An automatic voltage regulator zero dynamic detection method based on neural network prediction
By employing a detection method based on state-driven neural network prediction, combined with Luenberger state observers and deep learning models, the early detection challenge of zero-dynamic attacks in AVR systems was solved, achieving attack identification with high sensitivity and low false alarm rate, thereby improving the safe operation level of the power grid.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- JIANGSU OCEAN UNIV
- Filing Date
- 2025-06-27
- Publication Date
- 2026-06-23
AI Technical Summary
Existing technologies lack effective early detection methods, making it difficult to identify covert zero-dynamic attacks in AVR systems. Traditional detection methods have limited effectiveness against zero-dynamic attacks and lack a comprehensive detection system that combines state estimation techniques with advanced data-driven prediction methods.
A comprehensive detection system based on state-driven neural network prediction is adopted, which achieves early detection of zero-dynamic attacks on AVR systems through Luenberger state observers and deep learning prediction models. This method includes establishing a mathematical model of the AVR system, state partitioning, designing a Luenberger state observer, constructing and training a state-driven neural network predictor, as well as online prediction and residual generation, using the residuals to determine zero-dynamic attacks.
It enables early warning of zero-dynamic attacks, has high detection sensitivity, low false alarm rate, and strong adaptability. It can identify attacks before the system output deviates significantly from the normal value, thus significantly improving the security and stability of the power grid.
Smart Images

