Substation anomaly detection model training method, anomaly detection method and device

The substation anomaly detection model uses an autoregressive moving average and logistic regression model to predict future anomalies, addressing the lack of timely warnings in existing monitoring methods and ensuring power grid safety and stability.

CN119128514APending Publication Date: 2024-12-13NEI MENG GU CHAO GAO YA GONG DIAN JU
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411147239.1
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-08-21
Publication Date
2024-12-13

AI Technical Summary

Technical Problem

Existing substation monitoring methods, such as real-time monitoring and daily protective monitoring, fail to provide timely warnings for potential failures, compromising the safety and stability of the power grid.

Method used

A substation anomaly detection model is trained using an autoregressive moving average model and a logistic regression model, utilizing historical power data and abnormal records to predict future anomalies, enabling timely warnings.

Benefits of technology

The model effectively predicts substation abnormalities, allowing for timely warnings and preventing potential faults, thereby enhancing the safety and stability of the power grid.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119128514A_ABST
    Figure CN119128514A_ABST
Patent Text Reader

Abstract

The embodiment of the invention provides a transformer substation anomaly detection model training method and device, an anomaly detection method and device and electronic equipment, and relates to the technical field of transformer substation detection. The method comprises the following steps: acquiring a historical data set of a transformer substation, and preprocessing the historical data set to obtain a preprocessed standard data set; the standard data set comprises power data of the transformer substation and abnormal records of the transformer substation; inputting the power data into an autoregressive moving average model for training to obtain a power data prediction model; and inputting the power data and the abnormal record into a logistic regression model for training to obtain a transformer substation anomaly detection model. Therefore, the abnormal condition of the transformer substation in a future period of time can be judged, and timely early warning can be carried out when potential faults occur in the transformer substation.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of substation detection technology, and in particular to a substation anomaly detection model training method, anomaly detection method, device and electronic equipment. Background Art

[0002] With the rapid development of the power industry, substations are the core components of the power system, and their abnormal operation directly affects the safety and stability of the entire power grid. Therefore, real-time monitoring and early warning of substation operation abnormalities are particularly important.

[0003] At present, it is mainly carried out through real-time monitoring, which mainly includes key maintenance monitoring and daily protective monitoring. Key maintenance monitoring monitors equipment defects through real-time monitoring or regular inspections to avoid serious failures. However, this method cannot provide timely warnings when potential failures occur in substations. Summary of the invention

[0004] In view of this, an object of an embodiment of the present invention is to provide a substation anomaly detection model training method, anomaly detection method, device and electronic device to at least partially improve the above-mentioned problem.

[0005] In order to achieve the above purpose, the technical solution adopted by the embodiment of the present invention is as follows:

[0006] In a first aspect, an embodiment of the present invention provides a substation anomaly detection model training method, which is applied to a substation anomaly detection model training system, wherein the substation anomaly detection model training system includes an autoregressive moving average model and a logistic regression model, and the method includes:

[0007] Acquire a historical data set of the substation, preprocess the historical data set to obtain a preprocessed standard data set; the standard data set includes power data of the substation and abnormal records of the substation;

[0008] Inputting the power data into the autoregressive moving average model for training to obtain a power data prediction model;

[0009] The power data and the abnormal records are input into the logistic regression model for training to obtain a substation abnormality detection model.

[0010] Optionally, the power data includes the voltage of the substation, the current of the substation, the power of the substation and the temperature of the electric cabinet of the substation, and the step of inputting the power data into the autoregressive moving average model to obtain the power data prediction model includes:

[0011] According to the voltage, the current, the power and the temperature of the electric cabinet, the autoregressive order of the autoregressive moving average model and the moving average order of the autoregressive moving average model are calculated to obtain an autoregressive moving average candidate model;

[0012] Calculating estimated parameters of the autoregressive moving average candidate model using a maximum likelihood estimation algorithm;

[0013] Check whether the residual of the candidate autoregressive moving average model satisfies the white noise assumption. If so, use the candidate autoregressive moving average model as the power data prediction model.

[0014] Optionally, the step of inputting the power data and the abnormal records into the logistic regression model for training to obtain a substation abnormality detection model includes:

[0015] Setting weights, biases, and loss functions of the logistic regression model;

[0016] Dividing the power data and the abnormal records into N training sets;

[0017] Each training set is input into the logistic regression model in a loop, the value of the loss function and the gradient of the logistic regression model are calculated, and the weight and the bias are updated until the Mth training cycle meets the preset conditions, then the training is terminated and the trained logistic regression model is used as the substation anomaly detection model.

