An online data-based primary-secondary simulation model interaction method and device

CN122987352APending Publication Date: 2026-10-27STATE GRID SICHUAN ELECTRIC POWER CORP ELECTRIC POWER RES INST
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202611173506.1
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2026-08-04
Publication Date
2026-10-27

AI Technical Summary

Technical Problem

[0002]随着新型电力系统“双高”(高比例可再生能源、高比例电力电子设备)特征不断深化,电网暂态过程日趋复杂,继电保护系统面临故障特征变异、潜在风险隐蔽、传统运维模式响应迟滞等严峻挑战;现有技术主要依赖于分立的数据系统、离线的仿真工具和人工主导的分析流程,来实现对电网故障的分析和保护的校验;其核心特征是各环节相对独立,依赖人工进行数据对接与逻辑判断,未能实现数据、模型与业务的在线自动融合与闭环应用;综合来看,当前普遍使用的技术方法存在以下主要局限:

Benefits of technology

[0048]1. 提升仿真精准度与可信度,打破数据壁垒:本方案通过数据层汇聚并治理电网一二次系统的实时、历史及故障数据,构建了高质量的全景数据池;这使仿真模型能够紧密贴合电网实际状态,确保了仿真分析的唯一可信数据来源,可解决传统离线仿真数据陈旧、与实际脱节的问题,大幅提升了仿真的真实性与结果的可信度。

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122987352A_ABST
    Figure CN122987352A_ABST
Patent Text Reader

Abstract

The application discloses a one-two simulation model interaction method and device based on online data, relates to the technical field of data interaction, and comprises the following steps: acquiring power grid operation data and performing data cleaning and data alignment on the power grid operation data; acquiring a simulation demand required to be executed at present, and executing a simulation mode corresponding to the simulation demand based on the processed power grid operation data, wherein the simulation mode comprises simulation inversion and simulation early warning; analyzing simulation results of the simulation inversion and / or the simulation early warning, forming a report and rectification suggestion and / or forming an early warning processing strategy and a preventive maintenance work order according to analysis results; and connecting and fusing power grid real-time operation data and a high-fidelity simulation model to construct an online simulation environment which is data-driven, dynamically updated and closed-loop interactive, thereby supporting accurate digital mapping, real-time dynamic deduction and online active verification on behaviors of a relay protection system, so that the situation awareness capability and the active defense level of the relay protection system are effectively improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of data interaction technology, and more specifically, to a method and apparatus for primary and secondary simulation model interaction based on online data. Background Technology

[0002] As the "dual-high" characteristics (high proportion of renewable energy and high proportion of power electronic equipment) of the new power system continue to deepen, the transient processes of the power grid are becoming increasingly complex. Relay protection systems face severe challenges such as variations in fault characteristics, hidden potential risks, and slow response from traditional operation and maintenance models. Existing technologies mainly rely on separate data systems, offline simulation tools, and manually-led analysis processes to analyze power grid faults and verify protection. Their core characteristic is that each link is relatively independent, relying on manual data integration and logical judgment, failing to achieve online automatic fusion and closed-loop application of data, models, and business processes. In summary, the currently widely used technical methods have the following main limitations:

[0003] 1. The problem of data silos is severe, with simulation foundations disconnected from the actual power grid. In existing technologies, real-time data from the primary power grid system, configuration and status data from the secondary system, and fault recording data are often scattered across different independent systems (such as EMS, protection information substations, and recording master stations), exhibiting heterogeneous formats and inconsistent time scales, making effective integration difficult. This results in delayed updates to model parameters, operating sections, and protection settings used in the simulation, failing to reflect the real-time operating conditions of the power grid and significantly reducing the reliability and reference value of the simulation results.

[0004] 2. Fault analysis relies on manual labor and offline tools, resulting in low efficiency and limited accuracy. Current fault analysis primarily depends on technicians manually retrieving and comparing scattered fault reports, waveforms, and setting sheets, then using offline simulation software for rough reproduction. This process is time-consuming and labor-intensive, highly dependent on expert experience, and makes it difficult to accurately trace and quantitatively analyze the internal logic and hidden defects of protection systems. Consequently, accident analysis conclusions are often imprecise, and corrective measures lack specificity.

[0005] 3. Lack of risk early warning capabilities, resulting in a passive response state for safety defense; traditional methods lack the ability to dynamically correlate real-time secondary system parameters (such as soft pressure plate status and operating setpoint range) with the primary operation mode of the power grid and perform online simulation comparison. Therefore, it is impossible to proactively assess the adaptability of protection settings under the current operating mode before a fault occurs, or to identify hidden risks caused by parameter drift, configuration errors, etc. Safety management work mainly focuses on periodic verification and post-event analysis, with insufficient proactive early warning and preventive control capabilities.

[0006] 4. The technology chain is fragmented, failing to form an automated closed-loop decision support capability. Existing tools are mostly single-function independent software or modules (such as pure simulation software and independent data management systems), with each link (data acquisition, model building, simulation calculation, and result analysis) being isolated, requiring significant manual intervention for data transfer and process coordination. This results in a long and inefficient cycle from data to simulation and then to analysis and decision-making, failing to provide real-time, online, and automated closed-loop decision support for power grid operation, and limiting the level of intelligence.

[0007] Therefore, this application is hereby submitted. Summary of the Invention

[0008] The purpose of this invention is to provide a method and device for interaction between primary and secondary simulation models based on online data, which integrates and merges real-time power grid operation data with high-fidelity simulation models to construct a data-driven, dynamically updated, and closed-loop interactive online simulation environment. This supports accurate digital mapping, real-time dynamic simulation, and online active verification of the behavior of relay protection systems, thereby effectively improving their situational awareness and proactive defense capabilities.

[0009] The above-mentioned technical objective of the present invention is achieved through the following technical solution:

[0010] Firstly, this application provides a method for interactive primary and secondary simulation models based on online data, comprising the following specific steps:

[0011] Data on power grid operation is obtained from the production control systems of various power grids, and the data is cleaned and aligned.

[0012] Obtain the current simulation requirements and execute the corresponding simulation mode based on the processed power grid operation data. The simulation mode includes simulation inversion and simulation early warning, wherein:

[0013] Simulation inversion is used to reproduce accident scenarios and trace the causes of events; simulation early warning is used to identify weak links in the operation of the power grid system in order to proactively manage risks.

[0014] Analyze the simulation results of simulation inversion and / or simulation early warning, and generate reports and rectification suggestions and / or early warning handling strategies and preventive maintenance work orders based on the analysis results.

[0015] Based on the above technical solution, the present invention can be further improved as follows.

[0016] Furthermore, the above interaction method is implemented based on an interaction system, which includes:

[0017] The data layer is used to acquire power grid operation data and perform data cleaning and alignment on the power grid operation data; the power grid operation data includes at least real-time status data of the primary power grid system and actual operation data of the secondary power grid system.

