Load data synthesis method and device based on conditional diffusion model

Through the load data synthesis method based on the conditional diffusion model, user needs and electricity consumption preference information are obtained and customized load curves are generated, which solves the problem that load data synthesis methods in the existing technology are difficult to adapt to personalized needs, and realizes the use of different users Flexible adaptation and customized services.

CN119106389APending Publication Date: 2024-12-10ZHUHAI POWER SUPPLY BUREAU GUANGDONG POWER GIRD CO
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202410992572.6
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-07-23
Publication Date
2024-12-10

AI Technical Summary

Technical Problem

The existing load data synthesis method is difficult to flexibly adapt to the personalized needs of different users, and requires accurate physical models and domain knowledge. The unconditional form cannot specify the synthesis characteristics and patterns of load data, and cannot meet the high personalized load configuration of heterogeneous customers. Document requirements.

Method used

Using the load data synthesis method based on the conditional diffusion model, the load synthesis requirements and power consumption preference information of the target object is obtained, and the conditional information is determined, such as the demand synthesis time and scenario, the diffusion model is expanded to generate a customized load curve, and the conditional diffusion is used. The model processes historical load data to generate a synthetic load curve.

Benefits of technology

It realizes the generation of customized load curves based on user needs and preferences, can flexibly adapt to the personalized needs of different users, provide customized services, and solves the problem that traditional methods are difficult to adapt to personalized needs.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119106389A_ABST
    Figure CN119106389A_ABST
Patent Text Reader

Abstract

The invention discloses a load data synthesis method and device based on a conditional diffusion model. The method comprises the following steps: acquiring a load synthesis demand and power consumption preference information of a target object; determining condition information for load synthesis according to the load synthesis demand and the power consumption preference information; determining a historical time period of load data required by load synthesis according to the condition information, and obtaining the load data of the target object in the historical time period; expanding the diffusion model by using the condition information to obtain a condition diffusion model; and processing the load data through a conditional diffusion model to obtain a composite load curve of the load data, the composite load curve being used for displaying the power consumption condition of the target object in the historical time period. The technical problem that a traditional load data synthesis method is difficult to flexibly adapt to individual requirements of different users in related technologies is solved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of load data synthesis, and in particular to a load data synthesis method and device based on a conditional diffusion model. Background Art

[0002] Existing load data synthesis can generally be divided into two categories: model-based methods and data-driven methods. Model-based methods generate load data based on mathematical and physical modeling of customer loads. For example, residential energy consumption is simulated by modeling the physical characteristics of household appliances and buildings; load patterns of each household component are identified and simulated to develop residential building load synthesis methods. However, these methods require accurate physical models and domain knowledge, which makes them difficult to generalize in different scenarios. In addition, model-based methods usually use approximation techniques, which may lead to large deviations in the generated load curves. Data-driven methods learn load characteristics based on historical load data and then generate new load data for customers. For example, a load estimation method based on the k-means algorithm generates missing values ​​and future values ​​for smart meters; a combination of mixed model clustering and Markov models is used to synthesize residential loads from top to bottom. In addition, with the rapid development of deep learning, some researchers have proposed load curve generation methods based on deep generative models, especially Generative Adversarial Network (GAN). For example, a flexible GAN-based framework is proposed to generate synthetic labeled load patterns and usage habits at the device level; a high-resolution load profile is recovered from a low-resolution load profile through a two-stage process using a GAN-based model and weather data; a Wasserstein GAN method with differential privacy is developed to convert real-world datasets into anonymous synthetic load datasets to protect customers' data privacy. However, most existing data-driven methods are unconditional, which means that it is impossible to specify the characteristics and patterns of the load profile to be synthesized. Therefore, these unconditional generation methods cannot meet the needs of synthesizing highly personalized load profiles for heterogeneous customers.

[0003] In summary, the current load data synthesis methods have the following defects: 1) They require precise physical models and domain knowledge, which are difficult to promote in real environments; 2) They are unconditional and cannot specify the synthesis characteristics and patterns of load data; 3) They are not suitable for the data form of power systems and require specially designed model structures.

[0004] With regard to the problem that the traditional load data synthesis method in the above-mentioned related technologies is difficult to flexibly adapt to the personalized needs of different users, no effective solution has been proposed yet. Summary of the invention

[0005] The embodiment of the present invention provides a load data synthesis method and device based on a conditional diffusion model, so as to at least solve the technical problem that the traditional load data synthesis method in the related art is difficult to flexibly adapt to the personalized needs of different users.

[0006] According to one aspect of an embodiment of the present invention, a load data synthesis method based on a conditional diffusion model is provided, comprising: obtaining load synthesis demand and electricity preference information of a target object; determining condition information for load synthesis according to the load synthesis demand and the electricity preference information, wherein the condition information includes at least: demand synthesis time and demand synthesis scenario; determining a historical time period of load data required for load synthesis according to the condition information, and obtaining the load data of the target object within the historical time period; expanding a diffusion model using the condition information to obtain a conditional diffusion model, wherein the diffusion model is used to generate a load curve based on historical load data in the absence of the condition information; processing the load data through the conditional diffusion model to obtain a synthetic load curve of the load data, wherein the synthetic load curve is used to display the electricity consumption of the target object within the historical time period.

[0007] Optionally, using the condition information to expand the diffusion model to obtain the conditional diffusion model includes: using the condition information to expand the inverse process of the diffusion model according to a first formula to obtain the conditional diffusion model, wherein the first formula is: θ (x t-1 |x t ,x c ):=N(x t-1 ;μ θ (x t ,t|x c ),σ θ (x t ,t|x c )I), t represents the time step number, x t represents the noise load data of step t, x t-1 represents the noisy load data in step t-1, which is the data obtained by adding Gaussian noise to the load data during the diffusion process of the diffusion model, x c Indicates the condition information, p θ (x t-1 |x t ,x c ) represents the noise load data in step t-1 given the noise load data in step t and the condition information x c The conditional distribution probability under the condition, θ represents the model parameters, N() represents the Gaussian distribution, μ θrepresents the mean of the Gaussian distribution, σ θ represents the standard deviation of the Gaussian distribution, I represents the unit matrix, the diffusion process of the diffusion model is used to add noise to the load data, and the inverse process of the diffusion model is used to denoise the load data after adding noise in the diffusion process.

[0008] Optionally, the load data is processed by the conditional diffusion model to obtain a composite load curve of the load data, including: gradually adding Gaussian noise to the load data through the diffusion process of the conditional diffusion model to obtain noisy load data; gradually denoising the noisy load data through the inverse process of the conditional diffusion model to obtain restored load data; and generating the composite load curve based on the restored load data using the conditional diffusion model.

[0009] Optionally, the noisy load data is gradually denoised through the inverse process of the conditional diffusion model to obtain restored load data, including: a determining step, determining the noise data added to the previous noisy load data through a noise estimation model based on the noisy load data, wherein the noise estimation model is a neural network structure composed of a plurality of stacked residual layers, and the previous noisy load data is the noisy load data of the previous time step of the noisy load data; an acquiring step, denoising the noisy load data based on the noise data to obtain restored sub-load data; an updating step, updating the previous noisy load data to the noisy load data when the time step of the noisy load data is greater than 1; and repeatedly executing the determining step, the acquiring step and the updating step until the restored sub-load data is determined to be the restored load data when the time step of the noisy load data is 1.

[0010] Optionally, the noise data to be added to the previous noisy load data is determined through a noise estimation model based on the noisy load data, including: embedding and converting the time step, the noisy load data and the conditional information to obtain an embedded time step, an embedded noisy load data and embedded conditional information; fusing the feature vectors obtained by feature extraction of the embedded time step, the embedded noisy load data and the embedded conditional information to obtain a fused feature vector; processing the fused feature vector using an activation function to obtain an output vector of each of the residual layers; and generating the noise data according to multiple output vectors of multiple residual layers.