[0018] Optionally, the training set includes at least one sample, and the step of inputting each of the training sets into the logistic regression model, calculating the value of the loss function, the gradient of the logistic regression model, and updating the weight and the bias includes:

[0019] Calculating the prediction probability that the prediction result is a positive class according to the power data of a single sample;

[0020] Calculate the derivative of the loss function with respect to the predicted probability according to the true label of the sample and the predicted probability;

[0021] Calculating the derivative of the loss function with respect to the weight and the derivative of the bias;

[0022] Calculating the gradient of the logistic regression model according to the derivative of the predicted probability, the derivative of the weight, and the derivative of the bias;

[0023] According to the gradient and learning rate of the logistic regression model, the weight of the logistic regression model and the bias of the logistic regression model are updated.

[0024] Optionally, the step of preprocessing the historical data set to obtain a preprocessed standard data set includes:

[0025] Processing the abnormal values ​​of the historical data set to obtain a normal data set;

[0026] The normal data set is standardized to obtain the standard data set.

[0027] Optionally, the step of processing the abnormal values ​​of the historical data set to obtain a normal data set includes:

[0028] Calculate the average value of the historical data set, and find the abnormal value according to the average value;

[0029] The outlier is replaced by the average of the values ​​of its neighboring data.

[0030] In a second aspect, an embodiment of the present invention provides a substation anomaly detection method, which is applied to a substation anomaly detection model, wherein the substation anomaly detection model includes a power data prediction model and a logistic regression model, and the method includes:

[0031] Obtain the power data and environmental data of the substation within a period of time before the current time;

[0032] Inputting the power data into the power data prediction model to obtain predicted power data of the substation for a period of time in the future;

[0033] The predicted power data is input into the logistic regression model to obtain the abnormal probability of the substation.

[0034] In a third aspect, an embodiment of the present invention provides a substation anomaly detection model training device, which is applied to a substation anomaly detection model training system. The substation anomaly detection model training system includes an autoregressive moving average model and a logistic regression model. The device includes:

[0035] A data processing unit, used to obtain a historical data set of the substation, preprocess the historical data set, and obtain a preprocessed standard data set; the standard data set includes power data of the substation and abnormal records of the substation;

[0036] A power data prediction model training unit, used for inputting the power data into the autoregressive moving average model for training to obtain a power data prediction model;

[0037] The logistic regression model training unit is used to input the power data and the abnormal records into the logistic regression model for training to obtain a substation abnormality detection model.

[0038] In a fourth aspect, an embodiment of the present invention provides a substation anomaly detection device, which is applied to a substation anomaly detection model, wherein the substation anomaly detection model includes a power data prediction model and a logistic regression model, and the device includes:

[0039] A data acquisition unit, used to acquire power data and environmental data of the substation within a period of time before the current time;

[0040] A power data prediction unit, used for inputting the power data into the power data prediction model to obtain predicted power data of the substation for a period of time in the future;

[0041] The substation abnormality judgment unit is used to input the predicted power data into the logistic regression model to obtain the substation abnormality probability.

[0042] In a fifth aspect, an embodiment of the present invention provides an electronic device, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor implements any of the methods described above when executing the program.

[0043] The embodiment of the present invention provides a substation abnormality detection model training method, anomaly detection method, device and electronic equipment, which obtains the historical data set of the substation, pre-processes the historical data set, obtains the pre-processed standard data set, the standard data set includes the power data of the substation and the abnormal records of the substation, inputs the power data into the autoregressive moving average model for training, obtains the power data prediction model, inputs the power data and the abnormal records into the logistic regression model for training, and obtains the substation abnormality detection model. And by obtaining the power data and environmental data of the substation in a period of time before the current time, inputs the power data into the power data prediction model, obtains the predicted power data of the substation in the future period of time, inputs the predicted power data into the logistic regression model, and obtains the abnormal probability of the substation. In this way, it is possible to judge the abnormal situation of the substation in the future period of time, and to give a timely warning when a potential fault occurs in the substation.

[0044] In order to make the above-mentioned objects, features and advantages of the present application more obvious and easy to understand, preferred embodiments are specifically cited below and described in detail with reference to the attached drawings. BRIEF DESCRIPTION OF THE DRAWINGS

[0045] In order to more clearly illustrate the technical solutions of the embodiments of the present invention, the drawings required for use in the embodiments are briefly introduced below. It should be understood that the following drawings only show certain embodiments of the present invention and therefore should not be regarded as limiting the scope. For ordinary technicians in this field, other related drawings can be obtained based on these drawings without creative work.