[0018] The business logic layer is used to perform online data mapping of processed power grid operation data based on the acquired simulation requirements, and to update the simulation model corresponding to the simulation requirements; it is also used to execute the corresponding simulation mode through the data-updated simulation model and obtain the simulation results.

[0019] The model layer includes a primary electromagnetic transient simulation model and a secondary electromagnetic transient simulation model. The primary electromagnetic transient simulation model performs simulation and early warning based on the real-time status data of the primary power grid system and the actual operating data of the secondary power grid system. The secondary electromagnetic transient simulation model performs simulation and inversion based on the actual operating data of the secondary power grid system and fault information.

[0020] The application layer is used to analyze simulation results and generate reports and rectification suggestions and / or early warning and preventive maintenance work orders based on the analysis results.

[0021] Furthermore, the above simulation inversion is achieved through the following steps:

[0022] The fault information is used as a boundary condition to drive the secondary electromagnetic transient simulation model. After the simulation is executed, a set of initial electrical quantity waveform data output by the model is obtained.

[0023] A residual analysis algorithm based on dynamic time warping is adopted to compare electrical quantity waveform data with actual fault recording data point by point and calculate the comprehensive residual of the two in multiple dimensions.

[0024] A sensitivity matrix is ​​constructed by combining electrical quantity waveform data with actual fault recording data, and the model parameters of the secondary electromagnetic transient simulation model are iteratively updated based on the sensitivity matrix.

[0025] The simulation continues using the updated secondary electromagnetic transient simulation model with updated model parameters until the number of iterations is reached or the comprehensive residual converges to a preset threshold.

[0026] Furthermore, the above-mentioned simulation-based early warning is achieved through the following steps:

[0027] Configure and run a primary electromagnetic transient simulation model based on real-time status data of the primary power grid system, and generate electrical quantity waveforms and protection action sequences under the benchmark scenario as a correct data reference.

[0028] The primary electromagnetic transient simulation model is dynamically updated and run using actual operating data of the power grid secondary system to generate real-time data references;

[0029] A multi-dimensional feature comparison algorithm is used to quantitatively evaluate the correct data reference and the real-time data reference to obtain the comprehensive deviation.

[0030] The overall deviation is compared with a preset adaptive threshold. When the overall deviation is not less than the adaptive threshold, an early warning is triggered and abnormal process and deviation source information are output.

[0031] Furthermore, the above analysis of the simulation results is achieved through the following steps:

[0032] Wavelet transform or spectral analysis are performed on the data in the simulation results to extract fault features;

[0033] Based on fault characteristics, fault location algorithms are used to determine the fault location.

[0034] Utilize fault location and fault characteristics to generate reports and rectification suggestions and / or form early warning and handling strategies and preventive maintenance work orders.

[0035] Furthermore, the aforementioned comprehensive residuals are specifically as follows: ,in: ; ; ; In the formula, To integrate residuals, , , The weights of the corresponding items, For amplitude residuals, For phase residual, For harmonic residuals, This is the maximum amplitude. The maximum harmonic value, This represents harmonic data in electrical quantity waveform data. This represents the harmonic data in the actual fault recording data. Indicates amplitude. Indicates phase, This indicates the total amount of data.

[0036] Furthermore, the aforementioned sensitivity matrix is ​​as follows: ; In the formula, Let be the element in the q-th row and p-th column of the sensitivity matrix. , representing the feature vector of the model parameters. The feature vector output by the model. This represents the amount of disturbance.

[0037] Furthermore, the model parameters of the secondary electromagnetic transient simulation model are iteratively updated based on the sensitivity matrix, specifically as follows: ,in: ; In the formula, This represents the model parameters after the (k+1)th update. These are the model parameters after the k-th update. Indicates the step size. For the sensitivity matrix, This represents the regularization coefficient used to ensure the invertibility of the matrix.

[0038] Furthermore, the aforementioned overall deviation is specifically as follows: ,in: ; In the formula, For the overall deviation, , , , , These are the weights of the corresponding items. Indicates the overall similarity. This indicates the characteristic deviation of the fault current. This represents the characteristic deviation of the voltage sag depth. Characteristic deviations representing the timing of protective actions. This represents a logical consistency indicator. , , The weights of the corresponding items, For amplitude similarity, For phase similarity, Indicates harmonic similarity.

[0039] Secondly, this application provides an interactive device for primary and secondary simulation models based on online data, applied to any one of the interactive methods for primary and secondary simulation models based on online data in the first aspect, comprising:

[0040] The data acquisition module is used to acquire power grid operation data from various power grid production control systems, and to perform data cleaning and alignment on the power grid operation data.

[0041] The simulation module is used to acquire the simulation requirements to be executed and to execute the corresponding simulation mode based on the processed power grid operation data. The simulation modes include simulation inversion and simulation early warning, wherein:

[0042] Simulation inversion is used to reproduce accident scenarios and trace the causes of events; simulation early warning is used to identify weak links in the operation of the power grid system in order to proactively manage risks.

[0043] The results analysis module is used to analyze the simulation results of simulation inversion and / or simulation early warning, and generate reports and rectification suggestions and / or early warning handling strategies and preventive maintenance work orders based on the analysis results.

[0044] Thirdly, this application provides an electronic device, including: at least one processor, at least one memory, and a data bus;

[0045] In this system, the processor and memory communicate with each other via a data bus; the memory stores program instructions that can be executed by the processor, and the processor calls the program instructions to execute an interactive method for primary and secondary simulation models based on online data, as described in any of the first aspects.

[0046] Fourthly, this application provides a non-transitory computer-readable storage medium that stores computer instructions, which cause the computer to execute any one of the methods for primary and secondary simulation model interaction based on online data in the first aspect.

[0047] Compared with the prior art, the present invention has at least the following beneficial effects:

[0048] 1. Improve simulation accuracy and credibility, and break down data barriers: This solution aggregates and manages real-time, historical, and fault data from the primary and secondary power grid systems through a data layer, constructing a high-quality panoramic data pool. This enables the simulation model to closely match the actual state of the power grid, ensuring the only reliable data source for simulation analysis. It can solve the problems of outdated data and disconnect from reality in traditional offline simulations, and significantly improve the realism of the simulation and the credibility of the results.

[0049] 2. Achieve accurate fault inversion and rapid cause attribution: Relying on the automated scheduling of the business logic layer and the high-precision interactive model of the model layer, the simulation inversion function can use actual fault waveform data to dynamically correct and iterate the simulation, ultimately highly reproducing the fault process; with the support of in-depth analysis at the application layer, it can not only verify the protection action behavior, but also accurately locate the root cause of the fault (such as primary equipment defects or hidden faults in the secondary system), automatically generate detailed analysis reports and rectification suggestions, greatly shorten the accident analysis time, and provide direct and quantitative decision-making basis for rapid recovery and prevention of similar events.

