Methods, apparatus, electronic devices and storage media for obtaining typical daily load curves
By introducing joint training of reconstruction loss and clustering loss into the Transformer model, the problems of feature randomness and feature drift in deep clustering in high-dimensional power data are solved, thereby improving the accuracy and stability of power user classification.
Patent Information
- Application Number
- CN202210606149.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-05-31
- Publication Date
- 2025-10-31
- Estimated Expiration
- 2042-05-31
AI Technical Summary
Existing deep learning-based clustering methods struggle to handle high-dimensional power data, especially in power user classification, where they suffer from issues of feature randomness and feature drift.
We employ a Transformer pre-trained model combined with K-means clustering, and use a joint training method of reconstruction loss and clustering loss to avoid feature randomness and feature drift, thereby extracting global features.
It effectively solves the problems of feature randomness and feature drift in high-dimensional power data by deep clustering, and improves the accuracy and stability of power user classification.
Smart Images

Figure CN114841288B_ABST
Abstract
Description
Technical Field
[0001] This application relates to the technical field of electricity user classification, and in particular to a method, apparatus, electronic device, and storage medium for obtaining a typical daily load curve. Background Technology
[0002] Electricity user classification refers to classifying users using Typical Daily Load Lines (TDLPs). Obtaining TDLPs requires clustering electricity data. Currently, clustering methods are mainly divided into two types: traditional clustering and deep clustering.
[0003] There are five common methods based on traditional clustering: partition-based clustering algorithms, hierarchical clustering algorithms, density-based clustering algorithms, grid-based clustering algorithms, and model-based clustering algorithms.
[0004] Among the various clustering algorithms, K-means and K-medians are commonly used based on partitioning. These are simple and practical algorithms with good clustering results, capable of reaching local optima. However, they require specifying the value of K (the number of clusters) and are not suitable for multi-class classification tasks or highly discrete classifications. Hierarchical clustering algorithms mainly include agglomerative and splitting algorithms. They do not require specifying the number of clusters, but they perform poorly on high-dimensional data features and on non-hypersphere or convex regions. Density-based clustering algorithms include DBSCAN, which can handle clusters of any shape and detect outliers. However, it requires a given data point radius r and a minimum number of clusters m, making it sensitive to input parameters. Grid-based clustering algorithms include Self-Organizing Feature Maps (SOM), which produce clustering results with high visualization and interpretability, but its clustering time is too long and it lacks a defined objective function. Model-based clustering algorithms refer to methods based on probabilistic models. A representative algorithm is the Gaussian Mixture Model (GMM). Its results can be represented by probabilities, and the category can be predicted based on the probabilities. However, it requires complete sample information to make predictions and loses its effectiveness in high-dimensional spaces.
[0005] Traditional clustering algorithms each have their advantages, but they share a common drawback: they struggle to handle high-dimensional data. Electricity data used for electricity user classification is characterized by its large volume and high dimensionality. Therefore, to address the issue of high data dimensionality, deep learning-based clustering methods (deep clustering) have attracted significant attention from researchers.
[0006] Deep learning-based clustering methods can be broadly categorized into two types: multi-stage learning and joint learning. Multi-stage learning methods include RLPC-DCAE, AE-TSC, and CA-MTD. These methods all utilize a deep convolutional autoencoder (DCAE) neural network architecture, employing reconstruction loss and K-means clustering algorithm. The purpose of training the DCAE is to obtain intermediate dimensionality-reduced features, which are then used in the clustering algorithm to optimize the clustering loss, resulting in TDLP. However, this learning approach has a drawback: it may lead to feature randomness. Therefore, to address this issue, joint learning methods can be used, jointly training the reconstruction and clustering losses to avoid feature randomness. Common joint learning methods include DEC, IDEC, and DETECT. DEC and IDEC both use the DCAE neural network model, but they differ in that DEC removes the decoder after pre-training, while IDEC retains the decoder. Compared to DEC, IDEC preserves the local structure of the features, resulting in more complete generated features. DETECT uses a completely different neural network: RNN. This type of network is more capable of capturing temporal features on power datasets. However, neither DCAE nor RNN can capture global features, and these models also struggle to address the feature drift problem. Summary of the Invention
[0007] Based on this, the present invention provides a method, apparatus, electronic device and storage medium for obtaining typical daily load curves, and avoids the problem of feature drift by using a joint training method of reconstruction loss and clustering loss.
[0008] In a first aspect, embodiments of this application provide a method for obtaining a typical daily load curve, the method comprising the following steps:
[0009] Obtain the initial power data to be classified;
[0010] The power data is subjected to data embedding processing to obtain a set of embedding vectors for the power data.
[0011] The set of embedded vectors is input into a trained deep clustering model to obtain the dimensionality-reduced latent features; wherein, the deep clustering model is trained by jointly training reconstruction loss and clustering loss;
[0012] K-means clustering is performed on the potential features to obtain the daily load curve corresponding to the power data.
[0013] Optionally, the training process of the deep clustering model includes:
[0014] Obtain the dataset and test set for training;
[0015] The deep clustering model is pre-trained using the dataset to obtain a pre-trained deep clustering model;
[0016] The pre-trained deep clustering model is jointly optimized and trained using the weighted value of reconstruction loss and clustering loss as the joint loss to obtain the jointly optimized deep clustering model.
[0017] The joint optimized deep clustering model is tested and evaluated using the test set. When the joint optimized deep clustering model meets the evaluation threshold, a trained deep clustering model is obtained.
[0018] Optionally, the pre-trained deep clustering model can be jointly optimized and trained using a weighted average of the reconstruction loss and clustering loss as the joint loss, including the following steps:
[0019] The joint loss minL is obtained using the following formula. t :
[0020] minL t =λL rec +(1-λ)L clu
[0021] Where, minL t The loss is the joint loss, where λ is a dynamic coefficient that gradually decreases with the number of iterations; L rec To rebuild the losses, L clu Clustering loss;
[0022] The initial value of λ is set to 0.9, and then decreased by 0.05 every 10 iterations. The pre-trained deep clustering model is then jointly optimized and trained until the value of λ is 0.1.
[0023] Optionally, the joint optimized deep clustering model is tested and evaluated using the test set, including the following steps:
[0024] The embedding vector set of the test set is input into the joint optimized deep clustering model to obtain the latent features of the test set;
[0025] K-means clustering is performed on the latent features of the test set using the following formula:
[0026]
[0027] Where, x i It is the input vector, c i It is x i The cluster to which it belongs Z represents the center point corresponding to the cluster, i.e., the latent spatial feature z, and N is the number of samples;
[0028] Cluster performance is evaluated using the RI metric and normalized mutual information.
[0029] Optionally, testing and evaluating the joint optimized deep clustering model using the test set further includes the following steps:
[0030] The K-means clustering results were validated using the Wilcoxon signed-rank test.
[0031] Optionally, the deep clustering model is a Transformer model.
[0032] Optionally, obtain the dataset and test set used for training, including:
[0033] Obtain initial power data for training;
[0034] Data embedding is performed on the initial power data to obtain a set of embedding vectors for the initial power data;
[0035] Feature scaling is applied to the set of embedded vectors to obtain the dataset for training and the test set.
[0036] Secondly, embodiments of this application provide a device for obtaining a typical daily load curve, comprising:
[0037] The power data acquisition module is used to acquire the initial power data to be classified.
[0038] The data embedding module is used to perform data embedding processing on the power data to obtain a set of embedding vectors for the power data.
[0039] The feature extraction module is used to input the set of embedded vectors into a trained deep clustering model to obtain the dimensionality-reduced latent features; wherein, the deep clustering model is trained by jointly training reconstruction loss and clustering loss;
[0040] The clustering module is used to perform K-means clustering on the potential features to obtain the daily load curve corresponding to the power data.
[0041] Thirdly, the present invention also provides an electronic device, comprising:
[0042] At least one memory and at least one processor;
[0043] The memory is used to store one or more programs;
[0044] When the one or more programs are executed by the at least one processor, the at least one processor performs the steps of a method for obtaining a typical daily load curve as described in any of the first aspects of the invention.
[0045] Fourthly, the present invention also provides a computer-readable storage medium.
[0046] The computer-readable storage medium stores a computer program that, when executed by a processor, implements the steps of a method for obtaining a typical daily load curve as described in any of the first aspects of the present invention.
[0047] In this embodiment, to address the problem of deep clustering's difficulty in capturing global features, this invention introduces a Transformer pre-trained model and proposes a Transformer-based deep clustering model. This model first pre-trains using the original Transformer model; however, unlike the original Transformer, it lacks a masking module, requiring the generated results to closely approximate the original input to obtain the reconstruction loss. Furthermore, the Transformer model pre-trained with power data effectively prevents feature randomness. Subsequently, a clustering loss algorithm is embedded between the Transformer model (decoder and encoder), using K-means because it is efficient and robust in most models. Then, through joint training, the reconstruction loss and clustering loss are trained, each with a dynamic coefficient term. These dynamic coefficients are updated with the number of iterations. The coefficient of the reconstruction loss term gradually decreases with increasing iterations, while the coefficient of the clustering loss term gradually increases. This shifts the training focus from reconstruction to clustering, thus avoiding feature drift. The number of iterations is manually set. Finally, the electricity data is input into the trained model, the dimensionality-reduced features are extracted, and then fed into the K-means algorithm to output the clustering results. The centroid of each cluster is the required Typical Daily Load Line (TDLP). The TDLP is then analyzed to obtain the final electricity user classification.
[0048] To more clearly illustrate the technical solutions in the embodiments of this application or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of this application. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort. Attached Figure Description
[0049] Figure 1 A flowchart illustrating a method for obtaining a typical daily load curve provided by the present invention;
[0050] Figure 2 This is a schematic diagram of the original Transformer model used in this invention;
[0051] Figure 3This is a schematic diagram of the RI index results in one embodiment of the present invention;
[0052] Figure 4 This is a schematic diagram of the normalized mutual information training result in one embodiment of the present invention;
[0053] Figure 5 This is a schematic diagram of a typical daily load curve obtained in one embodiment of the present invention;
[0054] Figure 6 This is a schematic diagram of a typical daily load curve acquisition device provided by the present invention. Detailed Implementation
[0055] To make the objectives, technical solutions, and advantages of this application clearer, the embodiments of this application will be described in further detail below with reference to the accompanying drawings.
[0056] It should be understood that the described embodiments are merely some, not all, of the embodiments of this application. All other embodiments obtained by those skilled in the art based on the embodiments of this application without creative effort are within the scope of protection of the embodiments of this application.
[0057] The terminology used in the embodiments of this application is for the purpose of describing particular embodiments only and is not intended to limit the embodiments of this application. The singular forms “a,” “the,” and “the” used in the embodiments of this application and the appended claims are also intended to include the plural forms unless the context clearly indicates otherwise. It should also be understood that the term “and / or” as used herein refers to and includes any or all possible combinations of one or more of the associated listed items.
[0058] In the following description, when referring to the accompanying drawings, unless otherwise indicated, the same numbers in different drawings represent the same or similar elements. The embodiments described in the following exemplary embodiments do not represent all embodiments consistent with this application. Rather, they are merely examples of apparatuses and methods consistent with some aspects of this application as detailed in the appended claims. In the description of this application, it should be understood that the terms "first," "second," "third," etc., are used only to distinguish similar human bodies and are not necessarily used to describe a specific order or sequence, nor should they be construed as indicating or implying relative importance. Those skilled in the art can understand the specific meaning of the above terms in this application according to the specific circumstances.
[0059] Furthermore, in the description of this application, unless otherwise stated, "multiple" means two or more. "And / or" describes the relationship between related human beings, indicating that three relationships can exist. For example, A and / or B can represent: A alone, A and B simultaneously, or B alone. The character " / " generally indicates that the preceding and following related human beings have an "or" relationship.
[0060] To address the technical problems mentioned in the background section, this invention proposes a method for obtaining a typical daily load curve, such as... Figure 1 As shown, the method includes the following steps:
[0061] S01: Obtain the initial power data to be classified.
[0062] In one specific embodiment, the power data is time-series data.
[0063] S02: Perform data embedding processing on the power data to obtain a set of embedding vectors for the power data.
[0064] In a preferred embodiment, the power data is encoded using One-Hot encoding and then Word Embedding is used to obtain a set of embedding vectors x for the power data.
[0065] S03: Input the set of embedded vectors into the trained deep clustering model to obtain the dimensionality-reduced latent features; wherein, the deep clustering model is trained by jointly training reconstruction loss and clustering loss.
[0066] S04: Perform K-means clustering on the potential features to obtain the daily load curve corresponding to the power data.
[0067] In a specific embodiment, to avoid the problem that the encoder is trained first and then the K-means algorithm is trained in multi-stage training, resulting in little connection between the trained encoder and K-means, and the features generated by the encoder will have random characteristics, which is not conducive to clustering, this invention uses a joint training method. While training the model reconstruction loss, it also takes into account the training clustering loss, generating features specific to good clustering, thereby avoiding the problem of random features.
[0068] Preferably, the training process of the deep clustering model used in this invention includes:
[0069] S11: Obtain the dataset and test set for training.
[0070] In one specific embodiment, the power data used in this invention comes from the UCR time series archive, which contains 128 datasets (https: / / www.cs.ucr.edu / ~eamonn / time_series_data_2018 / ). This invention uses the power-related datasets ElectricDevices, ItalyPowerDemand, LargeKitchenAppliances, ScreenType, etc., each of which includes a training set and a test set.
[0071] The original dataset needs to undergo data embedding and data preprocessing. Specifically, this includes:
[0072] One-Hot encoding is used on the power data, and then Word Embedding is used to obtain the set of embedding vectors x of the power data.
[0073] Feature scaling is applied to the set of embedded vectors x using the following formula:
[0074]
[0075] Where x is the set of embedding vectors, min(x) refers to the minimum value in set x, and max(x) refers to the maximum value in set x. i Let x' be an independent vector in set x. i It is a rescaled vector.
[0076] After the above processing, we obtain the dataset and test set for training.
[0077] S12: Use the dataset to pre-train the deep clustering model to obtain a pre-trained deep clustering model.
[0078] In a preferred embodiment, the model used for pre-training is a Transformer, such as... Figure 2 As shown, it consists of an encoder and a decoder. No mask is used here; the preprocessed x' is used. i The input to the model is used to generate latent spatial features z, and at the same time, an output set y consistent with the input is generated. The output is used for reconstruction loss. The initial number of pre-training iterations is 50.
[0079] S13: Using the weighted average of reconstruction loss and clustering loss as the joint loss, the pre-trained deep clustering model is jointly optimized and trained to obtain the jointly optimized deep clustering model.
[0080] Given an input set of embedded vectors x, we will obtain a reconstructed output set y. Here, mean squared error (MSE) is used as the reconstruction loss, and the loss function is as follows:
[0081]
[0082] The latent feature set z obtained from the model is used as static data H, which will yield the Gram matrix H. T H, then use spectral relaxation to transform the K-means clustering loss into:
[0083] minL clu =Tr(H T H)-Tr(F T H T HF)
[0084] Since H is a static matrix, finding the minimum clustering loss is transformed into:
[0085]
[0086] Where Tr is the trace of the matrix, and F is the trace of the matrix. T Let F be an orthogonal matrix. According to the Ky-Fan theorem, the first k singular vectors of H constitute a closed-form solution of F.
[0087] To address the feature drift issue, a dynamic coefficient λ is used to combine the two losses. λ gradually decreases with the number of iterations, initially set to 0.9, decreasing by 0.05 every 10 iterations until it reaches 0.1, for a total of 160 iterations. The final total loss for joint training is as follows:
[0088] minL t =λL rec +(1-λ)L clu )
[0089] S14: Use the test set to test and evaluate the joint optimized deep clustering model. When the joint optimized deep clustering model meets the evaluation threshold, the trained deep clustering model is obtained.
[0090] First, clustering performance is evaluated. After the model is trained, it is input into the test set, and then K-means is used to cluster the test set. The K-means algorithm is as follows:
[0091]
[0092] Where x i It is the input vector, c i It is x i The cluster to which it belongs Z represents the center point corresponding to the cluster, i.e., the latent spatial feature z, and N is the number of samples.
[0093] This invention requires the use of RI metrics and normalized mutual information (NMI) to evaluate cluster performance.
[0094] The RI index is as follows:
[0095]
[0096] Where TP (true number) is the number of time series logs that are correctly placed in the same cluster, TN (true negative number) is the number of logs that are correctly placed in different clusters, and N is the size of the dataset.
[0097] RI index results are as follows Figure 3 As shown, the vertical axis represents the RI index, and the horizontal axis represents the number of iterations (set to 2000).
[0098] The formula for Normalized Mutual Information (NMI) is as follows:
[0099]
[0100] Normalized mutual information training results are as follows Figure 4 As shown, Y represents the basic truth label, C represents the cluster label, I represents the mutual information metric, and H represents the entropy.
[0101] Clustering validation was then performed. The Wilcoxon signed-rank test was used, which sums the ranks of the absolute differences between the observed values and the central locations of the null hypothesis, assigning different signs to each rank, to obtain the test statistic. For i = 1, 2, ..., n, |x| is calculated. i -c0| represents the distance from these sample points to c0. Sort the n absolute values and find their n ranks. If they have the same sample points, take the average rank of each point. Let W + equals x i -c0>0 of |x i -c0| the sum of ranks, while W - equals x i -c0<0 of |x i -c0|The sum of ranks. For the two-sided test H0:M=M0<=>H1:M≠M0, under the null hypothesis, W + and W - They should be roughly the same. Therefore, when one of them is very small, the null hypothesis should be questioned. Here, we take the test statistic W = W + Or W = W -Based on the obtained W value, use statistical software or consult the Wilcoxon signed-rank test distribution table to obtain the p-value under the null hypothesis. If n is large, use a normal approximation: obtain the value of a normal random variable Z related to W, and then use software or consult a normal distribution table to obtain the p-value. If the p-value is small (e.g., less than or equal to the given significance level, such as 0.05), the null hypothesis can be rejected. If the p-value is large, there is insufficient evidence to reject the null hypothesis, but it does not mean that the null hypothesis should be accepted.
[0102] The trained deep clustering model described above can be used for the formation and analysis of electricity user groups. In a specific embodiment, such as... Figure 5 As shown, based on the initial electricity data to be classified, after data embedding, model feature extraction, and K-means clustering, the centroid c is obtained, which is equivalent to obtaining the Typical Daily Load Curve (TDLP). Then, manual analysis is performed to determine which type of electricity user the TDLP belongs to. In other embodiments, a pre-trained Typical Daily Load Curve identification model can also be used to automatically analyze the type of electricity user the TDLP belongs to.
[0103] To address the challenge of capturing global features in deep clustering, this invention introduces a Transformer pre-trained model and proposes a Transformer-based deep clustering model. This model first pre-trains using the original Transformer model, but unlike the original, it lacks a masking module. The generated results need to closely approximate the original input to obtain the reconstruction loss. Furthermore, the Transformer model pre-trained with power data effectively prevents feature randomness. Subsequently, a clustering loss algorithm is embedded between the Transformer model (decoder and encoder). K-means is used due to its efficiency and robustness in most models. Then, the reconstruction and clustering losses are trained jointly, each with a dynamic coefficient term. These coefficients are updated with the number of iterations. The reconstruction loss coefficient gradually decreases with increasing iterations, while the clustering loss coefficient gradually increases. This shifts the training focus from reconstruction to clustering, avoiding feature drift. The number of iterations is manually set. Finally, the electricity data is input into the trained model, the dimensionality-reduced features are extracted, and then fed into the K-means algorithm to output the clustering results. The centroid of each cluster is the required Typical Daily Load Line (TDLP). The TDLP is then analyzed to obtain the final electricity user classification.
[0104] In this embodiment, a deep learning neural network model, Transformer, is used. By setting fewer neural nodes than the power data dimension through the feedforward neural network in Transformer, dimensionality reduction is achieved, which can effectively extract high-dimensional features. Compared with multi-stage deep clustering methods, this invention uses a joint training approach for Transformer and K-means. In multi-stage training, the encoder is trained first and then the K-means algorithm is trained. In this way, there is not much connection between the trained encoder and K-means, and the features generated by the encoder have random characteristics, which is not conducive to clustering. On the contrary, by using a joint training approach, the clustering loss is trained while the model reconstruction loss is trained, generating features specific to good clustering, thereby avoiding the problem of random features. Compared to other deep clustering joint training methods, the Transformer model can capture the temporal nodes of the entire power data through a self-attention mechanism. Specifically, the power data is first converted into an embedding vector matrix, which is divided into three types: Query, Key, and Value (Q, K, V). The difference between them is the weight W. The attention score is obtained by multiplying matrices Q and K, and then multiplied with V as a weight. The whole process is equivalent to a weighted summation. However, unlike other models, its weighted summation covers the entire vector (sequence), which can capture global features and make up for the shortcomings of other models that can only capture local features. Finally, to address the drawback of feature drift, dynamic coefficients are used for both the reconstruction and clustering loss terms. These coefficients change dynamically with the number of iterations, gradually shifting the focus from reconstruction to clustering. Because the features are randomly selected at the beginning of model training, the clustering effect is not good. However, after a certain number of iterations, the reconstruction loss term gradually decreases, indicating that the values of the input and output vectors are becoming increasingly similar. The resulting dimensionality-reduced features are exactly what the model needs. At this point, the coefficient of the reconstruction loss term can be gradually reduced, decreasing its weight, and the focus can be shifted to the clustering loss term by increasing its coefficient. This results in features that are biased towards well-clustered clusters, thus avoiding feature drift.
[0105] like Figure 6 As shown, corresponding to the above-described method for obtaining a typical daily load curve, this application embodiment also provides a typical daily load curve acquisition device 400, which includes:
[0106] The power data acquisition module 401 is used to acquire the initial power data to be classified.
[0107] Data embedding module 402 is used to perform data embedding processing on the power data to obtain a set of embedding vectors for the power data;
[0108] The feature extraction module 403 is used to input the set of embedded vectors into the trained deep clustering model to obtain the dimensionality-reduced latent features; wherein, the deep clustering model is trained by jointly training reconstruction loss and clustering loss;
[0109] Clustering module 404 is used to perform K-means clustering on the potential features to obtain the daily load curve corresponding to the power data.
[0110] Preferably, the training process of the deep clustering model includes:
[0111] Obtain the dataset and test set for training;
[0112] The deep clustering model is pre-trained using the dataset to obtain a pre-trained deep clustering model;
[0113] The pre-trained deep clustering model is jointly optimized and trained using the weighted value of reconstruction loss and clustering loss as the joint loss to obtain the jointly optimized deep clustering model.
[0114] The joint optimized deep clustering model is tested and evaluated using the test set. When the joint optimized deep clustering model meets the evaluation threshold, a trained deep clustering model is obtained.
[0115] Preferably, the pre-trained deep clustering model is jointly optimized and trained using a weighted average of the reconstruction loss and clustering loss as the joint loss, including the following steps:
[0116] The joint loss minL is obtained using the following formula. t :
[0117] minL t =λL rec +(1-λ)L clu
[0118] Where, minL t The loss is the joint loss, where λ is a dynamic coefficient that gradually decreases with the number of iterations; L rec To rebuild the losses, L clu Clustering loss;
[0119] The initial value of λ is set to 0.9, and then decreased by 0.05 every 10 iterations. The pre-trained deep clustering model is then jointly optimized and trained until the value of λ is 0.1.
[0120] Preferably, the joint optimized deep clustering model is tested and evaluated using the test set, including the following steps:
[0121] The embedding vector set of the test set is input into the joint optimized deep clustering model to obtain the latent features of the test set;
[0122] K-means clustering is performed on the latent features of the test set using the following formula:
[0123]
[0124] Where, x i It is the input vector, c i It is x i The cluster to which it belongs Z represents the center point corresponding to the cluster, i.e., the latent spatial feature z, and N is the number of samples;
[0125] Cluster performance is evaluated using the RI metric and normalized mutual information.
[0126] Preferably, the testing and evaluation of the joint optimized deep clustering model using the test set further includes the following steps:
[0127] The K-means clustering results were validated using the Wilcoxon signed-rank test.
[0128] Preferably, the deep clustering model is the Transformer model.
[0129] Preferably, the dataset and test set used for training are obtained, including:
[0130] Obtain initial power data for training;
[0131] Data embedding is performed on the initial power data to obtain a set of embedding vectors for the initial power data;
[0132] Feature scaling is applied to the set of embedded vectors to obtain the dataset for training and the test set.
[0133] For the apparatus embodiments, since they basically correspond to the method embodiments, the relevant parts can be referred to in the description of the method embodiments. The apparatus embodiments described above are merely illustrative, and the units described as separate components may or may not be physically separate, and the components shown as units may or may not be physical units. Those skilled in the art will clearly understand that, for the sake of convenience and brevity, the specific working processes of the systems, apparatuses, and units described above can be referred to the corresponding processes in the foregoing method embodiments, and will not be repeated here.
[0134] This application also provides an electronic device, including:
[0135] At least one memory and at least one processor;
[0136] The memory is used to store one or more programs;
[0137] When the one or more programs are executed by the at least one processor, the at least one processor performs the steps of a method for obtaining a typical daily load curve as described above.
[0138] For the device embodiments, since they basically correspond to the method embodiments, the relevant parts can be referred to in the description of the method embodiments. The device embodiments described above are merely illustrative. The components described as separate parts may or may not be physically separate, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed across multiple network units. Some or all of the modules can be selected to achieve the purpose of this disclosure according to actual needs. Those skilled in the art can understand and implement this without creative effort.
[0139] This application also provides a computer-readable storage medium.
[0140] The computer-readable storage medium stores a computer program that, when executed by a processor, implements the steps of a method for obtaining a typical daily load curve as described above.
[0141] Computer storage media include permanent and non-permanent, removable and non-removable media, and information storage can be achieved by any method or technology. Information can be computer-readable instructions, data structures, program modules, or other data. Examples of computer storage media include, but are not limited to: phase-change memory (PRAM), static random access memory (SRAM), dynamic random access memory (DRAM), other types of random access memory (RAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), flash memory or other memory technologies, CD-ROM, digital versatile optical disc (DVD) or other optical storage, magnetic tape, magnetic magnetic disk storage or other magnetic storage devices, or any other non-transfer medium that can be used to store information accessible by computing devices.
[0142] Corresponding to the method for obtaining the typical daily load curve described above, this application also provides a smart walking aid, comprising:
[0143] At least one memory and at least one processor;
[0144] The memory is used to store one or more programs;
[0145] When the one or more programs are executed by the at least one processor, the at least one processor performs the steps of the method for obtaining a typical daily load curve as described in any of the above embodiments.
[0146] Corresponding to the method for obtaining a typical daily load curve described above, this application also provides a controller, including:
[0147] At least one memory and at least one processor;
[0148] The memory is used to store one or more programs;
[0149] When the one or more programs are executed by the at least one processor, the at least one processor performs the steps of the method for obtaining a typical daily load curve as described in any of the above embodiments.
[0150] It should be understood that the embodiments of this application are not limited to the precise structures described above and shown in the accompanying drawings, and various modifications and changes can be made without departing from their scope. The scope of the embodiments of this application is limited only by the appended claims.
[0151] The above-described embodiments are merely illustrative of several implementation methods of the embodiments of this application, and their descriptions are relatively specific and detailed, but they should not be construed as limiting the scope of the invention patent. It should be noted that those skilled in the art can make several modifications and improvements without departing from the concept of the embodiments of this application, and these all fall within the protection scope of the embodiments of this application.
Claims
1. A method for obtaining a typical daily load curve, characterized in that, Includes the following steps: Obtain the initial power data to be classified; The power data is subjected to data embedding processing to obtain a set of embedding vectors for the power data. The set of embedded vectors is input into a trained deep clustering model to obtain the dimensionality-reduced latent features; wherein, the deep clustering model is trained by jointly training reconstruction loss and clustering loss; K-means clustering is performed on the potential features to obtain the daily load curve corresponding to the power data; The deep clustering model is the Transformer model.
2. The method for obtaining a typical daily load curve according to claim 1, characterized in that, The training process of the deep clustering model includes: Obtain the dataset and test set for training; The deep clustering model is pre-trained using the dataset to obtain a pre-trained deep clustering model; The pre-trained deep clustering model is jointly optimized and trained using the weighted value of reconstruction loss and clustering loss as the joint loss to obtain the jointly optimized deep clustering model. The joint optimized deep clustering model is tested and evaluated using the test set. When the joint optimized deep clustering model meets the evaluation threshold, a trained deep clustering model is obtained.
3. The method for obtaining a typical daily load curve according to claim 2, characterized in that, The pre-trained deep clustering model is jointly optimized and trained using a weighted average of the reconstruction loss and clustering loss as the joint loss, including the following steps: The joint loss minL is obtained using the following formula. t : minL t =λL rec +(1-λ)L clu Where, minL t The loss is the joint loss, where λ is a dynamic coefficient that gradually decreases with the number of iterations; L rec To rebuild the losses, L clu Clustering loss; The initial value of λ is set to 0.9, and then decreased by 0.05 every 10 iterations. The pre-trained deep clustering model is then jointly optimized and trained until the value of λ is 0.
1.
4. The method for obtaining a typical daily load curve according to claim 2, characterized in that, The joint optimized deep clustering model is tested and evaluated using the test set, including the following steps: The embedding vector set of the test set is input into the joint optimized deep clustering model to obtain the latent features of the test set; K-means clustering is performed on the latent features of the test set using the following formula: Where, x i It is the input vector, c i It is x i The cluster to which it belongs Z represents the center point corresponding to the cluster, i.e., the latent spatial feature z, and N is the number of samples; Cluster performance is evaluated using the RI metric and normalized mutual information.
5. The method for obtaining a typical daily load curve according to claim 4, characterized in that, The test set is used to evaluate the joint optimized deep clustering model, which further includes the following steps: The K-means clustering results were validated using the Wilcoxon signed-rank test.
6. The method for obtaining a typical daily load curve according to claim 2, characterized in that, Obtain the dataset and test set for training, including: Obtain initial power data for training; Data embedding is performed on the initial power data to obtain a set of embedding vectors for the initial power data; Feature scaling is applied to the set of embedded vectors to obtain the dataset for training and the test set.
7. A device for acquiring a typical daily load curve, characterized in that, include: The power data acquisition module is used to acquire the initial power data to be classified. The data embedding module is used to perform data embedding processing on the power data to obtain a set of embedding vectors for the power data. The feature extraction module is used to input the set of embedded vectors into the trained deep clustering model to obtain the dimensionality-reduced latent features; wherein, the deep clustering model is a Transformer model, which is trained by jointly training reconstruction loss and clustering loss; The clustering module is used to perform K-means clustering on the potential features to obtain the daily load curve corresponding to the power data.
8. An electronic device, characterized in that, include: At least one memory and at least one processor; The memory is used to store one or more programs; When the one or more programs are executed by the at least one processor, the at least one processor implements the steps of a method for obtaining a typical daily load curve as described in any one of claims 1-6.
9. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a computer program that, when executed by a processor, implements the steps of a method for obtaining a typical daily load curve as described in any one of claims 1-6.