[0046] Figure 1 A schematic structural block diagram of an electronic device provided by an embodiment of the present invention;

[0047] Figure 2 A schematic structural block diagram of a substation anomaly detection model training system provided by an embodiment of the present invention;

[0048] Figure 3 A schematic diagram of a flow chart of a substation anomaly detection model training method provided by an embodiment of the present invention;

[0049] Figure 4 Another schematic diagram of a flow chart of a substation anomaly detection model training method provided by an embodiment of the present invention;

[0050] Figure 5 Another schematic diagram of a flow chart of a substation anomaly detection model training method provided by an embodiment of the present invention;

[0051] Figure 6 A schematic diagram of a flow chart of a substation abnormality detection method provided by an embodiment of the present invention;

[0052] Figure 7 A schematic diagram of a substation anomaly detection model training device provided by an embodiment of the present invention;

[0053] Figure 8 A schematic diagram of a substation abnormality detection device provided by an embodiment of the present invention.

[0054] Icons: 100-electronic device; 101-memory; 102-communication interface; 103-processor; 104-bus; 10-substation anomaly detection model training system; 11-autoregressive moving average model; 12-logistic regression model; 400-substation anomaly detection model training device; 410-data processing unit; 420-power data prediction model training unit; 430-logistic regression model training unit; 500-substation anomaly detection device; 510-data acquisition unit; 520-power data prediction unit; 530-substation anomaly judgment unit. DETAILED DESCRIPTION

[0055] In order to make the purpose, technical solutions and advantages of the embodiments of the present invention clearer, the technical solutions in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiments of the present invention. Obviously, the described embodiments are part of the embodiments of the present invention, not all of the embodiments. Generally, the components of the embodiments of the present invention described and shown in the drawings here can be arranged and designed in various different configurations.

[0056] Therefore, the following detailed description of the embodiments of the present invention provided in the accompanying drawings is not intended to limit the scope of the invention claimed for protection, but merely represents selected embodiments of the present invention. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.

[0057] It should be noted that similar reference numerals and letters represent similar items in the following drawings, so once an item is defined in one drawing, it does not need to be further defined and explained in the subsequent drawings. At the same time, in the description of the present invention, the terms "first", "second", etc. are only used to distinguish the description and cannot be understood as indicating or implying relative importance.

[0058] It should be noted that, in this article, relational terms such as first and second, etc. are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Moreover, the terms "include", "comprise" or any other variants thereof are intended to cover non-exclusive inclusion, so that a process, method, article or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or device. In the absence of further restrictions, the elements defined by the sentence "comprise a ..." do not exclude the existence of other identical elements in the process, method, article or device including the elements.

[0059] With the rapid development of the power industry, substations are the core components of the power system, and their abnormal operation directly affects the safety and stability of the entire power grid. Therefore, real-time monitoring and early warning of substation operation abnormalities are particularly important.

[0060] At present, it is mainly carried out through real-time monitoring, mainly including key maintenance monitoring and daily protective monitoring. Key maintenance monitoring monitors equipment defects through real-time monitoring or regular inspection to avoid serious failures. Its transmission carrier is generally optical fiber or cable. Daily protective monitoring is to conduct daily and periodic inspection and maintenance of equipment to ensure its normal operation. However, this method cannot provide timely warning when potential failures occur in substations.

[0061] Based on the above situation, the embodiment of the present invention provides a substation abnormality detection model training method, anomaly detection method, device and electronic equipment, by obtaining the historical data set of the substation, preprocessing the historical data set, obtaining the preprocessed standard data set, the standard data set includes the power data of the substation and the abnormal records of the substation, inputting the power data into the autoregressive moving average model for training, obtaining the power data prediction model, inputting the power data and the abnormal records into the logistic regression model for training, and obtaining the substation abnormality detection model. And by obtaining the power data and environmental data of the substation in a period of time before the current time, inputting the power data into the power data prediction model, obtaining the predicted power data of the substation in the future period of time, inputting the predicted power data into the logistic regression model, and obtaining the abnormal probability of the substation. In this way, it is possible to judge the abnormal situation of the substation in the future period of time, and to give a timely warning when a potential fault occurs in the substation.

[0062] To implement the process steps and functions of each example of the present invention, please refer to Figure 1 , Figure 1 A schematic structural block diagram of an electronic device provided by an embodiment of the present invention. The electronic device 100 includes a memory 101 and a processor 103, and the memory 101 and the processor 103 are electrically connected to each other directly or indirectly to realize data transmission or interaction. For example, these elements can be electrically connected to each other through one or more communication buses 104 or signal lines. The memory 101 can be used to store software programs and modules, and the processor 103 executes the software programs and modules stored in the memory 101 to perform various functional applications and data processing.

