Method and system for classifying net load scenes

By combining the Conditional Variational Autoencoder (CVAE) and the K-Means algorithm with the Medoid method, the net load scenario classification is dynamically optimized. This solves the problem that the coupling relationship between net load and meteorological factors is difficult to capture in traditional methods, and achieves efficient net load scenario classification, thereby improving the dispatching decision-making and economic benefits of the power system.

CN121009384APending Publication Date: 2025-11-25NANJING TECH UNIV +3
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202511059676.2
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-07-30
Publication Date
2025-11-25

AI Technical Summary

Technical Problem

Traditional methods struggle to capture the complex coupling relationship between net load and meteorological factors, resulting in unsatisfactory net load scenario classification and impacting power system dispatch decisions and economic costs.

Method used

We employ a conditional variational autoencoder (CVAE) for latent feature extraction, and combine the K-Means algorithm and the Medoid method. Through joint optimization of reconstruction loss, KL divergence loss, and cluster consistency loss, we dynamically optimize the latent space structure and select the most representative net load curve for classification.

Benefits of technology

It significantly improves the clustering cohesion and distinguishability of net load scenarios, achieves accurate scenario classification, and enhances the operational flexibility and stability of the power system.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121009384A_ABST
    Figure CN121009384A_ABST
Patent Text Reader

Abstract

The invention discloses a net load scene classification method and system, and relates to the field of net load scene classification, and the method comprises the following steps: carrying out the potential feature extraction of net load data and meteorological data through a conditional variation auto-encoder (CVAE), carrying out the preliminary training of a model through reconstruction loss and KL divergence loss in a pre-training stage, and carrying out the classification of net load scenes. The method comprises the following steps of: firstly, selecting a net load curve with the highest representativeness in each scene based on an Euclidean distance matrix by using an iterative clustering enhancement training strategy, dynamically updating a clustering center by using the iterative clustering enhancement strategy in combination with a K-means algorithm, introducing clustering consistency loss in each mini-batch training process, and selecting the net load curve with the highest representativeness in each scene based on the Euclidean distance matrix by using a Medoid method. And obtaining a typical scene in the multi-class scene set. According to the method, the cohesiveness and discrimination of clustering can be remarkably improved, and accurate classification and efficient representation of the net load scene are realized.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The present application relates to the technical field of load scenario classification, and particularly relates to a net load scenario classification method and system. BACKGROUND

[0002] Net load scenario classification plays a vital role in power system operation and planning, not only providing a scientific basis for new energy consumption and power grid dispatching decisions, but also directly affecting the efficiency of generating plan formulation and the implementation effect of demand response, thereby improving the operational flexibility and stability of the system. Accurate scenario classification can reliably identify the typical characteristics of different load modes, providing strong support for safety assessment and economic dispatch; otherwise, if the classification result is inaccurate, it may lead to mismatching of dispatching schemes, improper configuration of reserve capacity, thereby increasing operational risks and economic costs, and even disrupting the orderly operation of the power market. Traditional methods have limitations in capturing the complex coupling relationship between net load and meteorological factors, in the extraction and clustering optimization of nonlinearity, uncertainty and spatiotemporal correlation characteristics, resulting in unsatisfactory classification results. SUMMARY

[0003] The present application aims to provide a net load scenario classification method and system to solve the problems raised in the background.

[0004] To achieve the above object, the present application provides the following technical scheme:

[0005] A net load scenario classification method, comprising:

[0006] Based on historical net load data and meteorological feature data, latent feature extraction is performed using a conditional variational autoencoder (CVAE), and the model is preliminarily trained through reconstruction loss and KL divergence loss;

[0007] When the preliminary training is completed, the conditional variational autoencoder (CVAE) periodically updates the cluster center using the currently generated latent feature vector through the K-Means algorithm, and calculates the cluster consistency loss in each mini-batch training process. The cluster consistency loss, together with the reconstruction loss and the KL divergence loss, constitutes an end-to-end joint optimization objective, and the cluster division result is obtained.

[0008] Based on the cluster division result, the Medoid method is used to select the most representative net load curve in each class of scenarios, and the curve with the minimum total distance from the same class curve is determined as the representative through the Euclidean distance matrix, to obtain the typical scenario under the multi-class scenario set.

[0009] As a further scheme of the present application, the latent feature extraction using the conditional variational autoencoder (CVAE) further comprises:

[0010] The posterior distribution of the latent feature z output by the encoder of the conditional variational autoencoder CVAE parameters, i.e., the mean vector μ and the standard deviation vector σ

[0011] The conditional variational autoencoder CVAE inputs a conditional vector c composed of source load data and meteorological feature data and the net load data X and outputs a low-dimensional latent vector containing the source load data and the meteorological feature data

[0012] The latent feature z is sampled by using the following formula:

[0013] z = μ + σ + ε (29)

[0014] In the formula, ε is a standard normal distribution random variable, i.e., ε ~ N(0, 1)

[0015] The encoder output latent feature z is combined with the conditional vector c to input the decoder to obtain the reconstructed data X' similar to the net load data X, the conditional variational autoencoder CVAE loss function shown in the following formula is minimized as the goal, the historical samples are used to form a training set to carry out unsupervised training on the conditional variational autoencoder CVAE, and the encoder parameter set θ and the decoder parameter set θ are determined:

[0016]

[0017] In the formula, L Re is the reconstruction loss, representing the difference between the reconstructed data X' and the net load data X under the condition of the given latent feature z and the conditional vector c, i.e., the expected maximum value of the log-likelihood function of the posterior distribution q θ (z|X, c) under the condition of the latent feature z; L KL is the KL divergence between the posterior distribution q θ (z|X, c) and the expected prior distribution q KL The smaller the D KL value is, the more similar the two distributions are.

