Scene adaptive load prediction algorithm based on graph embedding

Through the scene adaptive load prediction algorithm based on graph embedding, using SCADA system and graph embedding technology, a scene encoding generator and prediction network are built, and the prediction accuracy problem of the load prediction model in extreme weather and holidays is solved, achieving higher accuracy and stability.

CN120258191APending Publication Date: 2025-07-04STATE GRID SHANDONG ELECTRIC POWER CO
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202510187157.8
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-02-20
Publication Date
2025-07-04

AI Technical Summary

Technical Problem

The existing load prediction model is difficult to adapt to the complexity and diversity of power consumption loads under the influence of various factors, resulting in a decrease in prediction accuracy. Especially in special scenarios such as extreme weather and holidays, the scarce amount of data leads to small sample problems and overfitting problems, and the general scenario division standards are difficult to define.

Method used

By constructing a scene adaptive load prediction algorithm based on graph embedding, the SCADA system is used to collect data, calculate the similarity between samples, construct a similarity matrix and a Laplace matrix, build a scene encoding generator and prediction network, jointly train a scene encoding generator and prediction network, optimize the scene encoding library, and reduce prediction errors.

Benefits of technology

It improves the generalization ability and prediction accuracy of the model in different scenarios, avoids small sample problems, enhances the adaptability and robustness of the model to changes in complex scenarios, and ensures the accuracy and stability of the prediction.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120258191A_ABST
    Figure CN120258191A_ABST
Patent Text Reader

Abstract

The invention relates to the technical field of graph neural networks, in particular to a scene adaptive load prediction algorithm based on graph embedding. The method comprises the following steps: S1, collecting and arranging power grid load, weather and date related data through an SCADA system, and forming a sample by taking a day as a unit; s2, introducing a power grid load variable to calculate continuous and discrete feature similarity between samples to construct a similarity matrix, and generating a Laplacian matrix to represent a relationship between the samples; s3, constructing a scene code generator, and ensuring that the actual similarity between the scene code and the sample is matched based on the scene code generator; s4, constructing a prediction network composed of a feature converter and a prediction generator; s5, training a scene coding generator and a prediction network at the same time, and optimizing a scene coding library by minimizing a prediction error; and S6, considering fitting errors, graph regular terms and entropy minimization, and adjusting network parameters and a scene coding library to realize reduction of load prediction errors.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of graph neural networks, and more specifically, to a scene adaptive load prediction algorithm based on graph embedding. Background Art

[0002] The scene adaptive load prediction algorithm based on graph embedding is an advanced prediction technology that combines knowledge of graph theory, machine learning, and power system engineering, aiming to improve the accuracy of power load prediction by analyzing the power grid structure and its dynamic characteristics. The algorithm first models the power network as a graph, where each node in the power grid (such as a power generation station, a substation, or a user) is represented as a vertex of the graph, and the connecting lines between the nodes are represented as edges. Then, graph embedding technology is used to convert this complex graph structure into a representation form in a low-dimensional vector space, and these vectors can capture the relationships between nodes and the topological features of the entire network.

[0003] With the continuous development of the power system and the increasing demand for intelligence, accurate electricity load prediction has become increasingly important. Electricity load prediction not only helps the stable operation of the power system, but also can optimize resource allocation, improve energy utilization efficiency, and reduce operating costs. However, high-precision load prediction faces many challenges. First, the electricity load is affected by various factors, including weather conditions, seasonal changes, holidays, social and economic activities, etc. These factors result in highly complex and diverse load data. For example, on weekends and holidays, people's electricity consumption behaviors are significantly different from those on weekdays; during extreme high temperatures or cold snaps, the use of air conditioners and heating equipment will cause the load to rise or fall sharply. These different scenarios make it difficult for a single model to accurately capture the load change rules in all situations. Second, the electricity load data under different scenarios often shows different distribution characteristics. For example, the electricity consumption peaks in summer and winter are different in terms of time and intensity. This data distribution shift poses a great challenge to traditional load prediction models. If the model cannot adapt to these different data distributions, its prediction accuracy will drop significantly. Directly processing different scenarios or different distribution data separately will bring new problems. First, for some special scenarios, the amount of data is very scarce, such as transitional weather and extreme high temperatures, and their data volume accounts for a very limited proportion in a year. Directly taking out this part of the data for training will lead to the small sample problem, and the model will face a serious overfitting problem. Second, it is difficult to define a general scenario division standard. Different division standards have a great impact on the model, and at the same time, it will exacerbate the above-mentioned small sample problem. Therefore, a scene adaptive load prediction algorithm based on graph embedding is provided. Summary of the Invention

[0004] The object of the present invention is to provide a scenario - adaptive load forecasting algorithm based on graph embedding to solve the problems proposed in the above - mentioned background technology. The electricity load is affected by various factors, including weather conditions, seasonal changes, holidays, social and economic activities, etc. These factors result in highly complex and diverse load data. For example, on weekends and holidays, people's electricity consumption behaviors are significantly different from those on weekdays; during extreme high - temperature or cold - wave periods, the use of air - conditioners and heating equipment will cause the load to rise or fall sharply. These different scenarios make it difficult for a single model to accurately capture the load change rules in all situations. Secondly, the electricity load data under different scenarios often show different distribution characteristics. For example, the electricity consumption peaks in summer and winter are different in terms of time and intensity. This data distribution shift poses a huge challenge to traditional load forecasting models. If the model cannot adapt to these different data distributions, its forecasting accuracy will drop significantly. Directly processing different scenarios or different - distributed data separately will bring new problems. First, for some special scenarios, the amount of data is very scarce, such as transitional weather and extreme high - temperature. The proportion of this part of the data in a year is very limited. Directly taking out this part of the data for training will lead to the small - sample problem, and the model will face serious over - fitting problems. Secondly, it is difficult to define a general scenario - division standard, and different division standards have a greater impact on the model.