[0011] Optionally, the condition information includes: load condition information, date condition information, the embedded condition information includes: embedded load condition information, embedded date condition information, embedding and converting the time step, the noisy load data and the condition information to obtain the embedded time step, the embedded noisy load data and the embedded condition information, including: embedding and converting the time step according to the second formula or the third formula to obtain the embedded time step, wherein the second formula is: The third formula is: t emb represents the embedding time step, d model represents a vector dimension, i represents an index of the vector dimension; the noisy load data is embedded and converted according to the fourth formula to obtain the embedded noisy load data, wherein the fourth formula is: represents the embedded noise load data, FC(x t ) represents the application of the fully connected layer to x t The load condition information is embedded and converted according to the fifth formula to obtain the embedded load condition information, wherein the fifth formula is: represents the embedded load condition information, x c,load represents the load condition information; and embedding and converting the date condition information according to the sixth formula to obtain the embedded date condition information, wherein the sixth formula is: Indicates the embedded date condition information, x c,date represents the date condition information, and OneHot() represents a one-hot encoding function.

[0012] Optionally, the feature vectors obtained by performing feature extraction on the embedding time step, the embedding noise load data and the embedding condition information are fused to obtain a fused feature vector, including: using a multi-head self-attention function to perform feature extraction on the embedding time step, the embedding noise load data and the embedding condition information to obtain multiple feature vectors; fusing the multiple feature vectors according to the seventh formula to obtain the fused feature vector, wherein the seventh formula is: x total Represents the fused feature vector, and MHSA() represents the multi-head self-attention function.

[0013] Optionally, generating the noise data according to the multiple output vectors of the multiple residual layers includes: integrating the multiple output vectors of the multiple residual layers, and generating the noise data according to an eighth formula, wherein the eighth formula is: ∈ θ(x t ,t|x c )=FC(Concat(x skip,1 ,…,x skip,k ,…,x skip,K )),∈ θ represents the noise data, Concat represents the vector concatenation operator, x skip,k represents the output vector of the k-th residual layer, and k represents the label of the residual layer.

[0014] According to another aspect of an embodiment of the present invention, a load data synthesis device based on a conditional diffusion model is also provided, including: a first acquisition unit, used to acquire the load synthesis demand and electricity preference information of a target object; a determination unit, used to determine the condition information for load synthesis according to the load synthesis demand and the electricity preference information, wherein the condition information includes at least: demand synthesis time and demand synthesis scenario; a second acquisition unit, used to determine the historical time period of load data required for load synthesis according to the condition information, and acquire the load data of the target object within the historical time period; a third acquisition unit, used to expand the diffusion model using the condition information to obtain the conditional diffusion model, wherein the diffusion model is used to generate a load curve based on historical load data in the absence of the condition information; a fourth acquisition unit, used to process the load data through the conditional diffusion model to obtain a synthetic load curve of the load data, wherein the synthetic load curve is used to display the electricity consumption of the target object within the historical time period.

[0015] Optionally, the third acquisition unit includes: a first acquisition module, configured to use the condition information to expand the inverse process of the diffusion model according to a first formula to obtain the conditional diffusion model, wherein the first formula is: p θ (x t-1 |x t ,x c ):=N(x t-1 ;μ θ (x t ,t|x c ),σ θ (x t ,t|x c )I), t represents the time step number, x t represents the noise load data of step t, x t-1 represents the noisy load data in step t-1, which is the data obtained by adding Gaussian noise to the load data during the diffusion process of the diffusion model, x c Indicates the condition information, p θ (xt-1 |x t ,x c ) represents the noise load data in step t-1 given the noise load data in step t and the condition information x c The conditional distribution probability under the condition, θ represents the model parameters, N() represents the Gaussian distribution, μ θ represents the mean of the Gaussian distribution, σ θ represents the standard deviation of the Gaussian distribution, I represents the unit matrix, the diffusion process of the diffusion model is used to add noise to the load data, and the inverse process of the diffusion model is used to denoise the load data after adding noise in the diffusion process.

[0016] Optionally, the fourth acquisition unit includes: a second acquisition module, used to gradually add Gaussian noise to the load data through the diffusion process of the conditional diffusion model to obtain noisy load data; a third acquisition module, used to gradually denoise the noisy load data through the inverse process of the conditional diffusion model to obtain restored load data; and a generation module, used to generate the synthetic load curve based on the restored load data using the conditional diffusion model.

[0017] Optionally, the third acquisition module includes: a first determination submodule, used to determine the noise data added to the previous noisy load data through a noise estimation model based on the noisy load data, wherein the noise estimation model is a neural network structure composed of a plurality of stacked residual layers, and the previous noisy load data is the noisy load data of the previous time step of the noisy load data; a first acquisition submodule, used to denoise the noisy load data based on the noise data to obtain restored sub-load data; an update submodule, used to update the previous noisy load data to the noisy load data when the time step of the noisy load data is greater than 1; a second determination submodule, used to repeatedly execute the determination submodule, the acquisition submodule and the update submodule until the time step of the noisy load data is 1, and the restored sub-load data is determined to be the restored load data.

[0018] Optionally, the first determination submodule includes: a second acquisition submodule, used to embed and transform the time step, the noise load data and the condition information to obtain an embedded time step, an embedded noise load data and an embedded condition information; a third acquisition submodule, used to fuse the feature vectors obtained by feature extraction of the embedded time step, the embedded noise load data and the embedded condition information to obtain a fused feature vector; a fourth acquisition submodule, used to process the fused feature vector using an activation function to obtain an output vector of each residual layer; and a first generation submodule, used to generate the noise data according to multiple output vectors of multiple residual layers.

[0019] Optionally, the condition information includes: load condition information and date condition information; the embedded condition information includes: embedded load condition information and embedded date condition information; the second acquisition submodule includes: a fifth acquisition submodule, configured to perform embedding conversion on the time step according to the second formula or the third formula to obtain the embedded time step, wherein the second formula is: The third formula is: t emb represents the embedding time step, d model represents a vector dimension, and i represents an index of the vector dimension; a sixth acquisition submodule, configured to embed and transform the noisy load data according to a fourth formula to obtain the embedded noisy load data, wherein the fourth formula is: represents the embedded noise load data, FC(x t ) represents the application of the fully connected layer to x t PE() represents a position encoding function; a seventh acquisition submodule is used to embed and transform the load condition information according to the fifth formula to obtain the embedded load condition information, wherein the fifth formula is: represents the embedded load condition information, x c,load represents the load condition information; an eighth acquisition submodule, used to embed and convert the date condition information according to the sixth formula to obtain the embedded date condition information, wherein the sixth formula is: Indicates the embedded date condition information, x c,date represents the date condition information, and OneHot() represents a one-hot encoding function.

[0020] Optionally, the third acquisition submodule includes: a ninth acquisition submodule, used to perform feature extraction on the embedding time step, the embedding noise load data and the embedding condition information using a multi-head self-attention function to obtain a plurality of the feature vectors; a tenth acquisition submodule, used to fuse the plurality of the feature vectors according to the seventh formula to obtain the fused feature vector, wherein the seventh formula is: x total Represents the fused feature vector, and MHSA() represents the multi-head self-attention function.

[0021] Optionally, the first generating submodule includes: a second generating submodule, configured to integrate the plurality of output vectors of the plurality of residual layers, and generate the noise data according to an eighth formula, wherein the eighth formula is: ∈ θ (x t ,t|x c )=FC(Concat(x skip,1 ,…,x skip,k ,…,x skip,K )),∈ θ represents the noise data, Concat represents the vector concatenation operator, x skip,k represents the output vector of the k-th residual layer, and k represents the label of the residual layer.

