Automatic Response Method for Electricity Demand Based on Sub - item Energy Consumption Metering

Through the automatic response method of electricity consumption demand based on energy consumption sub-item measurement, and using technologies such as data preprocessing, feature extraction and clustering analysis, the power distribution strategy optimization problem of existing power demand response methods under variable power demand demand is solved, achieving more efficient and accurate grid load prediction and power scheduling.

CN119494523BActive Publication Date: 2025-06-20NANJING DEEPCTRLS TECHNOLOGIES CO LTD
View PDF 1 Cites 0 Cited by

Patent Information

Application Number
CN202510080913.7
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2025-01-20
Publication Date
2025-06-20
Estimated Expiration
2045-01-20

AI Technical Summary

Technical Problem

When facing variable power demand demand, it is difficult to achieve the optimal power distribution strategy, which affects the safe operation and resource utilization efficiency of the power grid.

Method used

The automatic response method for power consumption demand based on energy consumption sub-item measurement is adopted. By acquiring and preprocessing the historical load data of the power grid, the correlation coefficient and principal component analysis algorithm are used to extract features, perform cluster analysis, generate load prediction results, and optimize power load distribution through deep learning algorithms.

Benefits of technology

It improves the accuracy of grid load state prediction, helps to optimize power scheduling decisions, and meets the power consumption needs of power equipment or processes during special periods or under changing situations of power consumption demand.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119494523B_ABST
    Figure CN119494523B_ABST
Patent Text Reader

Abstract

An automatic response method for electricity demand based on sub-metering of energy consumption, the method comprising: obtaining historical grid load data, preprocessing and normalizing the historical grid load data to construct a data set. Extract features with a correlation degree exceeding a first threshold with the load value from the data set through the correlation coefficient, construct an original feature matrix based on the extracted features using principal component analysis, calculate a covariance matrix based on the original feature matrix to obtain a reduced-dimensional feature matrix. Calculate the total squared error for different numbers of clusters, determine the optimal number of clusters through the elbow method, and initialize the cluster centers using a clustering algorithm. Cluster the reduced-dimensional feature matrix based on the selected number of clusters and the initial cluster centers, and update and iterate the cluster centers until convergence. Project the future feature matrix into the reduced-dimensional feature space, calculate the distances from each future feature in the feature space to the cluster centroids, and assign the nearest cluster to output the load prediction result.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention belongs to the technical field of power dispatching, and more specifically, relates to an automatic response method for electricity demand based on sub-item energy consumption metering. Background Art

[0002] Power demand response is an important means to regulate the power supply and demand. Implementing demand response for virtual power plants such as end-users can, on the one hand, relieve the pressure on the power grid during peak periods and reduce the impact on the safe operation of the power grid; on the other hand, it can improve the operating efficiency of the power system, reduce unnecessary resource waste, so as to maximize the overall interests and enable the power generation system to operate efficiently, stably and safely.

[0003] Currently, in the process of power demand response dispatching for traditional power demand response methods, power dispatching for processes is mainly carried out according to the power consumption demands of the processes according to specific load patterns. It is difficult to predict the future variable possible power consumption demands, and thus it is difficult to take into account the optimal power distribution strategy in the case of more processes and variable power consumption demands, which to a certain extent affects the power consumption demands of processes or processes during special periods. Summary of the Invention

[0004] To solve the deficiencies in the prior art, the purpose of the present invention is to solve the above-mentioned defects, and further propose an automatic response method for electricity demand based on sub-item energy consumption metering.

[0005] The present invention adopts the following technical solutions.

[0006] The first aspect of the present invention discloses an automatic response method for electricity demand based on sub-item energy consumption metering, and the method includes:

[0007] Obtain historical power grid load data, and preprocess and standardize the historical power grid load data to construct a data set. The preprocessing includes missing value filling, outlier detection, and the construction of time features and rolling statistical features;

[0008] Select extraction features with a correlation degree exceeding the first threshold with the load value from the data set through the correlation coefficient, and construct an original feature matrix based on the extraction features by using the principal component analysis algorithm, so as to calculate the covariance matrix based on the original feature matrix and obtain a dimension-reduced feature matrix;

[0009] Calculate the total squared error of different numbers of clusters, determine the optimal number of clusters through the elbow method, and initialize the cluster centers by using the K-means clustering algorithm to obtain the selected optimal number of clusters and the initial cluster centers;

[0010] Perform K-means clustering on the dimension-reduced feature matrix based on the selected number of clusters and the initial cluster centers, and update and iterate the cluster centers until convergence to generate a clustering result;

[0011] Construct a future feature matrix, project the future feature matrix into the dimension-reduced feature space, calculate the distances from each future feature in the feature space to the cluster centroids, and assign the nearest cluster to output a load prediction result;

[0012] Among them, the grid historical load data includes timestamps, load values, temperature, humidity, and date features. The rolling statistical features are obtained by calculating the average load and standard deviation of the grid historical load data within the first historical time period. The future feature matrix is constructed based on the extracted temperature, humidity, and date features within the second future time period.

[0013] Further, the obtaining of the grid historical load data and the preprocessing and standardization of the grid historical load data to construct a data set include:

[0014] Use linear interpolation to fill in missing values to fill in the missing load values. The expression for filling in missing values is:

[0015]

[0016] In the formula, and are the load values at the previous and next moments respectively, is the missing load value;

[0017] Use the Z-score algorithm to detect outliers and obtain a set second threshold. When the result of the Z-score algorithm exceeds the second threshold, replace the load value corresponding to the result of the Z-score algorithm with the average value of the load values at adjacent moments. The expression for detecting outliers using the Z-score algorithm is.

[0018] Further, the obtaining of the grid historical load data and the preprocessing and standardization of the grid historical load data to construct a data set further include:

[0019] Extract time features from the grid historical load data. The time features include hours, weekdays, and holidays, and calculate the average load and standard deviation of the grid historical load data within the first historical time period to obtain the rolling statistical features;

[0020] Perform standardization processing on the numerical features in the grid historical load data through the Z-score algorithm. The expression for standardization processing using the Z-score algorithm is:

[0021]

