Power system dynamic simulation method and device, storage medium and computer device

CN122818944APending Publication Date: 2026-09-25ELECTRIC POWER RES INST CHINA SOUTHERN POWER GRID CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202611011610.0
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2026-07-08
Publication Date
2026-09-25

AI Technical Summary

Technical Problem

[0004]本申请的目的旨在至少能解决上述的技术缺陷之一,特别是现有技术中动态仿真模型工况单一,导致大规模批量仿真时效率和精度较差,难以满足当前电力系统运行分析与控制决策的实际需求的技术缺陷

Benefits of technology

[0052]本申请提供的电力系统动态仿真方法、装置、存储介质及计算机设备,响应于用户请求,本申请可以解析得到用户请求中携带的任务列表,并识别任务列表中每一动态仿真任务的任务工况,为后续任务仿真提供针对性的任务适配基础;接着可以调用最新版本的动态仿真模型,由于该模型是基于重建损失、对比损失和物理一致性损失训练,并基于实测偏差驱动模型版本持续更新得到的,因此可以保证模型版本始终适配当前电网的实际运行特性,为仿真精度提供持续保障;随后在动态仿真模型中加载与每一任务工况对应的适配器组件,即可实现对各个动态仿真任务同步进行仿真执行,大幅提升大规模批量仿真的执行效率;最后可以对仿真结果进行合规性和可信度评估,并根据评估结果和仿真结果生成结构化可解释报告,为电网运行决策提供清晰可靠的量化参考,从而满足当前电力系统运行分析与控制决策的实际需求。

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122818944A_ABST
    Figure CN122818944A_ABST
Patent Text Reader

Abstract

The power system dynamic simulation method, device, storage medium and computer equipment provided by the application respond to a user request, analyze a task list carried in the user request, identify the task working condition of each dynamic simulation task in the list, and provide a targeted task adaptation basis for subsequent task simulation. Since the dynamic simulation model called by the application is trained based on reconstruction loss, contrast loss and physical consistency loss, and is continuously updated based on the measured deviation driving model version, the simulation accuracy can be continuously guaranteed. By loading the adapter component corresponding to each task working condition in the dynamic simulation model, the simulation execution of each task can be simultaneously implemented, and the execution efficiency of large-scale batch simulation is greatly improved. Finally, the simulation results can be evaluated for compliance and credibility, and a structured and interpretable report can be generated based on the evaluation results and the simulation results, which can provide a clear and reliable quantitative reference for power grid operation decision-making.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of power system technology, and in particular to a power system dynamic simulation method, apparatus, storage medium and computer equipment. Background Technology

[0002] Dynamic simulation of power systems is a core technical support for power grid planning and design, security and stability analysis, and operation control decision-making. It can simulate and calculate the dynamic behavior of power systems after disturbances, providing quantitative basis for power grid security and stability assessment and control strategy formulation. With the high proportion of new energy sources connected to the grid and the large-scale integration of power electronic equipment, the dynamic behavior characteristics of modern power systems are becoming increasingly complex, and multi-timescale coupling phenomena such as voltage, frequency, and power angle occur frequently. Therefore, higher requirements are placed on the speed, accuracy, and coverage of dynamic simulation.

[0003] Traditional power system dynamic simulations are mostly based on mechanistic modeling, relying on simplified assumptions about the physical characteristics of components. When faced with the complex and ever-changing operating scenarios of new power systems, they are prone to insufficient simulation accuracy due to model parameter mismatch and unreasonable assumptions. Furthermore, traditional simulation methods often build models or develop programs independently for single types of dynamic simulation tasks, failing to keep pace with the evolving operational needs of new power systems. In short, existing dynamic simulation models operate under limited conditions, resulting in poor efficiency and accuracy during large-scale batch simulations, making it difficult to meet the actual needs of current power system operation analysis and control decision-making. Summary of the Invention

[0004] The purpose of this application is to at least address one of the aforementioned technical deficiencies, particularly the technical deficiency that the existing dynamic simulation models operate under a single condition, resulting in poor efficiency and accuracy during large-scale batch simulations, making it difficult to meet the actual needs of current power system operation analysis and control decision-making.

[0005] This application provides a dynamic simulation method for a power system, the method comprising:

[0006] In response to a user request, the task list carried in the user request is parsed and the task status of each dynamic simulation task in the task list is determined.

[0007] The latest version of the dynamic simulation model is invoked; the dynamic simulation model is trained based on reconstruction loss, contrast loss and physical consistency loss, and the model version is continuously updated based on measured bias.

[0008] In the dynamic simulation model, an adapter component corresponding to each task condition is loaded, and each dynamic simulation task is synchronously executed based on each adapter component to obtain simulation results.

[0009] The simulation results are evaluated for compliance and credibility to obtain a comprehensive evaluation result. Based on the comprehensive evaluation result and the simulation results, a structured and interpretable report of the user request is generated.

[0010] Optionally, the training process of the dynamic simulation model includes:

[0011] A training dataset was constructed based on operational data from multiple historical dynamic events in the power system.

[0012] The pre-trained model is iteratively trained using the training dataset, and the trained pre-trained model is used as the backbone model.

[0013] The original parameters of the backbone model are fixed, and low-rank adapters are inserted into multiple attention layers of the backbone model. A lightweight task head is set for each task condition to form an initial simulation model.

[0014] For each task condition, a task data sample for that task condition is obtained, and the parameters of the initial simulation model are fine-tuned using the task data sample to obtain the adapter component corresponding to that task condition; the adapter component includes a fine-tuned lightweight task header and low-rank adapter weights.

[0015] A dynamic simulation model is generated based on the main model and the adapter components for each task condition.

[0016] Optionally, the training dataset constructed based on operational data from multiple historical dynamic events in the power system includes:

[0017] The system acquires operational data from multiple historical dynamic events in the power system; the operational data includes waveform data acquired from the power grid dispatching platform, synchronous phasor data collected from the wide-area measurement system, and synthetic data generated through the transient simulation platform.

[0018] The waveform data, the synchronization phasor data, and the synthetic data are cleaned and uniformly modeled using a three-dimensional tensor format to obtain a three-dimensional tensor sample corresponding to each historical dynamic event; wherein, the three dimensions of the three-dimensional tensor format include the device dimension, the time dimension, and the physical quantity dimension;

[0019] After determining the event metadata for each historical dynamic event and establishing the mapping relationship between the event metadata and the three-dimensional tensor format for each historical dynamic event, the data is stored in the corpus repository.

[0020] Multiple three-dimensional tensor samples are read from the corpus, and each three-dimensional tensor sample is segmented using a fixed-length sliding window to obtain multiple time-series segments.

[0021] Each time series segment is randomly masked to obtain the mask segment corresponding to each time series segment, and the comparison sample pair of each time series segment is constructed, and the physical residual label corresponding to each time series segment is calculated offline.

[0022] Multiple training samples are generated based on the masked fragments, contrast sample pairs, and physical residual labels of each time segment, and a training dataset is constructed based on each training sample.

[0023] Optionally, the iterative training of the pre-trained model using the training dataset includes:

[0024] During each round of training, training samples are randomly extracted from the training dataset; the training samples include mask fragments, contrast sample pairs, and physical residual labels;

[0025] The training samples are input into the pre-trained model to obtain the high-dimensional features output by the pre-trained model;

[0026] The reconstruction loss is calculated based on the high-dimensional features and the mask fragment; the contrast loss is calculated based on the high-dimensional features and the contrast sample pair; and the physical consistency loss is calculated based on the high-dimensional features and the physical residual label.

[0027] The parameters of the pre-trained model are updated based on the reconstruction loss, the contrast loss, and the physical consistency loss.

[0028] Optionally, the continuous update process of the dynamic simulation model includes:

[0029] The simulation results predicted by the dynamic simulation model for each dynamic simulation task are obtained, and the measured results of each dynamic simulation task in the power system are monitored.

[0030] Determine the prediction error of each dynamic simulation task between the simulation result and the measured result, and mark dynamic simulation tasks whose prediction error is greater than a preset error threshold and whose duration exceeds a preset time window as deviation events.

