A transformer temperature early warning method and system
By combining adaptive sliding window and Stacking model with support vector regression, random forest and gradient boosting regression, the window size is dynamically adjusted, which solves the problems of insufficient accuracy and flexibility of transformer temperature early warning method, realizes efficient prediction and timely early warning of transformer temperature, and improves the stability and economy of power grid.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- STATE GRID HUBEI ELECTRIC POWER CO XIAOGAN POWER SUPPLY CO
- Filing Date
- 2024-12-05
- Publication Date
- 2026-05-26
AI Technical Summary
Existing transformer temperature early warning methods are insufficient in terms of accuracy and flexibility, making it difficult to effectively capture short-term fluctuations and long-term trends in transformer temperature. This leads to untimely fault prediction, affecting the stability and economy of the power grid.
We employ an adaptive sliding window and stacking approach, combining support vector regression, random forest, and gradient boosting regression models. By stacking these models, we predict transformer temperatures and construct an early warning rule base. We dynamically adjust the window size to adapt to temperature changes, thereby improving prediction accuracy and flexibility.
This improves the accuracy and flexibility of transformer temperature prediction, enabling timely identification of temperature anomalies, reducing equipment damage and power outages, extending equipment lifespan, lowering operating costs, and enhancing the reliability and economy of the power grid.
Smart Images

