Privacy-preserving digital twin modeling approach in cyber-physical energy systems

By using conditional generative adversarial networks for digital twin modeling under the federated learning framework, optimizing client selection and global model aggregation, the problems of low efficiency and privacy protection in digital twin modeling are solved, and efficient and secure digital twin modeling is achieved.

CN118890285BActive Publication Date: 2025-09-16HEILONGJIANG UNIV
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202410900113.0
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-07-05
Publication Date
2025-09-16
Estimated Expiration
2044-07-05

AI Technical Summary

Technical Problem

The existing digital twin modeling methods using federated learning have low modeling and updating efficiency due to complex calculations and analysis, and there are privacy protection issues.

Method used

A conditional generative adversarial network is used as the single digital twin model, and modeling is performed under the federated learning framework. Through client selection, initial weight distribution and global model aggregation optimization, combined with prediction methods and loss function correction, a global digital twin model is constructed.

Benefits of technology

It improves the efficiency and privacy protection capabilities of digital twin modeling, ensures model performance, and realizes secure modeling and updating in a distributed environment.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118890285B_ABST
    Figure CN118890285B_ABST
Patent Text Reader

Abstract

A digital twin modeling method for privacy protection in a cyber-physical energy system belongs to the field of wind power load forecasting modeling. The present invention addresses the problem of low modeling and updating efficiency due to complex calculations and analysis in existing digital twin modeling methods using federated learning. It includes: first, using the theoretical model of digital twins to describe the modeling focus and the relationship between digital twins and physical entities; then, solving the problem of local modeling of digital twins through cyclic conditional generative adversarial networks; finally, solving the privacy protection problem in the digital twin modeling process in a distributed environment through federated learning to ensure modeling security; in the process of modeling the digital twin global model based on federated learning, client selection, initial weight distribution and global model aggregation are optimized to improve modeling efficiency. Compared with the existing benchmark strategy, the method of the present invention can improve modeling efficiency and ensure model performance.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to a privacy-protected digital twin modeling method in a cyber-physical energy system, and belongs to the field of wind power load forecasting modeling. Background Art

[0002] As the latest paradigm in cyber-physical energy systems, digital twins fully exploit their real-time and low-cost interactive features. They significantly improve the operational efficiency of physical entities throughout their entire lifecycle and ensure reliable operational quality. However, low modeling and updating efficiency directly impacts the practical application of digital twins. Furthermore, privacy protection is often neglected during the digital twin modeling process.

[0003] Emerging technologies such as artificial intelligence, big data analytics, cloud computing, and edge computing have greatly facilitated the development of cyber-physical energy systems. However, as the scale of these systems grows, the increasing number of devices involved in them leads to a dramatic increase in workload. Consequently, the complexity of coordinating various processes is exploding. Digitalization has made the operational process more visible and transparent, improving operational efficiency while also addressing the challenges of integrating various processes. As the latest paradigm in digital technology, digital twins offer the advantages of real-time performance and low cost, making their value particularly prominent in cyber-physical energy systems.

[0004] Digital twins simulate the physical world's operational processes, predict trends and risks, and provide a basis for decision-making. Digital twins can mitigate unexpected situations in complex systems by mapping the possible or future behavior of physical entities into cyberspace for digital representation. The introduction of the digital twin concept has sparked significant research interest in academia and industry, as well as practitioners in the manufacturing, Internet of Things, and other technical communities and sectors. Some even suggest that digital twins are the most promising advanced enabling method for smart manufacturing and Industry 4.0, often referred to in academia as SOTA (State-of-the-Art). From generation to application, digital twins can be broadly summarized into five stages: acquisition, transmission, data processing, mapping, and modeling. Digital twin modeling is not only a prerequisite for the implementation of digital twin technology but also the foundation of the entire future digital twin network architecture. Considerable research has focused on digital twin modeling methods. For example, modeling methods based on mechanistic models strive for high-precision simulation of physical entities, but they are relatively complex and lack flexibility. Compared to traditional methods, machine learning can effectively model digital twins and learn relevant relationships, but it lacks a unified, concrete representation of digital twin models and still faces challenges with privacy protection and efficiency. Failure to maintain data security during digital twin modeling can lead to serious privacy issues for physical entities, such as privacy leaks. This is because digital twins present many unknown security risks during the modeling process. Y. Wang et al. demonstrate that digital twin security flaws, including privacy protection, are key obstacles to their deployment and large-scale application. Furthermore, W. Wang et al. emphasize that while digital twins can greatly empower wireless networks, they can also be vulnerable to numerous security attacks. Therefore, the security of digital twin modeling requires attention and strengthening. Consequently, Z. Zhou et al. suggest that technical solutions should be used to address privacy and security issues in the application of digital twins. Furthermore, a balance must be struck between privacy protection and data sharing when using digital twins. Federated learning, as a secure distributed learning framework, can effectively protect data privacy during digital twin modeling and achieve good modeling results. Global digital twins modeled using federated learning are universal within the selected scope.

[0005] While digital twin security is a priority, it also leads to complex computations and analysis, significantly reducing modeling and updating efficiency. The value of digital twins lies in their ability to rapidly simulate physical entities. Therefore, modeling efficiency directly determines whether digital twins can achieve their intended application outcomes. To further improve efficiency, H. Elayan et al. proposed using machine learning to implement a context-aware smart healthcare system based on the concept of digital twins. The integration of various technologies, such as artificial intelligence and blockchain, provides new technical support and direction for enhancing the efficiency of digital twins while ensuring data security. Furthermore, D. Van Huynh et al. believe that in the future, mobile edge computing and ultra-reliable and ultra-low latency communications could boost digital twin modeling efficiency to levels sufficient to construct a metaverse. However, current machine learning methods face efficiency bottlenecks when modeling digital twins. Therefore, digital twin modeling methods using federated learning require further improvement and optimization. Summary of the Invention

[0006] In response to the problem that the existing digital twin modeling method using federated learning has low modeling and updating efficiency due to complex calculations and analysis, the present invention provides a digital twin modeling method for privacy protection in a cyber-physical energy system.

[0007] The present invention provides a privacy-preserving digital twin modeling method for a cyber-physical energy system, comprising:

[0008] At the physical entity layer, the target data true value of each physical entity PO is obtained. The target data includes behavior data and status data. At the modeling layer, multiple edge servers are used to establish a single digital twin model at different times for each physical entity PO based on the corresponding target data true value, which is used to predict the target data predicted value of the physical entity PO at the target time. At the digital twin layer, a central cloud server is used to aggregate all single digital twin models to obtain a global digital twin model.