[0031] Confirm the task status and event metadata of the deviation event, and package the event metadata, the simulation results and the measured results into new training samples, and add them to the incremental learning partition in the corpus warehouse corresponding to the task status.

[0032] When the number of newly added training samples in the incremental learning partition of any task condition reaches the preset trigger number, the newly added training samples in the incremental learning partition are extracted to update the parameters of the adapter component in the dynamic simulation model corresponding to the task condition, so as to obtain the latest version of the dynamic simulation model.

[0033] Optionally, the compliance and credibility assessment of the simulation results to obtain a comprehensive assessment result includes:

[0034] The simulation results are inversely normalized to obtain engineering data;

[0035] The engineering data is corrected in the feasible region using physical constraint projection to obtain corrected data, and a compliance assessment result is generated based on the corrected data and the engineering data.

[0036] Uncertainty estimation is performed on each predicted value in the engineering data to obtain the confidence interval of each predicted value, and a confidence assessment result is generated based on each confidence interval.

[0037] A comprehensive evaluation result of the simulation results is generated based on the compliance assessment results and the credibility assessment results.

[0038] Optionally, generating a structured, interpretable report of the user request based on the comprehensive evaluation results and the simulation results includes:

[0039] The contribution of the predicted value at each time step in the simulation results is quantified by using integrated gradients to obtain the contribution data of key input features.

[0040] By using a pre-set historical operating condition table index library, the high-dimensional features of each dynamic simulation task are searched for nearest neighbors to obtain target operating condition data. The simulation results are then compared and analyzed with the target operating condition data to obtain operating condition difference evaluation data.

[0041] The baseline data corresponding to each task condition is obtained by using a preset mechanism simulation evaluation set, and the simulation results are compared and analyzed with the baseline data to obtain mechanism simulation deviation data.

[0042] Based on the comprehensive evaluation results, the key input feature contribution data, the operating condition difference evaluation data, and the mechanism simulation deviation data, a structured and interpretable report for the user request is generated.

[0043] This application also provides a power system dynamic simulation device, including:

[0044] The request parsing module is used to respond to a user request, parse the task list carried in the user request, and determine the task status of each dynamic simulation task in the task list.

[0045] The model invocation module is used to invoke the latest version of the dynamic simulation model; the dynamic simulation model is trained based on reconstruction loss, contrast loss and physical consistency loss, and the model version is continuously updated based on measured deviations.

[0046] The task simulation module is used to load adapter components corresponding to each task condition into the dynamic simulation model, and to synchronously perform simulation execution on each dynamic simulation task based on each adapter component to obtain simulation results.

[0047] The report generation module is used to evaluate the compliance and credibility of the simulation results, obtain a comprehensive evaluation result, and generate a structured and interpretable report of the user request based on the comprehensive evaluation result and the simulation results.

[0048] This application also provides a storage medium storing computer-readable instructions, which, when executed by one or more processors, cause the one or more processors to perform the steps of the power system dynamic simulation method as described in any of the above embodiments.

[0049] This application also provides a computer device, including: one or more processors, and memory;

[0050] The memory stores computer-readable instructions, which, when executed by the one or more processors, perform the steps of the power system dynamic simulation method as described in any of the above embodiments.

[0051] As can be seen from the above technical solutions, the embodiments of this application have the following advantages:

[0052] The power system dynamic simulation method, apparatus, storage medium, and computer equipment provided in this application, in response to user requests, can parse the task list carried in the user request and identify the task conditions of each dynamic simulation task in the task list, providing a targeted task adaptation basis for subsequent task simulations. Next, the latest version of the dynamic simulation model can be called. Since this model is trained based on reconstruction loss, contrast loss, and physical consistency loss, and is continuously updated based on measured deviations, it ensures that the model version always adapts to the actual operating characteristics of the current power grid, providing continuous assurance for simulation accuracy. Subsequently, by loading the adapter component corresponding to each task condition into the dynamic simulation model, the simulation of each dynamic simulation task can be performed synchronously, significantly improving the execution efficiency of large-scale batch simulations. Finally, the simulation results can be evaluated for compliance and credibility, and a structured interpretable report can be generated based on the evaluation results and simulation results, providing a clear and reliable quantitative reference for power grid operation decisions, thereby meeting the actual needs of current power system operation analysis and control decisions. Attached Figure Description

[0053] To more clearly illustrate the technical solutions in the embodiments of this application or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of this application. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.

[0054] Figure 1 A flowchart illustrating a dynamic simulation method for a power system provided in this application embodiment;

[0055] Figure 2 A flowchart illustrating an iterative training process for a pre-trained model, provided as an embodiment of this application;

[0056] Figure 3 A schematic diagram of the structure of a power system dynamic simulation device provided in this application embodiment;

[0057] Figure 4 This is a schematic diagram of the internal structure of a computer device provided in an embodiment of this application. Detailed Implementation

[0058] The technical solutions of the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of this application, and not all embodiments. Based on the embodiments of this application, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of this application.

[0059] Traditional power system dynamic simulations are mostly based on mechanistic modeling, relying on simplified assumptions about the physical characteristics of components. When faced with the complex and ever-changing operating scenarios of new power systems, they are prone to insufficient simulation accuracy due to model parameter mismatch and unreasonable assumptions. Furthermore, traditional simulation methods often build models or develop programs independently for single types of dynamic simulation tasks, failing to keep pace with the evolving operational needs of new power systems. In short, existing dynamic simulation models operate under limited conditions, resulting in poor efficiency and accuracy during large-scale batch simulations, making it difficult to meet the actual needs of current power system operation analysis and control decision-making.

[0060] Based on this, this application proposes the following technical solution, as detailed below:

[0061] In one embodiment, such as Figure 1 As shown, Figure 1 This is a flowchart illustrating a power system dynamic simulation method provided in an embodiment of this application. The application provides a power system dynamic simulation method, specifically including the following:

[0062] S110: In response to the user request, parse the task list carried in the user request and determine the task status of each dynamic simulation task in the task list.

[0063] In this step, when a user request is received, the computer device can respond to it, parse the task list carried in the user request, and identify the task status of each dynamic simulation task in the task list, so as to provide a targeted task adaptation basis for subsequent task simulation.

[0064] In this context, a user request refers to a simulation request initiated by a user to the power system dynamic simulation service, containing one or more dynamic simulation tasks to be executed. Each dynamic simulation task corresponds to a task condition, which is a set of characteristics of the power system's operating state corresponding to the task, including grid operation mode, fault type, fault location, disturbance type, load level, renewable energy penetration rate, equipment switching status, and simulation duration. Different task conditions correspond to different adapter components; therefore, the identification of task conditions enables targeted adaptation of dynamic simulation tasks.

[0065] Specifically, the dynamic simulation tasks in the task list can include transient stability simulation tasks, small disturbance stability simulation tasks, voltage stability simulation tasks, frequency dynamic simulation tasks, new energy grid connection dynamic simulation tasks, and fault disturbance recovery simulation tasks. Each dynamic simulation task has a different simulation object, analysis target, or operating scenario. Therefore, the computer equipment can identify each dynamic simulation task in the task list item by item, and, in conjunction with task description information, simulation parameter information, target power grid model information, and user-defined information, identify the corresponding task operating condition for each dynamic simulation task. Based on the identified task operating condition for each dynamic simulation task, the computer equipment can generate a corresponding task tag for each dynamic simulation task and associate and store the task tag with the dynamic simulation task, thereby providing a targeted task adaptation basis for subsequent simulation resource scheduling.

[0066] S120: Call the latest version of the dynamic simulation model; the dynamic simulation model is trained based on reconstruction loss, contrast loss and physical consistency loss, and the model version is continuously updated based on measured bias.

[0067] In this step, after determining the task conditions of each dynamic simulation task through step S110, the computer equipment can call the latest version of the dynamic simulation model. Since the model is trained based on reconstruction loss, contrast loss and physical consistency loss, and is continuously updated based on measured deviation, this application can ensure that the model version always adapts to the actual operating characteristics of the current power grid, providing continuous assurance for simulation accuracy.