[0005] To achieve the above object, the present invention aims to provide a scenario - adaptive load forecasting algorithm based on graph embedding, including the following steps: S1. Collect and organize the grid load, meteorological and date - related data through the SCADA system, and form samples on a daily basis; S2. Introduce grid - load variables to calculate the continuous and discrete feature similarities between samples to construct a similarity matrix, and generate a Laplacian matrix to represent the relationship between samples; S3. Construct a scenario - encoding generator to ensure that the scenario encoding matches the actual similarity between samples based on the scenario - encoding generator; S4. Construct a prediction network composed of a feature transformer and a prediction generator; S5. Train the scenario - encoding generator and the prediction network simultaneously by minimizing the prediction error and optimizing the scenario - encoding library; S6. Consider the fitting error, graph regularization term, and entropy minimization, adjust the network parameters and the scenario - encoding library to reduce the load - forecasting error.

[0006] As a further improvement of this technical solution, in step S1, the specific steps involved in collecting and organizing the grid load, meteorological and date - related data and forming samples on a daily basis are as follows: S1.1. Determine the types of data to be collected; S1.2. Select the REST API data interface to obtain data according to the type of the SCADA system; S1.3. Use the interpolation method to check for missing values in the data, and use the Z-score standard method to detect and correct outliers; S1.4. Aggregate the sorted data into a single sample by day.

[0007] As a further improvement of this technical solution, in S2, the specific process of introducing the grid load variable to calculate the similarity of continuous and discrete features between samples and generating the Laplacian matrix to represent the relationship between samples is as follows: S2.1. Calculate the similarity of continuous features between samples according to the features of each sample; Among them, the specific process of calculating the similarity of continuous features between samples is as follows: For two samples and , their L2 distance is expressed as: ; Among them, represents the L2 distance between the th sample and the th sample; represents the set of continuous features; represents the value of the th sample on the th continuous feature; represents the value of the th sample on the th continuous feature; S2.2. Calculate the similarity of discrete features between samples according to the features of each sample; Among them, the specific process of calculating the similarity of discrete features between samples is as follows: For two samples and , their similarity is calculated by verifying whether they belong to the same type: ; Among them, represents the set of discrete features; represents the value of the th sample on the th discrete feature; represents the value of the th sample on the th discrete feature; represents the th sample and the The original discrete feature similarity between samples; Indicates an instruction calculation to determine whether two values are equal; S2.3. Considering the impact of grid load variables on the accuracy of similarity, introduce grid load variables to optimize it: The continuous feature similarity after introducing grid load variables is: ; Among them, Represents the th sample and the th sample, the optimized L2 distance after introducing grid load variables; Represents the grid load value of the th sample; Represents the grid load value of the th sample; Convert the L2 distance to similarity and use the Gaussian kernel function: ; Among them, Represents the decay rate of controlling similarity; Represents the th sample and the th sample, the continuous feature similarity between them; Represents the exponential operation; The discrete feature similarity after introducing grid load variables is: ; Among them, Represents the grid load category of the th sample; The th sample's grid load category; Represents the th sample and the th sample, the optimized discrete feature similarity after introducing grid load variables between them; S2.4. Construct a comprehensive similarity matrix ; Among them, the comprehensive similarity matrix is: Combine the similarities of continuous and discrete features to construct a comprehensive similarity matrix : ; Among them, Represents the comprehensive similarity matrix; S2.5. Construct the Laplacian matrix ; Among them, the Laplacian matrix is: ; Among them, represents a diagonal matrix.

[0008] As a further improvement of this technical solution, in S3, a scene encoding generator is constructed to ensure that the scene encoding matches the actual similarity between the samples based on the scene encoding generator. The scene encoding generator includes a feature extractor, a scene projector, and a scene encoding library; Among them, the feature extractor is used to input all the features of a sample and convert all the features into a group of high-dimensional feature vectors; The scene projector is used to reduce the dimension of the high-dimensional feature vectors generated by the feature extractor and map them into a predefined scene space to obtain a scene encoding; The scene encoding library is used to search for the newly generated scene encoding and find the most similar historical scene encoding as the matching result.

[0009] As a further improvement of this technical solution, the specific construction process involved in constructing the scene encoding generator is as follows: The feature extractor is a multi-layer MLP, and its input is the meteorological features of a sample. Here, the meteorological features are flattened into a vector and input into the feature extractor; Among them, the meteorological features include temperature, perceived temperature, humidity, wind speed, precipitation, irradiance, and cloud cover; That is: ; Among them, represents the feature vector extracted by the feature extractor on the th sample; represents the feature extractor; represents the feature concatenation operation; represents the th feature of the th sample; The scene projector is a single-layer linear layer stacked with a softmax activation function, that is, the feature is projected to obtain the indication vector of the scene encoding; ; ; Among them, represents the indication vector of the scene encoding of the th sample; represents the indication vector of the scene encoding of the th sample belonging to the th category; Represents the vector after linear transformation; Represents the th element after linear transformation; Represents the number of categories; Represents the category index variable; Represents the index variable; When classifying the sample feature vector in the temperature scenario, considering that the temperature will affect the output of the scenario encoding, a temperature variable is introduced to control the output distribution of the Softmax function and adjust the sharpness of the scenario encoding; ; Among them, Represents the scenario encoding indicator vector introducing the temperature variable; Represents the temperature variable; The final scenario encoding vector is equal to: ; Among them, Represents the th final scenario encoding vector of the sample; Represents the scenario encoding library matrix; The optimization objective function is used to match the scenario encoding vector with the manually corresponding similarity map; ; Among them, Represents the optimization objective function; Represents the matrix composed of the scenario encoding indicator vectors of all samples; Represents the inverse matrix of the Laplacian matrix; Represents the trace of the matrix; Represents the transpose of the matrix.