[0022] In the formula, is the original numerical feature, is the numerical feature after standardization, and are the mean and standard deviation of the numerical feature respectively.

[0023] Furthermore, extracting features that have a correlation degree with the load value exceeding a first threshold from the dataset through a correlation coefficient, and constructing an original feature matrix based on the extracted features using a principal component analysis algorithm, so as to calculate a covariance matrix based on the original feature matrix to obtain a feature matrix after dimensionality reduction, including:

[0024] Selecting the extracted features that have a correlation degree with the load value exceeding the first threshold using a correlation coefficient algorithm, and the expression of the correlation coefficient algorithm is:

[0025]

[0026] In the formula, is the correlation coefficient between the load value and the extracted feature, is the covariance, and are the standard deviations of the load value and the extracted feature respectively;

[0027] Constructing an original feature matrix based on the extracted features through a principal component analysis algorithm, and calculating the covariance matrix corresponding to the original feature matrix;

[0028] Solving the eigenvalues and eigenvectors of the covariance matrix, sorting them according to the eigenvalue magnitudes to determine the principal component space, and projecting the original feature matrix onto the principal component space to obtain a feature matrix after dimensionality reduction.

[0029] Furthermore, calculating the total squared error of different numbers of clusters, determining the optimal number of clusters through the elbow method, and initializing the cluster centers using the K-means clustering algorithm to obtain the selected optimal number of clusters and the initial cluster centers, including:

[0030] Calculating the total squared error under different numbers of clusters to draw a relationship graph between the number of clusters and the total squared error, and selecting the number of clusters where the elbow is located as the optimal number of clusters;

[0031] Initializing the cluster centers through the K-means clustering algorithm to improve the clustering effect and convergence speed, and outputting the optimal number of clusters and the initial cluster centers;

[0032] Among them, the calculation expression of the total squared error is:

[0033]

[0034] Wherein, is the total squared error, is the number of clusters, is the i-th sample, is the k-th cluster, is the centroid of the k-th cluster.

[0035] Furthermore, performing K-means clustering on the dimension-reduced feature matrix based on the selected number of clusters and the initial cluster centers to update and iterate the cluster centers until convergence to generate a clustering result, including:

[0036] Calculating the Euclidean distance from each sample to the centroids of each cluster to assign it to the nearest cluster, and recalculating the centroid of each cluster. If the change in the centroid after recalculation is less than a preset convergence threshold, stop the iteration to obtain the trained clustering model;

[0037] Calculating the silhouette coefficient of each sample to evaluate the dispersion and compactness of the clustering process, and calculating the average of the silhouette coefficients of all samples based on the silhouette coefficient of each sample to obtain the average silhouette coefficient, which is used to evaluate the clustering effect;

[0038] Wherein, the trained clustering model is used to predict and output the load prediction result.

[0039] Furthermore, the load prediction result includes the grid load situation of the grid in the third future time period and the electricity consumption demands of each process, and the method further includes:

[0040] Based on the predicted grid load situation and the electricity consumption demands of each process, performing topological sorting on multiple processes through a deep learning algorithm to obtain multiple process topological sorting results for characterizing the dependency relationships and electricity consumption demands between different processes;

[0041] Based on the process topological sorting results, and in combination with the predicted grid load situation and the electricity consumption demands of each process, calling a deep learning algorithm to select the optimal topological sorting from multiple process topological sorting results to optimally allocate the power load to each process.

[0042] The second aspect of the present invention discloses an automatic power consumption demand response device, and the device includes:

[0043] A data preprocessing module, configured to obtain historical grid load data, and perform preprocessing and standardization on the historical grid load data to construct a data set, and the preprocessing includes missing value filling, outlier detection, and construction of time features and rolling statistical features;

[0044] A feature processing module, which is used to select extraction features with a correlation degree exceeding a first threshold with the load value from the dataset through a correlation coefficient, and construct an original feature matrix based on the extraction features by using a principal component analysis algorithm, so as to calculate a covariance matrix based on the original feature matrix and obtain a feature matrix after dimensionality reduction;

[0045] A clustering algorithm module, which is used to calculate the total squared error of different numbers of clusters, determine the optimal number of clusters through the elbow method, and initialize the cluster centers by using the K-means clustering algorithm to obtain the selected optimal number of clusters and the initial cluster centers;

[0046] An iterative clustering module, which is used to perform K-means clustering on the feature matrix after dimensionality reduction based on the selected number of clusters and the initial cluster centers, so as to update and iterate the cluster centers until convergence and generate a clustering result;

[0047] A load prediction module, which is used to construct a future feature matrix, project the future feature matrix into the feature space after dimensionality reduction, calculate the distances from each future feature in the feature space to the cluster centroids, and assign the nearest cluster to output a load prediction result;

[0048] Wherein, the historical power grid load data includes a timestamp, a load value, a temperature, a humidity, and a date feature. The rolling statistical feature is obtained by calculating the average load and the standard deviation of the historical power grid load data within a first historical time period. The future feature matrix is constructed based on the extracted temperature, humidity, and date features within a second future time period.

[0049] A third aspect of the present invention discloses a terminal, including a processor and a storage medium; characterized in that:

[0050] The storage medium is used to store instructions;

[0051] The processor is used to operate according to the instructions to execute the steps of the method described in the first aspect.

[0052] A fourth aspect of the present invention discloses a computer-readable storage medium, on which a computer program is stored, characterized in that when the program is executed by a processor, the steps of the method described in the first aspect are implemented.

[0053] The beneficial effects of the present invention are that, compared with the prior art, the present invention has the following advantages:

[0054] By obtaining the historical load data of the power grid and preprocessing and standardizing the historical load data of the power grid to construct a data set, the preprocessing includes missing value filling, outlier detection, and the construction of time features and rolling statistical features. Then, relevant features with a correlation degree exceeding a set threshold with the load value are selected from the data set through the correlation coefficient, and the principal component analysis algorithm is used to construct an original feature matrix based on the extracted features, so as to calculate the covariance matrix based on the original feature matrix and obtain a reduced-dimensional feature matrix. Subsequently, the total squared error of different numbers of clusters is calculated, and the optimal number of clusters is determined through the elbow method, and the K-means clustering algorithm is used to initialize the cluster centers to obtain the selected optimal number of clusters and the initial cluster centers. After that, K-means clustering is performed on the reduced-dimensional feature matrix based on the selected number of clusters and the initial cluster centers, and the cluster centers are updated and iterated until convergence to generate a clustering result. Finally, a future feature matrix is constructed, and the future feature matrix is projected into the reduced-dimensional feature space, and the distances from each future feature in the feature space to the cluster centroids are calculated, and the nearest cluster is assigned to output the load prediction result. This method analyzes the historical power grid load through an iterative clustering algorithm, can identify different load patterns, and then classifies and predicts the electricity consumption situation in a specific future time period, improves the accuracy of predicting the load state of the power grid in a future period of time, provides a basis for subsequent power dispatching decisions, and thus meets the electricity consumption needs of electrical equipment or processes in special periods or under the situation of changing electricity consumption demands. Description of the Drawings

[0055] Figure 1 is a schematic flowchart of an automatic response method for electricity demand based on sub-metering of energy consumption provided by the present invention. Detailed Embodiments

[0056] The following further describes the present application with reference to the drawings. The following embodiments are only used to more clearly illustrate the technical solutions of the present invention and cannot be used to limit the protection scope of the present application.

[0057] As Figure 1 shown, in one embodiment, an automatic response method for electricity demand based on sub-metering of energy consumption includes the following steps:

[0058] Step S110, obtain the historical load data of the power grid, and preprocess and standardize the historical load data of the power grid to construct a data set. The preprocessing includes missing value filling, outlier detection, and the construction of time features and rolling statistical features.

[0059] Among them, the historical load data of the power grid includes time stamps, load values, temperatures, humidities, and date features. The rolling statistical features are obtained by calculating the average load and standard deviation of the historical load data of the power grid in the first historical time period.

[0060] In some embodiments, the automatic power consumption demand response method based on energy consumption sub-item metering provided by the present invention obtains historical grid load data and preprocesses and standardizes the historical grid load data, specifically including the following steps:

[0061] Step S111, use the linear interpolation method to fill in the missing values to fill in the missing load values. The expression for filling in the missing values is:

[0062]

[0063] In the formula, and are the load values at the previous and subsequent moments respectively, is the missing load value.

[0064] Step S112, use the Z-score algorithm to detect outliers and obtain a set second threshold. When the result of the Z-score algorithm exceeds the second threshold, replace the load value corresponding to the result of the Z-score algorithm with the average value of the load values at adjacent moments. The expression for detecting outliers by the Z-score algorithm is.

[0065] In some embodiments, the automatic power consumption demand response method based on energy consumption sub-item metering provided by the present invention obtains historical grid load data and preprocesses and standardizes the historical grid load data, and specifically further includes the following steps:

[0066] Step S113, extract time features from the historical grid load data. The time features include hours, weekdays, and holidays, and calculate the average load and standard deviation of the historical grid load data within the first historical time period to obtain rolling statistical features.

[0067] Step S114, perform standardization processing on the numerical features in the historical grid load data through the Z-score algorithm. The expression for standardization processing by the Z-score algorithm is:

[0068]

[0069] In the formula, is the original numerical feature, is the standardized numerical feature, and are the mean and standard deviation of the numerical features respectively.

[0070] Step S120, select extraction features with a correlation degree exceeding the first threshold with the load value from the data set through the correlation coefficient, and use the principal component analysis algorithm to construct an original feature matrix based on the extraction features, so as to calculate the covariance matrix based on the original feature matrix to obtain a reduced-dimensional feature matrix.

[0071] In some embodiments, for the automatic power consumption demand response method based on energy consumption itemized metering provided by the present invention, correlation coefficients are used to select extraction features from a dataset whose correlation degree with the load value exceeds a first threshold, and a principal component analysis algorithm is used to construct an original feature matrix based on the extraction features, so as to calculate a covariance matrix based on the original feature matrix to obtain a feature matrix after dimensionality reduction. Specifically, the method includes the following steps:

[0072] Step S121, using a correlation coefficient algorithm to select extraction features whose correlation degree with the load value exceeds a first threshold. The expression of the correlation coefficient algorithm is:

[0073]

[0074] In the formula, is the correlation coefficient between the load value and the extraction feature, is the covariance, and are the standard deviations of the load value and the extraction feature respectively.

[0075] Step S122, constructing an original feature matrix based on the extraction features through a principal component analysis algorithm, and calculating the covariance matrix corresponding to the original feature matrix.

[0076] Step S123, solving the eigenvalues and eigenvectors of the covariance matrix, sorting them according to the eigenvalue magnitudes to determine the principal component space, and projecting the original feature matrix onto the principal component space to obtain a feature matrix after dimensionality reduction.

[0077] Step S130, calculating the total squared error for different numbers of clusters, determining the optimal number of clusters through the elbow method, and initializing the cluster centers using the K-means clustering algorithm to obtain the selected optimal number of clusters and the initial cluster centers.

[0078] In some embodiments, for the automatic power consumption demand response method based on energy consumption itemized metering provided by the present invention, the total squared error for different numbers of clusters is calculated, the optimal number of clusters is determined through the elbow method, and the K-means clustering algorithm is used to initialize the cluster centers to obtain the selected optimal number of clusters and the initial cluster centers. Specifically, the method includes the following steps:

[0079] Step S131, calculating the total squared error for different numbers of clusters, drawing a relationship graph between the number of clusters and the total squared error, and selecting the number of clusters where the elbow is located as the optimal number of clusters.

[0080] Step S132, initializing the cluster centers through the K-means clustering algorithm to improve the clustering effect and convergence speed, and outputting the optimal number of clusters and the initial cluster centers.

[0081] Among them, the calculation expression of the total squared error is as follows:

[0082]

[0083] In the formula, is the total squared error, is the number of clusters, is the i-th sample, is the k-th cluster, is the centroid of the k-th cluster.

[0084] Step S140: Perform K-means clustering on the dimensionality-reduced feature matrix based on the selected number of clusters and the initial cluster centers, and update and iterate the cluster centers until convergence to generate a clustering result.