[0068] Among them, the dynamic simulation model refers to the data-driven dynamic simulation model of the power system built on the deep learning architecture. It can extract deep operating features from the input power system runtime sequence data and output the power grid dynamic response prediction results for the corresponding time step.

[0069] Specifically, the loss function used in training the dynamic simulation model mainly consists of reconstruction loss, contrast loss, and physical consistency loss. Reconstruction loss measures the difference between the output of the dynamic simulation model and the actual dynamic response data. It constrains the model's ability to learn the inherent temporal correlations and feature representations of power system operating data, enabling the model to accurately capture the changing patterns of the power grid's operating state. Contrast loss learns the similarities and differences between different operating conditions, enabling the model to form discriminative feature representations of operating conditions. This improves the ability of the high-dimensional features extracted by the model to distinguish between different operating conditions, enhancing the model's feature robustness. Physical consistency loss constrains the dynamic simulation results to meet the physical laws of the power system. It constrains the model output to meet the fundamental physical laws of the power system, preventing the model from generating unreasonable results that violate physical constraints, further improving the reliability of the simulation output. This application uses these three types of losses to synergistically constrain the model's training process, allowing the model to simultaneously consider data feature learning ability, feature robustness, and physical rationality, solving the problems of physical inconsistency and unreliable output that easily occur in purely data-driven models.

[0070] Furthermore, after training the dynamic simulation model, the computer equipment can continuously acquire the measured deviation between the dynamic simulation results and the actual on-site operating data, and determine whether the current dynamic simulation model meets the preset accuracy requirements based on the measured deviation. When the measured deviation exceeds the preset deviation threshold, the computer equipment can use the measured data, simulation results, and measured deviation under the corresponding operating conditions to perform incremental training or retraining on the dynamic simulation model, and generate a new model version. When the new model version passes model verification, it can be updated to the latest version in the current dynamic simulation model library for subsequent dynamic simulation tasks to call, thereby realizing the continuous iterative update of the dynamic simulation model version, enabling the model to continuously adapt to changes in the current power grid operation mode, the scale of new energy access, and the operating status of equipment.

[0071] S130: Load the adapter component corresponding to each task condition into the dynamic simulation model, and perform synchronous simulation execution on each dynamic simulation task based on each adapter component to obtain the simulation results.

[0072] In this step, after calling the dynamic simulation model through step S120, the computer device can load the adapter component corresponding to each task condition in the dynamic simulation model, thereby realizing the synchronous simulation execution of each dynamic simulation task and greatly improving the execution efficiency of large-scale batch simulation.

[0073] The adapter component is a lightweight parameter module pre-trained for different types of task conditions. It does not change the main network structure of the dynamic simulation model itself, but only adjusts some parameters or feature mapping relationships within the model to enable the dynamic simulation model to quickly adapt to the dynamic response characteristics of the corresponding task conditions. For example, corresponding adapter components can be configured for different dynamic simulation tasks, such as high penetration rate of new energy, low inertia operation, voltage stability analysis, frequency stability analysis, transient stability analysis, and different fault disturbance scenarios.

[0074] Specifically, the computer device can retrieve the corresponding adapter component from the adapter component library based on the task conditions of each dynamic simulation task, and load each adapter component into the dynamic simulation model simultaneously. Subsequently, the computer device can establish a corresponding simulation execution context for each dynamic simulation task, enabling each dynamic simulation task to share the main parameters of the dynamic simulation model, and call the corresponding adapter component to perform dynamic feature adjustment and dynamic response prediction respectively. In addition, the computer device can also allocate multiple dynamic simulation tasks to multiple computing threads or multiple computing devices for synchronous execution. Based on the shared reasoning capability of the main model, each task can use the corresponding adapter component to complete the dynamic simulation calculation under its own task conditions, and finally output the dynamic response results corresponding to each dynamic simulation task, thereby realizing the synchronous simulation execution of multiple dynamic simulation tasks.

[0075] Understandably, through the adapter component library, computer equipment can load adapter components corresponding to each task condition in the dynamic simulation model as needed, and execute dynamic simulation synchronously in combination with multi-threaded or distributed computing methods. This can significantly improve the concurrent processing capability and overall execution efficiency of large-scale batch dynamic simulation, increase the model reuse rate and resource utilization rate between different operating conditions, and enable the system to more efficiently meet the application requirements of large-scale dynamic simulation of multiple operating conditions in new power systems.

[0076] S140: Conduct a compliance and credibility assessment of the simulation results, obtain a comprehensive assessment result, and generate a structured and interpretable report for the user's request based on the comprehensive assessment result and the simulation results.

[0077] In this step, after obtaining the simulation results of each dynamic simulation task through step S130, the computer equipment can also conduct compliance and credibility assessment of the simulation results, and generate a structured and interpretable report based on the assessment results and simulation results, providing a clear and reliable quantitative reference for power grid operation decisions, thereby meeting the actual needs of current power system operation analysis and control decisions.

[0078] Specifically, in order to ensure that the simulation results conform to the physical rules of actual operation of the power system and have a referenceable level of quantitative confidence, this application can evaluate the simulation results from two dimensions. One dimension is compliance assessment, which verifies whether the simulation results are within the feasible range allowed by the physical rules; the other dimension is credibility assessment, which quantifies the uncertainty of the model output prediction results.

[0079] For compliance assessment, the computer equipment can evaluate whether each predicted value in the simulation results output by the model meets the preset physical operating constraints of each component and node of the power system, such as whether the voltage exceeds the allowable range, whether the frequency recovery time exceeds the preset time limit, whether the system becomes unstable, whether the line is overloaded, and whether the equipment operating parameters exceed the safety threshold, thereby generating a compliance assessment result. For credibility assessment, the computer equipment can perform multiple forward inferences on each predicted value in the simulation results, and statistically analyze the distribution characteristics of the multiple inference results to estimate the uncertainty corresponding to each predicted value, thereby generating a credibility assessment result.

[0080] By combining the assessment results from both compliance and credibility dimensions, the computer equipment can obtain a comprehensive evaluation result for this simulation output. Furthermore, the computer equipment integrates the comprehensive evaluation result with the simulation results from each dynamic simulation task, and organizes it according to a user-predefined report template format to generate a structured and interpretable simulation report that meets the needs of power grid operation analysis. Finally, this report can be delivered to the requesting user, completing the dynamic simulation service.

[0081] Understandably, through structured and interpretable reports, this application can transform complex dynamic simulation results into clear, intuitive, and interpretable analytical conclusions, providing reliable quantitative references for power grid planning and design, safety and stability analysis, operation mode adjustment, and control strategy formulation, thereby better meeting the practical application needs under the complex operation scenarios of new power systems.

[0082] In the above embodiments, in response to a user request, this application can parse the task list carried in the user request and identify the task conditions of each dynamic simulation task in the task list, providing a targeted task adaptation basis for subsequent task simulations. Then, the latest version of the dynamic simulation model can be called. Since this model is trained based on reconstruction loss, contrast loss, and physical consistency loss, and is continuously updated based on measured deviations, it ensures that the model version always adapts to the actual operating characteristics of the current power grid, providing continuous assurance for simulation accuracy. Subsequently, an adapter component corresponding to each task condition is loaded into the dynamic simulation model, enabling synchronous simulation execution of each dynamic simulation task, significantly improving the execution efficiency of large-scale batch simulations. Finally, the simulation results can be evaluated for compliance and credibility, and a structured interpretable report can be generated based on the evaluation results and simulation results, providing a clear and reliable quantitative reference for power grid operation decisions, thereby meeting the actual needs of current power system operation analysis and control decisions.

[0083] In one embodiment, the training process of the dynamic simulation model in step S120 may include:

[0084] S121: A training dataset is constructed based on the operational data of multiple historical dynamic events in the power system.

[0085] S122: Use the training dataset to iteratively train the pre-trained model, and use the trained pre-trained model as the backbone model.

[0086] S123: Fix the original parameters of the backbone model, insert low-rank adapters into multiple attention layers of the backbone model, and set the lightweight task head corresponding to each task condition to form the initial simulation model.

[0087] S124: For each task condition, obtain the task data sample for that task condition, and use the task data sample to fine-tune the parameters of the initial simulation model to obtain the adapter component corresponding to that task condition; the adapter component includes the fine-tuned lightweight task header and low-rank adapter weights.

