Method and device for enhancing electric quantity time sequence data of electric energy meter based on multi-scale condition
By using multi-scale feature extraction and physical constraint processing, the problems of insufficient consideration of time correlation and external conditions in the enhancement of electricity meter power data are solved, and high-quality electricity meter power data that conforms to the characteristics of electricity meters are generated.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-12-22
- Publication Date
- 2026-04-07
AI Technical Summary
In the process of enhancing electricity meter data, existing technologies and traditional methods destroy the temporal correlation of the data, making it difficult for the generated data to maintain the true electricity consumption behavior pattern. Furthermore, they lack consideration of external conditions and physical constraints, which affects the enhancement effect.
By combining multi-scale feature extraction and physical constraints, the original electricity meter data and external condition data are obtained. The data generator is then used to generate enhanced data that conforms to the physical laws of the electricity meter, including multi-scale feature extraction, data generation condition information and noise vector fusion, and physical constraint processing.
This enhances the effectiveness of electricity meter data generation, ensuring the authenticity of the generated data and its semantic consistency with external conditions. It also conforms to the physical laws of the electricity meter, thereby improving the authenticity and reliability of the data.
Smart Images

Figure CN121808376A_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of power electronics technology, and in particular to a method and apparatus for enhancing the time-series data of electricity meter power consumption based on multi-scale conditions. Background Technology
[0002] Currently, with the technological advancements and equipment upgrades in high-frequency data acquisition and broadband carrier technology, power data is poised for further explosive growth, making it crucial to leverage existing power data for its full potential. Based on the segmented areas of the power business, creating power data datasets is a new approach to facilitate smooth business operations and oversight, such as datasets for electricity meter usage, green power, and intelligent operation and maintenance.
[0003] In related technologies, the generation of electricity meter data sets relies on the augmentation of electricity meter data. Currently, electricity meter data augmentation is achieved by using traditional statistical methods to superimpose Gaussian white noise or uniform noise onto the original electricity meter data. While this can improve the robustness of the augmented electricity meter data to small perturbations, it severely disrupts the inherent temporal correlation of the electricity meter data, making it difficult for the generated electricity meter data to maintain the true electricity consumption behavior pattern, resulting in poor augmentation effects. Summary of the Invention
[0004] Therefore, it is necessary to provide a method and apparatus for enhancing the time-series data of electricity meter power consumption based on multi-scale conditions, which can improve the enhancement effect of electricity meter power consumption data and address the above-mentioned technical problems.
[0005] In a first aspect, this application provides an enhancement method for electricity meter time-series data based on multi-scale conditions, including:
[0006] Obtain raw electricity meter readings and external condition data;
[0007] Multi-scale feature extraction is performed on the original electricity meter data to obtain multi-scale spliced features;
[0008] The data generation condition information and noise vector are fused and then input into the data generator to obtain the preliminary time series data output by the data generator. The data generation condition information includes the multi-scale stitching features and the external condition data.
[0009] The preliminary time-series data is processed using physical constraints to obtain enhanced electricity meter data.
[0010] In one embodiment, after acquiring the original electricity meter readings and external condition data, the method further includes:
[0011] The original electricity meter data and the external condition data are preprocessed respectively; wherein the preprocessing operations include fractional normalization of the original electricity meter data and LSTM encoding of the external condition data.
[0012] In one embodiment, the original electricity meter data is time-series data of electricity meter usage. The step of extracting multi-scale features from the original electricity meter data to obtain multi-scale concatenated features includes:
[0013] Using convolution kernels of different widths, local features of the original electricity meter data at different time windows are extracted respectively.
[0014] The local features of the different time windows are stitched together to obtain the stitched local features;
[0015] A multi-head self-attention mechanism is used to extract features from the original electricity meter data to obtain global features;
[0016] The multi-scale spliced features are obtained based on the spliced local features and the global features.
[0017] In one embodiment, the data generator includes a gated loop unit, which includes a reset gate and an update gate; the reset gate is used to determine whether historical time-series data has been forgotten, and the update gate is used to determine whether to prioritize updating the forgotten historical time-series data or to prioritize updating the most recently input fused data into the data generator;
[0018] The process of fusing data generation condition information and noise vectors and inputting the resulting data into the data generator to obtain preliminary time-series data output by the data generator includes:
[0019] The data generation condition information and noise vector are fused and then input into the reset gate to obtain candidate hidden states;
[0020] The candidate hidden states are input into the update gate to obtain the final hidden state;
[0021] The final hidden state is mapped to the initial time series data.
[0022] In one embodiment, the physical constraints include nonnegativity constraints and / or cumulative monotonicity constraints.
[0023] In one embodiment, after processing the initial time-series data using physical constraints to obtain enhanced electricity meter data, the method further includes:
[0024] The enhanced electricity meter data is subjected to local branch discrimination and global branch discrimination by a multi-scale discriminator to obtain the validity discrimination result of the enhanced electricity meter data.
[0025] The local branch discrimination is used to evaluate the authenticity of the enhanced electricity meter data at different time scales, and the global branch discrimination is used to evaluate the global consistency of the enhanced electricity meter data.
[0026] In one embodiment, after processing the initial time-series data using physical constraints to obtain enhanced electricity meter data, the method further includes:
[0027] The intermediate features of the enhanced electricity meter data are extracted using a multi-scale discriminant.
[0028] Based on the intermediate features, the probability distribution data of each external condition corresponding to the enhanced generated electricity meter data are determined;
[0029] Based on the probability distribution data of each external condition, the semantic consistency between the enhanced generated electricity meter data and the external condition data is determined.
[0030] In one embodiment, after obtaining the enhanced electricity meter data, the method further includes:
[0031] Calculate the loss function value corresponding to the electricity meter data generated by the enhancement;
[0032] Use the loss function value to optimize the model parameters of the data generator;
[0033] The loss function value includes at least one of the following: adversarial loss value, dynamic time alignment loss value, conditional matching loss value, and physical constraint regularization loss value.
[0034] In one embodiment, after obtaining the enhanced electricity meter data, the method further includes:
[0035] The noise pattern in the energy meter data is obtained by learning from real energy meter data using a variational autoencoder.
[0036] The noise amplitude of the noise vector is dynamically adjusted based on the noise pattern and the relative entropy divergence feedback mechanism.
[0037] Secondly, this application also provides an enhancement device for electricity meter time-series data based on multi-scale conditions, comprising:
[0038] The acquisition module is used to acquire raw electricity meter data and external condition data.
[0039] The extraction module is used to extract multi-scale features from the original electricity meter data to obtain multi-scale spliced features.
[0040] The generation module is used to fuse data generation condition information and noise vector and input them into the data generator to obtain preliminary time series data output by the data generator. The data generation condition information includes the multi-scale splicing features and the external condition data.
[0041] The constraint module is used to process the preliminary time-series data using physical constraints to obtain enhanced electricity meter data.
[0042] In one embodiment, the acquisition module is further configured to perform preprocessing operations on the original electricity meter power data and the external condition data respectively; wherein the preprocessing operations include fractional normalization of the original electricity meter power data and LSTM encoding of the external condition data.
[0043] In one embodiment, the extraction module is further configured to use convolutional kernels of different widths to extract local features of the original electricity meter data in different time windows; to concatenate the local features of the different time windows to obtain concatenated local features; to use a multi-head self-attention mechanism to extract features from the original electricity meter data to obtain global features; and to obtain the multi-scale concatenated features based on the concatenated local features and the global features.
[0044] In one embodiment, the data generator includes a gated loop unit, which includes a reset gate and an update gate; the reset gate is used to determine whether historical time-series data has been forgotten, and the update gate is used to determine whether to prioritize updating the forgotten historical time-series data or to prioritize updating the most recently input fused data into the data generator;
[0045] The generation module is further configured to fuse the data generation condition information and the noise vector and input them into the reset gate to obtain a candidate hidden state; input the candidate hidden state into the update gate to obtain a final hidden state; and map the final hidden state to the preliminary time series data.
[0046] In one embodiment, the physical constraints include nonnegativity constraints and / or cumulative monotonicity constraints.
[0047] In one embodiment, the enhancement device based on multi-scale conditions for electricity meter time-series data further includes:
[0048] The discrimination module is used to perform local branch discrimination and global branch discrimination on the enhanced electricity meter power data through a multi-scale discriminator to obtain the validity discrimination result of the enhanced electricity meter power data;
[0049] The local branch discrimination is used to evaluate the authenticity of the enhanced electricity meter data at different time scales, and the global branch discrimination is used to evaluate the global consistency of the enhanced electricity meter data.
[0050] In one embodiment, the discrimination module is further configured to extract intermediate features of the enhanced generated electricity meter data using a multi-scale discriminator; determine the probability distribution data of each external condition corresponding to the enhanced generated electricity meter data based on the intermediate features; and determine the semantic consistency between the enhanced generated electricity meter data and the external condition data based on the probability distribution data of each external condition.
[0051] In one embodiment, the enhancement device based on multi-scale conditions for electricity meter time-series data further includes:
[0052] The optimization module is used to calculate the loss function value corresponding to the enhanced electricity meter data; and to optimize the model parameters of the data generator using the loss function value.
[0053] The loss function value includes at least one of the following: adversarial loss value, dynamic time alignment loss value, conditional matching loss value, and physical constraint regularization loss value.
[0054] In one embodiment, the optimization module is further configured to learn from real electricity meter power data using a variational autoencoder to obtain a noise pattern in the electricity meter power data; and dynamically adjust the noise amplitude of the noise vector according to the noise pattern and a relative entropy divergence feedback mechanism.
[0055] Thirdly, this application also provides a computer device, including a memory and a processor, wherein the memory stores a computer program, and the processor executes the computer program to implement the above-described method for enhancing the electricity meter time-series data based on multi-scale conditions in the first aspect.
[0056] Fourthly, this application also provides a computer-readable storage medium having a computer program stored thereon, wherein the computer program, when executed by a processor, implements the above-described method for enhancing the electricity meter time-series data based on multi-scale conditions in the first aspect.
[0057] Fifthly, this application also provides a computer program product, including a computer program that, when executed by a processor, implements the method for enhancing the electricity meter's time-series data based on multi-scale conditions as described in the first aspect.
[0058] The aforementioned method and apparatus for enhancing electricity meter time-series data based on multi-scale conditions acquires original electricity meter data and external condition data; performs multi-scale feature extraction on the original electricity meter data to obtain multi-scale spliced features; fuses data generation condition information and noise vectors and inputs them into a data generator to obtain preliminary time-series data output by the data generator. The data generation condition information includes multi-scale spliced features and external condition data; and processes the preliminary time-series data using physical constraints to obtain enhanced electricity meter data. Because multi-scale feature extraction is performed on the original electricity meter data, short-term fluctuations and long-term trends of the electricity meter data can be captured, improving the authenticity of the enhanced electricity meter data. Furthermore, the introduction of physical constraints to process the generated data ensures that the enhanced electricity meter data conforms to the physical laws of the electricity meter, thereby improving the enhancement effect of the electricity meter data. Attached Figure Description
[0059] To more clearly illustrate the technical solutions in the embodiments of this application or related technologies, the drawings used in the description of the embodiments of this application or related technologies will be briefly introduced below. Obviously, the drawings described below are only some embodiments of this application. For those skilled in the art, other related drawings can be obtained based on these drawings without creative effort.
[0060] Figure 1 An application environment diagram for an enhancement method based on multi-scale conditions for electricity meter time-series data provided in this application embodiment;
[0061] Figure 2 A flowchart illustrating a method for enhancing electricity meter time-series data based on multi-scale conditions, provided in an embodiment of this application;
[0062] Figure 3 A flowchart illustrating another method for enhancing electricity meter time-series data based on multi-scale conditions, provided in an embodiment of this application;
[0063] Figure 4 A structural block diagram of an enhancement device for electricity meter time-series data based on multi-scale conditions, provided in an embodiment of this application;
[0064] Figure 5 This is an internal structural diagram of a computer device provided in an embodiment of this application. Detailed Implementation
[0065] To make the objectives, technical solutions, and advantages of this application clearer, the following detailed description is provided in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are merely illustrative and not intended to limit the scope of this application.
[0066] The relevant technologies will be explained below.
[0067] Currently, with the technological advancements and equipment upgrades in high-frequency data acquisition and broadband carrier technology, power data is poised for further explosive growth, making it crucial to leverage existing power data for its full potential. Based on the segmented areas of the power business, creating power data datasets is a new approach to facilitate smooth business operations and oversight, such as datasets for electricity meter usage, green power, and intelligent operation and maintenance.
[0068] In related technologies, the generation of electricity meter data sets relies on the augmentation of electricity meter data. Currently, electricity meter data augmentation is achieved by using traditional statistical methods to superimpose Gaussian white noise or uniform noise onto the original electricity meter data. While this can improve the robustness of the augmented electricity meter data to small perturbations, it severely disrupts the inherent temporal correlation of the electricity meter data, making it difficult for the generated electricity meter data to maintain the true electricity consumption behavior pattern, resulting in poor augmentation effects.
[0069] In addition, time scaling methods can also be used to enhance electricity meter data. Time scaling methods change the sequence length of electricity meter data through linear interpolation or Dynamic Time Warping (DTW). While this can simulate data patterns at different sampling frequencies, it cannot capture the complex characteristics of multi-timescale coupling and may even cause peak-valley phase misalignment due to abrupt time axis distortion, resulting in the generation of false electricity consumption patterns. In the field of generative adversarial networks, although general time series generative models such as Time Series Generative Adversarial Networks (TimeGAN) improve time dependency modeling through adversarial training mechanisms, their application in power scenarios still has significant shortcomings, including: ignoring the influence of external conditions on electricity consumption patterns and assuming that user electricity consumption behavior is unchanging; lacking physical constraints and not considering the non-negativity of electricity meter readings and the monotonicity of cumulative amounts; and insufficient multi-scale feature modeling, failing to address the coupling between short-term fluctuations and long-term trends.
[0070] To address the aforementioned issues, this application provides a method and apparatus for enhancing electricity meter time-series data based on multi-scale conditions. This method extracts multi-scale features from the original electricity meter data, thereby capturing short-term fluctuations and long-term trends, improving the authenticity of the enhanced electricity meter data. Furthermore, physical constraints are introduced to process the generated data, ensuring that the enhanced electricity meter data conforms to the physical laws of the electricity meter, thus improving the enhancement effect.
[0071] The enhancement method for electricity meter time-series data based on multi-scale conditions provided in this application can be applied to, for example... Figure 1 In the application environment shown, terminal 102 communicates with server 104 via a network. A data storage system can store the data that server 104 needs to process. The data storage system can be integrated onto server 104, or it can be located in the cloud or on another network server.
[0072] First, server 104 obtains the raw electricity meter data and external condition data from terminal 102. Second, server 104 performs multi-scale feature extraction on the raw electricity meter data to obtain multi-scale stitched features. Third, server 104 fuses the data generation condition information and noise vector and inputs it into the data generator to obtain preliminary time-series data output by the data generator. The data generation condition information includes the multi-scale stitched features and external condition data. Finally, server 104 processes the preliminary time-series data using physical constraints to obtain enhanced electricity meter data.
[0073] The terminal 102 can be, but is not limited to, various personal computers, laptops, smartphones, tablets, IoT devices, and portable wearable devices. IoT devices can include smart speakers, smart TVs, smart air conditioners, smart in-vehicle systems, and projection devices. Portable wearable devices can include smartwatches, smart bracelets, and head-mounted displays. Head-mounted displays can be virtual reality (VR) devices, augmented reality (AR) devices, and smart glasses. The server 104 can be a standalone physical server, a server cluster or distributed system composed of multiple physical servers, or a cloud server providing cloud computing services.
[0074] In one exemplary embodiment, such as Figure 2 As shown, an enhancement method for electricity meter time-series data based on multi-scale conditions is provided, which is then applied to... Figure 1 Taking the server in the example, the explanation includes the following steps 201 to 204. Wherein:
[0075] S201. Obtain the original electricity meter data and external condition data.
[0076] The original electricity meter data can be time-series data of the electricity meter's electricity consumption.
[0077] For example, the original electricity meter data can be ,Right now, ,in, Let t represent the electricity consumption of the electricity meter at the t-th collection point. The high-frequency collection meter records the electricity consumption every 15 minutes.
[0078] The external condition data may include external environmental or time data related to electricity consumption. For example, external condition data may include date-type data and timestamp-type data. Date-type data may include data such as weekdays, weekends, and holidays, encoded as one-hot vectors. Timestamp-type data may include data such as hours, days of the week, and months, encoded as periodic features.
[0079] In some embodiments, after acquiring the original electricity meter data and external condition data, the server can perform preprocessing operations on the original electricity meter data and external condition data respectively; wherein, the preprocessing operations include fractional normalization of the original electricity meter data and Long Short-Term Memory (LSTM) encoding of the external condition data.
[0080] For example, in order to eliminate the influence of extreme values and preserve the data distribution pattern, the input original electricity meter data can be subjected to a more robust fractional normalization process, as shown in formula (1).
[0081] (1)
[0082] in, and These are the original electricity meter readings. The 10th and 90th percentiles, the data after fraction normalization. The range of values is .
[0083] For example, the external condition data can be an external condition vector. In order to capture the temporal evolution of the external conditions, the external condition data can be encoded using LSTM, as shown in Equation (2).
[0084] (2)
[0085] in, Let be the external condition vector at time step t; Let h be the hidden state of the LSTM at time step t-1, and h be the dimension of the hidden layer. The encoded conditional hidden state incorporates historical conditional information.
[0086] S202. Perform multi-scale feature extraction on the original electricity meter data to obtain multi-scale spliced features.
[0087] In this step, after the server obtains the original electricity meter data and external condition data, it can perform multi-scale feature extraction on the original electricity meter data to obtain multi-scale spliced features.
[0088] It should be understood that multi-scale feature extraction can capture short-term fluctuations (such as hourly peak-valley fluctuations) and long-term trends (such as periodic and seasonal changes) in the original electricity meter data. By modeling through convolutional neural networks (CNN branch) and self-attention mechanisms (Transformer branch), features from different time scales can be integrated to improve the authenticity of the generated data.
[0089] In some embodiments, the server can first use convolutional kernels of different widths to extract local features of the original electricity meter data at different time windows. Secondly, the server concatenates the local features from different time windows to obtain concatenated local features. Thirdly, the server uses a multi-head self-attention mechanism to extract features from the original electricity meter data to obtain global features. Finally, the server obtains multi-scale concatenated features based on the concatenated local and global features.
[0090] For example, local features at different time windows can be extracted by a local feature extraction branch, allowing this branch to use one-dimensional convolution to capture short-term fluctuations. For the normalized raw electricity meter data, convolution kernels of different widths are applied simultaneously. ), capturing local features in different time windows respectively. As shown in formula (3). Subsequently, the outputs of different convolutional kernels can be used as local features of different time windows, and concatenated along the channel dimension to obtain the concatenated local features. As shown in formula (4).
[0091] (3)
[0092] (4)
[0093] in, For width is The convolution kernel weights, where C is the number of output channels. For bias terms, These are local features extracted from a time window with a convolution kernel of 3. These are local features extracted from a time window with a convolution kernel of 5. These are local features extracted from the time window with a kernel of 7.
[0094] For example, a multi-head self-attention mechanism can be used in the Transformer branch to capture global temporal patterns and extract global features. The self-attention mechanism can generate queries (Q), keys (K), and values (V): , , Where W^Q, W^K, W^V∈R^(1×d) are the learnable weight matrices (d is the hidden layer dimension).
[0095] For example, the calculation of attention weights in a multi-head self-attention mechanism can be as shown in Equation (5), the parallel execution of multiple attention heads can be as shown in Equations (6) and (7), and the calculation of the feedforward network can be as shown in Equation (8).
[0096] (5)
[0097] (6)
[0098] (7)
[0099] (8)
[0100] in, To scale the dot product attention to prevent gradient vanishing. This is the number of heads (default setting is 8). This is the output weight.
[0101] For example, after obtaining the spliced local features and global features, the spliced local features and global features can be combined into multi-scale spliced features, as shown in formula (9).
[0102] (9)
[0103] in, This represents the number of local feature channels, i.e., 3 types of convolutional kernels * C channels per kernel; The hidden layer dimension represents the global features.
[0104] In some implementations, after obtaining multi-scale stitched features, layer normalization can be performed to stabilize training and unify the dimensions. That is... .
[0105] S203. After fusing the data generation condition information and the noise vector, input the data into the data generator to obtain the preliminary time series data output by the data generator.
[0106] The data generation condition information includes multi-scale stitching features and external condition data.
[0107] In some embodiments, the data generator includes a gated recurrent unit (GRU). The gated recurrent unit includes a reset gate and an update gate; the reset gate is used to determine whether to forget historical time-series data, and the update gate is used to determine whether to prioritize updating forgotten historical time-series data or prioritize updating the fused data of the latest input data generator.
[0108] In some embodiments, the server can fuse data generation condition information and noise vectors and input the result into a reset gate to obtain candidate hidden states. Subsequently, the server inputs the candidate hidden states into an update gate to obtain the final hidden state. Finally, the server maps the final hidden state to preliminary time-series data.
[0109] For example, multi-scale splicing features and external conditional data can be used as data generation conditional information F, which is fused with the causal vector z to obtain the input data of the data generator. Subsequently, the input data is fed into the GRU for GRU update. The reset gate first processes the data to obtain candidate hidden states, and then the update gate processes it to obtain the final hidden states. Here, ⊕ represents the vector concatenation operation.
[0110] For example, resetting the door The gate can be updated as shown in formula (10). As shown in formula (11), the candidate hidden state can be shown in formula (12), and the final hidden state can be shown in formula (13).
[0111] (11)
[0112] (12)
[0113] (13)
[0114] (14)
[0115] in, This is the weight matrix. For bias terms, This is element-wise multiplication.
[0116] For example, through formula The final hidden state of GRU can be... The data is mapped to initial time series data, and the ReLU function is used to ensure that the initial time series data is non-negative. .
[0117] S204. Use physical constraints to process the preliminary time series data to obtain enhanced electricity meter data.
[0118] Physical constraints include nonnegativity constraints and / or cumulative monotonicity constraints.
[0119] For example, nonnegativity constraints are used to penalize the generation of negative charge, ensuring that the initial time-series data is not less than 0. As shown in formula (15). The cumulative monotonicity constraint is used to constrain the cumulative electricity of the meter to remain monotonically constant over time, and to relax the loss function to allow for small errors. As shown in formula (16).
[0120] (15)
[0121] (16)
[0122] in, Based on historical data statistics, the default setting is... .
[0123] The following explains how to interpret the electricity meter data generated by the enhancement process.
[0124] In some embodiments, after processing the initial time-series data using physical constraints to obtain the enhanced electricity meter power data, the server can also use a multi-scale discriminator to perform local branch discrimination and global branch discrimination on the enhanced electricity meter power data to obtain the validity discrimination result of the enhanced electricity meter power data.
[0125] For example, local branch discrimination is used to evaluate the authenticity of the enhanced electricity meter data at different time scales, capturing detailed patterns. Structurally, a one-dimensional convolutional network is used to output a branch authenticity matrix, as shown in Equation (17). Each convolutional kernel generates a feature map for one channel, and multiple kernels are used in parallel to capture different local patterns. Each time point corresponds to a branch authenticity probability matrix with a shape... .
[0126] (17)
[0127] For example, the global branch discrimination used to evaluate the global consistency of the enhanced generated electricity meter data can be implemented by using a bidirectional LSTM followed by a fully connected layer.
[0128] In some embodiments, after processing the initial time-series data using physical constraints to obtain enhanced electricity meter data, the server can further extract intermediate features from the enhanced electricity meter data using a multi-scale discriminator. Subsequently, based on the intermediate features, the server determines the probability distribution data of each external condition corresponding to the enhanced electricity meter data. Finally, based on the probability distribution data of each external condition, the server determines the semantic consistency between the enhanced electricity meter data and the external condition data.
[0129] For example, conditional matching is used to ensure that the generated electricity meter data is semantically consistent with external conditions. A conditional classifier can be formed by attaching a conditional classifier to a multi-scale discriminator to determine the degree of semantic consistency.
[0130] For example, the probability distribution data of each external condition corresponding to the enhanced generated electricity meter data can be determined by formula (18). .
[0131] (18)
[0132] in, K represents the intermediate feature, and K is the number of conditional categories.
[0133] For example, the semantic consistency between the enhanced generated electricity meter data and the external condition data can be determined by combining the probability distribution data of various external conditions and formula (19).
[0134] (19)
[0135] in, The conditional matching loss value represents the degree of semantic consistency. The loss is calculated to force the conditional classification of the real data to be accurate, penalizing incorrect matching between generated data and conditions, which is the probability of the conditional class predicted by the discriminator.
[0136] In some embodiments, after obtaining the enhanced electricity meter data, the server can also calculate the loss function value corresponding to the enhanced electricity meter data, and then use the loss function value to optimize the model parameters of the data generator.
[0137] The loss function value includes at least one of the following: adversarial loss value, dynamic time alignment loss value, conditional matching loss value, and physical constraint regularization loss value.
[0138] For example, the model parameters of the data generator may include weight matrices and bias terms, etc.
[0139] For example, the adversarial loss function corresponding to the adversarial loss value can be improved by using the gradient penalty of Wassersterin GAN to enhance training stability. The adversarial loss function can be as shown in Equation (20).
[0140] (20)
[0141] in, This represents the actual distribution of electricity consumption data. To generate a data distribution, For samples generated through interpolation, , This is the gradient penalty coefficient, set to 10.
[0142] For example, the dynamic time alignment loss function corresponding to the dynamic time alignment loss value introduces dynamic time warping to constrain the time dependency between the generated electricity meter data and the original electricity meter data. The dynamic time alignment loss function is shown in formula (21).
[0143] (twenty one)
[0144] in, , This represents the set of all alignment paths for sequences A and B. Indicates and A true reference sequence of the same type.
[0145] In this application, the problem of temporal phase offset between the generated sequence and the real data can be solved by using dynamic time alignment loss.
[0146] For example, the conditional matching loss function corresponding to the conditional matching loss value forces the generation of enhanced electricity meter data. The semantic consistency with external condition C is such that the conditional matching loss function is shown in formula (22).
[0147] (twenty two)
[0148] in, This represents the probability of a conditional match predicted by the discriminator. This represents the output of the conditional classifier.
[0149] For example, the physical constraint regularization loss value corresponds to the physical constraint regularization loss function as shown in formulas (23) and (24).
[0150] (twenty three)
[0151] (twenty four)
[0152] For example, after determining the values of each loss function, the total loss function value can be calculated based on the values of each loss function, as shown in formula (25).
[0153] (25)
[0154] Among them, the hyperparameter values , , .
[0155] In some embodiments, after obtaining the enhanced electricity meter data, the server can also use a variational autoencoder to learn from the real electricity meter data to obtain the noise pattern in the electricity meter data. Subsequently, the server dynamically adjusts the noise amplitude of the noise vector based on the noise pattern and a relative entropy divergence feedback mechanism.
[0156] It should be understood that, in order to enhance the diversity and authenticity of the generated data, the noise distribution of the data generator input can be dynamically adjusted. First, the noise pattern corresponding to the real electricity meter data is modeled by a variational autoencoder (VAE). Then, the noise amplitude is adaptively adjusted by combining the KL divergence feedback mechanism.
[0157] It should be noted that traditional noise vectors are static distributions and cannot adapt to the noise characteristics of different electricity consumption patterns. Therefore, VAEs are used to learn the conditional distribution of noise from real electricity meter data. This allows noise to be dynamically correlated with data patterns.
[0158] For example, you can input actual electricity meter readings X and output potential distribution parameters. and Using a 1D-CNN+LSTM network structure, through the formula Capturing temporal dependencies from the latent space Reconstruct input data This allows us to model the noise patterns corresponding to real electricity meter readings.
[0159] For example, based on the noise pattern corresponding to the actual electricity meter data, the distribution difference between the enhanced electricity meter data and the actual electricity meter data can be determined, thereby dynamically adjusting the noise amplitude. For instance, the distribution of the actual electricity meter data can be statistically analyzed. and enhance the distribution of generated electricity meter data Features, calculate their divergence with respect to entropy (KL). Select a statistic that is sensitive to noise (such as standard deviation, mean, variance, autocorrelation) and dynamically adjust the noise amplitude of the noise vector.
[0160] For example, the KL divergence can be dynamically adjusted for noise standard deviation as shown in formula (26).
[0161] (26)
[0162] in, The initial noise amplitude is set to 0.1 by default. To adjust the coefficient and control the influence of KL divergence, the default value is 0.5.
[0163] In this application, in order to enhance the diversity and authenticity of the generated data, the noise distribution of the generator input is dynamically adjusted. The noise pattern in the real electricity meter power data is modeled by a variational autoencoder, and the noise amplitude is adaptively adjusted by combining the KL divergence feedback mechanism, thereby effectively generating electricity meter power data and supporting the construction of electricity meter status evaluation datasets and other power-related businesses.
[0164] The method for enhancing electricity meter time-series data based on multi-scale conditions provided in this application involves: acquiring original electricity meter data and external condition data; extracting multi-scale features from the original electricity meter data to obtain multi-scale spliced features; fusing data generation condition information and noise vectors and inputting the fused data into a data generator to obtain preliminary time-series data output by the data generator, where the data generation condition information includes multi-scale spliced features and external condition data; and processing the preliminary time-series data using physical constraints to obtain enhanced electricity meter data. By extracting multi-scale features from the original electricity meter data, the method can capture short-term fluctuations and long-term trends in the electricity meter data, improving the authenticity of the enhanced electricity meter data. Furthermore, the introduction of physical constraints to process the generated data ensures that the enhanced electricity meter data conforms to the physical laws of the electricity meter, thereby improving the enhancement effect of the electricity meter data.
[0165] In one exemplary embodiment, such as Figure 3 As shown, another method for enhancing electricity meter time-series data based on multi-scale conditions is presented, which can be applied to... Figure 1 Taking the server in the example, the explanation includes the following steps S301 to S311. Wherein:
[0166] S301. Obtain the original electricity meter data and external condition data.
[0167] S302. Perform preprocessing operations on the original electricity meter data and external condition data respectively.
[0168] The preprocessing operations include fractional normalization of the original electricity meter data and LSTM encoding of the external condition data.
[0169] S303. Perform multi-scale feature extraction on the original electricity meter data to obtain multi-scale spliced features.
[0170] In some embodiments, the original electricity meter data is time-series data of electricity meter consumption. Multi-scale feature extraction is performed on the original electricity meter data to obtain multi-scale concatenated features, including:
[0171] Using convolutional kernels of different widths, local features of the original electricity meter data at different time windows are extracted. The local features of different time windows are concatenated to obtain concatenated local features. A multi-head self-attention mechanism is used to extract features from the original electricity meter data to obtain global features. Based on the concatenated local features and global features, multi-scale concatenated features are obtained.
[0172] S304. After fusing the data generation condition information and the noise vector, input the data into the data generator to obtain the preliminary time series data output by the data generator. The data generation condition information includes multi-scale splicing features and external condition data.
[0173] The data generator includes a gated loop unit, which includes a reset gate and an update gate. The reset gate is used to determine whether historical time-series data has been forgotten, and the update gate is used to determine whether to prioritize updating forgotten historical time-series data or to prioritize updating the fused data of the latest input data generator.
[0174] In some embodiments, the data generation condition information and noise vector are fused and input into the data generator to obtain preliminary time-series data output by the data generator, including: fusing the data generation condition information and noise vector and inputting them into a reset gate to obtain candidate hidden states; inputting the candidate hidden states into an update gate to obtain final hidden states; and mapping the final hidden states to preliminary time-series data.
[0175] In some embodiments, the server can use a variational autoencoder to learn noise patterns from real electricity meter data. Subsequently, the server dynamically adjusts the noise amplitude of the noise vector based on the noise patterns and a relative entropy divergence feedback mechanism.
[0176] S305. Use physical constraints to process the preliminary time series data to obtain enhanced electricity meter data.
[0177] Physical constraints include nonnegativity constraints and / or cumulative monotonicity constraints.
[0178] S306. The enhanced electricity meter data is subjected to local branch discrimination and global branch discrimination by a multi-scale discriminator to obtain the validity discrimination result of the enhanced electricity meter data.
[0179] Among them, the local branch discrimination is used to evaluate the authenticity of the enhanced electricity meter data at different time scales, and the global branch discrimination is used to evaluate the global consistency of the enhanced electricity meter data.
[0180] S307. Extract intermediate features from the enhanced generated electricity meter data using a multi-scale discriminator.
[0181] S308. Based on the intermediate features, determine the probability distribution data of each external condition corresponding to the enhanced generated electricity meter data.
[0182] S309. Based on the probability distribution data of each external condition, determine the semantic consistency between the enhanced generated electricity meter data and the external condition data.
[0183] S310. Calculate the loss function value corresponding to the electricity meter data generated by the enhancement.
[0184] S311. Use the loss function value to optimize the model parameters of the data generator.
[0185] The loss function value includes at least one of the following: adversarial loss value, dynamic time alignment loss value, conditional matching loss value, and physical constraint regularization loss value.
[0186] The method for enhancing electricity meter time-series data based on multi-scale conditions provided in this application involves: acquiring original electricity meter data and external condition data; extracting multi-scale features from the original electricity meter data to obtain multi-scale spliced features; fusing data generation condition information and noise vectors and inputting the fused data into a data generator to obtain preliminary time-series data output by the data generator, where the data generation condition information includes multi-scale spliced features and external condition data; and processing the preliminary time-series data using physical constraints to obtain enhanced electricity meter data. By extracting multi-scale features from the original electricity meter data, the method can capture short-term fluctuations and long-term trends in the electricity meter data, improving the authenticity of the enhanced electricity meter data. Furthermore, the introduction of physical constraints to process the generated data ensures that the enhanced electricity meter data conforms to the physical laws of the electricity meter, thereby improving the enhancement effect of the electricity meter data.
[0187] It should be understood that although the steps in the flowcharts of the above embodiments are shown sequentially according to the arrows, these steps are not necessarily executed in the order indicated by the arrows. Unless explicitly stated herein, there is no strict order restriction on the execution of these steps, and they can be executed in other orders. Moreover, at least some steps in the flowcharts of the above embodiments may include multiple steps or multiple stages. These steps or stages are not necessarily completed at the same time, but can be executed at different times. The execution order of these steps or stages is not necessarily sequential, but can be performed alternately or in turn with other steps or at least some of the steps or stages of other steps.
[0188] Based on the same inventive concept, this application also provides an apparatus for enhancing the electricity meter time-series data based on multi-scale conditions, which is used to implement the aforementioned method for enhancing electricity meter time-series data based on multi-scale conditions. The solution provided by this apparatus is similar to the solution described in the above method. Therefore, the specific limitations in one or more embodiments of the apparatus for enhancing electricity meter time-series data based on multi-scale conditions provided below can be found in the limitations of the method for enhancing electricity meter time-series data based on multi-scale conditions described above, and will not be repeated here.
[0189] In one exemplary embodiment, such as Figure 4 As shown, an enhancement device 400 for electricity meter time-series data based on multi-scale conditions is provided, comprising: an acquisition module 401, an extraction module 402, a generation module 403, and a constraint module 404, wherein:
[0190] The acquisition module 401 is used to acquire the original electricity meter power data and external condition data.
[0191] The extraction module 402 is used to extract multi-scale features from the original electricity meter data to obtain multi-scale spliced features.
[0192] The generation module 403 is used to fuse the data generation condition information and noise vector and input them into the data generator to obtain the preliminary time series data output by the data generator. The data generation condition information includes multi-scale splicing features and external condition data.
[0193] The constraint module 404 is used to process the preliminary time-series data using physical constraints to obtain enhanced electricity meter data.
[0194] In one embodiment, the acquisition module 401 is further configured to perform preprocessing operations on the original electricity meter power data and external condition data respectively; wherein, the preprocessing operations include fractional normalization of the original electricity meter power data and LSTM encoding of the external condition data.
[0195] In one embodiment, the extraction module 402 is further configured to use convolutional kernels of different widths to extract local features of the original electricity meter data in different time windows; to concatenate the local features of different time windows to obtain concatenated local features; to use a multi-head self-attention mechanism to extract features from the original electricity meter data to obtain global features; and to obtain multi-scale concatenated features based on the concatenated local features and global features.
[0196] In one embodiment, the data generator includes a gated loop unit, which includes a reset gate and an update gate; the reset gate is used to determine whether historical time-series data has been forgotten, and the update gate is used to determine whether to prioritize updating forgotten historical time-series data or to prioritize updating the fused data of the latest input data generator.
[0197] The generation module 403 is also used to fuse the data generation condition information and the noise vector and input them into the reset gate to obtain the candidate hidden state; input the candidate hidden state into the update gate to obtain the final hidden state; and map the final hidden state into the preliminary time series data.
[0198] In one embodiment, the physical constraints include nonnegativity constraints and / or cumulative monotonicity constraints.
[0199] In one embodiment, the enhancement device 400 based on multi-scale conditions for electricity meter time-series data further includes:
[0200] The discrimination module is used to perform local branch discrimination and global branch discrimination on the enhanced electricity meter power data through a multi-scale discriminator to obtain the validity discrimination result of the enhanced electricity meter power data.
[0201] Among them, the local branch discrimination is used to evaluate the authenticity of the enhanced electricity meter data at different time scales, and the global branch discrimination is used to evaluate the global consistency of the enhanced electricity meter data.
[0202] In one embodiment, the discrimination module is further configured to extract intermediate features of the enhanced generated electricity meter data through a multi-scale discriminator; determine the probability distribution data of each external condition corresponding to the enhanced generated electricity meter data based on the intermediate features; and determine the semantic consistency between the enhanced generated electricity meter data and the external condition data based on the probability distribution data of each external condition.
[0203] In one embodiment, the enhancement device 400 based on multi-scale conditions for electricity meter time-series data further includes:
[0204] The optimization module is used to calculate the loss function value corresponding to the enhanced electricity meter data; and uses the loss function value to optimize the model parameters of the data generator.
[0205] The loss function value includes at least one of the following: adversarial loss value, dynamic time alignment loss value, conditional matching loss value, and physical constraint regularization loss value.
[0206] In one embodiment, the optimization module is further configured to learn from real electricity meter power data using a variational autoencoder to obtain a noise pattern in the electricity meter power data; and dynamically adjust the noise amplitude of the noise vector according to the noise pattern and the relative entropy divergence feedback mechanism.
[0207] The modules in the aforementioned enhancement device for electricity meter time-series data based on multi-scale conditions can be implemented entirely or partially through software, hardware, or a combination thereof. These modules can be embedded in or independent of the processor in a computer device, or stored in the memory of a computer device as software, so that the processor can call and execute the corresponding operations of each module.
[0208] In one exemplary embodiment, a computer device is provided, which may be a server, and its internal structure diagram may be as follows: Figure 5 As shown, the computer device includes a processor, memory, input / output (I / O) interfaces, and a communication interface. The processor, memory, and I / O interfaces are connected via a system bus, and the communication interface is also connected to the system bus via the I / O interfaces. The processor provides computational and control capabilities. The memory includes non-volatile storage media and internal memory. The non-volatile storage media stores the operating system, computer programs, and a database. The internal memory provides the environment for the operating system and computer programs stored in the non-volatile storage media. The database stores data. The I / O interfaces are used for exchanging information between the processor and external devices. The communication interface is used for communicating with external terminals via a network. When the computer program is executed by the processor, it implements an enhancement method for electricity meter time-series data based on multi-scale conditions.
[0209] Those skilled in the art will understand that Figure 5The structure shown is merely a block diagram of a portion of the structure related to the present application and does not constitute a limitation on the computer device to which the present application is applied. Specific computer devices may include more or fewer components than those shown in the figure, or combine certain components, or have different component arrangements.
[0210] In one exemplary embodiment, a computer device is provided, including a memory and a processor, wherein the memory stores a computer program, and the processor executes the computer program to implement the above-described method for enhancing electricity meter time-series data based on multi-scale conditions.
[0211] In one embodiment, a computer-readable storage medium is provided having a computer program stored thereon, which, when executed by a processor, implements the above-described method for enhancing electricity meter time-series data based on multi-scale conditions.
[0212] In one embodiment, a computer program product is provided, including a computer program that, when executed by a processor, implements the above-described method for enhancing electricity meter time-series data based on multi-scale conditions.
[0213] It should be noted that the user information (including but not limited to user device information, user personal information, etc.) and data (including but not limited to data used for analysis, data stored, data displayed, etc.) involved in this application are all information and data authorized by the user or fully authorized by all parties, and the collection, use and processing of the relevant data must comply with relevant regulations.
[0214] Those skilled in the art will understand that all or part of the processes in the methods of the above embodiments can be implemented by a computer program instructing related hardware. The computer program can be stored in a non-volatile computer-readable storage medium. When executed, the computer program can include the processes of the embodiments of the above methods. Any references to memory, databases, or other media used in the embodiments provided in this application can include at least one of non-volatile memory and volatile memory. Non-volatile memory may include read-only memory (ROM), magnetic tape, floppy disk, flash memory, optical memory, high-density embedded non-volatile memory, resistive random access memory (ReRAM), magnetic random access memory (MRAM), ferroelectric random access memory (FRAM), phase change memory (PCM), graphene memory, etc. Volatile memory may include random access memory (RAM) or external cache memory, etc. By way of illustration and not limitation, RAM can take many forms, such as Static Random Access Memory (SRAM) or Dynamic Random Access Memory (DRAM). The databases involved in the embodiments provided in this application may include at least one type of relational database and non-relational database. Non-relational databases may include, but are not limited to, blockchain-based distributed databases. The processors involved in the embodiments provided in this application may be general-purpose processors, central processing units, graphics processing units, digital signal processors, programmable logic devices, quantum computing-based data processing logic devices, artificial intelligence (AI) processors, etc., and are not limited to these.
[0215] The technical features of the above embodiments can be combined in any way. For the sake of brevity, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this application.
[0216] The above embodiments are merely illustrative of several implementation methods of this application, and their descriptions are relatively specific and detailed. However, they should not be construed as limiting the scope of this application. It should be noted that those skilled in the art can make various modifications and improvements without departing from the concept of this application, and these all fall within the protection scope of this application. Therefore, the protection scope of this application should be determined by the appended claims.
Claims
1. A method for enhancing electricity meter time-series data based on multi-scale conditions, characterized in that, The method includes: Obtain raw electricity meter readings and external condition data; Multi-scale feature extraction is performed on the original electricity meter data to obtain multi-scale spliced features; The data generation condition information and noise vector are fused and then input into the data generator to obtain the preliminary time series data output by the data generator. The data generation condition information includes the multi-scale stitching features and the external condition data. The preliminary time-series data is processed using physical constraints to obtain enhanced electricity meter data.
2. The method according to claim 1, characterized in that, After acquiring the original electricity meter readings and external condition data, the method further includes: The original electricity meter data and the external condition data are preprocessed respectively; wherein the preprocessing operations include fractional normalization of the original electricity meter data and LSTM encoding of the external condition data.
3. The method according to claim 1, characterized in that, The original electricity meter data is time-series data of electricity meter consumption. The process of extracting multi-scale features from the original electricity meter data to obtain multi-scale concatenated features includes: Using convolution kernels of different widths, local features of the original electricity meter data at different time windows are extracted respectively. The local features of the different time windows are stitched together to obtain the stitched local features; A multi-head self-attention mechanism is used to extract features from the original electricity meter data to obtain global features; The multi-scale spliced features are obtained based on the spliced local features and the global features.
4. The method according to claim 1, characterized in that, The data generator includes a gated loop unit, which includes a reset gate and an update gate. The reset gate is used to determine whether historical time-series data has been forgotten, and the update gate is used to determine whether to prioritize updating the forgotten historical time-series data or to prioritize updating the latest fused data input to the data generator. The process of fusing data generation condition information and noise vectors and inputting the resulting data into a data generator to obtain preliminary time-series data output by the data generator includes: The data generation condition information and noise vector are fused and then input into the reset gate to obtain candidate hidden states; The candidate hidden states are input into the update gate to obtain the final hidden state; The final hidden state is mapped to the initial time series data.
5. The method according to claim 1, characterized in that, The physical constraints include nonnegativity constraints and / or cumulative monotonicity constraints.
6. The method according to claim 1, characterized in that, After processing the initial time-series data using physical constraints to obtain enhanced electricity meter data, the method further includes: The enhanced electricity meter data is subjected to local branch discrimination and global branch discrimination by a multi-scale discriminator to obtain the validity discrimination result of the enhanced electricity meter data. The local branch discrimination is used to evaluate the authenticity of the enhanced electricity meter data at different time scales, and the global branch discrimination is used to evaluate the global consistency of the enhanced electricity meter data.
7. The method according to claim 6, characterized in that, After processing the initial time-series data using physical constraints to obtain enhanced electricity meter data, the method further includes: The intermediate features of the enhanced electricity meter data are extracted using a multi-scale discriminant. Based on the intermediate features, the probability distribution data of each external condition corresponding to the enhanced generated electricity meter data are determined; Based on the probability distribution data of each external condition, the semantic consistency between the enhanced generated electricity meter data and the external condition data is determined.
8. The method according to any one of claims 1-7, characterized in that, After obtaining the enhanced electricity meter data, the method further includes: Calculate the loss function value corresponding to the electricity meter data generated by the enhancement; Use the loss function value to optimize the model parameters of the data generator; The loss function value includes at least one of the following: adversarial loss value, dynamic time alignment loss value, conditional matching loss value, and physical constraint regularization loss value.
9. The method according to any one of claims 1-7, characterized in that, After obtaining the enhanced electricity meter data, the method further includes: The noise pattern in the energy meter data is obtained by learning from real energy meter data using a variational autoencoder. The noise amplitude of the noise vector is dynamically adjusted based on the noise pattern and the relative entropy divergence feedback mechanism.
10. An enhancement device for electricity meter time-series data based on multi-scale conditions, characterized in that, The device includes: The acquisition module is used to acquire raw electricity meter data and external condition data. The extraction module is used to extract multi-scale features from the original electricity meter data to obtain multi-scale spliced features. The generation module is used to fuse data generation condition information and noise vector and input them into the data generator to obtain preliminary time series data output by the data generator. The data generation condition information includes the multi-scale splicing features and the external condition data. The constraint module is used to process the preliminary time-series data using physical constraints to obtain enhanced electricity meter data.