[0022] According to another aspect of an embodiment of the present invention, a load data synthesis system based on a conditional diffusion model is further provided. The load data synthesis system based on a conditional diffusion model uses any of the load data synthesis methods based on a conditional diffusion model described above.

[0023] According to another aspect of an embodiment of the present invention, a computer-readable storage medium is further provided, wherein the computer-readable storage medium includes a stored program, wherein the program executes any one of the load data synthesis methods based on the conditional diffusion model described above.

[0024] According to another aspect of an embodiment of the present invention, a processor is further provided, the processor being used to run a program, wherein the program executes any one of the load data synthesis methods based on the conditional diffusion model described above when running.

[0025] According to another aspect of an embodiment of the present invention, a computer program product is further provided, comprising computer instructions, wherein when the computer instructions are executed by a processor, any one of the load data synthesis methods based on the conditional diffusion model is executed.

[0026] In an embodiment of the present invention, the load synthesis demand and electricity preference information of the target object are obtained; the condition information for load synthesis is determined according to the load synthesis demand and electricity preference information, wherein the condition information at least includes: demand synthesis time and demand synthesis scene; the historical time period of the load data required for load synthesis is determined according to the condition information, and the load data of the target object in the historical time period is obtained; the diffusion model is expanded by the condition information to obtain the conditional diffusion model, wherein the diffusion model is used to generate a load curve according to the historical load data in the absence of condition information; the load data is processed by the conditional diffusion model to obtain a synthetic load curve of the load data, wherein the synthetic load curve is used to show the electricity consumption of the target object in the historical time period. Through the above technical scheme, the purpose of expanding the diffusion model by user demand and user preference is achieved, so as to generate the customized synthetic load curve of the user according to the load data by using the expanded conditional diffusion model, and the technical effect of providing customized load curve synthesis for different power customers according to their electricity consumption habits and personalized needs is achieved, and customized services can be flexibly adapted to the personalized needs of different users, thereby solving the technical problem that the traditional load data synthesis method in the related technology is difficult to flexibly adapt to the personalized needs of different users. BRIEF DESCRIPTION OF THE DRAWINGS

[0027] The drawings described herein are used to provide a further understanding of the present invention and constitute a part of this application. The exemplary embodiments of the present invention and their descriptions are used to explain the present invention and do not constitute an improper limitation of the present invention. In the drawings:

[0028] Figure 1 It is a hardware structure block diagram of a mobile terminal of a load data synthesis method based on a conditional diffusion model according to an embodiment of the present invention;

[0029] Figure 2 is a flow chart of a load data synthesis method based on a conditional diffusion model according to an embodiment of the present invention;

[0030] Figure 3 is a flow chart of an optional load data synthesis method based on a conditional diffusion model according to an embodiment of the present invention;

[0031] Figure 4 is a schematic diagram of a customized load curve integration framework according to an embodiment of the present invention;

[0032] Figure 5 is a schematic diagram of a conditional diffusion model for synthesizing a customized load curve according to an embodiment of the present invention;

[0033] Figure 6 is a schematic diagram of a neural network architecture of a noise estimation model according to an embodiment of the present invention;

[0034] Figure 7 is a schematic diagram of a load data synthesis device based on a conditional diffusion model according to an embodiment of the present invention. DETAILED DESCRIPTION

[0035] In order to enable those skilled in the art to better understand the scheme of the present invention, the technical scheme in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work should fall within the scope of protection of the present invention.

[0036] It should be noted that the terms "first", "second", etc. in the specification and claims of the present invention and the above-mentioned drawings are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence. It should be understood that the data used in this way can be interchanged where appropriate, so that the embodiments of the present invention described herein can be implemented in an order other than those illustrated or described herein. In addition, the terms "including" and "having" and any variations thereof are intended to cover non-exclusive inclusions, for example, a process, method, system, product or device that includes a series of steps or units is not necessarily limited to those steps or units that are clearly listed, but may include other steps or units that are not clearly listed or inherent to these processes, methods, products or devices.

[0037] As described in the background art, the traditional load data synthesis method in the related art is difficult to flexibly adapt to the personalized needs of different users. In view of the above defects, a load data synthesis method and device based on a conditional diffusion model are provided in an embodiment of the present invention.

[0038] The technical solutions in the embodiments of the present invention will be described clearly and completely below in conjunction with the accompanying drawings in the embodiments of the present invention.

[0039] The method embodiments provided in the embodiments of the present invention can be executed in a mobile terminal, a computer terminal or a similar computing device. Taking running on a mobile terminal as an example, Figure 1 1 is a hardware structure block diagram of a mobile terminal of a load data synthesis method based on a conditional diffusion model according to an embodiment of the present invention. Figure 1 As shown, the mobile terminal may include one or more ( Figure 1 Only one is shown in the figure) a processor 102 (the processor 102 may include but is not limited to a processing device such as a microprocessor MCU or a programmable logic device FPGA) and a memory 104 for storing data, wherein the mobile terminal may also include a transmission device 106 and an input / output device 108 for communication functions. It can be understood by those skilled in the art that Figure 1 The structure shown is only for illustration and does not limit the structure of the mobile terminal. Figure 1 More or fewer components as shown, or with Figure 1 Different configurations are shown.

[0040] The memory 104 can be used to store computer programs, for example, software programs and modules of application software, such as the computer program corresponding to the load data synthesis method based on the conditional diffusion model in the embodiment of the present invention. The processor 102 executes various functional applications and data processing by running the computer program stored in the memory 104, that is, the above method is implemented. The memory 104 may include a high-speed random access memory, and may also include a non-volatile memory, such as one or more magnetic storage devices, flash memory, or other non-volatile solid-state memory. In some examples, the memory 104 may further include a memory remotely arranged relative to the processor 102, and these remote memories can be connected to the mobile terminal via a network. Examples of the above network include but are not limited to the Internet, an intranet, a local area network, a mobile communication network, and a combination thereof. The transmission device 106 is used to receive or send data via a network. The specific example of the above network may include a wireless network provided by a communication provider of the mobile terminal. In one example, the transmission device 106 includes a network adapter (Network Interface Controller, referred to as NIC), which can be connected to other network devices through a base station so as to communicate with the Internet. In one example, the transmission device 106 may be a radio frequency (RF) module, which is used to communicate with the Internet wirelessly.

[0041] According to an embodiment of the present invention, a method embodiment of a load data synthesis method based on a conditional diffusion model is provided. It should be noted that the steps shown in the flowchart of the accompanying drawings can be executed in a computer system such as a set of computer executable instructions, and although the logical order is shown in the flowchart, in some cases, the steps shown or described can be executed in an order different from that shown here.

[0042] Figure 2 is a flow chart of a load data synthesis method based on a conditional diffusion model according to an embodiment of the present invention. Figure 2 As shown, the method comprises the following steps:

[0043] Step S202: Obtain the load synthesis demand and power preference information of the target object.

[0044] In this embodiment, the load synthesis demand and electricity usage preference information of a certain electricity user (i.e., the target object) can be obtained. The load synthesis demand here refers to the load data within a specific period of time that the user wants to synthesize, and the electricity usage preference information refers to the user's usual electricity usage habits and electricity usage characteristics, etc., so as to better customize the load curve according to the user's needs and electricity usage habits.

[0045] Step S204, determining the condition information for load synthesis according to the load synthesis demand and the electricity preference information, wherein the condition information at least includes: demand synthesis time and demand synthesis scenario.

[0046] In this embodiment, the condition information of the synthetic load curve may be determined according to the user's needs and electricity usage preferences.

[0047] Step S206: determine the historical time period of the load data required for load synthesis according to the condition information, and obtain the load data of the target object within the historical time period.

[0048] In this embodiment, the load data in the relevant historical time period can be acquired more specifically according to the determined condition information.