[0009] The digital twin theoretical model is obtained by combining the general representation of the prediction method used to solve the problem of digital twin. The digital twin theoretical model is then deformed by combining the prediction method currently used to solve the problem of cyber-physical energy system to obtain the digital twin specific model of cyber-physical energy system.

[0010] A conditional generative adversarial network (CGN) is used as the single digital twin model, and a value function for modeling the digital twin using the CGN is configured. The loss function for solving the current problem is then calculated based on the CGN digital twin within the federated learning framework. The CGN digital twin within the federated learning framework is then corrected by calculating the probability distribution and Wasserstein distance.

[0011] Then, federated learning is used in combination with the calculation of the loss function to update the model parameters of the discriminator and generator in the conditional generative adversarial network through stochastic gradient ascent and descent, respectively, to obtain the optimized conditional generative adversarial network;

[0012] The physical entity PO as the client is preliminarily screened to obtain the preliminarily selected clients based on data difference screening; the preliminarily selected clients are further screened based on the statistical characteristics of the client data to obtain the final selected clients; the real value of the target data corresponding to the final selected clients is used to use the optimized conditional generative adversarial network to perform final digital twin modeling on the physical entity PO, and the final single-unit digital twin model corresponding to each final selected client is obtained;

[0013] Initial weights are assigned to all the final selected clients, and the initial weights are calculated based on the mutual distances of the final selected clients; then the weighted average method is used to aggregate all the final monomer digital twin models to obtain the final global digital twin model after aggregation, thus completing the modeling.

[0014] Beneficial effects of the present invention: The method of the present invention performs digital twin modeling based on federated learning and cyclic conditional generative adversarial networks. It first uses the theoretical model of digital twins to describe the modeling focus and the relationship between digital twins and physical entities. Then, the problem of local modeling of digital twins is solved by cyclic conditional generative adversarial networks. Finally, the privacy protection problem in the digital twin modeling process in a distributed environment is solved by federated learning to ensure modeling security. The method of the present invention optimizes client selection, initial weight distribution, and global model aggregation in the process of modeling the digital twin global model based on federated learning, thereby improving modeling efficiency. Numerical experimental results based on real data sets show that the method of the present invention can improve modeling efficiency and ensure model performance compared with existing benchmark strategies. BRIEF DESCRIPTION OF THE DRAWINGS

[0015] Figure 1 This is a model architecture diagram of the privacy-preserving digital twin modeling method for the cyber-physical energy system described in the present invention;

[0016] Figure 2 This is a schematic diagram of the selection strategy for screening clients;

[0017] Figure 3 This is a diagram of the convergence of the loss function obtained by training the conditional generative adversarial network in the verification experiment;

[0018] Figure 4 yes Figure 3 The test effect diagram of the conditional generative adversarial network trained in

[15] ;

[0019] Figure 5This is the learning effect convergence diagram of the conditional generative adversarial network (random global model) of the final global digital twin model each time the central server randomly selects a client;

[0020] Figure 6 yes Figure 5 The test effect diagram of the conditional generation adversarial network obtained in ;

[0021] Figure 7 It is the learning effect convergence diagram of the final global digital twin model's conditional generative adversarial network (global rough model) every time the central server performs preliminary screening to obtain the preliminary selected client;

[0022] Figure 8 yes Figure 7 The test effect diagram of the conditional generation adversarial network obtained in ;

[0023] Figure 9 This is the learning effect convergence diagram of the conditional generative adversarial network (Global Fine Model) of the final global digital twin model when the central server performs preliminary screening and further screening to obtain the final selected client;

[0024] Figure 10 yes Figure 9 The test effect diagram of the conditional generation adversarial network obtained in ;

[0025] Figure 11 This is a comparison chart of the target data predictions of the Global Fine Model, Global Rough Model, Global Random Model, and the final single-unit digital twin model (local model) within the same time period;

[0026] Figure 12 This is a bar chart comparing the indicators in Table 2. DETAILED DESCRIPTION

[0027] The following will clearly and completely describe the technical solutions in the embodiments of the present invention in conjunction with the accompanying drawings. 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 making any creative efforts shall fall within the scope of protection of the present invention.

[0028] It should be noted that, in the absence of conflict, the embodiments of the present invention and the features in the embodiments may be combined with each other.

[0029] The present invention will be further described below with reference to the accompanying drawings and specific embodiments, but they are not intended to limit the present invention.

[0030] Specific implementation method 1. Combination Figure 1 and Figure 2 As shown, the present invention provides a privacy-preserving digital twin modeling method for a cyber-physical energy system, comprising:

[0031] At the physical entity layer, the target data true value of each physical entity PO is obtained. The target data includes behavior data and status data. At the modeling layer, multiple edge servers are used to establish a single digital twin model at different times for each physical entity PO based on the corresponding target data true value, which is used to predict the target data predicted value of the physical entity PO at the target time. At the digital twin layer, a central cloud server is used to aggregate all single digital twin models to obtain a global digital twin model.

[0032] The digital twin theoretical model is obtained by combining the general representation of the prediction method used to solve the problem of digital twin. The digital twin theoretical model is then deformed by combining the prediction method currently used to solve the problem of cyber-physical energy system to obtain the digital twin specific model of cyber-physical energy system.

[0033] A conditional generative adversarial network (CGN) is used as the single digital twin model, and a value function for modeling the digital twin using the CGN is configured. The loss function for solving the current problem is then calculated based on the CGN digital twin within the federated learning framework. The CGN digital twin within the federated learning framework is then corrected by calculating the probability distribution and Wasserstein distance.

[0034] Then, federated learning is used in combination with the calculation of the loss function to update the model parameters of the discriminator and generator in the conditional generative adversarial network through stochastic gradient ascent and descent, respectively, to obtain the optimized conditional generative adversarial network;

[0035] The physical entity PO as the client is preliminarily screened to obtain the preliminarily selected clients based on data difference screening; the preliminarily selected clients are further screened based on the statistical characteristics of the client data to obtain the final selected clients; the real value of the target data corresponding to the final selected clients is used to use the optimized conditional generative adversarial network to perform final digital twin modeling on the physical entity PO, and the final single-unit digital twin model corresponding to each final selected client is obtained;

[0036] Initial weights are assigned to all the final selected clients, and the initial weights are calculated based on the mutual distances of the final selected clients; then the weighted average method is used to aggregate all the final monomer digital twin models to obtain the final global digital twin model after aggregation, thus completing the modeling.

