Power consumption demand automatic response method based on energy consumption subentry measurement
Through the automatic response method of electricity consumption demand based on energy consumption sub-item measurement, cluster analysis and deep learning algorithms are used to solve the problem of difficult to achieve optimal power distribution in the existing technology, and the accuracy of grid load prediction and electricity consumption are improved. Demand satisfaction.
Patent Information
- Application Number
- CN202510080913.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-01-20
- Publication Date
- 2025-02-21
- Estimated Expiration
- 2045-01-20
AI Technical Summary
When the existing power demand response methods face variable power demand, it is difficult to achieve the optimal power distribution strategy, which affects the power demand of the process or process during special periods.
The automatic response method of electricity consumption demand based on energy consumption sub-item measurement is adopted. By obtaining the historical load data of the power grid, the characteristics are extracted using correlation coefficient and principal component analysis algorithm, K-means clustering analysis is performed to generate load prediction results. , and topological sorting is performed through deep learning algorithms to optimize power distribution.
It improves the accuracy of the load state prediction of the power grid in the future, meets the power consumption needs of power equipment or processes during special periods or under changing situations of power consumption demand, and realizes the optimal distribution of power load.
Smart Images

Figure CN119494523A_ABST
Abstract
Description
Technical Field
[0001] The present invention belongs to the technical field of electric power dispatching, and more specifically, relates to an automatic response method for electricity demand based on item-by-item energy consumption metering. Background Art
[0002] Electricity demand response is an important means of regulating electricity supply and demand. Implementing demand response for virtual power plants such as end users can, on the one hand, relieve the pressure of 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 and reduce unnecessary waste of resources to maximize overall benefits and enable the power generation system to operate efficiently, stably and safely.
[0003] At present, the traditional power demand response method mainly dispatches power to the process according to the power demand of the process according to a specific load pattern during the power demand response scheduling process. This makes it difficult to predict the possible changeable power demand in the future, which makes it difficult to take into account the optimal power allocation strategy when encountering a large number of processes and changing power demand, which to a certain extent affects the power demand of the process or the process in special time periods. Summary of the invention
[0004] In order 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 energy consumption item metering.
[0005] The present invention adopts the following technical solution.
[0006] The first aspect of the present invention discloses a method for automatically responding to electricity demand based on energy consumption item-by-item metering, the method comprising: 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; 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; 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, assign the nearest cluster, and output the load forecast result; Among them, the historical load data of the power grid includes timestamp, load value, temperature, humidity and date characteristics, the rolling statistical characteristics 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, and the future feature matrix is constructed based on the extracted temperature, humidity and date characteristics in the second future time period.
[0007] Furthermore, the acquisition 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. The expression for detecting abnormal values by the Z-score algorithm is:
[0008] Furthermore, the acquiring of historical power grid load data, and preprocessing and standardizing the historical power grid load data to construct a data set, further 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.
[0009] Furthermore, the extracted features whose correlation with the load value exceeds a first threshold are selected from the data set through 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.
[0010] Furthermore, the total square error of different cluster numbers is calculated, and the optimal number of clusters is determined by the elbow rule, and the cluster centers are initialized by using the K-means clustering algorithm to obtain the selected optimal number of clusters and initial cluster centers, including: 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.
[0011] Further, performing K-means clustering on the feature matrix after dimension reduction based on the selected number of clusters and the initial cluster center to update and iterate the cluster center until convergence to generate a clustering result 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.
[0012] Furthermore, 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 select the optimal topological sorting from multiple process topological sorting results to optimally distribute the power load to each process.
[0013] The second aspect of the present invention discloses an automatic response device for electricity demand, the device comprising: 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 features and rolling statistical features; 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; The load forecasting 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, assign the nearest cluster, and output the load forecasting result; The historical load data of the power grid includes timestamp, load value, temperature, humidity and date characteristics. The rolling statistical characteristics 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. The future feature matrix is constructed based on the extracted temperature, humidity and date characteristics in the second future time period. The third aspect of the present invention discloses a terminal, including a processor and a storage medium; the characteristics are: The storage medium is used to store instructions; The processor is used to operate according to the instructions to execute the steps of the method described in the first aspect.
[0014] The fourth aspect of the present invention discloses 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 described in the first aspect are implemented.
[0015] The beneficial effects of the present invention are that, compared with the prior art, the present invention has the following advantages: The historical load data of the power grid is obtained, and the historical load data of the power grid is preprocessed and standardized to construct a data set. The preprocessing includes missing value filling, outlier detection, and the construction of time features and rolling statistical features. Then, the extracted features with a correlation with the load value exceeding the set threshold are selected from the data set through the correlation coefficient, and the original feature matrix is constructed based on the extracted features using the principal component analysis algorithm to calculate the covariance matrix based on the original feature matrix to obtain the reduced-dimensional feature matrix. Subsequently, the total square error of different cluster numbers is calculated, and the optimal number of clusters is determined by the elbow rule, and the cluster center is initialized using the K-means clustering algorithm to obtain the selected optimal number of clusters and the initial cluster center. After that, the reduced-dimensional feature matrix is subjected to K-means clustering based on the selected number of clusters and the initial cluster center to update the iterative cluster center until convergence and generate the clustering result. Finally, the future feature matrix is constructed and projected into the reduced-dimensional feature space, and the distance from each future feature in the feature space to the centroid of each cluster is calculated to obtain the nearest cluster to output the load forecasting result. This method analyzes historical power grid loads through an iterative clustering algorithm, can identify different load patterns, and then classify and predict the power consumption in a specific time period in the future, thereby improving the accuracy of the load state prediction of the power grid in the future, providing a basis for subsequent power dispatching decisions, and thus meeting the power demand of power equipment or processes in special time periods or situations with changing power demand. BRIEF DESCRIPTION OF THE DRAWINGS
[0016] Figure 1 It is a flow chart of the method for automatic response to electricity demand based on item-by-item energy consumption metering provided by the present invention. DETAILED DESCRIPTION
[0017] The present application is further described below in conjunction with the accompanying drawings. The following embodiments are only used to more clearly illustrate the technical solution of the present invention, and cannot be used to limit the protection scope of the present application.
[0018] like Figure 1 As shown, in one embodiment, a method for automatically responding to electricity demand based on energy consumption item metering includes the following steps: Step S110, acquiring historical power grid load data, and preprocessing and standardizing 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.
[0019] The historical load data of the power grid includes timestamp, load value, temperature, humidity and date characteristics, and the rolling statistical characteristics 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.
[0020] In some embodiments, the method for automatically responding to electricity demand based on energy consumption item metering provided by the present invention obtains historical load data of the power grid, and preprocesses and standardizes the historical load data of the power grid, specifically comprising the following steps: Step S111, linear interpolation is used to fill in missing values to fill in 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.
[0021] Step S112, use the Z-score algorithm to detect abnormal values, and obtain the set second threshold. When the Z-score algorithm result exceeds the second threshold, replace the load value corresponding to the Z-score algorithm result with the average load value at adjacent moments. The expression for detecting abnormal values by the Z-score algorithm is:
[0022] In some embodiments, the method for automatically responding to electricity demand based on energy consumption item metering provided by the present invention obtains historical load data of the power grid, and preprocesses and standardizes the historical load data of the power grid, and specifically further includes the following steps: Step S113, 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 the first historical time period to obtain rolling statistical features.
[0023] Step S114, the numerical features in the historical load data of the power grid are standardized by the Z-score algorithm. 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.
[0024] Step S120, extracting features whose correlation with the load value exceeds a first threshold value are selected from the data set through the 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 and obtain a feature matrix after dimensionality reduction.
[0025] In some embodiments, the method for automatically responding to electricity demand based on energy consumption item metering provided by the present invention selects extracted features whose correlation with the load value exceeds a first threshold from the data set through the correlation coefficient, and constructs 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, and obtain a feature matrix after dimensionality reduction, specifically comprising the following steps: Step S121, using a correlation coefficient algorithm to select extraction features whose correlation with the load value exceeds a 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 deviation of the loading value and the extracted features, respectively.
[0026] Step S122, 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.
[0027] Step S123, solving the eigenvalues and eigenvectors of the covariance matrix, sorting them according to the size of the eigenvalues to determine the principal component space, and projecting the original feature matrix to the principal component space to obtain a feature matrix after dimensionality reduction.
[0028] Step S130, calculating the total square errors of different numbers of clusters, determining the optimal number of clusters by the elbow rule, and initializing the cluster centers by using the K-means clustering algorithm to obtain the selected optimal number of clusters and initial cluster centers.
[0029] In some embodiments, the method for automatically responding to electricity demand based on energy consumption item metering provided by the present invention calculates the total square error of different cluster numbers, determines the optimal cluster number by the elbow rule, and initializes the cluster center by using the K-means clustering algorithm to obtain the selected optimal cluster number and initial cluster center, specifically including the following steps: Step S131, 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.
[0030] Step S132, initializing the cluster centers by using 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.
[0031] Among them, 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.
[0032] Step S140, 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 the iterative cluster centers until convergence, and generate a clustering result.
[0033] In some embodiments, the method for automatically responding to electricity demand based on energy consumption item metering provided by the present invention calculates the total square error of different cluster numbers, determines the optimal cluster number by the elbow rule, and initializes the cluster center by using the K-means clustering algorithm to obtain the selected optimal cluster number and initial cluster center, and specifically includes the following steps: Step S141, 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.
[0034] Step S142, 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.
[0035] Among them, the trained clustering model is used to predict and output the load forecast results.
[0036] Step S150, construct a future feature matrix, and project the future feature matrix into the feature space after dimensionality reduction, and 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 forecast result.
[0037] The future feature matrix is constructed based on the extracted temperature, humidity and date features in the second future time period.
[0038] In some embodiments, the method for automatically responding to electricity demand based on energy consumption item metering provided by the present invention, the load forecasting result includes the load situation of the power grid in the third time period in the future and the electricity demand of each process, and further includes the following steps: Step S210, based on the predicted grid load and the power demand of each process, multiple processes are topologically sorted by a deep learning algorithm to obtain multiple process topological sorting results for characterizing the dependency relationship and power demand between different processes.
[0039] Step S220, based on the process topological sorting results, and combined with the predicted grid load and the electricity demand of each process, call the deep learning algorithm to select the optimal topological sorting from multiple process topological sorting results to optimally distribute the power load to each process.
[0040] It should be noted that the first time period, the second time period and the third time period are any time periods that can be set manually, and the first threshold, the second threshold and the third threshold are different set thresholds.
[0041] The above-mentioned automatic response method for electricity demand based on energy consumption sub-item metering analyzes the historical power grid load through an iterative clustering algorithm, can identify different load patterns, and then classify and predict the electricity load conditions in a specific time period in the future, thereby improving the accuracy of the load state prediction of the power grid in the future. It provides a basis for subsequent power dispatching decisions, thereby meeting the electricity demand of power equipment or processes in special time periods or situations with changing electricity demand.
[0042] In a specific embodiment, the method for automatically responding to electricity demand based on energy consumption item metering provided by the present invention includes steps 1 to 7: Step 1: Data collection and preprocessing.
[0043] Specifically, it includes steps 1.1 to 1.4: Step 1.1, collect historical power grid load data, covering at least the hourly load records of the past year, and construct an initial data set. Each sample in the data set contains timestamp, load value, temperature, humidity, and date features (such as day of the week, holiday identifier).
[0044] Step 1.2, data cleaning.
[0045] Handle missing values and outliers to ensure data completeness and accuracy.
[0046] Among them, missing value filling: use linear interpolation to fill in the missing load values, and its expression is: In the formula, and are the load values before and after, respectively. is the missing load value.
[0047] Outlier detection preprocessing: Use the Z-score method to detect outliers and set the threshold , if a load value satisfy: Then replace it with the mean of the adjacent moments: In the formula, and are the mean and standard deviation of the load values, respectively.
[0048] Step 1.3, feature engineering.
[0049] Additional features are constructed to enhance the prediction capability of the clustering algorithm model, including time features, that is, extracting features such as hours, days of the week, and whether it is a holiday. It also includes rolling statistical features, which are obtained by calculating the average load and standard deviation over the past 24 hours.
[0050] Step 1.4, data standardization.
[0051] Normalize the numerical features to ensure that different features have the same scale. In this example, Z-score normalization is used, and its expression 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.
[0052] In this embodiment, the preprocessed data set includes standardized features and load values.
[0053] Step 2: Construct the feature matrix.
[0054] Specifically, it includes steps 2.1 to 2.3: Step 2.1, feature selection.
[0055] Select the features that have the greatest impact on load forecasting and reduce the complexity of the model. In this example, the correlation coefficient method is used to select features that have a high correlation with the load value. The expression is: In the formula, is the correlation coefficient between the load value and the extracted features, is the covariance, and are the load value and the standard deviation of the extracted features respectively. In this example, the correlation coefficient is selected characteristics.
[0056] Step 2.2, feature dimensionality reduction.
[0057] Principal component analysis (PCA) is used to further reduce the feature dimension and retain the main information. First, a feature matrix is constructed. The constructed feature matrix is composed of samples and features in the data set, and the covariance matrix is calculated based on the constructed feature matrix. Then, the eigenvalues and eigenvectors of the covariance matrix are solved and sorted according to the eigenvalue size. Finally, the top k principal components are selected so that the cumulative explained variance ratio is greater than or equal to 0.95.
[0058] Step 2.3, construct the feature matrix after dimensionality reduction.
[0059] The original feature matrix constructed in step 2.2 is projected into the selected principal component space to obtain the reduced-dimensional feature matrix, which is used for subsequent clustering analysis.
[0060] Step 3: Clustering algorithm selection and initialization.
[0061] Specifically, it includes steps 3.1 to 3.3: 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 data sets.
[0062] Step 3.2, determine the number of clusters K.
[0063] The optimal number of clusters K is determined using the Elbow Method.
[0064] First, calculate the total square error (WCSS) under different K values. The calculation formula 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.
[0065] Then, a graph of K versus WCSS is plotted, and the K value where the elbow is located is selected as the optimal number of clusters.
[0066] Step 3.3, cluster center initialization.
[0067] The K-means++ algorithm is used to initialize the cluster centers to improve the clustering effect and convergence speed, and the selected number of clusters K and the initial cluster centers are output.
[0068] Step 4: clustering model training.
[0069] Specifically, it includes steps 4.1 and 4.2: Step 4.1, clustering iteration process.
[0070] Perform K-means clustering and iteratively update the cluster center until convergence. First, for each sample, calculate its Euclidean distance to the centroid of each cluster, and assign the nearest cluster, which is expressed as: In the formula, is the cluster to which the ith sample belongs. Other variables are the same as above and will not be described here.
[0071] Then, recalculate the centroid of each cluster , whose expression is: In the formula, is the number of samples in the kth cluster. Other variables are the same as above and will not be described here.
[0072] After that, the convergence judgment is performed. If the change in the center of mass is less than the preset threshold, the iteration is stopped. Otherwise, the iteration continues. The expression is: Where t is the current iteration number, is the convergence threshold, and other variables are the same as above and will not be described here.
[0073] Step 4.2: Verify clustering results.
[0074] Verify the validity of clustering results and ensure clustering quality.
[0075] First, the silhouette coefficient of each sample is calculated to evaluate the separation and compactness of the clusters. Then, the overall silhouette coefficient of the cluster is calculated, which is the average of the silhouette coefficients of all samples. The closer the average is to 1, the better the clustering effect.
[0076] Step 5: Cluster prediction for future load periods.
[0077] Specifically, it includes steps 5.1 to 5.3: Step 5.1: Extract the features of 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.
[0078] In step 5.2, the future features extracted in step 5.1 are subjected to the same standardization process as the above data.
[0079] Step 5.3, cluster assignment.
[0080] To assign future features to the trained clusters, first project the future feature matrix into the feature space after dimensionality reduction, then calculate the distance from the features of each future time period to the centroid of each cluster, assign the nearest cluster, and then output the cluster label for each hour in the next 6 hours.
[0081] Step 6: Load forecast output.
[0082] Specifically, it includes steps 6.1 to 6.3: Step 6.1, cluster centroid loading extraction.
[0083] The centroid load value of each cluster is extracted for future load prediction. The centroid load is defined as the centroid load of each cluster, which is the average value of all sample load values in the cluster.
[0084] Step 6.2, load forecast calculation.
[0085] According to the cluster label of each hour in the next 6 hours, the corresponding load value is predicted. For example, for the kth hour in the future, the predicted load is the centroid load value of the cluster to which it belongs.
[0086] Step 6.3, load forecast output.
[0087] The predicted load values are sorted into load forecast results for the next 6 hours to output the load forecast values for the next 6 hours.
[0088] Step 7: Perform topological sorting based on the grid load forecast and process power situation.
[0089] Determine the power consumption of each process based on the process environmental requirements. According to the different requirements of each process for environmental conditions in the factory, evaluate and determine the power consumption of each process under different environmental conditions.
[0090] Environmental demand analysis: Conduct a detailed analysis of the temperature, humidity, cleanliness and other environmental parameters of each process to determine its power demand under different process conditions.
[0091] Electricity calculation: Combined with the environmental requirements of each process, calculate the amount of electricity required for each process under different load conditions.
[0092] The above process ensures that the power demand of each process is accurately quantified, providing accurate data support for subsequent load scheduling. Subsequently, the grid load predicted by the clustering algorithm and the power demand of each process are combined, and a deep learning algorithm is used to topologically sort the processes to determine the optimal execution order of the processes.
[0093] In this embodiment, the process dependency is defined as a clear execution order between processes, for example, stipulating that the first process must be executed before the second process, and the third process must also be executed before the second process.
[0094] In the process of generating topological sorting, deep learning algorithms are used to generate topological sorting of processes based on the dependencies of the processes and the power demand.
[0095] For example, there are two possible topological sorting results: First process → Third process → Second process The third process → the first process → the second process In this case, through deep learning algorithms, the optimal topological sorting can be dynamically selected based on real-time grid load forecasts and process power requirements to achieve optimal distribution of power load.
[0096] The automatic response device for electricity demand provided by the present invention is described below. The automatic response device for electricity demand described below and the automatic response method for electricity demand based on item-by-item energy consumption metering described above can be referenced to each other.
[0097] In one embodiment, an automatic response device for electricity demand includes a data preprocessing module, a feature processing module, a clustering algorithm module, an iterative clustering module, and a load prediction module.
[0098] The data preprocessing module is used to 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.
[0099] The feature processing module is used to select extracted features whose correlation with the load value exceeds a first threshold from the data set through the correlation coefficient, and use the principal component analysis algorithm to construct the original feature matrix based on the extracted features, so as to calculate the covariance matrix based on the original feature matrix to obtain the feature matrix after dimensionality reduction.
[0100] 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.
[0101] 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 initial cluster centers, so as to update the iterative cluster centers until convergence and generate clustering results.
[0102] The load forecasting module is used to construct the future feature matrix and project it into the feature space after dimensionality reduction. It also calculates the distance from each future feature in the feature space to the centroid of each cluster and assigns the nearest cluster to output the load forecasting result.
[0103] Among them, the historical load data of the power grid includes timestamp, load value, temperature, humidity and date characteristics. The rolling statistical characteristics 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. The future feature matrix is constructed based on the extracted temperature, humidity and date characteristics in the second future time period.
[0104] In this embodiment, the data preprocessing module of the automatic response device for power demand provided by the present invention is specifically used for: Linear interpolation is used to fill 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.
[0105] The Z-score algorithm is used to detect outliers and obtain the set second threshold. 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. The expression for detecting outliers by the Z-score algorithm is:
[0106] In this embodiment, the data preprocessing module of the automatic response device for power demand provided by the present invention is further used for: Time features are extracted from the historical load data of the power grid, including hours, weeks and holidays, and the average load and standard deviation of the historical load data of the power grid in the first historical time period are calculated to obtain rolling statistical features.
[0107] The numerical features in the historical load data of the power grid are standardized by the Z-score algorithm. The expression of the Z-score algorithm standardization 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.
[0108] In this embodiment, the automatic response device for power demand provided by the present invention, the feature processing module is specifically used for: The correlation coefficient algorithm is used to select the extracted 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 deviation of the loading value and the extracted features, respectively.
[0109] The original feature matrix is constructed based on the extracted features through the principal component analysis algorithm, and the covariance matrix corresponding to the original feature matrix is calculated.
[0110] Solve the eigenvalues and eigenvectors of the covariance matrix, sort them according to the size of the eigenvalues to determine the principal component space, and project the original feature matrix into the principal component space to obtain the feature matrix after dimensionality reduction.
[0111] In this embodiment, the automatic response device for power demand provided by the present invention, the clustering algorithm module is specifically used for: The total squared error under different numbers of clusters is calculated to draw a graph between the number of clusters and the total squared error, and the number of clusters where the elbow is located is selected as the optimal number of clusters.
[0112] The cluster centers are initialized by the K-means clustering algorithm to improve the clustering effect and convergence speed, and the optimal number of clusters and initial cluster centers are output.
[0113] Among them, 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.
[0114] In this embodiment, the automatic response device for power demand provided by the present invention, the iterative clustering module is specifically used for: The Euclidean distance from each sample to the centroid of each cluster is calculated to assign it to the nearest cluster, and the centroid of each cluster is recalculated. If the change in the centroid after recalculation is less than the preset convergence threshold, the iteration is stopped to obtain the trained clustering model.
[0115] The silhouette coefficient of each sample is calculated to evaluate the dispersion and compactness of the clustering process, and the average of the silhouette coefficients of all samples is calculated based on the silhouette coefficient of each sample to obtain the average silhouette coefficient, which is used to evaluate the clustering effect.
[0116] Among them, the trained clustering model is used to predict and output the load forecast results.
[0117] In this embodiment, the automatic response device for electricity demand provided by the present invention has a load forecast result including the load condition of the power grid in the third time period in the future and the electricity demand of each process.
[0118] Also includes a topological sorting module for: Based on the predicted grid load and the power demand of each process, multiple processes are topologically sorted through a deep learning algorithm to obtain multiple process topological sorting results that are used to characterize the dependency relationships and power demand between different processes.
[0119] Based on the process topological sorting results, combined with the predicted grid load and the electricity demand of each process, the deep learning algorithm is called to select the optimal topological sorting from multiple process topological sorting results to optimally distribute the power load to each process.
[0120] The present disclosure may be a system, a method and / or a computer program product. The computer program product may include a computer-readable storage medium carrying computer-readable program instructions for causing a processor to implement various aspects of the present disclosure.
[0121] A computer-readable storage medium may be a tangible device that can hold and store instructions used 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 above. More specific examples (a non-exhaustive list) of computer-readable storage media 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 mechanical encoding device, such as a punch card or a raised structure in a groove on which instructions are stored, and any suitable combination of the above. The computer-readable storage medium used herein is not to be interpreted as a transient signal itself, such as a radio wave or other freely propagating electromagnetic wave, an electromagnetic wave propagating through a waveguide or other transmission medium (e.g., a light pulse through a fiber optic cable), or an electrical signal transmitted through a wire.
[0122] The computer-readable program instructions described herein can be downloaded from a computer-readable storage medium to each computing / processing device, or downloaded to an external computer or external storage device via a network, such as the Internet, a local area network, a wide area network, and / or a wireless network. The network can include copper transmission cables, optical fiber transmissions, wireless transmissions, routers, firewalls, switches, gateway computers, and / or edge servers. The 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 the computer-readable storage medium in each computing / processing device.
[0123] The computer program instructions for performing the operations of the present disclosure may be assembly instructions, instruction set architecture (ISA) instructions, machine instructions, machine-dependent 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 "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, as a separate software package, partially on the user's computer, 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., using an Internet service provider to connect through the Internet). In some embodiments, by using the state information of the computer-readable program instructions to personalize an electronic circuit, such as a programmable logic circuit, a field programmable gate array (FPGA), or a programmable logic array (PLA), the electronic circuit may execute the computer-readable program instructions, thereby implementing various aspects of the present disclosure.
[0124] Various aspects of the present disclosure are described herein with reference to flowcharts and / or block diagrams of methods, devices (systems) and computer program products according to embodiments of the present disclosure. It should be understood that each box in the flowchart and / or block diagram and the combination of boxes in the flowchart and / or block diagram can be implemented by computer-readable program instructions.
[0125] 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 device, thereby producing a machine, so that when these instructions are executed by the processor of the computer or other programmable data processing device, a device that implements the functions / actions specified in one or more boxes in the flowchart and / or block diagram is generated. These computer-readable program instructions can also be stored in a computer-readable storage medium, and these instructions cause the computer, programmable data processing device, and / or other equipment to work in a specific manner, so that the computer-readable medium storing the instructions includes a manufactured product, which includes instructions for implementing various aspects of the functions / actions specified in one or more boxes in the flowchart and / or block diagram.
[0126] Computer-readable program instructions may also be loaded onto a computer, other programmable data processing apparatus, or other device so that a series of operating steps are performed on the computer, other programmable data processing apparatus, or other device to produce a computer-implemented process, thereby causing the instructions executed on the computer, other programmable data processing apparatus, or other device to implement the functions / actions specified in one or more boxes in the flowchart and / or block diagram.
[0127] The flow chart and block diagram in the accompanying drawings show the possible architecture, function and operation of the system, method and computer program product according to multiple embodiments of the present disclosure. In this regard, each square box in the flow chart or block diagram can represent a part of a module, program segment or instruction, and a part of the module, program segment or instruction includes one or more executable instructions for realizing the specified logical function. In some alternative implementations, the function marked in the square box can also occur in a sequence different from that marked in the accompanying drawings. For example, two continuous square boxes can actually be executed substantially in parallel, and they can sometimes be executed in reverse order, depending on the functions involved. It should also be noted that each square box in the block diagram and / or flow chart, and the combination of the square boxes in the block diagram and / or flow chart can be implemented with a dedicated hardware-based system that performs the specified function or action, or can be implemented with a combination of special hardware and computer instructions.
[0128] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention rather than to limit it. Although the present invention has been described in detail with reference to the above embodiments, ordinary technicians in the relevant field should understand that the specific implementation methods of the present invention can still be modified or replaced by equivalents, and any modifications or equivalent replacements that do not depart from the spirit and scope of the present invention should be covered within the scope of protection 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; 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; 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, assign the nearest cluster, and output the load forecast result; Among them, the historical load data of the power grid includes timestamp, load value, temperature, humidity and date characteristics, the rolling statistical characteristics 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, and the future feature matrix is constructed based on the extracted temperature, humidity and date characteristics in the second future time period.
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. The expression for detecting abnormal values by the Z-score algorithm is:
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-by-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; Wherein, 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. The method for automatically responding to electricity demand based on energy consumption item-by-item metering according to any one of claims 1 to 6, characterized in that: 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 select the optimal topological sorting from multiple process topological sorting results to optimally distribute the power load to each process.
8. An automatic response device for electricity 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 features and rolling statistical features; 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; The load forecasting 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, assign the nearest cluster, and output the load forecasting result; Among them, the historical load data of the power grid includes timestamp, load value, temperature, humidity and date characteristics, the rolling statistical characteristics 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, and the future feature matrix is constructed based on the extracted temperature, humidity and date characteristics in the second future time period.
9. 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-7.
10. 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 7 are implemented.
Citation Information
Patent Citations
Power grid peak load clustering extraction method based on Pearson coefficient and MapReduce parallel computing
CN110069467A
Power load short-term prediction method, model, device and system
CN110610280A
Fine classification method and system for power multivariate load users
CN111724278A
Power load curve clustering method
CN112270338A
Load prediction method and load prediction system
CN116611545A
Cited By
Power distribution operation scene construction method and device based on load clustering
CN120995150A
A power distribution operation scene construction method and device based on load clustering
CN120995150B
Tool performance evaluation method and device
CN121119441A