[0010] As a further improvement of this technical solution, in the S4, the specific construction process of the prediction network is as follows: The prediction network is divided into two parts. The first part is the feature transformer, and the second part is the prediction generator; The feature transformer receives the output of the feature extractor and further transforms the features: ; Among them, Represents the th intermediate feature of the sample after being transformed by the feature transformer; Represents the processing of the feature transformer; Finally, the prediction generator combines the output of the scenario generator and the output of the feature transformer to give the final prediction: ; Among them, Indicates the final prediction result of the th sample; Indicates the processing by the prediction generator.

[0011] As a further improvement of this technical solution, in the S5, the scene encoding generator and the prediction network are trained simultaneously. The specific process of minimizing the prediction error and optimizing the scene encoding library is as follows: Compare the predicted load with the measured load, and the fitting error of the data can be obtained: ; Among them, Indicates the reconstruction loss; Indicates the predicted value; Indicates the true value; Update the scene encoding library by optimizing the objective function; ; Among them, Indicates the updated scene encoding library matrix at the th iteration; Indicates the scene encoding library matrix at the th iteration; Indicates the learning rate; Indicates the gradient of the objective function with respect to the scene encoding library matrix .

[0012] As a further improvement of this technical solution, in the S6, considering the fitting error, the graph regularization term, and the entropy minimization, the specific process of adjusting the network parameters and the scene encoding library to reduce the load prediction error is as follows: Minimize the entropy of the scene indicator vector over the entire dataset: ; Among them, Indicates the entropy loss; Indicates taking the natural logarithm of ; Simultaneously minimize the fitting error of the network, the graph regularization objective function, and the entropy of the scene encoding vector to obtain the overall objective function of the entire training network: ; Among them, Indicates the overall objective function; Indicates the weight controlling the graph regularization term; Indicates the weight of the entropy loss; Update the scene encoding library according to the overall objective function; ; Among them, It represents the updated scenario encoding library matrix at the th iteration after introducing the overall objective function.

[0013] Compared with the prior art, the beneficial effects of the present invention are as follows: 1. In the scenario adaptive load forecasting algorithm based on graph embedding, the data is sorted by day to form time series samples. Each sample contains the load data, meteorological conditions, and date features of the day, ensuring that the model can capture daily periodicity and seasonal variations. By calculating the similarity between samples (including continuous and discrete features), a similarity matrix is constructed. This matrix reflects the similarity relationship between samples and helps the model capture the internal connections between different samples. The scenario encoding generator maps high-dimensional features to a low-dimensional space, reducing the complexity of the model while retaining the similarity information between samples. This helps improve the computational efficiency and generalization ability of the model.

[0014] 2. In the scenario adaptive load forecasting algorithm based on graph embedding, the prediction network not only depends on the original features but also combines the scenario encoding information. By introducing the scenario encoding generator, the data of different scenarios are processed separately, enabling each scenario's data to learn the optimal solution. Moreover, the scenario encoding method avoids data segmentation and the small sample problem of some scenarios, enhancing the generalization ability of the model in each scenario.

[0015] Meanwhile, through the multi-modal fusion method, the model can understand samples from multiple perspectives, improving the prediction accuracy. By training the scenario encoding generator and the prediction network simultaneously, the model can optimize the prediction error while ensuring the quality of the scenario encoding. This joint training method enables the two modules to promote each other and jointly improve the overall performance. By considering the fitting error, graph regularization term, and entropy loss simultaneously, the model can be optimized in multiple aspects to ensure the best balance among prediction accuracy, similarity preservation, and certainty. BRIEF DESCRIPTION OF THE DRAWINGS

[0016] Figure 1 It is the overall method flowchart of the present invention. DETAILED DESCRIPTION OF THE EMBODIMENTS

[0017] The technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings in the embodiments of the present invention. Obviously, the described embodiments are only a part of the embodiments of the present invention, rather than all the embodiments. All other embodiments obtained by those of ordinary skill in the art based on the embodiments of the present invention without creative efforts shall fall within the protection scope of the present invention.

[0018] Embodiment: Please refer to Figure 1As shown in the figure, this embodiment provides a scenario - adaptive load prediction algorithm based on graph embedding, including the following steps: S1. Collect and organize the data related to grid load, meteorology, and date through the SCADA system, and form samples on a daily basis; In this example, the specific steps involved in collecting and organizing the data related to grid load, meteorology, and date and forming samples on a daily basis are as follows: S1.1. Determine the types of data to be collected; Specifically, the types of data to be collected include grid load (such as total load, sub - regional load), meteorological data (temperature, humidity, wind speed, precipitation, irradiance, etc.), and date - related data (year, time of day, whether it is a weekend, holiday, etc.).

[0019] S1.2. Select the REST API data interface to obtain data according to the type of the SCADA system; Specifically, REST API (Representational State Transfer Application Programming Interface) is a design style of network application programming interface based on the HTTP protocol. It allows different systems to communicate through standard URLs and HTTP methods (such as GET, POST, PUT, DELETE). REST API usually returns structured data formats, such as JSON or XML, enabling the client to easily request and operate on the resources on the server side without knowing the internal implementation details. Its stateless feature means that each request is processed independently, simplifying the scalability and maintainability of the system.