[0063] The electronic device 100 may be, but is not limited to, a personal computer (PC), a server, a distributed computer, etc. It is understandable that the electronic device 100 is not limited to a physical server, but may also be a virtual machine on a physical server, a virtual machine built on a cloud platform, etc., which can provide the same functions as the server or virtual machine. The operating system of the electronic device 100 may be, but is not limited to, a Windows system, a Linux system, etc.

[0064] Among them, the memory 101 can be, but is not limited to, a random access memory (RAM), a read only memory (ROM), a programmable read-only memory (PROM), an erasable programmable read-only memory (EPROM), an electrically erasable read-only memory (EEPROM), etc.

[0065] The communication connection between the electronic device 100 and an external device is achieved through at least one communication interface 102 (which can be wired or wireless).

[0066] The processor 103 may be an integrated circuit chip with signal processing capabilities. In the implementation process, each step of the embodiment of the present invention can be completed by the hardware integrated logic circuit in the processor 103 or the instructions in the form of software. The processor 103 can be a general-purpose processor, including a central processing unit (CPU), a network processor (NP), etc.; it can also be a digital signal processor (DSP), an application specific integrated circuit (ASIC), a field-programmable gate array (FPGA) or other programmable logic devices, discrete gates or transistor logic devices, discrete hardware components.

[0067] Understandably, Figure 1 The structure shown is for illustration only. The electronic device 100 may also include Figure 1 More or fewer components as shown, or with Figure 1 Different configurations are shown. Figure 1 Each component shown in the figure can be implemented by hardware, software or a combination thereof.

[0068] The following is an exemplary description of the image scoring model training method provided by the present invention. Specifically, Figure 2 A schematic structural block diagram of a substation abnormality detection model training system provided by an embodiment of the present invention, referring to Figure 2The method is applied to a substation anomaly detection model training system 10, which includes an autoregressive moving average model 11 and a logistic regression model 12; further, Figure 3 A flow chart of a substation anomaly detection model training method provided by an embodiment of the present invention, combined with Figure 2 and Figure 3 , the method comprises the steps of:

[0069] S210: Acquire a historical data set of the substation, preprocess the historical data set, and obtain a preprocessed standard data set.

[0070] The standard data set includes the power data of the substation and the abnormal records of the substation.

[0071] S220: Inputting the power data into the autoregressive moving average model for training to obtain a power data prediction model.

[0072] S230: Input the power data and abnormal records into the logistic regression model for training to obtain a substation abnormality detection model.

[0073] In step S210, the historical data set of the substation may be all the historical data in the past or the historical data within a period of time. The historical data is preprocessed to meet the input requirements of the autoregressive moving average model and the logistic regression model.

[0074] In step S220, the power data is input into the autoregressive moving average model for training, and the power data may include voltage, current, power, and cabinet temperature. The time series analysis model used to train the substation anomaly detection model may include a moving average model, an autoregressive model, an autoregressive moving average model, an autoregressive integrated moving average model, an exponential smoothing model, etc. In this embodiment, the autoregressive moving average model is preferably selected, which is a model that combines the moving average model and the autoregressive model.

[0075] In step S230, in this embodiment, a logistic regression model is used to train a substation anomaly detection model. In other possible embodiments, models such as support vector machines, decision trees, and random forests may also be selected.

[0076] The method obtains the historical data set of the substation, preprocesses the historical data set, and obtains the preprocessed standard data set; the standard data set includes the power data of the substation and the abnormal records of the substation; the power data is input into the autoregressive moving average model for training to obtain the power data prediction model; the power data and abnormal records are input into the logistic regression model for training to obtain the substation abnormality detection model. In this way, the abnormal situation of the substation in the future can be judged, and timely warning can be given when potential faults occur in the substation.

[0077] In one possible implementation, the voltage, current, power and cabinet temperature of the substation are predicted based on the voltage, current, power and cabinet temperature of the substation in the future. Then, based on the voltage, current, power and cabinet temperature of the substation, it is determined whether there is a risk of abnormality in the substation in the future.

[0078] First, train a power data prediction model to predict the voltage, current, power, and cabinet temperature of the substation in the future. The power data may include the voltage, current, power, and cabinet temperature of the substation. Figure 4 , Figure 4 Another flowchart of a substation anomaly detection model training method provided by an embodiment of the present invention, step S220 may include the following steps:

[0079] S221: Calculate the autoregressive order of the autoregressive moving average model and the moving average order of the autoregressive moving average model according to the voltage, current, power and cabinet temperature, and obtain an autoregressive moving average candidate model.

[0080] S222: Calculate the estimated parameters of the autoregressive moving average candidate model using the maximum likelihood estimation algorithm.

[0081] S223: Check whether the residual of the candidate autoregressive moving average model satisfies the white noise assumption. If so, use the candidate autoregressive moving average model as the power data prediction model.

[0082] In this embodiment, based on the collected voltage, current, power and cabinet temperature data, we can use statistical methods or machine learning algorithms to preliminarily estimate the autoregressive order (p) and moving average order (q) of the autoregressive moving average (ARMA) model. For example, by calculating the autocorrelation function (ACF) and partial autocorrelation function (PACF) of the data, we can preliminarily determine the possible values ​​of p and q. p=2 and q=1 are determined as the order of candidate models.

[0083] Use the maximum likelihood estimation algorithm (MLE) to estimate the parameters of the ARMA(2,1) model. MLE is a parameter estimation method that obtains parameter estimates by maximizing the likelihood function of the model. In this step, we need to fit the ARMA(2,1) model using the collected data and calculate the parameter values ​​of the model.

[0084] Check whether the residuals of the ARMA(2,1) model meet the white noise assumption. The white noise assumption is an important premise of the ARMA model, which requires that the residuals of the model are random and irregular. We can test this assumption by drawing a histogram of the residuals, calculating the autocorrelation function of the residuals, and so on. If the residuals meet the white noise assumption, then we can consider the ARMA(2,1) model to be a suitable power data prediction model. Among them, the Ljung-Box Q statistic test can be selected to determine whether the residuals of the ARMA(2,1) model meet the white noise assumption. By calculating the Q statistic and its corresponding p-value, it can be determined whether the residual sequence is random, that is, whether it meets the white noise assumption. If the p-value is less than the predetermined significance level (such as 0.05), the autoregressive moving average candidate model is used as the power data prediction model.

[0085] Furthermore, in order to train the substation anomaly detection model, refer to Figure 5 , Figure 5 Another flowchart of a substation anomaly detection model training method provided by an embodiment of the present invention, step S230 may include the following steps:

[0086] S231: Set the weight, bias and loss function of the logistic regression model.

[0087] S232: Divide the power data and abnormal records into N training sets.

[0088] S233: Input each training set into the logistic regression model in a loop, calculate the value of the loss function, the gradient of the logistic regression model, and update the weight and bias until the Mth training cycle meets the preset conditions. Then the training is terminated and the trained logistic regression model is used as the substation anomaly detection model.

[0089] In step S231, the weights and biases of the logistic regression model need to be initialized. These values ​​will be randomly initialized. Define the loss function, and the cross entropy loss function is used in this embodiment. The formula is:

[0090] L_i=-y_i*log(p_i)-(1-y_i)*log(1-p_i)

[0091] L=1 / N*ΣL_i

[0092] Where Li is the cross entropy loss of a single sample, L is the average loss of the entire training set, yi is the true label of the ith sample (0 or 1), pi is the probability that the model predicts the ith sample to be positive, and N is the number of samples in the training set.

[0093] In step S232, the power data and abnormal records are divided into N training sets. The collected power data and abnormal records are divided to form N different training sets. Each training set contains a portion of power data and corresponding abnormal labels.

[0094] In step S233, each training set is input into the logistic regression model in a loop, the value of the loss function and the gradient of the logistic regression model are calculated, and the weights and biases are updated until the Mth training cycle meets the preset conditions. The training is then terminated and the trained logistic regression model is used as the substation anomaly detection model.

[0095] For each training set, perform the following steps:

[0096] The power data in the training set is input into the logistic regression model to calculate the model's predicted probability for each sample. This probability indicates the possibility that the sample is considered abnormal. The formula for calculating the predicted probability is:

[0097] z=w*x+b

[0098] p = sigmoid(z)

[0099] Among them, z is the linear output of the model, w is the weight, x is the feature vector x of the power data, b is the bias, p is the predicted probability that the sample is a positive class, and sigmoid is the logistic function.

[0100] Based on the true label of the sample (i.e., whether it is an anomaly) and the predicted probability, the derivative of the loss function with respect to the predicted probability is calculated. This derivative reflects the difference between the model prediction and the true label. The calculation formula is:

[0101] dL_dp_i=-y_i / p_i+(1-y_i) / (1-p_i)