[0088] S125: Generate dynamic simulation models based on the backbone model and adapter components for each task condition.

[0089] In this embodiment, during model training, the computer device can first construct a training dataset based on the operational data of multiple historical dynamic events in the power system. Then, the pre-trained model is iteratively trained using the training dataset, and the trained pre-trained model is used as the backbone model. Subsequently, the computer device can fix the original parameters of the backbone model and insert low-rank adapters into multiple attention layers of the backbone model. Then, the lightweight task head and low-rank adapter weights corresponding to the task conditions can be fine-tuned using task data samples of the task conditions, thereby obtaining the adapter component corresponding to each task condition. Finally, a dynamic simulation model can be generated through the backbone model and the adapter components of each task condition.

[0090] Historical dynamic events refer to various disturbances, faults, and abnormal operating events that have occurred during the operation of the power system, such as short-circuit faults, sudden load changes, large fluctuations in the output of new energy sources, unit tripping, and line tripping. The operating data corresponding to these events can fully cover the dynamic response process of the power grid under different operating scenarios. Therefore, computer equipment can use this operating data for preprocessing to build a training dataset, providing sufficient data support for the model to learn the dynamic change law of the power grid.

[0091] Specifically, during training, the computer equipment can continuously adjust the model parameters using the training dataset, enabling the pre-trained model to learn the dynamic evolution laws of the power system under different power grid structures, operating modes, and fault disturbance scenarios. The model parameters are jointly optimized by combining reconstruction loss, comparison loss, and physical consistency loss. Once the model reaches the preset convergence condition or the preset number of training rounds is reached, the computer equipment can determine the pre-trained model as the backbone model. This backbone model is primarily used to extract common dynamic features shared by various dynamic simulation tasks, and its parameters reflect the common dynamic response laws of the power system under different operating conditions.

[0092] After training the backbone model, the computer can fix the original parameters in the backbone model, keeping them unchanged during subsequent training under different task conditions. This avoids the loss of existing dynamic knowledge due to repeated updates to the backbone model. Subsequently, the computer can insert low-rank adapters into multiple attention layers of the backbone model. These adapters are primarily used to learn feature shift information corresponding to different task conditions by adding only a few parameters while keeping the main parameters of the backbone model unchanged. Simultaneously, lightweight task heads can be set for each task condition, mainly used to output the final dynamic response prediction results for that task condition, enabling rapid adaptation of the model output to different task objectives.

[0093] Next, the computer equipment can construct corresponding task data samples for each task condition, keeping the backbone model parameters fixed. It can then fine-tune the training of the corresponding lightweight task head and low-rank adapter weights using these task data samples, enabling each task condition to learn its own corresponding dynamic feature representation. For example, for transient stability analysis, voltage stability analysis, frequency stability analysis, high penetration rate of new energy sources, and low inertia operation, the computer equipment can train corresponding lightweight task heads and low-rank adapter weights, forming adapter components that correspond one-to-one with each task condition, and storing them in an adapter component library.

[0094] Understandably, by adopting the training framework of "fixed backbone model parameters and fine-tuned adapter component parameters", this application can retain the ability of the backbone model to extract general power grid dynamic features learned from large-scale general data, and can also quickly adapt to specific task conditions, significantly reducing the computational and storage costs of multi-condition model training, and better adapting to the new power system dynamic simulation needs of continuously expanding business scenarios.

[0095] In one embodiment, the process of constructing a training dataset based on operational data from multiple historical dynamic events in the power system in step S121 may include:

[0096] S1211: Acquire operational data of multiple historical dynamic events in the power system; the operational data includes waveform data acquired from the power grid dispatching platform, synchronous phasor data collected from the wide-area measurement system, and synthetic data generated through the transient simulation platform.

[0097] S1212: The three-dimensional tensor format is used to clean and uniformly model the waveform data, synchronization phasor data and synthetic data to obtain the three-dimensional tensor sample corresponding to each historical dynamic event; the three dimensions of the three-dimensional tensor format include the device dimension, time dimension and physical quantity dimension.

[0098] S1213: Determine the event metadata for each historical dynamic event, establish the mapping relationship between the event metadata and the three-dimensional tensor format for each historical dynamic event, and then store it in the corpus repository.

[0099] S1214: Read multiple three-dimensional tensor samples from the corpus and segment each three-dimensional tensor sample using a fixed-length sliding window to obtain multiple time-series segments;

[0100] S1215: Perform random masking on each time segment to obtain the mask segment corresponding to each time segment, construct the comparison sample pair for each time segment, and calculate the physical residual label corresponding to each time segment offline.

[0101] S1216: Generate multiple training samples based on the masked fragments, contrast sample pairs, and physical residual labels of each time segment, and construct the training dataset based on each training sample.

[0102] In this embodiment, the runtime data may include waveform data, synchronization phasor data, and synthetic data. After acquiring runtime data for multiple historical dynamic events, the computer device can perform data cleaning and unified modeling on the waveform data, synchronization phasor data, and synthetic data using a three-dimensional tensor format to obtain a three-dimensional tensor sample corresponding to each historical dynamic event. Then, a mapping relationship between the event metadata of each historical dynamic event and the three-dimensional tensor format can be established, and the three-dimensional tensor sample is stored in a corpus warehouse. When constructing the training sample set, the computer device can randomly mask each time segment to obtain a mask segment corresponding to each time segment, construct a comparison sample pair for each time segment, and calculate the physical residual label corresponding to each time segment offline. Then, multiple training samples are generated based on the mask segment, comparison sample pair, and physical residual label of each time segment, and a training dataset is constructed based on each training sample.

[0103] Among them, waveform data refers to the time-series data of power grid operating parameters before and after a power grid fault, obtained from the power grid dispatching platform after the fault occurs. It can truly reflect the actual dynamic changes of the power grid under actual fault scenarios and is the core real data source for the model to learn the dynamic characteristics of the real power grid. Synchronous phasor data refers to the power grid voltage and current phasor data with unified time scales collected by the PMU in the wide-area measurement system. It has a higher time resolution and can provide the model with fine-grained data on the dynamic response process of the power grid. Synthetic data is the simulation data generated by the traditional mechanism-based transient simulation platform. It can supplement the extreme operating scenarios and rare fault scenarios that are not covered by real historical data, and enrich the scenario coverage of the training dataset.

[0104] Specifically, in the data cleaning stage, computer equipment can first remove outliers from the collected raw operational data, eliminating obvious errors caused by equipment acquisition anomalies or communication interference. Then, it uses linear interpolation or neighborhood mean filling to complete missing data, ensuring the continuity of time-series data. Subsequently, the cleaned operational data from different sources can be organized into a unified three-dimensional tensor format according to equipment, time, and physical quantity dimensions. The equipment dimension corresponds to objects such as power grid equipment, buses, and lines participating in the dynamic process; the time dimension corresponds to each time step of the dynamic process; and the physical quantity dimension corresponds to different physical quantities such as voltage amplitude, phase angle, active power, and reactive power for each object at each time step, thus achieving unified structured storage of data from different sources. After constructing the three-dimensional tensor samples, the computer equipment can extract event metadata corresponding to each historical dynamic event, including event occurrence time, event type, power grid operation mode, renewable energy penetration rate, fault location, and other feature annotation information. It then establishes a mapping relationship between event metadata and corresponding three-dimensional tensor samples, forming three-dimensional tensor samples that are then uniformly stored in a corpus warehouse.