[0050] 3. Achieving online early warning and proactive defense against risks: Through simulation early warning functions, the system can run simulations based on the actual parameters of the current power grid, generate "real-time data references," and continuously compare and quantify them with the "correct data references" under ideal configurations. The application layer transforms this difference into a visualized risk classification early warning (such as red, orange, and yellow levels), enabling early identification of operational risks such as the adaptability and sensitivity of protection settings. This promotes the transformation of safety management from "post-event analysis" to "pre-event early warning" and "proactive defense," helping to detect potential hazards such as setting mismatch and parameter drift in advance, and automatically triggering preventive maintenance processes.

[0051] 4. Forming a complete empowerment loop from data to decision-making: The solution constructs a complete technology stack from the data layer (fuel), model layer (engine), business logic layer (scheduling) to the application layer (value presentation); this closed-loop architecture realizes full-process automation of online simulation analysis, and ultimately transforms the original scattered data into intuitive insights and decision suggestions for scheduling operation, protection setting, and equipment maintenance, significantly improving the intelligence level and operation and maintenance efficiency of power grid operation and management. Attached Figure Description

[0052] The accompanying drawings, which are included to provide a further understanding of embodiments of the invention and form part of this application, do not constitute a limitation thereof. In the drawings:

[0053] Figure 1 This is a flowchart of the interaction method in an embodiment of the present invention;

[0054] Figure 2 This is a system block diagram of the interactive system in an embodiment of the present invention;

[0055] Figure 3 This is a functional logic diagram of the simulation execution module in an embodiment of the present invention;

[0056] Figure 4 This is a schematic diagram of the simulation inversion process in an embodiment of the present invention;

[0057] Figure 5 This is a schematic diagram of the simulation early warning process in an embodiment of the present invention. Detailed Implementation

[0058] To make the objectives, technical solutions, and advantages of the embodiments of the present invention clearer, the technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. The components of the embodiments of the present invention described and shown in the accompanying drawings can generally be arranged and designed in various different configurations.

[0059] Therefore, the following detailed description of the embodiments of the invention provided in the accompanying drawings is not intended to limit the scope of the claimed invention, but merely to illustrate selected embodiments of the invention. All other embodiments obtained by those skilled in the art based on the embodiments of the invention without inventive effort are within the scope of protection of the invention.

[0060] It should be noted that similar labels and letters in the following figures indicate similar items. Therefore, once an item is defined in one figure, it does not need to be further defined and explained in subsequent figures.

[0061] In the description of the embodiments of the present invention, "multiple" means at least two.

[0062] Example 1: This example provides an interactive method for primary and secondary simulation models based on online data, such as... Figure 1 As shown, the specific steps include the following:

[0063] S1 obtains power grid operation data from various power grid production control systems and performs data cleaning and alignment on the power grid operation data.

[0064] S2, obtains the simulation requirements to be executed, and executes the simulation mode corresponding to the simulation requirements based on the processed power grid operation data. The simulation mode includes simulation inversion and simulation early warning, wherein:

[0065] Simulation inversion is used to reproduce accident scenarios and trace the causes of events; simulation early warning is used to identify weak links in the operation of the power grid system in order to proactively manage risks.

[0066] Specifically, after a single simulation is executed, a set of initial electrical quantity waveform data is output. Subsequently, a residual analysis algorithm based on dynamic time warping is started to compare the simulated waveform with the actual fault recording data point by point, and calculate the comprehensive residual between the two in multiple dimensions such as amplitude, phase and harmonic content. This residual serves as the objective function to drive a parameter correction algorithm based on the sensitivity matrix: by analyzing the sensitivity of key model parameters (such as line impedance, protection action time constant, arc model coefficient) to the output waveform, the parameter values ​​are dynamically adjusted to minimize the residual.

[0067] The above simulation inversion is achieved through the following steps:

[0068] S211 uses fault information as boundary conditions to drive a secondary electromagnetic transient simulation model. After the simulation is executed, a set of initial electrical quantity waveform data output by the model is obtained.

[0069] S212 employs a residual analysis algorithm based on dynamic time warping to compare electrical quantity waveform data with actual fault recording data point by point, and calculate the comprehensive residual of the two in multiple dimensions.

[0070] Among them, the Dynamic Time Warping (DTW) distance calculation: can be set as follows: The actual recorded sequence is Define the local distance matrix. ,in (Euclidean distance); DTW regular path satisfy Solved recursively using dynamic programming; Boundary conditions: The constraints include: Monotonicity Continuity Boundary The recursive formula is: ; The final DTW distance is: .

[0071] Furthermore, regarding Aligned waveform pairs Calculate the residuals for each dimension: Amplitude residual: ; Phase residual: ; Harmonic residuals: ;in , , The weights of the corresponding items, For amplitude residuals, For phase residual, For harmonic residuals, This is the maximum amplitude. The maximum harmonic value, This represents harmonic data in electrical quantity waveform data. This represents the harmonic data in the actual fault recording data. Indicates amplitude. Indicates phase, This represents the total amount of data; the composite residual is a weighted fusion. ; After normalization, all dimensions are dimensionless, and the weights are taken as... , , .

[0072] S213 constructs a sensitivity matrix using electrical quantity waveform data and actual fault recording data, and iteratively updates the model parameters of the secondary electromagnetic transient simulation model based on the sensitivity matrix.

[0073] Here, the model parameter vector can be set as follows: (e.g., line impedance, protection time constant, etc.), the output waveform characteristic vector is Sensitivity matrix The elements are approximated using the central difference method: ; In the formula, Let be the element in the q-th row and p-th column of the sensitivity matrix. This represents the disturbance quantity. The parameter value can be 1%-5%.

[0074] S214, the simulation continues to be performed using the updated secondary electromagnetic transient simulation model with model parameters until the number of iterations is reached or the comprehensive residual converges to the preset threshold.

[0075] Specifically, the parameters can be updated using the Levenberg-Marquardt method, and the parameter update formula is as follows: ; in, These are regularization coefficients used to ensure matrix invertibility; iterative update: ,in Step size (determined via line search); Convergence criterion: when Or waveform correlation coefficient Stop iteration when, where .

[0076] After each iteration, the model parameters are updated and the simulation is repeated until the residuals converge to a preset threshold (such as waveform similarity of more than 95% or root mean square error of less than 5%), thus completing the simulation inversion process.

[0077] Specifically, the aforementioned simulation-based early warning system is based on a pre-configured simulation model with correctly configured parameters for the secondary system. The simulation is run, and waveform data is acquired and used as a "correct data reference." During the actual early warning process, the module acquires the actual operating parameters of each protection device in the power grid in real time and dynamically updates the simulation model accordingly. The simulation is then run again to obtain a "real-time data reference" based on the actual parameters. By continuously comparing the differences between the "correct data reference" and the "real-time data reference" and conducting quantitative assessments, the identification and early warning of operational risks are ultimately achieved. The simulation-based early warning assessment and judgment process is as follows:

[0078] First, based on the correctly configured parameters of the secondary system (such as protection settings and soft pressure plate status), a simulation model is preset and generated to produce electrical quantity waveforms and protection action sequences under a benchmark scenario, serving as a "correct data reference." During actual early warning processes, the module acquires the actual operating parameters of each protection device in the power grid in real time (including the current setting range, soft pressure plate status, equipment operating conditions, etc.) and dynamically updates the simulation model to obtain a "real-time data reference." Subsequently, a multi-dimensional feature comparison algorithm is used to quantitatively evaluate the two sets of data: on the one hand, the comprehensive similarity of waveforms in amplitude, phase, and harmonic content is calculated through dynamic time warping; on the other hand, the feature values ​​of key electrical quantities (such as fault current and voltage sag depth) are extracted for deviation analysis, and the consistency of protection action logic and timing is verified. After normalization, all difference indicators are weighted and fused to form a comprehensive deviation, which is compared with a preset adaptive threshold (dynamically adjusted according to the power grid operation mode and environmental factors). When the comprehensive deviation exceeds the threshold, the system determines that there is a potential risk, triggers an early warning, and outputs abnormal links and deviation tracing information.

[0079] In this embodiment, the simulation warning can be described in the following form:

[0080] S221, configures and runs a primary electromagnetic transient simulation model based on real-time status data of the primary power grid system, generates electrical quantity waveforms and protection action sequences under the benchmark scenario, and serves as a correct data reference.

[0081] S222 uses actual operating data from the secondary power grid system to dynamically update and run the primary electromagnetic transient simulation model, generating real-time data references.

[0082] S223 employs a multi-dimensional feature comparison algorithm to quantitatively evaluate the correct data reference and the real-time data reference, thereby obtaining a comprehensive deviation.

[0083] The overall deviation is calculated using the logic consistency index, the characteristic deviation of the fault current, the characteristic deviation of the voltage sag depth, the characteristic deviation of the protection action time, and the overall similarity. The overall similarity calculation involves referencing the correct data waveform. With real-time data reference waveform The DTW algorithm can be used to calculate the overall similarity after alignment. ; in, For amplitude similarity, For phase similarity, For harmonic similarity, weight , , .

[0084] For each characteristic value deviation: extract key electrical quantity characteristics, including fault current. Voltage sag depth Protective action time The deviations for each feature are: , , .

[0085] Among them, the protection logic consistency verification: verifies the protection action logic expression. Output consistency under both configurations; can be set and Given the logical outputs (0 / 1) under the baseline configuration and the actual configuration respectively, the logical consistency metric is: ; in For Hamming distance, Total number of logical judgments; Action time coordination verification: Check whether the action times of each level of protection meet the step coordination relationship. Typical value s.

[0086] For calculating the overall deviation, the above indicators can be weighted and combined after Min-Max normalization. ; Weighting , , , , .

[0087] S224 compares the overall deviation with the preset adaptive threshold. When the overall deviation is not less than the adaptive threshold, an early warning is triggered and abnormal process and deviation source information are output.

[0088] The adaptive threshold setting mentioned above: ;in, As the baseline threshold, Correction factor for operating mode (N-1 mode) Normal operation ), Environmental correction factor (high temperature weather) ,normal ),when An alert is triggered at any time.

[0089] S3 analyzes the simulation results of simulation inversion and / or simulation early warning, and generates reports and rectification suggestions and / or early warning handling strategies and preventive maintenance work orders based on the analysis results.

[0090] The above analysis of the simulation results is achieved through the following steps:

[0091] S31. Perform wavelet transform or spectrum analysis on the data in the simulation results to extract fault features.

[0092] S32, based on fault characteristics, uses a fault location algorithm to determine the fault location.

[0093] S33, using fault location and fault characteristics to generate reports and rectification suggestions and / or form early warning handling strategies and preventive maintenance work orders.

[0094] Specifically as follows: (1) Continuous Wavelet Transform (CWT): Let the input waveform signal be The mother wavelet function is Then CWT is defined as: ; in, For scale parameters (corresponding frequencies). For translation parameters (corresponding time). This is the complex conjugate of the mother wavelet. Morlet mother wavelet is used: , where the center frequency Fault feature extraction is achieved by detecting the modulus maxima of wavelet coefficients: Let... If in scale Down, It is a local maximum and Then it is determined at time . There is a fault mutation point.

[0095] (2) Discrete Fourier Transform (DFT) and Spectrum Analysis: For the sampled sequence The DFT is defined as: ; Power spectral density (PSD) estimation uses the Welch periodogram method: the signal is divided into M overlapping segments of length L (50% overlap), a Hanning window is applied to each segment, the periodogram is calculated, and then the average is taken. ; Total Harmonic Distortion (THD) Calculation: ,in The fundamental amplitude, Let H be the amplitude of the h-th harmonic, where H is the highest number of analyses (usually H=50).

[0096] (3) Fault location algorithm (impedance method): Let the distance from the fault point F to the measuring end be d, and the impedance per unit length of the line be z = r + jx. The fault loop equation is: ; in , To measure terminal voltage and current, The fault resistor is identified; two-terminal measurement is used to eliminate it. Influence: ,in The impedance is the total length of the line. , The quantity measured at the other end; positioning error: .

[0097] Specifically, the above interaction method is implemented based on an interaction system, namely Figure 2 For the primary and secondary fusion simulation interaction interface based on online data, see [link / reference]. Figure 2 The interactive system includes:

[0098] The data layer is used to acquire power grid operation data and perform data cleaning and alignment on the power grid operation data; the power grid operation data includes at least real-time status data of the primary power grid system and actual operation data of the secondary power grid system.

[0099] Specifically, the data layer mainly aggregates and manages the following three categories of key data:

[0100] Real-time status data of the primary power grid system: This data reflects the physical connections and real-time operating conditions of the power grid and serves as the benchmark for constructing online simulation models; it mainly includes:

[0101] Network topology data: Real-time open / closed status of switching equipment such as circuit breakers and disconnectors, used to determine the real-time operation and wiring of the power grid.

[0102] Power flow section data: voltage and phase angle of each node, active and reactive power of branches, etc., used to set the initial operating point of the simulation model.

[0103] Equipment parameter data, such as line impedance, transformer turns ratio and leakage reactance, and generator transient parameters, serve as the static basis for the simulation model.

[0104] Actual operating data of the power grid secondary system: This data reflects the configuration and health status of relay protection and automatic safety devices, and serves as the direct basis for protection behavior simulation and risk assessment; it mainly includes:

[0105] Device configuration and status data: the soft pressure plate activation / deactivation status of the protection device, the hard pressure plate status (obtained through communication or auxiliary contacts), the current operating setpoint range, device self-test alarm information, etc.