[0037] The digital twin theoretical model proposed in this embodiment can well describe the characteristics and modeling process of digital twins using machine learning and neural networks. Considering that the data used to model digital twins should be privacy-protected, this embodiment uses federated learning to ensure that the original data used to model digital twins is not shared but can still be fully utilized during the model training process. In addition, to improve the modeling and updating efficiency of digital twins, an optimization method for modeling global digital twins using federated learning is proposed, which ensures both efficiency and model performance.

[0038] The theoretical model of digital twins proposed in this embodiment mainly describes the two-way dynamic relationship between physical entities and digital twins from the two perspectives of historical experience data and real-time operating status; the use of cyclic conditional generative adversarial networks to model local digital twins can better perceive the data distribution of physical entities and extract useful time series features; the use of federated learning to model global digital twins allows digital twins to have high versatility within the optional range while solving the privacy protection issues that exist when aggregating local digital twins in a distributed environment; this embodiment formulates and optimizes client selection, initial weight distribution, and model aggregation in the process of global digital twin modeling based on federated learning, thereby greatly improving the efficiency of digital twin modeling and updating while ensuring good model performance; numerical results and simulation experimental results based on real data sets show that the proposed digital twin modeling method is significantly better than the baseline strategy.

[0039] The following first introduces traditional methods for modeling digital twins, including software-defined methods and model engineering, and then discusses the use of machine learning to model digital twins.

[0040] First, the software-defined approach attempts to simulate physical entities with high fidelity through visualization tools, software, or other technologies, achieving maximum consistency between the digital twin and the physical entity. Essentially, it models a digital mirror or replica of the physical entity. This approach allows the digital twin model to be based on the physical entity itself, providing a reference for simulating operational processes. The software-defined approach requires the construction of digital twins based on specific modeling theories or methods. For example, an existing digital twin conceptual modeling method based on a five-dimensional digital twin framework represents the complex relationships between physical entities and their attributes. Furthermore, existing discrete event system modeling theories for building three-dimensional digital twins construct and map all discrete units into digital manufacturing modules, ultimately integrating all these digital modules into a three-dimensional digital twin model. Similarly, in the manufacturing context, some literature categorizes digital twins into product digital twins, process digital twins, and operational digital twins, modeling and operating them separately to simulate the state and behavior of the corresponding physical entities for production process optimization. However, the software-defined approach focuses on theory and neglects practical considerations in digital twin modeling. Furthermore, there is a lack of clear consensus on information modeling standards within the software-defined approach. Most importantly, the software-defined approach overly pursues high-precision modeling results, which is difficult to achieve in practice.

[0041] Then, model engineering focuses on the core of the model to fundamentally clarify issues related to digital twin model establishment. For this reason, some literature attempts to address two questions from the perspective of model engineering: how to correctly define a digital twin and how to correctly build a digital twin. While introducing the concept and related technologies of model engineering, it also specifically points out that modeling without addressing the specific aspects to be studied is meaningless, as any model is built based on specific requirements. This allows for better study of the dynamic changes in the model's properties and ensures that it remains within the lifecycle of the modeled object. Other literature, from an engineering perspective, proposes using model-driven engineering, a design approach that strives to be both flexible and universal. Specifically, digital twins should first be modeled as basic components according to their respective functions, and then these components should be aggregated hierarchically to form a complete digital twin. However, model engineering fails to integrate all details, including many issues such as definition, quantification, evaluation metrics, and data processing and management during modeling. Furthermore, it fails to consider the dynamic evolution and universality of digital twins over time. Therefore, model engineering is more suitable as a guiding principle for digital twins rather than a specific modeling method.

[0042] Finally, machine learning, with its superior feature extraction and correlation learning capabilities, has become a highly effective approach for modeling digital twins. This is because the relationships between digital twins and their corresponding physical entities are complex. Modeling them using mathematical equations is complex and lacks flexibility and adaptability. Machine learning, on the other hand, offers simplicity, efficiency, scalability, and applicability. Compared to other approaches, machine learning can learn correlations based on valuable data provided by physical entities to model digital twins. For example, a digital twin wireless network architecture implemented using federated learning effectively alleviates the problem of unreliable communication between user terminals and remote edge servers. Similarly, a digital twin edge network architecture integrates digital twins into edge networks to improve communication efficiency and reduce transmission costs. Building on this architecture, a blockchain-enabled federated learning modeling strategy is proposed to further enhance communication security and data privacy, and an asynchronous aggregation strategy is proposed to rationally allocate bandwidth resources. Furthermore, after proposing the use of deep reinforcement learning to address random offloading in digital twin networks, the architecture is further refined and optimized from two perspectives: reducing offloading latency and verifying model updates. However, using machine learning to build digital twins can lead to the leakage of raw data about physical entities or expose the models themselves to cyberattacks. Furthermore, addressing security concerns can reduce modeling and update efficiency. Data encryption or additional security measures can significantly reduce modeling efficiency. A crucial application of digital twins is near-real-time advanced simulation of physical entities, which inevitably impacts their practical application. Therefore, it's crucial to consider how to improve the efficiency of digital twin modeling and updates.

[0043] This implementation considers the unique characteristics of machine learning-based digital twin modeling and proposes a theoretical model for digital twins, describing their digital representation in both general and specific scenarios. Next, a generative adversarial network is used to fully learn the data patterns of physical entities, generating corresponding digital twins for modeling. Finally, federated learning is used to model digital twins, ensuring data security for the physical entities. Furthermore, optimization strategies are proposed to improve modeling and update efficiency.

[0044] This implementation divides the digital twin model architecture into the physical entity layer, the modeling layer, and the digital twin layer. Figure 1As shown in Figure 2, N different devices (including sensors, mobile devices, computing devices, etc.) in the physical entity layer represent the corresponding physical entities PO of the digital twin DT to be modeled. This layer provides the behavioral data required for modeling digital twins that can characterize the behavior of N physical entities at different times t.<X,Y> The uploaded data undergoes preprocessing, such as cleaning and enhancement, before being used for model training. In the modeling layer, each edge server is responsible for local modeling of its own physical entity. Each edge server uses a deep neural network to model the digital twin of each physical entity PO at different times. At the digital twin layer, these local digital twin models are aggregated globally by a central cloud server, ultimately resulting in a global digital twin model.

[0045] The digital twin construction process evolves through three layers, and as data volumes continue to grow, the model continues to be modeled and updated in real time. After the digital twin modeling is complete, the digital twin layer feeds back analysis results to the physical entity layer, driving its improved operation in the real world. This cycle of bidirectional closed-loop iterations repeats itself. As the digital twin's network topology and overall structure become increasingly complex and complete, the physical entity itself will also continue to be improved and optimized.