[0018] As a further scheme of the present application, the method for periodically updating the cluster center by using the currently generated latent feature vector through the K-Means algorithm by the conditional variational autoencoder CVAE is specifically:

[0019] In the early stage of training, the conditional variational autoencoder CVAE is used for training, and the loss is

[0020] From the end of the pre-training stage, every interval of a certain training round, using the latent features z of all samples generated by the conditional variational autoencoder CVAE, the clustering labels are obtained through K-Means clustering, and the corresponding cluster centers are calculated

[0021] As a further scheme of the present application, the steps of the K-Means clustering algorithm are as follows:

[0022] Calculate the distance between the remaining samples in the total sample S={s1, s2, …, s m} and the K cluster centers O1, O2, …, Ok K , and the calculation formula is as follows:

[0023]

[0024] In the formula, L(s i ,o k ) represents the distance between the ith sample S i and the kth initial cluster center O k ; represents the jth index data of the kth initial cluster center, L(s i ,o k ) is sorted from small to large, and each sample is assigned to the nearest cluster center. After the above sample assignment processing, k clusters are formed, and the average value of each sample in the cluster and the cluster center of the cluster is calculated, that is,

[0025]

[0026] In the formula, represents the average value of each sample in the kth cluster and the cluster center of the cluster; L k (s ki ,o k ) represents the distance between the ith sample S ki in the kth cluster and the initial cluster center of the cluster ; N k represents the number of samples in the kth cluster, and N k is obtained instead of the initial cluster center O k of the cluster, and the above process is repeated until the cluster centers of all clusters are updated, denoted as Calculate the error sum of squares between all samples and , that is,

[0027]

[0028] In the formula, β represents error sum of squares, when β is less than a specified threshold, the K-means algorithm ends, and a final scene classification result is obtained; otherwise, the above cluster center updating process is repeated until the cluster center no longer changes.

[0029] As a further scheme of the application, the method for calculating the cluster consistency loss in each mini-batch training process, combining the cluster consistency loss with the reconstruction loss and the KL divergence loss to form an end-to-end joint optimization target, and obtaining a cluster division result is as follows:

[0030] The cluster consistency loss is introduced, and after updating the cluster center, the cluster consistency loss L is additionally calculated for each mini-batch during continuous training. clust :

[0031]

[0032] The total loss function L total is:

[0033] L total = L Re + L KL + λL clust (35)

[0034] In the formula, N batch is the number of small samples contained in a mini-batch, wherein the mini-batch is a training method for dividing the entire data set into multiple small batch subsets, and only the samples in one batch are used to calculate the gradient and update the model parameters in each iteration, and λ is a weight parameter;

[0035] In each training, the conditional variational autoencoder CVAE updates the parameters through the mini-batch, and continuously adjusts the cluster consistency loss by using the latest cluster center feedback, dynamically optimizes the latent representation while reducing the reconstruction error and the KL divergence, so that similar samples are more closely gathered around the respective cluster center in the low-dimensional space, and finally an accurate cluster division result is obtained.

[0036] As a further scheme of the application, the method for selecting the most representative curve by using Medoid and performing evaluation further comprises the following steps:

[0037] Step 3.1, the similarity between all curves is calculated by using the Euclidean distance, and the most representative curve in the cluster scene data set is selected by using Medoid;

[0038] The Medoid calculates the similarity between all curves by using the Euclidean distance to obtain the Euclidean distance matrix D, and the specific calculation method is as follows:

[0039]

[0040] The calculation method of the Euclidean distance is as follows:

[0041]

[0042] In the formula, X input is an input sequence;

[0043] The distance between curves is calculated based on the Euclidean distance, and the distance between all net load curves in a class of scenarios is obtained, and the total distance S i of each curve and all other curves is further calculated:

[0044]

[0045] Finally, the Medoid is obtained as a representative curve in a class of typical scenarios by calculating the minimum total distance S i between curves:

[0046] X medoid = argminS i (39)

[0047] Step 3.2, the silhouette coefficient SS, the Davies-Bouldin index DBI and the Calinski-Harabasz index CHI are used to evaluate the classification results of the scene;

[0048] The silhouette coefficient SS value range is [-1, 1], and the larger the value, the better the clustering effect:

[0049]

[0050] In the formula, a(i) represents the intra-class compactness, and b(i) represents the inter-class separation degree;

[0051] The smaller the Davies-Bouldin index DBI, the higher the intra-class compactness and inter-class separation degree:

[0052]

[0053] In the formula, K is the number of clustering clusters, S i is the average distance of samples in cluster i to the centroid, and d(c i ,c j ) represents the distance between centroids;

[0054] The larger the Calinski-Harabasz index CHI value, the clearer the clustering structure:

[0055]

[0056] In the formula, B k represents the inter-class dispersion matrix, and W kwherein, denotes the intra-class dispersion matrix, and tr() denotes the trace of a matrix.

[0057] As a further scheme of the present application, the present application also provides a net load scene classification system, comprising:

[0058] The feature extraction unit takes historical net load data and combines meteorological feature data, uses a conditional variational autoencoder CVAE to extract latent features, and preliminarily trains the model by using a reconstruction loss and a KL divergence loss in a pre-training stage.

[0059] The dynamic optimization unit, after the pre-training stage is completed, periodically updates the cluster center by using the currently generated latent feature vector through a K-Means algorithm, and simultaneously, in each mini-batch training process, calculates a clustering consistency loss, which, together with the reconstruction loss and the KL divergence loss, constitutes an end-to-end joint optimization target, to obtain a clustering division result.

