Training method of frequency security analysis system with semantic knowledge fusion and application thereof
Patent Information
- Application Number
- CN202611227995.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2026-08-13
- Publication Date
- 2026-10-16
AI Technical Summary
[0003]现有时域仿真能够准确建模扰动后的动态过程,但在海量预想扰动扫描中计算负担较重;平均系统频率(average system frequency, ASF)、系统频率响应(systemfrequency response, SFR)等效物理模型尽管计算简单,但是由于简化建模,无法准确反映新能源电力电网的复杂频率响应动态机理;数据驱动方法尽管具有快速非线性映射能力,但通常主要使用潮流、扰动和系统参数的数值特征,难以充分表征新能源电力电网的复杂频率响应动态,导致频率安全指标预测精度低
本发明将电气特征的数值、物理含义和单位量纲统一编码,并进一步引入相对运行状态和方向性作用关系,使频率安全分析不再仅依据数值大小进行映射,能够更完整地表征引入新能源的低惯量电网的复杂频率响应特性;而且,本发明采用统一语义模板和大语言模型嵌入方式将难以直接公式化的物理机理和运行经验转化为连续、可学习的语义特征矩阵,为频率安全预测提供不完全依赖瞬时量测数值的稳定先验,从而提高预测准确性,并减缓量测噪声和状态估计偏差造成的性能退化。因此,基于本发明所提方法,可以对新能源电力电网的频率安全指标进行快速准确地预测。
Smart Images

