A lightning arrester temperature compensation method and system based on DSA-CTCM network
Through the temperature compensation method based on the DSA-CTCM network, a dual-stage self-attention combined with MambaNet temporal convolutional network model is constructed, and parameters are adjusted in real time to solve the accuracy and adaptability problems of lightning arrester temperature monitoring and achieve high-precision temperature compensation effect.
Patent Information
- Application Number
- CN202411620765.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-11-14
- Publication Date
- 2025-09-26
- Estimated Expiration
- 2044-11-14
AI Technical Summary
The existing temperature monitoring method for lightning arresters relies on local contact sensors, which cannot fully reflect the internal temperature distribution. In addition, the existing temperature compensation method lacks a comprehensive response to complex temperature fields and is difficult to adapt to rapid changes in ambient temperature, affecting the reliability and service life of the lightning arrester.
A temperature compensation method based on the DSA-CTCM network is adopted. By obtaining the historical environmental data of the lightning arrester for preprocessing, a temporal convolutional network model combining dual-stage self-attention and MambaNet is constructed. A dynamic feedback mechanism is established to adjust the temperature compensation model parameters in real time to ensure high-precision temperature compensation under rapid changes in the external environment.
The time series data processing capability and feature focus accuracy of the temperature compensation model have been significantly improved, and the accuracy and adaptability of temperature compensation have been improved, ensuring the provision of high-precision temperature compensation results in complex environments.
Smart Images