[0060] The scene generation unit selects a most representative net load curve in each scene based on the clustering division result by using a Medoid method, determines a curve with the minimum total distance from the curves in the same class by using an Euclidean distance matrix, obtains a typical scene under a multi-class scene set, and verifies the effectiveness of the proposed scene classification method by using multi-dimensional evaluation indexes.

[0061] As a further scheme of the present application, the method for extracting latent features by using the conditional variational autoencoder CVAE in the feature extraction unit is as follows:

[0062] The conditional variational autoencoder CVAE outputs a posterior distribution of the latent feature z through an encoder Parameters, namely, a mean vector μ and a standard deviation vector σ;

[0063] The conditional variational autoencoder CVAE inputs a conditional vector c composed of source load data and meteorological feature data, and net load data X, and outputs a low-dimensional latent vector containing the source load data and the meteorological feature data.

[0064] The latent feature is sampled by using the following formula to reduce the number of sampling points of the decoder:

[0065] z = μ + σ + ε (43)

[0066] In the formula, ε is a standard normal distribution random variable, that is, ε ~ N(0, 1).

[0067] The latent features z output by the encoder are combined with the conditional vector c and input into the decoder to obtain reconstructed data X′ similar to the payload data X. The objective is to minimize the loss function of the Conditional Variational Autoencoder (CVAE) as shown in the following equation. Unsupervised training of the CVAE is conducted using a training set composed of historical samples to determine the encoder parameter set. and decoder parameter set θ:

[0068]

[0069] In the formula: L Re The reconstruction loss represents the difference between the reconstructed data X′ and the net payload data X, given the latent features z and the conditional vector c. In other words, it reflects the difference in the posterior distribution of the latent features z. Reconstruct the sample probability distribution q under the condition θ = (z|X,c) is the expected maximum value of the log-likelihood function; L KL For the posterior distribution With the expected prior distribution q θ The KL divergence between (z|X,c) represents the difference between the prior and posterior distributions of the latent feature z. KL The smaller the value, the more similar the two distributions are.

[0070] As a further aspect of the present invention, the dynamic optimization unit is used for:

[0071] In the initial training phase, a conditional variational autoencoder (CVAE) was used for training, with a loss of _____.

[0072] Starting from the end of the pre-training phase, at regular training epochs, the latent features z of all samples generated by the Conditional Variational Autoencoder (CVAE) are used to obtain cluster labels through K-Means clustering, and the corresponding cluster centers are calculated.

[0073] The steps of the K-Means clustering algorithm are as follows:

[0074] Calculate the total sample S = {s1, s2, ..., s} m The remaining samples in the cluster are clustered with K cluster centers O1, O2, ..., O K The distance between them is calculated using the following formula:

[0075]

[0076] In the formula, L(s) i ,o k ) represents the i-th sample S i With the k-th initial cluster center O k The distance between them; The j-th metric data representing the k-th initial cluster center, L(s) i ,o k Sort the samples from smallest to largest, and assign each sample to the nearest cluster center. After this sample allocation process, k clusters are formed. Calculate the average value of each sample in a cluster relative to the cluster center.

[0077]

[0078] In the formula, L represents the average value of each sample in the k-th cluster relative to the cluster center of that cluster; k (s ki ,o k ) represents the i-th sample S in the k-th cluster. ki with the initial cluster center of the cluster The distance between them; N k Representing the number of samples in the k-th cluster, we get N. k Replace the initial cluster center O of this cluster k Repeat the above process until the cluster centers of all clusters have been updated, denoted as . Calculate all samples to The sum of squared errors between them, i.e.

[0079]

[0080] In the formula, β represents the sum of squared errors. When β is less than a specified threshold, the K-means algorithm ends and the final scene classification result is obtained; otherwise, the above cluster center update process is repeated until the cluster centers no longer change.

[0081] A clustering consistency loss is introduced. After the cluster centers are updated, an additional clustering consistency loss L is calculated for each mini-batch during training. clust :

[0082]

[0083] Total loss function L total That is:

[0084] L total =L Re +L KL +λL clust (49)

[0085] In the formula, N batchis the number of samples contained in a mini-batch, where the mini-batch is a training method that divides the entire data set into multiple small batch subsets, and only uses the samples of one batch in each iteration to calculate the gradient and update the model parameters, which improves the training efficiency while maintaining the convergence stability, λ is a weight parameter used to adjust the proportion of clustering consistency loss in the overall objective;

[0086] In each training, the conditional variational autoencoder CVAE updates the parameters through the mini-batch, and constantly adjusts the clustering consistency loss by using the latest clustering center feedback, dynamically optimizes the latent representation while reducing the reconstruction error and KL divergence, so that similar samples are more closely clustered around the respective clustering center in the low-dimensional space, and finally obtain accurate clustering division results.

[0087] As a further scheme of the application, the method for selecting the most representative curve and evaluating it in the scene generation unit by using Medoid is as follows:

[0088] The similarity between all curves is calculated by using the Euclidean distance, and the most representative curve in the clustering scene data set is selected by using Medoid;

[0089] The similarity between all curves is calculated by using the Euclidean distance, and the most representative curve in the clustering scene data set is selected by using Medoid;

[0090]

[0091] The calculation method of the Euclidean distance is as follows:

[0092]

[0093] In the formula, X input is the input sequence;

[0094] The distance between curves is calculated based on the Euclidean distance, and the distance between all net load curves under a type of scene is obtained, and the total distance S i between each curve and all other curves is further calculated:

[0095]

[0096] Finally, the minimum total distance S i between curves is calculated, and the Medoid is obtained as the representative curve under a type of scene:

[0097] X medoid = argmin S i (53)

[0098] The scene classification result is evaluated by using a profile coefficient SS, a Davies-Bouldin index DBI and a Calinski-Harabasz index CHI.