[0105] When constructing the training dataset, in order to ensure the representativeness and balance of the corpus, the computer equipment can perform stratified sampling from the corpus according to dimensions such as operating mode, perturbation type, voltage level, and new energy penetration rate to obtain multiple three-dimensional tensor samples. Then, a fixed-length sliding window can be used to segment the long-time three-dimensional tensor samples to obtain multiple short-time segments of uniform length. The step size of the sliding window is smaller than the window length, which can achieve partial overlap between adjacent slices and enhance the diversity of the corpus. To adapt to the model's pre-training task, the computer device can perform random masking operations on each segmented time series. For example, it can randomly select several positions in the time and physical quantity dimensions of the time series segment and mark them as masked according to a masking ratio of 15% to 40%, thus obtaining the corresponding masked segments. This allows the model to learn to predict the values ​​at the masked positions and learn the inherent correlation patterns of power grid operation. Simultaneously, to meet the computational requirements of the contrast loss, the computer device can construct positive and negative contrast sample pairs for each time series segment. Positive sample pairs can be different time window slices of the same three-dimensional tensor sample, or time series segments under the same disturbance type but different operating modes. Negative sample pairs can be time series segments in three-dimensional tensor samples with different disturbance types and dynamic characteristics, allowing the model to learn to distinguish the feature differences of different operating conditions. Furthermore, the computer device can calculate the physical residual label corresponding to each time series segment offline, mainly used for subsequent calculation of physical consistency loss. Finally, the masked segments, contrast sample pairs, and physical residual labels are combined to generate training samples. The final training dataset is obtained by summing all training samples.

[0106] In one embodiment, such as Figure 2 As shown, Figure 2 A flowchart illustrating an iterative training process for a pre-trained model, provided as an embodiment of this application; Figure 2 In step S122, the process of iteratively training the pre-trained model using the training dataset may include:

[0107] S1221: In each round of training, training samples are randomly extracted from the training dataset; the training samples include mask fragments, contrast sample pairs, and physical residual labels.

[0108] S1222: Input the training samples into the pre-trained model to obtain the high-dimensional features output by the pre-trained model.

[0109] S1223: The reconstruction loss is calculated based on the high-dimensional features and mask fragments, the contrast loss is calculated based on the high-dimensional features and contrast sample pairs, and the physical consistency loss is calculated based on the high-dimensional features and physical residual labels.

[0110] S1224: Update the parameters of the pre-trained model based on reconstruction loss, contrast loss, and physical consistency loss.

[0111] In this embodiment, to improve the balance of training across various operating conditions, the computer device can randomly extract training samples from the training dataset during each training round. These samples include mask fragments, contrast sample pairs, and physical residual labels. Subsequently, the computer device can input the training samples into a pre-trained model to obtain high-dimensional features output by the pre-trained model. Based on these high-dimensional features and mask fragments, the computer device can calculate the reconstruction loss, the contrast loss, and the physical consistency loss. Finally, the computer device can update the parameters of the pre-trained model based on the reconstruction loss, contrast loss, and physical consistency loss.

[0112] Specifically, after the computer equipment inputs training samples into the pre-trained model, the pre-trained model can encode features of the three-dimensional tensor data in the training samples and use multiple attention layers to learn the correlations between different time dimensions, different measurement points, and different operational characteristics, thereby outputting high-dimensional features that can characterize the dynamic evolution of the power system. After obtaining the high-dimensional features, the computer equipment can construct multiple training objectives for joint optimization. For reconstruction loss, the computer equipment can use the high-dimensional features to recover the hidden operational data in the masked segment and compare the recovered result with the original unmasked data. The reconstruction loss is calculated based on the reconstruction error between the two, thus constraining the pre-trained model to learn complete dynamic time-series features and improving the model's ability to recover missing data and complex dynamic processes. For contrastive loss, the computer equipment can constrain the distance between positive samples and their corresponding high-dimensional features to gradually decrease, so that samples from the same operating conditions or similar dynamic events have closer feature representations. The distance between the corresponding high-dimensional features of the constrained negative samples gradually increases, making the samples from different operating conditions or different dynamic events clearly distinguishable. This allows the corresponding contrast loss to be calculated, thereby improving the pre-trained model's ability to identify and generalize dynamic features under different operating conditions. For the physical consistency loss, the computer equipment can predict the dynamic response results of the corresponding time segment based on the high-dimensional features, and calculate the degree of deviation between the prediction results and the physical constraints of the power system by combining the physical residual labels. The physical consistency loss is then calculated based on the difference between the physical residuals corresponding to the prediction results and the physical residual labels, in order to guide the model to learn the dynamic response laws that conform to the operating mechanism of the power system.

[0113] Furthermore, the computer device can jointly weight the calculated reconstruction loss, contrast loss, and physical consistency loss to generate a comprehensive loss function corresponding to the current training round. Then, using an optimizer with warm-up and cosine decay (AdamW), the model parameters in the pre-trained model are updated based on the comprehensive loss function using gradient backpropagation. When the comprehensive loss function reaches a preset convergence condition or the preset number of training rounds is reached, the pre-trained model training is complete, yielding the backbone model for subsequent dynamic simulation tasks.

[0114] Furthermore, the computer equipment can periodically save checkpoints during training and evaluate the zero-shot prediction performance of each checkpoint on a validation set. Once the backbone model is obtained after training, the computer equipment can also perform hash verification and signature encryption on the backbone model's parameter weights before storing them in a model asset repository, thus preventing direct modification later. This model asset repository manages all backbone weights by version number; before a new version is released, it must pass accuracy regression testing on a standard evaluation set to ensure it does not cause performance degradation for already deployed tasks.

[0115] In one embodiment, the continuous update process of the dynamic simulation model in step S120 may include:

[0116] S126: Obtain the simulation results of the dynamic simulation model's predicted output for each dynamic simulation task, and monitor the measured results of each dynamic simulation task in the power system.

[0117] S127: Determine the prediction error between the simulation results and the measured results for each dynamic simulation task, and mark dynamic simulation tasks whose prediction error is greater than a preset error threshold and whose duration exceeds a preset time window as deviation events.

[0118] S128: Confirm the task status and event metadata of the deviation event, and package the event metadata, simulation results and experimental results into new training samples, and add them to the incremental learning partition corresponding to the task status in the corpus repository.

[0119] S129: When the number of newly added training samples in the incremental learning partition of any task condition reaches the preset trigger number, the newly added training samples in the incremental learning partition are extracted to update the parameters of the adapter component corresponding to the task condition in the dynamic simulation model, so as to obtain the latest version of the dynamic simulation model.

[0120] In this embodiment, after the dynamic simulation model predicts and outputs simulation results for each dynamic simulation task, the computer device can also monitor the measured results of each dynamic simulation task in the power system in real time. Then, it determines the prediction error between the simulation results and the measured results for each dynamic simulation task, and marks dynamic simulation tasks with prediction errors greater than a preset error threshold and lasting longer than a preset time window as deviation events. The event metadata, simulation results, and measured results of these deviation events can then be packaged into new training samples and added to the incremental learning partition in the corpus corresponding to the task's operating condition. If the number of new training samples in the incremental learning partition for any task's operating condition reaches a preset trigger number, the computer device can extract these new training samples from the incremental learning partition to update the parameters of the adapter component in the dynamic simulation model corresponding to the task's operating condition, thus obtaining the latest version of the dynamic simulation model.

[0121] Specifically, the computer equipment can continuously monitor the real-time operating status of the target power system and collect the field measurement results corresponding to each dynamic simulation task. This allows for the establishment of a correspondence between the simulation results and the measured results for each dynamic simulation task. Time alignment and data matching are performed according to a unified time base, and the prediction error between the two results is calculated. This prediction error can be determined based on at least one of voltage deviation, frequency deviation, power angle deviation, active power deviation, reactive power deviation, and the overall fitting error of the dynamic curve. Subsequently, the computer equipment can continuously monitor changes in the prediction error and determine whether the prediction error continuously exceeds a preset error threshold. When the prediction error continuously exceeds the preset error threshold for a duration exceeding a preset time window, it indicates a decrease in the predictive ability of the current dynamic simulation model for the corresponding task's operating condition. At this point, the computer equipment can mark the corresponding dynamic simulation task as a deviation event.

[0122] After identifying the deviation event, the computer equipment can extract the corresponding event metadata, simulation results output by the dynamic simulation model, and field measurement results, and construct corresponding new training samples. Based on this data, the computer equipment can package it according to a unified data format to form new training samples, and add them to the incremental learning partition in the corpus warehouse associated with the corresponding task conditions. Therefore, the new training samples can be classified and managed according to different task conditions, providing a data foundation for subsequent targeted model updates.