[0102] Among them, y_i is the true label (0 or 1) of the i-th sample, and p_i is the probability that the model predicts the i-th sample as the positive class.

[0103] Next, the derivatives of the loss function with respect to the weights and biases are calculated. These derivatives describe how the weights and biases affect the model's predictions. That is, the derivative of the loss function with respect to the linear output z is:

[0104] delta_i=dL_dp_i*p_i*(1-p_i)

[0105] Among them, dL_dp_i is the derivative of the loss function with respect to the predicted probability, and p_i is the probability that the model predicts the i-th sample as the positive class.

[0106] Using the above derivatives, we can calculate the gradient of the logistic regression model. This gradient indicates how to adjust the weights and biases to reduce the value of the loss function. The gradient calculation formula is:

[0107] grad_w=1 / N*Σ(delta_i*x_i)

[0108] grad_b=1 / N*Σdelta_i

[0109] Among them, grad_w is the gradient of the weight, grad_b is the gradient of the bias, x_i is the eigenvector of the i-th sample, delta_i is the derivative of the loss function with respect to the linear output z, and N is the number of samples.

[0110] Finally, based on the calculated gradient and the preset learning rate, the weights and biases of the logistic regression model are updated. This process is called gradient descent. The formula for updating weights and biases is:

[0111] w = w - learning_rate * grad_w

[0112] b = b - learning_rate * grad_b

[0113] Among them, w is the weight, b is the bias, learning_rate is the learning rate, grad_w is the gradient of the weight, and grad_b is the gradient of the bias.

[0114] Repeat the above steps until the preset stop condition is met, which can be a certain number of iterations, or when the value of the loss function reaches or falls below a preset threshold, or when the absolute value or change of the gradient falls below a preset threshold. Once the training is completed, we get a trained logistic regression model, which can be used as a substation anomaly detection model.

[0115] In order to better train the model and achieve better results, the historical data set is preprocessed to obtain the preprocessed standard data set, which may include:

[0116] Process the outliers in the historical data set to obtain a normal data set;

[0117] The normal data set is standardized to obtain a standard data set.

[0118] In one possible implementation, the average of the historical data set is calculated and outliers are identified based on the average. An alternative approach could be to use the standard deviation to set a threshold, and data points beyond this threshold are considered outliers. Data points that exceed the mean plus or minus three standard deviations are considered outliers.

[0119] For the identified outliers, replace them with the average of their neighboring values. If the neighboring values ​​are also outliers, replace them with the average.

[0120] After obtaining a normal data set, standardization is performed. The data can be scaled so that it falls into a small specific interval, such as [-1,1] or [0,1]. The Z-score standardization method can be used, that is, each data point is subtracted from the mean and divided by the standard deviation.

[0121] After completing the above model training, a mature power data prediction model and substation anomaly detection model are obtained, which can be deployed in the electronic device 100 to detect abnormal conditions of the substation in the future. The embodiment of the present invention provides a substation anomaly detection method, which is applied to the substation anomaly detection model. The substation anomaly detection model includes a power data prediction model and a logistic regression model. Figure 6 , Figure 6 A schematic flow chart of a substation abnormality detection method provided by an embodiment of the present invention, the method comprising the steps of:

[0122] S310: Obtain power data and environmental data of the substation within a period of time before the current time.

[0123] S320: Input the power data into the power data prediction model to obtain the predicted power data of the substation for a period of time in the future.

[0124] S330: Input the predicted power data into the logistic regression model to obtain the abnormal probability of the substation.

[0125] In step S310, the power data and environmental data of the substation within a period of time before the current time are obtained. Determine the time range of the historical data to be obtained, such as the data of the past week or month. Extract the power data within the specified time range from the data recording system of the substation, including key indicators such as voltage, current, power, and power. At the same time, collect environmental data of the same period, such as the temperature of the electric cabinet. Clean the collected data to remove abnormal values, missing values ​​or duplicate data to ensure the accuracy and completeness of the data.

[0126] By inputting the cleaned data into the power data prediction model, the predicted power data for a period of time in the future can be obtained. Then, by inputting the predicted power data into the above-mentioned trained logistic regression model, the abnormal probability of the substation in the future period of time can be obtained.

[0127] Based on the above example, a substation anomaly detection model training device is provided below, which can be deployed in the substation anomaly detection model training system 10. Specifically, Figure 7 A schematic diagram of a substation anomaly detection model training device provided by an embodiment of the present invention, see Figure 7 , the substation anomaly detection model training device 400 includes: a data processing unit 410, a power data prediction model training unit 420 and a logistic regression model training unit 430;