[0099] The profile coefficient SS has a value range of [-1, 1], and the larger the value is, the better the clustering effect is:

[0100]

[0101] In the formula, a(i) represents the intra-class compactness, and b(i) represents the inter-class separation degree;

[0102] The smaller the Davies-Bouldin index DBI is, the more compact the intra-class is and the higher the inter-class separation degree is:

[0103]

[0104] In the formula, K is the number of clustering clusters, S i The average distance of samples in the cluster i to the centroid, d(c i ,c j ) represents the distance between the centroids.

[0105] The larger the Calinski-Harabasz index CHI is, the clearer the clustering structure is:

[0106]

[0107] In the formula, B k represents an inter-class dispersion matrix, W k represents an intra-class dispersion matrix, and tr() represents the trace of a matrix.

[0108] Compared with the prior art, the present application has the beneficial effects that: the present application can extract the potential representation of net load data and meteorological features by using CVAE, dynamically optimize the potential space structure through an iterative clustering enhancement (ICE) strategy, and significantly improve the cohesion and distinguishability of clustering; meanwhile, the high-efficiency clustering capability of the K-means algorithm and the Medoid method for selecting the most representative typical curve are combined, so that the precise classification and efficient representation of the net load scene are realized. BRIEF DESCRIPTION OF DRAWINGS

[0109] Figure 1 It is a flowchart of the net load scene classification method based on ICE-CVAE-K-means-Medoid;

[0110] Figure 2 It is a CVAE structure diagram;

[0111] Figure 3 It is a Kshape scene classification result;

[0112] Figure 4 It is a K-means scene classification result;

[0113] Figure 5 CVAE-K-means scene classification results;

[0114] Figure 6 scene classification results for the method herein;

[0115] Figure 7 Medoid typical scene curve selection results. DETAILED DESCRIPTION

[0116] The technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the drawings in the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present application, rather than all the embodiments. Based on the embodiments in the present application, all other embodiments obtained by a person of ordinary skill in the art without creative labor fall within the protection scope of the present application.

[0117] Embodiment 1

[0118] Reference Figure 1 The flowchart of a load scene classification method proposed in the embodiment is shown in FIG. 1, which includes the following processes:

[0119] A load scene classification method uses a conditional variational autoencoder to extract latent features of load data and meteorological data, and uses an iterative clustering enhanced training strategy to reduce reconstruction error and KL divergence while improving clustering cohesion, so as to obtain more accurate clustering division results. The Medoid method is used to select the most representative load curve in each scene, to obtain typical scenes under a multi-class scene set, to construct a load scene classification method, and to improve the accuracy and reliability of load data scene classification. The method includes the following processes:

[0120] Step 1: Take historical load data of a certain area and combine meteorological feature data, and use a conditional variational autoencoder to extract latent features. In the pre-training stage, the model is preliminarily trained through reconstruction loss and KL divergence loss.

[0121] Step 2: After the pre-training stage is completed, the CVAE regularly updates the clustering center by using the current generated latent vector through the K-Means algorithm. At the same time, the clustering consistency loss is calculated in each mini-batch training process, which is combined with the reconstruction loss and the KL divergence loss to form an end-to-end joint optimization target, so as to obtain more accurate clustering division results.

[0122] Step 3, the Medoid method is used to select the most representative net load curve in each category of scene based on the clustering results, and the curve with the minimum total distance from the curves in the same category is determined as the representative through the Euclidean distance matrix to obtain the typical scene under the multi-category scene set, and the effectiveness of the proposed scene classification method is verified by using multi-dimensional evaluation indexes.

[0123] In step 1, the latent feature extraction using the conditional variational autoencoder further includes the following steps:

[0124] Step 1.1, output the posterior distribution of latent feature z through the encoder of CVAE The parameters, i.e. the mean vector μ and the standard deviation vector σ, reflect the randomness of the uncertainty of the input data.

[0125] The conditional variational autoencoder (CVAE) is a variant based on the variational autoencoder, which is used to generate random samples under a specific condition. The input of the CVAE model includes a condition vector c composed of source load data and meteorological feature data, and net load data X, and the output is a low-dimensional latent vector containing source load data and meteorological feature data.

[0126] Step 1.2, sample the latent feature using the following formula, reduce the number of sampling points of the decoder and ensure that the latent feature is derivable:

[0127] z = μ + σ + ε (57)

[0128] In the formula: ε is a standard normal distribution random variable, i.e. ε ~ N(0, 1).

[0129] Step 1.3, combine z and the condition vector c to input the decoder to obtain the reconstructed data X' similar to the net load data X, the loss function of the CVAE model shown in the following formula is minimized as the goal, and the historical samples are used to form a training set to carry out unsupervised training on the CVAE model to determine the encoder parameter set and the decoder parameter set θ:

[0130]

[0131] In the formula: L Re is the reconstruction loss, which represents the difference between the reconstructed data X' and the net load data X under the condition of given latent feature z and condition vector c, i.e. the expected maximum value of the log-likelihood function of the posterior distribution q θ (z|X, c) under the condition of latent feature z; L KL is the expected maximum value of the log-likelihood function of the posterior distribution q θthe KL (Kullback-Leibler divergence) divergence between (z|X,c) to represent the gap between the prior distribution and the posterior distribution of the latent feature z, D KL The smaller the value, the more similar the two distributions.

[0132] The coupling feature representation of net load and meteorological data is extracted by CVAE, a low-dimensional latent space with statistical significance is generated, and a high-distinguishable feature basis is provided for scene classification, thereby supporting the construction of precise clustering optimization strategies.

[0133] The iterative clustering enhancement strategy between CVAE and K-Means algorithm in step 2 further comprises the following steps:

[0134] Step 2.1, at the beginning of training, use CVAE for training, and the loss is