[0106] Operating parameters and event data: sampled values ​​of the protection device, status of starting elements, and brief action event reports (SOE).

[0107] Power grid fault process recording data: This data records detailed electrical changes during power grid disturbances or faults and serves as the "gold standard" for comparison and correction in simulation and inversion functions. Its core is:

[0108] Fault waveform data: high sampling rate electrical quantity (voltage, current) waveform files before and after the fault, as well as the synchronous switch quantity change sequence; in addition, it also includes the associated fault briefing, which records preliminary analysis information such as fault inference components, fault type, and ranging results.

[0109] To ensure data availability and timeliness, the data layer implements the following key mechanisms:

[0110] Multi-source heterogeneous data access: Through standard protocols (such as IEC 61850 MMS, IEC 104) or dedicated interfaces, the above data can be synchronously acquired from different source systems such as energy management system (EMS), wide area measurement system (WAMS), relay protection fault information management system, and waveform recorder master station to achieve intelligent access.

[0111] The intelligent access process is as follows: By dynamically parsing the source description file (such as ICD / SCD or protocol template), it automatically identifies the data type and timing characteristics, and allocates acquisition threads and buffer queues with different priorities according to real-time requirements; at the same time, it integrates a breakpoint resumption and compensation mechanism, recording the breakpoint when the network is interrupted or the source is abnormal, and automatically retransmitting the missing data after recovery. This process effectively solves the compatibility and reliability problems of multi-source data access, providing a complete and real-time data foundation for upper-layer simulation.

[0112] Data cleaning and alignment: The raw data undergoes quality verification (such as removing bad data), timestamp alignment (unifying to the same time base, such as BeiDou / GPS time scale), and correlation integration to form a standardized data set that is consistent in the three dimensions of time, space, and object.

[0113] The specific process of data cleaning and alignment is as follows:

[0114] 1. For data alignment, firstly, normalize each source timestamp to the UTC reference and correct clock drift and delay deviation;

[0115] 2. Subsequently, a dynamic sliding window is used to correlate and match electrical quantities, equipment status, and setpoint data within the same time segment. Data with inconsistent sampling frequencies are resampled to a unified time grid through linear interpolation or Lagrange interpolation.

[0116] 3. Finally, based on the event sequence and topology changes, a temporal consistency check is performed to eliminate logically contradictory data, thereby ensuring the spatiotemporal consistency data foundation required for primary and secondary fusion simulations.

[0117] For data cleaning: 1. First, extract semantic features from the data description fields, construct device-signal-attribute triple feature vectors, and calculate semantic similarity based on edit distance, word vector models, or domain dictionaries to automatically establish cross-source mapping relationships; 2. At the same time, normalize the device states expressed differently (such as "separated / combined", "0 / 1") to a unified enumeration value, and perform outlier detection and correction based on historical distribution and physical constraint rules, thereby eliminating the semantic heterogeneity of multi-source data and ensuring that the data received by the simulation model has both semantic and numerical accuracy and consistency.

[0118] In this data layer, a hybrid storage architecture combining time-series databases, relational databases, and file systems is adopted to optimize the storage of real-time cross-sectional data, configuration relational data, and massive waveform files, respectively. At the same time, a unified, high-performance data query and access application programming interface (API) is provided for the business logic layer.

[0119] By constructing this panoramic data pool covering the primary and secondary systems of the power grid and spanning steady-state and transient processes, and implementing strict data governance, the data layer provides accurate, synchronous, and reliable "data fuel" for the upper-level simulation. It ensures that the simulation model closely matches the actual state of the power grid, provides a reliable comparison benchmark for simulation inversion, and allows simulation early warning to be based on real operating data, which is the premise for the entire method to achieve accurate analysis.

[0120] The aforementioned interactive system also includes:

[0121] The business logic layer is used to perform online data mapping of processed power grid operation data based on the acquired simulation requirements, and to update the simulation model corresponding to the simulation requirements; it is also used to execute the corresponding simulation mode through the data-updated simulation model and obtain the simulation results.

[0122] Specifically, the business logic layer, as the core hub of system function scheduling, achieves fully automated management of the entire process from initialization and simulation execution to exception handling and resource release. Its specific structure and operating mechanism are as follows:

[0123] 1. Initialization Phase; This phase is mainly responsible for building a usable online simulation model. Specific steps include:

[0124] (1) Instantiate the basic offline simulation model object from the model layer;

[0125] (2) Obtain real-time power grid status information (such as primary system power flow data, circuit breaker and disconnector status, and secondary system protection settings) from the data layer and parse it; the specific process is as follows: After receiving the simulation request, obtain the primary system power flow data, switchgear status, and secondary system protection settings and soft switch status in batches from the time-series database, relational database, and file system through the data access API. Then, according to the original data format (such as JSON, QS file, IEC 61850 report, etc.), call the corresponding parser to normalize the format and convert it into an internal unified data structure; then, based on the pre-established device mapping table, map the data layer identifier to the globally unique identifier of the simulation model and unify the status description of different source ends; finally, perform logical verification on the parsed data (such as the consistency of the correlation between circuit breaker status and current, and the rationality of the setting range) to ensure that the data is accurate and write it synchronously into the simulation model driver update.

[0126] (3) Use the above real-time data to update the offline primary and secondary simulation model objects, thereby generating an online simulation model object that conforms to the current actual operating state of the power grid.

[0127] 2. Simulation execution module, such as Figure 3 As shown, this module, based on the requirements issued by the application layer, first parses the mode identifier in the request (such as the GET / POST method of HTTP or the "mode" field in the request parameters) and automatically identifies the simulation mode to be executed—simulation inversion or simulation early warning. If it is identified as the inversion mode, the inversion logic module is scheduled to backtrack the power grid state based on historical fault data and drive high-fidelity electromagnetic transient simulation. If it is the early warning mode, the early warning logic module is called to perform forward-looking extrapolation calculations on potential fault scenarios based on real-time online data.

[0128] After the simulation is completed, the results data (such as electrical quantity waveforms and protection action information) are standardized and encapsulated (e.g., converted to COMTRADE format) and returned to the application layer through a unified return interface for more in-depth visualization and fault diagnosis by third-party professional analysis software; its overall functional logic is as follows: Figure 3 As shown, receiving user requests refers to the simulation execution module receiving simulation request commands from users through network communication protocols; determining the function module to be executed refers to determining whether the simulation execution module should perform simulation inversion or simulation early warning based on the protected parameter information in the user simulation request; then, the simulation execution module drives the simulation model in the model layer through API to perform simulation inversion or simulation early warning.

[0129] The simulation inversion process begins with an actual fault occurring in the power grid. The module first parses the fault information (including faulty components, location, type, and duration) obtained from the data layer and uses it as boundary conditions to drive the high-fidelity electromagnetic transient simulation model.