[0046] This implementation method focuses on the relationship between characteristics such as data, status and behavior, eliminates the interference of other unimportant factors, and designs and constructs digital twins at a deeper level with the model as the center. The system model will establish the digital twin from two perspectives: 1) general model 2) specific model.

[0047] In this embodiment, the method for establishing a single digital twin model is as follows:

[0048] The behavior data of N physical entities PO is expressed as<X,Y> , where X represents the sampled behavior data set of N physical entities PO, and Y represents the data label set of the sampled behavior data:

[0049] X={x1,x2,...,x N},

[0050] Y={y1,y2,...,y N},

[0051] Where x N is the sampling behavior data of the Nth physical entity PO, y N is the sampling behavior data x N Corresponding data labels;

[0052] S represents the state data set:

[0053] S={S1,S2,...,S T},

[0054] Where S T The status data of all physical entities PO at time T;

[0055] The single digital twin model is represented as

[0056]

[0057] Aggregate all individual digital twin models to obtain the global digital twin model DT t :

[0058]

[0059] In the formula is the preprocessed sampling behavior data set X.

[0060] General model: When solving different tasks, the digital twin obtains the behavioral model of the tth moment in different dimensions based on the data tuples and state modeling of the physical entity The model is substituted into the problem to be studied to output the digital twin to predict the possible future behavior of the physical entity, and then compared and analyzed with the actual behavior of the physical entity in the future. Finally, the digital twin general model is obtained by minimizing the convergence loss between the digital twin and the physical entity.

[0061] The theoretical model of digital twin is:

[0062]

[0063] Where F represents the loss function, P is the general representation of the prediction method used by digital twins to solve problems, and the output result is the predicted value of the target data. t The digital twin provides the actual value of the target data PO for the physical entity; the digital twin feeds the analysis results back to the physical entity as a reference and guidance for future operations. The physical entity then provides updated data to the digital twin for further optimization. This real-time two-way interaction, modeling, and updating not only reduces the transmission load and improves work efficiency, but also drives the physical entity to better operate and provide services in the real world.

[0064] Specific model: The specific model of the digital twin model varies depending on the specific problem. Based on the general model, the specific model can transform the problem to be solved and the loss function into the representation of the corresponding problem. For example, when the digital twin is used to solve the regression problem, the specific model of the digital twin of the cyber-physical energy system is:

[0065] DT t+i=minMSE(RG t~t+i (DT t ),PO t+i ) (2),

[0066] Where i represents a future time point relative to the current time t, MSE represents the mean square error, the current problem to be solved is a regression problem, MSE is the loss function for the regression problem, RG is the prediction method corresponding to the regression problem, and the output is the predicted value of the target data at time t+i.

[0067] When solving the special case of regression problems, the digital twin model can use the MSE as a loss function. By comparing the future behavior of the physical entity with the behavior predicted by the digital twin, the corresponding analysis results are processed. The analysis results in this case are the concrete representation of the digital twin, which is the direct application of the digital twin. In turn, it can simulate the future operation of the physical entity and provide strong support and basis for making good and effective decisions.

[0068] Generative adversarial networks (GANs) play a crucial role in the digital twin modeling process, leveraging their superior unsupervised learning capabilities in perceiving data distribution and extracting data features, as well as their ability to learn the relationship between physical entities (POs) and digital twins (DTs). For example, a study used bidirectional LSTMs and GANs to model digital twins, using them as surrogate models for the SEIRS mathematical model used to study the COVID-19 pandemic and predict the behavior of the epidemic, demonstrating superior results using GANs. Similarly, a variant of the conditional generative adversarial network (CGAN) was used to add auxiliary information to the generator and discriminator to learn conditional probability distributions, enabling the model to more robustly classify and predict corresponding developments.

[0069] Furthermore, the value function of the digital twin of a physical entity at a future moment modeled using a conditional generative adversarial network is expressed as:

[0070]

[0071] Where D represents the discriminator of the conditional generative adversarial network, G represents the generator of the conditional generative adversarial network, V(D,G) represents the objective function of the digital twin obtained by training the discriminator and the generator in a game mode; E represents the expectation, U t is the true value of the target data of the physical entity PO at time t, U is the set of true values ​​of the target data at different times, ρ U is the distribution of the true value of the target data, c is the historical experience data as auxiliary information, z is the noise sample, Z is the noise sample set, ρ Z is the distribution obeyed by the noise sample. z is the sample obtained by the standard Gaussian distribution sampled by G.

[0072] The generator in a generative adversarial network can be considered a digital twin (DT). The discriminator relies on the physical entity (PO) to determine the authenticity of sample data, while the digital twin attempts to deceive the discriminator by continuously simulating the physical entity, achieving a deceptive effect. First, the discriminator, through self-training, develops the ability to distinguish between sample data originating from the physical entity and the digital twin. Then, through continuous learning and updating, the digital twin becomes increasingly similar to the physical entity, gradually rendering the discriminator unable to distinguish between the original entity and the digital twin. The two engage in a minimax zero-sum game, maximizing the probability that the discriminator's judgment based on the physical entity is incorrect and minimizing the probability that the digital twin's approximation of the physical entity is incorrect. Ultimately, this game reaches a Nash equilibrium, completing the digital twin modeling.

[0073] Furthermore, there are papers that use GAN to solve the data missing problem of smart energy systems, and also study the impact of probabilistic events on GAN when handling anomaly detection tasks. Therefore, digital twins modeled using GAN can solve specific problems according to different application scenarios. This embodiment can use the modeled digital twin to solve the wind power forecasting problem as an example. This is because compared to the traditional load forecasting method that obtains a single value, probabilistic forecasting can better capture the inherent dynamic changes and time series correlations of wind energy, and GAN's excellent learning and utilization capabilities in probability distribution enable it to perform related tasks such as probabilistic forecasting well.

[0074] This implementation also addresses privacy concerns during digital twin modeling. Federated learning, a machine learning paradigm for achieving both data security and privacy, can effectively address this issue. Its core concept is to enable distributed model training across multiple data sources (also known as clients) with local data. Furthermore, its combined use with GANs maintains competitive performance while protecting data privacy, such as effectively addressing COVID-19 detection in edge cloud computing.

[0075] The loss function of the current problem (regression task) solved by digital twin computing based on conditional generative adversarial networks in the federated learning framework is expressed as

[0076]

[0077] In the formula represents the loss function for solving the regression problem, RM is the prediction method for the regression problem, G n The generator of the adversarial network for the nth condition, is the model parameter of the nth generator.

[0078] Going further, the method for correcting the digital twin based on the conditional generative adversarial network under the federated learning framework is as follows:

[0079] After training is completed, calculate the sampling behavior data x n The probability distribution P of historical experience data c r (x n ,c) and the probability distribution P of noise sample z and historical experience data c f (z,c):

[0080]

[0081] Where σ is the activation function, C n Generate an adversarial network for the nth condition, Generate model parameters of the adversarial network for the nth condition;

[0082] Next, we calculate the divergence KL according to formulas (5) and (6) to observe whether the probability distribution obtained by the model prediction is close to the probability distribution of the real data, and calculate the loss function of the divergence KL

[0083]

[0084] Input the noise sample into the generator for training to obtain the distribution of target data prediction values;

[0085] In order to reduce the impact of the asymmetry of KL divergence on the performance of the test model, the Wasserstein distance is introduced to further ensure the accuracy of the prediction. The Wasserstein distance is calculated based on the distribution of the target data's true value and the distribution of the target data's predicted value:

[0086]

[0087] In the formula is the Wasserstein distance, inf represents the lower bound, sup represents the upper bound, f is the first-order Lipschitz function that complies with the Lipschitz constraint, and L represents the norm; Π(P r ,P f ) is γ(x t+1 , the joint distribution set of G(z|y));

[0088] |f(U t )-f(U t+1 )|≤|U t -U t+1 | (9);

[0089] After confirming that the predicted probability distribution of the model is very close to the true distribution using KL divergence and Wasserstein distance respectively, the overall performance of the GAN model probability prediction is comprehensively evaluated using CRPS (Continuous Ranked Probability Score), which can be equivalently expressed as formula (11).

[0090] The continuous grade probability score CRPS is used to evaluate the overall performance of the conditional generative adversarial network:

[0091]

[0092] In the formula is the cumulative distribution function, U′ t is the predicted value of target data at time t, U t * For U t Mutually independent true values ​​of target data at time t;

[0093] After the above process, the correction of the digital twin based on the conditional generative adversarial network under the federated learning framework is completed.

[0094] In the local digital twin modeling method based on the cyclic conditional generative adversarial network in this embodiment, first, real data and noise data need to be input into the cyclic conditional generative adversarial network to train the discriminator network and the generator network. Before training begins, hyperparameters such as the number of training times and training step size of the discriminator network need to be initialized. During the training process, the discriminator network and the generator network are updated and optimized in succession until the game between the two reaches a balanced state. After the training is completed, the generator network is able to output predicted data close to the real data, and the local digital twin modeling is completed.

[0095] Federated learning does not require physical entities to exchange local or sample data. Instead, it builds a global digital twin model within a selected scope by simply exchanging parameters or intermediate results during the digital twin modeling process, thereby achieving a balance between data privacy protection and data sharing. This approach allows for privacy protection of digital twins and ensures the security of the entire modeling process.

[0096] In addition, federated learning is used to solve the problem of digital twin modeling in distributed scenarios.

[0097] Going further, the method for obtaining the optimized conditional generative adversarial network is:

[0098] The objective function of establishing a global digital twin model using federated learning is:

[0099]

[0100] In the formula represents the loss function of the conditional generative adversarial network, Update the discriminator in the model through stochastic gradient ascent; def means it is defined as;

[0101] Update the model parameters of the discriminator in the conditional generative adversarial network through stochastic gradient ascent:

[0102]

[0103] In the formula represents the gradient update formula of the discriminator, θ d are the model parameters of the discriminator, is the true value of the target data at time t corresponding to the nth physical entity PO, z n is the noise sample corresponding to the nth physical entity PO;

[0104] Then update the model parameters of the generator in the conditional generative adversarial network through stochastic gradient descent:

[0105]

[0106] In the formula Represents the gradient update formula of the generator;

[0107] After updating the model parameters, the optimized conditional generative adversarial network is obtained.

[0108] The following describes the digital twin modeling and update efficiency improvement strategy based on data selection in this implementation:

[0109] In this implementation, a digital twin modeling method based on a cyclic conditional generative adversarial network using federated learning is used. The most representative subset of clients is selected from all participants to construct a global digital twin model required to complete a specific task. These selected clients, acting as participants, calculate their initial weights using a pre-defined selection method, and each participant simultaneously begins local digital twin modeling.

[0110] The participant modeling digital twin model first needs to sample the noise vector from the noise sample, and then splice it with the conditional auxiliary information vector into a compact vector representation and input it into the RNN Layer in the generator to obtain the generated sample. It is then compared with the real sample vector sampled from the real data distribution and the conditional auxiliary information vector, which is also a compact vector representation and input into the RNN Layer in the discriminator to finally obtain the discrimination result of the generated sample.

[0111] After each participant completes the modeling, they upload the model parameters to the central server. Finally, the central server performs weighted averaging based on the initial weights of each participant to complete the global digital twin model aggregation. The above process is repeated until the model converges and the global digital twin model is completed.

[0112] Sharing the resulting global digital twin model with all clients for their respective tasks can be considered pre-training. This approach allows the model to learn using a small amount of data, saving training time while effectively preventing overfitting and ensuring competitive model accuracy.

[0113] In order to better achieve secure data sharing and data fusion, and without leaking the original data of physical entities, this embodiment proposes a data selection-based strategy for modeling a global digital twin model that can fully learn the diversity and differences of data and has real-time characteristics.

[0114] This implementation method takes into account both privacy security and efficiency improvement in the process of modeling digital twins. The structural diagram of the data selection strategy is as follows: Figure 2 The key is to ensure good model performance while using less data to update the model. First, the paper proposes to ensure the privacy of physical entities when using federated learning to model digital twins. Then, in the process of building a global digital twin model using federated learning modeling, the three processes of client screening (including rough selection and fine selection), initial weight assignment, and global model aggregation are optimized to meet the important characteristics of real-time modeling and updating of digital twins.

[0115] In this embodiment, the method for preliminarily screening the physical entity PO as the client is as follows:

[0116] The focus of this step is to select clients with significant differences and filter out clients with high similarity. It is necessary to observe the inherent data patterns to provide a reference for subsequent participant selection without leaking user privacy. Therefore, each client needs to first standardize and normalize its dataset. Then, the preprocessed data is sampled and uploaded to the central server for analysis. The data preprocessing is shown in formula (14).

[0117]

[0118] In the formula is the sampling behavior data x of the nth physical entity PO n The sampling behavior data at time t, for After preprocessing, μ n Sampling behavior data for the nth physical entity PO at each moment The mean of n Represents the sampling behavior data of the nth physical entity PO The standard deviation of n For preprocessed data The minimum value, max n For preprocessed data The maximum value of

[0119] Next, the dynamic time warping (DTW) method, which is insensitive to time series offset, is used to calculate the preprocessed data. The similarity of , so that the initial weights can be assigned to different clients according to the size of the similarity difference:

[0120]

[0121] Where d DTW represents similarity and difference, K represents the total number of paths, represents the minimum distance between the sampled behavior data of the nth client and the n′th client, n′=1, 2, 3, ... N; n≠n′; (I, J) is the two-dimensional coordinate of the end point of the path, (I k ,J k ) is the two-dimensional coordinate of the end point of the k-th path, A(I k ,J k ) represents the minimum distance between the sampled behavior data of the nth client and the n′th client in the kth path, where n k As the starting point of the k-th path, it corresponds to the pre-processed data of the n-th client, and n′ as the end point of the k-th path, it corresponds to the pre-processed data of the n′-th client;

[0122] d DTW The smaller the distance d, the more similar the two different time series data sets are. DTW The larger the value, the greater the difference; the similarity difference d DTW Clients with a value greater than a preset threshold are selected as preliminary clients.

[0123] The method for further screening to obtain the final selected client is:

[0124] Combine Figure 2 As shown, the initially selected clients are sorted by similarity and difference d DTWThe pre-processed data corresponding to each cluster of clients are averaged, and the averaged pre-processed data obtained is used as the pre-processed data of the final selected client. This not only helps to reduce data with high similarity or inline degree to a certain extent, thereby reducing data redundancy and preventing training overfitting, thereby improving training efficiency, but also helps to reduce computing pressure and communication latency in the process of federated learning, optimize resource allocation and enhance training efficiency:

[0125]

[0126] In the formula is the mean preprocessed data of the wth finally selected client, which is virtual data, w = 1, 2, 3, ... W, where W is the total number of finally selected clients; Q is the number of initially selected clients in each cluster of clients, The averaged pre-processed data corresponding to the initially selected client q.

[0127] At this stage, we can either select the most representative client from these clients based on the statistical characteristics of the sample data (such as the sample mean, which depends on the specific problem), or set up a trusted edge server (TrustedEdge Server) for these clients with high similarity to aggregate their pre-processed sample data and perform averaging. This way, the data held by the clients can be integrated through certain processing, allowing them to participate in the global model aggregation in another way.

[0128] The trusted edge server replaces some clients with high local similarity to participate in the subsequent global model aggregation. Its high computing power can not only ignore problems such as calculation and communication delays, but also reduce the model's learning of similar data, further improving training efficiency and preventing model overfitting.

[0129] Initial weight assignment and global model aggregation:

[0130] Before the model is globally aggregated, the initial weights need to be distributed to each participant for local digital twin modeling. In order to make the model aggregate and update faster and better, it is necessary to assign corresponding and more reasonable weights to different participants. The size of the assigned weights means that the local digital twin models of each participant have different impacts on the global model aggregation during the training process.

[0131] Finally, the method to obtain the final global digital twin model after aggregation is:

[0132] Calculate the final selected client similarity and difference set H:

[0133]

[0134] In the formula is the similarity difference between the first final selected client and the wth final selected client;

[0135] Due to e -x The value is always [0,1] in the range [0,+∞] and decreases as x increases. Therefore, the DTW distances between the current participant and other participants are summed and normalized. The smaller the total DTW distance, the higher the similarity. By substituting it into e -x Inverse calculation is also required to obtain the smaller weight that should be given. x Because the results obtained by different x values ​​have a large difference in magnitude, the final calculation may result in the initial weight of some participants being infinite. Therefore, it is necessary to minimize and maximize d DTW Linearly mapped to the range [0,1], such as k for the wth participant w The sum of the DTW distances between the participants is processed.

[0136] Calculate the weight coefficient k w :

[0137]

[0138] Where H w is the w final selected client similarity difference set, minH is the minimum value of the final selected client similarity difference set H, and maxH is the maximum value of the final selected client similarity difference set H; then e x After processing, the initial weight range of each participant is limited to [1,e].

[0139] According to the weight coefficient k w Initial weight allocation for the W final selected clients:

[0140]

[0141] Where ω W is the initial weight of the Wth finally selected client;

[0142] The weighted average method is used to aggregate all final monomer digital twin models to obtain the weighted average value. And according to the weighted average Obtain the final global digital twin model after aggregation;

[0143]

[0144] The model parameters of the discriminator for the Wth finally selected client;

[0145] The method to update the model parameters is:

[0146]

[0147] In the formula is the gradient update formula of the discriminator corresponding to the wth finally selected client; F is the gradient update function,

[0148]

[0149] In the formula is the gradient update formula of the generator corresponding to the wth finally selected client; θ G are the model parameters of the generator;

[0150] The updating method of each finally selected client model parameter is:

[0151]

[0152] In the formula is the updated value of the model parameters of the w-th discriminator at time t+1, is the model parameter value of the w-th discriminator at time t, η is the gradient coefficient, is the model parameter value of the w-th discriminator;

[0153] In the formula Update the model parameters of the w-th generator at time t+1, is the model parameter value of the w-th generator at time t, is the model parameter value of the w-th generator;

[0154] The parameter update method of the final global digital twin model after aggregation is:

[0155]

[0156] Where θ d,t+1 Update the model parameters of the discriminator in the final global digital twin model, θ G,t+1 Update the values ​​of the generator's model parameters in the final global digital twin model.

[0157] Experimental verification:

[0158] Experimental environment settings:

[0159] For example, using a modeled digital twin to solve a wind power forecasting problem uses a dataset from National Natural Resources Laboratory (NREL). NREL includes a wealth of energy data, and wind power data was selected as the key physical entity feature for digital twin modeling. The wind power data for the selected wind farm is the energy converted from wind speed to electrical energy. With one hour as a moment, the data volume calculated for this wind farm over 365 days a year is 8,760 data points, with the data unit being kilowatt-hour.

[0160] In the digital twin modeling process, wind power data needs to be normalized to prevent gradient explosion during neural network calculations. The minimum-maximum normalization method is used to normalize the data to the range of [0, 1].

[0161] Performance evaluation: The following standards are selected to measure the model performance of the present invention, namely, mean absolute error (MAE), root mean square error (RMSE), continuous ranking probability score (CRPS), KL divergence (KLD), and Wasserstein distance. The above standards are model test results obtained using data in the range of [0,1]. In order to better measure the prediction accuracy of the digital twin modeled by the present invention, the data is restored back to the range for testing, and new test standards are added, namely, mean absolute percentage error (MAPE), normalized root mean square error (NRMSE), and coefficient of variation of the root mean square error (CV-RMSE).