[0049] Combine the following Figure 3 and Figure 4 The above embodiments of the present invention are described in detail. Figure 3 is a flow chart of an optional load data synthesis method based on a conditional diffusion model according to an embodiment of the present invention; Figure 4 is a schematic diagram of a customized load curve integration framework according to an embodiment of the present invention.

[0050] like Figure 3 As shown, sample load data and condition information can be sampled to train the conditional diffusion model, and then the trained conditional diffusion model can be used to customize the user's synthetic load curve based on the acquired load data and condition information. The generated synthetic load curve can help the user understand the electricity consumption in a certain historical time period.

[0051] like Figure 4As shown in the figure, a client-server architecture can be used to provide customized load curve synthesis services for each customer according to their personalized needs; the client-server architecture includes the following two parts: 1) Server: The server collects the user's load curves and uses the collected data to train the global data generation model; in addition, the server also provides customized load curve synthesis services for each customer according to their personalized needs so that they have enough data to build their own data-driven models; 2) Client: Each user is responsible for uploading their own historical data to the server to help train the global model. In return, they can get customized synthetic load curves from the server when needed; it is worth noting that the uploaded data not only helps model training, but also enables users to obtain more realistic synthetic load curves; for new customers without historical data, the server also provides customized data generation services. Although the quality of the synthetic data may be slightly worse, it can initially support their data-driven applications. After obtaining customized synthetic load curves, customers can build high-performance data-driven models according to their respective application tasks, such as load prediction, anomaly detection, and energy management.

[0052] Step S208: Expand the diffusion model using the condition information to obtain a conditional diffusion model, wherein the diffusion model is used to generate a load curve based on historical load data in the absence of condition information.

[0053] In this embodiment, a diffusion model can be used to achieve high-quality load curve synthesis by converting customized synthesis into a conditional data generation problem, that is, the diffusion model can be expanded based on the conditional information obtained by analyzing user needs and electricity usage preferences to obtain a conditional diffusion model, so as to utilize the conditional diffusion model to generate a customized synthetic load curve for each customer based on the collected load data according to their personalized needs.

[0054] According to the above embodiment of the present invention, in the above step S208, the diffusion model is expanded using the conditional information to obtain the conditional diffusion model, including: using the conditional information to expand the inverse process of the diffusion model according to the first formula to obtain the conditional diffusion model, wherein the first formula is: θ (x t-1 |x t ,x c ):=N(x t-1 ;μ θ (x t ,t|x c ),σ θ (x t ,t|x c )I), t represents the time step number, x t represents the noise load data of step t, x t-1represents the noisy load data at step t-1. The noisy load data is the data obtained by adding Gaussian noise to the load data during the diffusion process of the diffusion model. c Indicates conditional information, p θ (x t-1 |x t ,x c ) represents the t-1th step noise load data given the tth step noise load data and condition information x c The conditional distribution probability under the condition, θ represents the model parameters, N() represents the Gaussian distribution, μ θ represents the mean of the Gaussian distribution, σ θ represents the standard deviation of Gaussian distribution, I represents the unit matrix, the diffusion process of the diffusion model is used to add noise to the load data, and the inverse process of the diffusion model is used to denoise the load data after the noise is added in the diffusion process.

[0055] Specifically, the diffusion model is generally divided into a diffusion process and an inverse process. Gaussian noise is first gradually added to the original load data through the diffusion process to obtain noisy load data, and then the noisy load data is gradually denoised through the inverse process to generate a synthetic load curve. In this embodiment, the inverse process of the diffusion model can be expanded using conditional information to use the conditional diffusion model obtained after the expansion to generate a customized synthetic load curve in combination with the user's personalized needs.

[0056] It should be noted that, by using conditional information to expand the inverse process of the diffusion model, a conditional expansion model is not directly obtained, but in the process of expanding the inverse process of the diffusion model by using conditional information, the noisy load data is gradually iteratively denoised, and finally a customized synthetic load curve is generated. The detailed process of generating a customized synthetic load curve in combination with the personalized needs of the user is described in detail in the following steps and will not be repeated here.

[0057] Step S210, processing the load data through a conditional diffusion model to obtain a synthetic load curve of the load data, wherein the synthetic load curve is used to display the power consumption of the target object in a historical time period.

[0058] In this embodiment, the conditional diffusion model may be used to synthesize the collected load data to obtain a synthetic load curve.

[0059] According to the above embodiment of the present invention, in the above step S210, the load data is processed by the conditional diffusion model to obtain a composite load curve of the load data, including: gradually adding Gaussian noise to the load data through the diffusion process of the conditional diffusion model to obtain noisy load data; gradually denoising the noisy load data through the inverse process of the conditional diffusion model to obtain restored load data; and generating a composite load curve based on the restored load data using the conditional diffusion model.

[0060] Combine the following Figure 5 The above embodiments of the present invention are described in detail. Figure 5 is a schematic diagram of a conditional diffusion model for synthesizing a customized load curve according to an embodiment of the present invention.

[0061] like Figure 5 As shown in Figure 1, the diffusion model consists of two processes: the diffusion process and the inverse process. The difference between the diffusion model and other latent variable models is that the posterior comes from the Markov chain. Specifically, Gaussian noise is gradually added to the original data through the diffusion process, which can be expressed as: Among them, q(x 1:T |x0) represents the diffusion process; x0 is the original data; x t is the noise data for the tth step; T is the total time step; since the diffusion process is defined by a Markov chain, Gaussian noise is iteratively added to x0, so t Sampling will take a lot of time. To improve sampling efficiency, we use the reparameterization trick to rewrite the diffusion process into a closed form for arbitrary time steps: Among them, q(x t |x0) represents the noise data of the tth step; N is Gaussian distribution; α t ∈(0,1) is the noise plan value; I is the identity matrix, and j represents the index of the time step.

[0062] On the other hand, the inverse process aims to t Denoising is performed to recover x0 so that it can eventually reconstruct the data samples from Gaussian noise; since the inverse process is difficult to express directly and explicitly, a neural network model can be used for approximation; in addition, a conditional diffusion model is proposed to consider the personalized needs of customers, so that customized load curves can be generated; specifically, the inverse process is expanded into a conditional form as follows: θ (x t-1 |x t ,x c ):=N(x t-1 ;μ θ (x t ,t|x c ),σ θ (x t ,t|xc )I), where p θ (x t-1 |x t ,x c ) represents the conditional inverse process; μ θ (x t ,t|x c ) and σ θ (x t ,t|x c ) are two neural networks used to estimate the mean and variance of Gaussian distribution respectively; x c It is conditional information.

[0063] In a specific embodiment of the present invention, the noisy load data is gradually denoised by the inverse process of the conditional diffusion model to obtain the restored load data, including: a determining step, determining the noise data added to the previous noisy load data by a noise prediction model based on the noisy load data, wherein the noise prediction model is a neural network structure composed of a plurality of stacked residual layers, and the previous noisy load data is the noisy load data of the previous time step of the noisy load data; an acquiring step, denoising the noisy load data based on the noise data to obtain the restored sub-load data; an updating step, updating the previous noisy load data to the noisy load data when the time step of the noisy load data is greater than 1; and repeatedly executing the determining step, the acquiring step and the updating step until the time step of the noisy load data is 1, determining the restored sub-load data to be the restored load data.

[0064] Specifically, in the inverse process of the conditional diffusion model, denoising the noisy load data is a step-by-step iterative process, which is to iterate denoising step by step according to the time step, that is, for x t After denoising, we get x t-1 , and then x t-1 Denoising is performed and repeated iteratively to restore the original load data as much as possible.

[0065] It is important to note that in order to denoise the data, it is important to accurately estimate the noise added to the original data at each time step. Given that the inverse process is the inverse of the diffusion process, the objective of the diffusion model can be expressed as: min(KL(p θ (x t-1 |x t ),q(x t-1 |x t ,x0))),1≤t≤T, where q(x t-1 |x t,x0) is the posterior conditional probability of the diffusion process (i.e., the true situation with added noise); KL is the abbreviation of Kullback-Leibler divergence, which can be minimized using the diffusion model.

