A method for detecting abnormal data in power system based on mechanism model
By constructing a mathematical model of the power grid and designing an extended Kalman filter, combined with the least squares method, the problem of abnormal data detection in the energy Internet is solved, timely and accurate detection of abnormal data is achieved, and the security of the energy Internet is improved.
Patent Information
- Application Number
- CN202211190870.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-09-28
- Publication Date
- 2024-11-08
- Estimated Expiration
- 2042-09-28
AI Technical Summary
The abnormal data in the huge data set in the energy Internet is difficult to detect in a timely and accurate manner, affecting real-time control and security.
Using the power system abnormal data detection method based on mechanism model, by constructing a grid mathematical model, designing an extended Kalman filter, combining the least squares method, comparing the differences in the processing results of the extended Kalman filter and the least squares method. If it is less than the detection threshold, is normal, otherwise it is an exception.
It realizes timely and accurate detection of abnormal data of the energy Internet, improves the detection effect of nonlinear power systems, and improves the security performance of the energy Internet.
Smart Images

Figure CN115441443B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of energy internet security, and in particular to a method for detecting abnormal data in a power system based on a mechanism model. Background Art
[0002] The increasing depletion of fossil energy has a profound impact on the development direction of energy technology. The contradiction between global energy supply and demand and environmental pressure have prompted people to explore more extensive and clean energy forms, more reasonable energy control methods and more efficient energy use methods. In this context, "The Third Industrial Revolution" proposed the idea of integrating Internet technology and new energy technology, opening the door to energy Internet research.
[0003] Due to the continuous development of the current energy Internet, if the energy Internet under the distributed management structure wants to be more effectively controlled, more complex networks are needed for coordination and control, and these complex networks will continue to generate new data during normal operation and interaction with other networks. These data will accumulate to form a huge data set, and the characteristics of these data sets are very different, forming a multi-dimensional and complex big data stream. Under the integrated mechanism of the energy Internet, even some minor data anomalies may have adverse effects, and the requirements for anomaly detection in real time are getting higher and higher. Summary of the invention
[0004] Purpose of the Invention
[0005] In view of the problem that the adverse effects brought by abnormal data in the huge data set generated by the current energy Internet are too great, the present invention discloses a method for detecting abnormal data in a power system based on a mechanism model, which can timely and accurately discover abnormal data in the energy Internet.
[0006] Technical Solution
[0007] A method for detecting abnormal data in a power system based on a mechanism model comprises the following steps:
[0008] S1. Construct a mathematical model of the power grid, characterize the relationship between the state quantity and quantity measurement of the power system under the AC environment, calculate the increment of the active and reactive power equations of the node based on the sampling data of two adjacent time intervals of the power system, and then derive the state transfer matrix function of the power system;
[0009] S2. Design an extended Kalman filter, perform Taylor expansion on the state transfer matrix function in step S1, retain only the first term, and obtain an extended Kalman filter;
[0010] S3. Execute anomaly detection, specifically steps S31, S32 and S33;
[0011] S31. Processing power system data using the least squares method;
[0012] S32. Processing power system data using the extended Kalman filter in step S2;
[0013] S33. Compare the two data in step S31 and step S32. If the difference between the two is less than or equal to the detection threshold, it means that there is no abnormality. Otherwise, it means that there is an abnormality. The expression is:
[0014]
[0015] in, is the estimated state obtained by the extended Kalman filter processing, is the estimated state obtained by the least squares method, and τ is the detection threshold.
[0016] The extended Kalman filter algorithm is very similar to the ordinary Kalman filter algorithm in form, both of which have state equations and measurement equations, but the extended Kalman filter algorithm is more suitable for nonlinear systems. The power system has a complex nonlinear relationship, and the extended Kalman filter algorithm can efficiently and accurately reflect the relevant physical relationship. In addition, under normal circumstances, the residual value caused by system noise is very small, far less than the set detection threshold. If a set of attack vectors are added, the residual value generated is also likely to be less than the preset detection threshold. At this time, the state estimation system cannot accurately detect. Therefore, the extended Kalman filter is introduced, and the estimated value obtained by using the Kalman filter is compared with the estimated value obtained by the least squares estimation, which can effectively detect abnormal data.
[0017] Furthermore, in step S1, the expression describing the relationship between the state quantity and quantity measurement of the power system under the AC environment is:
[0018]
[0019]
[0020]
[0021]
[0022] Among them, P i is the active power of node i, R i is the reactive power of node i, P ij is the active power through line ij, R ij is the reactive power through line ij, V i 、V j are the voltages at nodes i and j, respectively, is the conductance of line ij' is the susceptance of line ij, M c is the line-to-ground susceptance, C ij is the real part of the element ij in the admittance matrix, N ij is the imaginary part of the element ij in the admittance matrix, θ ij is the intersection difference between node i and node j.
[0023] Furthermore, in step S1, the expression for calculating the increment of the power equation of active and reactive power of the node is:
[0024]
[0025] Among them, ΔP is the total active power increment vector, ΔR is the total reactive power increment vector, ΔP g is the generator active power change vector, ΔP l is the load active power change vector, ΔR g is the generator reactive power change vector, ΔR l is the load reactive power change vector, Δθ and ΔV are the change vectors of node phase angle and voltage assignment caused by the change of system active and reactive power, A, B, C, and D are sub-matrices of the Jacobian matrix, and each element is Among them, θ j is the phase angle amplitude of node j, V j is the voltage amplitude of node j, J is the Jacobian matrix, and Δx is the change of the state variable.
[0026] Furthermore, in step S1, the state transfer matrix function of the power system is:
[0027]
[0028] Simplify the above formula to x k =Q k-1 x k-1 ,in, Among them, x k is the state variable of the system at time k, x k-1 is the state variable of the system at time k-1, is the active and reactive power factor of the nodes in the power system, and I is the unit matrix.
[0029] Further, in step S2, the expression of the extended Kalman filter is:
[0030] x k =f(x k-1 )+ω k ;
[0031] Where f is the state transfer function, ω k is the system error;
[0032] The prediction step of the extended Kalman filter is
[0033]
[0034] in, represents the predicted value of the system state quantity at time k obtained by using the state transfer matrix at time k-1, P k-1 is the covariance matrix, is the state prediction error covariance matrix at time k, w k-1 is the process noise;
[0035] The filtering step of the extended Kalman filter is
[0036]
[0037] in, is the estimated value of the state at time k, K k is the Kalman gain matrix, z k is the attack vector, h is the measurement equation, R k is the measurement noise variance, H k is the Jacobian matrix of the measurement equation, P k is the filtering error covariance matrix at time k.
[0038] Beneficial Effects
[0039] The present invention can timely and accurately discover abnormal data in the energy internet. The use of the extended Kalman filter can effectively optimize the detection effect of the method on nonlinear power systems, effectively improve the safety performance of the energy internet, and ensure that it can give full play to its maximum benefits. BRIEF DESCRIPTION OF THE DRAWINGS
[0040] Figure 1 The figure is a flow chart of the overall method of the present invention. DETAILED DESCRIPTION
[0041] In order to enable those skilled in the art to better understand the content of the present invention, the present invention is further described in conjunction with the accompanying drawings and specific implementation methods.
[0042] A method for detecting abnormal data in a power system based on a mechanism model comprises the following steps:
[0043] S1. Construct a mathematical model of the power grid, characterize the relationship between the state quantity and quantity measurement of the power system under the AC environment, calculate the increment of the active and reactive power equations of the node based on the sampling data of two adjacent time intervals of the power system, and then derive the state transfer matrix function of the power system;
[0044] The specific mathematical expression that describes the relationship between the state quantity and quantity measurement of the power system under AC environment is:
[0045]
[0046]
[0047]
[0048]
[0049] Among them, P i is the active power of node i, R i is the reactive power of node i, P ij is the active power through line ij, R ij is the reactive power through line ij, V i 、V j are the voltages at nodes i and j, respectively, is the conductance of line ij, is the susceptance of line ij, M c is the line-to-ground susceptance, C ij is the real part of the element ij in the admittance matrix, N ij is the imaginary part of the element ij in the admittance matrix, θ ij is the intersection difference between node i and node j;
[0050] The expression of the power equation increment for calculating the active and reactive power of the node is
[0051]
[0052] Among them, ΔP is the total active power increment vector, ΔR is the total reactive power increment vector, ΔP g is the generator active power change vector, ΔP l is the load active power change vector, ΔR g is the generator reactive power change vector, ΔR l is the load reactive power change vector, Δθ and ΔV are the change vectors of node phase angle and voltage assignment caused by the change of system active and reactive power, A, B, C, and D are sub-matrices of the Jacobian matrix, and each element is Among them, θ j is the phase angle amplitude of node j, V j is the voltage amplitude of node j, J is the Jacobian matrix, and Δx is the change of the state variable;
[0053] The state transfer matrix function of the power system is:
[0054]
[0055] Simplify the above formula to x k =Q k-1 x k-1 ,in, Among them, x k is the state variable of the system at time k, x k-1 is the state variable of the system at time k-1, is the active and reactive power factor of the node in the power system, and I is the unit matrix;
[0056] S2. Design an extended Kalman filter, perform Taylor expansion on the state transfer matrix function in step S1, retain only the first term, and obtain an extended Kalman filter;
[0057] The expression of the extended Kalman filter is:
[0058] x k =f(x k-1 )+ω k ;
[0059] Where f is the state transfer function, ω k is the system error;
[0060] The prediction step of the extended Kalman filter is
[0061]
[0062] in, represents the predicted value of the system state quantity at time k obtained by using the state transfer matrix at time k-1, P k-1 is the covariance matrix, is the state prediction error covariance matrix at time k, W k-1 is the process noise;
[0063] The filtering step of the extended Kalman filter is
[0064]
[0065] in, is the estimated value of the state at time k, K k is the Kalman gain matrix, z k is the attack vector, h is the measurement equation, R k is the measurement noise variance, H k is the Jacobian matrix of the measurement equation, P k is the filtering error covariance matrix at time k;
[0066] S3. Execute anomaly detection, specifically steps S31, S32 and S33;
[0067] S31. Processing power system data using the least squares method;
[0068] S32. Processing power system data using the extended Kalman filter in step S2;
[0069] S33. Compare the two data in step S31 and step S32. If the difference between the two is less than or equal to the detection threshold, it means that there is no abnormality. Otherwise, it means that there is an abnormality. The expression is:
[0070]
[0071] in, is the estimated state obtained by the extended Kalman filter processing, is the estimated state obtained by the least squares method, and τ is the detection threshold.
[0072] The above is only a preferred embodiment of the present invention. It should be pointed out that for ordinary technicians in this technical field, several improvements and modifications can be made without departing from the principle of the present invention. These improvements and modifications should also be regarded as the scope of protection of the present invention.
Claims
1. A method for detecting abnormal data in a power system based on a mechanism model, characterized in that: The following steps are involved: S1. Construct a mathematical model of the power grid, characterize the relationship between the state quantity and quantity measurement of the power system under the AC environment, calculate the increment of the active and reactive power equations of the node based on the sampling data of two adjacent time intervals of the power system, and then derive the state transfer matrix function of the power system; S2. Design an extended Kalman filter, perform Taylor expansion on the state transfer matrix function in step S1, retain only the first term, and obtain an extended Kalman filter; S3. Execute anomaly detection, specifically steps S31, S32 and S33; S31. Processing power system data using the least squares method; S32. Processing power system data using the extended Kalman filter in step S2; S33. Compare the two data in step S31 and step S32. If the difference between the two is less than or equal to the detection threshold, it means that there is no abnormality. Otherwise, it means that there is an abnormality. The expression is: in, is the estimated state obtained by the extended Kalman filter processing, is the estimated state obtained by the least squares method, and τ is the detection threshold.
2. The method for detecting abnormal data in a power system based on a mechanism model according to claim 1, characterized in that: In step S1, the expression describing the relationship between the state quantity and quantity measurement of the power system under the AC environment is: Among them, P i is the active power of node i, R i is the reactive power of node i, P ij is the active power through line ij, R ij is the reactive power through line ij, V i 、V j are the voltages at nodes i and j, respectively, is the conductance of line ij, is the susceptance of line ij, M c is the line-to-ground susceptance, C ij is the real part of the element ij in the admittance matrix, N ij is the imaginary part of the element ij in the admittance matrix, θ ij is the intersection difference between node i and node j.
3. The method for detecting abnormal data in a power system based on a mechanism model according to claim 1, characterized in that: In step S1, the expression for calculating the increment of the active and reactive power equation of the node is: Among them, ΔP is the total active power increment vector, ΔR is the total reactive power increment vector, ΔP g is the generator active power change vector, ΔP l is the load active power change vector, ΔR g is the generator reactive power change vector, ΔR l is the load reactive power change vector, Δθ and ΔV are the change vectors of node phase angle and voltage assignment caused by the change of system active and reactive power, A, B, C, and D are sub-matrices of the Jacobian matrix, and each element is Among them, θ j is the phase angle amplitude of node j, V j is the voltage amplitude of node j, J is the Jacobian matrix, and Δx is the change of the state variable.
4. The method for detecting abnormal data in a power system based on a mechanism model according to claim 1, characterized in that: In step S1, the state transfer matrix function of the power system is: Simplify the above formula to x k =Q k-1 x k-1 ,in, Among them, x k is the state variable of the system at time k, x k-1 is the state variable of the system at time k-1, is the active and reactive power factor of the nodes in the power system, and I is the unit matrix.
5. The method for detecting abnormal data in a power system based on a mechanism model according to claim 1, characterized in that: In step S2, the expression of the extended Kalman filter is: x k =f(x k-1 )+ω k ; Where f is the state transfer function, ω k is the system error; The prediction step of the extended Kalman filter is in, represents the predicted value of the system state quantity at time k obtained by using the state transfer matrix at time k-1, P k-1 is the covariance matrix, is the state prediction error covariance matrix at time k, W k-1 is the process noise; The filtering step of the extended Kalman filter is in, is the estimated value of the state at time k, K k is the Kalman gain matrix, z k is the attack vector, h is the measurement equation, P k is the measurement noise variance, H k is the Jacobian matrix of the measurement equation, P k is the filtering error covariance matrix at time k.