[0130] Furthermore, the business logic layer can also include exception handling and resource management functions. This involves monitoring and handling exceptions generated throughout the simulation process, from initialization to execution, as well as automatically releasing resources, as detailed below:

[0131] Exception Handling: A unified exception interception layer based on decorators was constructed, implementing a layered capture strategy. This serves as the first line of defense for system exception handling. The unified exception interception layer automatically captures various exceptions occurring during interface calls using Python decorators, including system-level exceptions (such as memory overflow, file read / write errors), data access exceptions (such as database connection timeouts, query failures), and simulation platform communication exceptions (such as CloudPSS interface call timeouts, incorrect return formats). Captured exceptions are standardized and encapsulated, converted into unified error codes and error message formats, and written to the log system according to exception type. Based on this, the business logic layer implements fine-grained exception handling and recovery logic for specific scenarios such as simulation initialization, data parsing, simulation execution, and result persistence. For example, it automatically retryes when simulation execution fails, rolls back to the previous state when data parsing exceptions occur, and enables local caching when database connections are interrupted. This layered capture strategy achieves separation of responsibilities in exception handling: the unified interception layer is responsible for centralized exception capture and initial processing, while the business logic layer is responsible for scenario-based recovery and compensation, effectively ensuring continuous system operation and data consistency, and preventing system-wide crashes caused by local exceptions.

[0132] Resource Release: Utilizing the decorator pattern, unified performance data collection is performed on key interfaces and methods. The execution time, resource usage, and call frequency of each functional module (such as data parsing and simulation calculation) are automatically recorded, generating structured performance logs and automatically releasing resources to prevent excessive memory consumption during multiple simulations.

[0133] Specifically, the core objectives of simulation inversion are reproduction and attribution, namely, the reproduction of the accident scenario and the tracing of the cause of the event. The application layer analyzes the inversion results, aiming to answer "how exactly did the failure occur" and "how to prevent similar events from happening again"; such as Figure 4As shown, specifically, this analysis first performs a precise verification of the fault action behavior. The action sequence and characteristics (such as impedance trajectory and current change rate) of the protection device, which closely match the actual waveform recording obtained from the inversion, are compared with the device's own action report and setting sheet. This not only verifies the correctness of the action but also accurately locates hidden defects or unreasonable setting settings. Based on this, a high-precision model after correction is used to deeply trace the entire fault development process, quantitatively analyze influencing factors such as system oscillations and power flow transfer, and identify whether the root cause of the fault is primary equipment insulation degradation or secondary system problems such as secondary circuit wiring errors or CT / PT transmission abnormalities. Finally, a structured inversion analysis report and rectification suggestions are automatically or assisted to generate. The report covers a panoramic reconstruction of the fault process, action behavior evaluation, key electrical quantity comparison curves, and model parameter correction records. Based on this, clear operational suggestions, setting adjustment schemes, or equipment maintenance plans are proposed, thus providing direct and quantitative decision-making basis for accident investigation and subsequent rectification.

[0134] Specifically, the core objective of simulation-based early warning is foresight and prevention. The application layer's analysis of early warning results aims to shift from passive response to proactive defense, actively managing risks by identifying weaknesses in system operation; such as... Figure 5 Specifically, the process begins with visualizing and tiered early warning of operational risks. Differences between "correct data reference" and "real-time data reference" in terms of action time, protection range, and sensitivity are quantified and scored. These differences are then visualized using color-coded levels (red, orange, yellow, etc.) based on the power grid's geographical wiring diagram or single-line diagram, enabling dispatch and maintenance personnel to intuitively and quickly grasp the risk distribution of the entire network's secondary systems. Building upon this, the adaptability of protection settings is assessed and optimized. When significant changes occur in operating conditions or load characteristics, the adaptability of existing settings under new operating conditions is evaluated in batches. The analysis results... It can be directly used to guide online verification or as input for setting optimization calculations, thereby ensuring that the selectivity, speed, and sensitivity of protection actions are always at their best. Furthermore, the system can automatically generate early warning and handling strategies and preventive maintenance work orders for identified high-risk points. For example, for protections with setting drift risk, prompts can be sent to "strengthen monitoring" or "plan verification", and for protections with parameter mismatch, prompts can be sent to "check and synchronize settings". These strategies can be linked to the production management system (PMS) and trigger corresponding preventive maintenance or defect elimination processes, ultimately forming a complete defense system from risk identification, assessment, handling to closed-loop management.

[0135] The aforementioned interactive system also includes:

[0136] The model layer includes a primary electromagnetic transient simulation model and a secondary electromagnetic transient simulation model. The primary electromagnetic transient simulation model performs simulation and early warning based on the real-time status data of the primary power grid system and the actual operating data of the secondary power grid system. The secondary electromagnetic transient simulation model performs simulation and inversion based on the actual operating data of the secondary power grid system and fault information.

[0137] Among them, the model layer is the core computing foundation of the entire simulation system, responsible for providing high-precision, modular, and interactive simulation model objects of primary and secondary equipment in substations. These models are not only static equipment descriptions, but also functional units with dynamic simulation capabilities, which can accurately simulate the physical behavior and logical actions of real equipment under power grid faults or disturbances, providing a reliable computing engine for simulation inversion and early warning analysis of the upper layer (business logic layer).

[0138] The model layer mainly consists of the following two categories of simulation models:

[0139] Primary system simulation model: Used to simulate the main electrical equipment and the physical network involved in power generation, transmission, and distribution in a power grid. Typical primary model objects established in this system include:

[0140] Energy transmission components: such as transformers (including windings and taps on each side), transmission lines (using π-type equivalent or distributed parameter models), and busbars.

[0141] Switching control components: such as circuit breakers (including arc extinguishing characteristics) and disconnect switches.

[0142] Measurement and compensation components: such as voltage transformers (PT), current transformers (CT), voltmeters, ammeters, parallel capacitors, and parallel reactors.

[0143] System equivalent model: such as Thevenin or Norton equivalent voltage sources for external systems, used to simplify boundary systems and focus on the simulation at this station.

[0144] Fault Model: It can simulate various types of short circuit faults (such as single-phase grounding, two-phase short circuit, three-phase short circuit) and open circuit faults, and supports setting parameters such as fault resistance and fault location.

[0145] Secondary system simulation model: used to simulate the measurement, logic judgment, and output action behavior of secondary equipment such as relay protection and automatic devices. Typical secondary model objects established in this system include:

[0146] Line protection models include: distance protection (including impedance elements, directional elements, and oscillation blocking logic), longitudinal differential protection, and zero-sequence current protection.

[0147] Transformer protection models include differential protection (including harmonic restraint logic), gas protection, overcurrent protection, and overexcitation protection.

[0148] Busbar protection model: such as busbar differential protection.