[0020] S1.3. Use the interpolation method to check for missing values in the data and use the Z - score standard method to detect and correct outliers; In this example, the process involved in using the interpolation method to check for missing values in the data and using the Z - score standard method to detect and correct outliers is as follows: Process missing values through the interpolation method: ; Among them, represents the load value at time point ; represents the actually measured load value at the adjacent time point before time point ; represents the actually measured load value at the adjacent time point after time point ; represents the timestamp in the time series; Denote the sample index; Given a set of load data , calculate the mean and standard deviation of each data point; ; ; Among them, denotes the load data set containing observation points, and each represents the load value measured at the time point ; denotes the mean of the load data ; denotes the standard deviation of the load data ; denotes the total number of samples; For each data point , calculate the Z-score; ; Among them, denotes the Z-score of the data point ; When , then it is considered that is an outlier; For the outlier, replace it with the mean ; ; Among them, denotes the predefined threshold; denotes the processed data point .

[0021] Specifically, by ensuring the integrity and consistency of the data, it provides high-quality input for subsequent feature extraction, similarity matrix construction, scenario encoding generation, and ultimately load prediction, significantly improving the performance and reliability of the entire model.

[0022] S1.4. Aggregate the sorted data into a single sample by day.

[0023] In this example, the process of aggregating the sorted data into a single sample by day is as follows: For each day , there are measurement points in a day ; Then calculate the daily average load: ; Among them, denotes the The daily average load for day indicating the th day; indicating the index of the number of days; indicating the number of measurements taken within the th day; indicating the load value at the th measurement on the th day; indicating the number of the measurement point on that day; Total daily load: ; where indicates the total daily load for the th day; Daily maximum load: ; where indicates the daily maximum load for the th day; Daily minimum load: ; where indicates the daily minimum load for the th day.

[0024] Specifically, this step extracts the load pattern and key statistical information for each day by calculating the average load, total load, maximum load, and minimum load of each day, providing a concise and effective input for subsequent modeling. This not only reduces the dimensionality of the data, lowers the complexity of the model, but also retains the periodic and trend characteristics of the load, enabling the model to better capture the daily cycle variation law and improve the accuracy and stability of the prediction.

[0025] S2. Introduce grid load variables to calculate the similarity of continuous and discrete features between samples to construct a similarity matrix, and generate a Laplacian matrix to represent the relationship between samples; In this example, the specific process involved in introducing grid load variables to calculate the similarity of continuous and discrete features between samples to construct a similarity matrix and generate a Laplacian matrix to represent the relationship between samples is as follows: S2.1. Calculate the similarity of continuous features between samples according to the features of each sample; Among them, the specific process of calculating the similarity of continuous features between samples is as follows: For two samples and , their L2 distance is expressed as: ; where Denote the L2 distance between the -th sample and the -th sample; Denote the set of continuous features; Denote the value of the -th sample on the -th continuous feature; Denote the value of the -th sample on the -th continuous feature; S2.2. Calculate the similarity of discrete features between samples according to the features of each sample; Among them, the specific process of calculating the similarity of discrete features between samples is as follows: For two samples and , their similarity is calculated by verifying whether they belong to the same type: ; Among them, Denote the set of discrete features; Denote the value of the -th sample on the -th discrete feature; Denote the value of the -th sample on the -th discrete feature; Denote the original discrete feature similarity between the -th sample and the -th sample; Denote the indication calculation to judge whether two values are equal; S2.3. Considering the influence of grid load variables on the accuracy of similarity, introduce grid load variables to optimize it: The similarity of continuous features after introducing grid load variables is: ; Among them, Denote the optimized L2 distance between the -th sample and the -th sample after introducing grid load variables; Denote the grid load value of the -th sample; Denote the grid load value of the -th sample; Convert the L2 distance to similarity using the Gaussian kernel function: ; Among them, Denote the attenuation rate of controlling similarity; Represents the continuous feature similarity between the th sample and the th sample; Represents exponentiation; The discrete feature similarity after introducing the power grid load variable is: ; Where, Represents the power grid load category of the th sample; The th sample's power grid load category; Represents the optimized discrete feature similarity between the th sample and the th sample after introducing the power grid load variable; Specifically, by calculating the L2 distance and introducing the power grid load variable, the model can more accurately measure the continuous feature differences between samples, especially the impact of the key variable of power grid load. This helps to capture the subtle changes in the load pattern and improve the prediction accuracy of the model. Using the Gaussian kernel function to convert the distance into similarity makes the similarity distribution smoother, avoids the problem of sharp decline in similarity when the distance is too large, and enhances the robustness of the model.

[0026] By verifying whether the samples belong to the same type, the model can accurately capture the matching of discrete features, especially the impact of the power grid load category. This helps to identify samples with similar characteristics and enhance the classification ability of the model. After introducing the power grid load category, the similarity calculation not only considers the matching of other discrete features but also the matching of the load category, making the similarity expression more comprehensive and accurate.

[0027] S2.4. Construct the comprehensive similarity matrix ; Where, the comprehensive similarity matrix is: Combine the similarities of continuous features and discrete features to construct a comprehensive similarity matrix : ; Where, Represents the comprehensive similarity matrix; Specifically, by combining the similarities of continuous features and discrete features, the model can comprehensively capture the complex relationships between samples, considering both the differences in numerical features and the matching of category features. This enables the model to better understand the internal connections between samples and improve the prediction accuracy. The comprehensive similarity matrix provides the basis for subsequent graph embedding, helping the model to learn in the graph space and retain the local and global similarities between samples.

