An adaptive repair and on-demand enhancement method and system for power data
By employing a multi-scale temporal attention mechanism and a physically constrained temporal generative adversarial network, the problems of low fidelity and numerical non-conservation in power data restoration are solved, achieving high-fidelity and reliable data restoration and enhancement, applicable to various application scenarios of power data.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2026-01-09
- Publication Date
- 2026-03-31
AI Technical Summary
Existing technologies have low fidelity in power data restoration, cannot effectively reconstruct long-term periodic patterns, and the values are not conserved when the data density is increased, which cannot meet the needs of high-frequency applications.
A conditional diffusion model incorporating a multi-scale temporal attention mechanism is employed for data repair, combined with periodic prior information to generate filler values. A physical constraint-based temporal generative adversarial network is used to enhance data density, and a consistency loss constraint is applied to ensure that the generated data is consistent with the original data values.
It achieves high-fidelity data restoration, reconstructs long-term periodic patterns, ensures strict numerical consistency of generated data, improves data authenticity and usability, and is suitable for advanced applications such as refined load analysis.
Smart Images

Figure CN121479245B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to power data processing technology, specifically to an adaptive repair and on-demand enhancement method and system for power data. Background Technology
[0002] Power big data is a core asset of the digital power grid, and its data quality directly determines the success or failure of upper-level analysis and applications. In practical applications, power time series data (such as user power consumption curves) often faces two major challenges: first, the data contains abnormal or missing values due to acquisition or transmission failures, which need to be repaired; second, some users have low acquisition frequencies (such as hourly), which cannot meet the needs of new application scenarios that require higher frequency data (such as minute-level) such as refined load analysis and demand-side response, thus requiring data density enhancement.
[0003] Currently, existing technologies for addressing the above challenges have significant shortcomings:
[0004] Firstly, in terms of data restoration, traditional methods often employ linear interpolation and filler with previous values / means. While these methods are simple, they essentially involve smoothing and fitting, resulting in filled data that loses the random fluctuations and detailed features inherent in real electricity consumption data. This leads to low "fidelity" of the restored data, deviating significantly from reality and severely impacting the accuracy of subsequent analyses. Especially when data is missing for extended periods, such simple fitting cannot reconstruct the daily, weekly, or other multi-scale periodic patterns that the data should possess, severely affecting subsequent periodic-based analysis and predictions. Furthermore, these methods typically require manual selection of different rules for different scenarios, lacking adaptive capabilities.
[0005] Secondly, regarding data density enhancement (or data super-resolution), directly increasing the acquisition frequency through hardware upgrades is costly, time-consuming, and difficult to implement, making large-scale deployment challenging. At the algorithm level, using simple interpolation methods will also result in low-fidelity, unusable high-frequency data. While some advanced generation algorithms can produce seemingly reasonable high-frequency curves, they generally suffer from a fatal technical flaw: they cannot guarantee that the generated high-frequency data, after aggregation, will strictly conserve its values from the original low-frequency data. This numerical inconsistency violates basic physical laws and business logic, rendering the generated data unreliable and unusable in actual production. Summary of the Invention
[0006] The technical problem to be solved by the present invention is to provide an adaptive repair and on-demand enhancement method and system for power data, which addresses the above-mentioned problems in the prior art, and enables high-fidelity repair of abnormal data and on-demand enhancement of data density in an economical, reliable and consistent manner.
[0007] To solve the above-mentioned technical problems, the technical solution adopted by the present invention is as follows:
[0008] An adaptive repair and on-demand enhancement method for power data includes the following steps:
[0009] Acquire time-series power data and task instructions;
[0010] If the task instruction is a data repair instruction, identify the normal data and the abnormal or missing parts in the time series data, use the trained conditional diffusion model to take the known normal data parts in the time series data as conditions, and combine them with preset periodic prior information. By capturing long-term periodic dependencies, fill values are generated, and the fill values are used to fill the abnormal or missing parts in the time series data to obtain the data-repaired power data.
[0011] If the task instruction is a data density enhancement instruction, the time series data is used as a low-frequency data sequence. A trained temporal generative adversarial network is used to generate a high-frequency data sequence by using the low-frequency data in the low-frequency data sequence as a constraint. A consistency loss constraint is applied to ensure that the aggregate value of the generated high-frequency data sequence is the same as the original value of the corresponding low-frequency data. The high-frequency data sequence is then output as the power data after data density enhancement.
[0012] Furthermore, the mathematical expression for the periodic prior information is as follows:
[0013]
[0014] in, It is the temporal feature encoding vector at time point t. It is an hour in a day. It is a weekday. and These are binary symbols for holidays and seasons, respectively.
[0015] Furthermore, the conditional diffusion model embeds an attention module, including short-term dependent attention heads and long-term periodic attention heads, into the bottleneck layer of the U-Net network. The mathematical expression of the conditional diffusion model is as follows:
[0016]
[0017] in, It is time series data at time point t. It is a feature representation obtained by aggregating the outputs of short-term dependent attention heads and long-term periodic attention heads. The conditional mapping matrix, This represents the original hidden state of the bottleneck layer. The input is conditional, and the mathematical expression is as follows:
[0018]
[0019] in, Representing time series data, Represents the encoding vector of all temporal features The characteristic matrix formed, Representation of time series data A binary mask vector of equal length, where the mask value corresponding to the data point to be repaired is 1, and the mask value corresponding to the normal data point is 0.
[0020] Furthermore, the mathematical expression for the feature representation obtained by aggregating the outputs of the short-term dependent attention head and the long-term periodic attention head is as follows:
[0021]
[0022] in, These are learnable parameters. and These are the outputs of the short-term dependent attention head and the long-term periodic attention head, respectively, and their mathematical expressions are as follows:
[0023]
[0024]
[0025] in, Representing each point in time Nearby neighborhood windows, Representing each point in time The corresponding set of periodic anchor points, and These represent the attention weights of short-term dependent attention heads and long-term periodic attention heads, respectively. and These represent the value vectors of the short-term dependent attention head and the long-term periodic attention head, respectively. , , Historical time points in the diffusion process of the conditional diffusion model intermediate samples, intermediate samples The corresponding temporal feature encoding, and These are the learnable parameters.
[0026] Furthermore, the mathematical expressions for the attention weights of short-term dependent attention heads and long-term periodic attention heads are as follows:
[0027]
[0028]
[0029] in, These are the query vector and key vector of the short-time attention-dependent head, respectively. , These are the query vector and key vector of the long-term attention head, respectively. , For time points in the diffusion process of the conditional diffusion model intermediate samples, intermediate samples The corresponding temporal feature encoding, and These are historical time points. Intermediate samples and temporal feature encoding, This is a relative position offset term. For periodic consistency bias function, This is an adjustable coefficient. These are the learnable parameters.
[0030] Furthermore, the temporal generator of the temporal generative adversarial network incorporates a missing mask and temporal prior coding at the input to ensure that the model fully utilizes available observation information and temporal patterns during the generation process. The mathematical expression is as follows:
[0031]
[0032] in, Representing time series data, Temporal feature encoding vector representing all periodic prior information The characteristic matrix formed, Representation of time series data A binary mask vector of equal length, where the mask value corresponding to the data point to be repaired is 1, and the mask value corresponding to the normal data point is 0.
[0033] Furthermore, the timing generator employs a constrained output layer and residual mapping at the output end, so that the generated high-frequency data sequence can be strictly consistent with the input low-frequency data in terms of physical quantities after aggregation.
[0034] Furthermore, the mathematical expression for the loss function of the timing generator is as follows:
[0035]
[0036] in, It is a counter-loss. These are hyperparameters used to balance the two losses. It is the physical consistency loss, and its mathematical expression is as follows:
[0037]
[0038] in, It is the i-th data point in the high-frequency data sequence generated by the generator. These are the raw low-frequency data points used as input conditions.
[0039] The present invention also proposes an adaptive repair and on-demand enhancement system for power data, comprising a processor and a computer-readable storage medium, wherein the computer-readable storage medium stores a computer program, which is executed by the processor to implement the steps of the adaptive repair and on-demand enhancement method for power data.
[0040] The present invention also proposes a computer-readable storage medium storing a computer program, which, when executed by a processor, implements the steps of the adaptive repair and on-demand enhancement method for power data.
[0041] Compared with the prior art, the advantages of the present invention are as follows:
[0042] This invention introduces periodic prior information as a strong prior condition during the data repair process, ensuring that the periodic profile of the data segment to be repaired is known before repair begins. Simultaneously, by capturing long-term periodic dependencies to generate filler values, it can deeply learn and utilize the daily, weekly, and other multi-scale periodic patterns of the data. Therefore, when repairing long-period missing data, the generated repaired data is no longer a smooth curve, but contains detailed fluctuations and periodic characteristics indistinguishable from the real data, greatly improving the data's authenticity, usability, and the accuracy of downstream analysis, thereby achieving high-fidelity reconstruction of missing data and precise capture of periodic patterns.
[0043] This invention applies a consistency loss constraint during data density enhancement to ensure that the aggregated value of the generated high-frequency data sequence is the same as the original value of the corresponding low-frequency data. This forces the generated high-frequency data sequence to always satisfy the hard physical constraint that the aggregated value of the generated sequence is strictly equal to the original low-frequency value. This fundamentally solves the numerical drift and non-conservation problems commonly found in existing technologies, ensuring that the generated high-frequency data is not only morphologically reliable but also numerically accurate. Attached Figure Description
[0044] Figure 1 This is a flowchart of a method according to an embodiment of the present invention. Detailed Implementation
[0045] The present invention will be further described below with reference to the accompanying drawings and specific preferred embodiments, but this does not limit the scope of protection of the present invention.
[0046] To achieve high-fidelity repair of abnormal data in power data and to enhance data density on demand in an economical, reliable, and consistent manner, two core technical challenges need to be addressed: First, existing data repair methods generate filler data with low fidelity and are unable to effectively reconstruct long-term missing data and its inherent multi-scale periodicity (such as daily and weekly patterns). Second, existing generation algorithms have a fatal flaw in data density enhancement: they cannot guarantee that the generated high-frequency data will be numerically identical to the original low-frequency data after aggregation, violating basic physical conservation laws and resulting in generated data lacking business credibility.
[0047] To address the technical challenges of existing power data restoration methods' weak ability to handle long-term missing data and the violation of physical conservation laws in data augmentation results, this embodiment proposes an adaptive restoration and on-demand augmentation method for power data. For anomalous data, a conditional diffusion model incorporating a multi-scale temporal attention mechanism is employed to capture long-term periodic dependencies such as daily and weekly data, generating high-fidelity restored data. For low-frequency data, a physically constrained temporal generative adversarial network is used, introducing a consistency loss derived from the law of energy conservation to generate high-frequency sequences on demand, ensuring that their aggregated values are strictly equal to the original low-frequency data. Using a targeted and optimized deep learning algorithm, high-fidelity data restoration and reliable augmentation without numerical drift are achieved, significantly improving data quality and business value.
[0048] like Figure 1 As shown, the method includes the following steps:
[0049] S1) Obtain time-series data of power data and task instructions. In this embodiment, the time-series data of power data is at least one of the power consumption data, power consumption data, voltage data or current data of power users obtained from a database or real-time data stream, and the task instructions are one of the data repair instructions or data density enhancement instructions.
[0050] S2) If the task instruction is a data repair instruction, then follow the instructions. Figure 1 The left branch, as shown, specifically includes:
[0051] The normal data and abnormal or missing parts in the time series data are identified, and then input into a trained conditional diffusion model. The conditional diffusion model takes the known normal data parts in the time series data as conditions and combines them with preset periodic prior information. By capturing long-term periodic dependencies, it generates filler values and fills the abnormal or missing parts in the time series data with the filler values to obtain the data-repaired power data.
[0052] S3) If the task instruction is a data density enhancement instruction, then according to... Figure 1 The branch on the right, as shown, specifically includes:
[0053] The time series data is used as a low-frequency data sequence and then input into a trained temporal generative adversarial network. The temporal generative adversarial network uses the low-frequency data in the low-frequency data sequence as a constraint to generate a high-frequency data sequence and applies a consistency loss constraint to ensure that the aggregated value of the generated high-frequency data sequence is the same as the original value of the corresponding low-frequency data. The high-frequency data sequence is then output as power data with enhanced data density.
[0054] Through the above steps, when repairing long-period missing data, the repaired data generated by the method of this embodiment is no longer a smooth curve, but contains detailed fluctuations and periodic characteristics that are indistinguishable from real data, which greatly improves the authenticity, usability and accuracy of downstream analysis of the data. In addition, the method of this embodiment ensures the absolute correctness and credibility of the generated high-frequency data in business logic during data upscaling.
[0055] The following is a detailed explanation of each step.
[0056] In this embodiment, step S1 involves obtaining time-series power data to be processed from a database or real-time data stream and receiving corresponding task instructions. Then, a decision-making process is initiated, determining whether the task instruction is "data repair" or "data density enhancement," and execution is performed based on the determination result. Figure 1 The corresponding process branches are shown in the figure.
[0057] In this embodiment, step S2, in response to the task instruction being a data repair instruction, executes a data repair process. Starting with identifying and marking abnormal / missing data segments, it uses a conditional diffusion model based on multi-scale attention for iterative denoising, generates padding values using normal data as conditions, and finally outputs a high-fidelity complete sequence after padding. The specific steps include:
[0058] S21) Prepare input data and mask, using the data mask to specify the known normal data portion and the abnormal or missing data portion to be filled in the time series data;
[0059] Specifically, firstly, the input time series data... The analysis is performed to locate the abnormal or missing data segments that need to be repaired. Then, a [database / structure] is generated. Equal-length binary mask vector Among them, for the data points to be repaired Its corresponding mask value For known normal data points Its corresponding mask value .
[0060] S22) Perform a conditional diffusion model based on multi-scale temporal attention for repair. The conditional diffusion model with multi-scale temporal attention mechanism is used for deep learning and the data’s daily, weekly and other multi-scale periodicity patterns are utilized to improve the data authenticity of the filled values.
[0061] In this embodiment, addressing the complex characteristics of power time-series data, such as long-term missing data, multi-scale periodicity (daily and weekly patterns), and non-periodic abrupt changes (e.g., holidays, equipment maintenance), a deep repair scheme driven entirely by end-to-end, intrinsic data information, is proposed instead of a simple conditional diffusion model. This scheme does not rely on any external correlation sequence inferences or power flow calculations (which often introduce significant errors in data silos or abrupt change scenarios). Instead, it achieves high-fidelity reconstruction of missing data through adaptive improvements to the model structure and conditional injection method.
[0062] The conditional diffusion model used in this embodiment is based on a specially designed neural network using Multi-Scale Temporal Attention U-Net. Its working principle has been improved as follows:
[0063] (1) Introduce temporal feature encoding as a strong prior condition
[0064] To enable the model to deeply understand the periodic context at each time point, this embodiment creates a temporal feature encoding vector for each time point t of the input sequence. This serves as periodic prior information. Periodic prior information includes at least one of the following: hour of day, day of the week, or holiday information. This encoding not only contains regular location information but also explicitly integrates key prior knowledge of the power system. The mathematical expression is as follows:
[0065]
[0066] in, It is the temporal feature encoding vector at time point t. It refers to the hours of a day (0-23). It is the weekday (1-7). and These are binary identifiers for holidays and seasons, respectively. These codes are used in conjunction with the original time-series data. Together as conditional inputs to the model ,Right now ,in Representing time series data, Represents the encoding vector of all temporal features The characteristic matrix formed, Representation of time series data A binary mask vector of equal length is used, where the mask value for the data point to be repaired is 1, and the mask value for the normal data point is 0. This allows the model to know the periodicity profile of the data segment to be repaired before the repair process begins.
[0067] (2) Construct a multi-scale temporal attention mechanism to capture long-range dependencies
[0068] To address the challenge of traditional models focusing only on neighboring data and struggling to repair long-term missing data, this embodiment embeds a multi-scale temporal attention module into the bottleneck layer of U-Net. This module consists of two parallel attention heads: a short-term dependency attention head for capturing short-term dependencies, and a long-term dependency attention head for capturing daily or weekly periodic dependencies. Both are structurally adapted to different temporal features and are aggregated at the bottleneck layer after output, thus jointly supporting the model's multi-scale perception capability.
[0069] First, for each time point The model uses intermediate samples from the current diffusion process. and its corresponding temporal feature encoding As input; the set of historical time points is denoted as Short-term dependence on the head is a key focus. Nearby Neighborhood Window This is to capture local smoothing and short-term fluctuations; long-term cycle heads are anchored by daily, weekly, and other cycle anchor points. As a focus object, it is used to reconstruct long-term periodic dependencies.
[0070] The calculation process for short-term attention-dependent heads is as follows:
[0071]
[0072]
[0073]
[0074] in This is a relative position offset term used to ensure the continuity of the trend between local smoothing and adjacent points. These are the query vector, key vector, and value vector. Indicates attention weights, It is the output of a short-term attention-dependent head. These are the learnable parameters.
[0075] The calculation process for long-term attention heads is as follows:
[0076]
[0077]
[0078]
[0079] in This is a periodic consistency bias function used to emphasize historical moments corresponding to the current time point on a daily or weekly cycle. This is an adjustable coefficient. These are the query vector, key vector, and value vector. Indicates attention weights, It is the output of a short-term attention-dependent head. These are the learnable parameters.
[0080] The outputs of the two attention heads are concatenated by channel at the bottleneck layer and then aggregated through a linear transformation. The result is injected into the hidden state of the bottleneck layer.
[0081]
[0082] in This represents the original hidden state of the bottleneck layer. The conditional mapping matrix, This represents normalization and nonlinear activation operations.
[0083] The final output obtained by the attention module As an explicit conditional feature, it is input into the noise prediction model. And participate in the reverse denoising process, so that in each step of the reverse denoising, the noise prediction model Both can utilize this attention mechanism to accurately extract patterns and details from historical data that best fit the current cyclical context, thereby generating filled values that are highly consistent with the context in terms of statistical distribution and fluctuation characteristics. The corresponding relationships are as follows:
[0084]
[0085] Therefore, the calculation process of the noise prediction model in formula (5) explicitly includes the conditional term of the attention mechanism output. Specifically, this is manifested in:
[0086]
[0087] in, The conditional features calculated by the multi-scale temporal attention module described in formulas (2) and (3) above (by...) Once the learnable parameters are determined, they are used to inject into the bottleneck layer of U-Net and participate in the noise prediction model. The calculation; and These are pre-set or selected plan parameters in the diffusion schedule, not generated by the attention mechanism.
[0088] Equivalently, the noise prediction model can be expressed as:
[0089]
[0090] in That is, the feature representation obtained by aggregating the outputs of short-term dependent attention heads and long-term periodic attention heads. Let be the conditional mapping matrix. This equivalent representation clearly shows how the output of the multi-scale attention mechanism is injected into the bottleneck layer of the model and directly affects the noisy prediction model. The calculation is performed to form the complete link of the conditional diffusion process in formula (6).
[0091] Through the above improvements, the conditional diffusion model in this embodiment can make full use of the short-term and long-term dependency features calculated by the multi-scale attention mechanism in each step of the denoising generation, thereby achieving high-fidelity reconstruction of missing data and accurate capture of periodic patterns.
[0092] In this embodiment, step S3, in response to the task instruction being a data density enhancement instruction, executes a data density enhancement process. Starting with acquiring a low-frequency data sequence, a physically constrained temporal GAN is executed to generate high-frequency subsequences. A consistency constraint derived from energy conservation is applied to ensure that the aggregated value is strictly equal to the original value. Finally, a high-frequency sequence that passes the consistency check is output. Specific steps include:
[0093] S31) Obtain the low-frequency data sequence;
[0094] Obtain the low-frequency sequence to be enhanced For example, k consecutive hours of electricity consumption data.
[0095] S32) Execute a physically-constrained temporal generative adversarial network (PCS-GAN).
[0096] Traditional generation algorithms often produce high-frequency data whose aggregated values drift away from the original low-frequency data, violating the fundamental law of energy conservation. This results in generated data that appears realistic but is completely unusable. To overcome this challenge, this embodiment proposes a Physics Constrained Sequential GAN (PCS-GAN). This network framework includes a specially designed temporal generator G, a temporal discriminator D, and an original loss function that reflects the laws of physics.
[0097] (1) Using a Sequential Generator (G)
[0098] The time series generator G in this embodiment is built based on common structural forms in the field of time series generation, such as recurrent neural networks, long short-term memory networks, or Transformer models. Its method of generating minute-level data sequences sequentially in chronological order is a well-known implementation in the field. While maintaining the basic structure of this generation framework, this embodiment makes targeted adjustments to the input and output interfaces to address physical consistency constraints and the characteristics of the upsampling task.
[0099] Missing data masks and temporal prior codes are added to the input to ensure that the model fully utilizes available observational information and temporal patterns during the generation process, so that the conditional input is also updated. ,in, Representing time series data, Temporal feature encoding vector representing all periodic prior information The characteristic matrix formed, Representation of time series data A binary mask vector of equal length, where the mask value corresponding to the data point to be repaired is 1, and the mask value corresponding to the normal data point is 0.
[0100] A constrained output layer and residual mapping are used at the output end to ensure that the generated high-frequency data sequence is strictly consistent with the input low-frequency data in terms of physical quantities after aggregation.
[0101] Through this interface-level structural adaptation, the time series generator G can work efficiently with the discriminator D and the physical consistency loss function, thereby balancing generation accuracy and conservation constraints to achieve high-fidelity data density enhancement.
[0102] (2) Using a Sequential Discriminator (D)
[0103] In this embodiment, the discriminator D employs a one-dimensional convolutional neural network (1D-CNN). It receives a complete high-frequency sequence (real or generated by G) as input, and through multiple convolutional and pooling operations, extracts the overall pattern features of the sequence, such as the smoothness of fluctuations, the regularity of peaks and valleys, and noise levels. Finally, it outputs a scalar to determine the authenticity of the sequence. This design upgrades the discriminator from judging the authenticity of "points" to judging the authenticity of "lines" (i.e., dynamic patterns).
[0104] (3) Apply key constraints based on the law of conservation of energy
[0105] This embodiment implements the consistency constraint by adding a consistency loss term to the loss function of the conditional generative adversarial network to measure the difference between the aggregated high-frequency data values and the original low-frequency data values. During the training of the generator G, its total loss function... It consists of two parts:
[0106]
[0107] in, It's an adversarial loss, the standard loss term in GANs, which drives the generator G to produce sequences that can fool the discriminator D and statistically approximate the real data. These are hyperparameters used to balance the two losses. The physical consistency loss is defined in this embodiment as the absolute difference or squared difference between the sum of the generated high-frequency data sequence values and the corresponding original low-frequency data values, or as the quadratic norm of the difference between the sum of the generated high-frequency data sequence values and the corresponding original low-frequency data values.
[0108] Physical consistency loss The theoretical basis directly stems from the law of conservation of electric charge in physics, which states that the total electric charge over a long period must be exactly equal to the sum of the electric charges over all short periods within that period. This is an inviolable rigid business logic in the power industry. This physical law can be transformed into a differentiable loss function, mathematically expressed as follows:
[0109]
[0110] in, It is a high-frequency sequence generated by generator G. The i-th data point in the data, These are the raw low-frequency data points used as input conditions.
[0111] By introducing physical consistency loss into the total loss This technology forces the generator to always maintain a strict physical constraint that the aggregated value of the generated sequence is exactly equal to the original low-frequency value while learning to generate realistic details and fluctuations. This fundamentally solves the numerical drift and non-conservation problems that are common in existing technologies, ensuring that the generated high-frequency data is not only morphologically realistic and reliable, but also numerically accurate, thus possessing business value for advanced applications such as refined load analysis, demand-side response, and settlement.
[0112] S33) Output the enhanced high-frequency sequence
[0113] Once the model is trained and the data density augmentation task is performed, for each low-frequency input data point, the generator G will produce a high-frequency subsequence that passes the consistency check. Finally, all the generated high-frequency subsequences are concatenated in chronological order to form a complete high-frequency time series with augmented data density. .
[0114] Furthermore, this embodiment also proposes an adaptive repair and on-demand enhancement system for power data, including a processor and a computer-readable storage medium. The computer-readable storage medium stores a computer program, which is executed by the processor to implement the steps of the adaptive repair and on-demand enhancement method for power data described in this embodiment.
[0115] Furthermore, this embodiment also proposes a computer-readable storage medium storing a computer program, which, when executed by a processor, implements the steps of the adaptive repair and on-demand enhancement method for power data described in this embodiment.
[0116] In summary, this invention proposes an adaptive repair and on-demand enhancement method and system for power data. The data repair process employs a conditional diffusion model incorporating a multi-scale temporal attention mechanism. Based on known normal data portions in the time-series data as conditions, it generates high-fidelity repair data to fill in abnormal or missing data portions. The multi-scale temporal attention mechanism is used to capture long-term periodic dependencies in the time-series data. The data density enhancement process employs a conditional generative adversarial network (GAN). Based on low-frequency time-series data as constraints, it generates high-frequency time-series data. During the GAN processing, a consistency loss constraint derived from physical conservation laws is applied to ensure that the generated high-frequency data, after aggregation, maintains numerical consistency with the original low-frequency data. This invention has the following significant advantages:
[0117] 1. Extremely high data fidelity and adept at handling long-period missing data: The conditional diffusion model employed in this invention, which incorporates a multi-scale temporal attention mechanism, can deeply learn and utilize the daily, weekly, and other multi-scale periodic patterns of the data. Therefore, when repairing long-period missing data, the generated repaired data is no longer a smooth curve, but contains detailed fluctuations and periodic characteristics indistinguishable from the real data, greatly improving the data's authenticity, usability, and the accuracy of downstream analysis.
[0118] 2. By innovatively introducing a consistency loss constraint derived from the law of energy conservation into generative adversarial networks, this invention fundamentally solves the fatal flaw of numerical non-conservation that is prevalent in data upscaling. This ensures the absolute correctness and reliability of the generated high-frequency data in terms of business logic, enabling it to be directly applied to scenarios with stringent requirements for numerical accuracy, such as load granular analysis, demand response, and electricity billing.
[0119] 3. Economical and efficient with wide applicability: This invention replaces expensive and time-consuming hardware upgrades with pure software and advanced algorithms, providing an economical, efficient and feasible technical path for popularizing high-frequency data analysis in various applications.
[0120] 4. High degree of automation and intelligence: Whether it is repair or enhancement, the entire process is automatically completed by pre-trained deep models, without the need for manual setting of cumbersome rules or intervention, which significantly improves the efficiency of power data governance.
[0121] Those skilled in the art will understand that embodiments of this application can be provided as methods, systems, or computer program products. Therefore, this application can take the form of a completely hardware embodiment, a completely software embodiment, or an embodiment combining software and hardware aspects. Furthermore, this application can take the form of a computer program product embodied on one or more computer-readable storage media (including, but not limited to, disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code. This application is described with reference to flowchart illustrations and / or block diagrams of methods, apparatus (systems), and computer program products according to embodiments of this application. It will be understood that each block of the flowchart illustrations and / or block diagrams, and combinations of blocks in the flowchart illustrations and / or block diagrams, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, special-purpose computer, embedded processor, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, create a machine for implementing the process. Figure 1 One or more processes and / or boxes Figure 1The computer program instructions may also be stored in a computer-readable storage medium that can direct a computer or other programmable data processing device to operate in a particular manner, such that the instructions stored in the computer-readable storage medium produce an article of manufacture including instruction means, which are implemented in a process Figure 1 One or more processes and / or boxes Figure 1 The functions specified in one or more boxes. These computer program instructions may also be loaded onto a computer or other programmable data processing apparatus to cause a series of operational steps to be performed on the computer or other programmable apparatus to produce a computer-implemented process, thereby providing instructions that execute on the computer or other programmable apparatus for implementing the process. Figure 1 One or more processes and / or boxes Figure 1 The steps of the function specified in one or more boxes.
[0122] The above description is merely a preferred embodiment of the present invention. The scope of protection of the present invention is not limited to the above embodiments. All technical solutions falling within the scope of the present invention's concept are within the scope of protection of the present invention. It should be noted that for those skilled in the art, any improvements and modifications made without departing from the principle of the present invention should also be considered within the scope of protection of the present invention.
Claims
1. A method for adaptive repair and on-demand enhancement of power data, the method comprising: The method comprises the following steps: obtaining time series data of power data and task instructions; if the task instruction is a data repair instruction, identifying normal data and abnormal or missing parts in the time series data, using a trained conditional diffusion model to take the known normal data part in the time series data as a condition, combining pre-set periodic prior information, generating a filling value by capturing long-term periodic dependence, filling the abnormal or missing part in the time series data with the filling value to obtain power data after data repair, and the mathematical expression of the periodic prior information is as follows: wherein, is a time-series feature encoding vector for time point t, is an hour of the day, is a day of the week, and are binary flags for holidays and seasons, respectively; The conditional diffusion model embeds an attention module including a short-term dependence attention head and a long-term periodic attention head in the bottleneck layer of a U-Net network, and the mathematical expression of the conditional diffusion model is as follows: wherein, is time series data at time point t, is a feature representation aggregated from outputs of the short-term dependency attention head and the long-term periodic attention head, is a conditional mapping matrix, is a bottleneck layer original hidden state, is a conditional input; if the task instruction is a data density enhancement instruction, the time series data is taken as a low-frequency data sequence, a trained time series generative adversarial network is used to generate a high-frequency data sequence by taking low-frequency data in the low-frequency data sequence as a constraint condition, a consistency loss constraint is applied to ensure that the aggregate value of the generated high-frequency data sequence is the same as the original value of the corresponding low-frequency data, and the high-frequency data sequence is output as power data after data density enhancement, the time series generator of the time series generative adversarial network adds a missing mask and a time prior encoding at the input end to ensure that the model makes full use of available observation information and time series rules during the generation process, and the time series generator adopts a constraint output layer and residual mapping at the output end, so that the generated high-frequency data sequence can be strictly consistent with the input low-frequency data in physical quantity after aggregation.
2. The adaptive repair and on-demand enhancement of power data method of claim 1, wherein, The mathematical expression of the conditional input is as follows: wherein, denotes time series data, denotes all time series feature encoding vectors a feature matrix consisting of, denotes a binary mask vector of the same length as the time series data wherein the data points to be repaired correspond to a mask value of 1 and normal data points correspond to a mask value of 0.
3. The adaptive repair and on-demand enhancement of power data method of claim 2, wherein, The mathematical expression of the feature representation obtained by aggregating the outputs of the short-term dependence attention head and the long-term periodic attention head is as follows: wherein, are learnable parameters, and are the outputs of the short-term dependency attention head and the long-term periodic attention head, respectively, and are mathematically expressed as follows: wherein, denotes the neighborhood window around each time point denotes the neighborhood window around each time point denotes the neighborhood window around each time point denotes the set of periodic anchor points corresponding to each time point and denote the attention weights of the short-term dependency attention head and the long-term periodic attention head, respectively, and denote the value vectors of the short-term dependency attention head and the long-term periodic attention head, respectively, , , is the intermediate sample at the history time point during the diffusion process of the conditional diffusion model, is the intermediate sample corresponding to the time-series feature encoding, and are learnable parameters, respectively.
4. The adaptive repair and on-demand enhancement of power data method of claim 3, wherein, The mathematical expression of the attention weights of the short-term dependence attention head and the long-term periodic attention head is as follows: wherein, are the query vector and the key vector of the short-term dependency attention head, respectively, , are the query vector and the key vector of the long-term periodic attention head, respectively, , is the intermediate sample at time point in the diffusion process of the conditional diffusion model, is the intermediate sample corresponding temporal feature encoding, and are the intermediate sample and the temporal feature encoding at historical time point , is the relative position bias term, is the periodic consistency bias function, is the adjustable coefficient, are the learnable parameters, respectively.
5. The adaptive repair and on-demand enhancement of power data method of claim 1, wherein, The mathematical expression of the missing mask and the time prior encoding added at the input end of the time series generator of the time series generative adversarial network is as follows: wherein, represents time series data, represents a time series feature encoding vector of all periodic prior information a feature matrix composed of, represents the time series data a binary mask vector of the same length, wherein the mask value corresponding to the data point to be repaired is 1, and the mask value corresponding to the normal data point is 0.
6. The adaptive repair and on-demand enhancement of power data method of claim 5, wherein, The mathematical expression of the loss function of the time series generator is as follows: wherein, is the adversarial loss, is a hyperparameter for balancing the two losses, is the physical consistency loss, mathematically expressed as follows: wherein, is the i-th data point in the high-frequency data sequence generated by the generator, is the original low-frequency data point as an input condition.
7. An adaptive repair and on-demand enhancement system for power data, characterized by, The computer readable storage medium stores a computer program, and the computer program is executed by the processor to realize the steps of the adaptive repair and on-demand enhancement method of power data according to any one of claims 1-6.
8. A computer-readable storage medium, characterized in that, The computer readable storage medium stores a computer program, and the computer program is executed by the processor to realize the steps of the adaptive repair and on-demand enhancement method of power data according to any one of claims 1-6.
Citation Information
Patent Citations
Marine spatio-temporal data interpolation method based on remote sensing condition information diffusion
CN120950852A
Very high-resolution image in-painting with neural networks
US20210150678A1