[0123] Furthermore, the computer equipment can continuously monitor the number of newly added training samples in the incremental learning partition corresponding to each task condition. When the number of newly added training samples in the incremental learning partition corresponding to any task condition reaches a preset trigger number, the computer equipment can trigger the incremental learning process of the corresponding adapter component. In detail, the computer equipment can extract the newly added training samples from the incremental learning partition and keep the parameters of the main dynamic simulation model fixed, updating only the parameters of the adapter component corresponding to that task condition. During the parameter update process, the computer equipment can use the newly added training samples to further fine-tune the lightweight task header and low-rank adapter weights corresponding to that task condition, enabling the adapter component to learn the dynamic response characteristics under the latest operating condition. After the adapter component is updated, the computer equipment can replace the original adapter component with the updated one, thereby generating the latest version of the dynamic simulation model, providing a reliable guarantee for the continuous optimization and engineering application of dynamic simulation of new power systems.

[0124] Furthermore, before a new version of the adapter component is deployed, it needs to undergo A / B testing and regression evaluation. If the evaluation results show performance degradation, the computer equipment can roll it back to the previous version to ensure business continuity.

[0125] In one embodiment, the process of evaluating the compliance and credibility of the simulation results in step S140 to obtain a comprehensive evaluation result may include:

[0126] S141: Perform inverse normalization on the simulation results to obtain engineering data.

[0127] S142: Use physical constraint projection to perform feasible domain correction on the engineering data to obtain corrected data, and generate compliance assessment results based on the corrected data and the engineering data.

[0128] S143: Estimate the uncertainty of each predicted value in the engineering data, obtain the confidence interval of each predicted value, and generate a confidence assessment result based on each confidence interval.

[0129] S144: A comprehensive evaluation result of the simulation results generated based on the compliance assessment results and the credibility assessment results.

[0130] In this embodiment, after the dynamic simulation model outputs simulation results, the computer device can perform inverse normalization on the simulation results to obtain engineering data. Then, physical constraint projection can be used to perform feasible region correction on the engineering data to obtain corrected data. Based on the corrected data and the engineering data, a compliance assessment result is generated. Furthermore, uncertainty estimation is performed on each predicted value in the engineering data to obtain a confidence interval for each predicted value, and a credibility assessment result is generated based on each confidence interval. Finally, the computer device can generate a comprehensive assessment result of the simulation results based on the compliance assessment result and the credibility assessment result.

[0131] Specifically, after the dynamic simulation model outputs simulation results, the computer equipment can first perform inverse normalization processing on the simulation results. This includes inversely transforming each predicted value, such as restoring voltage to kV, frequency to Hz, power angle to degrees, and restoring engineering quantities such as active power and reactive power, so that the simulation data is restored to engineering data with actual physical units. Subsequently, the computer equipment can use physical constraint projection, that is, using the engineering data as the initial point of optimization, and using the power flow equation, power balance equation, and equipment operation constraints as constraints, to solve for the physical feasible solution closest to the original prediction result, and determine it as the correction data. Then, based on the correction amount between the correction data and the engineering data, and the deviation before and after correction, the corresponding compliance assessment result can be generated, thereby determining whether the simulation result meets the physical constraints of the power system. At the same time, the computer equipment can also calculate the confidence interval corresponding to each predicted value based on deep integration or Bayesian approximation methods, and generate a credibility assessment result based on the width of each confidence interval. When the confidence interval corresponding to a certain predicted value exceeds a preset threshold, the credibility of the prediction result can be determined to be low, and a corresponding credibility assessment result can be generated.

[0132] Understandably, based on the compliance assessment results and the credibility assessment results, computer equipment can use engineering data as the core output of the simulation results, use the correction amount corresponding to the projection of physical constraints and the deviation before and after correction as the physical compliance assessment content, and use the confidence interval corresponding to each predicted value as the credibility assessment content, and jointly construct a comprehensive assessment result of the simulation results, providing a reliable basis for power grid operation analysis and control decisions.

[0133] In one embodiment, the process of generating a structured and interpretable report of the user request based on the comprehensive evaluation results and simulation results in step S140 may include:

[0134] S145: The contribution of the predicted value at each time step in the simulation results is quantified by using integrated gradients to obtain the contribution data of key input features.

[0135] S146: The target operating condition data is obtained by performing nearest neighbor retrieval on the high-dimensional features of each dynamic simulation task through a preset historical operating condition table index library, and the simulation results are compared and analyzed with the target operating condition data to obtain operating condition difference evaluation data.

[0136] S147: Obtain the baseline data corresponding to each task condition through the preset mechanism simulation evaluation set, and compare and analyze the simulation results with the baseline data to obtain the mechanism simulation deviation data.

[0137] S148: Generate a structured and interpretable report requested by the user based on the comprehensive evaluation results, key input feature contribution data, operating condition difference evaluation data, and mechanism simulation deviation data.

[0138] In this embodiment, after generating the comprehensive evaluation results, the computer device can further determine the key input feature contribution data, operating condition difference evaluation data, and mechanism simulation deviation data of the simulation results. Then, based on the comprehensive evaluation results, key input feature contribution data, operating condition difference evaluation data, and mechanism simulation deviation data, a structured and interpretable report requested by the user can be generated. Therefore, the user can intuitively understand the basis for the formation of the dynamic simulation results, the degree of credibility, and the differences between the results and historical operating conditions and mechanism simulation results through this report.

[0139] Specifically, key input feature contribution data refers to the set of data that quantifies the degree of influence of each input feature on the current simulation prediction result. When determining key input feature contribution data, the computer can perform integral calculations on the gradient contribution corresponding to each time step and each physical quantity in the input time series tensor based on the calculation results after one forward inference operation of the model. This quantifies the influence of each input feature on each predicted value and generates contribution weights based on the contribution degree of each input feature, thereby identifying the key input variables and key time periods that have the greatest impact on the current dynamic simulation result, and obtaining the key input feature contribution data.

[0140] Operating condition difference assessment data refers to the quantitative difference data obtained by comparing the current operating conditions of the simulation task with historically occurring and verified typical operating conditions. When determining the mechanism simulation deviation data, the computer equipment can first encode the current operating condition using the backbone model of the dynamic simulation model to obtain the corresponding high-dimensional feature representation. Then, it retrieves the target operating condition data closest to this high-dimensional feature from a pre-established historical operating condition table index. Finally, it compares and analyzes the current simulation results with the historical dynamic response results corresponding to the target operating condition data to generate operating condition difference assessment data, including operating condition similarity, main differences, and reasons for the differences.

[0141] Mechanism simulation deviation data refers to the statistical benchmark data corresponding to the standard simulation results output by traditional mechanism-based simulation tools under the current task conditions. When determining mechanism simulation deviation data, the computer equipment can also obtain benchmark data corresponding to the current task conditions through a preset mechanism simulation evaluation set. This set pre-stores mechanism simulation benchmark results for different task conditions. After obtaining the benchmark data matching the current task conditions, the computer equipment can compare the simulation results with this benchmark data item by item to obtain the deviation range corresponding to the predicted results such as voltage, frequency, power angle, and power, thereby generating mechanism simulation deviation data.

[0142] The following describes the power system dynamic simulation device provided in the embodiments of this application. The power system dynamic simulation device described below can be referred to in correspondence with the power system dynamic simulation method described above.

[0143] In one embodiment, such as Figure 3 As shown, Figure 3 This application provides a schematic diagram of the structure of a power system dynamic simulation device according to an embodiment of the present application. The present application also provides a power system dynamic simulation device, including a request parsing module 210, a model calling module 220, a task simulation module 230, and a report generation module 240, specifically comprising the following:

[0144] The request parsing module 210 is used to respond to a user request, parse the task list carried in the user request, and determine the task status of each dynamic simulation task in the task list.

[0145] The model calling module 220 is used to call the latest version of the dynamic simulation model. The dynamic simulation model is trained based on reconstruction loss, contrast loss and physical consistency loss, and the model version is continuously updated based on measured deviations.

[0146] The task simulation module 230 is used to load the adapter component corresponding to each task condition into the dynamic simulation model, and to perform synchronous simulation execution of each dynamic simulation task based on each adapter component to obtain simulation results.