[0028] S2.5. Construct the Laplacian matrix ; Among them, the Laplacian matrix is: ; Among them, represents the diagonal matrix.

[0029] Specifically, the Laplacian matrix is used to represent the topological structure between samples, reflecting the similarity and connection relationship between samples. It plays a key role in graph embedding, helping the model maintain the similarity relationship between samples and ensuring that similar samples have similar encodings in the graph space. By minimizing this regularization term, the model can maintain the similarity between samples in the scenario space, avoid overfitting, and enhance the generalization ability.

[0030] S3. Construct a scenario encoding generator to ensure that the scenario encoding matches the actual similarity between samples based on the scenario encoding generator; In this example, a scenario encoding generator is constructed to ensure that the scenario encoding matches the actual similarity between samples based on the scenario encoding generator. The scenario encoding generator includes a feature extractor, a scenario projector, and a scenario encoding library; Among them, the feature extractor is used to input all the features of a sample and convert all the features into a set of high-dimensional feature vectors; The scenario projector is used to reduce the dimension of the high-dimensional feature vectors generated by the feature extractor and map them into a predefined scenario space to obtain the scenario encoding; The scenario encoding library is used to search for the newly generated scenario encoding and find the most similar historical scenario encoding as the matching result.

[0031] Specifically, in the scenario adaptive load prediction algorithm based on graph embedding, the role of the scenario encoding generator is to convert the complex features of each sample into a compact and semantically meaningful scenario encoding. The original features are mapped into high-dimensional feature vectors through the feature extractor, then reduced in dimension and mapped into a predefined scenario space by the scenario projector, and finally the scenario encoding library is used to find the historical scenario encoding most similar to the current scenario. This process ensures that the new scenario encoding can accurately reflect the actual similarity between samples, thereby helping the model capture the load patterns under different scenarios and improving the accuracy and robustness of the prediction. In short, the scenario encoding generator enables the model to make more accurate load predictions based on similar historical situations when facing new inputs by learning and matching historical scenarios.

[0032] In this example, the specific construction process involved in constructing the scenario encoding generator is as follows: The feature extractor is a multi-layer MLP, whose input is the meteorological features of a sample. Here, the meteorological features are flattened into a vector and input into the feature extractor; Among them, the meteorological features include temperature, perceived temperature, humidity, wind speed, precipitation, irradiance, cloud cover; The scene encoding generator matches and classifies features such as temperature, perceived temperature, humidity, wind speed, precipitation, irradiance, and cloud cover, and generates a temperature prediction scene, a perceived temperature prediction scene, a humidity prediction scene, a wind speed prediction scene, a precipitation prediction scene, an irradiance prediction scene, and a cloud cover prediction scene respectively; That is: ; Among them, represents the feature vector extracted by the feature extractor on the th sample; represents the feature extractor; represents the feature concatenation operation; represents the th feature of the th sample; The scene projector is a single-layer linear layer stacked with a softmax activation function, that is, the feature is projected to obtain the indicator vector of the scene encoding; ; ; Among them, represents the indicator vector of the scene encoding of the th sample; represents the indicator vector of the scene encoding of the th sample belonging to the th class; represents the vector after linear transformation; represents the th element after linear transformation; represents the number of classes; represents the class index variable; represents the index variable; When classifying the sample feature vector for the temperature scene, considering that the temperature will affect the output of the scene encoding, a temperature variable is introduced to control the output distribution of the Softmax function and adjust the sharpness of the scene encoding; ; Among them, represents the indicator vector of the scene encoding with the temperature variable introduced; represents the temperature variable; When When it is larger, the Softmax distribution is smoother and the probabilities of each category are closer; When is smaller, the Softmax output is sharper and the larger activation values will dominate; Specifically, in humidity, wind speed, precipitation, and irradiance, the output distribution of the Softmax function is also controlled by respective independent variables to adjust the sharpness of the scene encoding; Humidity: Introduce the humidity variable to control the output distribution of the Softmax function: ; Among them, represents the scene encoding indication vector considering the influence of humidity; represents the humidity variable, which is used to adjust the sharpness of the output distribution.

[0033] Wind speed: Introduce the wind speed variable to control the output distribution of the Softmax function: ; Among them, represents the scene encoding indication vector considering the influence of wind speed; represents the wind speed variable, which is used to adjust the sharpness of the output distribution.

[0034] Apparent temperature: Introduce the apparent temperature variable to control the output distribution of the Softmax function: ; Among them, represents the scene encoding indication vector considering the influence of apparent temperature; represents the apparent temperature variable, which is used to adjust the sharpness of the output distribution; Precipitation: Introduce the precipitation variable to control the output distribution of the Softmax function: ; Among them, represents the scene encoding indication vector considering the influence of precipitation; represents the precipitation variable, which is used to adjust the sharpness of the output distribution.

[0035] Irradiance: Introduce the irradiance variable to control the output distribution of the Softmax function: ; Among them, represents the scene coding indication vector considering the influence of irradiance; represents the irradiance variable, which is used to adjust the sharpness of the output distribution.

[0036] Cloud cover: Introduce the cloud cover variable to control the output distribution of the Softmax function: ; Among them, represents the scene coding indication vector considering the influence of cloud cover; represents the cloud cover variable, which is used to adjust the sharpness of the output distribution; The final scene coding vector is equal to: ; Among them, represents the th final scene coding vector of the sample; represents the scene coding library matrix; The optimization objective function is used to match the scene coding vector with the manually corresponding similarity map; ; Among them, represents the optimization objective function; represents the matrix composed of the scene coding indication vectors of all samples; represents the inverse matrix of the Laplacian matrix; represents the trace of the matrix; represents the transpose of the matrix.