Figure CN120722722B_ABST
Abstract
Description
Technical Field
[0001] This invention belongs to the field of power grid safety, and specifically relates to a method for zero dynamic detection of automatic voltage regulators based on neural network prediction. Background Technology
[0002] With rapid economic development and the continuous improvement of people's living standards, electric energy, as one of the important infrastructures of modern society, plays a crucial role in the sustainable development of the entire social economy due to its security and stability. The power grid, as a vital carrier of electric energy supply, not only undertakes the stable transmission and distribution of electricity but also directly affects the normal operation of industrial production, communications, transportation, and residents' daily lives. To ensure grid voltage stability and power quality, Automatic Voltage Regulators (AVRs) are widely used in modern power grid systems. AVR systems maintain the generator output voltage around a preset target value by adjusting the generator's excitation current in real time, thereby protecting grid equipment from voltage fluctuations and improving transmission efficiency. A typical AVR control system consists of subsystems such as amplifiers, exciters, generators, and sensors. Each subsystem is modeled using a first-order transfer function defined by gain and time constant, thus constructing the overall mathematical model of the system. To improve AVR control performance, a proportional-integral (PI) controller is usually introduced into the control loop, utilizing the unity negative feedback principle to form a closed-loop control structure, ensuring system stability and fast response characteristics. The unity negative feedback principle refers to directly feeding back the system's output to the input for comparison, thereby automatically correcting the error between the output and input. With the integration of advanced information technology and power systems, AVR systems are gradually upgrading from traditional analog control to digital and networked control.
[0003] The widespread application of Supervisory Control and Data Acquisition (SCADA) systems enables AVRs to remotely acquire real-time power grid operating status data and adjust system control strategies in a timely manner, improving the flexibility and efficiency of power grid operation. However, this deep integration also brings new cybersecurity risks to the power grid.
[0004] In recent years, zero-dynamic attacks have attracted widespread attention as an advanced network attack method. A zero-dynamic attack is a special form of spoofed data injection attack, primarily exploiting the inherent structural characteristics of non-minimum-phase control systems. Non-minimum-phase systems possess unstable zero-dynamics, allowing attackers to design specific attack signals using system structural parameters. After the attack signal is injected into the control loop, the system's internal state gradually deviates from its normal trajectory and may even diverge, while its external behavior remains essentially the same as when unattacked. This attack is highly concealed, making it difficult for traditional monitoring techniques to detect and respond promptly, thus posing a significant risk to the safe operation of the power grid. Research on zero-dynamic attack detection technology for AVR systems has become an important current research topic. To better understand the technical solution of this invention, the following is a review of relevant technologies in this field. In the field of state estimation and control, the pole placement method is widely used as a classic control system design method. The pole placement method, by appropriately selecting the feedback matrix or observer gain matrix, places the eigenvalues (pole) of the closed-loop or observer system in the desired positions, thereby ensuring the system's stability and dynamic performance. Especially when designing state observers (such as Luenberger observers), the pole placement method can ensure that the estimated state converges quickly to the true state, thus ensuring the accuracy of subsequent control or detection strategies.
[0005] The closest related patent technology to this invention includes: Chinese invention patent CN119628884A, which discloses an enhanced zero-dynamic attack method for automatic voltage regulators (AVRs). This patent designs more destructive zero-dynamic attack signals for AVR systems, analyzes key attack factors, and amplifies the attack effect by adjusting the attack signal. However, this patent only focuses on the attack technique itself and does not involve effective detection and defense methods against zero-dynamic attacks. Chinese invention patent CN118413364A discloses a zero-dynamic attack defense method for sampled networked control systems. This patent designs a defense strategy based on the characteristics of sampled networks to resist zero-dynamic attacks, paying particular attention to attacks caused by system latency. However, this patent does not consider the application of state-driven neural networks in state prediction and attack detection. Chinese invention patent CN119675964A discloses a defense method against zero-dynamic attacks on wind power generation systems. It primarily uses dynamically adjustable electronically controlled passive components to transform unstable zero points into stable zero points. Although this patent addresses the zero-dynamic problem of power systems, its application is limited to wind power systems and does not cover automatic voltage regulators. Chinese invention patent CN111181428A discloses a zero-dynamic DC output voltage control method and system for current source converters. This patent achieves zero-dynamic DC voltage regulation through feedforward control, but it mainly focuses on the control strategy of DC voltage converters, which differs significantly from the voltage regulation and attack detection technology involved in this invention.
[0006] The shortcomings of the aforementioned existing technologies are as follows: First, most existing technologies focus on the design of attack signals or the defense control strategies themselves, lacking early detection schemes for attacks; second, traditional detection methods usually rely on the direct anomaly judgment of output signals, which has limited effectiveness against advanced attack methods such as zero-dynamic attacks that hide output anomalies; third, there is a lack of a comprehensive detection system that effectively combines state estimation technology with advanced data-driven prediction methods, making it difficult to effectively detect covert zero-dynamic attacks. Summary of the Invention
[0007] To address the aforementioned problems, this invention proposes a novel method for detecting zero-dynamic attacks on AVRs. It aims to provide a comprehensive detection system based on state-driven neural network prediction, utilizing state estimation technology and deep learning prediction models to achieve early detection and effective defense against zero-dynamic attacks on AVRs, thereby improving the safe operation level of the power grid. The zero-dynamic detection method for automatic voltage regulators based on neural network prediction described in this invention includes the following steps:
[0008] S1: AVR system mathematical model establishment and state partitioning, including the following steps:
[0009] S1-1: Acquire known physical parameters of the amplifier, exciter, generator, and sensors in the automatic voltage regulator (AVR), including the gain K. a K e K g K s With time constant τ a τ e τ g τ s ;
[0010] S1-2: Based on the gain and time constant described in step S1-1, establish the first-order transfer function of each subsystem, and connect the transfer functions in series and in parallel to form the open-loop transfer function of the AVR system.
[0011] S1-3: A proportional-integral (PI) controller is placed before the open-loop transfer function. The proportional gain and integral gain of the PI controller are given by the controller adjustment algorithm to obtain the closed-loop transfer function.
[0012] S1-4: Construct a fifth-order linear time-invariant state-space model matrix based on the closed-loop transfer function. At the same time, apply the Byrnes-Isidori paradigm transformation to decompose the original state vector into internal state vector and external state vector, and obtain the transformed system matrix.
[0013] S2: Luenberger State Observer Design and Online State Estimation, including the following steps:
[0014] S2-1: Construct the Luenberger state observer structure based on the system matrix obtained in step S1-4;
[0015] S2-2: The observer gain matrix is calculated using the pole placement method, so that all the observer eigenvalues are placed inside the unit circle and the error between the system's true state and the observer's estimated value is converged. The gain matrix is stored in the controller.
[0016] S2-3: During system operation, drive the observer state update equation, output the estimated internal state and the estimated external state, and set the internal state... and external state Cache it in a circular buffer for use in steps S3 and S4;
[0017] S3: Construction and training of state-driven neural network predictors, including the following steps:
[0018] S3-1: Offline Phase: Collect historical datasets, where each sample includes: a historical input sequence of the time window length; a historical output sequence of the time window length; the corresponding estimated internal state; the corresponding estimated external state; the above data are concatenated into a network input vector; the corresponding label is the actual output at the next time step.
[0019] S3-2: Construct a feedforward neural network with learnable parameters, taking the network input vector as input and outputting the predicted value;
[0020] S3-3: Define the total loss function, use the Adam optimizer to train the network parameters until convergence, and obtain the trained predictor;
[0021] S3-4: Deploy the trained weights along with the network structure as an online detection module;
[0022] S4: Online prediction and residual generation, including the following steps:
[0023] S4-1: In each sampling period, read the internal and external states output in step S2-3, as well as the historical input sequence and historical output sequence cached in step S3-1, to form the network input vector;
[0024] S4-2: Input the network input vector into the deployed predictor to obtain the prediction output for the next sampling period;
[0025] S4-3: Calculate the mirror output using a mirror model that is completely identical to the parameters of the AVR system and has not been attacked, driven by the real-time input u(t);
[0026] S4-4: Calculate the residuals and store them in the residual sequence;
[0027] S5: Zero-dynamic attack detection includes the following steps:
[0028] S5-1: Set a threshold ε for the residual sequence. The threshold can be set statically or updated online adaptively based on system noise.
[0029] S5-2: If the residual sequence is greater than the set threshold during a continuous sampling period, a zero dynamic attack alarm signal will be output, and the abnormal timestamp will be recorded at the same time.
[0030] As a preferred embodiment of the present invention, the calculation of the open-loop transfer function in step S1-2 specifically includes the following steps:
[0031] The amplifier transfer function is expressed as:
[0032]
[0033] The exciter transfer function is expressed as:
[0034]
[0035] The transfer function of generator terminal voltage and field voltage is expressed as:
[0036]
[0037] The sensor transfer function is expressed as:
[0038]
[0039] By combining formulas (1), (2), (3), and (4), the open-loop transfer function of the system can be derived as follows:
[0040]
[0041] Among them, K a τ represents the amplifier gain. a K represents the amplifier time constant. e τ represents the exciter gain. e K represents the exciter time constant. g τ represents the gain between the generator terminal voltage and the field voltage. g K represents the time constant between the generator terminal voltage and the field voltage. s τ represents the sensor gain. s This represents the sensor's time constant.
[0042] As a preferred embodiment of the present invention, the calculation of the closed-loop transfer function in steps S1-3 specifically includes the following steps:
[0043] Set the transfer function of the proportional-integral (PI) controller as follows:
[0044] Among them, K p K is the proportional gain of the PI controller. i The integral coefficient of the PI controller;
[0045] Connect G1(s) in series with the open-loop transfer function G0(s) shown in formula (5), where G1(s) is the transfer function of the PI controller and G0(s) is the open-loop transfer function of the AVR control system.
[0046] Based on the principle of unity negative feedback, the closed-loop transfer function is calculated using the following formula:
[0047]
[0048] Where, K0 = K a K e K g K s K p K1 = K a K e K g K s K i ,τ0=τ a τ eτ g τ s ,τ1=τ a τ e +τ a τ g +τ a τ s +τ e τ g +τ e τ s +τ g τ s ,τ2=τ a τ e τ g +τ a τ e τ s +τ a τ g τ s +τ e τ g τ s ,τ3=τ a +τ e +τ g +τ s τ4=1+K a K e K g K s K p τ5=K a K e K g K s K i The closed-loop transfer function shown in formula (6) can be used for subsequent system performance analysis and state-space model construction in steps S1-4.
[0049] As a preferred embodiment of the present invention, the calculation of the system matrix in steps S1-4 specifically includes the following steps:
[0050] Define the state vector as The formula for calculating the state space is:
[0051]
[0052] Among them, V e Let u(t) be the voltage error of the system, y(t) be the input voltage error of the system, and x(t) be the output terminal voltage of the closed-loop system. Let A be the state vector of the closed-loop system, B be the input matrix of the closed-loop system, and C be the output matrix of the closed-loop system.
[0053] Performing Euclidean polynomial division on the denominator polynomial Den(s) and the numerator polynomial Num(s) of the closed-loop transfer function yields the quotient Quo(s) and the remainder Rem(s). The specific calculation formulas are as follows:
[0054]
[0055] Where Den(s) = Quo(s)Num(s) + Rem(s);
[0056] Based on the degree relationship between Quo(s) and Rem(s), a coordinate transformation matrix T is constructed to decompose the original state vector x(t) into internal state vectors. The external state vector δ(t) is calculated using the following formula:
[0057]
[0058] Among them, δ(t)=[y(t) y(t+1) y(t+2) y(t+3)] T , λ T δ(t)=y(t)+b m N o φ(t)-b m u(t), M c =[0 0 0 1] T N c = [1 0 0 0]; φ(t+1) is the change of the system's internal state vector; δ(t+1) is the change of the system's external state vector; G o M o N o For the minimum implementation of the feedback path; b m λ is the coefficient in Quo(s); T This is the solution to formula (9);
[0059] The transformed system matrix and λ are calculated using the coordinate transformation matrix T, thus completing the Byrnes–Isidori normal form transformation.
[0060] As a preferred embodiment of the present invention, the mathematical model of the AVR system further includes a zero-dynamic attack modeling, and the system model under zero-dynamic attack is as follows:
[0061]
[0062] After receiving an attack, the system model changes as follows:
[0063]
[0064] Where a(t) represents the attack data added to u(t) through logical operations, and z(t) is the state vector z(t+1) = G calculated by the attacker using the system matrix. o z(t), a(t) = N o z(t).
[0065] As a preferred embodiment of the present invention, the Luenberger state observer structure in step S2 is as follows: the input signal u(t) issued by the controller acts simultaneously on the system and the observer, and the system output y(t) and the output y generated by the observer are... L (t) is compared to obtain the output error e y (t), this error, after being weighted by the gain matrix L, is fed back into the observer to correct the state estimate, thereby enabling the observer to gradually approximate the true state trajectory during iteration. The specific calculation formula is as follows:
[0066]
[0067] in, L represents the estimated values of the internal and external states, respectively. φ ,L δ The observer gain matrix is... This represents the current output error, used for observation correction.
[0068] As a preferred embodiment of the present invention, in step S2, the system output y(t) is a linear combination of δ(t), which can be achieved by constructing matrix N. c Ensure system observability, and design a suitable L based on this. φ ,L δ To bring the state estimation error to converge, the error between the actual system state and the observer's estimate is defined as follows:
[0069]
[0070] Based on the system state equation and the observer state update formula, the calculation formula for the dynamic system of error evolution over time is derived as follows:
[0071] e δ (t+1)=(G c +M c λ T -L δ N c )e δ (t)+M c b m N o e φ (t), (15)
[0072] e φ(t+1)=(G φ -L φ N c )e φ (t)+M o N c e δ (t). (16)
[0073] Among them, G φ L is a system matrix and gain matrix in the dynamic equation of the state estimation error. φ ,L δ The pole placement method is used for selection, while ensuring...
[0074] As a preferred embodiment of the present invention, the input of the state-driven neural network predictor in step S3 consists of the following four types of variables, which are estimated internal states obtained through the observer. Estimated external state obtained through observers Given the historical input sequence u(tk:t) and the historical output sequence y(tk:t-1), the neural network constructs a function by concatenating these features into an input vector:
[0075]
[0076] Among them, f θ (·) represents a feedforward neural network structure with learnable parameters θ, whose output is a prediction of the future output of the system.
[0077] As a preferred embodiment of the present invention, the formula for calculating the total loss function in step S3-3 is as follows:
[0078]
[0079] in, Indicates the change in the predicted output. The change in internal state estimation is represented by γ, which is the state change scaling factor, and α is the weight of the consistency loss term.
[0080] As a preferred embodiment of the present invention, steps S4 and S5 are implemented through the following online detection architecture:
[0081] The controller outputs an input signal u(t) that is simultaneously input to both the real system and the mirror system. The mirror system, serving as an unattacked reference model, generates a normal output y. n (t);
[0082] The observer estimates the internal state of the system in real time based on u(t) and y(t). With external state And utilize the output error e y (t) through gain L φ ,L δ Corrected state estimation;
[0083] Neural networks estimate internal states With external state Using the historical input sequence u(tk:t) and the historical output sequence y(tk:t-1) as inputs, predict the system's output at the next time step.
[0084] The predicted output is the same as the mirror system output y. n (t) Compare to obtain the residual And send it to the residual detection module for judgment;
[0085] By observing the predicted output The changing trend can be used to determine whether the system has been attacked.
[0086] Compared with the relevant prior art, the beneficial effects of the present invention are:
[0087] Early warning and earlier detection: By relying on the deep coupling of Luenberger state observer and state-driven neural network predictor, this invention can identify zero-dynamic attacks in advance by predicting residuals and internal state change trends before the system output deviates significantly from the normal value, thus achieving early warning of covert attacks.
[0088] It has high detection sensitivity and low false alarm rate. By introducing a state change consistency term into the loss function, the neural network not only focuses on the deviation of the output value, but also remains sensitive to the internal state increment. It effectively distinguishes between random disturbances in the operation of the equipment itself and systematic drift caused by attacks, and significantly reduces false alarms and missed alarms.
[0089] The algorithm is highly versatile and adaptable. The observer design (pole placement) and prediction model structure used in this invention have good scalability, can be quickly reconstructed for AVR systems of different models and parameters, and the threshold can be adaptively updated online to adapt to different operating conditions and noise levels.
[0090] This invention enhances the security and stability of the power grid by promptly detecting and alerting to zero-dynamic attacks on AVR systems. It effectively blocks potential harm to the power grid caused by attackers exploiting inherent vulnerabilities in non-minimum phase systems, providing a solid technical guarantee for the safe operation of the power grid. Attached Figure Description
[0091] Figure 1 A flowchart of a method for zero dynamic detection of an automatic voltage regulator based on neural network prediction provided by the present invention;
[0092] Figure 2 AVR system structure diagram provided for embodiments of the present invention;
[0093] Figure 3 This is a block diagram of a closed-loop AVR control system according to an embodiment of the present invention;
[0094] Figure 4 This is a flowchart illustrating the injection of zero-dynamic attack into an AVR control system according to an embodiment of the present invention;
[0095] Figure 5 This is a structural diagram of the Luenberger observer provided in an embodiment of the present invention;
[0096] Figure 6 This is a neural network structure diagram provided in an embodiment of the present invention;
[0097] Figure 7 This is a schematic diagram of the detection method provided in an embodiment of the present invention;
[0098] Figure 8 This is an illustration of the effect of detecting zero dynamic attacks by setting upper and lower thresholds according to an embodiment of the present invention;
[0099] Figure 9 This is an illustration of the enhanced zero-dynamic attack effect of setting upper and lower thresholds in an embodiment of the present invention;
[0100] Figure 10 This is a graph showing the change in the predicted output of the multiple linear regression model in detecting zero-dynamic attacks according to an embodiment of the present invention.
[0101] Figure 11 This is a graph showing the change in the predicted output of the multiple linear regression model in detecting enhanced zero dynamic attacks, as provided in the embodiments of the present invention.
[0102] Figure 12 This is a graph showing the change in the predicted output of the neural network predictor in detecting zero-dynamic attacks according to an embodiment of the present invention;
[0103] Figure 13 This is a graph showing the change in the predicted output of the neural network predictor in detecting a reinforced zero dynamic attack, according to an embodiment of the present invention. Detailed Implementation
[0104] The present invention will be further described below with reference to the accompanying drawings. However, the present invention can be implemented in many different ways and should not be construed as limited to the embodiments shown; rather, these embodiments provide those skilled in the art with implementation methods that meet applicable legal requirements.
[0105] Example 1: As Figure 1 As shown, the present invention proposes a method for zero dynamic detection of an automatic voltage regulator based on neural network prediction, which includes the following steps:
[0106] S1: AVR system mathematical model establishment and state partitioning, including the following steps:
[0107] S1-1: Acquire known physical parameters of the amplifier, exciter, generator, and sensors in the automatic voltage regulator (AVR), including the gain K. a K e K g K s With time constant τ a τ e τ g τ s ;
[0108] S1-2: Based on the gain and time constant described in step S1-1, establish the first-order transfer function of each subsystem, and connect the transfer functions in series and parallel to form the open-loop transfer function of the AVR system; the calculation of the open-loop transfer function in step S1-2 specifically includes the following steps:
[0109] The amplifier transfer function is expressed as:
[0110]
[0111] The exciter transfer function is expressed as:
[0112]
[0113] The transfer function of generator terminal voltage and field voltage is expressed as:
[0114]
[0115] The sensor transfer function is expressed as:
[0116]
[0117] By combining formulas (1), (2), (3), and (4), the open-loop transfer function of the system can be derived as follows:
[0118]
[0119] Among them, K a τ represents the amplifier gain. a K represents the amplifier time constant. e τ represents the exciter gain. e K represents the exciter time constant. g τ represents the gain between the generator terminal voltage and the field voltage. g K represents the time constant between the generator terminal voltage and the field voltage. s τ represents the sensor gain. sThis represents the sensor's time constant.
[0120] S1-3: A proportional-integral (PI) controller is placed before the open-loop transfer function. The proportional gain and integral gain of the PI controller are given by the controller adjustment algorithm to obtain the closed-loop transfer function. The calculation of the closed-loop transfer function in step S1-3 specifically includes the following steps:
[0121] Set the transfer function of the proportional-integral (PI) controller as follows:
[0122] Among them, K p K is the proportional gain of the PI controller. i The integral coefficient of the PI controller;
[0123] Connect G1(s) in series with the open-loop transfer function G0(s) shown in formula (5), where G1(s) is the transfer function of the PI controller and G0(s) is the open-loop transfer function of the AVR control system.
[0124] Based on the principle of unity negative feedback, the closed-loop transfer function is calculated using the following formula:
[0125]
[0126] Where, K0 = K a K e K g K s K p K1 = K a K e K g K s K i ,τ0=τ a τ e τ g τ s ,τ1=τ a τ e +τ a τ g +τ a τ s +τ e τ g +τ e τ s +τ g τ s ,τ2=τ a τ e τ g +τ a τ e τ s +τ a τ g τ s +τ eτ g τ s ,τ3=τ a +τ e +τ g +τ s τ4=1+K a K e K g K s K p τ5=K a K e K g K s K i The closed-loop transfer function shown in formula (6) can be used for subsequent system performance analysis and state-space model construction in steps S1-4.
[0127] S1-4: Construct a fifth-order linear time-invariant state-space model matrix based on the closed-loop transfer function. Simultaneously, apply the Byrnes-Isidori normal form transformation to decompose the original state vector into internal and external state vectors, and obtain the transformed system matrix. The calculation of the system matrix in step S1-4 specifically includes the following steps:
[0128] Define the state vector as The formula for calculating the state space is:
[0129]
[0130] Among them, V e Let u(t) be the voltage error of the system, y(t) be the input voltage error of the system, and x(t) be the output terminal voltage of the closed-loop system. Let A be the state vector of the closed-loop system, B be the input matrix of the closed-loop system, and C be the output matrix of the closed-loop system.
[0131] Performing Euclidean polynomial division on the denominator polynomial Den(s) and the numerator polynomial Num(s) of the closed-loop transfer function yields the quotient Quo(s) and the remainder Rem(s). The specific calculation formulas are as follows:
[0132]
[0133] Where Den(s) = Quo(s)Num(s) + Rem(s);
[0134] Based on the degree relationship between Quo(s) and Rem(s), a coordinate transformation matrix T is constructed to decompose the original state vector x(t) into internal state vectors. The external state vector δ(t) is calculated using the following formula:
[0135]
[0136] Among them, δ(t)=[y(t) y(t+1) y(t+2) y(t+3)] T , λ T δ(t)=y(t)+b m N o φ(t)-b m u(t), M c =[0 0 0 1] T N c = [1 0 0 0]; φ(t+1) is the change of the system's internal state vector; δ(t+1) is the change of the system's external state vector; G o M o N o For the minimum implementation of the feedback path; b m λ is the coefficient in Quo(s); T This is the solution to formula (9);
[0137] The transformed system matrix and λ are calculated using the coordinate transformation matrix T, thus completing the Byrnes–Isidori normal form transformation.
[0138] The mathematical model of the AVR system also includes a zero-dynamic attack modeling, and the system model under zero-dynamic attack is as follows:
[0139]
[0140] After receiving an attack, the system model changes as follows:
[0141]
[0142] Where a(t) represents the attack data added to u(t) through logical operations, and z(t) is the state vector z(t+1) = G calculated by the attacker using the system matrix. o z(t), a(t) = N o z(t).
[0143] S2: Luenberger State Observer Design and Online State Estimation, including the following steps:
[0144] S2-1: Construct the Luenberger state observer structure based on the system matrix obtained in step S1-4;
[0145] S2-2: The observer gain matrix is calculated using the pole placement method, so that all the observer eigenvalues are placed inside the unit circle and the error between the system's true state and the observer's estimated value is converged. The gain matrix is stored in the controller.
[0146] S2-3: During system operation, drive the observer state update equation, output the estimated internal state and the estimated external state, and set the internal state... and external state Cache it in a circular buffer for subsequent steps S3 and S4;
[0147] In step S2, the Luenberger state observer structure is as follows: the input signal u(t) from the controller acts simultaneously on both the system and the observer; the system output y(t) and the observer-generated output y L (t) is compared to obtain the output error e y (t), this error, after being weighted by the gain matrix L, is fed back into the observer to correct the state estimate, thereby enabling the observer to gradually approximate the true state trajectory during iteration. The specific calculation formula is as follows:
[0148]
[0149] in, L represents the estimated values of the internal and external states, respectively. φ ,L δ The observer gain matrix is... This represents the current output error, used for observation correction.
[0150] In step S2, the system output y(t) is a linear combination of δ(t), which can be achieved by constructing matrix N. c Ensure system observability, and design a suitable L based on this. φ ,L δ To bring the state estimation error to converge, the error between the actual system state and the observer's estimate is defined as follows:
[0151]
[0152] Based on the system state equation and the observer state update formula, the calculation formula for the dynamic system of error evolution over time is derived as follows:
[0153] e δ (t+1)=(G c +M c λ T -L δ N c )e δ (t)+M c b m N o e φ (t), (15)
[0154] e φ (t+1)=(Gφ -L φ N c )e φ (t)+M o N c e δ (t). (16)
[0155] Among them, G φ L is a system matrix and gain matrix in the dynamic equation of the state estimation error. φ ,L δ The pole placement method is used for selection, while ensuring...
[0156] S3: Construction and training of state-driven neural network predictors, including the following steps:
[0157] S3-1: Offline Phase: Collect historical datasets, where each sample includes: a historical input sequence of the time window length; a historical output sequence of the time window length; the corresponding estimated internal state; the corresponding estimated external state; the above data are concatenated into a network input vector; the corresponding label is the actual output at the next time step.
[0158] S3-2: Construct a feedforward neural network with learnable parameters, taking the network input vector as input and outputting the predicted value;
[0159] S3-3: Define the total loss function, use the Adam optimizer to train the network parameters until convergence, and obtain the trained predictor;
[0160] S3-4: Deploy the trained weights along with the network structure as an online detection module;
[0161] In step S3, the input to the state-driven neural network predictor consists of the following four types of variables, which are estimated internal states obtained through the observer. Estimated external state obtained through observers Given the historical input sequence u(tk:t) and the historical output sequence y(tk:t-1), the neural network constructs a function by concatenating these features into an input vector:
[0162]
[0163] Among them, f θ (·) represents a feedforward neural network structure with learnable parameters θ, whose output is a prediction of the future output of the system.
[0164] The formula for calculating the total loss function in step S3-3 is as follows:
[0165]
[0166] in, Indicates the change in the predicted output; γ represents the change in internal state estimation; γ is the state change scaling factor; α is the weight of the consistency loss term.
[0167] S4: Online prediction and residual generation, including the following steps:
[0168] S4-1: In each sampling period, read the internal and external states output in step S2-3, as well as the historical input sequence and historical output sequence cached in step S3-1, to form the network input vector;
[0169] S4-2: Input the network input vector into the deployed predictor to obtain the prediction output for the next sampling period;
[0170] S4-3: Calculate the mirror output using a mirror model that is completely identical to the parameters of the AVR system and has not been attacked, driven by the real-time input u(t);
[0171] S4-4: Calculate the residuals and store them in the residual sequence;
[0172] S5: Zero-dynamic attack detection includes the following steps:
[0173] S5-1: Set a threshold ε for the residual sequence. The threshold can be set statically or updated online adaptively based on system noise.
[0174] S5-2: If the residual sequence is greater than the set threshold during a continuous sampling period, a zero dynamic attack alarm signal will be output, and the abnormal timestamp will be recorded at the same time.
[0175] Steps S4 and S5 are implemented through the following online detection architecture:
[0176] The controller outputs an input signal u(t) that is simultaneously input to both the real system and the mirror system. The mirror system, serving as an unattacked reference model, generates a normal output y. n (t);
[0177] The observer estimates the internal state of the system in real time based on u(t) and y(t). With external state And utilize the output error e y (t) through gain L φ ,L δ Corrected state estimation;
[0178] Neural networks estimate internal states With external state Using the historical input sequence u(tk:t) and the historical output sequence y(tk:t-1) as inputs, predict the system's output at the next time step.
[0179] The predicted output is the same as the mirror system output y. n (t) Compare to obtain the residual And send it to the residual detection module for judgment;
[0180] By observing the predicted output The changing trend can be used to determine whether the system has been attacked.
[0181] Example 2: To illustrate the system model of the method described in this invention, this example introduces a detailed structural diagram of an AVR system, as follows: Figure 2 As shown, in this system, V ref This represents the reference voltage signal supplied to the generator, ΔV s This represents the terminal voltage measured at the output terminal, with voltage error denoted by ΔV. e The AVR system utilizes this voltage error to regulate the generator output. The error signal is sent to an amplifier, which adjusts the exciter. The exciter then alters the generator's magnetic field current, controlling the generator's output voltage. A voltage sensor continuously monitors the output voltage and feeds it back to the control loop to maintain the required voltage. The system also includes a step-down transformer to convert the generator voltage to a suitable induced level.
[0182] The AVR system model consists of four subsystems: amplifier, exciter, generator, and sensors. Each subsystem can be modeled using a first-order transfer function defined by gain and time constant, neglecting saturation and nonlinearity. The closed-loop control block diagram of the AVR system is shown below. Figure 3 As shown.
[0183] Zero-dynamic attacks exploit the inherent vulnerabilities in a system's control system by leveraging its zero dynamics. Zero dynamics are intrinsic properties of the system's mathematical model, meaning their output is unaffected by specific inputs. This strategy involves constructing attack signals a(t) identical to these zero dynamics, allowing attackers to manipulate the system's behavior without triggering traditional detection mechanisms. Figure 4 As shown, it is assumed that an attacker can inject an attack signal a(t) into the input of a closed-loop system through the network and learn all the model knowledge of the system.
[0184] The structure of the Luenberger observer is as follows: Figure 5 As shown, the input signal u(t) from the controller acts on both the system and the observer, and the system output y(t) and the observer-generated output y(t) are simultaneously applied. L (t) is compared to obtain the output error e yThe error (t) is weighted by the gain matrix L and fed back to the observer to correct the state estimate, so that the observer gradually approaches the true state trajectory in the iteration.
[0185] To achieve accurate prediction of the future output of an automatic voltage regulator system and indirectly reflect the dynamic changes in the system's internal state, this invention designs a state-driven neural network predictor structure. This prediction model uses historical input-output information of the system, as well as the internal and external states estimated by the observer, as feature inputs. By learning a nonlinear mapping relationship, it predicts the system's output value at future moments, providing a criterion for subsequent attack detection.
[0186] Neural network structure such as Figure 6 As shown, the input consists of the following four types of variables, and the estimated internal state is obtained through the observer. Estimated external state obtained through observers The neural network constructs an input vector by concatenating the historical input sequence u(tk:t) and the historical output sequence y(tk:t-1).
[0187] The principle of the detection method is as follows: Figure 7 As shown, the input signal u(t) output by the controller is simultaneously input to both the real system and the mirror system. The mirror system, as an unattacked reference model, generates the normal output y. n (t). The observer estimates the internal state of the system in real time based on u(t) and y(t). With external state And utilize the output error e y (t) through gain L φ ,L δ Correcting the state estimate. The neural network uses the estimated internal state... With external state Using the historical input sequence u(tk:t) and the historical output sequence y(tk:t-1) as inputs, predict the system's output at the next time step. The predicted output is the same as the mirror system output y. n (t) Compare to obtain the residual The data is then sent to the residual detection module for evaluation. Simultaneously, because the neural network incorporates an internal state change consistency loss term during the training phase, the predicted output can be determined by observing the changes. The changing trend can be used to determine whether the system has been attacked.
[0188] Example 3: In this example, we first constructed a typical AVR closed-loop control system based on the simulation parameters in Table 1, and then implemented three detection schemes: traditional upper and lower threshold detection, multiple linear regression prediction detection, and the detection method based on state-driven neural network prediction of this invention. Then, comparative simulations were performed in the MATLAB / Simulink environment for both ordinary zero-dynamic attack and enhanced zero-dynamic attack conditions. The simulation parameters and detection results are shown in Table 1. Figures 8 to 13 As shown.
[0189] Table 1: AVR System Simulation Parameters
[0190]
[0191]
[0192] As shown in Table 1, in the simulation, the amplifier gain is set to 0.1, and the time constant is 10s; the exciter gain is 0.4, and the time constant is 1s; the generator and sensor gains are 1 and 0.01, respectively, with corresponding time constants of 1s each. This parameter combination represents the typical operating conditions of a small synchronous generator AVR commonly used in industry and can realistically reflect the dynamic behavior of the system.
[0193] Anomaly detection methods were used to compare the results of zero-dynamic attack detection. A trained neural network predictor detected both ordinary and enhanced zero-dynamic attacks. The anomaly detection performance was as follows: Figure 8 and Figure 9 As shown, the comparison method yields the following results. Figure 10 and Figure 11 As shown, the effects of the method of the present invention are as follows: Figure 12 and Figure 13 As shown.
[0194] In abnormal data detection methods, the steady-state output μ of the system y ≈15, the maximum observed steady-state perturbation The anomaly detection threshold is defined as sigma = μ y ±∈, with upper and lower thresholds set to [13.5, 16.5]. Output values less than 13.5 or greater than 16.5 will trigger an abnormal alarm. The red line represents the system output, and the blue dashed line represents the set upper and lower thresholds. Figure 8 A typical zero-dynamic attack was exposed after exceeding the threshold limit at 282 seconds. Figure 12 The enhanced zero-dynamic attack was exposed after exceeding the threshold limit at 162s.
[0195] In the testing method for multiple linear regression models, the blue line represents the internal state of the system, the green line represents the predicted output, the red line represents the actual output of the system, and the purple line represents the normal output of the mirror system. Figure 10and 11 It can be seen that although this method can reflect the changes in the internal state of the system by the predicted output after being attacked, and thereby observe the change pattern of the predicted output to judge whether the system has been attacked by zero dynamics, the fitting accuracy of the output before and after the attack is not that high.
[0196] In the neural network predictor detection method, the blue line represents the internal state of the system, the green line represents the predicted output, the red line represents the actual output of the system, and the purple line represents the normal output of the mirror system. Figure 12 and Figure 13 It can be seen that, compared with the detection method of multiple linear regression model, this method can not only observe the general change pattern of the internal state of the system by predicting the output and judge whether the system has been attacked, but also the output fitting accuracy before and after the attack is higher than that of the detection method of multiple linear regression model.
[0197] In this embodiment, a typical AVR closed-loop control system was first built based on the simulation parameters in Table 1 (amplifier gain 0.1, exciter gain 0.4, generator gain 1, sensor gain 0.01 and their respective time constants), and a corresponding mirror system was designed as an unattacked reference model. The online observer uses the pole placement method to ensure fast and accurate estimation of the internal and external states. The neural network predictor uses mean square error as the main loss and is supplemented by state change consistency loss (weight α, scaling factor γ). It is trained for 3000 rounds using the Adam optimizer (learning rate 0.001) and then deployed.
[0198] When a normal zero-dynamic attack is injected, the anomaly detection method based on fixed upper and lower limits (13.5V–16.5V) can only trigger an alarm due to output exceeding the limit after approximately 282 seconds; although the aforementioned multiple linear regression prediction can reflect internal state changes, its detection time is relatively lagging due to insufficient linear fitting accuracy. In contrast, this invention... Figure 12 and Figure 13 The system exhibits earlier and more stable early warnings: the residuals between the predicted output and the mirrored output show a significant deviation in the early stages of an attack, enabling it to capture both normal and enhanced zero-dynamic attacks before the system output exceeds traditional thresholds. Furthermore, the predictor maintains a high fitting accuracy of less than 0.25V in both normal and attack phases, with significantly lower false positive and false negative rates than existing linear models.
[0199] In summary, this invention, through deep coupling of state observation and neural network prediction, not only achieves early warning of highly concealed zero-dynamic attacks, but also has the advantages of high precision, low false alarm, strong real-time performance, and no hardware modification, providing a reliable guarantee for the safe operation of AVR systems.
[0200] The above embodiments merely illustrate implementation methods of the present invention, and while the descriptions are relatively specific and detailed, they should not be construed as limiting the scope of the invention. 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 method for zero dynamic detection of an automatic voltage regulator based on neural network prediction, characterized in that: Includes the following steps: S1: AVR system mathematical model establishment and state partitioning, including the following steps: S1-1: Acquire known physical parameters of the amplifier, exciter, generator, and sensors in the automatic voltage regulator (AVR), including the gain K. a K e K g K s With time constant τ a τ e τ g τ s ; S1-2: Based on the gain and time constant described in step S1-1, establish the first-order transfer function of each subsystem, and connect the transfer functions in series and in parallel to form the open-loop transfer function of the AVR system. S1-3: A proportional-integral (PI) controller is placed before the open-loop transfer function. The proportional gain and integral gain of the PI controller are given by the controller adjustment algorithm to obtain the closed-loop transfer function. S1-4: Construct a fifth-order linear time-invariant state-space model matrix based on the closed-loop transfer function. At the same time, apply the Byrnes-Isidori paradigm transformation to decompose the original state vector into internal state vector and external state vector, and obtain the transformed system matrix. S2: Luenberger State Observer Design and Online State Estimation, including the following steps: S2-1: Construct the Luenberger state observer structure based on the system matrix obtained in step S1-4; S2-2: The observer gain matrix is calculated using the pole placement method, so that all the observer eigenvalues are placed inside the unit circle and the error between the system's true state and the observer's estimated value is converged. The gain matrix is stored in the controller. S2-3: During system operation, drive the observer state update equation, output the estimated internal state and the estimated external state, and set the internal state... and external state Cache to a circular buffer; S3: Construction and training of state-driven neural network predictors, including the following steps: S3-1: Offline Phase: Collect historical datasets, where each sample includes: a historical input sequence of the time window length; a historical output sequence of the time window length; the corresponding estimated internal state; the corresponding estimated external state; the above data are concatenated into a network input vector; the corresponding label is the true output at the next time step. S3-2: Construct a feedforward neural network with learnable parameters, taking the network input vector as input and outputting the predicted value; S3-3: Define the total loss function, use the Adam optimizer to train the network parameters until convergence, and obtain the trained predictor; S3-4: Deploy the trained weights along with the network structure as an online detection module; S4: Online prediction and residual generation, including the following steps: S4-1: In each sampling period, read the internal and external states output in step S2-3, as well as the historical input sequence and historical output sequence cached in step S3-1, to form the network input vector; S4-2: Input the network input vector into the deployed predictor to obtain the prediction output for the next sampling period; S4-3: Calculate the mirror output using a mirror model that is completely identical to the parameters of the AVR system and has not been attacked, driven by the real-time input u(t); S4-4: Calculate the residuals and store them in the residual sequence; S5: Zero-dynamic attack detection includes the following steps: S5-1: Set a threshold ε for the residual sequence. The threshold can be set statically or updated online adaptively based on system noise. S5-2: If the residual sequence is greater than the set threshold during a continuous sampling period, a zero dynamic attack alarm signal will be output, and the abnormal timestamp will be recorded at the same time.
2. The method for zero dynamic detection of an automatic voltage regulator based on neural network prediction according to claim 1, characterized in that: The calculation of the open-loop transfer function in step S1-2 specifically includes the following steps: The amplifier transfer function is expressed as: The exciter transfer function is expressed as: The transfer function of generator terminal voltage and field voltage is expressed as: The sensor transfer function is expressed as: By combining formulas (1), (2), (3), and (4), the open-loop transfer function of the system can be derived as follows: Among them, K a τ represents the amplifier gain. a K represents the amplifier time constant. e τ represents the exciter gain. e K represents the exciter time constant. g τ represents the gain between the generator terminal voltage and the field voltage. g K represents the time constant between the generator terminal voltage and the field voltage. s τ represents the sensor gain. s This represents the sensor's time constant.
3. The method for zero dynamic detection of an automatic voltage regulator based on neural network prediction according to claim 1, characterized in that: The calculation of the closed-loop transfer function in step S1-3 specifically includes the following steps: Set the transfer function of the proportional-integral (PI) controller as follows: Among them, K p K is the proportional gain of the PI controller. i The integral coefficient of the PI controller; Connect G1(s) in series with the open-loop transfer function G0(s) shown in formula (5), where G1(s) is the transfer function of the PI controller and G0(s) is the open-loop transfer function of the AVR control system. Based on the principle of unity negative feedback, the closed-loop transfer function is calculated using the following formula: Among them,K0=K a K e K g K s K p ,K1=K a K e K g K s K i ,τ0=τ a t e t g t s ,τ1=τ a t e +t a t g +t a t s +t e t g +t e t s +t g t s ,τ2=τ a t e t g +t a t e t s +t a t g t s +t e t g t s ,τ3=τ a +t e +t g +t s ,τ4=1+K a K e K g K s K p ,τ5=K a K e K g K s K i 。 4. The method for zero dynamic detection of an automatic voltage regulator based on neural network prediction according to claim 1, characterized in that: The calculation of the system matrix in steps S1-4 specifically includes the following steps: Define the state vector as The formula for calculating the state space is: y(t)=Cx(t), B=[K1 K0 0 0 0] T , C=[1 0 0 0 0]. Among them, V e Let u(t) be the voltage error of the system, y(t) be the input voltage error of the system, and x(t) be the output terminal voltage of the closed-loop system. Let A be the state vector of the closed-loop system, B be the input matrix of the closed-loop system, and C be the output matrix of the closed-loop system. Performing Euclidean polynomial division on the denominator polynomial Den(s) and the numerator polynomial Num(s) of the closed-loop transfer function yields the quotient Quo(s) and the remainder Rem(s). The specific calculation formulas are as follows: Where Den(s) = Quo(s)Num(s) + Rem(s); Based on the degree relationship between Quo(s) and Rem(s), a coordinate transformation matrix T is constructed to decompose the original state vector x(t) into an internal state vector φ(t) and an external state vector δ(t). The specific calculation formula is as follows: Among them, δ(t)=[y(t) y(t+1) y(t+2) y(t+3)] T , λ T δ(t)=y(t)+b m N o φ(t)-b m u(t), M c =[0 0 0 1] T N c = [1 0 0 0]; φ(t+1) is the change of the system's internal state vector; δ(t+1) is the change of the system's external state vector; G o M o N o For the minimum implementation of the feedback path; b m λ is the coefficient in Quo(s); T This is the solution to formula (9); The transformed system matrix and λ are calculated using the coordinate transformation matrix T, thus completing the Byrnes–Isidori normal form transformation.
5. The method for zero dynamic detection of an automatic voltage regulator based on neural network prediction according to claim 1, characterized in that: The mathematical model of the AVR system also includes a zero-dynamic attack modeling, and the system model under zero-dynamic attack is as follows: After receiving an attack, the system model changes as follows: Where a(t) represents the attack data added to u(t) through logical operations, and z(t) is the state vector z(t+1) = G calculated by the attacker using the system matrix. o z(t), a(t) = N o z(t).
6. The method for zero dynamic detection of an automatic voltage regulator based on neural network prediction according to claim 1, characterized in that: In step S2, the Luenberger state observer structure is as follows: the input signal u(t) from the controller acts simultaneously on both the system and the observer; the system output y(t) and the observer-generated output y L (t) is compared to obtain the output error e y (t), this error, after being weighted by the gain matrix L, is fed back into the observer to correct the state estimate. The specific calculation formula is as follows: in, L represents the estimated values of the internal and external states, respectively. φ L δ The observer gain matrix is... This represents the current output error, used for observation correction.
7. The method for zero dynamic detection of an automatic voltage regulator based on neural network prediction according to claim 1, characterized in that: In step S2, the system output y(t) is a linear combination of δ(t), which is achieved by constructing matrix N. c Ensure system observability, and design a suitable L based on this. φ ,L δ To bring the state estimation error to converge, the error between the actual system state and the observer's estimate is defined as follows: Based on the system state equation and the observer state update formula, the calculation formula for the dynamic system of error evolution over time is derived as follows: e δ (t+1)=(G c +M c λ T -L δ N c )e δ (t)+M c b m N o e φ (t), (15) e φ (t+1)=(G φ -L φ N c )e φ (t)+M o N c e δ (t). (16) Among them, G φ L is a system matrix and gain matrix in the dynamic equation of the state estimation error. φ ,L δ The pole placement method is used for selection, while ensuring...
8. The method for zero dynamic detection of an automatic voltage regulator based on neural network prediction according to claim 1, characterized in that: In step S3, the input to the state-driven neural network predictor consists of the following four types of variables, which are estimated internal states obtained through the observer. Estimated external state obtained through observers Given the historical input sequence u(tk:t) and the historical output sequence y(tk:t-1), the neural network constructs a function by concatenating these features into an input vector: Among them, f θ (·) represents a feedforward neural network structure with learnable parameters θ, whose output is a prediction of the future output of the system.
9. The method for zero dynamic detection of an automatic voltage regulator based on neural network prediction according to claim 1, characterized in that: The formula for calculating the total loss function in step S3-3 is as follows: in, Indicates the change in the predicted output; γ represents the change in internal state estimation; γ is the state change scaling factor; α is the weight of the consistency loss term.
10. The method for zero dynamic detection of an automatic voltage regulator based on neural network prediction according to claim 1, characterized in that: Steps S4 and S5 are implemented through the following online detection architecture: The controller outputs an input signal u(t) that is simultaneously input to both the real system and the mirror system. The mirror system, serving as an unattacked reference model, generates a normal output y. n (t); The observer estimates the internal state of the system in real time based on u(t) and y(t). With external state And utilize the output error e y (t) through gain L φ ,L δ Corrected state estimation; Neural networks estimate internal states With external state Using the historical input sequence u(tk:t) and the historical output sequence y(tk:t-1) as inputs, predict the system's output at the next time step. The predicted output is the same as the mirror system output y. n (t) Compare to obtain the residual And send it to the residual detection module for judgment; By observing the predicted output The changing trend can be used to determine whether the system has been attacked.