[0162] The training loss of the local digital twin model is as follows Figure 3 As shown, the model converged around the 6000th round, from Figure 3 As can be seen in the figure, the generator network and the discriminator network of the digital twin modeled using the generative adversarial network reach a balance in the game with a loss value of approximately 0.69, indicating that the digital twin modeling is complete and can be applied.

[0163] Figure 4 This is the test effect diagram of the local digital twin model after convergence. The data set is divided according to the ratio of 5:1:4, so the data volume of the test set is 3504. Due to the large amount of data, Figure 4 A local magnified image is added to show the model’s prediction performance more clearly. Figure 4 It can be seen that the model established in this embodiment is relatively good at learning and extracting wind power time series characteristics, especially in depicting the overall trend, which shows that the model established by the present invention has considerable application value.

[0164] After the local digital twin modeling is completed, it is necessary to model the global digital twin under the federated learning framework. In this process, a data selection-based strategy is proposed to optimize the global model modeling. Figures 5 to 10Comparisons of learning performance and prediction accuracy are shown for each instance of a central server randomly selecting clients, using only preliminary screening to obtain preliminarily selected clients, and performing preliminary screening followed by further screening according to the present invention to obtain final selected clients. Random client selection is a classic FedAvg algorithm and represents the baseline strategy. As can be seen from the figure, the data selection strategy proposed in this invention achieves similar learning stability and prediction accuracy to the baseline strategy, but uses only half the data for learning. Experiments demonstrate that the present invention's strategy of selectively selecting clients for learning while protecting data privacy is both reasonable and effective.

[0165] Figure 11 for Figures 5 to 10 Together with the locally enlarged graph of the prediction accuracy of the local model in the same time period, it can be seen that the local model has the best wind power trend prediction accuracy, and the global model based on data selection strategy optimization proposed in the present invention is second only to it.

[0166] The comparison results of each model in various indicators are shown in Table 1, which are the comparison results when the input data is normalized to the range of [0,1].

[0167] Table 1

[0168]

[0169] Table 2 shows the results when the input data ranges from original to original.

[0170] Table 2

[0171]

[0172] Figure 12 It is intuitively shown that the method of the present invention uses half the amount of data to greatly improve the modeling and updating efficiency, thereby further ensuring the real-time characteristics of the digital twin.

[0173] In summary, the method of the present invention ensures privacy security and further improves modeling efficiency in the digital twin modeling method based on federated learning in the cyber-physical energy system. First, based on the characteristics of machine learning, a digital twin theoretical model is proposed to represent the bidirectional dynamic relationship between digital twins and physical entities. Then, federated learning is used to solve the privacy protection problem in the process of global model aggregation of local digital twin models modeled by generative adversarial networks in a distributed environment. Finally, a data selection-based strategy is proposed to optimize the screening of clients, initial weight distribution and global model aggregation to improve the model update efficiency and meet the real-time requirements of digital twins. Finally, the numerical results based on real data sets show that the method of the present invention can make digital twins universal within the constructed scope compared with the benchmark strategy. A large number of simulation experiments show that the strategy proposed in the present invention can significantly improve the update efficiency.

[0174] Although the present invention is described herein with reference to specific embodiments, it should be understood that these embodiments are merely illustrative of the principles and applications of the invention. It should be understood that many modifications may be made to the illustrative embodiments, and that other arrangements may be devised, without departing from the spirit and scope of the invention as defined by the appended claims. It should be understood that the various dependent claims and features described herein may be combined in ways other than those described in the original claims. It should also be understood that features described in conjunction with individual embodiments may be used in conjunction with other described embodiments.

Claims

1. A privacy-preserving digital twin modeling method for a cyber-physical energy system, characterized by: include: At the physical entity layer, the real value of the target data of each physical entity PO is obtained. The target data includes behavior data and status data. At the modeling layer, multiple edge servers are used to establish a single digital twin model at different times for each physical entity PO based on the corresponding target data real value, which is used to predict the target data predicted value of the physical entity PO at the target time; at the digital twin layer, a central cloud server is used to aggregate all single digital twin models to obtain a global digital twin model; The digital twin theoretical model is obtained by combining the general representation of the prediction method used to solve the problem of digital twin. The digital twin theoretical model is then deformed by combining the prediction method currently used to solve the problem of cyber-physical energy system to obtain the digital twin specific model of cyber-physical energy system. A conditional generative adversarial network (CGN) is used as the single digital twin model, and a value function for modeling the digital twin using the CGN is configured. The loss function for solving the current problem is then calculated based on the CGN digital twin within the federated learning framework. The CGN digital twin within the federated learning framework is then corrected by calculating the probability distribution and Wasserstein distance. Then, federated learning is used in combination with the calculation of the loss function to update the model parameters of the discriminator and generator in the conditional generative adversarial network through stochastic gradient ascent and descent, respectively, to obtain the optimized conditional generative adversarial network; Conduct a preliminary screening of the physical entity PO as the client to obtain the preliminary selected clients based on data difference screening; Then, based on the statistical characteristics of the client data, the preliminary selected clients are further screened to obtain the final selected clients; The final digital twin modeling of the physical entity PO is performed using the optimized conditional generative adversarial network using the target data true value corresponding to the final selected client, and the final monomer digital twin model corresponding to each final selected client is obtained; Initial weights are assigned to all the final selected clients, and the initial weights are calculated based on the distance between the final selected clients. Then, a weighted average method is used to aggregate all the final single digital twin models to obtain the final aggregated global digital twin model, completing the modeling. The method for establishing a single digital twin model is as follows: The behavior data of N physical entities PO is expressed as<X,Y> , where X represents the sampled behavior data set of N physical entities PO, and Y represents the data label set of the sampled behavior data: X={x1,x2,...,x N }, Y={y1,y2,...,y N }, Where x N is the sampling behavior data of the Nth physical entity PO, y N is the sampling behavior data x N Corresponding data labels; S represents the state data set: S={S1,S2,...,S T }, Where S T The status data of all physical entities PO at time T; The single digital twin model is represented as Aggregate all individual digital twin models to obtain the global digital twin model DT t : In the formula is the preprocessed sampling behavior data set X; The theoretical model of digital twin is: Where F represents the loss function, P is the general representation of the prediction method used by digital twins to solve problems, and the output result is the predicted value of the target data. t The actual value of the target data of the physical entity PO; The specific models of the digital twin of a cyber-physical energy system are: DT t+i =minMSE(RG t~t+i (DT t ),PO t+i ) (2), Where i represents a future time point relative to the current time t, MSE represents the mean square error, the problem being solved is a regression problem, MSE is the loss function for the regression problem, RG is the prediction method corresponding to the regression problem, and the output is the predicted value of the target data at time t+i; The value function of modeling digital twins using conditional generative adversarial networks is expressed as: Where D represents the discriminator of the conditional generative adversarial network, G represents the generator of the conditional generative adversarial network, V(D,G) represents the objective function of the digital twin obtained by training the discriminator and the generator in a game mode; E represents the expectation, U t is the true value of the target data of the physical entity PO at time t, U is the set of true values ​​of the target data at different times, ρ U is the distribution of the true value of the target data, c is the historical experience data as auxiliary information, z is the noise sample, Z is the noise sample set, ρ Z is the distribution obeyed by the noise samples.