[0066] However, since KL divergence is difficult to calculate directly, it needs to be converted into an expression that is convenient for calculating gradients so that the neural network model can update parameters. θ (x t-1 |x t ) and q(x t-1 |x t ,x0) all obey Gaussian distribution, so KL divergence can be calculated using Rao-Blackwellized method and a closed-form expression is given. Therefore, we get the explicit expression of conditional diffusion model: Where L(θ) represents the loss function; ∈ θ is the noise estimation model, that is, the noise data added to each time step of the original load data during the diffusion process; ∈~N(0,I) is the standard Gaussian noise; q(x0) is the distribution of the original data.

[0067] In a specific embodiment of the present invention, noise data to be added to previous noisy load data is determined based on the noisy load data through a noise estimation model, including: embedding and converting a time step, noisy load data and conditional information to obtain an embedded time step, embedded noisy load data and embedded conditional information; fusing feature vectors obtained by feature extraction of the embedded time step, embedded noisy load data and embedded conditional information to obtain a fused feature vector; processing the fused feature vector using an activation function to obtain an output vector of each residual layer; and generating noise data based on multiple output vectors of multiple residual layers.

[0068] Optionally, the above condition information may include but is not limited to: load condition information and date condition information.

[0069] Optionally, the above embedded condition information may include but is not limited to: embedded load condition information and embedded date condition information.

[0070] Specifically, since all inputs of the noise estimation model (such as noise data and conditioning information) are time series, a deep learning model based on an attention mechanism can be utilized to predict the noise added to the original data during the diffusion process.

[0071] Combine the following Figure 6 The above embodiments of the present invention are described in detail. Figure 6 is a schematic diagram of a neural network architecture of a noise prediction model according to an embodiment of the present invention; Figure 6As shown in Figure 2, the noise estimation model consists of K stacked residual layers; specifically, the input includes the latent variable x t , time step t and conditional information x c , and then use skip connections to aggregate the output of each residual layer to form the final model output (i.e., the noise data at each time step). Specifically, the model is mainly composed of an embedding module, a residual module, and an output module. The specific functions of the three modules are described in detail below.

[0072] In the above embodiment of the present invention, the time step, the noise load data and the condition information are embedded and converted to obtain the embedded time step, the embedded noise load data and the embedded condition information, including: embedding and converting the time step according to the second formula or the third formula to obtain the embedded time step, wherein the second formula is: The third formula is: t emb represents the embedding time step, d model represents the vector dimension, i represents the index of the vector dimension; the noisy load data is embedded and transformed according to the fourth formula to obtain embedded noisy load data, wherein the fourth formula is: represents the embedded noise load data, FC(x t ) represents the application of the fully connected layer to x t PE() represents the position encoding function; the load condition information is embedded and transformed according to the fifth formula to obtain embedded load condition information, wherein the fifth formula is: represents embedded load condition information, x c,load represents load condition information; and embedding and converting the date condition information according to the sixth formula to obtain embedded date condition information, wherein the sixth formula is: Indicates embedded date condition information, x c,date Represents date condition information, and OneHot() represents the one-hot encoding function.

[0073] Specifically, the embedding module of the noise estimation model can implement the following functions: In order to preserve the temporal relationship of the data, an embedding transformation can be performed on each input; first, the time step t is converted into an encoding vector t emb : Among them, sin and cos represent the sine and cosine functions, d model is the vector dimension, i∈[0,d model / 2] is the vector dimension index; then, since x t is sequence data, in order to get the corresponding embedding A linear layer can be applied to transform the data: Among them, FC is the fully connected neural network, PE is the position encoding function; finally, considering the continuous conditional information x c Contains the typical load and target date of the customer, which need to be processed separately. For the typical load, the linear layer is also used to transform the sequence data to obtain For the target date, the one-hot encoding method can be used to embed the data. Among them, x c,load and x c,date Represents load condition information and date condition information; OneHot is a one-hot encoding function.

[0074] In the above embodiment of the present invention, the feature vectors obtained by feature extraction of the embedding time step, the embedding noise load data and the embedding condition information are fused to obtain a fused feature vector, including: using a multi-head self-attention function to extract features of the embedding time step, the embedding noise load data and the embedding condition information to obtain multiple feature vectors; fusing the multiple feature vectors according to the seventh formula to obtain a fused feature vector, wherein the seventh formula is: x total represents the fused feature vector, and MHSA() represents the multi-head self-attention function.

[0075] Specifically, the residual module of the noise estimation model can achieve the following functions: Since each embedded vector represents different types of content, simple addition or merging will reduce the diversity of information. Therefore, the attention mechanism can be used to extract the time series features of these vectors, and then combine them organically; then the embedded vector is divided into two parts according to whether it is related to the condition, and then each part is fused; next, the attention function is used to extract the time features of each part respectively, and then the two parts are combined to obtain the comprehensive feature x total : Among them, MHSA is the multi-head self-attention function; ⊕ is element addition.

[0076] In order to further facilitate the fusion of conditional information, x total Split into two parts, each processed by a different activation function, and then merged; different activation functions can be used for processing to avoid information loss caused by the same processing operation, thereby ensuring information diversity. In addition, residual connections can also be deployed to effectively alleviate the gradient vanishing problem.

[0077] In the above embodiment of the present invention, generating noise data according to multiple output vectors of multiple residual layers includes: integrating multiple output vectors of multiple residual layers and generating noise data according to the eighth formula, wherein the eighth formula is: ∈ θ (x t ,t|x c )=FC(Concat(x skip,1 ,…,x skip,k ,…,x skip,K )),∈ θ represents noise data, Concat represents the vector concatenation operator, x skip,k represents the output vector of the kth residual layer, where k represents the label of the residual layer.

[0078] Specifically, the output module of the noise estimation model can achieve the following functions: Since the designed model consists of multiple stacked residual layers, if the output of the last layer is directly used as the model result, some valuable information may be missed; therefore, the output of each layer can be considered and the final output (i.e., noise data) can be jointly generated by integrating jump connections: ∈ θ (x t ,t|x c )=FC(Concat(x skip,1 ,…,x skip,k ,…,x skip,K )), where Concat is a vector concatenation operator; x skip,k Represents the output of the kth residual layer.

[0079] It can be seen from the above steps that the technical solution provided by the above embodiments of the present invention can obtain the load synthesis demand and electricity preference information of the target object; determine the condition information for load synthesis according to the load synthesis demand and electricity preference information, wherein the condition information at least includes: demand synthesis time and demand synthesis scenario; determine the historical time period of the load data required for load synthesis according to the condition information, and obtain the load data of the target object in the historical time period; use the condition information to expand the diffusion model to obtain the conditional diffusion model, wherein the diffusion model is used to generate a load curve according to the historical load data in the absence of condition information; process the load data through the conditional diffusion model to obtain a synthetic load curve of the load data, wherein the synthetic load curve is used to show the electricity consumption of the target object in the historical time period, so as to achieve the purpose of expanding the diffusion model through user needs and user preferences, so as to generate the customized synthetic load curve of the user according to the load data by using the extended conditional diffusion model, and realize the technical effect of providing customized load curve synthesis for different power customers according to their electricity consumption habits and personalized needs, and can flexibly adapt to the personalized needs of different users to provide customized services.

[0080] Therefore, the technical solution provided by the above-mentioned embodiment of the present invention solves the technical problem that the traditional load data synthesis method in the related art is difficult to flexibly adapt to the personalized needs of different users.

[0081] It should be noted that, for the aforementioned method embodiments, for the sake of simplicity, they are all expressed as a series of action combinations, but those skilled in the art should be aware that the present application is not limited by the described order of actions, because according to the present application, certain steps can be performed in other orders or simultaneously. Secondly, those skilled in the art should also be aware that the embodiments described in the specification are all preferred embodiments, and the actions and modules involved are not necessarily required by the present application.