Figure CN122926015A_ABST
Abstract
Description
Technical Field
[0001] This invention belongs to the field of smart grid related technology, and more specifically, relates to a training method and application of a frequency security analysis system that integrates semantic knowledge. Background Technology
[0002] With the large-scale integration of new energy sources, existing large-scale power grids are rapidly evolving into low-inertia grids. Due to the significant reduction in the equivalent inertia and weakened frequency support capacity of new energy power systems, the rate of frequency change after disturbances increases dramatically—this directly reflects the degree of system inertia loss, used to quickly determine the magnitude of the disturbance power gap and trigger emergency control. Simultaneously, the uncertainty of the frequency minimum point deviation increases—it marks the deepest trough of frequency drop during transient processes, directly determining whether low-frequency load shedding or unit protection action thresholds will be triggered. Furthermore, the volatility of the quasi-steady-state frequency deviation also intensifies—this indicator reflects the balance accuracy of active power recovery after primary frequency regulation and load shedding measures, used to verify whether the system can stabilize within a safe operating range. To ensure grid safety, operators must conduct a comprehensive analysis of the above three frequency safety indicators based on the current steady-state operating mode before disturbances occur, thereby assisting in the formulation of reasonable operating mode adjustment plans and preventative control strategies.
[0003] Existing time-domain simulations can accurately model the dynamic process after disturbances, but the computational burden is heavy in the massive scanning of anticipated disturbances. Although the equivalent physical models of average system frequency (ASF) and system frequency response (SFR) are computationally simple, they cannot accurately reflect the complex frequency response dynamic mechanism of new energy power grids due to the simplification of modeling. Although data-driven methods have the ability to quickly map nonlinear data, they usually mainly use the numerical characteristics of power flow, disturbances and system parameters, which are difficult to fully characterize the complex frequency response dynamics of new energy power grids, resulting in low prediction accuracy of frequency security indicators.
[0004] Therefore, how to quickly and accurately predict the frequency security indicators of new energy power grids is a technical problem that urgently needs to be solved. Summary of the Invention
[0005] In view of the above-mentioned defects or improvement needs of the existing technology, the present invention provides a training method and its application for a frequency security analysis system for new energy power grids, the purpose of which is to quickly and accurately predict the frequency security indicators of new energy power grids.
[0006] To achieve the above objectives, this invention is proposed.
[0007] According to a first aspect of the present invention, a training method for a frequency security analysis system incorporating semantic knowledge is provided, comprising: Obtain sample data; different sample data represent the nodal electrical parameters of the new energy power grid under different operating conditions. System global parameters and frequency security indicators under disturbances. Node electrical parameters include node disturbance parameters and node power flow parameters under stable operating conditions before the disturbance is applied; system global parameters cover the grid's system inertia, system damping, system active power reserve, and system renewable energy penetration rate; i is the sample index, h is the node index, k is the index for node electrical parameter types, m is the index for system global parameter types, and m is the index for frequency safety index types. Node electrical parameters Constructed as a physical semantic template ;template To make parameters Convert it into a text description that includes at least the node location, parameter name, parameter value, unit of value, and the physical meaning of the parameter response; System global parameters Construct as a scene semantic template ,template To make parameters Convert to a text description that includes at least the parameter name, parameter value, and relative status level of the parameter; convert system global parameters The m-th type of frequency security index is jointly constructed as a directional semantic template. ,template To make parameters The m-th type of frequency security indicator is converted into a text description that includes at least the parameter name, the relative state level of the parameter, the indicator name, and the positive or negative effect of changes in the k-th type of system global parameters on the m-th type of frequency security indicator; each type of system global parameter has multiple parameter value ranges, with larger values indicating higher relative state levels, and the parameters are judged... The parameter range in which it is located determines its relative state level; physical semantic template Scene semantic template and directional semantic templates Each input is processed into a large language model and mapped to a continuous semantic vector, resulting in a node-level semantic matrix for each sample. System-level semantic matrix and frequency security prior semantic matrix ; With matrix , , The neural network is trained using the input, and training ends when the similarity loss between the frequency security index predicted by the neural network and the frequency security index in the sample converges to a preset level. The trained neural network is then used as the frequency security analysis system.
[0008] According to a second aspect of the present invention, a frequency security analysis method incorporating semantic knowledge is provided, comprising: Obtain the node electrical parameters and system global parameters of the new energy power grid under the current operating conditions; The electrical parameters of the current node are constructed into a physical semantic template, and the global parameters of the system are constructed into a scene semantic template and a directional semantic template. The physical semantic template, scene semantic template and directional semantic template are respectively input into the large language model to be mapped into continuous semantic vectors, and the node-level semantic matrix, system-level semantic matrix and frequency safety prior semantic matrix under the current working condition are obtained one by one. The node-level semantic matrix, system-level semantic matrix, and frequency security prior semantic matrix are input into the frequency security analysis system trained by the above training method to predict and output the frequency security index under the current operating conditions of the power grid.
[0009] In summary, compared with the prior art, the technical solutions conceived in this invention have the following main advantages: This invention unifies the encoding of the numerical values, physical meanings, and unit dimensions of electrical characteristics, and further introduces relative operating states and directional action relationships. This allows frequency security analysis to go beyond simply mapping numerical values, enabling a more complete characterization of the complex frequency response characteristics of low-inertia power grids incorporating new energy sources. Furthermore, this invention employs a unified semantic template and a large language model embedding approach to transform physical mechanisms and operational experiences that are difficult to directly formulate into continuous, learnable semantic feature matrices. This provides stable priors for frequency security prediction that are not entirely dependent on instantaneous measurement values, thereby improving prediction accuracy and mitigating performance degradation caused by measurement noise and state estimation bias. Therefore, based on the method proposed in this invention, frequency security indicators for new energy power grids can be predicted quickly and accurately. Attached Figure Description
[0010] Figure 1 This is a flowchart of the training method of a frequency security analysis system that integrates semantic knowledge according to an embodiment of the present invention.
[0011] Figure 2 This is a schematic diagram of constructing three types of matrices in one embodiment of the present invention.
[0012] Figure 3 This is a schematic diagram of constructing three types of matrices in one embodiment of the present invention.
[0013] Figure 4It is an improved network topology diagram of the IEEE 39-node system.
[0014] Figure 5 This is a statistical graph showing the prediction performance of the method of the present invention under different noise levels. Detailed Implementation
[0015] To make the objectives, technical solutions, and advantages of this invention clearer, the invention will be further described in detail below with reference to the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are merely illustrative and not intended to limit the invention. Furthermore, the technical features involved in the various embodiments of this invention described below can be combined with each other as long as they do not conflict with each other.
[0016] Considering that the frequency response of low-inertia power grids is related not only to the characteristic values, but also to the physical meaning, unit dimensions, relative operating state, and direction of action of the characteristics. For example, the same inertia value may correspond to different safety margins in power grids of different sizes; the directions of action of inertia, damping, active power reserve, and renewable energy penetration rate on different frequency safety indicators are also not entirely the same. This knowledge usually exists in unstructured or semi-structured form, making it difficult to directly use as model input. While fixed rules, fuzzy membership degrees, or discrete coding can achieve a certain degree of quantization, they require designing mapping rules for different knowledge items and are difficult to preserve the correlation between knowledge items. Based on this, the following technical solution of this invention is proposed.
[0017] Example 1: This invention provides a training method for a frequency security analysis system that integrates semantic knowledge, such as... Figure 1 The diagram shows a flowchart of the training method for a frequency security analysis system that integrates semantic knowledge according to an embodiment of the present invention. The following is a summary of the steps. Figure 1 This method is described in detail.
[0018] S1. Obtain sample data. Different sample data represent the nodal electrical parameters of the new energy power grid under different operating conditions. System global parameters and frequency security indicators under disturbances. .
[0019] Node electrical parameters include node disturbance parameters and node power flow parameters under stable operating conditions of the grid before the disturbance is applied; system global parameters cover the grid's system inertia, system damping, system active power reserve, and system renewable energy penetration rate; i is the sample index, and h is the node index. is the node electrical parameter type index, k is the system global parameter type index, and m is the frequency safety index type index.
[0020] Specifically, this involves acquiring power flow parameters, global system parameters, disturbance parameters, and prior frequency security knowledge of the new energy power grid under different operating conditions, and constructing different sample data. Power flow parameters include the power flow parameters of each node in the stable operating state of the grid before the disturbance is applied, including the generation power, load power, and bus voltage information of the corresponding node. Disturbance data includes the disturbance parameters of each node when a disturbance is applied to the grid. Global system parameters include the grid's system inertia, system damping, system active power reserve, and system new energy penetration rate. Prior frequency security knowledge includes the grid's system frequency security indicators after the disturbance is applied.
[0021] Specifically, the operating conditions of the power grid can be changed by altering its steady-state operation mode or by changing the disturbance mode. Changing the steady-state operation mode can involve altering any one of the following: the penetration rate of new energy sources, generator output, load level, or network operation mode. A sample data point is obtained for each operating condition, leading to a series of sample data points.
[0022] Specifically, the power flow parameters of a node include: the active power generation and reactive power generation of the corresponding node, the load active power, the load reactive power, the bus voltage amplitude, and the bus voltage phase angle. It is understandable that for non-generating nodes, both their active and reactive power generation are zero, and for non-load nodes, both their load active and reactive power are zero.
[0023] Specifically, node disturbance parameters encompass both active power disturbances and reactive power disturbances. These parameters need to reflect both the disturbance type and the amount of disturbance power. Generally, disturbances are applied only to some nodes; for nodes without disturbances, the disturbance parameters are zero. For nodes with applied disturbances, the disturbance parameters are numerical values with positive and negative signs. The sign indicates the disturbance type: a positive number represents a load shedding disturbance, and a negative number represents a generating node disturbance.
[0024] Specifically, the global parameters of the system may include: total system inertia, synchronous system inertia, virtual system inertia, total system damping, synchronous system damping, virtual system damping, system droop coefficient, active power reserve, and new energy penetration rate.
[0025] The power flow data, system global parameters, and disturbance data are shown in the table below.
[0026]
[0027] Specifically, system frequency security indicators may include: the frequency minimum deviation, quasi-steady-state frequency deviation, and frequency change rate obtained by the power grid after a disturbance is applied.
[0028] During training, the system frequency security index of the i-th sample is actually the frequency security index label of the i-th sample, which can be denoted as: ; in, Let i be the frequency safety index label for the i-th sample. The rate of change of frequency, The deviation at the lowest frequency point, The quasi-steady-state frequency deviation is represented by i, where i is the sample number.
[0029] S2, Node electrical parameters Constructed as a physical semantic template ;template To make parameters Convert it into a text description that includes at least the node location, parameter name, parameter value, unit of measurement, and the physical meaning of the parameter response.
[0030] Specifically, each sample data obtained in step S1 includes power flow parameters and disturbance parameters for each node in the power grid. These power flow parameters and disturbance parameters are collectively referred to as node electrical parameters. For each sample i, the node electrical parameters for each node h are... Constructed as a physical semantic template The physical semantic template is the corresponding node electrical parameters. Convert to a text description that includes at least the node location, node electrical parameter name, node electrical parameter value, unit of measurement, and the physical meaning of the parameter.
[0031] For example, physical semantic templates can be used. Represented as: ; In the formula, The parameter name representing the electrical parameters of the j-th type of node. Let be the parameter values of the electrical parameters of the j-th type of node in sample i. Let be the unit dimension of the electrical parameter of the j-th node. The physical meaning of the electrical parameters of the j-th type of node. This is a constructor for semantic templates.
[0032] In one embodiment, the physical semantic template for the active power generation of node h can be, for example: "The active power generation of node h is x MW; the unit is MW; this parameter represents the active power balance between node generation and load, affecting the power deficit and frequency response after disturbance."; x represents the specific parameter value. When its value is 7.80MW, the corresponding physical semantic template is written as "The active power generation of node h is 7.80MW; the unit is MW; this parameter represents the active power balance between node generation and load, affecting the power deficit and frequency response after disturbance."
[0033] The above text description incorporates the specific numerical value of active power generation along with the physical meaning of "active power balance" into the semantic template, enabling a unified representation of the numerical value and its role in the frequency response. For reactive power generation, load active power, load reactive power, bus voltage amplitude, bus voltage phase angle, active power disturbance, and reactive power disturbance, the same structure can be used to write the parameter name, numerical value, unit dimension, and physical meaning respectively.
[0034] The physical meaning of reactive power generation can be expressed as: the reactive power injected into or absorbed by the power system by the generating node, which affects the reactive power balance of the node and the bus voltage, and thus indirectly affects the frequency response after disturbance.
[0035] The physical meaning of load active power can be expressed as: the active power consumed by the load node, which affects the active power balance of the system and the power deficit and frequency response after disturbance.
[0036] The physical meaning of load reactive power can be expressed as: the reactive power consumed by the load node, which affects the reactive power balance of the node and the bus voltage, and thus indirectly affects the frequency response after the disturbance.
[0037] The physical meaning of the bus voltage amplitude can be expressed as: the voltage operating state of the node, which is related to the reactive power balance and voltage support capacity of the node, and indirectly affects the frequency response after disturbance.
[0038] The physical meaning of the bus voltage phase angle can be expressed as: characterizing the phase relationship between the node voltage and the reference node, and the phase angle difference between nodes reflects the active power transmission status, affecting the active power flow distribution of the line and the power redistribution after disturbance.
[0039] The physical meaning of active power disturbance can be expressed as: the sudden change in active power caused by the corresponding type of disturbance (e.g., change in power generation, change in load, or other operating events), the magnitude of which affects the degree of active power imbalance and frequency response after the disturbance.
[0040] The physical meaning of reactive power disturbance can be expressed as: the sudden change in reactive power caused by the corresponding type of disturbance (e.g., changes in power generation, load changes, or other operating events). Its magnitude affects the degree of reactive power imbalance after the disturbance, and indirectly affects the frequency response after the disturbance.
[0041] S3, Set system global parameters Construct as a scene semantic template ,template To make parameters Convert to a text description that includes at least the parameter name, parameter value, and relative status level of the parameter; convert system global parameters The m-th type of frequency security index is jointly constructed as a directional semantic template. ,template To make parameters The m-th type of frequency security index is converted into a text description that includes at least the parameter name, the parameter's relative state level, the index name, and the positive and negative effects of changes in the k-th type of system global parameters on the m-th type of frequency security index.
[0042] Each type of system global parameter has multiple value ranges. The larger the value in the range, the higher the relative state level. (The last sentence appears to be incomplete and possibly refers to a different parameter.) The parameter range in which it is located determines its relative state level.
[0043] Specifically, the set of global parameters of the k-th system is obtained by sorting the k-th system global parameters in all samples according to their data size. , Represents system global parameters The parameter value k; the first quartile is calculated using the quartile mechanism. Second quartile and the third and fourth quartiles Determine system global parameters The mechanism of relative state levels is as follows: ; In the formula, Represents system global parameters The relative state levels, L1, L2, L3 and L4, represent four relative state levels from low to high, which can be referred to as low level, low-medium level, medium-high level and high level.
[0044] Scene semantic template To set system global parameters Convert to a text description that includes at least the parameter name, parameter value, and relative status level of the parameter, specifically as follows: ; Directional semantic template To set system global parameters The m-th type of frequency security index is converted into a text description that includes at least the parameter name, the relative status level of the parameter, the index name, and the positive and negative effects of changes in the k-th type of system global parameters on the m-th type of frequency security index. Specifically, it can be expressed as: ; In the formula, Let K be the name of the global parameter of the k-th system. Let be the parameter value of the global parameter of the k-th class of the system in the i-th sample. Let $\frac{i}{k}$ represent the relative running state of the global parameters of the $k$-th system in the $i$-th sample. Let m be the name of the frequency security index of the m-th category. This represents the negative or positive impact of changes in the global parameters of the k-th system on the m-th frequency security index.
[0045] Among them, regarding Based on the frequency response mechanism, the directional effect of changes in the global parameters of the k-th type of system on the frequency security index of the m-th type can be determined in advance. An increase in system inertia can usually suppress the rate of frequency change in the early stage of a disturbance; an increase in system damping and active power reserve is usually beneficial to frequency recovery; an increase in the penetration rate of new energy sources usually reduces the system's equivalent inertia and frequency support capacity.
[0046] For example, the scene semantic template for system inertia can be: "System inertia is xs; unit is seconds; relative state level is L." j The value is at a low / low-medium / high-medium / high level; this parameter represents the system's ability to resist rapid frequency changes after a disturbance. The higher the system inertia, the slower the system frequency changes. "; x represents the specific parameter value, L j The L1, L2, L3, and L4 represent the relative state levels determined by the parameter values of the system inertia, respectively, representing low level, low-medium level, medium-high level, and high level.
[0047] When the system inertia is 4.20 s and the corresponding relative state level is L2, the corresponding scenario semantic template is written as: "System inertia is 4.20 s; unit is s; relative state level is medium to high; this parameter represents the system's ability to resist rapid frequency changes after disturbance. The larger the system inertia, the slower the system frequency changes."
[0048] The directional semantic template jointly constructed from system inertia and rate of change of frequency can be: "The current system inertia is xs, which is at a low / low-medium / high-medium / high level; the frequency change rate is one of the frequency safety indicators; under other basically unchanged operating conditions, the system inertia can enhance the system's ability to resist active power imbalance, suppress rapid frequency changes in the early stage of disturbances, and reduce the absolute value of the frequency change rate. Therefore, the current system inertia has a weak / relatively weak / relatively strong / strong suppression effect on the frequency change rate." Here, x represents a specific parameter value, and the inertia level corresponds one-to-one with the degree of suppression.
[0049] The textual description of the positive and negative relationships between each global system parameter (system inertia, system damping, system active power reserve, and system renewable energy penetration rate) and its frequency change rate, frequency minimum deviation, and quasi-steady-state frequency deviation can be as follows: The text describes the negative relationship between system inertia and the rate of frequency change as follows: Increasing system inertia can enhance the system's ability to resist active power imbalance, suppress rapid frequency changes in the early stages of disturbances, and reduce the absolute value of the rate of frequency change. Therefore, system inertia has a weak / relatively weak / relatively strong / strong suppressive effect on the rate of frequency change.
[0050] The system inertia has a negative effect on the frequency minimum deviation. The text describes it as follows: increasing the system inertia can slow down the frequency drop process after the disturbance, providing more sufficient response time for frequency adjustment, thereby reducing the absolute value of the frequency minimum deviation. Therefore, the system inertia has a weak / relatively weak / relatively strong / strong suppressive effect on the frequency minimum deviation.
[0051] The influence of system inertia on quasi-steady-state frequency deviation is relatively weak. The text describes it as follows: System inertia mainly affects the transient frequency change process after disturbance, while quasi-steady-state frequency deviation is mainly determined by the active power balance and frequency regulation capability after disturbance. Therefore, the direct effect of system inertia on quasi-steady-state frequency deviation is relatively weak.
[0052] The relationship between system damping and the rate of frequency change is negative. The text describes it as follows: increasing system damping can enhance the damping effect of the system on frequency deviation, suppress the continuous and rapid change of frequency after disturbance, and reduce the absolute value of the rate of frequency change. Therefore, system damping has a weak / relatively weak / relatively strong / strong suppressive effect on the rate of frequency change.
[0053] The system damping has a negative effect on the frequency minimum deviation. The text describes it as follows: increasing the system damping can enhance the system's self-adjustment ability to frequency deviation, suppress the continuous drop in frequency after disturbance, and make the frequency minimum point closer to the rated frequency, thereby reducing the absolute value of the frequency minimum deviation. Therefore, the system damping has a weak / relatively weak / relatively strong / strong suppression effect on the frequency minimum deviation.
[0054] The system damping has a negative effect on the quasi-steady-state frequency deviation. The text describes it as follows: increasing the system damping can enhance the power regulation of the system under frequency deviation, promote the rebalancing of active power after disturbance, and make the quasi-steady-state frequency closer to the rated frequency, thereby reducing the absolute value of the quasi-steady-state frequency deviation. Therefore, the system damping has a weak / relatively weak / relatively strong / strong suppression effect on the quasi-steady-state frequency deviation.
[0055] The active power reserve of the system has a negative relationship with the rate of frequency change. The text describes it as follows: The increase of the active power reserve of the system can provide more sufficient active power regulation margin for frequency regulation after disturbance. When the reserve resources participate in the rapid frequency response, it can suppress the rapid frequency change and reduce the absolute value of the rate of frequency change. Therefore, the active power reserve of the system has a weak / relatively weak / relatively strong / strong suppression effect on the rate of frequency change.
[0056] The system's active power reserve has a negative effect on the frequency minimum point deviation. The text describes it as follows: The increase in the system's active power reserve can provide more sufficient active power support after a disturbance, reduce the continuous active power deficit caused by the disturbance, suppress further frequency drop, and make the frequency minimum point closer to the rated frequency, thereby reducing the absolute value of the frequency minimum point deviation. Therefore, the system's active power reserve has a weak / relatively weak / relatively strong / strong suppressive effect on the frequency minimum point deviation.
[0057] The active power reserve of the system has a negative effect on the quasi-steady-state frequency deviation. The text describes it as follows: "Increasing the active power reserve of the system can enhance the active power regulation and power balance recovery capability after the system disturbance, making the quasi-steady-state frequency closer to the rated frequency, thereby reducing the absolute value of the quasi-steady-state frequency deviation. Therefore, the active power reserve of the system has a weak / relatively weak / relatively strong / strong suppression effect on the quasi-steady-state frequency deviation."
[0058] The system's new energy penetration rate has a positive relationship with the frequency change rate. The text describes it as follows: An increase in the system's new energy penetration rate usually reduces the system's equivalent inertia and frequency support capability in the early stage of disturbance, which accelerates the frequency change after the disturbance and increases the absolute value of the frequency change rate. Therefore, the system's new energy penetration rate has a weak / relatively weak / relatively strong / strong promoting effect on the frequency change rate.
[0059] The system's renewable energy penetration rate has a positive relationship with the frequency minimum deviation. The text describes it as follows: An increase in the system's renewable energy penetration rate usually reduces the system's inertia and frequency support capability, which increases the degree of frequency drop after disturbance and further deviates the frequency minimum from the rated frequency, thereby increasing the absolute value of the frequency minimum deviation. Therefore, the system's renewable energy penetration rate has a weak / relatively weak / relatively strong / strong promoting effect on the frequency minimum deviation.
[0060] The system's renewable energy penetration rate has a positive relationship with the quasi-steady-state frequency deviation. The text describes it as follows: An increase in the system's renewable energy penetration rate usually reduces the system's available frequency regulation capability, weakens the ability to restore active power balance after disturbances, and further deviates the quasi-steady-state frequency from the rated frequency, thereby increasing the absolute value of the quasi-steady-state frequency deviation. Therefore, the system's renewable energy penetration rate has a weak / relatively weak / relatively strong / strong promoting effect on the quasi-steady-state frequency deviation.
[0061] S4. Physical semantic template Scene semantic template and directional semantic templates Each input is processed into a large language model and mapped to a continuous semantic vector, resulting in a node-level semantic matrix for each sample. System-level semantic matrix and frequency security prior semantic matrix .
[0062] like Figure 2 The diagram shown is a schematic diagram of constructing three types of matrices in one embodiment of the present invention.
[0063] Specifically, the large language model is used only for semantic embedding. For any semantic template T, its continuous semantic vector is represented as: ; In the formula, d is the semantic embedding function of the large language model, and d is the semantic vector dimension.
[0064] In one embodiment, the Qwen-Embedding 0.6B large language model can be used as a semantic encoder to map each semantic template into a 256-dimensional continuous semantic vector.
[0065] Each physical semantic template After mapping the input large language model into continuous semantic vectors, and combining the electrical parameters of all nodes and all types of nodes, the node-level semantic matrix of the corresponding sample i can be obtained. H represents the number of nodes, J represents the number of types of node electrical parameters, and d represents the semantic vector dimension.
[0066] Semantic templates for each scene After mapping the input large language model into continuous semantic vectors, and combining all types of system global parameters, the system-level semantic matrix for the corresponding sample i can be obtained. K is the number of types of global parameters in the system, and d is the dimension of the semantic vector.
[0067] Each directional semantic template After mapping the input large language model into continuous semantic vectors, and combining all types of system global parameters and all types of frequency security indices, the frequency security prior semantic matrix of the corresponding sample i can be obtained. , K represents the number of prior knowledge items, K represents the number of types of global system parameters, and M represents the number of types of frequency security indicators.
[0068] For example, the semantic vector dimension d=256, the number of nodes H=39, the number of types of node electrical parameters J=8, the number of types of system global parameters K=9, and the number of types of frequency safety indicators M=3; The semantic vectors corresponding to the active power generated, reactive power generated, active power of load, reactive power of load, voltage amplitude, voltage phase angle, disturbance active power, and disturbance reactive power at the 39 nodes are arranged in the order of "node-electrical feature-semantic dimension" to form a node-level semantic matrix: ; The semantic vectors corresponding to the nine system global parameters are arranged sequentially to form a system-level semantic matrix: ; The semantic vectors corresponding to the relative operating states of system inertia, system damping, active power reserve, and renewable energy penetration rate, and their directional effects on the three frequency security indicators, are arranged sequentially to form a frequency security prior semantic matrix: .
[0069] S5, using a matrix , , The neural network is trained using the input, and training ends when the similarity loss between the frequency security index predicted by the neural network and the frequency security index in the sample converges to a preset level. The trained neural network is then used as the frequency security analysis system.
[0070] like Figure 3 The diagram shown is a schematic diagram of prediction based on a neural network in one embodiment of the present invention.
[0071] The neural network can be selected from any of the following: machine learning models, fully connected neural networks, convolutional neural networks, recurrent neural networks, or graph neural networks. Its prediction results and training objectives are expressed as follows: ; ; in, , and These are the node-level semantic matrix, system-level semantic matrix, and frequency security prior semantic matrix of the i-th sample, respectively. These are the weights of the neural network.
[0072] Specifically, the hidden layer dimension of the model was set to 64, the learning rate was set to 0.001, and the model was trained for 300 rounds using the Adam optimizer and a cosine annealing learning rate scheduling strategy with hot restart.
[0073] Example 2: This invention also provides a frequency security analysis method that integrates semantic knowledge, comprising: Obtain the node electrical parameters and system global parameters of the new energy power grid under the current operating conditions; The electrical parameters of the current node are constructed into a physical semantic template, and the global parameters of the system are constructed into a scene semantic template and a directional semantic template. The physical semantic template, scene semantic template and directional semantic template are respectively input into the large language model to be mapped into continuous semantic vectors, and the node-level semantic matrix, system-level semantic matrix and frequency safety prior semantic matrix under the current working condition are obtained one by one. The node-level semantic matrix, system-level semantic matrix, and frequency security prior semantic matrix are input into the frequency security analysis system trained by the above training method to predict and output the frequency security index under the current operating conditions of the power grid.
[0074] Example 3: The present invention also relates to an electronic device, including a memory and a processor, wherein the memory stores a computer program, and the processor executes the computer program to implement the steps of the method described above.
[0075] The electronic device can be a desktop computer, laptop, handheld computer, or cloud server, etc. The processor can be a Central Processing Unit (CPU), or other general-purpose processors, digital signal processors (DSPs), application-specific integrated circuits (ASICs), field-programmable gate arrays (FPGAs), or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. The memory can be used to store computer programs and / or modules. The processor implements various functions of the electronic device by running or executing the computer programs and / or modules stored in the memory, and by accessing data stored in the memory.
[0076] Example 4: The present invention also relates to a computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the steps of the method described above.
[0077] Specifically, the memory may include high-speed random access memory, as well as non-volatile memory, such as hard disks, RAM, plug-in hard disks, smart media cards (SMC), secure digital (SD) cards, flash cards, at least one disk storage device, flash memory device, or other volatile solid-state storage devices.
[0078] Example 5: This invention provides a computer program product or computer program that includes computer instructions stored in a computer-readable storage medium. A processor of a computer device reads the computer instructions from the computer-readable storage medium and executes the computer instructions, causing the computer device to perform the steps of the method described in the above embodiments of this invention.
[0079] Example 6: The present invention was verified.
[0080] This embodiment uses, as follows: Figure 4 The improved IEEE 39-node system was used for verification. This system includes 39 nodes, 10 generators, 19 loads, and 34 AC lines. To construct operating modes with different inertia levels, wind farms of equal capacity were used to replace 1, 2, 3, and 4 synchronous generators, respectively, corresponding to renewable energy penetration rates of 10.58%, 20.88%, 31.46%, and 40.26%. Under each renewable energy penetration rate, all synchronous generators were put into operation, and five synchronous generator N-1 operating modes were set, with power flow levels successively set to 80%, 85%, 90%, 95%, 100%, 105%, and 110% of the standard operating conditions. This resulted in 4 6 7 = 168 types of convergent steady-state operation modes of power flow.
[0081] For each steady-state operating mode, generator cutoff disturbances and load cutoff disturbances with active power greater than 100MW are set, including 10 types of generator cutoff disturbances and 17 types of load cutoff disturbances. Therefore, a total of 168... (10+17)=4536 operating conditions, generating 4536 samples. Each sample includes node active power generation, active power generation, load active power, load reactive power, voltage amplitude, voltage phase angle, disturbance active power and disturbance reactive power, as well as system total inertia, synchronous inertia, virtual inertia, total damping, synchronous damping, virtual damping, system droop coefficient, active power reserve and new energy penetration rate.
[0082] Time-domain simulations were performed for each steady-state operating mode and its corresponding anticipated disturbance to obtain the system frequency trajectory after the disturbance. The system's inertial center frequency is expressed as: ; in, It is the inertial center frequency; and It is the inertial time constant of the i-th generator; Let be the frequency of the bus connected to the i-th generator; and m be the number of generators. Calculate the deviation of the lowest frequency point based on the inertial center frequency trajectory. Quasi-steady-state frequency deviation and frequency change rate The 4536 samples were divided into training, validation, and test sets in a 70:15:15 ratio, with the relative running state threshold calculated only from the training set.
[0083] For each sample, a physical semantic template, a scene semantic template, and a directional semantic template are constructed according to the method proposed in this invention. These templates are then input into a large language model to map them into continuous semantic vectors, resulting in a one-to-one correspondence between the node-level semantic matrix, the system-level semantic matrix, and the frequency security prior semantic matrix for the corresponding sample. The resulting node-level, system-level, and frequency security prior semantic matrices are used as three types of inputs to the neural network. The neural network extracts node operation and perturbation features, overall system frequency support features, and frequency security prior features according to the data structure of the three types of semantic matrices, and establishes a mapping relationship between the three types of semantic matrices and frequency security indicators. ; in, , and These are the node-level semantic matrix, system-level semantic matrix, and frequency security prior semantic matrix of the i-th sample, respectively. For neural network models, This is the output of the model. In this embodiment, a graph neural network is used to process the node-level semantic matrix, and a neural network encoder is used to process the system-level semantic matrix and the frequency security prior semantic matrix. Finally, three frequency security indicators are output through a regression layer.
[0084] Specifically, the model's hidden layer dimension was set to 64, the learning rate to 0.001, and it was trained for 300 epochs using the Adam optimizer and a cosine annealing learning rate scheduling strategy with hot restart. Mean squared error was used as the training loss function. ; After training, in the test set , and The mean absolute percentage errors were 3.535%, 2.101%, and 1.775%, respectively, and the maximum absolute errors were 0.077 Hz / s, 0.153 Hz, and 0.113 Hz, respectively. These results demonstrate that by embedding numerical values, physical meaning, relative state, and directional priors into three types of semantic matrices, it is possible to predict the security index of the anticipated perturbation frequency.
[0085] Further, multiplicative noise of 1%, 3%, and 5% was added to the power flow characteristics of the test set, while keeping the frequency safety label unchanged. The results are as follows: Figure 5 As shown, the mean absolute percentage errors of the model for the three frequency safety indices are 5.414%, 4.315%, and 3.814% under 3% noise, and 6.117%, 4.780%, and 4.465% under 5% noise. Compared with the model that only uses numerical features, the error growth is suppressed, indicating that relative operating state and directional priors can provide auxiliary information that is not entirely dependent on instantaneous values.
[0086] The technical features of the above embodiments can be combined arbitrarily. For the sake of brevity, not all possible combinations of the technical features in the above embodiments are described. However, as long as the combination of these technical features does not contradict each other, it should be considered within the scope of this specification. It should be noted that the terms "in one embodiment," "for example," and "again" are intended to illustrate the present invention and are not intended to limit the present invention.
[0087] The above embodiments merely illustrate several implementation methods of the present invention, and their descriptions are relatively specific and detailed, but they should not be construed as limiting the scope of the patent application. It should be noted that those skilled in the art can make various modifications and improvements without departing from the concept of the present invention, and these all fall within the protection scope of the present invention.
Claims
1. A training method for a frequency security analysis system incorporating semantic knowledge, characterized in that, include: Obtain sample data; different sample data represent the nodal electrical parameters of the new energy power grid under different operating conditions. System global parameters and frequency security indicators under disturbances. Node electrical parameters include node disturbance parameters and node power flow parameters under stable operating conditions before the disturbance is applied; system global parameters cover the grid's system inertia, system damping, system active power reserve, and system renewable energy penetration rate; i is the sample index, h is the node index, k is the index for node electrical parameter types, m is the index for system global parameter types, and m is the index for frequency safety index types. Node electrical parameters Constructed as a physical semantic template ;template To make parameters Convert it into a text description that includes at least the node location, parameter name, parameter value, unit of value, and the physical meaning of the parameter response; System global parameters Construct as a scene semantic template ,template To make parameters Convert to a text description that includes at least the parameter name, parameter value, and relative status level of the parameter; convert system global parameters The m-th type of frequency security index is jointly constructed as a directional semantic template. ,template To make parameters The m-th type of frequency security indicator is converted into a text description that includes at least the parameter name, the relative state level of the parameter, the indicator name, and the positive or negative effect of changes in the k-th type of system global parameters on the m-th type of frequency security indicator; each type of system global parameter has multiple parameter value ranges, with larger values indicating higher relative state levels, and the parameters are judged... The parameter range in which it is located determines its relative state level; physical semantic template Scene semantic template and directional semantic templates Each input is processed into a large language model and mapped to a continuous semantic vector, resulting in a node-level semantic matrix for each sample. System-level semantic matrix and frequency security prior semantic matrix ; With matrix , , The neural network is trained using the input, and training ends when the similarity loss between the frequency security index predicted by the neural network and the frequency security index in the sample converges to a preset level. The trained neural network is then used as the frequency security analysis system.
2. The training method of the frequency security analysis system integrating semantic knowledge as described in claim 1, characterized in that, The specific power flow parameters of a node include: the active power generation, reactive power generation, load active power, load reactive power, bus voltage amplitude, and bus voltage phase angle of the corresponding node.
3. The training method of the frequency security analysis system integrating semantic knowledge as described in claim 1, characterized in that, The frequency safety indicators specifically include: frequency change rate, frequency minimum point deviation, and quasi-steady-state frequency deviation.
4. The training method of the frequency security analysis system integrating semantic knowledge as described in claim 1, characterized in that, One way to set multiple parameter value ranges for the global parameters of the k-th system is to sort the global parameters of the k-th system in all samples to obtain the set of global parameters of the k-th system. , Represents system global parameters The parameter value is given by B, where B is the total number of samples; the first quartile is calculated using the quartile mechanism. Second quartile and the third and fourth quartiles ,get Four intervals; Determine system global parameters The mechanism of relative state levels is as follows: ; In the formula, Represents system global parameters The relative state levels are L1, L2, L3, and L4, which represent the four relative state levels from low to high, respectively.
5. The training method of the frequency security analysis system integrating semantic knowledge as described in claim 1, characterized in that, Similarity loss between the frequency security index of the neural network and the frequency security index in the sample The calculation formula is: ; In the formula, B is the sample size. The frequency security index collected in sample i The frequency security index is predicted by the neural network based on sample i.
6. The training method of the frequency security analysis system integrating semantic knowledge as described in claim 1, characterized in that, Neural networks can be selected from machine learning models, fully connected neural networks, convolutional neural networks, recurrent neural networks, or graph neural networks.
7. A frequency security analysis method incorporating semantic knowledge, characterized in that, include: Obtain the node electrical parameters and system global parameters of the new energy power grid under the current operating conditions; The electrical parameters of the current node are constructed into a physical semantic template, and the global parameters of the system are constructed into a scene semantic template and a directional semantic template. The physical semantic template, scene semantic template and directional semantic template are respectively input into the large language model to be mapped into continuous semantic vectors, and the node-level semantic matrix, system-level semantic matrix and frequency safety prior semantic matrix under the current working condition are obtained one by one. The node-level semantic matrix, system-level semantic matrix, and frequency security prior semantic matrix are input into the frequency security analysis system trained by the training method described in any one of claims 1 to 6, and the frequency security index under the current operating conditions of the power grid is predicted and output.
8. An electronic device comprising a memory and a processor, wherein the memory stores a computer program, characterized in that, When the processor executes the computer program, it implements the steps of the method as described in any one of claims 1 to 7.
9. A computer-readable storage medium having a computer program stored thereon, characterized in that, When the computer program is executed by a processor, it implements the steps of the method as described in any one of claims 1 to 7.
10. A computer program product, comprising a computer program or instructions, characterized in that, When the computer program or instructions are executed by a processor, they implement the steps of the method as described in any one of claims 1 to 7.