Online monitoring method and device for current transformer error based on machine learning
By fusing the combined algorithm of Prophet, SVR, RFR and Lasso regression models, the real-time and accuracy of error monitoring in online monitoring of current transformers is solved, and stable error monitoring is achieved under the missing primary side current data, improving the metering accuracy and fault detection efficiency of the power system.
Patent Information
- Application Number
- CN202411284945.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-09-13
- Publication Date
- 2025-08-26
- Estimated Expiration
- 2044-09-13
AI Technical Summary
The prior art has insufficient real-time, accuracy and stability in online monitoring of current transformers, especially in the scenario of missing primary current data.
A combined algorithm based on Prophet prediction model, support vector regression model, random forest model and Lasso regression model is used to predict the current trend, period and residual components through historical running data, and the current prediction value is obtained in combination with weighted integration to calculate the current transformer error.
Real-time, stable and accurate monitoring of current transformer errors in the case of missing primary current data is achieved, and the measurement accuracy and fault detection efficiency of the power system are improved.
Smart Images

Figure CN119149949B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of power system monitoring, and in particular to a method and device for online monitoring of current transformer errors based on machine learning. Background Art
[0002] With the development of society and economy, the power system has put forward higher requirements for power supply stability and metering accuracy. As a key equipment in the power system, current transformers play a core role in ensuring the accuracy of electric energy metering. However, the offline calibration method commonly used by traditional electromagnetic current transformers has a long cycle and requires power outages. This not only consumes a lot of manpower and material resources, but also fails to truly reflect the metering characteristics of the transformer under actual working conditions. In addition, with the increasing requirements for power supply reliability, suitable power outage calibration windows are becoming increasingly difficult to obtain, making traditional offline power outage detection increasingly difficult to meet the requirements. This leads to deficiencies such as untimely and inaccurate real-time detection of potential faults and defects, potentially increasing the risks to the safe operation of the power grid and the fairness and justice of electricity trade.
[0003] Given these shortcomings, exploring online monitoring technology for current transformer errors is an urgent need to improve the efficiency and reliability of power system operations. Compared to traditional offline calibration, online monitoring can continuously and in real time monitor the metering performance of current transformers without interrupting power supply, thereby ensuring the accuracy of energy metering and the stability of power supply services.
[0004] In the field of online monitoring of current transformer metering performance, with the advancement of technology, researchers have conducted research from two aspects: system design improvement and algorithm optimization to achieve metering performance evaluation of current transformers. In terms of research based on system design:
[0005] Prior Art 1 (Title: “Evaluating the metering error of electronic transformers on-line based on vn-mwpca”; Authors: Zhang Z, Chen Q, Hu C, et al.; Journal: “Measurement”; Publication Date: 2018; Issue 130; Pages: 1-7) To address the shortcomings of traditional laboratory offline detection, an online monitoring system for high-voltage electric energy metering devices was designed. The system is mainly used for real-time online monitoring of the secondary load, voltage drop, and error of voltage transformers and current transformers, aiming to ensure the accuracy of electric energy metering.
[0006] Existing technology 2 (Title: "A Review of Verification and Evaluation Methods for Power Transformers"; Author: Wang Yuqi, Li Hongbin, Xiang Xin, etc.; Journal: "High Voltage Electrical Appliances"; Publication Date: 2020; Issue 56, Volume 4; Pages: 95-101, 107) studied the secondary circuit online monitoring technology and realized real-time monitoring through 10kHz impedance spectroscopy. However, there are many difficulties in the large-scale application of this technology and its economy and ease of use.
[0007] In terms of research based on algorithm implementation:
[0008] Prior art 3 (Title: "Development of an online monitoring system for transformers for metering"; Authors: Zhang Penghe, Deng Zeguan, Wang Longhua, etc.; Journal: "Electrical Measurement and Instrumentation"; Publication date: 2009; Vol. 46, No. 7; Pages: 41-44) discusses an online detection method for transformer metering errors based on a BP neural network. This method measures the error by applying a heterodyne signal on the secondary side. Although it is simple and effective, it may affect the accuracy of error measurement when facing heterodyne signal interference such as high-order harmonics in the power grid.
[0009] Existing technology 4 (Title: "Design and Application of Online Test Device for Voltage and Current Sensor Errors for Distribution Networks"; Author: Han Shaigen, Chen Chi, Wang Zizhen; Journal: "High Voltage Electrical Appliances"; Publication Date: 2020; Vol. 56, No. 12; Pages: 235-241) studies the accompanying fault identification strategy of electronic transformers based on historical data, and attempts to analyze the fault mode based on the vertical coordination of the data. However, this strategy has high requirements on data quality and processing speed in actual operation, which limits its practicality.
[0010] The electronic current transformer error prediction method proposed in prior art 5 (Title: "Research on Online Monitoring Technology of Secondary Circuit of Metering Current Transformer"; Author: Wang Binwu, Liu Jian, Zhang Jun; Journal: "Electronic Measurement Technology"; Publication Date: 2022; Vol. 45, No. 17; Pages: 29-35) has certain foresight, but has a slow convergence speed and is prone to falling into local minima.
[0011] Although the above-mentioned existing technical solutions have promoted the development of current transformer online monitoring technology to a certain extent, it not only requires measuring the primary current value of the current transformer or adding a current transformer standard device, but also has obvious deficiencies in real-time performance, accuracy and stability. In particular, when dealing with the scenario of missing primary side current data, it lacks the ability to measure the current transformer error. Summary of the Invention
[0012] The present invention provides a method for online monitoring of current transformer errors based on a machine learning algorithm to solve the problem of how to monitor and obtain current transformer errors in real time, accurately and stably when primary-side current data is missing.
[0013] The present invention is achieved through the following technical solutions:
[0014] A first aspect of the present invention provides a method for online monitoring of current transformer errors based on a machine learning algorithm, comprising:
[0015] Acquire current acquisition data and current actual value of the current transformer; the current acquisition data is a period of historical operating data of the current transformer before the current time, and the current actual value is the operating data of the current transformer at the current time;
[0016] Processing the current acquisition data through a Prophet prediction model to predict a current trend component and a current cycle component;
[0017] Processing the current acquisition data through a support vector regression model to predict a first residual component;
[0018] Processing the current acquisition data through a random forest model to predict a second residual component; the first residual component and the second residual component are parts of the current acquisition data that do not conform to a trend and a periodic pattern;
[0019] Performing weighted integration on the first residual component and the second residual component through a lasso regression model to obtain a third residual component;
[0020] Summing the current trend component, the current period component, and the third residual component to obtain a current prediction value at a current time;
[0021] The error of the current transformer is calculated according to the actual current value and the predicted current value.
[0022] To address the growing demand for stable power supply and precise metering in power systems, and to address the limitations of existing online calibration methods for current transformers, this paper proposes a machine learning algorithm based on historical current transformer operating data. This algorithm combines the time series prediction capabilities of the Prophet prediction model with the regression algorithms of the support vector regression (SVR), random forest model (RFR), and lasso regression model. Prophet can effectively handle seasonal fluctuations, capture future trends, and accurately predict the current trend and period components. SVR is used to build a refined regression model to address Prophet's shortcomings in small-scale datasets. RFR optimizes the accuracy of metering performance prediction for large-scale datasets, and the prediction results of SVR and RFR complement each other. Finally, the lasso regression model is used for feature selection and to avoid overfitting, thereby enhancing the model's stability. Therefore, this method predicts the standard value of the current transformer with high accuracy. Using the predicted current value as the reference standard value for online current transformer monitoring solves the problem of missing primary-side current data, thereby enabling stable and accurate real-time monitoring of current transformer errors.
[0023] Furthermore, the Prophet prediction model includes a current trend prediction sub-model and a current cycle prediction sub-model. The expression of the current trend prediction sub-model is as follows:
[0024]
[0025] Where g(t) represents the current trend component, b(t) represents the offset, C(t) is a time function that represents the model capacity and is used to limit the maximum value that the model can grow. k represents the growth rate. As time t increases, g(t) approaches C(t).
[0026] The expression of the current cycle prediction sub-model is as follows:
[0027]
[0028] Among them, s(t) represents the current periodic component, a n 、b n Represents the parameters that need to be estimated in the formula, π is the ratio of pi, T is a period, n represents the nth period, and n represents the total number of periods. The larger the value of N, the more complex the seasonality of the fitting.
[0029] Furthermore, the current periodic component includes a periodic component with a week as a period, a periodic component with a day as a period, and a periodic component with a 15-minute interval as a period.
[0030] Furthermore, the training method of the Prophet prediction model includes:
[0031] Decomposing the historical operating data of the current transformer using a decomposition model provided by Prophet to obtain a first historical trend component and a first historical period component;
[0032] The Prophet model is used to establish the current trend prediction sub-model and the current cycle prediction sub-model respectively;
[0033] The current trend prediction sub-model is trained by the historical operation data and the first historical trend component, and the current cycle prediction sub-model is trained by the historical operation data and the first historical cycle component.
[0034] Furthermore, the training method of the support vector regression model includes:
[0035] The current trend component and the current cycle component are predicted by the Prophet prediction model on the historical operation data to obtain the second historical trend component and the second historical cycle component;
[0036] Calculate the historical residual component based on the historical operating data, the second historical trend component and the second historical period component;
[0037] The support vector regression model is trained by taking the second historical trend component and the second historical period component as features and the historical residual component as the target variable.
[0038] Furthermore, the training method of the random forest model includes:
[0039] The current trend component and the current cycle component are predicted by the Prophet prediction model on the historical operation data to obtain the second historical trend component and the second historical cycle component;
[0040] Calculate the historical residual component based on the historical operating data, the second historical trend component and the second historical period component;
[0041] The random forest model is trained by taking the second historical trend component and the second historical period component as features and the historical residual component as the target variable.
[0042] A second aspect of the present invention provides a device for online monitoring of current transformer errors based on machine learning, comprising:
[0043] A data acquisition module, configured to acquire current acquisition data and actual current value of a current transformer; the current acquisition data is historical operating data of the current transformer, and the actual current value is operating data of the current transformer at the current time;
[0044] A trend and cycle prediction module, configured to process the current acquisition data using a Prophet prediction model to predict a current trend component and a current cycle component;
[0045] a residual prediction module, configured to process the current acquisition data through a support vector regression model to predict a first residual component; and
[0046] Processing the current acquisition data by a random forest model to predict a second residual component; the first residual component and the second residual component are parts of the current acquisition data that do not conform to trend and periodic patterns; and
[0047] Performing weighted integration on the first residual component and the second residual component through a lasso regression model to obtain a third residual component;
[0048] a current prediction module, configured to sum the current trend component, the current period component, and the third residual component to obtain a current prediction value at a current time;
[0049] An error monitoring module is used to calculate the error of the current transformer based on the actual current value and the predicted current value.
[0050] The third aspect of the present invention provides an electronic device, a memory, a processor, and a computer program stored in the memory and runnable on the processor. When the processor executes the computer program, the online monitoring method for current transformer errors based on machine learning as described in any one of the first aspects of the present invention is implemented.
[0051] A fourth aspect of the present invention provides a computer-readable storage medium having a computer program stored thereon, characterized in that when the computer program is executed by a processor, the online monitoring method for current transformer errors based on machine learning as described in any one of the first aspects of the present invention is implemented.
[0052] A fifth aspect of the present invention provides a computer program product, characterized in that when the computer program product runs on a processor, it implements the online monitoring method for current transformer errors based on machine learning as described in any one of the first aspects of the present invention.
[0053] Compared with the prior art, the present invention has the following advantages and beneficial effects:
[0054] A technology for accurately predicting the standard value of current based on the Prophet-SVR-RFR-Lasso (PSRL) algorithm was proposed and verified, which made up for the lack of primary side current data and realized online monitoring of current transformer errors.
[0055] By combining advanced machine learning methods, the error measurement accuracy of the power system is improved, so that faults can be detected in time and maintenance efficiency can be improved.
[0056] As a core time series forecasting tool, the Prophet model effectively handles seasonal changes and predicts future trends. The combination of support vector regression (SVR), random forest regression (RFR), and Lasso regression further enhances the algorithm's ability to process time series data, especially in reducing overfitting and improving forecast accuracy.
[0057] A series of experiments comprehensively evaluated the performance of the Prophet-SVR-RFR-Lasso (PSRL) algorithm. The results show that the algorithm has significant advantages in capturing and processing the long-term dependencies of current transformer data, accurately predicting future changes in data with complex seasonality and trends, and improving the algorithm's stability and robustness by combining multiple regression techniques. BRIEF DESCRIPTION OF THE DRAWINGS
[0058] In order to more clearly illustrate the technical solutions of the exemplary embodiments of the present invention, the following briefly introduces the drawings required for use in the examples. It should be understood that the following drawings only illustrate certain embodiments of the present invention and should not be considered as limiting the scope. A person of ordinary skill in the art can also derive other relevant drawings based on these drawings without inventive effort. In the drawings:
[0059] Figure 1 This is a flow chart of a method for online monitoring of current transformer errors based on machine learning according to an embodiment of the present invention;
[0060] Figure 2 This is a model structure diagram of a machine learning algorithm according to an embodiment of the present invention;
[0061] Figure 3 1 is a schematic diagram of a decomposition of a Prophet prediction model according to an embodiment of the present invention;
[0062] Figure 4 This is a flowchart of establishing a Prophet model according to an embodiment of the present invention;
[0063] Figure 5 is a schematic diagram of an SVR model according to an embodiment of the present invention;
[0064] Figure 6 This is a schematic diagram of an RFR decision process according to an embodiment of the present invention;
[0065] Figure 7 This is a schematic diagram of a Lasso technology process according to an embodiment of the present invention;
[0066] Figure 8a This is a comparison chart of the MSE indicators of DT, RFR, GBRT and PSRL at different prediction times;
[0067] Figure 8b This is a comparison chart of the RMSE indicators of DT, RFR, GBRT and PSRL at different prediction times;
[0068] Figure 8c This is a comparison chart of MAPE indicators of DT, RFR, GBRT and PSRL at different prediction times;
[0069] Figure 9a This is a comparison chart of the MSE indicators of prediction algorithms built by different component combinations in different time periods;
[0070] Figure 9b This is a comparison chart of the RMSE indicators of prediction algorithms built by different component combinations in different time periods;
[0071] Figure 9c This is a comparison chart of MAPE indicators in different time periods of prediction algorithms built by different component combinations;
[0072] Figure 10 It is a structural diagram of an electronic device according to an embodiment of the present invention. DETAILED DESCRIPTION
[0073] In order to make the objectives, technical solutions and advantages of the present invention more clearly understood, the present invention is further described in detail below in conjunction with examples and drawings. The exemplary embodiments of the present invention and their descriptions are only used to explain the present invention and are not intended to limit the present invention.
[0074] It should be noted that the terms "including" and "having" and any variations thereof in the specification and claims of the present invention and the above-mentioned drawings are intended to cover non-exclusive inclusions. For example, a process, method, system, product or device that includes a series of steps or units is not necessarily limited to other steps or units inherent in the device.
[0075] The terms used in the various embodiments of the application are only used to describe the purpose of specific embodiments and are not intended to limit the various embodiments of the application. As used herein, the singular form is intended to also include the plural form, unless the context clearly indicates otherwise. Unless otherwise limited, all terms used here (including technical terms and scientific terms) have the same meaning as the meaning generally understood by those of ordinary skill in the art of the application. The terms (such as the terms defined in the dictionary generally used) will be interpreted as having the same meaning as the contextual meaning in the relevant technical field and will not be interpreted as having idealized meaning or too formal meaning, unless clearly defined in the various embodiments of the application.
[0076] The embodiments of the present invention provide a method and device for online monitoring of current transformer errors based on machine learning, which is suitable for online monitoring of current transformer errors when primary-side current data is missing, and is conducive to real-time, stable and accurate monitoring of data to ensure the safety of the power system.
[0077] Taking into account the lack of primary-side current measurement, the present invention designs a machine learning algorithm to fill the data gap in this monitoring link. The machine learning algorithm designed by the present invention combines the advantages of Prophet, support vector regression (SVR), random forest (RFR), and lasso regression algorithms, and is used to predict the trend term, periodic term, and residual term of current data respectively, and fuses the prediction results of each prediction model to obtain the final primary-side current prediction value. The designed algorithm is optimized for time series data analysis, and it can learn and predict the performance of current transformers based on historical data. In the absence of direct primary-side current measurement, the model can accurately predict the current value by learning from past data.
[0078] The machine learning algorithm of the present invention can be deployed in edge devices. Edge devices are devices that provide entry points to the core network of an enterprise or service provider. They include routers, routing, switches, integrated access devices (IADs), multiplexers, and various metropolitan area network (MAN) and wide area network (WAN) access devices. The machine algorithm on the edge device does not need to rely on excessive computing power support. It can not only efficiently process the real-time data stream collected from the current transformer, but also perform complex periodic and trend analysis. This design increases the speed of data processing, reduces the pressure on the network infrastructure, and ensures the efficient use of computing resources.
[0079] See also Figure 1 As shown, Figure 1 The present invention provides a flowchart of a method for online monitoring of current transformer errors based on machine learning, which includes the following steps:
[0080] S1, obtain the current collection data and actual current value of the current transformer.
[0081] S2, processes the current acquisition data through the Prophet prediction model to predict the current trend component and current cycle component.
[0082] S3, processing the current acquisition data through a support vector regression model to predict a first residual component; and processing the current acquisition data through a random forest model to predict a second residual component.
[0083] S4, performing weighted integration on the first residual component and the second residual component through the lasso regression model to obtain the third residual component.
[0084] S5, summing the trend component, the period component and the third residual component to obtain the current prediction value at the current time.
[0085] S6, calculating the error of the current transformer according to the actual current value and the predicted current value.
[0086] Specifically, the current acquisition data in the above step S1 is a period of historical operating data of the current transformer before the current time, which is obtained by continuously monitoring the current of the current transformer during a period of historical time. The actual current value is the operating data of the current transformer at the current time. By inputting multi-dimensional historical current data into the machine learning model, the model can predict the current data at the future time t and use it as the reference standard value of the current at the future time t. When there is a deviation between the actual measured current value at time t and the predicted value, the error of the current transformer can be calculated by comparing the difference between the two. This error calculation method can help us monitor the metering performance of the current transformer in real time, realize real-time and accurate performance monitoring, promptly discover potential problems and take corresponding measures.
[0087] See also Figure 2 As shown, Figure 2 It is a model structure diagram of the machine learning algorithm of the present invention, which consists of a Prophet prediction model, a support vector regression model, a random forest model and two data fusion modules.
[0088] The Prophet model is a self-additive model for forecasting time series data. It is suitable for processing time series data. The Prophet model provides strong support for processing seasonal variations and long-term trends in current data. Its built-in decomposition function decomposes current data into multiple periodic components and a trend component. The model can be broken down into three main components: the growth term g(t), the seasonality term s(t), and the holiday term h(t).
[0089] The present invention utilizes the Prophet prediction model to decompose the current data, which includes two parts: current trend term decomposition and current cycle term decomposition.
[0090] Current data trend component g(t) prediction: Use the Prophet model to model and predict the long-term trend of current data. The Prophet model can capture long-term trends in current data, such as growth or decline.
[0091] Prediction of the periodic component s(t) of current data: The Prophet model is also used to model and predict the periodic components in the current data. These periodic terms can reflect the periodic fluctuations in the current data, such as daily current peaks and troughs.
[0092] The periodic components of the current data include weekly_seasonality, daily_seasonality, and quarter_seasonality, but are not limited to these. Other periodic components can be modified or added. The residual component can be obtained based on the periodic component and the trend component, such as Figure 3 The figure shows the decomposition diagram of the Prophet forecast model, and its decomposition expression is as follows:
[0093] P(t)=g(t)+s(t)+ε(t) (1)
[0094] Where P(t) represents the model input, which is the current data collected from the current transformer, g(t) represents the trend component, s(t) represents the periodic component, and ε(t) represents the residual component.
[0095] like Figure 4 The figure shows the Prophet model establishment flow chart. During the prediction process of the trend component and periodic component of current data, Prophet establishes a current data model based on the prediction problem, simulates the historical current data, and evaluates the effectiveness of the model. Based on the problems that arise, further adjustments and modeling are performed, and finally the entire prediction result is fed back in a visual manner.
[0096] The current trend term decomposition and the current period term decomposition are modeled separately. The basic model is the Prophet model. That is, the Prophet prediction model includes a current trend prediction sub-model and a current period prediction sub-model. The current trend prediction sub-model is specifically used to predict the current trend component, and the current period prediction sub-model is specifically used to predict the current period component.
[0097] For the trend component prediction, this paper adopts the logistic saturated growth model, and the basic trend term adopts a logistic regression model, which is expressed as follows:
[0098]
[0099] Where b(t) represents the offset, C(t) refers to the carrying capacity, also called model capacity, which is a time function whose purpose is to limit the maximum growth of the model. k represents the growth rate. As time t increases, g(t) approaches C(t).
[0100] s(t) represents periodic changes. In order to fit and predict seasonal effects, Prophet proposed a flexible model based on the Fourier series, which is expressed as follows:
[0101]
[0102] Where a n 、b n Represents the parameters that need to be estimated in the formula, π is the ratio of pi, T is a period, n represents the nth period, and N represents the total number of periods. The larger the N value, the more complex the seasonality of the fitting.
[0103] Before using the Prophet prediction model, it needs to be trained. The current trend prediction sub-model and the current cycle prediction sub-model need to be modeled and trained respectively, including (1) data preprocessing, (2) data decomposition, and (3) model training.
[0104] First, historical operating data is obtained from the current transformer as training samples. Since the current data may contain noise and other irregularities, it needs to be preprocessed by noise reduction and smoothing. The preprocessing method adopts existing methods. Then, the current data is decomposed using Prophet's built-in decomposition model. The decomposed data is used to train the sub-model, including:
[0105] S2-1, using Prophet's built-in decomposition model, decomposes the historical operating data of the current transformer to obtain the historical trend component and the historical cycle component.
[0106] S2-2, use the Prophet model to establish the current trend prediction sub-model and the current cycle prediction sub-model respectively.
[0107] S2-3, train the current trend prediction sub-model through historical operation data and historical trend components, and train the current cycle prediction sub-model through historical operation data and historical cycle components.
[0108] The above model training method adopts a conventional training method, which can divide the samples into a training set and a test set. The training set is used for training, and the test set is used for model testing.
[0109] The decomposition process can be seen in Figure 3 As shown in the figure, the Prophet model's built-in decomposition function decomposes n-day current data p(t) into a trend term, a weekly seasonal term, a daily seasonal term, a quarterly seasonal term, and a residual term. The trend component g(t) and the periodic component s(t) are obtained. The residual component is then calculated based on the input current data p(t). The calculation formula is: ε(t) = P(t) - g(t) - s(t).
[0110] In step S2-2, the Prophet model can be used to establish prediction models for the trend item trend in the current data, the weekly seasonal item weekly_seasonality with a weekly cycle, the daily seasonal item daily_seasonality with a daily cycle, and the quarterly seasonal item quarter_seasonality with a 15-minute interval as a cycle. A total of 1 current trend prediction sub-model and 3 current cycle prediction sub-models are used. The historical operating data of the first 6 months is used as the training set, and the data of the last 24 points (i.e., the last 6 hours) is used as the test set. The historical current data is simulated and the effect of the model is evaluated. According to the problems that arise, further adjustments and modeling are performed to obtain a trained Prophet prediction model, and finally the entire prediction result is fed back in a visual manner.
[0111] The residual term ε(t) represents the part of the current data that does not conform to the trend and periodic pattern, that is, the part that cannot be captured by the aforementioned Prophet model. The present invention designs a joint prediction model based on the support vector regression algorithm and the random forest algorithm to predict the residual component of the current data. Figure 2 As shown in Figure 3, the residual prediction model includes three parts: support vector regression model (SVR), random forest regression model (RFR) and lasso regression model.
[0112] First, SVR is used to capture the nonlinear relationship in the current data and preliminarily calculate the residual term. Figure 5 The figure shows a schematic diagram of the SVR model. In the figure, ωx+b is the predicted value of the regression model, where ω is the weight vector, x is the input feature vector, and b is the bias term. ε represents the maximum tolerance error allowed by the regression model. Represents the distance from one decision boundary to another. Support vector regression (SVR) is a supervised machine learning algorithm developed based on support vector machines (SVM) and is used to address data regression prediction problems. In the algorithm, a radial basis kernel function is used for given current data, resulting in an SVR regression estimation model, expressed as follows:
[0113]
[0114] Among them, f(x) represents the SVR regression estimation model, a i 、 represents the Lagrangian operator, n is the number of samples, K(x i ,x j ) is the kernel function, representing x i ,x j The similarity between them, b represents the bias term, and σ represents the parameter of the kernel function, that is, the scale parameter.
[0115] At the same time, RFR combines the results of multiple decision trees to perform diversified and integrated estimation of the residual terms of current data, such as Figure 6 The figure below shows a schematic diagram of the RFR decision process. Random forests combine multiple decision trees. Each time, a dataset is selected with replacement, and some features are randomly selected as input. The results of multiple decision trees are voted on to determine the optimal regression, resulting in the final prediction result.
[0116] Finally, the prediction results of SVR and RFR are integrated into the Lasso model to obtain the final residual prediction results.
[0117] like Figure 7 The figure shows the Lasso technology process flow diagram. Lasso (Least Absolute Shrinkage and Selection Operator) is a regularization method for linear regression and feature selection. It can be used for compression and variable selection in regression analysis and is particularly suitable for processing data sets with high-dimensional features. k represents the feature set selected in the kth iteration, β k Represents the characteristic coefficient selected in the kth iteration, y res is the residual, which represents the difference between the model prediction value and the actual value. x1 represents the feature selected in the first iteration, x tRepresents the features selected in the current iteration. Lasso performs regularization by adding an L1 regularization term (i.e., the sum of the absolute values of the parameters) to the traditional least squares estimation, thereby performing feature selection and parameter reduction, enabling it to handle complex data sets. It also has the function of selecting variables, can automatically perform feature selection, and output a sparse model to further optimize and refine the prediction of the residual term.
[0118] In Lasso regression, the optimization objective consists of two parts: one is to minimize the residual sum of squares, and the other is to constrain the L1 norm of the coefficients to be less than or equal to a given threshold λ. Mathematically, this can be expressed as:
[0119]
[0120] Among them, y i is the observed value, x i is the eigenvector, is x i The transpose of , p is the number of features, β is the p-dimensional regression coefficient vector, is the L1 norm, n is the number of samples, t is a threshold, and λ is a tuning parameter that determines the strength of regularization. When the constraint function, i.e. Lasso, is added, the specific expression is:
[0121]
[0122] Where y i is the observed value, x i,j is the jth eigenvalue of the i-th sample, m is the number of features, β is the coefficient variable, β j is the regression coefficient corresponding to the jth feature, n is the number of samples, and λ is the penalty coefficient for parameter estimation.
[0123] Lasso regression is used to perform a weighted integration of the prediction results of each model's current components to generate the final current data prediction results. In addition, this module is responsible for comprehensively evaluating the model's prediction performance to ensure the accuracy and reliability of the prediction results.
[0124] Through this multi-model combination method, accurate prediction of the residual term of current data is achieved, which improves the prediction accuracy and the stability and generalization ability of the model, and effectively copes with the complex fluctuations of current data.
[0125] Before using SVR and RFR for residual prediction, these two models need to be trained. The training samples need to use the prediction results of Prophet. The training methods of the two regression models are similar. The training process of SVR includes the following steps:
[0126] S3-1, using the Prophet prediction model to predict the current trend component and the current cycle component of the historical operating data p(t), to obtain the historical trend component g(t) and the historical cycle component s(t);
[0127] S3-2 calculates the historical residual component ε(t) based on the historical operating data p(t), historical trend component g(t) and historical cycle component s(t) in S3-1;
[0128] S3-3, use the historical trend component g(t) and historical cycle component s(t) obtained in S3-1 as feature X, and the historical residual component ε(t) obtained in S3-2 as the target variable y to train the support vector regression model.
[0129] The training process of RFR includes: using the historical trend component g(t) and the historical cycle component s(t) obtained in S3-1 as the feature X, and the historical residual component ε(t) obtained in S3-2 as the target variable y, to train the random forest model.
[0130] The Prophet prediction model used in the above method is a trained Prophet prediction model. The output of the Prophet prediction model is used to train the two regression models so that they can perform feature learning on the feature X and the target variable y. The trained SVR model and RFR model have residual prediction capabilities.
[0131] Furthermore, in order to fully verify the effectiveness of the established algorithm in the online evaluation of current transformer metering performance, we built an experimental verification platform and conducted multiple sets of experiments on the data set.
[0132] The dataset covers current data from one input and two outputs of current transformer A. Each time point contains three current features, resulting in a total of 70,078 moments of experimental data, providing rich information for algorithm training and evaluation. During this time, it is assumed that the actual current load remains constant within a sampling interval, meaning that the current error fluctuates within the same percentage range.
[0133] (1) Selection of evaluation indicators
[0134] To ensure the effectiveness and accuracy of the current prediction algorithm, three key statistical metrics were used as comprehensive evaluation indicators of the algorithm's performance: RMSE (root mean square error), MSE (mean square error), and MAPE (mean absolute percentage error), as shown in Table 1. These metrics comprehensively assess the algorithm's fit to current transformer data and its prediction accuracy, thus more objectively reflecting the algorithm's performance. By comprehensively considering these metrics, the performance of the Prophet-SVR-RFR-Lasso (PSRL) algorithm in online current transformer monitoring tasks can be comprehensively evaluated and compared with other models. Details of each metric are shown in Table 1.
[0135] Table 1 Evaluation indicators
[0136]
[0137]
[0138] (2) Comparative experiment
[0139] This paper selects the following 1-6 classic models for comparative experiments with the machine learning model Prophet-SVR-RFR-Lasso (hereinafter referred to as "PSRL") designed by this invention. The comparison models include:
[0140] 1. DT model (Decision Tree), a tree-structured machine learning model that classifies or regresses data through a series of rules.
[0141] 2. RF model (Random Forest): An integrated model consisting of multiple decision trees, each of which is trained independently and votes to determine the final result.
[0142] 3. GBRT model (Gradient Boosting Regression Trees), an ensemble learning model that minimizes the loss function by gradually adding decision trees.
[0143] 4. LR model (Linear Regression model), linear regression model, predicts numerical data by fitting the linear relationship between one or more independent variables and the dependent variable.
[0144] 5. ARIMA model (Autoregressive Integrated Moving Average) is a time series forecasting model that combines autoregressive, differencing, and moving average methods and can handle non-stationary data.
[0145] 6. SVR model (Support Vector Regression), a regression version based on the support vector machine (SVM), defines a boundary and tries to make as many points as possible fall within this boundary.
[0146] In order to give full play to the advantages of the Prophet model in capturing trends and periodicity, this paper selects 6 months of historical current data of current transformers as input to better simulate the long-term trend and periodic characteristics of current changes, thereby providing more accurate predictions. In order to evaluate the performance of different models in processing current transformer data, Table 2 compares the prediction effects of models including DT, RFR, GBRT, LR, ARIMA and SVR, and compares them with the PSRL model we proposed. The model was evaluated for the following three prediction time windows (2 hours, 4 hours and 6 hours), and the prediction performance of the model was measured by three indicators: MSE, RMSE and MAPE. In order to compare the errors of each model more intuitively, Figure 8a 、 8b 8c shows the error index comparison curves of the four models (DT, RFR, GBRT, PSRL) with better performance in Table 2. These diagrams help to more clearly understand the performance differences of each model under different prediction time windows.
[0147] Table 2 Comparison of performance indicators of each model under different prediction time windows
[0148]
[0149] The PSRL model performs exceptionally well for 2-hour current forecasts. Its MSE (mean square error) is 0.0011, its RMSE (root mean square error) is 0.0328, and its MAPE (mean square error) is 0.0006. These metrics significantly outperform the other models, demonstrating that PSRL can provide extremely accurate results for short-term forecasts. In comparison, the MSE and RMSE values of DT and RFR are relatively low, but PSRL still performs significantly better. The LR and SVR prediction errors are much higher than those of PSRL, demonstrating significant deficiencies in accurately capturing current variations.
[0150] In the 4-hour forecast task, the PSRL model continued to outperform, with an MSE of 0.0018, an RMSE of 0.0419, and a MAPE of 0.0007. These results demonstrate that PSRL maintains high accuracy even when handling medium-term forecasts. In contrast, the ARIMA model's MSE and MAPE increased significantly when forecasting for 4 hours, with the MSE reaching a high of 3.3602, reflecting the ARIMA model's lack of stability in forecasting.
[0151] For the longer-term 6-hour forecast, the PSRL model achieved an MSE of 0.004, an RMSE of 0.0636, and a MAPE of 0.0011, remaining the best performer among all compared models. In comparison, the ARIMA model achieved an MSE of 11.7325, an RMSE of 3.4253, and a MAPE of 0.0598, indicating a large error in long-term forecasts. Although GBRT and SVR approach PSRL in some respects, they still lag behind in this regard.
[0152] To more intuitively compare the performance of various models in the online current transformer monitoring task, Table 3 compares the results of a six-hour forecast based on six months of historical data, demonstrating the performance of the three excellent models (DT, RFR, and GBRT) and PSRL. MAPE was selected as the primary evaluation metric. Compared with other error metrics, MAPE provides consistent evaluation performance for variations in data magnitude and is less affected by outliers.
[0153] As can be seen in Table 3, PSRL exhibits a lower MAPE value compared to the other three models, indicating that PSRL has significantly smaller prediction errors and more accurate prediction results. This result not only verifies the superior performance of the PSRL algorithm in online current transformer monitoring tasks but also emphasizes the stability and consistency of its predictions. Comparing predictions at each time point reveals that PSRL can more accurately capture subtle changes in current data, further improving prediction accuracy. Compared to other models, PSRL demonstrates more stable performance when processing complex data.
[0154] In summary, the PSRL model demonstrates excellent predictive capabilities for online current transformer monitoring. As the prediction window increases, the PSRL model maintains low MSE, RMSE, and MAPE. Therefore, when processing complex current data, the PSRL model effectively captures current trends and cyclical characteristics, providing a reliable solution for online current transformer monitoring.
[0155] Table 3 Comparison of prediction results of various models (6-month prediction for 6 hours)
[0156]
[0157]
[0158] To further evaluate the effectiveness of different models in prediction tasks, this paper conducted experiments on related model combinations. Figure 9a 、 9bFigures 9c and 9c show a performance comparison of Prophet, Prophet-SVR, Prophet-RFR, and PSRL for different forecast durations (2 hours, 4 hours, and 6 hours) using 6 months of historical data. The forecast accuracy of these models is analyzed using three evaluation metrics (MSE, RMSE, and MAPE). Prophet is used as the baseline model, and PSRL is compared with the other three models.
[0159] Through Table 4 and Figure 9a 、 9b As can be seen from the data in Figure 9c, the Prophet model alone has a large error, demonstrating its limitations in capturing complex patterns. Although models combining SVR or RFR with Prophet have improved performance, the PSRL algorithm proposed in this paper achieves the lowest error, demonstrating its superiority in handling complex forecasting tasks.
[0160] Table 4 Comparison of the performance of different model combinations for different future forecast durations based on 6 months of historical data
[0161]
[0162] Experimental results show that the optimized model has high accuracy in predicting the current reference standard value, can reduce errors, and better realize the online monitoring of current transformer metering performance. By monitoring 6 months of historical data, the optimized Prophet model performs well in predicting the current transformer reference standard value, with a 2-hour mean absolute percentage error (MAPE) of only 0.06% and a mean square error (MSE) of 0.0011. The MAPE and MSE of the Prophet model alone are 1.31% and 0.4767, respectively. In addition, PSRL Figure 9
[0163] The method shows good stability in predicting data of different durations, proving its practicality and superiority in online monitoring of current transformers.
[0164] A second aspect of the present invention provides a device for online monitoring of current transformer errors based on machine learning, comprising:
[0165] A data acquisition module, configured to acquire current acquisition data and actual current value of a current transformer; the current acquisition data is historical operating data of the current transformer, and the actual current value is operating data of the current transformer at the current time;
[0166] A trend and cycle prediction module, configured to process the current acquisition data using a Prophet prediction model to predict a current trend component and a current cycle component;
[0167] a residual prediction module, configured to process the current acquisition data through a support vector regression model to predict a first residual component; and
[0168] Processing the current acquisition data by a random forest model to predict a second residual component; the first residual component and the second residual component are parts of the current acquisition data that do not conform to trend and periodic patterns; and
[0169] Performing weighted integration on the first residual component and the second residual component through a lasso regression model to obtain a third residual component;
[0170] a current prediction module, configured to sum the current trend component, the current period component, and the third residual component to obtain a current prediction value at a current time;
[0171] An error monitoring module is used to calculate the error of the current transformer based on the actual current value and the predicted current value.
[0172] The device is used to execute the online monitoring method of current transformer error based on machine learning of the above embodiment of the present invention. The specific monitoring method, model establishment, and model training method refer to the above embodiment and are not repeated here.
[0173] A third aspect of the present invention provides an electronic device, such as Figure 10 As shown, Figure 10 The electronic device of the present invention comprises a processor 1200, a memory 1201, an input device 1202, an output device 1203 and a communication device 1204. The number of processors 1200 in the computer device can be one or more. Figure 10 The processor 1200, the memory 1201, the input device 1202 and the output device 1203 in the electronic device can be connected through a bus or other means. Figure 10 The bus connection is taken as an example.
[0174] Memory 1201, as a computer-readable storage medium, can be used to store software programs, computer-executable programs, and modules. Processor 1200 executes the software programs, instructions, and modules stored in memory 1201 to perform various functional applications and data processing of the electronic device, thereby implementing the machine learning-based online current transformer error monitoring method according to any of the above-described embodiments of the present invention.
[0175] The memory 1201 may mainly include a program storage area and a data storage area, wherein the program storage area may store an operating system and at least one application required for a function; the data storage area may store data created based on the use of the terminal, etc. In addition, the memory 1201 may include a high-speed random access memory and may also include a non-volatile memory, such as at least one disk storage device, a flash memory device, or other non-volatile solid-state storage device. In some instances, the memory 1201 may further include a memory remotely located relative to the processor 1200, and these remote memories may be connected to the electronic device via a network. Examples of the above-mentioned network include, but are not limited to, the Internet, an intranet, a local area network, a mobile communication network, and combinations thereof.
[0176] The input device 1202 can be used to receive external data such as user ID, instructions, current data, etc., and the output device 1203 is used to output intermediate data, prediction results, distribution network pages, etc.
[0177] A third aspect of the present invention provides a computer-readable storage medium having a computer program stored thereon. When executed by a processor, the computer program implements the online current transformer error monitoring method based on machine learning according to any embodiment of the present invention. The storage medium may be ROM / RAM, a magnetic disk, an optical disk, or the like.
[0178] In a fifth aspect, the present invention provides a computer program product. When the computer program product runs on a computer, it enables the computer to execute the online monitoring method of current transformer error based on machine learning according to any of the above embodiments of the present invention.
[0179] The specific implementation methods described above further illustrate the objectives, technical solutions and beneficial effects of the present invention in detail. It should be understood that the above description is only a specific implementation method of the present invention and is not intended to limit the scope of protection of the present invention. Any modifications, equivalent substitutions, improvements, etc. made within the spirit and principles of the present invention should be included in the scope of protection of the present invention.
Claims
1. A current transformer error online monitoring method based on machine learning, characterized in that: include: Obtain current collection data and actual current value of the current transformer; The current acquisition data is a period of historical operating data of the current transformer before the current time, and the current actual value is the operating data of the current transformer at the current time; Processing the current acquisition data through a Prophet prediction model to predict a current trend component and a current cycle component; Processing the current acquisition data through a support vector regression model to predict a first residual component; Processing the current acquisition data through a random forest model to predict a second residual component; The first residual component and the second residual component are parts of the current acquisition data that do not conform to trend and periodic patterns; Performing weighted integration on the first residual component and the second residual component through a lasso regression model to obtain a third residual component; Summing the current trend component, the current period component, and the third residual component to obtain a current prediction value at a current time; The error of the current transformer is calculated according to the actual current value and the predicted current value.
2. The method for online monitoring of current transformer errors based on machine learning according to claim 1, characterized in that: The Prophet prediction model includes a current trend prediction sub-model and a current cycle prediction sub-model. The expression of the current trend prediction sub-model is as follows: Where g(t) represents the current trend component, b(t) represents the offset, C(t) is a time function that represents the model capacity and is used to limit the maximum value that the model can grow. k represents the growth rate. As time t increases, g(t) approaches C(t). The expression of the current cycle prediction sub-model is as follows: Among them, s(t) represents the current periodic component, a n 、b n Represents the parameters that need to be estimated in the formula, π is the ratio of pi, T is a period, n represents the nth period, and N represents the total number of periods. The larger the N value, the more complex the seasonality of the fitting.
3. The method for online monitoring of current transformer errors based on machine learning according to claim 1 or 2, characterized in that: The current periodic component includes a periodic component with a week as a period, a periodic component with a day as a period, and a periodic component with a 15-minute interval as a period.
4. The method for online monitoring of current transformer errors based on machine learning according to claim 2, characterized in that: The training method of the Prophet prediction model includes: Decomposing the historical operating data of the current transformer using a decomposition model provided by Prophet to obtain a first historical trend component and a first historical period component; The Prophet model is used to establish the current trend prediction sub-model and the current cycle prediction sub-model respectively; The current trend prediction sub-model is trained by the historical operation data and the first historical trend component, and the current cycle prediction sub-model is trained by the historical operation data and the first historical cycle component.
5. The method for online monitoring of current transformer errors based on machine learning according to claim 1, characterized in that: The training method of the support vector regression model includes: The current trend component and the current cycle component are predicted by the Prophet prediction model on the historical operation data to obtain the second historical trend component and the second historical cycle component; Calculate the historical residual component based on the historical operating data, the second historical trend component and the second historical period component; The support vector regression model is trained by taking the second historical trend component and the second historical period component as features and the historical residual component as the target variable.
6. The method for online monitoring of current transformer errors based on machine learning according to claim 1, characterized in that: The training method of the random forest model includes: The current trend component and the current cycle component are predicted by the Prophet prediction model on the historical operation data to obtain the second historical trend component and the second historical cycle component; Calculate the historical residual component based on the historical operating data, the second historical trend component and the second historical period component; The random forest model is trained by taking the second historical trend component and the second historical period component as features and the historical residual component as the target variable.
7. The current transformer error online monitoring device based on machine learning is characterized by: include: A data acquisition module is used to obtain the current collection data and actual current value of the current transformer; The current acquisition data is the historical operating data of the current transformer, and the current actual value is the operating data of the current transformer at the current time; A trend and cycle prediction module, configured to process the current acquisition data using a Prophet prediction model to predict a current trend component and a current cycle component; A residual prediction module, configured to process the current acquisition data through a support vector regression model to predict a first residual component; as well as, Processing the current acquisition data through a random forest model to predict a second residual component; The first residual component and the second residual component are parts of the current acquisition data that do not conform to trend and periodic patterns; as well as, Performing weighted integration on the first residual component and the second residual component through a lasso regression model to obtain a third residual component; a current prediction module, configured to sum the current trend component, the current period component, and the third residual component to obtain a current prediction value at a current time; An error monitoring module is used to calculate the error of the current transformer based on the actual current value and the predicted current value.
8. An electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein: When the processor executes the computer program, the online monitoring method for current transformer errors based on machine learning according to any one of claims 1 to 6 is implemented.
9. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the online monitoring method for current transformer errors based on machine learning according to any one of claims 1 to 6 is implemented.
10. A computer program product, characterized in that When the computer program product runs on a processor, the online monitoring method for current transformer errors based on machine learning described in any one of claims 1 to 6 is implemented.
Citation Information
Patent Citations
Electronic transformer error short-time prediction method based on intelligent algorithm
CN111537938A
Heat pump system fault diagnosis method based on combined data driving model
CN117093896A