[0082] Through the description of the above implementation methods, those skilled in the art can clearly understand that the method according to the above embodiment can be implemented by means of software plus a necessary general hardware platform, and of course by hardware, but in many cases the former is a better implementation method. Based on this understanding, the technical solution of the present application, or the part that contributes to the prior art, can be embodied in the form of a software product, which is stored in a storage medium (such as ROM / RAM, magnetic disk, optical disk), and includes a number of instructions for a terminal device (which can be a mobile phone, computer, server, or network device, etc.) to execute the methods described in each embodiment of the present application.

[0083] According to an embodiment of the present invention, a load data synthesis device based on a conditional diffusion model is provided for implementing the load data synthesis method based on a conditional diffusion model. Figure 7 is a schematic diagram of a load data synthesis device based on a conditional diffusion model according to an embodiment of the present invention, such as Figure 7 As shown, the device includes: a first acquisition unit 71, a determination unit 73, a second acquisition unit 75, a third acquisition unit 77 and a fourth acquisition unit 79. The load data synthesis device based on the conditional diffusion model is described in detail below.

[0084] The first acquisition unit 71 is used to acquire the load synthesis demand and power preference information of the target object.

[0085] The determination unit 73 is used to determine the condition information for load synthesis according to the load synthesis demand and the power preference information, wherein the condition information at least includes: the demand synthesis time and the demand synthesis scenario.

[0086] The second acquisition unit 75 is used to determine the historical time period of the load data required for load synthesis according to the condition information, and acquire the load data of the target object within the historical time period.

[0087] The third acquisition unit 77 is used to expand the diffusion model using the condition information to obtain a conditional diffusion model, wherein the diffusion model is used to generate a load curve according to historical load data in the absence of condition information.

[0088] The fourth acquisition unit 79 is used to process the load data through the conditional diffusion model to obtain a synthetic load curve of the load data, wherein the synthetic load curve is used to display the power consumption of the target object in a historical time period.

[0089] It should be noted here that the above-mentioned first acquisition unit 71, determination unit 73, second acquisition unit 75, third acquisition unit 77 and fourth acquisition unit 79 correspond to steps S202 to S210 in the above-mentioned embodiments, and the five units are the same as the instances and application scenarios implemented by the corresponding steps, but are not limited to the contents disclosed in the above-mentioned embodiments.

[0090] As can be seen from the above, in the scheme recorded in the above embodiment of the present invention, the first acquisition unit can be used to acquire the load synthesis demand and electricity preference information of the target object; then the determination unit is used to determine the condition information for load synthesis according to the load synthesis demand and electricity preference information, wherein the condition information at least includes: demand synthesis time and demand synthesis scene; then the second acquisition unit is used to determine the historical time period of the load data required for load synthesis according to the condition information, and the load data of the target object in the historical time period is acquired; then the third acquisition unit is used to expand the diffusion model using the condition information to obtain the conditional diffusion model, wherein the diffusion model is used to generate a load curve according to the historical load data in the absence of condition information; finally, the load data is processed by the fourth acquisition unit through the conditional diffusion model to obtain a synthetic load curve of the load data, wherein the synthetic load curve is used to show the electricity consumption of the target object in the historical time period, so as to achieve the purpose of expanding the diffusion model through user demand and user preference, so as to generate the customized synthetic load curve of the user according to the load data by using the extended conditional diffusion model, and realize the technical effect of providing customized load curve synthesis for different power customers according to their electricity consumption habits and personalized needs, and can flexibly adapt to the personalized needs of different users to provide customized services.

[0091] Therefore, the technical solution provided by the above-mentioned embodiment of the present invention solves the technical problem that the traditional load data synthesis method in the related art is difficult to flexibly adapt to the personalized needs of different users.

[0092] Optionally, the third acquisition unit includes: a first acquisition module, configured to use the condition information to expand the inverse process of the diffusion model according to the first formula to obtain the conditional diffusion model, wherein the first formula is: p θ (x t-1 |xt ,x c ):=N(x t-1 ;μ θ (x t ,t|x c ),σ θ (x t ,t|x c )I), t represents the time step number, x t represents the noise load data of step t, x t-1 represents the noisy load data at step t-1. The noisy load data is the data obtained by adding Gaussian noise to the load data during the diffusion process of the diffusion model. c Indicates conditional information, p θ (x t-1 |x t ,x c ) represents the t-1th step noise load data given the tth step noise load data and condition information x c The conditional distribution probability under the condition, θ represents the model parameters, N() represents the Gaussian distribution, μ θ represents the mean of the Gaussian distribution, σ θ represents the standard deviation of Gaussian distribution, I represents the unit matrix, the diffusion process of the diffusion model is used to add noise to the load data, and the inverse process of the diffusion model is used to denoise the load data after the noise is added in the diffusion process.

[0093] Optionally, the fourth acquisition unit includes: a second acquisition module, which is used to gradually add Gaussian noise to the load data through the diffusion process of the conditional diffusion model to obtain noisy load data; a third acquisition module, which is used to gradually denoise the noisy load data through the inverse process of the conditional diffusion model to obtain restored load data; and a generation module, which is used to generate a synthetic load curve based on the restored load data using the conditional diffusion model.

[0094] Optionally, the third acquisition module includes: a first determination submodule, used to determine the noise data added to the previous noisy load data based on the noisy load data through a noise estimation model, wherein the noise estimation model is a neural network structure composed of a plurality of stacked residual layers, and the previous noisy load data is the noisy load data of the previous time step of the noisy load data; a first acquisition submodule, used to denoise the noisy load data based on the noise data to obtain restored sub-load data; an update submodule, used to update the previous noisy load data to the noisy load data when the time step of the noisy load data is greater than 1; a second determination submodule, used to repeatedly execute the determination submodule, the acquisition submodule and the update submodule until the time step of the noisy load data is 1, and the restored sub-load data is determined to be the restored load data.

[0095] Optionally, the first determination submodule includes: a second acquisition submodule, which is used to embed and transform the time step, the noise load data and the condition information to obtain the embedded time step, the embedded noise load data and the embedded condition information; a third acquisition submodule, which is used to fuse the feature vectors obtained by feature extraction of the embedded time step, the embedded noise load data and the embedded condition information to obtain a fused feature vector; a fourth acquisition submodule, which is used to process the fused feature vector using an activation function to obtain the output vector of each residual layer; and a first generation submodule, which is used to generate noise data based on multiple output vectors of multiple residual layers.

[0096] Optionally, the condition information includes: load condition information, date condition information, the embedded condition information includes: embedded load condition information, embedded date condition information, the second acquisition submodule includes: a fifth acquisition submodule, used to embed the time step according to the second formula or the third formula to obtain the embedded time step, wherein the second formula is: The third formula is: t emb represents the embedding time step, d model represents the vector dimension, i represents the index of the vector dimension; a sixth acquisition submodule is used to embed and transform the noisy load data according to the fourth formula to obtain embedded noisy load data, wherein the fourth formula is: represents the embedded noise load data, FC(x t ) represents the application of the fully connected layer to x t PE() represents a position encoding function; a seventh acquisition submodule is used to embed and transform the load condition information according to the fifth formula to obtain embedded load condition information, wherein the fifth formula is: represents embedded load condition information, x c,load represents load condition information; an eighth acquisition submodule, for embedding and converting the date condition information according to the sixth formula to obtain embedded date condition information, wherein the sixth formula is: Indicates embedded date condition information, x c,date Represents date condition information, and OneHot() represents the one-hot encoding function.