[0149] Component protection models: such as capacitor protection (overvoltage, undervoltage, unbalanced current), reactor protection.

[0150] Circuit breaker protection and operation box model: simulates circuit breaker failure protection, three-phase inconsistency protection and trip / close circuit.

[0151] General-purpose functional modules, such as signal input / output modules, logic AND / OR / NOT gates, time relays, signal reset modules, etc., are used to construct complex protection logic.

[0152] To achieve the online simulation and inversion correction functions described in the business logic layer, the model layer design has the following key features:

[0153] Parameterization and Dynamic Updating: All key parameters of the model (such as transformer impedance, line parameters, protection settings, time constants, etc.) are encapsulated as externally accessible and modifiable attributes. This enables the business logic layer to dynamically refresh the model state based on real-time data or inversion requirements, achieving the transformation from an "offline general model" to an "online accurate model".

[0154] Signal-level interaction and closed-loop simulation: The primary and secondary models interact in a closed loop through simulated electrical signals (voltage, current) and switching signals (trip, close, input). For example, the primary line fault model generates fault current and voltage, which are acquired by the CT / PT input module of the secondary protection model. After logical calculation, the protection model issues a trip command, driving the primary circuit breaker model to disconnect, thereby changing the primary network topology and forming a complete dynamic simulation closed loop of "fault-measurement-judgment-action-grid change".

[0155] Standardized Interfaces and API-Driven Approach: The model layer provides a unified application programming interface (API) to the outside world; the simulation execution module of the business logic layer drives the model to run, inject parameters, and obtain simulation waveform data by calling these APIs (such as Model.Run(), Model.SetParameter(), Model.GetOutput()), thereby realizing the automated scheduling of the simulation process.

[0156] By constructing this complete, accurate, and open primary and secondary simulation model library and establishing its dynamic interaction mechanism, the model layer provides a powerful and flexibly configurable "digital twin" simulation environment for upper-layer applications. It is the fundamental cornerstone for realizing a series of advanced application functions such as accurate fault inversion and online risk early warning.

[0157] The aforementioned interactive system also includes:

[0158] The application layer is used to analyze simulation results and generate reports and rectification suggestions and / or early warning and preventive maintenance work orders based on the analysis results.

[0159] This layer serves as the interface between the system and end users (such as power grid dispatchers, protection specialists, and maintenance personnel), and is the final link in realizing the value of simulation. Its core task is not to repeat simulation calculations, but to conduct in-depth analysis, visualization, and decision support on the simulation results generated by the business logic layer after verification or comparison. Ultimately, the analysis conclusions are used to guide the actual operation, maintenance, and management of the power grid, including two parts: application analysis of simulation inversion results and application analysis of simulation early warning results.

[0160] Specifically, after completing the above simulation function logic, the simulation results are structured, encapsulated, and standardized for output, and returned to the application layer for third-party software to perform more refined analysis. Simulation results (analog quantities, digital quantities, and simulation logs after simulation) are also returned to the application layer for further analysis by third-party software. The returned data includes three main categories of information: analog data (such as the time-series waveforms of voltages at each node and branch currents, as well as characteristic quantities such as harmonic content and transient overvoltages), digital data (such as the action sequence of protection devices, changes in the opening and closing states of circuit breakers, alarm signals, and event sequence records), and simulation logs (including simulation parameter configurations, model call records, iterative convergence processes, and anomaly information). To meet the needs of refined analysis, all waveform data is uniformly converted to the standard COMTRADE format, while digital quantities and logs are output in JSON or XML structured formats to ensure seamless integration with mainstream third-party analysis tools (such as fault diagnosis systems, visualization platforms, and relay protection action behavior analysis software). The application layer can conduct multi-dimensional in-depth analysis based on this data: for example, performing wavelet transform or spectrum analysis on the waveform to extract fault characteristics; comparing the consistency between the protection action timing and setting logic; or combining the power grid topology to locate faults and extrapolate the scope of impact.

[0161] Example 2: This application provides an interactive device for primary and secondary simulation models based on online data, applied to the interactive method for primary and secondary simulation models based on online data in Example 1, including:

[0162] The data acquisition module is used to acquire power grid operation data from various power grid production control systems, and to perform data cleaning and alignment on the power grid operation data.

[0163] The simulation module is used to acquire the simulation requirements to be executed and to execute the corresponding simulation mode based on the processed power grid operation data. The simulation modes include simulation inversion and simulation early warning, wherein:

[0164] Simulation inversion is used to reproduce accident scenarios and trace the causes of events; simulation early warning is used to identify weak links in the operation of the power grid system in order to proactively manage risks.

[0165] The results analysis module is used to analyze the simulation results of simulation inversion and / or simulation early warning, and generate reports and rectification suggestions and / or early warning handling strategies and preventive maintenance work orders based on the analysis results.

[0166] Example 3: This application provides an electronic device, including: at least one processor, at least one memory, and a data bus;

[0167] In this system, the processor and memory communicate with each other via a data bus; the memory stores program instructions that can be executed by the processor, and the processor calls the program instructions to execute an interactive method for primary and secondary simulation models based on online data, as described in Example 1.

[0168] Example 4: This application provides a non-transitory computer-readable storage medium that stores computer instructions, which cause the computer to execute a primary and secondary simulation model interaction method based on online data, as described in Example 1.

[0169] Those skilled in the art will understand that embodiments of this application can be provided as methods, systems, or computer program products. Therefore, this application can take the form of a completely hardware embodiment, a completely software embodiment, or an embodiment combining software and hardware aspects. Furthermore, this application can take the form of a computer program product embodied on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.

[0170] This application is described with reference to flowchart illustrations and / or block diagrams of methods, apparatus (systems), and computer program products according to embodiments of this application. It will be understood that each block of the flowchart illustrations and / or block diagrams, and combinations of blocks in the flowchart illustrations and / or block diagrams, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, special-purpose computer, embedded processor, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, generate instructions for implementing the flowchart... Figure 1 One or more processes and / or boxes Figure 1 A device that provides the functions specified in one or more boxes.

[0171] These computer program instructions may also be stored in a computer-readable storage medium that can direct a computer or other programmable data processing device to function in a particular manner, such that the instructions stored in the computer-readable storage medium produce an article of manufacture including instruction means, which are implemented in a process Figure 1 One or more processes and / or boxes Figure 1 The function specified in one or more boxes.

[0172] These computer program instructions may also be loaded onto a computer or other programmable data processing equipment to cause a series of operational steps to be performed on the computer or other programmable equipment to produce a computer-implemented process, thereby providing instructions that execute on the computer or other programmable equipment for implementing the process. Figure 1 One or more processes and / or boxes Figure 1 The steps of the function specified in one or more boxes.