[0128] The data processing unit 410 is used to obtain a historical data set of the substation, preprocess the historical data set, and obtain a preprocessed standard data set; wherein the standard data set includes power data of the substation and abnormal records of the substation.

[0129] The power data prediction model training unit 420 is used to input the power data into the autoregressive moving average model for training to obtain a power data prediction model.

[0130] The logistic regression model training unit 430 is used to input the power data and abnormal records into the logistic regression model for training to obtain a substation abnormality detection model.

[0131] Furthermore, an embodiment of the present invention also provides a substation abnormality detection device, specifically, Figure 8 A schematic diagram of a substation abnormality detection device provided by an embodiment of the present invention, see Figure 8 , the substation anomaly detection device 500 is applied to the substation anomaly detection model, and the device includes: a data acquisition unit 510, a power data prediction unit 520 and a substation anomaly judgment unit 530;

[0132] The data acquisition unit 510 is used to acquire the power data and environmental data of the substation within a period of time before the current time;

[0133] The power data prediction unit 520 is used to input the power data into the power data prediction model to obtain the predicted power data of the substation for a period of time in the future;

[0134] The substation abnormality judgment unit 530 is used to input the predicted power data into the logistic regression model to obtain the substation abnormality probability.

[0135] In summary, the embodiments of the present invention provide a substation anomaly detection model training method, anomaly detection method, device and electronic equipment, which obtains the historical data set of the substation, pre-processes the historical data set, obtains the pre-processed standard data set, and the standard data set includes the power data of the substation and the abnormal records of the substation, inputs the power data into the autoregressive moving average model for training, obtains the power data prediction model, inputs the power data and the abnormal records into the logistic regression model for training, and obtains the substation anomaly detection model. And by obtaining the power data and environmental data of the substation in a period of time before the current time, inputs the power data into the power data prediction model, obtains the predicted power data of the substation in the future, inputs the predicted power data into the logistic regression model, and obtains the abnormal probability of the substation. In this way, it is possible to judge the abnormal situation of the substation in the future, and to give a timely warning when a potential fault occurs in the substation.

[0136] In the embodiments provided by the present invention, it should be understood that the disclosed devices and methods can also be implemented in other ways. The device embodiments described above are merely schematic. For example, the flowcharts and block diagrams in the accompanying drawings show the possible architecture, functions and operations of the devices, methods and computer program products according to multiple embodiments of the present invention. In this regard, each box in the flowchart or block diagram can represent a module, a program segment or a part of the code, and a module, a program segment or a part of the code contains one or more executable instructions for implementing the specified logical functions. It should also be noted that in some alternative implementations, the functions marked in the box can also occur in a different order from the order marked in the accompanying drawings. For example, two consecutive boxes can actually be executed substantially in parallel, and they can sometimes be executed in the opposite order, depending on the functions involved. It should also be noted that each box in the block diagram and / or flowchart, and the combination of boxes in the block diagram and / or flowchart can be implemented with a dedicated hardware-based system that performs a specified function or action, or can be implemented with a combination of dedicated hardware and computer instructions.

[0137] In addition, the functional modules in the various embodiments of the present invention may be integrated together to form an independent part, or each module may exist independently, or two or more modules may be integrated to form an independent part.

[0138] If the function is implemented in the form of a software function module and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present invention, or the part that contributes to the prior art or the part of the technical solution, can be embodied in the form of a software product. The computer software product is stored in a computer-readable storage medium, including a number of instructions for a computer device (which can be a personal computer, a server, or a network device, etc.) to perform all or part of the steps of the methods of each embodiment of the present invention. The aforementioned storage medium includes: U disk, mobile hard disk, read-only memory (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory), disk or optical disk and other media that can store program codes.

[0139] The above are only preferred embodiments of the present invention and are not intended to limit the present invention. For those skilled in the art, the present invention may have various modifications and variations. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present invention shall be included in the protection scope of the present invention.

[0140] It will be apparent to those skilled in the art that the invention is not limited to the details of the exemplary embodiments described above and that the invention can be implemented in other specific forms without departing from the spirit or essential features of the invention. Therefore, the embodiments should be considered exemplary and non-limiting in all respects, and the scope of the invention is defined by the appended claims rather than the foregoing description, and it is intended that all variations falling within the meaning and scope of the equivalent elements of the claims be included in the invention. Any reference numeral in a claim should not be considered as limiting the claim to which it relates.

Claims