Figure CN119760656B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the technical field of power equipment operation status monitoring and fault early warning, and in particular to a transformer temperature early warning method and system. Background Technology
[0002] Transformers are key equipment in substations and crucial components of the entire power grid system. They are responsible for increasing and decreasing voltage to achieve efficient power transmission and distribution. By increasing voltage, transformers reduce energy losses during transmission, allowing electrical energy to travel long distances without significant disruption. Simultaneously, the safety of transformers directly impacts the stability and reliability of the power grid. Any transformer failure or overheating can lead to power outages, equipment damage, or even large-scale power accidents. Therefore, ensuring the normal operation of transformers and timely monitoring of their status are essential measures for maintaining power grid security.
[0003] Transformer temperature early warning systems can identify potential high-temperature faults early, enabling timely maintenance measures to prevent equipment damage and power outages, thus improving the reliability of the power grid. The significance of transformer temperature early warning systems lies primarily in fault prevention, safety assurance, improved operational efficiency, extended equipment lifespan, and reduced operating costs. By monitoring temperature in real time, the early warning system can identify temperature anomalies early and take timely measures to prevent equipment failure and damage. Excessive temperatures can lead to safety hazards such as insulation aging, short circuits, or fires; temperature early warning effectively reduces these risks, ensuring the safety of equipment and personnel. Simultaneously, temperature monitoring and early warning can optimize the operating status of transformers, ensuring they operate efficiently within safe ranges, thereby improving the overall performance and reliability of the power grid. Furthermore, timely temperature warnings can prevent damage caused by overheating, extend the service life of transformers, and reduce the frequency of replacement and maintenance. Effective temperature management can reduce unexpected power outages and maintenance costs, improving the economic efficiency of the power system. Therefore, transformer temperature early warning is of great importance to the stability and economy of the entire power system.
[0004] The transformer temperature early warning method based on adaptive sliding window and Stacking proposed in this application mainly consists of transformer temperature prediction and early warning strategies. The transformer temperature prediction methods are mainly divided into three types: statistical methods, machine learning methods, and deep learning methods. Figure 1As shown, the statistical methods include linear regression, which establishes linear relationships between variables through statistical analysis; and autoregressive integral moving average, a statistical method for time series analysis, suitable for modeling and predicting stationary and non-stationary data. The machine learning methods include ensemble learning, which combines multiple weakly supervised models to obtain a better and more comprehensive strongly supervised model; support vector regression, an extension of support vector machines used to solve regression problems; and artificial neural networks, a computational model inspired by biological neural networks, composed of multiple layers of neurons, widely used in classification and regression problems. The deep learning methods include convolutional neural networks, a deep learning model specifically designed for processing data with grid structures; and long short-term memory networks, a special type of recurrent neural network specifically designed for processing and predicting long-term dependencies in time series data.
[0005] Statistical methods provide a scientific theoretical foundation and practical technical support for transformer temperature prediction, helping to achieve efficient fault detection and condition monitoring. Linear regression, which minimizes the sum of squared errors between predicted and actual values to find the best-fit line for transformer temperature prediction, is simple to implement and computationally efficient, but it is only suitable for linear relationship predictions and is overly sensitive to outliers. The autoregressive integral moving average model combines the characteristics of autoregression and moving averages, and uses differencing to station the time series for time series prediction. This method can handle non-stationary time series data and capture autocorrelation in the time series, but its model parameter selection is complex and it cannot handle data abrupt changes and trend shifts.
[0006] Machine learning methods utilize vast amounts of historical data for training, automatically extracting features and patterns. Traditional statistical methods often require significant human intervention and specialized knowledge, while machine learning models can learn and optimize automatically, thereby improving prediction efficiency and ensuring high accuracy. Ensemble learning, by combining multiple learning algorithms, can enhance model accuracy and generalization ability, and exhibits strong resistance to outliers and noisy data. However, its effectiveness depends on the selection of base learners and is computationally expensive. Support vector regression's basic idea is to fit data to a hyperplane in a high-dimensional space, aiming to minimize model complexity while ensuring the error between predicted and actual values is within a set threshold. This method effectively handles high-dimensional data and nonlinear relationships, but its effectiveness depends on parameter selection and is sensitive to feature scaling. Artificial neural networks typically include input, hidden, and output layers, and their learning process includes forward and backward propagation. This method can automatically extract features and is suitable for processing large-scale data, but it has high data requirements and is prone to overfitting.
[0007] Deep learning methods employ multi-layered neural networks for feature learning and data modeling, exhibiting significant advantages in these capabilities and being suitable for various complex data types. Convolutional neural networks (CNNs) are specifically designed for image data processing, using convolutional layers to extract spatial features. Typically, they include convolutional layers, pooling layers, and fully connected layers. They can automatically learn effective features and are suitable for large-scale data, but require substantial computational power and have high data requirements. Long Short-Term Memory (LSTM) networks, by introducing memory units and gating mechanisms, effectively overcome the vanishing gradient problem in long-sequence learning of traditional recurrent neural networks. This method possesses memory capabilities and can capture complex temporal features, but it consumes significant computational resources, is sensitive to parameter selection, and exhibits unstable performance. Summary of the Invention
[0008] To address the aforementioned technical problems, this invention provides a transformer temperature early warning method and system with improved prediction accuracy and flexibility.
[0009] The present invention provides a transformer temperature early warning method, the first step of which is to collect historical temperature data of the transformer, that is, to extract temperature data over a continuous period of time from the transformer temperature sensor.
[0010] Step 2: Calculate the sliding window size. The sliding window is one of the important algorithms for time series forecasting, and its size is a key parameter that affects the performance of the algorithm.
[0011] Step 3: Train the support vector regression model based on the transformer temperature data collected in Step 1 and the sliding window size obtained in Step 2;
[0012] Step 4: Train a random forest model based on the transformer temperature data collected in Step 1 and the sliding window size obtained in Step 2;
[0013] Step 5: Train the gradient boosting regression model based on the transformer temperature data collected in Step 1 and the sliding window size obtained in Step 2;
[0014] Step 6: Stack the models obtained in Steps 3, 4, and 5 to obtain the Stacking model, and calculate whether the mean square error of the current transformer temperature prediction model based on adaptive sliding window and Stacking has reached the minimum. If it has reached the minimum, proceed to Step 7; otherwise, return to Step 2.
[0015] Step 7: Predict future temperatures based on the optimal transformer temperature prediction model based on adaptive sliding window and Stacking.
[0016] Step 8: Construct an early warning rule base based on historical data and professional knowledge, which will serve as the evaluation criteria for early warning after transformer temperature prediction;
[0017] Step 9: Based on the predicted transformer temperature obtained in Step 7 and the early warning rule base obtained in Step 8, a judgment and early warning are made. This method uses a Stacking model that combines support vector regression, random forest, and gradient boosting regression for transformer temperature prediction. It also uses Stacking, one of the ensemble learning methods, and adaptive sliding window to predict transformer temperature, establishes a transformer temperature early warning rule base, and performs early warning processing based on the predicted transformer temperature and the transformer temperature early warning rule base. This method improves the prediction accuracy and flexibility to achieve effective transformer temperature early warning.
[0018] Preferably, in step one, historical temperature data of the transformer is collected, which is the three-phase temperature of fiber A, B, and C on the high-voltage side of the main transformer.
[0019] Preferably, in step two, the sliding window size is calculated and continuously updated until the training prediction mean square error reaches its minimum. The sliding window is one of the important algorithms for time series prediction, and its size is a key parameter affecting the effectiveness of the algorithm. Dynamically adjusting the window size according to temperature changes can better capture short-term temperature fluctuations and long-term trends, thereby improving the accuracy of prediction.
[0020] Preferably, in step three, the support vector regression model aims to find an optimal regression hyperplane such that most training data points lie within a specific tolerance band. This is achieved by using a function to fit the data, which satisfies the following relationship:
[0021] f(x)=ω T φ(x)+b
[0022] Where ω is the weight vector, x is the input feature, and φ(x) i ) represents the feature map, and b represents the bias. The model mainly includes parameter selection, specifically choosing the tolerance band width ε and the penalty parameter C. ε defines the tolerance range for prediction errors, and C controls the degree of penalty applied to training errors. An optimization problem is constructed, namely, minimizing a loss function to balance model complexity and fitting error. In this application, the following relationship is satisfied:
[0023]
[0024] Where, ξ i and These are slack variables used to handle cases where data points exceed the tolerance band; constraints are added to ensure that the prediction error for each data point does not exceed ε. In this application, the constraints satisfy the following relationship:
[0025]
[0026] Among them, y i Let ω be the true target value of the i-th training sample.T φ(x i )+b represents the model's predicted value; solving the optimization problem involves using the Lagrange multiplier method to combine the objective function and constraints, constructing the Lagrange function, and solving for the optimal weight vector ω and bias b; model prediction involves predicting new data points; support vector regression models can effectively handle high-dimensional data by mapping input data to a high-dimensional feature space through kernel functions, capturing complex nonlinear relationships. By using tolerance bands, support vector regression models have a certain robustness to outliers and noise because the goal is to maximize the boundary rather than fit all training data points.
[0027] Preferably, the random forest model in step four is combined with the prediction results of multiple decision tree models. The random forest model improves the overall performance by combining the prediction results of multiple decision tree models. Therefore, random forests can handle large-scale datasets and have a certain robustness to missing values and outliers. Furthermore, by introducing randomness, random forests are generally less prone to overfitting than a single decision tree.
[0028] Preferably, the gradient boosting regression model in step five includes initialization and calculation of the mean F0(x) of the target value, satisfying...
[0029] relation:
[0030]
[0031] Where y i Let m be the target value of the i-th training sample; iterative training is performed, and for each round m = 1, 2, ..., M, the residuals are calculated, satisfying the following relationship:
[0032]
[0033] Then the weak learner h is trained. m (x), i.e., using residuals Train a new weak learner as the target, then update the model to satisfy the following relationship:
[0034] F m (x)=F m―1 (x)+Υ m h m (x)
[0035] Among them, Υ m The learning rate controls the impact of the new model on the overall model; the final prediction is used to predict the new sample; the gradient boosting regression model improves the model's predictive ability step by step, effectively handling missing values and adaptively handling missing parts of the data through the splitting properties of trees.
[0036] Preferably, in step seven, the transformer temperature prediction model predicts the three-phase temperatures of optical fibers A, B, and C on the high-voltage side of the main transformer.
[0037] Preferably, the early warning rule base in step eight is divided into three early warning levels. Level 1 is a minor early warning, requiring continuous online monitoring of transformer temperature changes by staff, but no further action is needed. Level 2 is a moderate early warning, requiring on-site inspection of the transformer's operating status by staff. Level 3 is a severe early warning, requiring immediate shutdown of the transformer for inspection, detailed fault analysis and troubleshooting, and checks of electrical connections, insulation status, etc. These three early warning levels correspond to three temperature change thresholds, denoted as ΔT1, ΔT2, and ΔT3, respectively. Since temperature changes in the transformer have a certain time periodicity, the early warning rule base proposed in this application uses a one-day cycle, utilizing the average data value at that time each day from historical data as the evaluation standard. If the difference between the predicted temperature and the average value is less than ΔT1, no early warning operation is performed; if the difference is greater than or equal to ΔT1 but less than ΔT2, a Level 1 early warning operation is performed; if the difference is greater than or equal to ΔT2 but less than ΔT3, a Level 2 early warning operation is performed; and if the difference is greater than or equal to ΔT3, a Level 3 early warning operation is performed.
[0038] Preferably, step eight is independent of steps one through seven.
[0039] The present invention provides a transformer temperature early warning system, comprising a data collection unit, an algorithm logic unit, a first model training unit, a second model training unit, a third model training unit, a model building unit, a temperature prediction unit, a rule base unit, and a judgment and early warning unit.
[0040] The data collection unit is used to collect and store historical temperature data under varying pressure.
[0041] The algorithm logic unit is used to receive historical temperature data and continuously update the sliding window size until the training prediction mean square error reaches its minimum.
[0042] The first model training unit is used to read historical temperature data and train the support vector regression model in conjunction with the sliding window size.
[0043] The second model training unit is used to read historical temperature data and train the random forest model in conjunction with the sliding window size.
[0044] The third model training unit is used to read historical temperature data and train the gradient boosting regression model in conjunction with the sliding window size.
[0045] Model building unit; used to stack the support vector regression model, random forest model and gradient boosting regression model to obtain the Stacking model, and to calculate whether the mean square error of the current transformer temperature prediction model based on adaptive sliding window and Stacking has reached the minimum.
[0046] The temperature prediction unit is used to predict and transmit the future temperatures of phases A, B, and C of the high-voltage side optical fiber of the main transformer.
[0047] The rule base unit, built based on historical data and professional knowledge, serves as the evaluation standard for early warning after transformer temperature prediction;
[0048] The judgment and early warning unit is used to receive the predicted future temperature sent by the temperature prediction unit and combine it with the rule base unit to make judgments and issue early warnings.
[0049] Compared with the prior art, the beneficial effects of this invention are as follows: This method uses a stacking model of support vector regression, random forest and gradient boosting regression to predict transformer temperature, and uses stacking and adaptive sliding window, one of the ensemble learning methods, to predict transformer temperature, establish a transformer temperature early warning rule base, and perform early warning processing based on the predicted transformer temperature and the transformer temperature early warning rule base. This method improves the prediction accuracy and flexibility, so as to achieve effective transformer temperature early warning. Attached Figure Description
[0050] Figure 1 A diagram illustrating transformer temperature prediction technology;
[0051] Figure 2 This is a flowchart of the transformer temperature early warning method of the present invention;
[0052] Figure 3 The results of the transformer temperature prediction model with fixed sliding window and Stacking are shown in the figure.
[0053] Figure 4 The results of the transformer temperature prediction model based on adaptive sliding window and stacking are shown in the figure.
[0054] Figure 5 This is a block diagram of the transformer temperature early warning system of the present invention. Detailed Implementation
[0055] To facilitate understanding of the present invention, a more complete description will be given below with reference to the accompanying drawings. The present invention can be implemented in many different forms and is not limited to the embodiments described herein. Rather, these embodiments are provided so that this disclosure will be thorough and complete.
[0056] Example 1
[0057] The present invention provides a transformer temperature early warning method and system, the first step of which is to collect historical temperature data of the transformer, that is, to extract temperature data over a continuous period of time from the transformer temperature sensor; the historical temperature data of the transformer is the three-phase temperature of the A, B, and C phases of the high-voltage side optical fiber of the main transformer.
[0058] Step 2: Calculate the sliding window size. The sliding window is one of the important algorithms for time series prediction, and its size is a key parameter that affects the performance of the algorithm. The sliding window size is continuously updated until the training prediction mean square error reaches its minimum.
[0059] Step 3: Train a support vector regression model based on the transformer temperature data collected in Step 1 and the sliding window size obtained in Step 2. The support vector regression model aims to find an optimal regression hyperplane such that most training data points lie within a specific tolerance band; that is, it uses a function to fit the data, which satisfies the following relationship:
[0060] f(x)=ω T φ(x)+b
[0061] Where ω is the weight vector, x is the input feature, and φ(x) i ) represents the feature map, and b represents the bias. The model mainly includes parameter selection, specifically choosing the tolerance band width ε and the penalty parameter C. ε defines the tolerance range for prediction errors, and C controls the degree of penalty applied to training errors. An optimization problem is constructed, namely, minimizing a loss function to balance model complexity and fitting error. In this application, the following relationship is satisfied:
[0062]
[0063] Where, ξ i and These are slack variables used to handle cases where data points exceed the tolerance band; constraints are added to ensure that the prediction error for each data point does not exceed ε. In this application, the constraints satisfy the following relationship:
[0064]
[0065] Among them, y i Let ω be the true target value of the i-th training sample. T φ(x i )+b represents the model's predicted value; to solve the optimization problem, the Lagrange multiplier method is used to combine the objective function and constraints, construct the Lagrange function and solve it to obtain the optimal weight vector ω and bias b; model prediction is used to predict new data points;
[0066] Step 4: Train a random forest model based on the transformer temperature data collected in Step 1 and the sliding window size obtained in Step 2. The random forest model combines the prediction results of multiple decision tree models.
[0067] Step 5: Train a gradient boosting regression model based on the transformer temperature data collected in Step 1 and the sliding window size obtained in Step 2. The gradient boosting regression model includes initialization and calculation of the mean F0(x) of the target value, satisfying the following relationship:
[0068]
[0069] Where y i Let m be the target value of the i-th training sample; iterative training is performed, and for each round m = 1, 2, ..., M, the residuals are calculated, satisfying the following relationship:
[0070]
[0071] Then the weak learner h is trained. m (x), i.e., using residuals Train a new weak learner as the target, then update the model to satisfy the following relationship:
[0072] F m (x)=F m―1 (x)+Υ m h m (x)
[0073] Among them, Υ m The learning rate controls the impact of the new model on the overall model; the final prediction is used to predict the new samples.
[0074] Step 6: Stack the models obtained in Steps 3, 4, and 5 to obtain the Stacking model, and calculate whether the mean square error of the current transformer temperature prediction model based on adaptive sliding window and Stacking has reached the minimum. If it has reached the minimum, proceed to Step 7; otherwise, return to Step 2.
[0075] Step 7: Predict future temperatures based on the optimal transformer temperature prediction model based on adaptive sliding window and Stacking.
[0076] Step 8: Construct an early warning rule base based on historical data and professional knowledge. This rule base serves as the evaluation standard for early warnings following transformer temperature prediction. The early warning rule base is divided into three warning levels: Level 1 is a minor warning, requiring continuous online monitoring of transformer temperature changes by staff, but no further action is needed; Level 2 is a moderate warning, requiring on-site inspection of the transformer's operating status; Level 3 is a severe warning, requiring immediate shutdown of the transformer for inspection, detailed fault analysis and troubleshooting, and checks of electrical connections, insulation status, etc. These three warning levels correspond to three temperature change thresholds, denoted as ΔT1, ΔT2, and ΔT3, respectively. Since temperature changes in transformers have a certain time periodicity, the early warning rule base proposed in this application uses a one-day cycle, utilizing the average data value at that time each day from historical data as the evaluation standard. If the difference between the predicted temperature and the mean is less than ΔT1, no warning operation is performed; if the difference between the predicted temperature and the mean is greater than or equal to ΔT1 but less than ΔT2, a first-level warning operation is performed; if the difference between the predicted temperature and the mean is greater than or equal to ΔT2 but less than ΔT3, a second-level warning operation is performed; if the difference between the predicted temperature and the mean is greater than or equal to ΔT3, a third-level warning operation is performed.
[0077] Step 9: Make a judgment and issue an early warning based on the transformer predicted temperature obtained in Step 7 and the early warning rule base obtained in Step 8.
[0078] In this embodiment, the application is characterized by using a stacking model combining support vector regression, random forest, and gradient boosting regression for transformer temperature prediction. Many stacking models may only use similar types of regression models. Since the three models used in this application have different advantages and disadvantages, their ensemble effect is often superior to stacking models using only one model. Furthermore, this application applies an adaptive sliding window to the training of the stacking model. The sliding window can extract features at different time scales. Combined with the powerful modeling capabilities of support vector regression, random forest, and gradient boosting regression, it can effectively capture short-term and long-term temperature change patterns. Moreover, the adaptive sliding window can dynamically adjust the training set according to data changes, allowing the model to better capture the changing trends and periodic features in time series data, thereby improving prediction accuracy. Finally, we also construct a transformer temperature early warning rule base based on historical data and professional knowledge, enabling the predicted temperature obtained by the transformer temperature prediction model based on the adaptive sliding window and stacking to play a practical role. The transformer temperature early warning method and system based on the adaptive sliding window and stacking can dynamically adjust the window size and step size according to the trend and pattern of temperature changes, improving sensitivity to sudden events and optimizing early warning robustness.
[0079] In transformer temperature early warning systems, the most critical factor affecting the early warning function is the transformer temperature prediction. The smaller the prediction error, the greater the effectiveness of the early warning. Therefore, to demonstrate the predictive performance of the transformer temperature prediction method based on adaptive sliding window and Stacking proposed in this application, experiments were conducted using the continuous 20-day data (one-hour interval) of the A, B, and C phases of the high-voltage side fiber optic cable of a substation's main transformer. The experimental results demonstrate the advantages of this method and its practical application.
[0080] This application uses the first 15 days of data in the dataset for model training and the last 5 days of data for testing prediction performance, such as... Figure 3 and Figure 4 As shown, this application predicts the temperatures of phases A, B, and C of the optical fiber on the high-voltage side of the main transformer. Feature 1 in the figure represents the temperature of phase A, feature 2 represents the temperature of phase B, and feature 3 represents the temperature of phase C. Figure 3 It can be seen that the transformer temperature prediction model based on fixed sliding window and Stacking can predict future temperatures relatively accurately, and the predicted temperature trend is basically consistent with the actual temperature trend. However, there are still some data points with large errors. Figure 4 It can be seen that the error is reduced compared to the fixed sliding window and Stacking methods. Therefore, it can be concluded that the transformer temperature prediction method based on adaptive sliding window and Stacking improves the accuracy and robustness of transformer temperature prediction.
[0081] Since both methods described above perform well in predicting temperature, it is difficult to determine their relative merits from a simple comparison of the graphs. Therefore, this application supplements Table 1 to more intuitively demonstrate the advantages of the transformer temperature prediction method based on adaptive sliding window and Stacking. Table 1 shows that the mean square error of the prediction results of both methods is relatively small. However, the transformer temperature prediction method based on adaptive sliding window and Stacking still reduces the mean square error of the prediction results to a certain extent compared to the fixed sliding window and Stacking method. It can be concluded that the transformer temperature prediction method based on adaptive sliding window and Stacking reduces the prediction error in the three-phase temperature prediction of A, B, and C. Therefore, the transformer temperature early warning method and system based on adaptive sliding window and Stacking achieves effective transformer temperature early warning by improving the accuracy of transformer temperature prediction.
[0082] Table 1 Evaluation Table of Prediction Results
[0083]
[0084] Example 2
[0085] The present invention provides a transformer temperature early warning method and system, comprising a data collection unit, an algorithm logic unit, a first model training unit, a second model training unit, a third model training unit, a model building unit, a temperature prediction unit, a rule base unit, and a judgment and early warning unit;
[0086] The data collection unit is used to collect and store historical temperature data under varying pressure.
[0087] The algorithm logic unit is used to receive historical temperature data and continuously update the sliding window size until the training prediction mean square error reaches its minimum.
[0088] The first model training unit is used to read historical temperature data and train the support vector regression model in conjunction with the sliding window size.
[0089] The second model training unit is used to read historical temperature data and train the random forest model in conjunction with the sliding window size.
[0090] The third model training unit is used to read historical temperature data and train the gradient boosting regression model in conjunction with the sliding window size.
[0091] Model building unit; used to stack the support vector regression model, random forest model and gradient boosting regression model to obtain the Stacking model, and to calculate whether the mean square error of the current transformer temperature prediction model based on adaptive sliding window and Stacking has reached the minimum.
[0092] The temperature prediction unit is used to predict and transmit the future temperatures of phases A, B, and C of the high-voltage side optical fiber of the main transformer.
[0093] The rule base unit, built based on historical data and professional knowledge, serves as the evaluation standard for early warning after transformer temperature prediction;
[0094] The judgment and early warning unit is used to receive the predicted future temperature sent by the temperature prediction unit and combine it with the rule base unit to make judgments and issue early warnings.
[0095] This invention discloses a transformer temperature early warning method and system. The installation, connection, or setting methods are all common mechanical methods, and any method that achieves the desired beneficial effect can be implemented. Stacking is an ensemble learning method that improves model performance by combining the prediction results of multiple base learners. Its basic idea is to train multiple base learners to learn different parts of the data separately, and then use a meta-learner to integrate the outputs of these base learners to form the final prediction result. The base learners are key to the Stacking model's performance; in this application, they are support vector regression, random forest, and gradient boosting regression. The meta-learner is usually a simple model; in this application, it is ridge regression. This type of method, by combining multiple base learners, can reduce prediction bias and variance, improve the model's generalization ability, and capture more information from the prediction results of different models. Selecting a more diverse set of base learners can improve the Stacking effect; therefore, this application selects support vector regression, random forest, and gradient boosting regression, each with its own characteristics, as base learners.
[0096] Support Vector Regression (SVR) is a regression method based on Support Vector Machines (SVMs) that aims to make predictions by minimizing the trade-off between model complexity and training error. The SVR model seeks an optimal regression hyperplane such that most training data points lie within a specific tolerance band; that is, it uses a function to fit the data, which satisfies the following relationship:
[0097] f(x)=ω T φ(x)+b
[0098] Where ω is the weight vector, x is the input feature, and φ(x) i ) represents the feature map, and b represents the bias. The model mainly includes parameter selection, specifically choosing the tolerance band width ε and the penalty parameter C. ε defines the tolerance range for prediction errors, and C controls the degree of penalty applied to training errors. An optimization problem is constructed, namely, minimizing a loss function to balance model complexity and fitting error. In this application, the following relationship is satisfied:
[0099]
[0100] Where, ξ i and These are slack variables used to handle cases where data points exceed the tolerance band; constraints are added to ensure that the prediction error for each data point does not exceed ε. In this application, the constraints satisfy the following relationship:
[0101]
[0102] Among them, y i Let ω be the true target value of the i-th training sample. Tφ(x i ω + b represents the model's predicted value; solving the optimization problem involves using the Lagrange multiplier method to combine the objective function and constraints, constructing the Lagrange function, and solving for the optimal weight vector ω and bias b; model prediction involves predicting new data points. Support vector regression effectively captures complex relationships in data by finding the optimal regression hyperplane in a high-dimensional feature space, combined with tolerance bands and penalty mechanisms, and is suitable for various regression tasks.
[0103] Random forest is an ensemble learning method primarily used for classification and regression tasks. It improves model accuracy and robustness by constructing multiple decision trees and combining their predictions. The steps include: randomly sampling with replacement from the original training dataset to form multiple distinct training subsets, each used to train an independent decision tree; randomly selecting a specific number of features for evaluation at each node of each decision tree, instead of using all features—this randomness increases model diversity and reduces the risk of overfitting; constructing multiple decision trees based on the bagged samples and randomly selected features, each tree having a different structure as they are trained on different data subsets and feature sets; finally, for regression tasks, averaging the predictions from all trees. Random forest leverages the ensemble of multiple decision trees to improve prediction accuracy and robustness. By introducing randomness, it excels at handling complex data and is suitable for classification and regression problems, making it one of the most widely used algorithms in machine learning.
[0104] The gradient boosting regression model, including initialization, calculates the mean F0(x) of the target value, satisfying the following relationship:
[0105]
[0106] Where y i Let m be the target value of the i-th training sample; iterative training is performed, and for each round m = 1, 2, ..., M, the residuals are calculated, satisfying the following relationship:
[0107]
[0108] Then the weak learner h is trained. m (x), i.e., using residuals Train a new weak learner as the target, then update the model to satisfy the following relationship:
[0109] F m (x)=F m―1 (x)+Υ m h m (x)
[0110] Among them, Υ mThe learning rate controls the impact of the new model on the overall model; the final prediction is used to predict the new sample. Gradient boosting regression performs well in many machine learning competitions and practical applications, and is a very popular choice for regression tasks. By optimizing the loss function, gradient boosting regression can effectively capture complex patterns in the data.
[0111] In this application, the meta-learner of the Stacking model is Ridge Regression, which improves the model's generalization ability by introducing an L2 regularization term to constrain the model's complexity. The process includes: selecting a regularization parameter and determining the regularization strength λ. This parameter controls the model's complexity; a larger value results in a simpler model but is more likely to underfit, while a smaller value results in a more complex model.
[0112] Where β is the regression coefficient, X i This is the feature vector of the i-th sample; to solve the optimization problem, the regression coefficient β is obtained by minimizing the loss function. The analytical solution of ridge regression satisfies the following relationship:
[0113] β * =(X T X+λI) ―1 X T y
[0114] This loss function formula is used to prevent the model from overfitting. The first part is the mean squared error, yi is the temperature value in the dataset, i.e., the actual value, Xiβ is the predicted value, λ is the regularization intensity parameter, and βj is the model parameter, which is different from β.
[0115] Adaptive sliding windows adapt to data changes by continuously adjusting the window size and position, thereby capturing the dynamic characteristics of time-series data during prediction. The steps include: initialization, defining the initial size and step size of the sliding window; window adjustment, dynamically adjusting the window size according to changes in the data flow—decreasing the window size to capture short-term changes when data fluctuations are large, and increasing the window size to capture long-term trends when data is relatively stable; feature construction, constructing features from the data in the current window, which can include statistical features and time-series features; model construction, using the constructed features as input to the prediction model, outputting the predicted value for the current time point; and sliding window movement, moving the sliding window to the next time point according to the set step size, repeating the above steps. In transformer temperature prediction, adaptive sliding windows, when used in conjunction with Stacking, can fully utilize the advantages of different models, enhancing the accuracy and robustness of predictions, making it an effective method for handling complex time-series data.
[0116] The above description is only a preferred embodiment of the present invention. It should be noted that for those skilled in the art, several improvements and modifications can be made without departing from the technical principles of the present invention, and these improvements and modifications should also be considered within the scope of protection of the present invention.
Claims
1. A transformer temperature early warning method, characterized in that, Step 1: Collect historical temperature data of the transformer, that is, extract temperature data over a continuous period of time from the transformer temperature sensor; Step 2: Calculate the sliding window size. The sliding window is one of the important algorithms for time series forecasting, and its size is a key parameter that affects the algorithm's performance. Step 3: Train the support vector regression model based on the transformer temperature data collected in Step 1 and the sliding window size obtained in Step 2; Step 4: Train a random forest model based on the transformer temperature data collected in Step 1 and the sliding window size obtained in Step 2; Step 5: Train the gradient boosting regression model based on the transformer temperature data collected in Step 1 and the sliding window size obtained in Step 2; Step 6: Stack the models obtained in Steps 3, 4, and 5 to obtain the Stacking model, and calculate whether the mean square error of the current transformer temperature prediction model based on adaptive sliding window and Stacking has reached the minimum. If it has reached the minimum, proceed to Step 7; otherwise, return to Step 2. Step 7: Predict future temperatures based on the optimal transformer temperature prediction model based on adaptive sliding window and Stacking. Step 8: Construct an early warning rule base based on historical data and professional knowledge, which will serve as the evaluation criteria for early warning after transformer temperature prediction; Step 9: Make a judgment and issue an early warning based on the predicted transformer temperature obtained in Step 7 and the early warning rule base obtained in Step 8; In step one, historical temperature data of the transformer is collected, which is the temperature of the three phases A, B, and C of the high-voltage side fiber optic cable of the main transformer. In step two, the sliding window size is calculated and continuously updated until the training prediction mean square error reaches its minimum. In step three, the support vector regression model aims to find an optimal regression hyperplane that ensures most training data points lie within a tolerance band. This involves using a function to fit the data, satisfying the following relationship: , in, It is a weight vector. For input features, Here, b represents the feature map, and b is the bias. The model mainly includes the selection of parameters, specifically the width of the tolerance band. and penalty parameter C, The tolerance range for prediction error is defined, and C controls the degree of penalty for training error; an optimization problem is constructed, namely minimizing a loss function to balance the complexity of the model and the fitting error, satisfying the following relationship: , in, and These are slack variables used to handle cases where data points exceed the tolerance band; constraints are added to ensure that the prediction error for each data point does not exceed [the tolerance band]. The constraint conditions satisfy the following relationship: , in, Let i be the true target value of the i-th training sample. This represents the model's predicted values; to solve the optimization problem, the Lagrange multiplier method is used to combine the objective function and constraints, construct the Lagrange function, and solve for it to obtain the optimal weight vector. and bias b; Based on the random forest model in step four, combined with the prediction results of multiple decision tree models; In step eight, the early warning rule base is divided into three warning levels. Level 1 is a minor warning, requiring continuous online monitoring of transformer temperature changes by staff, but no further action is needed. Level 2 is a moderate warning, requiring on-site inspection of the transformer's operating status by staff. Level 3 is a severe warning, requiring immediate shutdown of the transformer for inspection, detailed fault analysis and troubleshooting, and checking of electrical connections and insulation status. These three warning levels correspond to three temperature change thresholds, which are respectively... , , It is stated that, due to the periodicity of temperature changes in transformers, a warning rule base is proposed with a daily cycle. The average value of data at the same time each day from historical data is used as the evaluation standard. If the difference between the predicted temperature and the average value is less than [a certain value], the rule will be issued. If the difference between the predicted temperature and the average temperature is greater than or equal to 0, no warning action will be taken; if the difference is greater than or equal to 0, no warning action will be taken. And less than Then, a Level 1 warning will be issued; if the difference between the predicted temperature and the average temperature is greater than or equal to... And less than Then a Level 2 early warning operation will be initiated; if the difference between the predicted temperature and the average temperature is greater than or equal to... Then a Level 3 early warning operation will be initiated.
2. The transformer temperature early warning method as described in claim 1, characterized in that, Step five, the gradient boosting regression model, includes initialization and calculation of the mean of the target value. (x), satisfying the relation: , in Let m be the target value of the i-th training sample; iterative training, for each round m=1,2,...,M, calculate the residuals, satisfying the following relationship: , Then, the weak learner was trained. That is, using residuals Train a new weak learner as the target, then update the model to satisfy the following relationship: , in, The learning rate is used to control the degree of influence of the new model on the overall model.
3. The transformer temperature early warning method as described in claim 2, characterized in that, The transformer temperature prediction model in step seven predicts the temperatures of the three phases A, B, and C of the high-voltage side fiber of the main transformer.
4. The transformer temperature early warning method as described in claim 1, characterized in that, Step eight is independent of steps one through seven.
5. A transformer temperature early warning system, characterized in that, The transformer temperature early warning method according to any one of claims 1 to 4 includes a data collection unit, an algorithm logic unit, a first model training unit, a second model training unit, a third model training unit, a model building unit, a temperature prediction unit, a rule base unit, and a judgment and early warning unit. The data collection unit is used to collect and store historical temperature data under varying pressure. The algorithm logic unit is used to receive historical temperature data and continuously update the sliding window size until the training prediction mean square error reaches its minimum. The first model training unit is used to read historical temperature data and train the support vector regression model in conjunction with the sliding window size. The second model training unit is used to read historical temperature data and train the random forest model in conjunction with the sliding window size. The third model training unit is used to read historical temperature data and train the gradient boosting regression model in conjunction with the sliding window size. Model building unit; used to stack the support vector regression model, random forest model and gradient boosting regression model to obtain the Stacking model, and to calculate whether the mean square error of the current transformer temperature prediction model based on adaptive sliding window and Stacking has reached the minimum. The temperature prediction unit is used to predict and transmit the future temperatures of phases A, B, and C of the high-voltage side optical fiber of the main transformer. The rule base unit, built based on historical data and professional knowledge, serves as the evaluation standard for early warning after transformer temperature prediction; The judgment and early warning unit is used to receive the predicted future temperature sent by the temperature prediction unit and combine it with the rule base unit to make judgments and issue early warnings.