[0147] The report generation module 240 is used to evaluate the compliance and credibility of the simulation results, obtain a comprehensive evaluation result, and generate a structured and interpretable report requested by the user based on the comprehensive evaluation result and the simulation results.

[0148] In the above embodiments, in response to a user request, this application can parse the task list carried in the user request and identify the task conditions of each dynamic simulation task in the task list, providing a targeted task adaptation basis for subsequent task simulations. Then, the latest version of the dynamic simulation model can be called. Since this model is trained based on reconstruction loss, contrast loss, and physical consistency loss, and is continuously updated based on measured deviations, it ensures that the model version always adapts to the actual operating characteristics of the current power grid, providing continuous assurance for simulation accuracy. Subsequently, an adapter component corresponding to each task condition is loaded into the dynamic simulation model, enabling synchronous simulation execution of each dynamic simulation task, significantly improving the execution efficiency of large-scale batch simulations. Finally, the simulation results can be evaluated for compliance and credibility, and a structured interpretable report can be generated based on the evaluation results and simulation results, providing a clear and reliable quantitative reference for power grid operation decisions, thereby meeting the actual needs of current power system operation analysis and control decisions.

[0149] In one embodiment, the model invocation module 220 may include:

[0150] The dataset construction submodule is used to construct a training dataset based on the operational data of multiple historical dynamic events in the power system.

[0151] The model training submodule is used to iteratively train the pre-trained model using the training dataset and to use the trained pre-trained model as the backbone model.

[0152] The model building submodule is used to fix the original parameters of the backbone model, insert low-rank adapters into multiple attention layers of the backbone model, and set the lightweight task head corresponding to each task condition to form the initial simulation model.

[0153] The model fine-tuning submodule is used to acquire task data samples for each task condition and fine-tune the parameters of the initial simulation model using the task data samples to obtain the adapter component corresponding to the task condition. The adapter component includes a fine-tuned lightweight task header and low-rank adapter weights.

[0154] The model generation submodule is used to generate dynamic simulation models based on the backbone model and the adapter components for each task condition.

[0155] In one embodiment, the dataset construction submodule may include:

[0156] The data acquisition unit is used to acquire operational data of multiple historical dynamic events in the power system. The operational data includes waveform data acquired from the power grid dispatching platform, synchronous phasor data collected from the wide-area measurement system, and synthetic data generated by the transient simulation platform.

[0157] The sample generation unit is used to perform data cleaning and unified modeling on waveform data, synchronization phasor data and synthetic data using a three-dimensional tensor format to obtain a three-dimensional tensor sample corresponding to each historical dynamic event; wherein, the three dimensions of the three-dimensional tensor format include the device dimension, the time dimension and the physical quantity dimension.

[0158] The sample storage unit is used to determine the event metadata of each historical dynamic event, and after establishing the mapping relationship between each historical dynamic event and the event metadata and the three-dimensional tensor format, it is stored in the corpus repository.

[0159] The sample segmentation unit is used to read multiple three-dimensional tensor samples from the corpus and segment each three-dimensional tensor sample using a fixed-length sliding window to obtain multiple time-series segments.

[0160] The data construction unit is used to randomly mask each time segment to obtain the mask segment corresponding to each time segment, construct the comparison sample pair for each time segment, and calculate the physical residual label corresponding to each time segment offline.

[0161] The dataset construction unit is used to generate multiple training samples based on the masked fragments, contrast sample pairs, and physical residual labels of each time segment, and to construct the training dataset based on each training sample.

[0162] In one embodiment, the model training submodule may include:

[0163] The sample extraction unit is used to randomly extract training samples from the training dataset in each training round; the training samples include mask fragments, contrast sample pairs, and physical residual labels.

[0164] The feature extraction unit is used to input training samples into the pre-trained model to obtain high-dimensional features output by the pre-trained model.

[0165] The loss calculation unit is used to calculate the reconstruction loss based on high-dimensional features and mask fragments, the contrast loss based on high-dimensional features and contrast sample pairs, and the physical consistency loss based on high-dimensional features and physical residual labels.

[0166] The parameter update unit is used to update the parameters of the pre-trained model based on reconstruction loss, contrast loss, and physical consistency loss.

[0167] In one embodiment, the model invocation module 220 may further include:

[0168] The data acquisition submodule is used to acquire the simulation results predicted by the dynamic simulation model for each dynamic simulation task, as well as to monitor the measured results of each dynamic simulation task in the power system.

[0169] The event tagging submodule is used to determine the prediction error between the simulation results and the measured results for each dynamic simulation task, and to mark dynamic simulation tasks whose prediction error is greater than a preset error threshold and whose duration exceeds a preset time window as deviation events.

[0170] The incremental sample generation submodule is used to confirm the task conditions and event metadata of the deviation event, and package the event metadata, simulation results and experimental results into new training samples, which are then added to the incremental learning partition in the corpus warehouse corresponding to the task conditions.

[0171] The update trigger submodule is used to extract the new training samples in the incremental learning partition of any task condition and update the parameters of the adapter component in the dynamic simulation model corresponding to the task condition when the number of new training samples in the incremental learning partition reaches the preset trigger number, so as to obtain the latest version of the dynamic simulation model.

[0172] In one embodiment, the report generation module 240 may include:

[0173] The first processing submodule is used to perform inverse normalization on the simulation results to obtain engineering data.

[0174] The second processing submodule is used to perform feasible domain correction on the engineering data using physical constraint projection, obtain corrected data, and generate compliance assessment results based on the corrected data and the engineering data.

[0175] The third processing submodule is used to estimate the uncertainty of each predicted value in the engineering data, obtain the confidence interval of each predicted value, and generate a confidence assessment result based on each confidence interval.

[0176] The results generation submodule is used to generate a comprehensive evaluation result of the simulation results based on the compliance assessment results and the credibility assessment results.

[0177] In one embodiment, the report generation module 240 may further include:

[0178] The first analysis submodule is used to quantify the contribution of the predicted value at each time step in the simulation results using integrated gradients, thereby obtaining the contribution data of key input features.

[0179] The second analysis submodule is used to perform nearest neighbor retrieval on the high-dimensional features of each dynamic simulation task through a preset historical working condition table index library to obtain target working condition data, and compare and analyze the simulation results with the target working condition data to obtain working condition difference evaluation data.

[0180] The third analysis submodule is used to obtain the benchmark data corresponding to each task condition through the preset mechanism simulation evaluation set, and compare and analyze the simulation results with the benchmark data to obtain mechanism simulation deviation data.

[0181] The report generation submodule is used to generate a structured and interpretable report requested by the user based on the comprehensive evaluation results, key input feature contribution data, operating condition difference evaluation data, and mechanism simulation deviation data.

[0182] In one embodiment, this application also provides a storage medium storing computer-readable instructions that, when executed by one or more processors, cause the one or more processors to perform the steps of the power system dynamic simulation method as described in any of the above embodiments.

[0183] In one embodiment, this application also provides a computer device storing computer-readable instructions that, when executed by one or more processors, cause the one or more processors to perform the steps of the power system dynamic simulation method as described in any of the above embodiments.

[0184] Indicatively, such as Figure 4 As shown, Figure 4 This is a schematic diagram of the internal structure of a computer device 300 provided in an embodiment of this application. The computer device 300 can be provided as a server. (Refer to...) Figure 4The computer device 300 includes a processing component 302, which further includes one or more processors, and memory resources represented by memory 301 for storing instructions, such as application programs, that can be executed by the processing component 302. The application programs stored in memory 301 may include one or more modules, each corresponding to a set of instructions. Furthermore, the processing component 302 is configured to execute instructions to perform the power system dynamic simulation method of any of the above embodiments.

[0185] The computer device 300 may also include a power supply component 303 configured to perform power management of the computer device 300, a wired or wireless network interface 304 configured to connect the computer device 300 to a network, and an input / output (I / O) interface 305. The computer device 300 may operate on an operating system stored in memory 301, such as Windows Server™, Mac OS X™, Unix™, Linux™, Free BSD™, or similar.