1. A substation anomaly detection model training method, characterized in that: Applied to a substation anomaly detection model training system, the substation anomaly detection model training system includes an autoregressive moving average model and a logistic regression model, and the method includes: Acquire a historical data set of the substation, preprocess the historical data set to obtain a preprocessed standard data set; the standard data set includes power data of the substation and abnormal records of the substation; Inputting the power data into the autoregressive moving average model for training to obtain a power data prediction model; The power data and the abnormal records are input into the logistic regression model for training to obtain a substation abnormality detection model.

2. The method according to claim 1, characterized in that The power data includes the voltage of the substation, the current of the substation, the power of the substation and the temperature of the electric cabinet of the substation. The step of inputting the power data into the autoregressive moving average model to obtain the power data prediction model includes: According to the voltage, the current, the power and the temperature of the electric cabinet, the autoregressive order of the autoregressive moving average model and the moving average order of the autoregressive moving average model are calculated to obtain an autoregressive moving average candidate model; Calculating estimated parameters of the autoregressive moving average candidate model using a maximum likelihood estimation algorithm; Check whether the residual of the candidate autoregressive moving average model satisfies the white noise assumption. If so, use the candidate autoregressive moving average model as the power data prediction model.

3. The method according to claim 1, characterized in that The step of inputting the power data and the abnormal records into the logistic regression model for training to obtain a substation abnormality detection model includes: Setting weights, biases, and loss functions of the logistic regression model; Dividing the power data and the abnormal records into N training sets; Each training set is input into the logistic regression model in a loop, the value of the loss function and the gradient of the logistic regression model are calculated, and the weight and the bias are updated until the Mth training cycle meets the preset conditions, then the training is terminated and the trained logistic regression model is used as the substation anomaly detection model.

4. The method according to claim 3, characterized in that The training set includes at least one sample, and the step of inputting each of the training sets into the logistic regression model, calculating the value of the loss function, the gradient of the logistic regression model, and updating the weight and the bias includes: Calculating the prediction probability that the prediction result is a positive class according to the power data of a single sample; Calculate the derivative of the loss function with respect to the predicted probability according to the true label of the sample and the predicted probability; Calculating the derivative of the loss function with respect to the weight and the derivative of the bias; Calculating the gradient of the logistic regression model according to the derivative of the predicted probability, the derivative of the weight, and the derivative of the bias; According to the gradient and learning rate of the logistic regression model, the weight of the logistic regression model and the bias of the logistic regression model are updated.

5. The method according to claim 1, characterized in that The step of preprocessing the historical data set to obtain a preprocessed standard data set includes: Processing the abnormal values ​​of the historical data set to obtain a normal data set; The normal data set is standardized to obtain the standard data set.

6. The method according to claim 5, characterized in that The step of processing the abnormal values ​​of the historical data set to obtain a normal data set includes: Calculate the average value of the historical data set, and find the abnormal value according to the average value; The outlier is replaced by the average of the values ​​of its neighboring data.

7. A substation abnormality detection method, characterized in that: Applied to a substation anomaly detection model, the substation anomaly detection model includes a power data prediction model and a logistic regression model, and the method includes: Obtain the power data and environmental data of the substation within a period of time before the current time; Inputting the power data into the power data prediction model to obtain predicted power data of the substation for a period of time in the future; The predicted power data is input into the logistic regression model to obtain the abnormal probability of the substation.

8. A substation anomaly detection model training device, characterized in that: Applied to a substation anomaly detection model training system, the substation anomaly detection model training system includes a substation anomaly detection model including an autoregressive moving average model and a logistic regression model, and the device includes: A data processing unit, used to obtain a historical data set of the substation, preprocess the historical data set, and obtain a preprocessed standard data set; the standard data set includes power data of the substation and abnormal records of the substation; A power data prediction model training unit, used for inputting the power data into the autoregressive moving average model for training to obtain a power data prediction model; The logistic regression model training unit is used to input the power data and the abnormal records into the logistic regression model for training to obtain a substation abnormality detection model.

9. A substation abnormality detection device, characterized in that: Applied to a substation anomaly detection model, the substation anomaly detection model includes a power data prediction model and a logistic regression model, and the device includes: A data acquisition unit, used to acquire power data and environmental data of the substation within a period of time before the current time; A power data prediction unit, used for inputting the power data into the power data prediction model to obtain predicted power data of the substation for a period of time in the future; The substation abnormality judgment unit is used to input the predicted power data into the logistic regression model to obtain the substation abnormality probability.

10. An electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that: When the processor executes the program, the method according to any one of claims 1 to 6 and / or claim 7 is implemented.