[0037] Specifically, in the scene adaptive load prediction algorithm based on graph embedding, the specific process of constructing the scene coding generator is to convert all features of each sample into high-dimensional feature vectors through a multi-layer perceptron (MLP) feature extractor, and then map these feature vectors to a predefined scene space through a single-layer linear transformation (scene projector) with a temperature-adjusted softmax activation function to generate a scene coding indication vector. Finally, the final scene coding vector of each sample is obtained by multiplying with the scene coding library matrix. This process ensures that the newly generated scene coding can accurately reflect the actual similarity between samples, and makes the scene coding match the manually defined similarity map structure as much as possible through the optimization objective function. Its core role is to capture and represent the inherent patterns of different load scenarios, enabling the model to make more accurate load predictions based on historical similar scenarios when facing new inputs, while improving the adaptability and robustness of the model to complex scene changes.

[0038] S4. Construct a prediction network consisting of a feature transformer and a prediction generator; In this example, the specific construction process of the prediction network is as follows: The prediction network is divided into two parts. The first part is the feature transformer, and the second part is the prediction generator; The feature transformer receives the output of the feature extractor and further transforms the features: ; Among them, represents the intermediate feature after the th sample is transformed by the feature transformer; represents the processing of the feature transformer; Finally, the prediction generator combines the output of the scenario generator and the output of the feature transformer to give the final prediction: ; Among them, represents the final prediction result of the th sample; represents the processing of the prediction generator.

[0039] Specifically, by introducing the feature transformer and the prediction generator, the model can process high-dimensional features while fully utilizing the scenario encoding information, improving the accuracy and robustness of the prediction. The feature transformer enhances the model's ability to capture complex feature patterns, while the prediction generator ensures that the model can make more accurate load predictions at different time scales and scenarios by combining feature and scenario information. This step provides a solid foundation for subsequent joint training and optimization, ensuring that the model can achieve high-precision load prediction in a complex power grid environment.

[0040] Furthermore, the final prediction generator combines the output of the scenario generator and the output of the feature transformer to give the final prediction, and its prediction results are respectively output by the temperature prediction module, the perceived temperature prediction module, the humidity prediction module, the wind speed prediction module, the precipitation prediction module, the irradiance prediction module, and the cloud cover prediction module; Temperature has a significant impact on power load. Especially in high-temperature summers or cold winters, the use of air conditioners and heating equipment will significantly increase the power load: ; Among them, represents the output of the temperature prediction module; represents the impact of temperature on the load; The perceived temperature combines factors such as temperature and humidity, more accurately reflecting the human perception of the environment, thus affecting electricity consumption behavior: ; Among them, Represents the output of the perceived temperature prediction module; Represents the impact of the perceived temperature on the load; Humidity can affect the perceived temperature, and thus affect the usage frequency of air conditioners and other electrical appliances. Especially in high-humidity environments, the dehumidification function of air conditioners will be frequently used: ; Among them, Represents the output of the humidity prediction module; Represents the impact of humidity on the load; Wind speed can indirectly affect the power load by influencing the heat preservation effect of buildings. Strong wind weather may lead to more heating or ventilation requirements: ; Among them, Represents the output of the wind speed prediction module; Represents the impact of wind speed on the load; Precipitation usually leads to an increase in indoor activities, which may increase the usage frequency of lighting and electrical appliances; at the same time, rainy days may reduce outdoor activities, resulting in an increase in the electricity consumption of some commercial facilities (such as shopping malls, cinemas, etc.): ; Among them, Represents the output of the precipitation prediction module; Represents the impact of precipitation on the load; Irradiance directly affects solar power generation, and thus affects the power grid load. Under high irradiance conditions, the solar power generation increases, which can relieve the power supply pressure of the power grid: ; Among them, Represents the output of the irradiance prediction module; Represents the impact of irradiance on the load; Cloud cover can affect the solar radiation intensity, thereby indirectly affecting solar power generation. Cloudy weather will reduce the solar power generation efficiency and increase the power supply burden of the power grid: ; Among them, Represents the output of the cloud cover prediction module; Represents the impact of cloud cover on the load; S5. At the same time, train the scenario encoding generator and the prediction network by minimizing the prediction error and optimizing the scenario encoding library; In this example, the specific process of training the scenario encoding generator and the prediction network simultaneously by minimizing the prediction error and optimizing the scenario encoding library is as follows: Compare the predicted load with the measured load, and then obtain the fitting error of the data: ; wherein, represents the reconstruction loss; represents the predicted value; represents the true value; update the scene encoding library by optimizing the objective function; ; wherein, represents the scene encoding library matrix after update at the -th iteration; represents the scene encoding library matrix at the -th iteration; represents the learning rate; represents the gradient of the objective function with respect to the scene encoding library matrix