[0135] Step 2.2, from the end of the pre-training stage, every certain training round, use the latent vectors z of all samples generated by CVAE to get the clustering label by K-Means clustering, and calculate the corresponding cluster center

[0136] K-Means clustering algorithm clustering is an unsupervised learning technique, whose purpose is to group unlabeled sample points. By analyzing data and their mutual relationships, clustering methods can divide data objects into multiple groups. The core idea is to maximize the similarity of sample points within the group, while minimizing the similarity of sample points between groups. The ideal clustering result should reflect the high similarity between objects within the group and the significant difference between groups. The steps of K-Means clustering algorithm are as follows:

[0137] Calculate the distance between the remaining samples in the total sample S={s1,s2,…,s m} and the K cluster centers O1,O2,…,O K , the calculation formula is as follows:

[0138]

[0139] In the formula, L(s i ,o k ) represents the distance between the i-th sample S i and the k-th initial cluster center O k ; represents the j-th index data of the k-th initial cluster center. L(s i ,o k) from small to large, each sample is assigned to the nearest cluster center, after the above sample assignment process, k clusters are formed, the average value of each sample in the cluster and the cluster center of the cluster is calculated, that is

[0140]

[0141] In the formula, represents the average value of each sample in the kth cluster and the cluster center of the cluster; L k (s ki ,o k ) represents the distance between the ith sample S ki and the initial cluster center of the cluster in the kth cluster; N k represents the number of samples in the kth cluster. Replace the initial cluster center O k of the cluster with N k . Repeat the above process until the cluster centers of all clusters are updated, denoted as Calculate the sum of squared errors of all samples to , that is

[0142]

[0143] In the formula, β represents the sum of squared errors. When β is less than a specified threshold, the K-means algorithm ends, and the final scene classification result is obtained; otherwise, repeat the cluster center updating process until the cluster center no longer changes.

[0144] Step 2.3, introduce cluster consistency loss, after updating the cluster center, continue to train and calculate the cluster consistency loss L clust for each mini-batch:

[0145]

[0146] The total loss function L total is:

[0147] L total = L Re + L KL + λL clust (63)

[0148] In the formula, N batch is the number of small samples contained in a mini-batch, wherein the mini-batch is a training method that divides the entire data set into multiple small batches of subsets, and only uses one batch of samples in each iteration to calculate the gradient and update the model parameters, thereby improving the training efficiency while maintaining a certain convergence stability. λ is a weight parameter used to adjust the proportion of cluster consistency loss in the overall target.

[0149] Step 2.4, in each training, CVAE updates parameters through mini-batch and constantly adjusts clustering consistency loss by using the latest cluster center feedback, so as to dynamically optimize the latent representation while reducing reconstruction error and KL divergence, so that similar samples are more closely clustered around the respective cluster center in low-dimensional space, and finally obtain accurate clustering division results.

[0150] In step 3, using Medoid to select the most representative curve and evaluation further includes the following steps:

[0151] Step 3.1, calculate the similarity between all curves using Euclidean distance, and select the most representative curve in the clustering scenario data set using Medoid.

[0152] Medoid (median point) is a representative data point selection method based on similarity measurement, widely used in time series analysis, clustering analysis and pattern recognition. In time series analysis, Medoid can be used to select the most representative curve, that is, to find a curve in the data set that is most similar to all other curves. It calculates the similarity between all curves by Euclidean distance to get the Euclidean distance matrix D, the specific calculation method is as follows:

[0153]

[0154] Wherein, the calculation method of Euclidean distance is as follows:

[0155]

[0156] In the formula, X input is the input sequence.

[0157] Based on the calculation of the distance between curves by Euclidean distance, the distance between all net load curves under a class of scenarios is obtained, and the total distance S i of each curve with all other curves is further calculated:

[0158]

[0159] Finally, by calculating the minimum total distance S i between curves, the Medoid (median curve) is obtained as the representative curve under a class of typical scenarios:

[0160] X medoid = argmin S i (67)

[0161] Step 3.2, the scene classification results are evaluated by using the Silhouette Score (SS), Davies-Bouldin Index (DBI) and Calinski-Harabasz Index (CHI);

[0162] The Silhouette Score (SS) has a value range of [-1, 1], and a larger value indicates a better clustering effect.

[0163]

[0164] In the formula, a(i) represents the intra-class compactness, and b(i) represents the inter-class separation.

[0165] The Davies-Bouldin Index (DBI) is smaller, indicating that the intra-class is more compact and the inter-class separation is higher.

[0166]

[0167] In the formula, K is the number of clusters, S i The average distance of samples in cluster i to the centroid, d(c i ,c j ) represents the distance between centroids.

[0168] The Calinski-Harabasz Index (CHI) is larger, indicating that the clustering structure is clearer.

[0169]

[0170] In the formula, B k represents the inter-class dispersion matrix, W k represents the intra-class dispersion matrix, and tr() represents the trace of the matrix.

[0171] Example 2:

[0172] This embodiment is based on the python platform and is simulated and optimized in the WIN10 operating system, i5 CPU, 2.20 GHz processor environment. The specific flow chart is as shown in Figure 1 .

[0173] In this embodiment, the net load data of a region for one month is used. There are 288*30 load data in total, and one load data is selected every 5 minutes.

[0174] To verify the effectiveness of the method proposed in Embodiment 1, four scenes are set respectively for comparative analysis, Scene 1: using the Kshape model for net load scene classification; Scene 2: using the K-means model for net load scene classification; Scene 3: using the CVAE-K-means model for net load scene classification; Scene 4: using the ICE-CVAE-K-means model for net load scene classification.