[0085] In some embodiments, for the automatic power consumption demand response method based on energy consumption sub-metering provided by the present invention, calculate the total squared error of different numbers of clusters, determine the optimal number of clusters through the elbow method, and initialize the cluster centers using the K-means clustering algorithm to obtain the selected optimal number of clusters and the initial cluster centers. Specifically, it further includes the following steps:

[0086] Step S141: Calculate the Euclidean distance from each sample to the centroid of each cluster, assign it to the nearest cluster, and recalculate the centroid of each cluster. If the change in the centroid after recalculation is less than the preset convergence threshold, stop the iteration to obtain the trained clustering model.

[0087] Step S142: Calculate the silhouette coefficient of each sample to evaluate the dispersion and compactness of the clustering process, and calculate the average value of the silhouette coefficients of all samples based on the silhouette coefficient of each sample to obtain the average silhouette coefficient. The average silhouette coefficient is used to evaluate the clustering effect.

[0088] Among them, the trained clustering model is used to predict and output the load prediction result.

[0089] Step S150: Construct a future feature matrix, project the future feature matrix into the dimensionality-reduced feature space, calculate the distance from each future feature in the feature space to the centroid of each cluster, and assign the nearest cluster to output the load prediction result.

[0090] Among them, the future feature matrix is constructed based on the extracted temperature, humidity, and date features within the future second time period.

[0091] In some embodiments, for the automatic power consumption demand response method based on energy consumption sub-metering provided by the present invention, the load prediction result includes the grid load situation of the power grid within the future third time period and the power consumption demands of each process. It further includes the following steps:

[0092] Step S210: Based on the predicted power grid load conditions and the power consumption requirements of each process, perform topological sorting on multiple processes through a deep learning algorithm to obtain multiple process topological sorting results that represent the dependency relationships and power consumption requirements between different processes.

[0093] Step S220: Based on the process topological sorting results, combined with the predicted power grid load conditions and the power consumption requirements of each process, call the deep learning algorithm to select the optimal topological sorting from multiple process topological sorting results to optimally allocate the power load to each process.

[0094] It should be noted that the first time period, the second time period, and the third time period are all arbitrarily set time periods that can be set by humans, and the first threshold, the second threshold, and the third threshold are different set thresholds.

[0095] The above-mentioned automatic response method for power consumption requirements based on energy consumption sub-metering analyzes the historical power grid load through an iterative clustering algorithm, can identify different load patterns, and then classifies and predicts the power consumption load conditions in a specific future time period, improving the accuracy of predicting the load state of the power grid in a future period of time, providing a basis for subsequent power dispatching decisions, and thus meeting the power consumption requirements of electrical equipment or processes in special periods or scenarios with variable power consumption requirements.

[0096] In a specific embodiment, the automatic response method for power consumption requirements based on energy consumption sub-metering provided by the present invention includes steps 1 to 7:

[0097] Step 1: Data collection and preprocessing.

[0098] Specifically, it includes steps 1.1 to 1.4:

[0099] Step 1.1: Collect historical power grid load data, covering at least hourly load records for the past year, and construct an initial data set. Each sample in the data set includes a timestamp, a load value, temperature, humidity, and date features (such as day of the week, holiday flag).

[0100] Step 1.2: Data cleaning.

[0101] Process missing values and outliers to ensure data integrity and accuracy.

[0102] Among them, for missing value filling: Use linear interpolation to fill in the missing load values, and its expression is:

[0103]

[0104] In the formula, and are the load values at the previous and subsequent times respectively, is the missing load value.

[0105] Outlier detection preprocessing: The Z-score method is used to detect outliers, and a threshold is set , if a certain load value satisfies:

[0106]

[0107] then replace it with the mean of the neighboring moments:

[0108]

[0109] In the formula, and are the mean and standard deviation of the load value respectively.

[0110] Step 1.3, Feature engineering.

[0111] Construct additional features to enhance the prediction ability of the clustering algorithm model, including time features, that is, features such as hour, day of the week, and whether it is a holiday are extracted. It also includes rolling statistical features, which are obtained by calculating the average load and standard deviation in the past 24 hours.

[0112] Step 1.4, Data standardization.

[0113] Perform standardization processing on numerical features to ensure that different features have the same scale. In this example, Z-score standardization is used, and its expression is:

[0114]

[0115] In the formula, is the original numerical feature, is the standardized numerical feature, and are the mean and standard deviation of the numerical feature respectively.

[0116] In this embodiment, the preprocessed data set contains standardized features and load values.

[0117] Step 2, Construct a feature matrix.

[0118] Specifically, it includes steps 2.1 to 2.3:

[0119] Step 2.1, Feature selection.

[0120] Select the features that have the most influence on load prediction and reduce the complexity of the model. In this example, the correlation coefficient method is used to select the features with higher correlation with the load value, and its expression is:

[0121]

[0122] In the formula, is the correlation coefficient between the load value and the extracted feature, is the covariance, and are the standard deviations of the load value and the extracted feature respectively. In this example, the features with a correlation coefficient are selected.

[0123] Step 2.2, Feature dimensionality reduction.

[0124] Use principal component analysis (PCA) to further reduce the feature dimension and retain the main information. First, construct a feature matrix, which is composed of the samples and features in the dataset, calculate the covariance matrix based on the constructed feature matrix, then solve the eigenvalues and eigenvectors of the covariance matrix, and sort them according to the eigenvalue size. Finally, select the first k principal components so that the cumulative explained variance ratio is greater than or equal to 0.95.

[0125] Step 2.3, Construct the reduced-dimension feature matrix.

[0126] Project the original feature matrix constructed in Step 2.2 into the selected principal component space to obtain the reduced-dimension feature matrix, which is used for subsequent clustering analysis.

[0127] Step 3, Clustering algorithm selection and initialization.

[0128] Specifically, it includes Steps 3.1 to 3.3:

[0129] Step 3.1, Select a clustering algorithm suitable for time series data. In this example, the K-means clustering algorithm is selected because it is simple and efficient and suitable for large-scale datasets.

[0130] Step 3.2, Determine the number of clusters K.