[0186] Those skilled in the art will understand that Figure 4 The structure shown is merely a block diagram of a portion of the structure related to the present application and does not constitute a limitation on the computer device to which the present application is applied. Specific computer devices may include more or fewer components than those shown in the figure, or combine certain components, or have different component arrangements.

[0187] Finally, it should be noted that in this document, relational terms such as "first" and "second" are used only to distinguish one entity or operation from another, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Furthermore, the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such a process, method, article, or apparatus. Without further limitations, an element defined by the phrase "comprising one..." does not exclude the presence of other identical elements in the process, method, article, or apparatus that includes said element.

[0188] The various embodiments in this specification are described in a progressive manner. Each embodiment focuses on the differences from other embodiments. The various embodiments can be combined as needed, and the same or similar parts can be referred to each other.

[0189] The above description of the disclosed embodiments enables those skilled in the art to make or use this application. Various modifications to these embodiments will be readily apparent to those skilled in the art, and the general principles defined herein may be implemented in other embodiments without departing from the spirit or scope of this application. Therefore, this application is not to be limited to the embodiments shown herein, but is to be accorded the widest scope consistent with the principles and novel features disclosed herein.

Claims

1. A dynamic simulation method for power systems, characterized in that, The method includes: In response to a user request, the task list carried in the user request is parsed and the task status of each dynamic simulation task in the task list is determined. The latest version of the dynamic simulation model is invoked; the dynamic simulation model is trained based on reconstruction loss, contrast loss and physical consistency loss, and the model version is continuously updated based on measured bias. In the dynamic simulation model, an adapter component corresponding to each task condition is loaded, and each dynamic simulation task is synchronously executed based on each adapter component to obtain simulation results. The simulation results are evaluated for compliance and credibility to obtain a comprehensive evaluation result. Based on the comprehensive evaluation result and the simulation results, a structured and interpretable report of the user request is generated.

2. The power system dynamic simulation method according to claim 1, characterized in that, The training process of the dynamic simulation model includes: A training dataset was constructed based on operational data from multiple historical dynamic events in the power system. The pre-trained model is iteratively trained using the training dataset, and the trained pre-trained model is used as the backbone model. The original parameters of the backbone model are fixed, and low-rank adapters are inserted into multiple attention layers of the backbone model. A lightweight task head is set for each task condition to form an initial simulation model. For each task condition, a task data sample for that task condition is obtained, and the parameters of the initial simulation model are fine-tuned using the task data sample to obtain the adapter component corresponding to that task condition; the adapter component includes a fine-tuned lightweight task header and low-rank adapter weights. A dynamic simulation model is generated based on the main model and the adapter components for each task condition.

3. The power system dynamic simulation method according to claim 2, characterized in that, The training dataset, constructed from operational data of multiple historical dynamic events in the power system, includes: The system acquires operational data from multiple historical dynamic events in the power system; the operational data includes waveform data acquired from the power grid dispatching platform, synchronous phasor data collected from the wide-area measurement system, and synthetic data generated through the transient simulation platform. The waveform data, the synchronization phasor data, and the synthetic data are cleaned and uniformly modeled using a three-dimensional tensor format to obtain a three-dimensional tensor sample corresponding to each historical dynamic event; wherein, the three dimensions of the three-dimensional tensor format include the device dimension, the time dimension, and the physical quantity dimension; After determining the event metadata for each historical dynamic event and establishing the mapping relationship between the event metadata and the three-dimensional tensor format for each historical dynamic event, the data is stored in the corpus repository. Multiple three-dimensional tensor samples are read from the corpus, and each three-dimensional tensor sample is segmented using a fixed-length sliding window to obtain multiple time-series segments. Each time series segment is randomly masked to obtain the mask segment corresponding to each time series segment, and the comparison sample pair of each time series segment is constructed, and the physical residual label corresponding to each time series segment is calculated offline. Multiple training samples are generated based on the masked fragments, contrast sample pairs, and physical residual labels of each time segment, and a training dataset is constructed based on each training sample.

4. The power system dynamic simulation method according to claim 2, characterized in that, The iterative training of the pre-trained model using the training dataset includes: During each round of training, training samples are randomly extracted from the training dataset; the training samples include mask fragments, contrast sample pairs, and physical residual labels; The training samples are input into the pre-trained model to obtain the high-dimensional features output by the pre-trained model; The reconstruction loss is calculated based on the high-dimensional features and the mask fragment; the contrast loss is calculated based on the high-dimensional features and the contrast sample pair; and the physical consistency loss is calculated based on the high-dimensional features and the physical residual label. The parameters of the pre-trained model are updated based on the reconstruction loss, the contrast loss, and the physical consistency loss.

5. The power system dynamic simulation method according to claim 1, characterized in that, The continuous update process of the dynamic simulation model includes: The simulation results predicted by the dynamic simulation model for each dynamic simulation task are obtained, and the measured results of each dynamic simulation task in the power system are monitored. Determine the prediction error of each dynamic simulation task between the simulation result and the measured result, and mark dynamic simulation tasks whose prediction error is greater than a preset error threshold and whose duration exceeds a preset time window as deviation events. Confirm the task status and event metadata of the deviation event, and package the event metadata, the simulation results and the measured results into new training samples, and add them to the incremental learning partition in the corpus warehouse corresponding to the task status. When the number of newly added training samples in the incremental learning partition of any task condition reaches the preset trigger number, the newly added training samples in the incremental learning partition are extracted to update the parameters of the adapter component in the dynamic simulation model corresponding to the task condition, so as to obtain the latest version of the dynamic simulation model.

6. The power system dynamic simulation method according to claim 1, characterized in that, The compliance and credibility assessment of the simulation results yields a comprehensive evaluation result, including: The simulation results are inversely normalized to obtain engineering data; The engineering data is corrected in the feasible region using physical constraint projection to obtain corrected data, and a compliance assessment result is generated based on the corrected data and the engineering data. Uncertainty estimation is performed on each predicted value in the engineering data to obtain the confidence interval of each predicted value, and a confidence assessment result is generated based on each confidence interval. A comprehensive evaluation result of the simulation results is generated based on the compliance assessment results and the credibility assessment results.

7. The power system dynamic simulation method according to claim 1, characterized in that, The step of generating a structured, interpretable report of the user request based on the comprehensive evaluation results and the simulation results includes: The contribution of the predicted value at each time step in the simulation results is quantified by using integrated gradients to obtain the contribution data of key input features. By using a pre-set historical operating condition table index library, the high-dimensional features of each dynamic simulation task are searched for nearest neighbors to obtain target operating condition data. The simulation results are then compared and analyzed with the target operating condition data to obtain operating condition difference evaluation data. The baseline data corresponding to each task condition is obtained by using a preset mechanism simulation evaluation set, and the simulation results are compared and analyzed with the baseline data to obtain mechanism simulation deviation data. Based on the comprehensive evaluation results, the key input feature contribution data, the operating condition difference evaluation data, and the mechanism simulation deviation data, a structured and interpretable report for the user request is generated.

8. A dynamic simulation device for a power system, characterized in that, include: The request parsing module is used to respond to a user request, parse the task list carried in the user request, and determine the task status of each dynamic simulation task in the task list. The model invocation module is used to invoke the latest version of the dynamic simulation model; the dynamic simulation model is trained based on reconstruction loss, contrast loss and physical consistency loss, and the model version is continuously updated based on measured deviations. The task simulation module is used to load adapter components corresponding to each task condition into the dynamic simulation model, and to synchronously perform simulation execution on each dynamic simulation task based on each adapter component to obtain simulation results. The report generation module is used to evaluate the compliance and credibility of the simulation results, obtain a comprehensive evaluation result, and generate a structured and interpretable report of the user request based on the comprehensive evaluation result and the simulation results.

9. A storage medium, characterized in that: The storage medium stores computer-readable instructions that, when executed by one or more processors, cause the one or more processors to perform the steps of the power system dynamic simulation method as described in any one of claims 1 to 7.

10. A computer device, characterized in that, include: One or more processors, and memory; The memory stores computer-readable instructions, which, when executed by the one or more processors, perform the steps of the power system dynamic simulation method as described in any one of claims 1 to 7.