[0175] The scene classification curves of the four scenes are shown in FIG. 2. Figures 3-6 As can be seen, the scene classification result based on the ICE-CVAE-K-means model is more reasonable, because the iterative clustering enhancement strategy continuously adjusts the latent space structure while ensuring the reconstruction accuracy of the original data and maintaining the regularization constraint, so that the low-dimensional representation obtained finally can show stronger cohesion and significant distinction in the clustering process, overcoming the representation dispersion problem caused by decoupling of representation learning and clustering process and re-clustering after training in the traditional method. Therefore, the net load scene classification method based on ICE-CVAE-K-means is better than the Kshape model, the K-means model and the CVAE-K-means model.

[0176] Table 1. Scene classification verification index

[0177] Method SS DBI CHI Kshape 0.085 1.42 5.722 K-means 0.196 0.921 20.785 CVAE-K-means 0.523 0.455 82.882 Method herein 0.795 0.063 253.435

[0178] The comparison of the verification indexes of the three scene classifications is shown in Table 1. As can be seen, compared with the Kshape model, the K-means model and the CVAE-K-means model, the scene classification model based on ICE-CVAE-K-means can effectively improve the accuracy of scene classification. The SS of the scene classification result of the method proposed in the application is improved by 0.71, 0.599 and 0.272 respectively; the DBI is reduced by 1.357, 0.858 and 0.392 respectively; and the CHI is reduced by 247.713, 232.65 and 170.553 respectively. From the above results, it can be seen that the SS value of the method proposed in the application is improved compared with each comparative scene, and the DBI value and the CHI value are reduced to a certain extent, which verifies that the model proposed in the application has good applicability in the task of net load scene classification.

[0179] Further, the application further provides a net load scene classification system, comprising:

[0180] a feature extraction unit: taking historical net load data and combining meteorological feature data, using a conditional variational autoencoder CVAE to extract latent features, and preliminarily training the model by reconstruction loss and KL divergence loss in the pre-training stage;

[0181] Dynamic optimization unit: after the pre-training phase is completed, the conditional variational autoencoder CVAE periodically updates the cluster center by using the current generated latent feature vector through the K-Means algorithm, and at the same time, the cluster consistency loss is calculated in each mini-batch training process, which is combined with the reconstruction loss and the KL divergence loss to form an end-to-end joint optimization objective, and the cluster division result is obtained;

[0182] Scene generation unit: based on the cluster division result, the Medoid method is used to select the most representative net load curve in each type of scene, the curve with the minimum total distance from the curves of the same type is determined through the Euclidean distance matrix as the representative, and the typical scene under the multi-class scene set is obtained, and the effectiveness of the proposed scene classification method is verified by using the multi-dimensional evaluation index.

[0183] It is apparent to those skilled in the art that the present application is not limited to the details of the foregoing exemplary embodiments, and that the present application can be implemented in other concrete forms without departing from the spirit or essential characteristics of the present application. Therefore, the embodiments should be considered in all respects as illustrative and not restrictive, the scope of the present application being defined by the appended claims rather than the above description, and it is intended to include all changes falling within the meaning and scope of the equivalent elements of the claims. Any reference signs in the claims should not be considered as limiting the claims involved.

[0184] Furthermore, it should be understood that, although the present specification is described in terms of embodiments, not every embodiment contains only one independent technical solution, and the description of the specification is only for the sake of clarity, and those skilled in the art should consider the specification as a whole, and the technical solutions in each embodiment can also be appropriately combined to form other embodiments that those skilled in the art can understand.

Claims

1. A method for classifying net load scenarios, characterized in that, include: Based on historical net load data and meteorological characteristic data, latent features were extracted using a conditional variational autoencoder (CVAE), and the model was initially trained using reconstruction loss and KL divergence loss. Upon completion of the initial training, the Conditional Variational Autoencoder (CVAE) periodically updates the cluster centers using the currently generated latent feature vectors through the K-Means algorithm. During each mini-batch training process, the cluster consistency loss is calculated. The cluster consistency loss, reconstruction loss, and KL divergence loss are combined to form an end-to-end joint optimization objective to obtain the clustering results. Based on the clustering results, the Medoid method is used to select the most representative net load curve in each scenario. The curve with the smallest total distance to the same type of curve is determined by the Euclidean distance matrix as the representative, thus obtaining typical scenarios under multiple scenario sets.

2. The net load scenario classification method according to claim 1, characterized in that, Latent feature extraction using a conditional variational autoencoder (CVAE) also includes: The posterior distribution of the latent feature z output by the encoder through the Conditional Variational Autoencoder (CVAE) The parameters are the mean vector μ and the standard deviation vector σ. The input of the Conditional Variational Autoencoder (CVAE) includes a conditional vector c composed of source load data and meteorological feature data, as well as net load data X. The output is a low-dimensional latent vector containing source load data and meteorological feature data. Sample latent features using the following formula: z=μ+σ+ε (1) In the formula: ε is a standard normally distributed random variable, i.e., ε ~ N(0,1); The latent features z output by the encoder are combined with the conditional vector c and input into the decoder to obtain reconstructed data X′ similar to the payload data X. The objective is to minimize the loss function of the Conditional Variational Autoencoder (CVAE) as shown in the following equation. Unsupervised training of the CVAE is conducted using a training set composed of historical samples to determine the encoder parameter set. and decoder parameter set θ: In the formula: L Re The reconstruction loss represents the difference between the reconstructed data X′ and the net payload data X, given the latent features z and the conditional vector c. In other words, it reflects the difference in the posterior distribution of the latent features z. Reconstruct the sample probability distribution q under the condition θ = (z|X,c) is the expected maximum value of the log-likelihood function; L KL For the posterior distribution With the expected prior distribution q θ The KL divergence between (z|X,c) represents the difference between the prior and posterior distributions of the latent feature z. KL The smaller the value, the more similar the two distributions are.