[0131] Use the Elbow Method to determine the optimal number of clusters K.

[0132] First, calculate the within-cluster sum of squares (WCSS) for different values of K. Its calculation formula is:

[0133]

[0134] In the formula, is the within-cluster sum of squares, is the number of clusters, is the i-th sample, is the k-th cluster, is the centroid of the k-th cluster.

[0135] Subsequently, plot the relationship between K and WCSS, and select the K value at the elbow as the optimal number of clusters.

[0136] Step 3.3, initialize the cluster centers.

[0137] Use the K-means++ algorithm to initialize the cluster centers to improve the clustering effect and convergence speed, and output the selected number of clusters K and the initial cluster centers.

[0138] Step 4, train the clustering model.

[0139] Specifically, it includes steps 4.1 to 4.2:

[0140] Step 4.1, the clustering iteration process.

[0141] Perform K-means clustering and iteratively update the cluster centers until convergence. First, calculate the Euclidean distance from each sample to the centroids of each cluster, and assign it to the nearest cluster. Its expression is:

[0142]

[0143] In the formula, is the cluster to which the i-th sample belongs, and the other variables are the same as above and will not be elaborated here.

[0144] Subsequently, recalculate the centroid of each cluster , and its expression is:

[0145]

[0146] In the formula, is the number of samples in the k-th cluster, and the other variables are the same as above and will not be elaborated here.

[0147] After that, perform convergence judgment. If the change in the centroid is less than the preset threshold, stop the iteration; otherwise, continue the iteration. Its expression is:

[0148]

[0149] In the formula, t is the current iteration number, is the convergence threshold, and the other variables are the same as above and will not be elaborated here.

[0150] Step 4.2, verify the clustering results.

[0151] Verify the effectiveness of the clustering results to ensure the clustering quality.

[0152] First, calculate the silhouette coefficient of each sample to evaluate the separation and compactness of the clustering. Subsequently, calculate the overall silhouette coefficient of the clustering, which is the average of the silhouette coefficients of all samples. The closer this average is to 1, the better the clustering effect.

[0153] Step 5, cluster prediction for future load periods.

[0154] Specifically, it includes steps 5.1 to 5.3:

[0155] Step 5.1, extract the features for the next 6 hours, including temperature, humidity, and date features, for cluster prediction, and construct a feature matrix based on the extracted 6-hour features.

[0156] Step 5.2, perform the same standardization processing on the future features extracted in step 5.1 as the above data.

[0157] Step 5.3, cluster assignment.

[0158] Assign the future features to the trained clusters. First, project the future feature matrix onto the reduced-dimensional feature space, then calculate the distance from the features of each future time period to the centroids of each cluster, assign the closest cluster, and then output the cluster labels to which each hour within the next 6 hours belongs.

[0159] Step 6, load prediction output.

[0160] Specifically, it includes steps 6.1 to 6.3:

[0161] Step 6.1, extract the centroid load of the cluster.

[0162] Extract the centroid load value of each cluster for predicting the future load. Among them, the centroid load is defined as the centroid load of each cluster, which is the average of the load values of all samples in the cluster.

[0163] Step 6.2, load prediction calculation.

[0164] According to the cluster labels to which each hour within the next 6 hours belongs, predict the corresponding load value. For example, for the kth hour in the future, its predicted load is the centroid load value of the cluster to which it belongs.

[0165] Step 6.3, load prediction output.

[0166] Organize the predicted load values into the load prediction results for the next 6 hours to output the load prediction values for the next 6 hours.

[0167] Step 7, perform topological sorting based on the grid load prediction and the process electricity consumption situation.

[0168] Determine the electricity consumption of each process based on the process environment requirements. According to the different requirements of each process in the factory for environmental conditions, evaluate and determine the power consumption of each process under different environmental conditions.

[0169] Environmental requirements analysis: Conduct a detailed analysis of environmental parameters such as temperature, humidity, and cleanliness for each process to determine its power requirements under different process states.

[0170] Electricity consumption calculation: Combine the environmental requirements of each process to calculate the amount of electricity required for each process under different load conditions.

[0171] The above process ensures that the power requirements of each process are accurately quantified, providing accurate data support for subsequent load scheduling. Subsequently, combining the predicted grid load situation by the clustering algorithm and the electricity consumption requirements of each process, a deep learning algorithm is used to perform topological sorting on the processes to determine the optimal execution order of the processes.

[0172] In this embodiment, the process dependency relationship is defined to clarify the sequential execution order between processes. For example, it is stipulated that the first process must be executed before the second process, and the third process must also be executed before the second process.

[0173] During the process of generating topological sorting, a deep learning algorithm is used to generate the topological sorting of the processes based on the dependency relationship and power demand situation of the processes.

[0174] For example, there are two possible topological sorting results:

[0175] First process → Third process → Second process

[0176] Third process → First process → Second process

[0177] In this example, through the deep learning algorithm, the optimal topological sorting can be dynamically selected according to the real-time grid load prediction and the electricity consumption requirements of the processes to achieve the optimal distribution of the power load.

[0178] Next, the automatic power demand response device provided by the present invention will be described. The automatic power demand response device described below can be mutually referred to with the automatic power demand response method based on energy consumption sub-item metering described above.

[0179] In one embodiment, an automatic power demand response device includes a data preprocessing module, a feature processing module, a clustering algorithm module, an iterative clustering module, and a load prediction module.

[0180] The data preprocessing module is used to obtain the historical grid load data, and preprocess and standardize the historical grid load data to construct a data set. The preprocessing includes missing value filling, outlier detection, and the construction of time features and rolling statistical features.

[0181] The feature processing module is used to select extraction features with a correlation degree exceeding the first threshold with the load value from the dataset through the correlation coefficient, and construct an original feature matrix based on the extraction features by using the principal component analysis algorithm, so as to calculate the covariance matrix based on the original feature matrix and obtain a feature matrix after dimensionality reduction.

[0182] The clustering algorithm module is used to calculate the total squared error of different numbers of clusters, determine the optimal number of clusters through the elbow method, and initialize the cluster centers by using the K-means clustering algorithm to obtain the selected optimal number of clusters and the initial cluster centers.

