1. Introduction
The operation of a power system requires the ability to issue control instructions to the system according to real-time changes in load and system power to maintain the frequency stability and active power balance of the system. However, since the change period of the load is generally at the second level, the period of state estimation and even manual control cannot be precisely controlled, so an automatic generation control system (AGC) is required to regulate the system.
An AGC system is a modern interconnected power grid system that maintains the power balance and frequency stability of the power system by regulating the output of frequency-modulated generators in the control area to preserve the real-time balance of power generation and load and the planned power exchange between areas. The operation of the AGC system depends on the network communication facilities to monitor the status and issue control instructions, and there is less human intervention, so it is more vulnerable to network attacks. The operation of the AGC system is highly dependent on communication technology and telemetry data, which further increases the threat of network attacks against the AGC system on the power system. In this case, the AGC system has become one of the essential targets of hacker attacks. Therefore, network intrusion detection is critical for innovative grid development and industrial automation level improvement.
At present, the primary purpose of attacking an AGC system is to cause an active power imbalance in the regional power system, further driving the system frequency to decline or the power to overload the regional tie-line [
1,
2,
3,
4,
5,
6]. In an attack against an AGC system, a false data injection attack is the principal means. By tampering with telemetry frequency, tie line power, or directly tampering with other state variable data, such as regional control error, the attacker makes the AGC system incorrectly estimate the unbalanced regional power, causing the AGC system to make wrong decisions and leading to power incidents such as the grid frequency being out of bounds and regional tie-line overload. The power grid frequency measurement device itself has high redundancy. According to this feature, the literature [
7,
8,
9,
10] has proposed an attack scheme for system power measurement. One study [
11] proposed a method to directly attack the regional error control signal, bypassing the telemetry data detection link. In the research of attack modeling, the literature [
12,
13,
14] has proposed a jump attack, slope attack, noise injection attack, overcompensation attack, and other models based on the basic attack model. Another study [
15] suggested a sonar attack. The attacker tampered with the load demand data in the regional power system, resulting in an imbalance in system power, and launched attacks on the power of tie lines according to the frequency change speed to cause instability in the frequency oscillation.
Currently, the attack detection schemes against false data injection attacks on AGC systems mainly include three types of methods. The first category is based primarily on regional error signal detection methods. This method uses historical data to count and monitor regional control errors. It uses historical data to predict regional control error values through some methods to identify abnormal regional error control values. One study [
16] proposed a typical detection scheme that belongs to the first category of methods. Based on the research on anomaly detection of the regional error control signals, relevant literature [
17] considers the continuity detection of regional error control signals and its derivative by jump and pull-off attacks as preliminary detection. A study [
18] selected a method based on a multi-layer perceptron classifier to extract the difference between the regional control error signals under attack and regular operation and to distinguish whether an attack occurred. In addition to the research methods of area control error (ACE) signal anomaly detection, there are also research methods of attack detection based on ACE signal prediction. One article [
19] used real-time load forecasting to forecast ACE and proposed detection indicators based on ACE time series characteristics and ACE statistical characteristics. After detecting the existence of the attack, this method used the predicted ACE signal instead of the attacked ACE signal to mitigate the attack. Other researchers [
20] combined load forecasting information, considered the range of variation of various loads, gave the prediction range of ACE signals, and used ACE data identification to mitigate attacks. There is also literature [
21,
22] that predicted ACE signals through long-term and short-term memory network learning, directly using the expected ACE values and the comparison of ACE measurement values for attack detection.
The second kind of method is mainly model-based detection methods. This method primarily builds a state estimator on the AGC system model structure and uses the technique to process the attack variables subject to false data injection. Finally, by comparing the estimated value and the observed value of the attacked variable, the attack variable is also set as an estimated variable to achieve the attack detection effect. One study [
23] proposed a detection method based on the Kalman filter for AGC, which uses estimated residuals to realize false data injection attack (FDIAs) detection. References [
24,
25] proposed an unknown input estimator, which can detect FDIAs by detecting the estimator residual when it is out of bounds. This method requires the high accuracy of the AGC system’s equivalent model.
The third type of method is mainly based on data-driven detection methods, which analyze the attack scenario and use it for attack detection. Reference [
26] proposed a semi-supervised hierarchical density space clustering method considering noise by using data in different attack scenarios and realizing the identification of various attack types through training. Another study [
27] proposed an online monitoring method based on spatio-temporal data, which uses the consistency information from remote sensing data to learn and apply the consistency information of different modes online through semi-supervised K-means clustering and realizes attack detection. Among these methods, semi-supervised detection methods rely heavily on training samples from other original scenes, so sample acquisition is the key to such practices.
False data injection attacks are one of the most threatening data integrity attacks to modern power system operations in recent years. Concealed means of injecting inaccurate measurement data can bypass existing attack detection technologies. The transition process of state variables in the power grid is relatively fast. Still, the change speed of state variables in the AGC system is slow, and the control effect has a delayed response, which allows network attackers to change the dynamic process of control signals more covertly, making the traditional detection methods unable to detect exceptions. Therefore, this paper proposes a random forest algorithm of time series, which has a good detection effect against hidden false data injection attacks.
Due to the imbalance of the experimental samples, the synthetic minority oversampling technique (SMOTE) oversampling algorithm is used to preprocess the experimental samples. The training data are divided into a training set and a test set, and the training set is used to train the detection model. The test set is used to detect the superiority of the model, such as accuracy, recall, F1 score, and confusion matrix. In this paper, the performance indexes of machine learning algorithm models classified by support-vector machines (SVM), decision trees, K-nearest neighbors (KNN), etc., are compared and analyzed with the same dataset samples, and the advantages of the random forest algorithm model are verified. By comparing the experimental results of various integrated learning methods, it is proved that the random forest algorithm based on time series can achieve significant advantages in feature analysis. The detection results also maintain a high degree of consistency with the simulated attack scenarios.
Compared with the existing detection and research methods, the method based on random forest data mining proposed in this paper is less complex, does not require additional measurement redundancy or substantial cost investment of state observers, and has the characteristics of wide applicability. At the same time, the occurrence of a false data injection attack is not achieved overnight. However, through a certain time dimension to gradually induce the accumulation of system error decision-making, this research method can observe the dynamic process of voting of each decision tree and then improve the stability of system operation.
2. AGC System Model
2.1. Composition and Physical Structure of the AGC System
The AGC system mainly comprises two modules: the load frequency control (LFC) and the economic dispatch control (EDC). The LFC system is used to ensure that the frequency of the regional power system is maintained within the normal fluctuation range, to ensure the balance between the active power and the load sent by the system, and to support adjacent power systems to solve the problem of power shortages. The EDC system is used to ensure that the output of each unit participating in AGC system frequency modulation in the regional power grid is in an excellent economic operation state. The EDC system uses the active power distribution method of equal consumption micro increment rate to distribute ACE signals to each team participating in AGC frequency modulation, to ensure that the minimum amount of primary energy is used to generate as much electricity as possible, and to improve the energy utilization efficiency.
Physically, the AGC system is mainly composed of three systems: the power dispatching master station control, information transmission, and the power plant control. The signal sent by the control system of the power dispatching master station is sent to the power plant control system through the information transmission system to control the output of the generator unit. The power plant control system returns the operation status of each unit to the power dispatching master station control system through the information transmission system, in which the automatic generation control system master station control system is included in the energy management system.
2.2. AGC Control Mode
An AGC system mainly has three control modes. The first control mode is constant frequency control (CFC). In this control mode, the AGC system maintains the regional system frequency at a constant value and takes this condition as the target of controlling the unit output. At this time, the ACE signal only contains the power deviation generated by frequency offset. The second control mode is the fixed tie line net exchange power control (CNIC). Under this control mode, the AGC system makes the net exchange power of the tie line between the adjacent system and the system constant to the planned value. At this time, the ACE signal only contains the deviation of the net exchange power of the tie line. The third control mode is the tie line net exchange power and frequency offset control mode (TBC). Under this control mode, the AGC system makes the system frequency and tie line net exchange power at the planned value, and the ACE signal includes the deviation jointly generated by the frequency offset and tie line net exchange power.
TBC control is one of the most widely used and effective AGC system control methods. The TBC control mode has two crucial advantages. First, the power system can realize the decentralized and independent control of regional systems without communicating between various interconnected systems. Second, the power deviation and frequency deviation of tie lines can be controlled within the allowable range at the same time. The TBC mode has sound effects on power transmission, the economical operation of large-capacity generator units, accident support, and the improvement of frequency quality. The main research scope of this paper is false data injection attack detection based on the TBC control mode.
When the AGC control mode is TBC, the regional control error signal is jointly affected by the power deviation of the tie line Δ
Ptie and the frequency deviation Δ
f of the tie line. The calculation formula is as follows:
where
B is the frequency deviation coefficient, which is usually a fixed constant.
2.3. State Variables of the AGC System
The AGC system is one of the essential core functions of the energy management system (EMS) system. The operation data of the power system is collected by a remote terminal unit (RTU) and sent to the EMS system through the communication system. The EMS system analyzes and calculates the collected information to obtain the system’s ACE signal and configures the dynamic power adjustment of each generator unit according to the ACE signal’s value and the primary constraints of the power system operation. This process is called the decision-making process of the EMS system.
The signals collected by the AGC system include the frequency signal, the net exchange power signal of tie line, the governor power signal, and the prime mover output power signal.
The regional AGC system mainly includes five state variables, namely the frequency deviation, Δf; the power deviation of the tie line, ΔPtie; the governor power deviation, ΔPg; the turbine power deviation, ΔPt; and the control error, ACE.
Let f be the system frequency (instantaneous value), and let f0 be the rated frequency of the system, 50 Hz.
The definition formula of Δ
f is as follows:
The measurement redundancy of Δf is relatively high, and there are many measuring points, all of which are located in the regional power system.
Ptie is the sum of the power (instantaneous value) of tie lines in the area, and
P0 is the preplanned exchange power of tie lines. The definition of Δ
Ptie is as follows:
The data acquisition point of ΔPtie is located on the regional exchange power tie line.
ΔPg is the difference between the expected power of the governor and the actual power, and ΔPt is the difference between the planned power of the turbine and the real power of the turbine.
2.4. False Data Injection Attack
False data in a power system refers to the inconsistency between the operation data of the power system obtained in the process of data acquisition and the operation state data of the existing power system. False data injection attacks are among the most threatening data integrity attacks to modern power system operations in recent years. This means of injecting inaccurate measured data can bypass the existing attack detection technology. Currently, the false data injection attack models for AGC systems mainly include scaling attacks, slope attacks, pulse attacks and random attacks.
2.4.1. Scaling Attack
The scaling attack involves amplifying or reducing the real signal value. The amplified or reduced signal will be transmitted to the following link of the system as the real signal, which will have an attack effect on the system. The effect of this attack depends on the characteristics of the signal. This kind of attack also has a good latency effect. The attack function of the scaling attack can be expressed by the following Formula (4):
In this formula, y(t) represents the AGC state variable data collected when there is no attack, y*(t) represents the value when the collected AGC system state data is attacked by false data injection, and λs is a constant.
2.4.2. Slope Attack
The principle of a slope attack is to add a time-related false data injection attack to the real signal. The effect of this type of attack will gradually increase with the increase in time and has a specific latency, as shown in Formula (5):
In this formula, y(t) represents the AGC state variable data collected when there is no attack, y*(t) represents the value when the collected AGC system state data is attacked by false data injection, and λr is a constant.
2.4.3. Pulse Attack
A pulse attack is a real signal with discontinuous and intermittent amplification or reduction. The attack is intermittent, so this type of attack has a strong concealment, a prolonged attack cycle, and a specific latency. Compared with a scaling attack, a scaling attack amplifies or narrows the measured value during the attack, while a pulse attack modifies the measured value through short interval pulses with attack parameters.
where
y*(t) is a piecewise periodic function, and the period is
T. When
t ∈ [
kT, (k + 1)
T],
k ∈
Z is in the interval [
kT, t], and the value of
y*(t) is 0, and
y*(t) is
y*(t) = (1 +
λp)
× y(t) on the interval [
t, (k + 1)
T].
2.4.4. Random Attack
A random attack is a process in which a random attack amount is superimposed on a real measured signal to generate a false data injection attack effect. The expression is as follows:
Among them, y(t) represents the AGC state variable data collected when there is no attack, y*(t) represents the value when the AGC system state data collected is attacked by a false data injection, and rand(a,b) represents the random value in the (a,b) interval.
False data injection attacks usually go through two stages. In the first stage, hackers must use gateway vulnerabilities to invade information systems. In the second stage, hackers need to tamper with information, injecting false information. In order to not alert the system, attackers often do not directly launch a large number of false data attacks because such actions can easily expose the location of the attack node and can be detected by simple measuring instruments. Therefore, an attack usually first enters the attack latency period, and only after a certain period of time will it have a pronounced attack effect on the system.
LFC in the AGC system is a closed-loop control with a fixed structure. The change in the load under regular operations is the main factor that causes the change in the state variables in the AGC system. The change characteristics of five-dimensional state variables (frequency deviation, governor power deviation, steam turbine power deviation, tie line power deviation, and regional control deviation of the regional power system) are traceable only under the influence of load. When a false data injection attack is added to the intermediate link, this is equivalent to the original transfer function of the LFC system being tampered with. At this time, the movement track of the five-dimensional state variable changes, and at this attack time, the entropy value of the state variable will be affected, which is different from the change in the entropy value that occurs when the regional power grid system carries the average load. On this basis, the machine learning idea is used to classify the running track of the system state under attack and the running track of the five-dimensional variable under a normal state to judge whether the system is attacked by false data injection, the state variable under attack, and the time when the attack occurs.
3. Detection of False Data Injection Attack Based on Random Forest
Based on the discussion of various machine learning detection models, this paper adopts a random forest algorithm based on time series to output the results by voting by integrating many decision trees to realize the detection of false data injection attacks.
A random forest can be understood as a set of decision trees, which is used to aggregate many decisions into one result and operates by building a large number of decision trees at training time. It is, therefore, a tree-based machine learning algorithm that uses the power of multiple decision trees to make decisions. A decision tree is an efficient and straightforward supervised learning algorithm. The tree structure classifier obtained after training can classify data according to the tree, so it is called a decision tree. It starts from the root node of the tree, selects the optimal splitting attribute, and then keeps splitting to form tree-building nodes one by one until it can no longer continue to separate out of the new node. The decision tree created by training can be used for prediction or classification detection. When testing, the detection data are selected from the root node using the decision tree model, and the last leaf node is the test result label.
3.1. Detection Principle of Random Forest Algorithm
The random forest algorithm is the typical and most representative algorithm in the bagging integration algorithm. It combines the bagging method and the random subspace partition method to achieve the “double randomness” of data selection and feature selection.
On the one hand, bagging first uses random sampling with placement to process the training set into multiple training subsets. Then, the classifier will generate a weak classifier set after using these training subsets for separate training. Finally, the weak classifier will be integrated according to some classification results to obtain a robust classifier with robust classification performance. The classification performance of a strong classifier composed of a set of weak classifiers has apparent advantages over a single robust classifier [
28].
On the other hand, the random subspace partition method first selects the data attributes of the dataset many times to form several datasets with different characteristics, then uses these different attribute datasets to generate a decision tree, and finally integrates the classification results of the decision tree. The random subspace method has obvious advantages over the data classification method of the single decision tree [
29].
Combining the benefits of the two, the random forest algorithm uses bootstrap sampling to construct a set of multiple decision trees from a single decision tree based on the classification and regression tree (CART) node splitting algorithm. Finally, it uses a voting algorithm to process the classification results of numerous decision trees to achieve data classification.
In this paper, the random forest algorithm based on time series is used to integrate and process different types of time series original data. Then, the random forest algorithm is used to train and model the data. By tuning the model, the model can be used to detect and judge new data in real time.
The dataset used in this paper can be divided into two parts: average data and attacked data. After preprocessing and splicing, dataset
Dn*t can be obtained, where
n is the number of datasets,
t is the dimension of the time series, and the training dataset contains the category Label. An example of the data is shown in Dataset
D in the block diagram on the left side of
Figure 1. This paper uses the random forest algorithm based on time series. The basic model of the random forest algorithm is the decision tree. Its principle is shown in
Figure 1, and the data example is shown in Dataset
D in the exemplary block diagram. The decision tree model calculates the information gain based on the input data and can obtain the best segmentation dimension and segmentation point.
The algorithm for obtaining the best segmentation dimension and segmentation point from the decision tree model is shown in Equation (8). E is a method to measure the degree of dataset confusion and is generally calculated by entropy. The decision tree traverses all data n and all values in the data t. The selections are used as temporary segmentation dimensions and segmentation points to obtain the segmented data and calculate the degree of confusion E(D,n,t). Finally, the partition dimension and partition point that make G the smallest are selected, and the data are divided to obtain the left and correct sub-node data.
As shown in
Figure 1 above, the best-dividing dimension is t1, and the best-dividing point is t1 = 0.3. According to this condition, Dataset
D can be divided into two sub-datasets,
D1 and
D2, respectively. For data with a t1 dimension value greater than 0.3, we proceed to the left sub-node. For data with a t1 dimension value less than or equal to 0.3, it is divided into the right sub-node. Further, the information gain of the two sub-node datasets is calculated, and they are divided into subsets
D3 and
D4 until all the data in the
D3 dataset have the same label. Then, this node cannot be divided again; that is, it becomes a leaf node. Similarly,
D4 is also a leaf node. Through the above splitting process, a decision tree model is built, and multiple decision trees are obtained through the same training process. All the trees form a complete random forest model.
The detection process uses the trained random forest model to vote on the real-time AGC system state data. The real-time detected
D dataset is voted on by the random forest decision tree, where the number of votes obtained is
K, the total number of votes obtained is
K, which contains labels of different types of states, the number of decision trees with the largest proportion of the same label is output is
K1, and the output detection probability
P is:
Because the false data injection attack does not happen overnight, through the accumulation of false data injection of continuous time segment state variable deviation signals, the frequency of the system gradually drops to the point of collapse. The random forest algorithm based on time series can find the deviation changes in the state variables caused by the injection of false data. Therefore, compared with the ordinary random forest, the random forest algorithm based on time series is more suitable for the process of entropy change in the time segment of the system. It is helpful to reflect on the dynamic process of voting of each decision tree to achieve a better attack detection effect.
3.2. Processing of Test Results
Because the result of the random forest algorithm used in this paper is the probability of the AGC system being attacked, it is difficult to judge whether the AGC system is attacked directly according to the detection results. Based on this, this paper needs to deal with it after obtaining the probability of being attacked.
First, because the change in the adjacent time probability can directly reflect whether the system is attacked, this paper first calculates the first difference in the detection results.
where
x is the change of detection result (probability).
Then, it needs to be centralized and standardized. The purpose of this is to process the test results through centralization and standardization to obtain the data subject to standard normal distribution that are conducive to subsequent classification tests. Therefore, Z-core standardization is adopted in this paper to realize data processing, as shown in Formula (11):
where
x’ is the first difference of standardized probability.
Z-score standardization is a standard score, also known as the Z-score. It describes the relative distance of a specific value in the dataset. This method can effectively judge the close standard distance of the average length of a detection value.
Finally, the absolute value of the test result after Z-score standardization is calculated.
where
x0 is the initial value of system operation, and the initial default value of system operation is the standard state operation data;
yn is the standardized value of the primary difference corresponding to each state variable.
When the system is not attacked, the value detected by the attack detection model is equal to the average value of the detection value. When the detection model detects that the attack signal is generated, the detection value measured at that time will deviate from the average value. As the amount of data collected by the AGC online monitoring system is too large, once there is an abnormal value, the distance between the value detected at this time and the value detected at other times will be instantly extended. The original parameters detected in real time by the Z-score standardization sequence can judge the existence of attacks and detect the relative distance between the detected value and the normal value. At the same time, this distance can also be used as the size of false data injection attacks.