Figure CN119514364B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of lightning arrester detection, and in particular to a lightning arrester temperature compensation method and system based on a DSA-CTCM network. Background Art
[0002] The health of substation equipment is crucial to the operation and maintenance of power systems. As power loads increase, the demand for monitoring substation equipment is growing. Infrared temperature measurement technology, due to its non-contact and rapid measurement capabilities, has become a common method for monitoring the thermal status of substation equipment. This technology analyzes infrared radiation from the surface of the equipment to detect temperature distribution and assess whether the equipment is faulty. However, infrared temperature measurement technology primarily relies on manual inspections, using handheld infrared imagers to capture two-dimensional infrared images for fault diagnosis. This technology suffers from issues such as missed detections, strong subjective judgment, and time lags. This is particularly true in complex environments, such as substations with complex structures and equipment obstructing each other, resulting in suboptimal infrared detection results. Furthermore, environmental factors such as climate and light radiation can also affect the accuracy of infrared temperature measurement, necessitating effective real-time compensation measures to ensure accurate temperature detection.
[0003] As a key protection device for the power system, the performance of the lightning arrester is particularly affected by temperature changes. During long-term operation and harsh environments, temperature changes may cause the leakage current of the lightning arrester to increase. Long-term high temperature may also accelerate the degradation of the zinc oxide material, affecting the electrical characteristics and service life of the lightning arrester. Although the internal temperature of the lightning arrester is closely related to its electrical performance, the temperature monitoring methods in the existing technology mostly rely on local contact temperature sensors, which cannot fully reflect the temperature distribution inside the lightning arrester. At the same time, the installation of these sensors may affect the structural integrity of the lightning arrester and increase the difficulty of maintenance. In addition, the existing temperature compensation methods are relatively simple, usually based on temperature feedback regulation systems, lack a comprehensive response to complex temperature fields, and are difficult to adapt to rapid changes in ambient temperature. Especially under complex meteorological conditions and strong electromagnetic environments, the limitations of the existing temperature compensation methods are more prominent, seriously affecting the accuracy of infrared temperature measurement of substation equipment, and thus affecting the reliability and service life of the lightning arrester. Summary of the Invention
[0004] In response to the above-mentioned problems in the prior art, the purpose of the present invention is to provide a lightning arrester temperature compensation method and system based on the DSA-CTCM network. By constructing a lightning arrester temperature compensation model based on the DSA-CTCM network, the accurate value of the lightning arrester temperature after temperature compensation is obtained, and through dynamic correction and real-time feedback mechanism, it is ensured that the temperature compensation model can provide high-precision temperature compensation results when the external environment changes rapidly.
[0005] In order to achieve the above purpose, the present invention adopts the following technical solutions:
[0006] In a first aspect, an embodiment of the present invention provides a lightning arrester temperature compensation method based on a DSA-CTCM network, comprising:
[0007] S1: Obtain historical environmental data of the arrester;
[0008] The environmental data includes temperature data of the arrester and climate data of the environment in which the arrester is located;
[0009] S2: preprocess the historical environmental data of the arrester;
[0010] S3: Based on the dual-stage self-attention combined with the temporal convolutional network of MambaNet, a temperature compensation model is constructed and trained using historical environmental data after data preprocessing;
[0011] S4: acquiring real-time environmental data of the arrester, inputting the real-time environmental data into a temperature compensation model to acquire predicted temperature data, and calculating a temperature deviation value between the real-time temperature data and the predicted temperature data;
[0012] S5: establishing a dynamic feedback mechanism, dynamically generating a compensation coefficient of the temperature compensation model according to the temperature deviation value, feeding the compensation coefficient back to the temperature compensation model to adjust the temperature compensation model parameters, and performing a performance evaluation on the temperature compensation model.
[0013] Optionally, S2 includes the following specific steps:
[0014] S201: Acquire historical environmental data of the arrester and synchronize the historical environmental data;
[0015] The data synchronization is to add a timestamp to each historical environmental data record and align the historical environmental data at different times;
[0016] S202: performing data cleaning processing on the historical environmental data;
[0017] S203: Smoothing the historical environmental data based on a Kalman filter algorithm;
[0018] S204: extracting the mean and standard deviation of the historical environmental data, and performing normalization processing on the historical environmental data;
[0019] S205: Perform Z-Score standardization processing on the historical environmental data.
[0020] Optionally, the Kalman filter algorithm in S203 includes a prediction process and an update process;
[0021] The function expression of the prediction process is:
[0022]
[0023]
[0024] Where, is the system state vector at time k, is the system state vector at time k-1; is the state transfer matrix; is the control matrix; is the control input; for The transposed matrix of and The state vectors are and The uncertainty covariance matrix of is the noise covariance matrix;
[0025] The function expression of the update process is:
[0026]
[0027]
[0028]
[0029] Where, is the Kalman gain, is the forecast error covariance, is a column vector of prior estimates, for The transposed matrix of is the sensor noise covariance matrix; is the best estimate for this forecast update, is the system sensor observation value; is the optimal covariance matrix after the update of this prediction;
[0030] The function expression of the normalization process in S204 is:
[0031]
[0032] Where x' is the normalized historical environmental data; x is the historical environmental data; min(x) is the minimum value of the historical environmental data, and max(x) is the maximum value of the historical environmental data;
[0033] The function expression of the Z-Score standardization in S205 is:
[0034]
[0035] Where X is the standardized historical environmental data; μ is the mean of the historical environmental data; and σ is the standard deviation of the historical environmental data.
[0036] Optionally, S3 includes the following specific steps:
[0037] S301: Establishing an environmental data set based on the historical environmental data after data preprocessing; the environmental data set includes a training set and a test set;
[0038] S302: Constructing a lightning arrester temperature compensation model based on a dual-stage self-attention combined with a MambaNet temporal convolutional network; the temperature compensation model includes an encoder, a Mamba module, and a decoder;
[0039] S303: Input the data in the training set into the encoder, extract the feature sequence of the input data based on the encoder, calculate the importance weight of the feature sequence to generate a weighted hidden state, and encode the hidden state and send it to the Mamba module;
[0040] S304: Based on the Mamba module, the encoder output is integrated, the dimensions are transformed, and key timing information is dynamically selected to enhance the time series modeling capability of the model, and a suitable feature sequence is generated and sent to the decoder;
[0041] S305: The decoder decodes the hidden state using the classification information and adaptively selects the importance weight of the hidden state to generate a new hidden state, combines the new hidden state with the feature sequence output by the Mamba module, and calculates the predicted temperature data after temperature compensation.
[0042] S306: Calculating a temperature difference between the historical temperature data and its corresponding predicted temperature data, and adjusting parameters of the temperature compensation model based on the temperature difference, and continuously iterating the training;
[0043] S307: When the number of training iterations of the temperature compensation model reaches a preset number of test times, a performance test is performed on the temperature compensation model based on the test set; if the model performance is qualified, the training of the temperature compensation model is completed; if the model performance is unqualified, step S308 is executed;
[0044] S308: Determine whether the number of iterations reaches a preset number of iterations. If so, complete the training of the temperature compensation model; otherwise, return to step S303.
[0045] Optionally, S4 includes the following specific steps:
[0046] S401: Acquire real-time environmental data of the arrester;
[0047] S402: Inputting the real-time environmental data into the trained temperature compensation model to obtain predicted temperature data;
[0048] The calculation formula for the predicted temperature data is:
[0049]
[0050] Where, To predict temperature data, For real-time climate data, is the historical temperature data;
[0051] S403: Calculating the temperature deviation between the real-time temperature data and the predicted temperature data;
[0052] The calculation formula of the temperature deviation value is:
[0053]
[0054] Where, is the real-time temperature data, and b is the temperature deviation value.
[0055] Optionally, S5 includes the following specific steps:
[0056] S501: Establishing a dynamic feedback mechanism; the dynamic feedback mechanism includes a dynamic correction algorithm and a real-time feedback mechanism; S502: Based on a preset abnormal deviation threshold, determining whether the temperature deviation value is greater than the abnormal deviation threshold; if so, recording the temperature deviation value and executing step S503; otherwise, outputting predicted temperature data;
[0057] S503: Based on the dynamic correction algorithm, dynamically generate the adjustment coefficient of the temperature compensation model according to the temperature deviation value;
[0058] S504: generating a feedback signal according to the temperature deviation value and climate data;
[0059] S505: Based on the real-time feedback mechanism, adjust the temperature compensation model parameters according to the adjustment coefficient and the feedback signal;
[0060] S506: Generate a deviation data set based on the temperature deviation value recorded in step 502, and calculate the mean and variance of the deviation data set to evaluate the performance of the temperature compensation model to ensure continuous optimization and normal operation of the model.
[0061] Optionally, the function expression of the dynamic correction algorithm in S503 is:
[0062]
[0063] Where, is the new compensation coefficient, is the old compensation coefficient, To adjust the rate;
[0064] The function expression of the feedback signal is:
[0065]
[0066] Where, is the feedback signal, is the bias weight, is the change weight of climate data, is the change in climate data;
[0067] The function expression of the real-time feedback mechanism is:
[0068]
[0069] Where, is the adjusted compensation coefficient, is the feedback adjustment coefficient;
[0070] The mean and variance of the deviation data set are calculated as follows:
[0071]
[0072]
[0073] Where, is the mean deviation, is the bias variance, is the temperature deviation value in the deviation data set, and N is the number of samples in the deviation data set.
[0074] Optionally, the encoder includes a convolutional neural network layer, an input multi-head self-attention layer, and a temporal convolutional network layer connected in sequence;
[0075] The Mamba module includes a splicing layer, a flattening layer, a linear mapping layer, a selective state space model layer and a one-dimensional convolution layer connected in sequence;
[0076] The encoder includes a temporal multi-head self-attention layer and a temporal convolutional network layer connected in sequence.
[0077] Optionally, the process of performing data cleaning on the historical environment data in step S202 includes one or more of the following:
[0078] Check the integrity and consistency of historical environmental data, remove noise, fill in missing data, and delete invalid data.
[0079] In a second aspect, an embodiment of the present invention provides a lightning arrester temperature compensation method based on a DSA-CTCM network, comprising:
[0080] Data acquisition module, used to obtain historical environmental data of the lightning arrester;
[0081] The environmental data includes temperature data of the arrester and climate data of the environment in which the arrester is located;
[0082] A data preprocessing module is used to preprocess the historical environmental data of the arrester;
[0083] The model building module is used to build and train a temperature compensation model based on the historical environmental data after data preprocessing, based on the dual-stage self-attention combined with the temporal convolutional network of MambaNet;
[0084] a deviation calculation module for obtaining real-time environmental data of the arrester, inputting the real-time environmental data into a temperature compensation model to obtain predicted temperature data, and calculating a temperature deviation value between the real-time temperature data and the predicted temperature data;
[0085] The dynamic correction module is used to establish a dynamic feedback mechanism, dynamically generate a compensation coefficient of the temperature compensation model according to the temperature deviation value, feed the compensation coefficient back to the temperature compensation model to adjust the temperature compensation model parameters, and perform performance evaluation on the temperature compensation model.
[0086] The beneficial effects brought about by the embodiments provided by the present invention include:
[0087] By integrating a temporal convolutional network with a two-stage self-attention mechanism, the present invention significantly improves the temporal data processing capability and feature attention accuracy of the temperature compensation model. It can effectively capture long-term dependencies in environmental data to accurately identify and weight environmental data at different time steps, thereby increasing the model's sensitivity to time series changes and improving the accuracy of temperature compensation.
[0088] By integrating a temporal convolutional network with a two-stage self-attention mechanism, the present invention enables the temperature compensation model to learn on different time scales, adapt to temperature change patterns in different time periods, and improve the temperature prediction accuracy of the model.
[0089] By combining convolutional neural networks and selective state-space models, the present invention significantly enhances the feature extraction capability of the temperature compensation model, effectively extracting spatial and local features from environmental data, and helping the model perform temperature compensation more accurately.
[0090] The present invention establishes a dynamic feedback mechanism to ensure that the temperature compensation model can provide high-precision temperature compensation results even when the external environment of the arrester changes rapidly. BRIEF DESCRIPTION OF THE DRAWINGS
[0091] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the following briefly introduces the drawings required for use in the embodiments or the description of the prior art. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative work.
[0092] Figure 1 A flow chart of a lightning arrester temperature compensation method based on a DSA-CTCM network according to an embodiment of this specification is shown;
[0093] Figure 2 shows a schematic structural diagram of a lightning arrester according to an embodiment of this specification;
[0094] Figure 3 shows a schematic diagram of a temperature compensation model according to an embodiment of this specification;
[0095] Figure 4 The figure shows a structural block diagram of a lightning arrester temperature compensation system based on a DSA-CTCM network according to an embodiment of the present specification. DETAILED DESCRIPTION
[0096] In order to make the objectives, technical solutions and advantages of the present disclosure more clearly understood, the present disclosure is further described in detail below in conjunction with specific embodiments and with reference to the accompanying drawings.
[0097] However, it should be understood that these descriptions are merely exemplary and are not intended to limit the scope of the present disclosure. In the detailed description below, for ease of explanation, many specific details are set forth to provide a comprehensive understanding of the embodiments of the present disclosure. However, it is apparent that one or more embodiments may also be implemented without these specific details. In addition, in the following description, descriptions of known technologies are omitted to avoid unnecessarily confusing the concepts of the present disclosure.
[0098] The terms used herein are only for describing specific embodiments and are not intended to limit the present disclosure. The term "comprising" used herein indicates the presence of features, steps, operations, but does not exclude the presence or addition of one or more other features. It should be noted that all terms (including technical and scientific terms) used herein have the meanings commonly understood by those skilled in the art, unless otherwise defined. It should be noted that the terms used here should be interpreted as having meanings consistent with the context of this specification, and should not be interpreted in an idealized or overly rigid manner.
[0099] Example 1
[0100] Figure 1 A flow chart of a lightning arrester temperature compensation method based on a DSA-CTCM network according to an embodiment of this specification is shown;
[0101] like Figure 1 As shown, this embodiment provides a lightning arrester temperature compensation method based on a DSA-CTCM network, including:
[0102] S1: Obtain historical environmental data of the arrester;
[0103] Exemplarily, the environmental data includes temperature data of the lightning arrester and climate data of the environment in which the lightning arrester is located;
[0104] Among them, climate data includes environmental factors that affect infrared temperature measurement, such as wind speed, humidity, and solar radiation.
[0105] Figure 2 Schematic diagram of the structure of the lightning arrester according to the embodiment of this specification is shown; wherein (a) is a cross-sectional view of a single-section lightning arrester; (b) is a front view of a single-section lightning arrester;
[0106] like Figure 2 As shown, in some embodiments, this embodiment uses high-precision temperature sensors and environmental sensors, and reasonably arranges them on the porcelain sleeve of the lightning arrester according to the structure and environment of the lightning arrester, which can ensure that the monitoring area fully covers the lightning arrester, so as to regularly collect temperature data on the surface of the lightning arrester and climate data of the environment in which the lightning arrester is located.
[0107] S2: preprocess the historical environmental data of the arrester;
[0108] Exemplarily, S2 includes the following specific steps:
[0109] S201: Acquire historical environmental data of the arrester and synchronize the historical environmental data;
[0110] Data synchronization involves adding a timestamp to each historical environmental data record and aligning the historical environmental data at different times.
[0111] S202: performing data cleaning on the historical environmental data;
[0112] In some embodiments, the data cleaning process includes one or more of checking the integrity and consistency of historical environmental data, removing noise, filling missing data, and deleting invalid data;
[0113] Specifically, the historical environmental data obtained in this embodiment may contain noise and outliers. The Z-score method is used to clean the data. The Z-score of each environmental data point is calculated. If the Z-score exceeds the threshold, it is marked as an outlier and deleted.
[0114] Specifically, missing values may appear in the historical environmental data obtained in this embodiment, and the missing values in the historical environmental data are filled in by a linear interpolation method.
[0115] S203: Smoothing the historical environmental data based on a Kalman filter algorithm;
[0116] In some embodiments, this embodiment smoothes the environmental data through the Kalman filter algorithm, which can remove random fluctuations and improve the availability of data; wherein, based on the prediction process and update process in the Kalman filter algorithm, the measurement and prediction results can be integrated to obtain more accurate prediction results.
[0117] Specifically, the function expression of the prediction process is:
[0118]
[0119] Where,
[0120] Specifically, the function expression of the update process is:
[0121]
[0122]
[0123] Where, is the Kalman gain, is the forecast error covariance;
[0124] S204: extracting the mean and standard deviation of the historical environmental data, and performing normalization processing on the historical environmental data;
[0125] In this embodiment, the historical environmental data are normalized to adjust the environmental data acquired by different sensors to the same scale, thereby facilitating subsequent processing.
[0126] Specifically, the function expression of normalization is:
[0127]
[0128] Where x' is the normalized historical environmental data; x is the historical environmental data; min(x) is the minimum value of the historical environmental data, and max(x) is the maximum value of the historical environmental data;
[0129] S205: Perform Z-Score standardization processing on the historical environmental data.
[0130] Specifically, the function expression of Z-Score standardization is:
[0131]
[0132] Where X is the standardized historical environmental data; μ is the mean of the historical environmental data; and σ is the standard deviation of the historical environmental data.
[0133] S3: Based on the dual-stage self-attention combined with the temporal convolutional network of MambaNet, a temperature compensation model is constructed and trained using historical environmental data after data preprocessing;
[0134] Figure 3 shows a schematic diagram of a temperature compensation model according to an embodiment of this specification;
[0135] like Figure 3 As shown, illustratively, S3 includes the following specific steps:
[0136] S301: Establishing an environmental data set based on the historical environmental data after data preprocessing;
[0137] In some embodiments, the environmental dataset is divided into a training set and a test set in a ratio of 7:3;
[0138] The data set includes multiple samples and labels corresponding to each sample. The samples are actual climate data of each arrester temperature compensation point at each historical moment in a historical time period. The labels are actual measured temperatures of each temperature compensation point.
[0139] S302: Constructing a lightning arrester temperature compensation model based on a dual-stage self-attention and MambaNet temporal convolutional network;
[0140] In this embodiment, the DSA-CTCM network refers to a dual-stage self-attention-based temporal convolutional network combined with MambaNet.
[0141] In some embodiments, the arrester temperature compensation model based on the DSA-CTCM network adopts an encoder-MambaNet-decoder structure. Considering the characteristics of strong coupling and large hysteresis of the arrester temperature compensation, the temperature compensation model sets the input as the real environmental data of k temperature measurement points from time T to time T+t, and the output is set as the compensated temperature data of the k temperature measurement points at time T+t.
[0142] Specifically, the encoder includes a convolutional neural network layer (CNN), a multi-head self-attention layer (Input Multi-Head Self-Attention) and a temporal convolutional network layer (Temporal Convolutional Network, TCN) connected in sequence;
[0143] Specifically, the Mamba module includes a concatenation layer (Concat), a flattening layer (Flatten), a linear mapping layer (Linear), a selective state space model layer (Selective SSM), and a one-dimensional convolution layer (Conv1d) connected in sequence;
[0144] Specifically, the encoder includes a temporal multi-head self-attention layer and a temporal convolutional network layer connected in sequence;
[0145] S303: After the training set data is input into the encoder, the feature sequence of the input data is extracted through the convolutional neural network layer. The importance weight of the feature sequence is calculated using the input multi-head self-attention layer, and the feature sequence is weighted summed to generate a hidden state. The hidden state is encoded based on the temporal convolutional network layer and sent to the Mamba module;
[0146] S304: Based on the Mamba module, the encoder output is integrated through the concatenation layer and the flattening layer, and the dimension is transformed. The encoded information is passed through the Linear layer, the Selective SSM layer, the Conv1d layer, and the Linear layer respectively to dynamically select timing information and enhance the modeling capability of time series. Finally, the two are multiplied and input into the decoder.
[0147] Specifically, the encoder extracts features from the input environmental data, extracting the spatial and preliminary temporal relationships between different temperature measurement points. The Mamba model receives the encoder output and integrates features from different time steps using the Concat and Flatten layers. It also performs dimensionality transformation, flattening the multidimensional features output by the encoder into a single dimension and concatenating features from different time steps. This allows these feature representations to be processed uniformly, enabling more efficient feature calculation and temporal information extraction.
[0148] The Linear layer then further adjusts the feature dimensions, making the data structure more suitable for subsequent time series modeling operations. The Selective SSM (Selective State Space Model) module can be viewed as a dynamic time series information extraction mechanism. By selectively modeling features at different time steps, it can flexibly adjust its focus on specific time steps based on the temporal changes of the input data, extracting the most representative time series features. Furthermore, the Conv1d layer captures the relationships between local time steps. This combination enables the Mamba model to not only identify global time series patterns but also extract key local time series features. Furthermore, the Selective SSM (Selective State Space Model) and Conv1d layers enhance the model's understanding of time series data. This enhancement is reflected in the model's ability to capture long-term and short-term dependencies in the input data and strike a balance between global and local time series patterns, thereby generating more effective time series feature representations.
[0149] Finally, after the Mamba module performs timing modeling and feature extraction, the generated feature sequence contains the integrated timing information and dynamic features of key time steps, which is convenient for further processing by the decoder.
[0150] S305: The decoder decodes the hidden state using the classification information and adaptively selects the importance weight of the hidden state through temporal multi-head self-attention to generate a new hidden state, combines it with the feature sequence output by the Mamba module, and finally calculates the temperature-compensated predicted temperature data through the temporal convolutional network layer;
[0151] S306: Calculating a temperature difference between the historical temperature data and its corresponding predicted temperature data, and adjusting parameters of the temperature compensation model based on the temperature difference, and continuously iterating the training;
[0152] S307: When the number of training iterations of the temperature compensation model reaches a preset number of tests, a performance test is performed on the temperature compensation model based on the test set; if the model performance is qualified, the training of the temperature compensation model is completed; if the model performance is unqualified, step S308 is executed; wherein the preset number of tests is 100 and the preset number of tests is always less than the preset number of iterations;
[0153] Specifically, the temperature compensation model is tested every 100 iterations. After the test set is input into the model, the temperature difference between the historical temperature data and the corresponding predicted temperature data is calculated to determine whether the temperature difference is less than the preset temperature difference accuracy. If so, the temperature compensation model test is qualified and its temperature compensation effect is good; if not, the temperature compensation model test is unqualified.
[0154] S308: Determine whether the number of iterations reaches a preset number of iterations. If so, complete the training of the temperature compensation model; otherwise, return to step S303.
[0155] In some embodiments, the model iteration training cutoff condition in S308 further includes determining whether the temperature difference between the historical temperature data and the corresponding predicted temperature data reaches a preset compensation accuracy.
[0156] S4: acquiring real-time environmental data of the arrester, inputting the real-time environmental data into a temperature compensation model to acquire predicted temperature data, and calculating a temperature deviation value between the real-time temperature data and the predicted temperature data;
[0157] Exemplarily, S4 includes the following specific steps:
[0158] S401: Acquire real-time environmental data of the arrester;
[0159] S402: Inputting the real-time environmental data into the trained temperature compensation model to obtain predicted temperature data;
[0160] The calculation formula for the predicted temperature data is:
[0161]
[0162] Where, To predict temperature data, For real-time climate data, is the historical temperature data;
[0163] S403: Calculating the temperature deviation between the real-time temperature data and the predicted temperature data;
[0164] The calculation formula of the temperature deviation value is:
[0165]
[0166] Where, is the real-time temperature data, and b is the temperature deviation value.
[0167] S5: Establish a dynamic correction and real-time feedback mechanism, dynamically generate an adjustment coefficient of the temperature compensation model according to the temperature deviation value, feed the adjustment coefficient back to the temperature compensation model to adjust the temperature compensation model parameters, and perform a performance evaluation on the temperature compensation model.
[0168] Exemplarily, S5 includes the following specific steps:
[0169] S501: Establishing a dynamic feedback mechanism; the dynamic correction and real-time feedback mechanism includes a dynamic correction algorithm and a real-time feedback mechanism;
[0170] S502: Based on a preset abnormal deviation threshold, determine whether the temperature deviation value is greater than the abnormal deviation threshold; if so, record the temperature deviation value and execute step S503; otherwise, output the predicted temperature data;
[0171] S503: Based on the dynamic correction algorithm, dynamically generate the adjustment coefficient of the temperature compensation model according to the temperature deviation value;
[0172] S504: generating a feedback signal according to the temperature deviation value and climate data;
[0173] S505: Based on the real-time feedback mechanism, adjust the temperature compensation model parameters according to the adjustment coefficient and the feedback signal;
[0174] S506: Generate a deviation data set based on the temperature deviation value recorded in step 502, and calculate the mean and variance of the deviation data set to evaluate the performance of the temperature compensation model to ensure continuous optimization and normal operation of the model.
[0175] Specifically, the function expression of the dynamic correction algorithm in S503 is:
[0176]
[0177] Where, is the new compensation coefficient, is the old compensation coefficient, To adjust the rate;
[0178] Among them, the function expression of the feedback signal is:
[0179]
[0180] Where, is the feedback signal, is the bias weight, is the change weight of climate data, is the change in climate data;
[0181] Among them, the function expression of the real-time feedback mechanism is:
[0182]
[0183] Where, is the adjusted compensation coefficient, is the feedback adjustment coefficient;
[0184] Among them, the mean and variance of the deviation data set are calculated as follows:
[0185]
[0186]
[0187] Where, is the mean deviation, is the bias variance, is the temperature deviation value in the deviation data set, and N is the number of samples in the deviation data set.
[0188] In this embodiment, a data set is constructed by obtaining the real environmental data of the lightning arrester, and the training in the data set is used to iteratively train the nonlinear temperature compensation model based on deep learning. An independent test set is used to perform performance testing on the trained temperature compensation model to evaluate the compensation effect of the model. In addition, this embodiment also establishes a dynamic feedback mechanism to ensure that the temperature compensation model can provide high-precision temperature compensation results even when the external environment of the lightning arrester changes rapidly.
[0189] Example 2
[0190] Figure 4 FIG2 shows a structural block diagram of a lightning arrester temperature compensation system based on a DSA-CTCM network according to an embodiment of the present specification;
[0191] like Figure 4 As shown, this embodiment provides a lightning arrester temperature compensation system 100 based on a DSA-CTCM network, including:
[0192] Data acquisition module 101, used to obtain historical environmental data of the lightning arrester;
[0193] The environmental data includes temperature data of the arrester and climate data of the environment in which the arrester is located;
[0194] The data preprocessing module 102 is used to preprocess the historical environmental data of the arrester;
[0195] A model building module 103 is used to build and train a temperature compensation model based on a dual-stage self-attention combined with a MambaNet temporal convolutional network using pre-processed historical environmental data;
[0196] a deviation calculation module 104 for obtaining real-time environmental data of the arrester, inputting the real-time environmental data into a temperature compensation model to obtain predicted temperature data, and calculating a temperature deviation value between the real-time temperature data and the predicted temperature data;
[0197] The dynamic correction module 105 is used to establish a dynamic feedback mechanism, dynamically generate a compensation coefficient of the temperature compensation model according to the temperature deviation value, feed the compensation coefficient back to the temperature compensation model to adjust the temperature compensation model parameters, and perform performance evaluation on the temperature compensation model.
[0198] Example 3
[0199] This embodiment provides an electronic device, including at least one control processor and a memory for communicating with the at least one control processor;
[0200] The memory, as a non-transient computer-readable storage medium, can be used to store non-transient software programs and non-transient computer executable programs. In addition, the memory may include a high-speed random access memory and may also include a non-transient memory, such as at least one disk storage device, a flash memory device, or other non-transient solid-state storage device. In some embodiments, the memory may optionally include a memory remotely arranged relative to the processor, and these remote memories may be connected to the processor 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.
[0201] The non-transient software program and instructions required to implement the above embodiment of a lightning arrester temperature compensation method based on a DSA-CTCM network are stored in the memory. When executed by the processor, the above embodiment of a lightning arrester temperature compensation method based on a DSA-CTCM network is executed, for example, the above described method is executed. Figure 1 Method steps S1 to S5 in .
[0202] The system embodiment described above is merely illustrative. The units described as separate components may or may not be physically separate, i.e., they may be located in one place or distributed across multiple network units. Some or all of these units may be selected based on actual needs to achieve the objectives of this embodiment.
[0203] Example 4
[0204] This embodiment provides a computer-readable storage medium storing computer-executable instructions for enabling a computer to execute a lightning arrester temperature compensation method based on a DSA-CTCM network as described in embodiment 1.
[0205] It should be noted that the computer-readable storage medium of the present embodiment may be a computer-readable signal medium or a computer-readable storage medium or any combination thereof. The computer-readable storage medium may be, for example, but not limited to, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, device, or component, or any combination thereof. More specific examples of computer-readable storage media may include, but are not limited to, an electrical connection having one or more wires, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination thereof.
[0206] In this embodiment, a computer-readable storage medium may be any tangible medium containing or storing a program that can be used by or in conjunction with an instruction execution system, apparatus, or device. Furthermore, in this embodiment, a computer-readable signal medium may include a data signal propagated in baseband or as part of a carrier wave, which carries a computer-readable program. This propagated data signal may take a variety of forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination thereof. A computer-readable signal medium may also be any computer-readable storage medium other than a computer-readable storage medium that can transmit, propagate, or transfer a program for use by or in conjunction with an instruction execution system, apparatus, or device. The computer program contained on a computer-readable storage medium may be transmitted using any suitable medium, including but not limited to wires, optical cables, RF (radio frequency), etc., or any suitable combination thereof.
[0207] The computer readable storage medium can be written in one or more programming languages or a combination thereof to execute the computer program for performing the present embodiment, including object-oriented programming languages such as Python, Java, C++, and conventional procedural programming languages such as C or similar programming languages. The program can be executed entirely on the user's computer, partially on the user's computer, as a separate software package, partially on the user's computer and partially on a remote computer, or entirely on a remote computer or server. In the case of a remote computer, the remote computer can be connected to the user's computer through any type of network, including a local area network (LAN) or a wide area network (WAN), or can be connected to an external computer (for example, using an Internet service provider to connect via the Internet).
[0208] In summary, this embodiment can effectively capture long-term dependencies in environmental data through the time series convolutional network, which is crucial for analyzing temperature changes with time series characteristics. It significantly improves the model's ability to process time series data of temperature measurement data and improves the accuracy and reliability of temperature compensation.
[0209] This embodiment introduces a two-stage self-attention mechanism, enhancing the model's ability to focus on important features in the input data. This allows the model to flexibly identify and weight temperature data at different time steps, thereby increasing the model's sensitivity to time series changes and further improving the effectiveness of temperature compensation. At the same time, by combining the temporal convolutional network and the self-attention mechanism, the model achieves multi-timescale learning capabilities, enabling the model to adapt to temperature change patterns within different time periods, improving prediction accuracy, and making temperature compensation more flexible and accurate.
[0210] This embodiment effectively improves the feature extraction capability of the temperature compensation model by combining the convolutional neural network and the selective state space model, so that the temperature compensation model can more accurately extract the spatial and local features in the temperature data, providing strong support for more accurate temperature compensation.
[0211] This embodiment enhances the flexibility of the model structure through the design of the Concat layer, the Flatten layer, and the linear layer, so that the DSA-CTCM network can be adjusted according to the characteristics of the actual data, optimizing the model performance to adapt to different temperature compensation scenarios.
[0212] This embodiment improves the generalization ability of the model through the application of the self-attention mechanism, so that the model can better understand and remember important patterns in the input data, reduce the risk of overfitting, improve the generalization ability of the model on new data, and ensure the stability and effectiveness of the temperature compensation model in different environments and conditions.
[0213] The foregoing description is merely a preferred embodiment of the present invention. It will be apparent to those skilled in the art that the present invention is not limited to the details of the exemplary embodiments described above and that the present invention can be implemented in other specific forms without departing from the spirit or essential characteristics of the present invention. Therefore, the embodiments should be considered in all respects as illustrative and non-restrictive. The scope of the present invention is defined by the appended claims, not the foregoing description, and all variations that come within the meaning and range of equivalents of the claims are intended to be included within the present invention.
Claims
1. A lightning arrester temperature compensation method based on DSA-CTCM network, characterized in that: include: S1: Obtain historical environmental data of the arrester; The environmental data includes temperature data of the arrester and climate data of the environment in which the arrester is located; S2: preprocess the historical environmental data of the arrester; S3: Based on the dual-stage self-attention combined with the temporal convolutional network of MambaNet, a temperature compensation model is constructed and trained using historical environmental data after data preprocessing; S4: acquiring real-time environmental data of the arrester, inputting the real-time environmental data into a temperature compensation model to acquire predicted temperature data, and calculating a temperature deviation value between the real-time temperature data and the predicted temperature data; S5: establishing a dynamic feedback mechanism to dynamically generate a compensation coefficient of the temperature compensation model according to the temperature deviation value, feeding the compensation coefficient back to the temperature compensation model to adjust the temperature compensation model parameters, and performing a performance evaluation on the temperature compensation model; The S3 includes the following specific steps: S301: Establishing an environmental data set based on the historical environmental data after data preprocessing; the environmental data set includes a training set and a test set; S302: Constructing a lightning arrester temperature compensation model based on a dual-stage self-attention combined with MambaNet temporal convolutional network; The temperature compensation model includes an encoder, a Mamba module and a decoder; S303: Input the data in the training set into the encoder, extract the feature sequence of the input data based on the encoder, calculate the importance weight of the feature sequence to generate a weighted hidden state, and encode the hidden state and send it to the Mamba module; S304: Based on the Mamba module, the encoder output is integrated, the dimensions are transformed, and key timing information is dynamically selected to enhance the time series modeling capability of the model, and a suitable feature sequence is generated and sent to the decoder; S305: The decoder decodes the hidden state using the classification information and adaptively selects the importance weight of the hidden state to generate a new hidden state, combines the new hidden state with the feature sequence output by the Mamba module, and calculates the predicted temperature data after temperature compensation. S306: Calculating a temperature difference between the historical temperature data and its corresponding predicted temperature data, and adjusting parameters of the temperature compensation model based on the temperature difference, and continuously iterating the training; S307: When the number of training iterations of the temperature compensation model reaches a preset number of test times, a performance test is performed on the temperature compensation model based on the test set; if the model performance is qualified, the training of the temperature compensation model is completed; if the model performance is unqualified, step S308 is executed; S308: Determine whether the number of iterations reaches a preset number of iterations. If so, complete the training of the temperature compensation model; otherwise, return to step S303.
2. The method according to claim 1, characterized in that The S2 includes the following specific steps: S201: Acquire historical environmental data of the arrester and synchronize the historical environmental data; The data synchronization is to add a timestamp to each historical environmental data record and align the historical environmental data at different times; S202: performing data cleaning on the historical environmental data; S203: Smoothing the historical environmental data based on a Kalman filter algorithm; S204: extracting the mean and standard deviation of the historical environmental data, and performing normalization processing on the historical environmental data; S205: Perform Z-Score standardization processing on the historical environmental data.
3. The method according to claim 2, characterized in that The Kalman filter algorithm in S203 includes a prediction process and an update process; The function expression of the prediction process is: ; ; Where, is the system state vector at time k, is the system state vector at time k-1; is the state transfer matrix; is the control matrix; is the control input; for The transposed matrix of and The state vectors are and The uncertainty covariance matrix of is the noise covariance matrix; The function expression of the update process is: ; ; ; Where, is the Kalman gain, is a column vector of prior estimates, for The transposed matrix of is the sensor noise covariance matrix; is the best estimate for this forecast update, is the system sensor observation value; is the optimal covariance matrix after the update of this prediction; The function expression of the normalization process in S204 is: ; Where x' is the normalized historical environmental data; x is the historical environmental data; min(x) is the minimum value of the historical environmental data, and max(x) is the maximum value of the historical environmental data; The function expression of the Z-Score standardization in S205 is: ; Where X is the standardized historical environmental data; μ is the mean of the historical environmental data; and σ is the standard deviation of the historical environmental data.
4. The method according to claim 1, wherein The S4 includes the following specific steps: S401: Acquire real-time environmental data of the arrester; S402: Inputting the real-time environmental data into the trained temperature compensation model to obtain predicted temperature data; The calculation formula for the predicted temperature data is: ; Where, To predict temperature data, For real-time climate data, is the historical temperature data; S403: Calculating the temperature deviation between the real-time temperature data and the predicted temperature data; The calculation formula of the temperature deviation value is: ; Where, is the real-time temperature data, and b is the temperature deviation value.
5. The method according to claim 1, characterized in that The S5 includes the following specific steps: S501: Establishing a dynamic feedback mechanism; the dynamic feedback mechanism includes a dynamic correction algorithm and a real-time feedback mechanism; S502: Based on a preset abnormal deviation threshold, determine whether the temperature deviation value is greater than the abnormal deviation threshold; if so, record the temperature deviation value and execute step S503; otherwise, output the predicted temperature data; S503: Based on the dynamic correction algorithm, dynamically generate the adjustment coefficient of the temperature compensation model according to the temperature deviation value; S504: generating a feedback signal according to the temperature deviation value and climate data; S505: Based on the real-time feedback mechanism, adjust the temperature compensation model parameters according to the adjustment coefficient and the feedback signal; S506: Generate a deviation data set based on the temperature deviation value recorded in step 502, and calculate the mean and variance of the deviation data set to evaluate the performance of the temperature compensation model to ensure continuous optimization and normal operation of the model.
6. The method according to claim 5, characterized in that The function expression of the dynamic correction algorithm in S503 is: ; Where, is the new compensation coefficient, is the old compensation coefficient, is the adjustment rate, b is the temperature deviation value; The function expression of the feedback signal is: ; Where, is the feedback signal, is the bias weight, is the change weight of climate data, is the change in climate data; The function expression of the real-time feedback mechanism is: ; Where, is the adjusted compensation coefficient, is the feedback adjustment coefficient; The mean and variance of the deviation data set are calculated as follows: ; ; Where, is the mean deviation, is the bias variance, is the i-th temperature deviation value in the deviation data set, and N is the number of samples in the deviation data set.
7. The method according to claim 1, characterized in that The encoder includes a convolutional neural network layer, an input multi-head self-attention layer, and a temporal convolutional network layer connected in sequence; The Mamba module includes a splicing layer, a flattening layer, a linear mapping layer, a selective state space model layer and a one-dimensional convolution layer connected in sequence; The decoder includes a temporal multi-head self-attention layer and a temporal convolutional network layer connected in sequence.
8. The method according to claim 2, characterized in that The process of performing data cleaning on the historical environment data in step S202 includes one or more of the following: Check the integrity and consistency of historical environmental data, remove noise, fill in missing data, and delete invalid data.
9. A lightning arrester temperature compensation system based on DSA-CTCM network, characterized in that: include: Data acquisition module, used to obtain historical environmental data of the lightning arrester; The environmental data includes temperature data of the arrester and climate data of the environment in which the arrester is located; A data preprocessing module is used to preprocess the historical environmental data of the arrester; The model building module is used to build and train a temperature compensation model based on the historical environmental data after data preprocessing, based on the dual-stage self-attention combined with the temporal convolutional network of MambaNet; a deviation calculation module for obtaining real-time environmental data of the arrester, inputting the real-time environmental data into a temperature compensation model to obtain predicted temperature data, and calculating a temperature deviation value between the real-time temperature data and the predicted temperature data; A dynamic correction module is used to establish a dynamic feedback mechanism, dynamically generate a compensation coefficient of the temperature compensation model according to the temperature deviation value, feed the compensation coefficient back to the temperature compensation model to adjust the temperature compensation model parameters, and perform performance evaluation on the temperature compensation model; The model building module is configured to perform the following steps: S301: Establishing an environmental data set based on the historical environmental data after data preprocessing; The environmental data set includes a training set and a test set; S302: Constructing a lightning arrester temperature compensation model based on a dual-stage self-attention combined with MambaNet temporal convolutional network; The temperature compensation model includes an encoder, a Mamba module and a decoder; S303: Input the data in the training set into the encoder, extract the feature sequence of the input data based on the encoder, calculate the importance weight of the feature sequence to generate a weighted hidden state, and encode the hidden state and send it to the Mamba module; S304: Based on the Mamba module, the encoder output is integrated, the dimensions are transformed, and key timing information is dynamically selected to enhance the time series modeling capability of the model, and a suitable feature sequence is generated and sent to the decoder; S305: The decoder decodes the hidden state using the classification information and adaptively selects the importance weight of the hidden state to generate a new hidden state, combines the new hidden state with the feature sequence output by the Mamba module, and calculates the predicted temperature data after temperature compensation. S306: Calculating a temperature difference between the historical temperature data and its corresponding predicted temperature data, and adjusting parameters of the temperature compensation model based on the temperature difference, and continuously iterating the training; S307: When the number of training iterations of the temperature compensation model reaches a preset number of test times, a performance test is performed on the temperature compensation model based on the test set; if the model performance is qualified, the training of the temperature compensation model is completed; if the model performance is unqualified, step S308 is executed; S308: Determine whether the number of iterations reaches a preset number of iterations. If so, complete the training of the temperature compensation model; otherwise, return to step S303.
Citation Information
Patent Citations
Sea surface temperature numerical prediction deviation correction method based on attention mechanism
CN114936620A
Improved LSTM combined attention mechanism distiller's yeast pit temperature prediction method
CN118585933A
Construction of transformer temperature field prediction model and temperature field prediction method and system
CN118606647A