[0183] The iterative clustering module is used to perform K-means clustering on the feature matrix after dimensionality reduction based on the selected number of clusters and the initial cluster centers, so as to update the iterative cluster centers until convergence and generate a clustering result.

[0184] The load prediction module is used to construct a future feature matrix, project the future feature matrix into the feature space after dimensionality reduction, calculate the distance from each future feature in the feature space to the centroid of each cluster, and assign the nearest cluster to output a load prediction result.

[0185] Among them, the historical grid load data includes a timestamp, a load value, temperature, humidity, and date features. The rolling statistical features are obtained by calculating the average load and standard deviation of the historical grid load data in the first historical time period. The future feature matrix is constructed based on the temperature, humidity, and date features extracted in the second future time period.

[0186] In this embodiment, for the automatic power consumption demand response device provided by the present invention, the data preprocessing module is specifically used for:

[0187] The linear interpolation method is used to fill in the missing values to fill in the missing load values. The expression for filling in the missing values is:

[0188]

[0189] In the formula, and are the load values at the previous and subsequent moments respectively, is the missing load value.

[0190] The Z-score algorithm is used to detect outliers, and a set second threshold is obtained. When the result of the Z-score algorithm exceeds the second threshold, the load value corresponding to the result of the Z-score algorithm is replaced with the average value of the load values at adjacent moments. The expression for detecting outliers by the Z-score algorithm is.

[0191] In this embodiment, for the automatic power consumption demand response device provided by the present invention, the data preprocessing module is specifically further used for:

[0192] Extract time features from the historical load data of the power grid. The time features include hours, weekdays, and holidays, and calculate the average load and standard deviation of the historical load data of the power grid in the first historical time period to obtain rolling statistical features.

[0193] Standardize the numerical features in the historical load data of the power grid through the Z-score algorithm. The expression for the Z-score algorithm standardization is:

[0194]

[0195] In the formula, is the original numerical feature, is the standardized numerical feature, and are the mean and standard deviation of the numerical feature respectively.

[0196] In this embodiment, for the automatic power consumption demand response device provided by the present invention, the feature processing module is specifically used for:

[0197] Adopt the correlation coefficient algorithm to select the extraction features whose correlation degree with the load value exceeds the first threshold. The expression of the correlation coefficient algorithm is:

[0198]

[0199] In the formula, is the correlation coefficient between the load value and the extraction feature, is the covariance, and are the standard deviations of the load value and the extraction feature respectively.

[0200] Construct an original feature matrix based on the extraction features through the principal component analysis algorithm, and calculate the covariance matrix corresponding to the original feature matrix.

[0201] Solve the eigenvalues and eigenvectors of the covariance matrix, sort them according to the eigenvalue size to determine the principal component space, and project the original feature matrix onto the principal component space to obtain the dimensionality-reduced feature matrix.

[0202] In this embodiment, for the automatic power consumption demand response device provided by the present invention, the clustering algorithm module is specifically used for:

[0203] Calculate the total squared error under different numbers of clusters to draw a relationship diagram between the number of clusters and the total squared error, and select the number of clusters where the elbow is located as the optimal number of clusters.

[0204] Initialize the cluster centers through the K-means clustering algorithm to improve the clustering effect and convergence speed, and output the optimal number of clusters and the initial cluster centers.

[0205] Among them, the calculation expression of the total squared error is:

[0206]

[0207] In the formula, is the total squared error, is the number of clusters, is the i-th sample, is the k-th cluster, is the centroid of the k-th cluster.

[0208] In this embodiment, for the automatic power consumption demand response device provided by the present invention, the iterative clustering module is specifically used for:

[0209] Calculate the Euclidean distance from each sample to the centroid of each cluster, assign it to the nearest cluster, and recalculate the centroid of each cluster. If the change in the centroid after recalculation is less than the preset convergence threshold, stop the iteration to obtain the trained clustering model.

[0210] Calculate the silhouette coefficient of each sample to evaluate the dispersion and compactness of the clustering process, and calculate the average value of the silhouette coefficients of all samples based on the silhouette coefficient of each sample to obtain the average silhouette coefficient, which is used to evaluate the clustering effect.

[0211] Among them, the trained clustering model is used to predict and output the load prediction result.

[0212] In this embodiment, for the automatic power consumption demand response device provided by the present invention, the load prediction result includes the power grid load situation of the power grid in the third future time period and the power consumption demands of each process.

[0213] It further includes a topological sorting module, which is used for:

[0214] Based on the predicted power grid load situation and the power consumption demands of each process, perform topological sorting on multiple processes through a deep learning algorithm to obtain multiple process topological sorting results for characterizing the dependency relationship and power consumption demand between different processes.

[0215] Based on the process topological sorting results, and combined with the predicted power grid load situation and the power consumption demands of each process, call the deep learning algorithm to select the optimal topological sorting from multiple process topological sorting results to optimally allocate the power load to each process.

[0216] This disclosure may be a system, method, and / or computer program product. The computer program product may include a computer-readable storage medium having computer-readable program instructions thereon for causing a processor to implement various aspects of this disclosure.

[0217] A computer-readable storage medium can be a tangible device that can retain and store instructions for use by an instruction execution device. A computer-readable storage medium may be, for example—but not limited to—an electrical storage device, a magnetic storage device, an optical storage device, an electromagnetic storage device, a semiconductor storage device, or any suitable combination of the foregoing. More specific examples (a non-exhaustive list) of the computer-readable storage medium include: a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), a static random access memory (SRAM), a portable compact disk read-only memory (CD-ROM), a digital versatile disk (DVD), a memory stick, a floppy disk, a mechanically encoded device such as a punched card or raised structures in grooves having instructions stored thereon, and any suitable combination of the foregoing. The computer-readable storage medium used herein is not construed as being a transitory signal per se, such as a radio wave or other freely propagating electromagnetic wave, an electromagnetic wave propagating through a waveguide or other transmission medium (e.g., an optical pulse through an optical fiber cable), or an electrical signal transmitted through a wire.