3. The net load scenario classification method according to claim 2, characterized in that, The method described above, whereby the Conditional Variational Autoencoder (CVAE) periodically updates the cluster centers using the K-Means algorithm based on the currently generated latent feature vectors upon completion of initial training, is as follows: In the initial training phase, a conditional variational autoencoder (CVAE) was used for training, with a loss of _____. Starting from the end of the pre-training phase, at regular training epochs, the latent features z of all samples generated by the Conditional Variational Autoencoder (CVAE) are used to obtain cluster labels through K-Means clustering, and the corresponding cluster centers are calculated.

4. The net load scenario classification method according to claim 3, characterized in that, The steps of the K-Means clustering algorithm are as follows: Calculate the total sample S = {s1, s2, ..., s} m The remaining samples in the cluster are clustered with K cluster centers O1, O2, ..., O K The distance between them is calculated using the following formula: In the formula, L(s) i ,o k ) represents the i-th sample S i With the k-th initial cluster center O k The distance between them; O k j The j-th metric data representing the k-th initial cluster center, L(s) i ,o k Sort the samples from smallest to largest, and assign each sample to the nearest cluster center. After this sample allocation process, k clusters are formed. Calculate the average value of each sample in a cluster relative to the cluster center. In the formula, L represents the average value of each sample in the k-th cluster relative to the cluster center of that cluster; k (s ki ,o k ) represents the i-th sample S in the k-th cluster. ki with the initial cluster center of the cluster The distance between them; N k Representing the number of samples in the k-th cluster, we get N. k Replace the initial cluster center O of the cluster k Repeat the above process until the cluster centers of all clusters have been updated, denoted as . Calculate all samples to The sum of squared errors between them, i.e. In the formula, β represents the sum of squared errors. When β is less than a specified threshold, the K-means algorithm ends and the final scene classification result is obtained; otherwise, the above cluster center update process is repeated until the cluster centers no longer change.

5. The net load scenario classification method according to claim 4, characterized in that, The method for calculating the clustering consistency loss during each mini-batch training process, and then combining the clustering consistency loss with the reconstruction loss and KL divergence loss to form an end-to-end joint optimization objective to obtain the clustering results is as follows: A clustering consistency loss is introduced. After the cluster centers are updated, an additional clustering consistency loss L is calculated for each mini-batch during training. clust : Total loss function L total That is: THE total =L Re +L KL +λL clust (7) In the formula, N batch λ is the number of small samples contained in a mini-batch. A mini-batch is a training method that divides the entire dataset into multiple small batch subsets. In each iteration, only samples from one batch are used to calculate the gradient and update the model parameters. λ is the weight parameter. In each training iteration, the Conditional Variational Autoencoder (CVAE) updates its parameters through mini-batch and continuously uses the latest cluster center feedback to adjust the cluster consistency loss. This dynamically optimizes the latent representation while reducing reconstruction error and KL divergence, allowing similar samples to cluster more closely in their respective cluster centers in the low-dimensional space, ultimately resulting in accurate clustering results.