2. The privacy-preserving digital twin modeling method for a cyber-physical energy system according to claim 1 is characterized in that: The loss function of the current problem solved by digital twin computing based on conditional generative adversarial networks in the federated learning framework is expressed as In the formula represents the loss function for solving the regression problem, RM is the prediction method for the regression problem, G n The generator of the adversarial network for the nth condition, is the model parameter of the nth generator.

3. The privacy-preserving digital twin modeling method for a cyber-physical energy system according to claim 2, characterized in that: The method for correcting the digital twin based on the conditional generative adversarial network under the federated learning framework is: Calculate the sample behavior data x n The probability distribution P of historical experience data c r (x n ,c) and the probability distribution P of noise sample z and historical experience data c f (z,c): Where σ is the activation function, C n Generate an adversarial network for the nth condition, Generate model parameters of the adversarial network for the nth condition; Calculate the divergence KL and calculate the loss function of the divergence KL Input the noise sample into the generator for training to obtain the distribution of target data prediction values; Calculate the Wasserstein distance based on the target data's true value distribution and the target data's predicted value distribution: In the formula is the Wasserstein distance, inf represents the lower bound, sup represents the upper bound, f is the first-order Lipschitz function that complies with the Lipschitz constraint, and L represents the norm; |f(U t )-f(U t+1 )|≤|U t -IN t+1 |(9); The continuous grade probability score CRPS is used to evaluate the overall performance of the conditional generative adversarial network: In the formula is the cumulative distribution function, U′ t is the predicted value of target data at time t, U t * For U t Mutually independent true values ​​of target data at time t; After the above process, the correction of the digital twin based on the conditional generative adversarial network under the federated learning framework is completed.

4. The privacy-preserving digital twin modeling method for a cyber-physical energy system according to claim 3 is characterized in that: The method to obtain the optimized conditional generative adversarial network is: The objective function of establishing a global digital twin model using federated learning is: In the formula Denotes the loss function of the conditional generative adversarial network, def means it is defined as; Update the model parameters of the discriminator in the conditional generative adversarial network through stochastic gradient ascent: Where l D represents the gradient update formula of the discriminator, θ d are the model parameters of the discriminator, is the true value of the target data at time t corresponding to the nth physical entity PO, z n is the noise sample corresponding to the nth physical entity PO; Then update the model parameters of the generator in the conditional generative adversarial network through stochastic gradient descent: Where l G Represents the gradient update formula of the generator; After updating the model parameters, the optimized conditional generative adversarial network is obtained.

5. The privacy-preserving digital twin modeling method for a cyber-physical energy system according to claim 4, characterized in that: The method for preliminary screening of physical entity POs as clients is as follows: In the formula is the sampling behavior data x of the nth physical entity PO n The sampling behavior data at time t, for After preprocessing, μ n Sampling behavior data for the nth physical entity PO at each moment The mean of n Represents the sampling behavior data of the nth physical entity PO The standard deviation of n For preprocessed data The minimum value, max n For preprocessed data The maximum value of The dynamic time warping (DTW) method, which is insensitive to time series offset, is used to calculate the preprocessed data. Similarities: Where d DTW represents similarity and difference, K represents the total number of paths, represents the minimum distance between the sampled behavior data of the nth client and the n′th client, n′=1, 2, 3, ... N; n1 n′; (I, J) is the two-dimensional coordinate of the end point of the path, (I k ,J k ) is the two-dimensional coordinate of the end point of the k-th path, A(I k ,J k ) represents the minimum distance between the sampled behavior data of the nth client and the n′th client in the kth path, where n k As the starting point of the k-th path, it corresponds to the pre-processed data of the n-th client, and n′ as the end point of the k-th path, it corresponds to the pre-processed data of the n′-th client; The similarity difference d DTW Clients with a value greater than a preset threshold are selected as preliminary clients.

6. The privacy-preserving digital twin modeling method for a cyber-physical energy system according to claim 5, characterized in that: The method for further screening to obtain the final selected client is: The initially selected clients are sorted by similarity and difference DTW The pre-processed data corresponding to each cluster of clients are averaged, and the averaged pre-processed data obtained is used as the pre-processed data of the final selected client: In the formula is the pre-processed data of the wth finally selected client, w = 1, 2, 3, ... W, where W is the total number of finally selected clients; Q is the number of initially selected clients in each cluster of clients, The averaged pre-processed data corresponding to the initially selected client q.

7. The privacy-preserving digital twin modeling method for a cyber-physical energy system according to claim 6, characterized in that: The method to obtain the final global digital twin model after aggregation is: Calculate the final selected client similarity and difference set H: In the formula is the similarity difference between the first final selected client and the wth final selected client; Calculate the weight coefficient k w : Where H w are the w final selected client similarity and difference sets, minH is the minimum value of the final selected client similarity and difference set H, and maxH is the maximum value of the final selected client similarity and difference set H; Initial weight allocation for the W final selected clients: Where ω W is the initial weight of the Wth finally selected client; The weighted average method is used to aggregate all final monomer digital twin models to obtain the weighted average value. And according to the weighted average Obtain the final global digital twin model after aggregation; The model parameters of the discriminator for the Wth finally selected client; The model parameters of the generator for the Wth final selected client; The method to update the model parameters is: In the formula is the gradient update formula of the discriminator corresponding to the wth finally selected client; F is the gradient update function, In the formula is the gradient update formula of the generator corresponding to the wth finally selected client; θ G are the model parameters of the generator; The updating method of each finally selected client model parameter is: In the formula is the updated value of the model parameters of the w-th discriminator at time t+1, is the model parameter value of the w-th discriminator at time t, η is the gradient coefficient, is the model parameter value of the w-th discriminator; In the formula Update the model parameters of the w-th generator at time t+1, is the model parameter value of the w-th generator at time t, is the model parameter value of the w-th generator; The parameter update method of the final global digital twin model after aggregation is: Where θ d,t+1 Update the model parameters of the discriminator in the final global digital twin model, θ G,t+1 Update the values ​​of the generator's model parameters in the final global digital twin model.