[0218] The computer-readable program instructions described herein can be downloaded from a computer-readable storage medium to respective computing / processing devices, or can be downloaded to an external computer or an external storage device through a network, such as the Internet, a local area network, a wide area network, and / or a wireless network. The network may include a copper transmission cable, an optical fiber transmission, a wireless transmission, a router, a firewall, a switch, a gateway computer, and / or an edge server. A network adapter card or network interface in each computing / processing device receives the computer-readable program instructions from the network and forwards the computer-readable program instructions for storage in a computer-readable storage medium in each computing / processing device.

[0219] The computer program instructions for performing the operations of the present disclosure may be assembly instructions, instruction set architecture (ISA) instructions, machine instructions, machine - related instructions, microcode, firmware instructions, state - setting data, or source code or object code written in any combination of one or more programming languages, including object - oriented programming languages such as Smalltalk, C++, etc., and conventional procedural programming languages such as the "C" language or similar programming languages. The computer - readable program instructions may be executed entirely on the user's computer, partially on the user's computer, executed as a stand - alone software package, partially on the user's computer and partially on a remote computer, or entirely on a remote computer or server. In the case of a remote computer, the remote computer may be connected to the user's computer through any type of network, including a local area network (LAN) or a wide area network (WAN), or may be connected to an external computer (e.g., through the Internet using an Internet service provider). In some embodiments, by using the state information of the computer - readable program instructions to customize an electronic circuit, such as a programmable logic circuit, a field - programmable gate array (FPGA), or a programmable logic array (PLA), the electronic circuit can execute the computer - readable program instructions to implement various aspects of the present disclosure.

[0220] Aspects of the present disclosure are described herein with reference to the flowchart and / or block diagram of methods, apparatus (systems), and computer program products according to embodiments of the present disclosure. It should be understood that each block of the flowchart and / or block diagram, and the combinations of blocks in the flowchart and / or block diagram, can be implemented by computer - readable program instructions.

[0221] These computer - readable program instructions can be provided to a processor of a general - purpose computer, a special - purpose computer, or other programmable data - processing apparatus to produce a machine such that the instructions, when executed by the processor of the computer or other programmable data - processing apparatus, result in an apparatus that implements the functions / actions specified in one or more blocks of the flowchart and / or block diagram. These computer - readable program instructions can also be stored in a computer - readable storage medium, which causes a computer, a programmable data - processing apparatus, and / or other devices to operate in a particular manner. Thus, the computer - readable medium storing the instructions includes a manufacture that includes instructions for implementing various aspects of the functions / actions specified in one or more blocks of the flowchart and / or block diagram.

[0222] Computer-readable program instructions may also be loaded onto a computer, other programmable data processing apparatus, or other devices, causing a series of operational steps to be performed on the computer, other programmable data processing apparatus, or other devices to generate a computer-implemented process, such that the instructions executed on the computer, other programmable data processing apparatus, or other devices implement the functions / acts specified in one or more boxes of the flowchart and / or block diagram.

[0223] The flowcharts and block diagrams in the figures illustrate the architecture, functionality, and operation of possible implementations of systems, methods, and computer program products according to various embodiments of the present disclosure. In this regard, each block in the flowchart or block diagram may represent a module, a segment of a program, or a portion of an instruction, which contains one or more executable instructions for implementing the specified logical function. In some alternative implementations, the functions noted in the blocks may occur out of the order noted in the figures. For example, two consecutive blocks may in fact be executed substantially in parallel, or they may sometimes be executed in the reverse order, depending on the functionality involved. It should also be noted that each block of the block diagrams and / or flowcharts, and combinations of blocks in the block diagrams and / or flowcharts, can be implemented by a dedicated hardware-based system that performs the specified functions or acts, or by a combination of dedicated hardware and computer instructions.

[0224] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention and not to limit them. Although the present invention has been described in detail with reference to the above embodiments, those of ordinary skill in the art should understand that: modifications or equivalent replacements can still be made to the specific embodiments of the present invention, and any modification or equivalent replacement that does not depart from the spirit and scope of the present invention shall be covered by the protection scope of the claims of the present invention.

Claims

1. A method for automatically responding to electricity demand based on energy consumption item measurement, characterized in that: The method comprises: Acquire historical power grid load data, and preprocess and standardize the historical power grid load data to construct a data set, wherein the preprocessing includes missing value filling, outlier detection, and construction of time features and rolling statistical features, wherein the rolling statistical features are obtained by calculating the average load and standard deviation of the historical power grid load data in a first historical time period; Selecting extracted features whose correlation with the load value exceeds a first threshold from the data set by using the correlation coefficient, and constructing an original feature matrix based on the extracted features by using a principal component analysis algorithm, so as to calculate a covariance matrix based on the original feature matrix, and obtain a feature matrix after dimensionality reduction; The total square error of different cluster numbers is calculated, and the optimal number of clusters is determined by the elbow rule. The cluster centers are initialized using the K-means clustering algorithm to obtain the selected optimal number of clusters and initial cluster centers. Performing K-means clustering on the feature matrix after dimension reduction based on the selected number of clusters and the initial cluster centers, so as to update and iterate the cluster centers until convergence, and generate clustering results; Constructing a future feature matrix, and projecting the future feature matrix into the feature space after dimensionality reduction, and calculating the distance from each future feature in the feature space to the centroid of each cluster, and assigning the nearest cluster to output a load forecast result, wherein the future feature matrix is ​​constructed based on the extracted power grid load data in the second future time period; The load forecast result includes the load condition of the power grid in the third time period in the future and the power demand of each process, and the method further includes: Based on the predicted power grid load and the power demand of each process, a plurality of processes are topologically sorted by a deep learning algorithm to obtain a plurality of process topological sorting results for characterizing the dependency relationship and power demand between different processes; Based on the process topological sorting results, and combined with the predicted grid load conditions and the electricity demand of each process, a deep learning algorithm is called to dynamically select the optimal topological sorting from multiple process topological sorting results to optimally distribute the power load to each process.