[0173] Those skilled in the art will understand that all or part of the steps in the above facts and methods can be implemented by a program instructing related hardware. The program or the program described therein can be stored in a computer-readable storage medium. When the program is executed, it includes the following steps: at this time, the corresponding method steps are introduced. The storage medium can be ROM / RAM, magnetic disk, optical disk, etc.

[0174] The specific embodiments described above further illustrate the purpose, technical solution, and beneficial effects of the present invention. It should be understood that the above description is only a specific embodiment of the present invention and is not intended to limit the scope of protection of the present invention. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of the present invention should be included within the scope of protection of the present invention.

Claims

1. A method for interactive primary and secondary simulation models based on online data, characterized in that, The specific steps include the following: Power grid operation data is obtained from the production control systems of various power grids, and the power grid operation data is cleaned and aligned. Obtain the simulation requirements to be executed, and execute the simulation mode corresponding to the simulation requirements based on the processed power grid operation data. The simulation mode includes simulation inversion and simulation early warning, wherein: The simulation inversion is used to reproduce accident scenarios and trace the causes of events; the simulation early warning is used to identify weak links in the operation of the power grid system in order to proactively manage risks. The simulation results of the simulation inversion and / or the simulation early warning are analyzed, and a report and rectification suggestions and / or an early warning handling strategy and preventive maintenance work order are generated based on the analysis results.

2. The interactive method for primary and secondary simulation models based on online data according to claim 1, characterized in that, The interaction method is implemented based on an interaction system, which includes: The data layer is used to acquire the power grid operation data and perform data cleaning and alignment on the power grid operation data; the power grid operation data includes at least real-time status data of the primary power grid system and actual operation data of the secondary power grid system. The business logic layer is used to perform online data mapping of the processed power grid operation data based on the acquired simulation requirements, and to update the simulation model corresponding to the simulation requirements; it is also used to execute the corresponding simulation mode through the data-updated simulation model and obtain the simulation results. The model layer includes a primary electromagnetic transient simulation model and a secondary electromagnetic transient simulation model. The primary electromagnetic transient simulation model performs the simulation warning based on the real-time status data of the primary power grid system and the actual operating data of the secondary power grid system. The secondary electromagnetic transient simulation model performs the simulation inversion based on the actual operating data of the secondary power grid system and fault information. The application layer is used to analyze simulation results and generate reports and rectification suggestions and / or early warning and preventive maintenance work orders based on the analysis results.

3. The interactive method for primary and secondary simulation models based on online data according to claim 2, characterized in that, The simulation inversion is achieved through the following steps: The fault information is used as a boundary condition to drive the secondary electromagnetic transient simulation model. After the simulation is executed, a set of initial electrical quantity waveform data output by the model is obtained. A residual analysis algorithm based on dynamic time warping is adopted to compare electrical quantity waveform data with actual fault recording data point by point and calculate the comprehensive residual of the two in multiple dimensions. A sensitivity matrix is ​​constructed by combining electrical quantity waveform data with actual fault recording data, and the model parameters of the secondary electromagnetic transient simulation model are iteratively updated based on the sensitivity matrix. The simulation continues using the updated secondary electromagnetic transient simulation model with updated model parameters until the number of iterations is reached or the comprehensive residual converges to a preset threshold.

4. The interactive method for primary and secondary simulation models based on online data according to claim 2, characterized in that, The simulation early warning is achieved through the following steps: Configure and run the primary electromagnetic transient simulation model based on the real-time status data of the primary power grid system, and generate electrical quantity waveforms and protection action sequences under the benchmark scenario as a correct data reference. The primary electromagnetic transient simulation model is dynamically updated and run using the actual operating data of the power grid secondary system to generate real-time data reference. A multi-dimensional feature comparison algorithm is used to quantitatively evaluate the correct data reference and the real-time data reference to obtain a comprehensive deviation. The overall deviation is compared with a preset adaptive threshold. When the overall deviation is not less than the adaptive threshold, an early warning is triggered and abnormal process and deviation source information are output.

5. The interactive method for primary and secondary simulation models based on online data according to claim 1, characterized in that, The simulation results are analyzed through the following steps: Wavelet transform or spectral analysis is performed on the data in the simulation results to extract fault features; Based on the aforementioned fault characteristics, the fault location is determined using a fault location algorithm. The fault location and fault characteristics are used to generate reports and rectification suggestions and / or form early warning and handling strategies and preventive maintenance work orders.

6. The interactive method for primary and secondary simulation models based on online data according to claim 3, characterized in that, The comprehensive residual is specifically: ,in: ; ; ; In the formula, To integrate residuals, , , The weights of the corresponding items, For amplitude residuals, For phase residual, For harmonic residuals, This is the maximum amplitude. The maximum harmonic value, This represents harmonic data in electrical quantity waveform data. This represents the harmonic data in the actual fault recording data. Indicates amplitude. Indicates phase, This indicates the total amount of data.

7. The interactive method for primary and secondary simulation models based on online data according to claim 3, characterized in that, The sensitivity matrix is ​​specifically as follows: ; In the formula, Let be the element in the q-th row and p-th column of the sensitivity matrix. , representing the feature vector of the model parameters. The feature vector output by the model. This represents the amount of disturbance.

8. The interactive method for primary and secondary simulation models based on online data according to claim 3, characterized in that, The model parameters of the secondary electromagnetic transient simulation model are iteratively updated based on the aforementioned sensitivity matrix, specifically as follows: ,in: ; In the formula, This represents the model parameters after the (k+1)th update. These are the model parameters after the k-th update. Indicates the step size. For the sensitivity matrix, This represents the regularization coefficient used to ensure the invertibility of the matrix.

9. The interactive method for primary and secondary simulation models based on online data according to claim 4, characterized in that, The comprehensive deviation is specifically as follows: ,in: ; In the formula, For the overall deviation, , , , , These are the weights of the corresponding items. Indicates the overall similarity. This indicates the characteristic deviation of the fault current. This represents the characteristic deviation of the voltage sag depth. Characteristic deviations indicating the timing of protective actions. This represents a logical consistency indicator. , , The weights of the corresponding items, For amplitude similarity, For phase similarity, Indicates harmonic similarity.

10. An interactive device for primary and secondary simulation models based on online data, characterized in that, include: The data acquisition module is used to acquire power grid operation data from various power grid production control systems, and to perform data cleaning and data alignment on the power grid operation data. The simulation module is used to acquire the simulation requirements to be executed and to execute the simulation mode corresponding to the simulation requirements based on the processed power grid operation data. The simulation mode includes simulation inversion and simulation early warning, wherein: The simulation inversion is used to reproduce accident scenarios and trace the causes of events; the simulation early warning is used to identify weak links in the operation of the power grid system in order to proactively manage risks. The results analysis module is used to analyze the simulation results of the simulation inversion and / or the simulation early warning, and to generate reports and rectification suggestions and / or early warning handling strategies and preventive maintenance work orders based on the analysis results.