[0097] Optionally, the third acquisition submodule includes: a ninth acquisition submodule, which is used to extract features of the embedding time step, the embedding noise load data and the embedding condition information using a multi-head self-attention function to obtain multiple feature vectors; and a tenth acquisition submodule, which is used to fuse the multiple feature vectors according to the seventh formula to obtain a fused feature vector, wherein the seventh formula is: x totalrepresents the fused feature vector, and MHSA() represents the multi-head self-attention function.

[0098] Optionally, the first generating submodule includes: a second generating submodule, which is used to integrate multiple output vectors of multiple residual layers and generate noise data according to the eighth formula, wherein the eighth formula is: ∈ θ (x t ,t|x c )=FC(Concat(x skip,1 ,…,x skip,k ,…,x skip,K )),∈ θ represents noise data, Concat represents the vector concatenation operator, x skip,k represents the output vector of the kth residual layer, where k represents the label of the residual layer.

[0099] According to another aspect of an embodiment of the present invention, a load data synthesis system based on a conditional diffusion model is further provided. The load data synthesis system based on a conditional diffusion model uses any of the above-mentioned load data synthesis methods based on a conditional diffusion model.

[0100] According to another aspect of an embodiment of the present invention, a computer-readable storage medium is further provided. The computer-readable storage medium includes a stored program, wherein the program executes any one of the above-mentioned load data synthesis methods based on the conditional diffusion model.

[0101] Optionally, in this embodiment, the computer-readable storage medium may be located in any one of the computer terminals in a computer terminal group in a computer network, or in any one of the communication devices in a communication device group.

[0102] Optionally, in this embodiment, the computer-readable storage medium is configured to store program code for executing the following steps: obtaining the load synthesis demand and electricity preference information of the target object; determining the condition information for load synthesis based on the load synthesis demand and electricity preference information, wherein the condition information includes at least: demand synthesis time and demand synthesis scenario; determining the historical time period of load data required for load synthesis based on the condition information, and obtaining the load data of the target object within the historical time period; using the condition information to expand the diffusion model to obtain a conditional diffusion model, wherein the diffusion model is used to generate a load curve based on historical load data in the absence of condition information; processing the load data through the conditional diffusion model to obtain a synthetic load curve of the load data, wherein the synthetic load curve is used to display the electricity consumption of the target object within the historical time period.

[0103] Optionally, in this embodiment, the computer-readable storage medium is configured to store program code for executing the following steps: using the condition information to expand the inverse process of the diffusion model according to the first formula to obtain the conditional diffusion model, wherein the first formula is: θ (x t-1 |x t ,x c ):=N(x t-1 ;μ θ (x t ,t|x c ),σ θ (x t ,t|x c )I), t represents the time step number, x t represents the noise load data of step t, x t-1 represents the noisy load data at step t-1. The noisy load data is the data obtained by adding Gaussian noise to the load data during the diffusion process of the diffusion model. c Indicates conditional information, p θ (x t-1 |x t ,x c ) represents the t-1th step noise load data given the tth step noise load data and condition information x c The conditional distribution probability under the condition, θ represents the model parameters, N() represents the Gaussian distribution, μ θ represents the mean of the Gaussian distribution, σ θ represents the standard deviation of Gaussian distribution, I represents the unit matrix, the diffusion process of the diffusion model is used to add noise to the load data, and the inverse process of the diffusion model is used to denoise the load data after the noise is added in the diffusion process.

[0104] Optionally, in this embodiment, the computer-readable storage medium is configured to store program code for performing the following steps: gradually adding Gaussian noise to the load data through the diffusion process of the conditional diffusion model to obtain noisy load data; gradually denoising the noisy load data through the inverse process of the conditional diffusion model to obtain restored load data; and generating a synthetic load curve based on the restored load data using the conditional diffusion model.

[0105] Optionally, in this embodiment, the computer-readable storage medium is configured to store program codes for performing the following steps: a determining step, determining noise data to be added to previous noisy load data through a noise estimation model based on the noisy load data, wherein the noise estimation model is a neural network structure composed of a plurality of stacked residual layers, and the previous noisy load data is the noisy load data of the previous time step of the noisy load data; an acquiring step, denoising the noisy load data based on the noise data to obtain restored sub-load data; an updating step, updating the previous noisy load data to the noisy load data when the time step of the noisy load data is greater than 1; and repeatedly executing the determining step, the acquiring step and the updating step until the time step of the noisy load data is 1, determining that the restored sub-load data is the restored load data.

[0106] Optionally, in this embodiment, the computer-readable storage medium is configured to store program code for executing the following steps: embedding and converting the time step, the noise load data and the condition information to obtain an embedded time step, an embedded noise load data and an embedded condition information; fusing the feature vectors obtained by feature extraction of the embedded time step, the embedded noise load data and the embedded condition information to obtain a fused feature vector; processing the fused feature vector using an activation function to obtain an output vector of each residual layer; and generating noise data based on multiple output vectors of multiple residual layers.

[0107] Optionally, in this embodiment, the computer-readable storage medium is configured to store a program code for executing the following steps: embedding the time step according to the second formula or the third formula to obtain the embedded time step, wherein the second formula is: The third formula is: t emb represents the embedding time step, d model represents the vector dimension, i represents the index of the vector dimension; the noisy load data is embedded and transformed according to the fourth formula to obtain embedded noisy load data, wherein the fourth formula is: represents the embedded noise load data, FC(x t ) represents the application of the fully connected layer to x t PE() represents the position encoding function; the load condition information is embedded and transformed according to the fifth formula to obtain embedded load condition information, wherein the fifth formula is: represents embedded load condition information, x c,load represents load condition information; and embedding and converting the date condition information according to the sixth formula to obtain embedded date condition information, wherein the sixth formula is: Indicates embedded date condition information, x c,date Represents date condition information, and OneHot() represents the one-hot encoding function.

[0108] Optionally, in this embodiment, the computer-readable storage medium is configured to store a program code for performing the following steps: extracting features of the embedding time step, the embedding noise load data, and the embedding condition information using a multi-head self-attention function to obtain a plurality of feature vectors; fusing the plurality of feature vectors according to the seventh formula to obtain a fused feature vector, wherein the seventh formula is: x total represents the fused feature vector, and MHSA() represents the multi-head self-attention function.

[0109] Optionally, in this embodiment, the computer-readable storage medium is configured to store a program code for performing the following steps: integrating multiple output vectors of multiple residual layers, and generating noise data according to the eighth formula, wherein the eighth formula is: ∈ θ (x t ,t|x c )=FC(Concat(x skip,1 ,…,x skip,k ,…,x skip,K )),∈ θ represents noise data, Concat represents the vector concatenation operator, x skip,k represents the output vector of the kth residual layer, where k represents the label of the residual layer.

[0110] According to another aspect of an embodiment of the present invention, a processor is further provided, and the processor is used to run a program, wherein when the program is run, any one of the above-mentioned load data synthesis methods based on the conditional diffusion model is executed.

[0111] According to another aspect of an embodiment of the present invention, a computer program product is further provided, comprising computer instructions, and when the computer instructions are executed by a processor, any one of the above load data synthesis methods based on the conditional diffusion model is executed.

[0112] The serial numbers of the above embodiments of the present invention are only for description and do not represent the advantages or disadvantages of the embodiments.

[0113] In the above embodiments of the present invention, the description of each embodiment has its own emphasis. For parts that are not described in detail in a certain embodiment, reference can be made to the relevant descriptions of other embodiments.

[0114] In the several embodiments provided in this application, it should be understood that the disclosed technical content can be implemented in other ways. Among them, the device embodiments described above are only schematic. For example, the division of the units can be a logical function division. There may be other division methods in actual implementation. For example, multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some interfaces, indirect coupling or communication connection of units or modules, which can be electrical or other forms.

[0115] The units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed on multiple units. Some or all of the units may be selected according to actual needs to achieve the purpose of the present embodiment.