2. The method for automatically responding to electricity demand based on energy consumption item metering according to claim 1 is characterized in that: The acquiring of historical power grid load data, and preprocessing and standardizing the historical power grid load data to construct a data set includes: Linear interpolation is used to fill in missing values ​​to fill in the missing load values. The expression for missing value filling is: In the formula, and are the load values ​​before and after, respectively. is the missing load value; The Z-score algorithm is used to detect abnormal values, and a set second threshold is obtained. When the Z-score algorithm result exceeds the second threshold, the load value corresponding to the Z-score algorithm result is replaced with the average load value at adjacent moments.

3. The method for automatically responding to electricity demand based on energy consumption item metering according to claim 2 is characterized in that: The obtaining of historical power grid load data, and preprocessing and standardizing the historical power grid load data to construct a data set also includes: Extracting time features from the historical load data of the power grid, the time features including hours, weeks and holidays, and calculating the average load and standard deviation of the historical load data of the power grid in a first historical time period to obtain the rolling statistical features; The numerical features in the historical load data of the power grid are standardized by the Z-score algorithm, and the expression of the standardized processing by the Z-score algorithm is: In the formula, is the original numerical feature, is the standardized numerical feature, and are the mean and standard deviation of the numerical features, respectively.

4. The method for automatically responding to electricity demand based on energy consumption item metering according to claim 3 is characterized in that: The extracting features whose correlation with the load value exceeds a first threshold are selected from the data set by the correlation coefficient, and the original feature matrix is ​​constructed based on the extracted features by using the principal component analysis algorithm, so as to calculate the covariance matrix based on the original feature matrix to obtain the feature matrix after dimensionality reduction, including: A correlation coefficient algorithm is used to select extraction features whose correlation with the load value exceeds the first threshold. The expression of the correlation coefficient algorithm is: In the formula, is the correlation coefficient between the load value and the extracted features, is the covariance, and are the standard deviations of the loading values ​​and extracted features, respectively; Constructing an original feature matrix based on the extracted features through a principal component analysis algorithm, and calculating a covariance matrix corresponding to the original feature matrix; The eigenvalues ​​and eigenvectors of the covariance matrix are solved, and the eigenvalues ​​are sorted according to the size of the eigenvalues ​​to determine the principal component space, and the original feature matrix is ​​projected into the principal component space to obtain a feature matrix after dimensionality reduction.

5. The method for automatically responding to electricity demand based on energy consumption item-by-item metering according to claim 4 is characterized in that: The method of calculating the total square error of different cluster numbers, determining the optimal cluster number by the elbow rule, and initializing the cluster center by using the K-means clustering algorithm to obtain the selected optimal cluster number and initial cluster center includes: Calculating the total square error under different numbers of clusters to draw a relationship diagram between the number of clusters and the total square error, and selecting the number of clusters where the elbow is located as the optimal number of clusters; Initializing the cluster centers by using the K-means clustering algorithm to improve clustering effect and convergence speed, and outputting the optimal number of clusters and initial cluster centers; The calculation expression of the total square error is: In the formula, is the total square error, is the number of clusters, is the i-th sample, is the kth cluster, is the centroid of the kth cluster.

6. The method for automatically responding to electricity demand based on energy consumption item-by-item metering according to claim 5 is characterized in that: The performing K-means clustering on the feature matrix after dimension reduction based on the selected number of clusters and the initial cluster centers to update and iterate the cluster centers until convergence to generate clustering results includes: Calculate the Euclidean distance from each sample to the centroid of each cluster to assign it to the nearest cluster, and recalculate the centroid of each cluster. If the change in the centroid after recalculation is less than a preset convergence threshold, stop the iteration and obtain the trained clustering model. Calculate the silhouette coefficient of each sample to evaluate the dispersion and compactness of the clustering process, and calculate the average of the silhouette coefficients of all samples based on the silhouette coefficient of each sample to obtain the average silhouette coefficient, which is used to evaluate the clustering effect; The trained clustering model is used to predict and output the load forecasting result.

7. An automatic response device for power demand, characterized in that: The device comprises: A data preprocessing module, used to obtain historical power grid load data, and preprocess and standardize the historical power grid load data to construct a data set, wherein the preprocessing includes missing value filling, outlier detection, and construction of time characteristics and rolling statistical characteristics, wherein the rolling statistical characteristics are obtained by calculating the average load and standard deviation of the historical power grid load data in a first historical time period; A feature processing module, used for selecting extracted features whose correlation with the load value exceeds a first threshold from the data set through a correlation coefficient, and constructing an original feature matrix based on the extracted features by using a principal component analysis algorithm, so as to calculate a covariance matrix based on the original feature matrix, and obtain a feature matrix after dimensionality reduction; The clustering algorithm module is used to calculate the total square error of different cluster numbers, determine the optimal number of clusters through the elbow rule, and initialize the cluster centers using the K-means clustering algorithm to obtain the selected optimal number of clusters and initial cluster centers; An iterative clustering module, used for performing K-means clustering on the feature matrix after dimension reduction based on the selected number of clusters and the initial cluster centers, so as to update and iterate the cluster centers until convergence, and generate a clustering result; A load forecasting module is used to construct a future feature matrix, project the future feature matrix into a feature space after dimensionality reduction, calculate the distance from each future feature in the feature space to the centroid of each cluster, assign the nearest cluster, and output a load forecasting result, wherein the future feature matrix is ​​constructed based on the extracted power grid load data in the second future time period; The load prediction result includes the load condition of the power grid in the third time period in the future and the power demand of each process. Based on the predicted load condition of the power grid and the power demand of each process, a topological sorting of multiple processes is performed through a deep learning algorithm to obtain multiple process topological sorting results for characterizing the dependency relationship and power demand between different processes; Based on the process topological sorting results, and combined with the predicted grid load conditions and the electricity demand of each process, a deep learning algorithm is called to dynamically select the optimal topological sorting from multiple process topological sorting results to optimally distribute the power load to each process.

8. A terminal comprising a processor and a storage medium; characterized in that: The storage medium is used to store instructions; The processor is configured to operate according to the instructions to execute the steps of the method according to any one of claims 1-6.

9. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the program is executed by a processor, the steps of the method according to any one of claims 1 to 6 are implemented.

Citation Information

Patent Citations

  • Power load curve clustering method and device, equipment and storage medium

    CN118626892A