6. The net load scenario classification method according to claim 5, characterized in that, The process of selecting and evaluating the most representative curve using Medoid also includes the following steps: Step 3.1: Calculate the similarity between all curves using Euclidean distance, and select the most representative curve in the clustering scenario dataset using Medoid; Medoid calculates the similarity between all curves using Euclidean distance, resulting in the Euclidean distance matrix D. The specific calculation method is as follows: The Euclidean distance is calculated as follows: In the formula, X input The input sequence; The distance between curves is calculated based on Euclidean distance, yielding the distance between all net load curves in a given scenario. The total distance S between each curve and all other curves is then calculated. i : Finally, the minimum total distance S between the curves is calculated. i This yields the Medoid curve as a representative curve for a typical scenario: Step 3.2: Use the silhouette coefficient SS, the Davidson-Bolding index DBI, and the Kalinsky-Harabass index CHI to evaluate the scene classification results; The silhouette coefficient (SS) has a range of [-1, 1], and a larger value indicates a better clustering effect. In the formula, a(i) represents the intra-class tightness and b(i) represents the inter-class separation. A smaller Davidson-Bauerdin index (DBI) indicates higher intra-class compactness and inter-class separation. In the formula, K is the number of clusters, and S i The average distance from the sample to the centroid within cluster i, d(c i ,c j () represents the distance between the centers of mass; A higher Kalinsky-Harabás index (CHI) value indicates a clearer cluster structure. In the formula, B k W represents the discrete matrix between classes. k tr() represents a discrete matrix within a class, and tr() represents the trace of the matrix.

7. A net load scenario classification system, characterized in that, include: Feature extraction unit: Takes historical net load data and combines it with meteorological feature data, uses conditional variational autoencoder (CVAE) to extract latent features, and performs preliminary training on the model in the pre-training stage using reconstruction loss and KL divergence loss. Dynamic optimization unit: After the pre-training phase is completed, the conditional variational autoencoder (CVAE) periodically updates the cluster centers using the currently generated latent feature vectors through the K-Means algorithm. At the same time, the cluster consistency loss is calculated in each mini-batch training process, and it, together with the reconstruction loss and KL divergence loss, constitutes the end-to-end joint optimization objective to obtain the clustering results. Scene generation unit: Based on the clustering results, the Medoid method is used to select the most representative net load curve in each scene class. The curve with the smallest total distance to the same type of curve is determined by the Euclidean distance matrix as the representative, so as to obtain typical scenes under multiple scene sets. The effectiveness of the proposed scene classification method is verified by multi-dimensional evaluation indicators.

8. The net load scenario classification system according to claim 7, characterized in that, The method for latent feature extraction using a conditional variational autoencoder (CVAE) in the feature extraction unit is as follows: The posterior distribution of the latent feature z output by the encoder through the Conditional Variational Autoencoder (CVAE) The parameters are the mean vector μ and the standard deviation vector σ. The input of the Conditional Variational Autoencoder (CVAE) includes a conditional vector c composed of source load data and meteorological feature data, as well as net load data X. The output is a low-dimensional latent vector containing source load data and meteorological feature data. By sampling latent features using the following formula, the number of sampling points in the decoder can be reduced: z=μ+σ+ε (15) In the formula: ε is a standard normally distributed random variable, i.e., ε ~ N(0,1); The latent features z output by the encoder are combined with the conditional vector c and input into the decoder to obtain reconstructed data X′ similar to the payload data X. The objective is to minimize the loss function of the Conditional Variational Autoencoder (CVAE) as shown in the following equation. Unsupervised training of the CVAE is conducted using a training set composed of historical samples to determine the encoder parameter set. and decoder parameter set θ: In the formula: L Re The reconstruction loss represents the difference between the reconstructed data X′ and the net payload data X, given the latent features z and the conditional vector c. In other words, it reflects the difference in the posterior distribution of the latent features z. Reconstruct the sample probability distribution q under the condition θ = (z|X,c) is the expected maximum value of the log-likelihood function; L KL For the posterior distribution With the expected prior distribution q θ The KL divergence between (z|X,c) represents the difference between the prior and posterior distributions of the latent feature z. KL The smaller the value, the more similar the two distributions are.

9. A net load scenario classification system according to claim 8, characterized in that, The dynamic optimization unit is used for: In the initial training phase, a conditional variational autoencoder (CVAE) was used for training, with a loss of _____. Starting from the end of the pre-training phase, at regular training epochs, the latent features z of all samples generated by the Conditional Variational Autoencoder (CVAE) are used to obtain cluster labels through K-Means clustering, and the corresponding cluster centers are calculated. The steps of the K-Means clustering algorithm are as follows: Calculate the total sample S = {s1, s2, ..., s} m The remaining samples in the cluster are clustered with K cluster centers O1, O2, ..., O K The distance between them is calculated using the following formula: In the formula, L(s) i ,o k ) represents the i-th sample S i With the k-th initial cluster center O k The distance between them; The j-th metric data representing the k-th initial cluster center, L(s) i ,o k Sort the samples from smallest to largest, and assign each sample to the nearest cluster center. After this sample allocation process, k clusters are formed. Calculate the average value of each sample in a cluster relative to the cluster center. In the formula, L represents the average value of each sample in the k-th cluster relative to the cluster center of that cluster; k (s ki ,o k ) represents the i-th sample S in the k-th cluster. ki with the initial cluster center of the cluster The distance between them; N k Representing the number of samples in the k-th cluster, we get N. k Replace the initial cluster center O of the cluster k Repeat the above process until the cluster centers of all clusters have been updated, denoted as . Calculate all samples to The sum of squared errors between them, i.e. In the formula, β represents the sum of squared errors. When β is less than a specified threshold, the K-means algorithm ends and the final scene classification result is obtained; otherwise, the above cluster center update process is repeated until the cluster centers no longer change. A clustering consistency loss is introduced. After the cluster centers are updated, an additional clustering consistency loss L is calculated for each mini-batch during training. clust : Total loss function L total That is: THE total =L Re +L KL +λL clust (21) In the formula, N batch λ is the number of small samples contained in a mini-batch. Mini-batch is a training method that divides the entire dataset into multiple small batch subsets. In each iteration, only samples from one batch are used to calculate the gradient and update the model parameters, which improves training efficiency while maintaining convergence stability. λ is a weight parameter used to adjust the proportion of cluster consistency loss in the overall objective. In each training iteration, the Conditional Variational Autoencoder (CVAE) updates its parameters through mini-batch and continuously uses the latest cluster center feedback to adjust the cluster consistency loss. This dynamically optimizes the latent representation while reducing reconstruction error and KL divergence, allowing similar samples to cluster more closely in their respective cluster centers in the low-dimensional space, ultimately resulting in accurate clustering results.

10. A net load scenario classification system according to claim 9, characterized in that, The method used in the scene generation unit to select and evaluate the most representative curve using Medoid is as follows: The similarity between all curves is calculated using Euclidean distance, and the most representative curve in the clustering scenario dataset is selected using Medoid. Medoid calculates the similarity between all curves using Euclidean distance, resulting in the Euclidean distance matrix D. The specific calculation method is as follows: The Euclidean distance is calculated as follows: In the formula, X input The input sequence; The distance between curves is calculated based on Euclidean distance, yielding the distance between all net load curves in a given scenario. The total distance S between each curve and all other curves is then calculated. i : Finally, the minimum total distance S between the curves is calculated. i This yields the Medoid curve as a representative curve for a typical scenario: X medoid =argminS i (25) The scene classification results were evaluated using the silhouette coefficient SS, the Davidson-Bolding index DBI, and the Kalinsky-Harabass index CHI. The silhouette coefficient (SS) has a range of [-1, 1], and a larger value indicates a better clustering effect. In the formula, a(i) represents the intra-class tightness and b(i) represents the inter-class separation. A smaller Davidson-Bauerdin index (DBI) indicates higher intra-class compactness and inter-class separation. In the formula, K is the number of clusters, and S i The average distance from the sample to the centroid within cluster i, d(c i ,c j () represents the distance between the centers of mass; A higher Kalinsky-Harabás index (CHI) value indicates a clearer cluster structure. In the formula, B k W represents the discrete matrix between classes. k tr() represents a discrete matrix within a class, and tr() represents the trace of the matrix.