[0116] In addition, each functional unit in each embodiment of the present invention may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit. The above-mentioned integrated unit may be implemented in the form of hardware or in the form of software functional units.

[0117] If the integrated unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present invention, in essence, or the part that contributes to the prior art, or all or part of the technical solution can be embodied in the form of a software product, and the computer software product is stored in a storage medium, including a number of instructions for a computer device (which can be a personal computer, a server or a network device, etc.) to perform all or part of the steps of the method described in each embodiment of the present invention. The aforementioned storage medium includes: U disk, read-only memory (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory), mobile hard disk, magnetic disk or optical disk and other media that can store program codes.

[0118] The above is only a preferred embodiment of the present invention. It should be pointed out that for ordinary technicians in this technical field, several improvements and modifications can be made without departing from the principle of the present invention. These improvements and modifications should also be regarded as the scope of protection of the present invention.

Claims

1. A load data synthesis method based on a conditional diffusion model, characterized in that: include: Obtain the target object's load synthesis demand and electricity preference information; Determining condition information for load synthesis according to the load synthesis demand and the electricity preference information, wherein the condition information at least includes: demand synthesis time and demand synthesis scenario; Determine the historical time period of the load data required for load synthesis according to the condition information, and obtain the load data of the target object within the historical time period; Expanding the diffusion model using the condition information to obtain a conditional diffusion model, wherein the diffusion model is used to generate a load curve based on historical load data in the absence of the condition information; The load data is processed by the conditional diffusion model to obtain a synthetic load curve of the load data, wherein the synthetic load curve is used to display the power consumption of the target object in the historical time period.

2. The load data synthesis method based on the conditional diffusion model according to claim 1 is characterized in that: The diffusion model is expanded using the conditional information to obtain a conditional diffusion model, including: The inverse process of the diffusion model is expanded according to the first formula using the condition information to obtain the conditional diffusion model, wherein the first formula is: θ (x t-1 |x t ,x c ):=N(x t-1 ;μ θ (x t ,t|x c ),σ θ (x t ,t|x c )I), t represents the time step number, x t represents the noise load data of step t, x t-1 represents the noisy load data in step t-1, which is the data obtained by adding Gaussian noise to the load data during the diffusion process of the diffusion model, x c Indicates the condition information, p θ (x t-1 |x t ,x c ) represents the noise load data in step t-1 given the noise load data in step t and the condition information x c The conditional distribution probability under the condition, θ represents the model parameters, N() represents Gaussian distribution, μ θ represents the mean of the Gaussian distribution, σ θ represents the standard deviation of the Gaussian distribution, I represents the unit matrix, the diffusion process of the diffusion model is used to add noise to the load data, and the inverse process of the diffusion model is used to denoise the load data after adding noise in the diffusion process.

3. The load data synthesis method based on the conditional diffusion model according to claim 1 is characterized in that: Processing the load data by the conditional diffusion model to obtain a synthetic load curve of the load data includes: Gaussian noise is gradually added to the load data through the diffusion process of the conditional diffusion model to obtain noisy load data; The noisy load data is gradually denoised by the inverse process of the conditional diffusion model to obtain restored load data; The synthetic load curve is generated using the conditional diffusion model based on the restoration load data.

4. The load data synthesis method based on the conditional diffusion model according to claim 3 is characterized in that: The noisy load data is gradually denoised by the inverse process of the conditional diffusion model to obtain restored load data, including: A determination step, determining the noise data added to the previous noisy load data through a noise estimation model based on the noisy load data, wherein the noise estimation model is a neural network structure composed of a plurality of stacked residual layers, and the previous noisy load data is the noisy load data of the previous time step of the noisy load data; an acquisition step of performing denoising processing on the noisy load data based on the noise data to obtain restored sub-load data; An updating step, when the time step of the noise load data is greater than 1, updating the previous noise load data to the noise load data; The determining step, the acquiring step and the updating step are repeatedly performed until the time step of the noise-added load data is 1, and the restored sub-load data is determined to be the restored load data.

5. The load data synthesis method based on the conditional diffusion model according to claim 4 is characterized in that: Determining noise data to be added to previous noise load data based on the noise load data by a noise estimation model includes: Embedding and converting the time step, the noise load data and the condition information to obtain an embedded time step, embedded noise load data and embedded condition information; Fusing feature vectors obtained by performing feature extraction on the embedding time step, the embedding noise load data, and the embedding condition information to obtain a fused feature vector; The fused feature vector is processed by using an activation function to obtain an output vector of each residual layer; The noise data is generated according to a plurality of the output vectors of a plurality of the residual layers.

6. The load data synthesis method based on the conditional diffusion model according to claim 5 is characterized in that: The condition information includes: load condition information and date condition information; the embedded condition information includes: embedded load condition information and embedded date condition information; the time step, the noisy load data and the condition information are embedded and converted to obtain an embedded time step, embedded noisy load data and embedded condition information, including: The time step is embedded and converted according to the second formula or the third formula to obtain the embedded time step, wherein the second formula is: The third formula is: t emb represents the embedding time step, d model represents a vector dimension, and i represents the index of the vector dimension; The noisy load data is embedded and converted according to the fourth formula to obtain the embedded noisy load data, wherein the fourth formula is: represents the embedded noise load data, FC(x t ) represents the application of the fully connected layer to x t For conversion, PE() represents the position encoding function; The load condition information is embedded and converted according to the fifth formula to obtain the embedded load condition information, wherein the fifth formula is: represents the embedded load condition information, x c,load indicating the load condition information; The date condition information is embedded and converted according to the sixth formula to obtain the embedded date condition information, wherein the sixth formula is: Indicates the embedded date condition information, x c,date represents the date condition information, and OneHot() represents a one-hot encoding function.

7. The load data synthesis method based on the conditional diffusion model according to claim 5 is characterized in that: The feature vectors obtained by performing feature extraction on the embedding time step, the embedding noise load data and the embedding condition information are fused to obtain a fused feature vector, including: Using a multi-head self-attention function, feature extraction is performed on the embedding time step, the embedding noise load data, and the embedding condition information to obtain a plurality of feature vectors; The plurality of feature vectors are fused according to the seventh formula to obtain the fused feature vector, wherein the seventh formula is: x total Represents the fused feature vector, and MHSA() represents the multi-head self-attention function.

8. The load data synthesis method based on the conditional diffusion model according to claim 5, characterized in that: Generating the noise data according to the plurality of output vectors of the plurality of residual layers comprises: The multiple output vectors of the multiple residual layers are integrated to generate the noise data according to the eighth formula, wherein the eighth formula is: ∈ θ (x t ,t|x c )=FC(Concat(x skip,1 ,…,x skip,k ,…,x skip,K )),∈ θ represents the noise data, Concat represents the vector concatenation operator, x skip,k represents the output vector of the k-th residual layer, and k represents the label of the residual layer.

9. A load data synthesis device based on a conditional diffusion model, characterized in that: include: A first acquisition unit, used to acquire the load synthesis demand and electricity preference information of the target object; A determination unit, configured to determine condition information for load synthesis according to the load synthesis demand and the power preference information, wherein the condition information at least includes: a demand synthesis time and a demand synthesis scenario; A second acquisition unit, configured to determine a historical time period of load data required for load synthesis according to the condition information, and acquire the load data of the target object within the historical time period; a third acquisition unit, configured to expand the diffusion model using the condition information to obtain a conditional diffusion model, wherein the diffusion model is used to generate a load curve based on historical load data in the absence of the condition information; The fourth acquisition unit is used to process the load data through the conditional diffusion model to obtain a composite load curve of the load data, wherein the composite load curve is used to display the power consumption of the target object in the historical time period.

10. A computer program product comprising computer instructions, characterized in that: When the computer instructions are executed by a processor, the load data synthesis method based on the conditional diffusion model described in any one of claims 1 to 8 is performed.