[0041] Specifically, in the scene adaptive load forecasting algorithm based on graph embedding, the specific process of simultaneously training the scene encoding generator and the prediction network optimizes the prediction performance of the model by minimizing the prediction error (reconstruction loss), and ensures the matching of the actual similarity between the scene encoding and the samples by updating the scene encoding library. This joint training process not only improves the fitting accuracy of the model to the load data, but also enhances the adaptability and robustness of the model to different scene changes, enabling the model to make more accurate load predictions based on historical similar scenes when facing new inputs, thereby improving the overall prediction accuracy and reliability. In short, this step ensures that the model can accurately predict the load and effectively capture and utilize the internal patterns of different scenes by jointly optimizing the prediction error and the scene encoding library; Preferably, the scene encoding generator and the prediction network are mainly integrated into the power load forecasting system. Through the scene encoding generator, the model can dynamically adapt to the data distribution of different scenes, avoiding the decline in prediction accuracy caused by fuzzy scene division or data distribution shift in traditional models. As the front-end module of the system, the scene encoding generator is responsible for dynamically generating scene encodings according to the input meteorological features (such as temperature, felt temperature, humidity, wind speed, precipitation, irradiance, cloud cover), and combining with the prediction network to receive the scene encoding and sample features, outputting high-precision load prediction results, and docking with the existing data systems of power companies (such as SCADA systems, meteorological data platforms, user electricity consumption information collection systems) to obtain input data in real time and output prediction results.

[0042] S6. Consider the fitting error, graph regularization term, and entropy minimization, adjust the network parameters and the scene encoding library, and achieve reducing the load prediction error.

[0043] In this example, considering the fitting error, graph regularization term, and entropy minimization, the specific process of adjusting the network parameters and scenario encoding library to reduce the load prediction error is as follows: Minimize the entropy of the scenario indicator vector over the entire dataset: ; where, represents the entropy loss; represents taking the natural logarithm of ; Simultaneously minimize the fitting error of the network, the graph regularization objective function, and the entropy of the scenario encoding vector to obtain the overall objective function of the entire training network: ; where, represents the overall objective function; represents the weight controlling the graph regularization term; represents the weight of the entropy loss; Update the scenario encoding library according to the overall objective function; ; where, represents the updated scenario encoding library matrix at the -th iteration after introducing the overall objective function.

[0044] Specifically, by comprehensively considering the fitting error, graph regularization term, and entropy minimization, the network parameters and scenario encoding library are adjusted to reduce the load prediction error. Specifically, this step introduces an entropy loss to minimize the uncertainty of the scenario indicator vector over the entire dataset, ensuring that each sample can be clearly assigned to the most similar historical scenario, and avoiding the problem of scenario encoding collapse. At the same time, combining the fitting error and the graph regularization term, an overall objective function is constructed, and the scenario encoding library and network parameters are updated by optimizing this objective function. This process not only improves the prediction accuracy of the model for load data, but also enhances the adaptability and robustness of the model to different scenario changes, ensuring that the model can effectively capture and utilize the patterns in historical scenarios, thereby achieving more accurate and stable load prediction. In short, step S6 ensures the best balance among prediction accuracy, scenario representation consistency, and diversity through multi-objective optimization, improving the overall performance.

[0045] The above shows and describes the basic principles, main features, and advantages of the present invention. Those skilled in the art should understand that the present invention is not limited by the above embodiments. The above embodiments and descriptions in the specification are only preferred examples of the present invention and are not used to limit the present invention. Without departing from the spirit and scope of the present invention, the present invention will have various changes and improvements, and these changes and improvements all fall within the scope of the present invention claimed.

Claims

1. A scenario adaptive load forecasting algorithm based on graph embedding, characterized in that: It includes the following steps: S1. Collect and organize the data related to grid load, meteorology, and date through the SCADA system, and form samples on a daily basis; S2. Introduce grid load variables to calculate the similarity of continuous and discrete features between samples to construct a similarity matrix, and generate a Laplacian matrix to represent the relationship between samples; S3. Construct a scene encoding generator, and ensure that the scene encoding matches the actual similarity between samples based on the scene encoding generator; S4. Construct a prediction network composed of a feature transformer and a prediction generator; S5. Train the scene encoding generator and the prediction network simultaneously, and minimize the prediction error and optimize the scene encoding library; S6. Considering the fitting error, graph regularization term, and entropy minimization, adjust the network parameters and the scene encoding library to reduce the load prediction error.

2. The scenario adaptive load prediction algorithm based on graph embedding according to claim 1, characterized in that: In the above S1, the specific steps involved in collecting and organizing the data related to grid load, meteorology, and date, and forming samples on a daily basis are as follows: S1.

1. Determine the types of data to be collected; S1.

2. Select the REST API data interface to obtain data according to the type of SCADA system; S1.

3. Use the interpolation method to check whether there are missing values in the data, and use the Z-score standard method to detect and correct outliers; S1.

4. Summarize the sorted data into a single sample on a daily basis.

3. The scene adaptive load prediction algorithm based on graph embedding according to claim 1, characterized in that: In the above S2, the specific process involved in introducing grid load variables to calculate the similarity of continuous and discrete features between samples to construct a similarity matrix, and generating a Laplacian matrix to represent the relationship between samples is as follows: S2.

1. Calculate the similarity of continuous features between samples according to the features of each sample; Among them, the specific process of calculating the similarity of continuous features between samples is as follows: For two samples and , the L2 distance between them is expressed as: ; Among them, represents the L2 distance between the -th sample and the -th sample; represents the set of continuous features; represents the value of the -th sample on the -th continuous feature; represents the value of the -th sample on the -th continuous feature; S2.

2. Calculate the similarity of discrete features between samples according to the features of each sample; Among them, the specific process of calculating the similarity of discrete features between samples is as follows: For two samples and , their similarity is calculated by verifying whether they belong to the same type: ; Among them, represents a set of discrete features; represents the th sample at the th discrete feature value; represents the th sample at the th discrete feature value; represents the original discrete feature similarity between the th sample and the th sample; represents an indication calculation to determine whether two values are equal; S2.

3. Considering that the grid load variable has an impact on the accuracy of similarity, introduce the grid load variable to optimize it: The similarity of continuous features after introducing the grid load variable is: ; Among them, represents the optimized L2 distance after introducing the grid load variable between the -th sample and the -th sample; represents the grid load value of the -th sample; represents the grid load value of the -th sample; Convert the L2 distance to similarity, and use the Gaussian kernel function: ; Among them, represents the attenuation rate of the control similarity; represents the th sample and the th sample's continuous feature similarity; represents the exponential operation; The similarity of discrete features after introducing the grid load variable is: ; Among them, represents the grid load category of the th sample; the grid load category of the th sample; represents the optimized discrete feature similarity after introducing the grid load variable between the th sample and the th sample; S2.

4. Construct the comprehensive similarity matrix ; Among them, the comprehensive similarity matrix is as follows: Combine the similarities of continuous features and discrete features to construct a comprehensive similarity matrix : ; Among them, represents the comprehensive similarity matrix; S2.

5. Construct the Laplacian matrix ; Among them, the Laplacian matrix is as follows: ; Among them, represents a diagonal matrix.

4. A scenario adaptive load prediction algorithm based on graph embedding according to claim 1, characterized in that: In the above S3, construct a scene encoding generator, and ensure that the scene encoding matches the actual similarity between samples based on the scene encoding generator. The scene encoding generator includes a feature extractor, a scene projector, and a scene encoding library; Among them, the feature extractor is used to input all the features of a sample and convert all the features into a group of high-dimensional feature vectors; The scene projector is used to reduce the dimension of the high-dimensional feature vectors generated by the feature extractor and map them into a predefined scene space to obtain the scene encoding; The scene encoding library is used to search for the newly generated scene encoding and find the most similar historical scene encoding as the matching result.

5. The scenario adaptive load prediction algorithm based on graph embedding according to claim 4, characterized in that: The specific construction process involved in constructing the scene encoding generator is as follows: The feature extractor is a multi-layer MLP, and its input is the meteorological features of a sample. Here, the meteorological features are flattened into a vector and input into the feature extractor; Among them, the meteorological features include temperature, perceived temperature, humidity, wind speed, precipitation, irradiance, and cloud cover; That is: ; Among them, represents the feature vector extracted by the feature extractor on the th sample; represents the feature extractor; represents the feature concatenation operation; represents the th feature of the th sample; The scene projector is a single-layer linear layer stacked with a softmax activation function, that is, features are projected to obtain the indicator vector of the scene encoding; ; ; Among them, represents the scenario encoding indication vector of the th sample; represents the scenario encoding indication vector that the th sample belongs to the th category; represents the vector after linear transformation; represents the th element after linear transformation; represents the number of categories; represents the category index variable; represents the index variable; When classifying the temperature scenario of the sample feature vector, considering that temperature will affect the output of the scenario encoding, a temperature variable is introduced to control the output distribution of the Softmax function and adjust the sharpness of the scenario encoding; ; Among them, represents the scenario coding indication vector introducing the temperature variable; represents the temperature variable; The final scenario encoding vector is equal to: ; Among them, represents the final scene encoding vector of the th sample; represents the scene encoding library matrix; Optimize the objective function to match the scenario encoding vector with the manually corresponding similarity map; ; Among them, represents the optimization objective function; represents the matrix composed of the scenario encoding indication vectors of all samples; represents the inverse matrix of the Laplacian matrix; represents the trace of the matrix; represents the transpose of the matrix.

6. The scenario adaptive load prediction algorithm based on graph embedding according to claim 1, wherein: In step S4, the specific construction process of the prediction network is as follows: The prediction network is divided into two parts. The first part is the feature transformer, and the second part is the prediction generator; The feature transformer receives the output of the feature extractor and further transforms the features: ; Among them, represents the intermediate feature after the th sample is transformed by the feature transformer; represents the processing by the feature transformer; Finally, the prediction generator combines the output of the scenario generator and the output of the feature transformer to give the final prediction: ; Among them, represents the final prediction result of the th sample; represents the processing by the prediction generator.

7. A scenario adaptive load forecasting algorithm based on graph embedding according to claim 1, characterized in that: In step S5, the specific process of simultaneously training the scenario encoding generator and the prediction network by minimizing the prediction error and optimizing the scenario encoding library is as follows: Compare the predicted load with the measured load, and the fitting error of the data can be obtained: ; Among them, represents the reconstruction loss; represents the predicted value; represents the true value; Update the scenario encoding library by optimizing the objective function; ; Among them, represents the updated scene coding library matrix at the -th iteration; represents the scene coding library matrix at the -th iteration; represents the learning rate; represents the gradient of the objective function with respect to the scene coding library matrix .

8. The scenario adaptive load prediction algorithm based on graph embedding according to claim 1, characterized in that: In step S6, considering the fitting error, graph regularization term, and entropy minimization, the specific process of adjusting the network parameters and the scenario encoding library to reduce the load prediction error is as follows: Minimize the entropy of the scenario indicator vector over the entire dataset: ; Among them, represents the entropy loss; represents taking the natural logarithm of; At the same time, minimize the fitting error of the network, the graph regularization objective function, and the entropy of the scenario encoding vector to obtain the overall objective function of the entire training network: ; Among them, represents the overall objective function; represents the weight of the control chart regularization term; represents the weight of the entropy loss; Update the scenario encoding library according to the overall objective function; ; Among them, represents the updated scenario encoding library matrix at the th iteration after introducing the overall objective function.