Methods, systems, devices and storage media for nonlinear compensation of voltage sensing signals

By using a joint optimization method of Transformer and GRU network, the nonlinear compensation problem of traditional voltage sensors in multi-factor coupling and dynamic environments is solved, achieving more accurate voltage signal compensation and improving measurement accuracy and system stability.

CN120763469BActive Publication Date: 2026-01-06UNIV OF SCI & TECH OF CHINA +1
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202510867087.0
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2025-06-26
Publication Date
2026-01-06
Estimated Expiration
2045-06-26

AI Technical Summary

Technical Problem

Traditional nonlinear compensation methods for voltage sensors struggle to handle nonlinear compensation problems under multi-factor coupling conditions and are unable to capture dynamically changing nonlinear errors in real time, which affects measurement accuracy and system stability.

Method used

A joint optimization method using Transformer and GRU networks is adopted. By extracting and fusing voltage sensing signal data and combining it with environmental operating condition data, a nonlinearly compensated target voltage signal is generated. The Transformer is used to learn the coupling relationship of multiple operating conditions, and the GRU model captures the time-series information of the voltage sequence to achieve accurate compensation.

Benefits of technology

This improves the compensation accuracy and adaptability of the voltage sensor in dynamic environments, outputs a more accurate post-compensation voltage estimate, and enhances the system's stability and measurement accuracy.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120763469B_ABST
    Figure CN120763469B_ABST
Patent Text Reader

Abstract

The application provides a voltage sensing signal nonlinear compensation method, system, device and storage medium, relates to the field of signal compensation, and the voltage sensing signal nonlinear compensation method comprises the following steps: inputting second target data into a Transform model, performing feature extraction and fusion based on an encoder and a decoder of the Transform model, obtaining a hidden variable representing fusion information of environmental features and a voltage sequence; inputting the hidden variable into a GRU model, calculating time sequence information of the entire sequence of the hidden variable through a loop and transforming through a full connection layer to generate a target voltage sensing signal after nonlinear compensation. The application comprehensively utilizes the Transform model and the GRU model, considers three factors of temperature, driving frequency and aging amount that cause sensor errors, realizes nonlinear compensation of the voltage sensing signal in the case of multi-factor coupling, can accurately predict nonlinear errors of the voltage sensor, and thus outputs more accurate compensated voltage estimation, thereby guaranteeing the effect of nonlinear compensation.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of signal compensation technology, specifically to a method, system, device, and storage medium for nonlinear compensation of voltage sensing signals. Background Technology

[0002] Voltage sensors are increasingly used in smart grids, renewable energy systems, and high-precision measurements. However, sensor output is affected by various factors, leading to nonlinear errors that impact measurement accuracy and system stability. Therefore, data compensation is often necessary to improve the accuracy and reliability of voltage sensors.

[0003] In related technologies, traditional voltage sensor compensation methods are mainly based on physical modeling and numerical compensation techniques. For example, when compensating for voltage sensing signals, the accuracy of measuring voltage transformers can be improved by estimating the excitation current and iron loss current. For the nonlinear behavior of voltage transformers under non-sinusoidal conditions, harmonic distortion can be compensated using a simplified Volterra model; lookup tables, spline interpolation, and polynomial fitting methods can also be applied to sensor data compensation.

[0004] However, the aforementioned traditional methods often only model a single error factor, while in practical applications, sensor errors are often affected by multiple factors. Traditional methods struggle to model the effects of the coupling of multiple factors, resulting in less effective models. Furthermore, traditional methods typically require large amounts of calibration data and complex modeling processes, making them difficult to adapt to the dynamic changes and diverse needs of sensors in real-world applications. Summary of the Invention

[0005] To address the shortcomings of existing technologies, this application provides a method, system, device, and storage medium for nonlinear compensation of voltage sensing signals, which solves the problems of complex modeling process and low compensation accuracy in current voltage sensing signal compensation.

[0006] To achieve the above objectives, this application provides the following technical solution:

[0007] In a first aspect, embodiments of this application provide a method for nonlinear compensation of voltage sensing signals. This method includes: acquiring preprocessed first target data and second target data, wherein both the first target data and the second target data include preprocessed voltage sensing signal data and environmental condition data. The environmental condition data is used to compensate the voltage sensing signal data and includes environmental variables such as temperature, driving frequency, and aging amount of the voltage sensor; jointly optimizing a preset Transformer network framework and a preset GRU network framework based on the first target data to obtain a Transformer model and a GRU model; inputting the second target data into the Transformer model, performing feature extraction and fusion based on the encoder and decoder of the Transformer model to obtain latent variables representing the fusion information of environmental features and voltage sequence; inputting the latent variables into the GRU model, calculating the temporal information of the entire sequence of fused latent variables through iterative calculations, and transforming it through a fully connected layer to generate a nonlinearly compensated target voltage sensing signal.

[0008] According to a first aspect of the embodiments of this application, before acquiring the preprocessed first target data and second target data, the voltage sensing signal nonlinear compensation method further includes: acquiring first initial data and second initial data of the voltage sensor, wherein both the first initial data and the second initial data include initial voltage sensing signal data and environmental condition data; resampling the initial voltage sensing signal data and the initial environmental condition data to a uniform frequency using linear interpolation, smoothly filling the gaps between sampling points through linear interpolation, and preserving the trend and distribution of the data; normalizing all the resampled data using a max-min normalization method, so that the numerical range of data with different dimensions when input to the network is under control; introducing a square term of temperature to capture the secondary effect of temperature on voltage, introducing the gradient of temperature with time to capture the influence of temperature change on voltage, and introducing an interaction term of temperature and frequency to capture the coupling effect between the two, thereby obtaining the preprocessed first target data and second target data.

[0009] According to a first aspect of the embodiments of this application, the Transformer model includes an encoder and a decoder; second target data is input into the Transformer model, and feature extraction and fusion are performed based on the encoder and decoder of the Transformer model to obtain latent variables representing the fusion information of environmental features and voltage sequence, including: extracting features from the environmental condition data of the second target data through the encoder, transforming the potential patterns and interactions of environmental factors into high-dimensional features to explore the complex dependencies between environmental variables; and extracting features from the voltage sensing signal data of the second target data through the decoder and fusing them with the high-dimensional features to obtain latent variables representing the fusion information of environmental features and voltage sequence.

[0010] According to a first aspect of the embodiments of this application, the decoder's processing includes a self-attention stage and a cross-attention stage; the decoder extracts features from the voltage sensing signal data of the second target data and fuses them with high-dimensional features to obtain latent variables representing the fusion information of environmental features and voltage sequence, including: in the self-attention stage, the voltage sensing signal data is processed through the decoder's self-attention mechanism to capture the temporal dependencies within the sequence to provide a structured voltage representation for subsequent environmental feature fusion; in the cross-attention stage, the environmental features output by the encoder are dynamically fused into the voltage sequence through the decoder's cross-attention mechanism to obtain latent variables representing the fusion information of environmental features and voltage sequence.

[0011] According to a first aspect of the embodiments of this application, the encoder is composed of multiple identical first target layers stacked together. The first target layer includes two sub-layers: the first sub-layer is based on a multi-head self-attention mechanism, and the second sub-layer is based on a position-based feedforward network. Each sub-layer employs residual connections, and layer normalization is performed after the addition calculation of the residual connections. The decoder is composed of multiple identical second target layers stacked together, and residual connections and normalization are used in the second target layers. The decoder has three sub-layers, and the middle sub-layer is the encoder-decoder attention layer. The encoder-decoder attention layer adopts a cross-attention paradigm to query the output from the previous decoder layer, and the key and value come from the output of the entire encoder.

[0012] According to a first aspect of the embodiments of this application, the GRU model is a two-layer GRU structure with the number of hidden units equal to the output dimension of the Transformer; the latent variables are input into the GRU model, and the temporal information of the entire sequence of the latent variables is fused through iterative calculation and transformed through a fully connected layer to generate a nonlinearly compensated target voltage sensing signal, including: dynamically processing the sequence information of the latent variables for each frame through the update gate and reset gate of the GRU model; cyclically calculating the temporal information of the entire sequence of the fused latent variables to characterize the dynamic characteristics of the voltage sensing signal data in the time dimension, and obtaining the hidden state of the last frame; sending the hidden state of the last frame to the fully connected layer to perform a linear transformation on the hidden state through the fully connected layer to generate a compensated voltage estimate, thereby obtaining a target voltage sensing signal characterizing the fusion information of environmental features and voltage sequence.

[0013] According to a first aspect of the embodiments of this application, a preset Transformer network framework and a preset GRU network framework are jointly optimized based on a first target data to obtain a Transformer model and a GRU model, including: dividing the first target data into a training set and a test set; in the training phase, jointly training the preset Transformer network framework and the preset GRU network framework based on the training set; using the Adam optimizer, setting the initial learning rate to 0.001, setting the weight decay to 1e-5, and using the Huber loss function to determine the loss of the joint training process to improve the robustness of the model to outliers and nonlinear errors; where e is a natural constant; in the testing phase, evaluating the model based on the test set and using mean absolute error, root mean square error, and coefficient of determination to determine the Transformer model and GRU model that pass the evaluation.

[0014] According to a first aspect of the embodiments of this application, the aforementioned Huber loss function satisfies the expression:

[0015]

[0016] In the formula, Here, δ is the loss value, δ is an adjustable parameter, and x is the true value. These are the model estimates.

[0017] Secondly, embodiments of this application provide a voltage sensing signal nonlinearity compensation system, which includes a data acquisition module, a joint optimization module, an extraction and fusion module, and a signal generation module. Specifically, the data acquisition module is used to acquire preprocessed first target data and second target data, wherein both the first target data and the second target data include preprocessed voltage sensing signal data and environmental condition data. The environmental condition data is used to compensate the voltage sensing signal data and includes environmental variables including temperature, driving frequency, and aging amount of the voltage sensor. The joint optimization module is used to jointly optimize a preset Transformer network framework and a preset GRU network framework based on the first target data to obtain a Transformer model and a GRU model. The extraction and fusion module is used to input the second target data into the Transformer model, and perform feature extraction and fusion based on the encoder and decoder of the Transformer model to obtain latent variables representing the fusion information of environmental features and voltage sequence. The signal generation module is used to input the latent variables into the GRU model, calculate the temporal information of the entire sequence of fused latent variables through loops, and transform it through a fully connected layer to generate the nonlinearly compensated target voltage sensing signal.

[0018] Thirdly, embodiments of this application provide an electronic device, which includes: a processor, a memory, and a program stored in the memory and executable on the processor. When the program is executed by the processor, it implements the voltage sensing signal nonlinear compensation method described in the first aspect above.

[0019] Fourthly, embodiments of this application provide a computer-readable storage medium storing a program or instructions that, when executed by a processor, implement the voltage sensing signal nonlinear compensation method described in the first aspect above.

[0020] This application provides a method, system, device, and storage medium for nonlinear compensation of voltage sensing signals. Compared with the prior art, it has the following advantages:

[0021] This application corrects and compensates voltage sensing signal data based on environmental operating condition data corresponding to the voltage sensor. Based on the first batch of target data, a pre-set Transformer network framework and a pre-set GRU network framework are jointly optimized and trained. The Transformer fully learns the coupling relationship between multiple operating condition factors, including temperature, driving frequency, and aging. After obtaining the Transformer model and the GRU model, the second batch of target data to be compensated is sequentially input into the Transformer model and the GRU model. Through feature extraction and fusion learning, the fusion information representing environmental features and voltage sequence is obtained, and latent variables are obtained. The GRU model iteratively calculates the time-series information corresponding to the fused latent variable sequence, thereby capturing the short-term changing trend of the voltage sequence and improving the model's adaptability to dynamic environments. The GRU model can accurately predict the nonlinear error of the voltage sensor, thus outputting a more accurate compensated voltage estimate and ensuring the effectiveness of nonlinear compensation. Attached Figure Description

[0022] To more clearly illustrate the technical solutions in the embodiments of the present invention or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.

[0023] Figure 1 This is a flowchart illustrating a nonlinear compensation method for voltage sensing signals provided in an embodiment of this application.

[0024] Figure 2 This is a simplified flowchart of a voltage sensing signal nonlinearity compensation method provided in an embodiment of this application.

[0025] Figure 3This is a schematic diagram of the structure of a voltage sensing signal nonlinear compensation system provided in an embodiment of this application;

[0026] Figure 4 This is a schematic diagram of the structure of an electronic device provided in an embodiment of this application. Detailed Implementation

[0027] To make the objectives, technical solutions, and advantages of the embodiments of the present invention clearer, the technical solutions in the embodiments of the present invention are described clearly and completely. Obviously, the described embodiments are only some embodiments of the present invention, not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.

[0028] It should be noted that, in this document, relational terms such as "first" and "second" are used merely to distinguish one entity or operation from another, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Furthermore, the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such a process, method, article, or apparatus. Without further limitations, an element defined by the phrase "comprising one..." does not exclude the presence of other identical elements in the process, method, article, or apparatus that includes the element.

[0029] This application provides a method, system, device, and storage medium for nonlinear compensation of voltage sensing signals, which solves the problems of complex modeling process and low compensation accuracy in current voltage sensing signal compensation.

[0030] The technical solution in this application is to solve the above-mentioned technical problems, and the general idea is as follows:

[0031] In recent years, voltage sensors have been increasingly widely used in smart grids, renewable energy systems, and high-precision measurements. However, sensor output is affected by various factors, leading to nonlinear errors that impact measurement accuracy and system stability. To address this, researchers have proposed various compensation methods to improve the accuracy and reliability of voltage sensors.

[0032] In related technologies, traditional nonlinear compensation methods for voltage sensors are mainly based on physical modeling and numerical compensation techniques. For example, when compensating for voltage sensing signals, the accuracy of measuring voltage transformers can be improved by estimating the excitation current and iron loss current. For the nonlinear behavior of voltage transformers under nonsinusoidal conditions, harmonic distortion can be compensated using a simplified Volterra model; lookup tables, spline interpolation, and polynomial fitting methods can also be applied to sensor data compensation.

[0033] However, the existing technologies have the following main drawbacks: (1) Traditional nonlinear compensation methods are difficult to handle nonlinear compensation problems under multi-factor coupling conditions, and often can only consider a single factor, which makes the results of nonlinear compensation need to be improved. (2) Traditional nonlinear compensation methods are difficult to capture dynamically changing nonlinear errors in real time. (3) Traditional nonlinear compensation methods usually require a large amount of calibration data and a complex modeling process, which is difficult to adapt to the dynamic changes and diverse needs of sensors in practical applications.

[0034] In recent years, deep learning methods have demonstrated significant advantages in various nonlinear compensation tasks. The Transformer architecture, as a deep learning model based on a self-attention mechanism, possesses powerful feature extraction and modeling capabilities, and has achieved remarkable results in fields such as natural language processing and computer vision, showcasing its strong ability to handle complex nonlinear problems. For example, applying Transformer to nonlinear channel compensation in optical communication systems, by introducing physical information masks, can significantly improve the performance of long-distance transmission systems. In power systems, robust voltage control in distribution networks can be achieved by using recursive least squares to estimate sensitivity coefficients online. These studies demonstrate that the Transformer architecture has significant advantages in handling complex nonlinear relationships and high-dimensional data, and has broad application prospects.

[0035] To better understand the above technical solutions, the following will provide a detailed explanation of the technical solutions in conjunction with the accompanying drawings and specific implementation methods.

[0036] The following section first introduces a nonlinear compensation method for voltage sensing signals provided in the embodiments of this application.

[0037] This application provides a flowchart illustrating a nonlinear compensation method for voltage sensing signals, which you can refer to in this embodiment. Figure 1 and Figure 2 The nonlinear compensation method for the voltage sensing signal may include the following steps S110-S140.

[0038] S110. Obtain the preprocessed first target data and second target data, wherein the first target data and the second target data both include the preprocessed voltage sensing signal data and environmental condition data. The environmental condition data is used to compensate the voltage sensing signal data and includes environmental variables including the temperature, driving frequency and aging amount of the voltage sensor.

[0039] S120. Based on the first target data, jointly optimize the preset Transformer network framework and the preset GRU network framework to obtain the Transformer model and the GRU model.

[0040] S130. Input the second target data into the Transformer model, and perform feature extraction and fusion based on the encoder and decoder of the Transformer model to obtain latent variables that represent the fusion information of environmental features and voltage sequence.

[0041] S140. Input the latent variables into the GRU model, perform time-series information of the entire sequence of latent variables through iterative calculation, and transform them through a fully connected layer to generate the nonlinearly compensated target voltage sensing signal.

[0042] The above is a specific implementation of a voltage sensing signal nonlinear compensation method provided in this application. It can be understood that this application corrects and compensates the voltage sensing signal data based on the environmental operating condition data corresponding to the voltage sensor, and performs joint optimization training on the preset Transformer network framework and the preset GRU network framework based on the first batch of first target data. The Transformer is used to fully learn the coupling relationship between multiple operating condition factors, including temperature, driving frequency and aging amount.

[0043] Furthermore, after obtaining the Transformer model and the GRU model, this application sequentially inputs the second batch of second target data to be compensated into the Transformer model and the GRU model to perform formal nonlinear compensation processing on the second target data; by feature extraction and fusion learning to represent the fusion information of environmental features and voltage sequence, latent variables are obtained, and the time series information corresponding to the fused latent variable sequence is calculated iteratively through the GRU model, thereby capturing the short-term changing trend of the voltage sequence, improving the model's adaptability to the dynamic environment, and the GRU model can accurately predict the nonlinear error of the voltage sensor, thereby outputting a more accurate voltage estimate after compensation, ensuring the effect of nonlinear compensation.

[0044] In some embodiments, before acquiring the preprocessed first target data and second target data, i.e. before the aforementioned S110, the voltage sensing signal nonlinearity compensation method further includes:

[0045] S101. Acquire the first initial data and the second initial data of the voltage sensor, wherein both the first initial data and the second initial data include initial voltage sensing signal data and environmental condition data.

[0046] S102. The initial voltage sensing signal data and the initial environmental condition data are resampled to a uniform frequency using linear interpolation. The gaps between sampling points are smoothly filled by linear interpolation, preserving the trend and distribution of the data.

[0047] S103. Use the maximum-minimum normalization method to normalize all the resampled data so that the numerical range of data with different dimensions when input into the network is under control.

[0048] S104. Introduce a square term for temperature to capture the secondary effect of temperature on voltage, introduce the gradient of temperature with respect to time to capture the effect of temperature change on voltage, and introduce an interaction term between temperature and frequency to capture the coupling effect between the two, thus obtaining the preprocessed first target data and second target data.

[0049] In the embodiments of this application, it can be understood that the first initial data corresponds to the model training stage, and the second initial data corresponds to the model application stage; the first initial data needs to be preprocessed when participating in model training, and the second initial data also needs to be preprocessed before analysis based on the model. In this application, the data preprocessing work mainly includes three aspects: resampling, normalization, and feature engineering.

[0050] Specifically, since the sampling rates of voltage and environmental condition data obtained in practice are usually inconsistent, this scheme uses linear interpolation to resample all data to a uniform frequency. Linear interpolation can smoothly fill the gaps between sampling points and preserve the trend and distribution of the data. In addition, since the dimensions and numerical ranges of different data vary significantly, it can lead to bias on features with larger values ​​during model training, affecting the learning effect. Therefore, this application uses the min-max normalization method to normalize the data to ensure that the numerical range of data with different dimensions is relatively controllable when input into the network.

[0051] It should be noted that, Figure 2 Feature engineering in electronics is the process of transforming raw data into features that better express the essence of the problem. Since the nonlinear error of voltage sensors is often closely related to the nonlinear combination of environmental factors—for example, an increase in temperature may cause a quadratic increase in voltage error, and the interaction between temperature and frequency may further amplify the error—relying solely on raw features may be insufficient to capture these complex relationships. Therefore, this application introduces a squared term for temperature to capture the quadratic effect of temperature on voltage, introduces a temperature gradient over time to capture the influence of temperature variation on voltage, and introduces an interaction term between temperature and frequency to capture the coupling effect between the two.

[0052] In some embodiments, the aforementioned joint optimization of the preset Transformer network framework and the preset GRU network framework based on the first target data yields the Transformer model and the GRU model. Specifically, the aforementioned S120 may include the following steps:

[0053] S210. Divide the first target data into a training set and a test set;

[0054] S220. During the training phase, the preset Transformer network framework and the preset GRU network framework are jointly trained based on the training set.

[0055] S230. The Adam optimizer is used, with an initial learning rate of 0.001 and a weight decay of 1e-5. The Huber loss function is used to determine the loss during joint training to improve the model's robustness to outliers and nonlinear errors; where e is a natural constant.

[0056] S240. During the testing phase, the mean absolute error, root mean square error, and coefficient of determination are used to evaluate the model based on the test set and model evaluation to determine the Transformer model and GRU model that pass the evaluation.

[0057] The Huber loss function satisfies the following expression:

[0058]

[0059] In the formula, Here, δ is the loss value, δ is an adjustable parameter, and x is the true value. These are the model estimates.

[0060] In the embodiments of this application, it is understood that because mean squared error is sensitive to outliers and mean absolute error is insufficient in penalizing large errors, the model may lack robustness. To improve the robustness of the model to outliers and nonlinear errors, this application employs the Huber loss function. The initial value of δ can be set to 1. Furthermore, to accelerate convergence and improve training efficiency, this application employs the Adam optimizer, with an initial learning rate of 0.001 and weight decay set to 1e-5.

[0061] In some embodiments, the Transformer model includes an encoder and a decoder;

[0062] The aforementioned input of the second target data into the Transformer model, and feature extraction and fusion based on the encoder and decoder of the Transformer model, yields latent variables representing the fusion information of environmental features and voltage sequence. Specifically, the aforementioned S130 may include the following steps:

[0063] S310. The encoder extracts features from the environmental condition data of the second target data, transforming the potential patterns and interactions of environmental factors into high-dimensional features to explore the complex dependencies between environmental variables.

[0064] S320. The voltage sensing signal data of the second target data is extracted by the decoder and fused with high-dimensional features to obtain latent variables that represent the fusion information of environmental features and voltage sequence.

[0065] In some embodiments, the decoder's processing includes a self-attention stage and a cross-attention stage. The aforementioned feature extraction of the voltage sensing signal data of the second target data by the decoder and fusion with high-dimensional features yields latent variables characterizing the fusion information of environmental features and voltage sequence. Specifically, S320 may include the following steps:

[0066] S410. In the self-attention stage, the voltage sensing signal data is processed through the self-attention mechanism of the decoder to capture the temporal dependencies within the sequence in order to provide a structured voltage representation for subsequent environmental feature fusion.

[0067] S420. In the cross-attention stage, the environmental features output by the encoder are dynamically fused into the voltage sequence through the cross-attention mechanism of the decoder, so as to obtain the latent variables that represent the fusion information of environmental features and voltage sequence.

[0068] In some embodiments, the encoder is composed of multiple identical first target layers stacked together. The first target layer includes two sub-layers: the first sub-layer is based on a multi-head self-attention mechanism, and the second sub-layer is based on a position-based feedforward network. Each sub-layer employs residual connections, and layer normalization is performed after the addition calculation of the residual connections.

[0069] The decoder is composed of multiple identical second target layers stacked together, and residual connections and normalization are used in the second target layers;

[0070] The decoder has three sub-layers, with the middle sub-layer being the encoder-decoder attention layer. The encoder-decoder attention layer uses a cross-attention paradigm to query the output from the previous decoder layer, and the key and value come from the output of the entire encoder.

[0071] In the embodiments of this application, it is understood that the Transformer model is the core of this solution. The Transformer model is designed to capture the complex nonlinear relationship between voltage sensing signal data and environmental condition data. The encoder is used to extract features of voltage sensor temperature, drive frequency, and aging amount from the environmental condition data. It can transform the potential patterns and interactions of environmental factors into high-dimensional feature representations, effectively mining the complex dependencies between environmental factors.

[0072] In addition, the decoder is used to extract features from the voltage sensing signal data and fuse them with the features extracted by the encoder. The overall process can be divided into two stages: self-attention and cross-attention. The decoder first uses a self-attention mechanism to process the voltage sensing signal data, aiming to capture the temporal dependencies within the sequence. This process provides a structured voltage representation for subsequent environmental feature fusion. The decoder then dynamically fuses the environmental features output by the encoder into the voltage sequence through a cross-attention mechanism. Specifically, the encoder's environmental features serve as keys and values, while the voltage sequence serves as a query, achieving deep fusion through attention weights. This mechanism can adaptively adjust the representation of the voltage data according to changes in environmental conditions, thereby accurately reflecting the impact of nonlinear errors.

[0073] It should also be noted that the classic Transformer network used in this application can be replaced with other improved versions of Transformer, such as Non-stationary Transformers suitable for non-stationary time series.

[0074] In some embodiments, the GRU model is a two-layer GRU structure and the number of hidden units is equal to the output dimension of the Transformer.

[0075] The aforementioned process of inputting latent variables into the GRU model, fusing the temporal information of the entire sequence of latent variables through iterative calculations, and transforming it through a fully connected layer to generate a nonlinearly compensated target voltage sensing signal, specifically S140 may include the following steps:

[0076] S510. The sequence information of latent variables in each frame is dynamically processed through the update gate and reset gate of the GRU model.

[0077] S520. By iteratively calculating and fusing the temporal information of the entire sequence of latent variables, the dynamic characteristics of the voltage sensing signal data in the time dimension are characterized, and the hidden state of the last frame is obtained.

[0078] S530. The hidden state of the last frame is sent to the fully connected layer so that the hidden state can be linearly transformed by the fully connected layer to generate a compensated voltage estimate, thereby obtaining the target voltage sensing signal that represents the fusion information of environmental features and voltage sequence.

[0079] In this embodiment, it is understood that while Transformer excels at capturing long-range dependencies through its self-attention mechanism, it has limited ability to model short-term temporal dynamics. GRU, as a gated recurrent neural network, effectively captures short-term memory effects and temporal dependencies using update and reset gates. This application selects a two-layer GRU structure. The input to the module is the output sequence of each frame of the Transformer model, and the number of hidden units is equal to the Transformer output dimension. The GRU model dynamically processes the input sequence through update and reset gates, and the final output is the hidden state of the last frame. This hidden state, through iterative calculation, integrates the temporal information of the entire sequence, representing the dynamic characteristics of the voltage sensing signal data in the time dimension; and finally, a fully connected layer linearly transforms the hidden state to generate a compensated voltage estimate. Furthermore, the GRU used in this scheme can also be replaced with other neural networks, such as LSTM.

[0080] In some embodiments, this application provides a voltage sensing signal nonlinearity compensation system 600, such as... Figure 3 As shown, the voltage sensing signal nonlinear compensation system 600 may include the following modules:

[0081] The data acquisition module 610 is used to acquire preprocessed first target data and second target data. The first target data and second target data both include preprocessed voltage sensing signal data and environmental condition data. The environmental condition data is used to compensate the voltage sensing signal data and includes environmental variables including the temperature, driving frequency and aging amount of the voltage sensor.

[0082] The joint optimization module 620 is used to jointly optimize the preset Transformer network framework and the preset GRU network framework based on the first target data to obtain the Transformer model and the GRU model.

[0083] The extraction and fusion module 630 is used to input the second target data into the Transformer model, and perform feature extraction and fusion based on the encoder and decoder of the Transformer model to obtain latent variables that characterize the fusion information of environmental features and voltage sequence.

[0084] The signal generation module 640 is used to input the latent variables into the GRU model, perform time-series information of the entire sequence of latent variables through iterative calculation, and transform them through a fully connected layer to generate the nonlinearly compensated target voltage sensing signal.

[0085] According to embodiments of this application, any multiple modules among the data acquisition module 610, joint optimization module 620, extraction and fusion module 630, and signal generation module 640 can be combined into one module, or any one of these modules can be split into multiple modules. Alternatively, at least some of the functions of one or more of these modules can be combined with at least some of the functions of other modules and implemented in one module.

[0086] Figure 3 Each module in the system shown has the function of implementing each step in the aforementioned nonlinear compensation method for voltage sensing signals, and can achieve the corresponding technical effect. For the sake of brevity, it will not be elaborated here.

[0087] In some embodiments, this application provides an electronic device, the structural schematic of which is shown below. Figure 4 As shown.

[0088] The electronic device may include a processor 710 and a memory 720 storing computer program instructions.

[0089] Specifically, the processor 710 may include a central processing unit (CPU), an application-specific integrated circuit (ASIC), or one or more integrated circuits that can be configured to implement the embodiments of this application.

[0090] Memory 720 may include mass storage for data or instructions. For example, and not limitingly, memory 720 may include a hard disk drive (HDD), floppy disk drive, flash memory, optical disk, magneto-optical disk, magnetic tape, or Universal Serial Bus (USB) drive, or a combination of two or more of these. Where appropriate, memory 720 may include removable or non-removable (or fixed) media. Where appropriate, memory 720 may be internal or external to the integrated gateway disaster recovery device. In a particular embodiment, memory 720 is non-volatile solid-state memory.

[0091] Memory 720 may include read-only memory (ROM), random access memory (RAM), disk storage media device, optical storage media device, flash memory device, electrical, optical, or other physical / tangible memory storage device. Therefore, typically, memory 720 includes one or more tangible (non-transitory) computer-readable storage media (e.g., memory devices) encoded with software including computer-executable instructions, and when the software is executed (e.g., by one or more processors), it can perform the operations described in any of the voltage sensing signal nonlinearity compensation methods in the above embodiments.

[0092] The processor 710 reads and executes computer program instructions stored in the memory 720 to implement any of the voltage sensing signal nonlinear compensation methods in the above embodiments.

[0093] In one example, the electronic device may also include a communication interface 730 and a bus 700. For example, Figure 4 As shown, the processor 710, memory 720, and communication interface 730 are connected via bus 700 and communicate with each other.

[0094] The communication interface 730 is mainly used to realize communication between various modules, devices, units and / or equipment in the embodiments of this application.

[0095] Bus 700 includes hardware, software, or both, that couples components of an online data traffic metering device together. For example, and not limitingly, the bus may include an Accelerated Graphics Port (AGP) or other graphics bus, an Enhanced Industry Standard Architecture (EISA) bus, a Front Side Bus (FSB), HyperTransport (HT) interconnect, an Industry Standard Architecture (ISA) bus, an Infinite Bandwidth Interconnect, a Low Pin Count (LPC) bus, a memory bus, a Microchannel Architecture (MCA) bus, a Peripheral Component Interconnect (PCI) bus, a PCI-Express (PCI-X) bus, a Serial Advanced Technology Attachment (SATA) bus, a Video Electronics Standards Association Local (VLB) bus, or other suitable buses, or combinations of two or more of these. Where appropriate, bus 700 may include one or more buses. Although specific buses are described and illustrated in embodiments of this application, any suitable bus or interconnect is contemplated herein.

[0096] Furthermore, in conjunction with the voltage sensing signal nonlinearity compensation method in the above embodiments, this application embodiment can provide a computer storage medium for implementation. The computer storage medium stores computer program instructions; when these computer program instructions are executed by a processor, they implement any of the voltage sensing signal nonlinearity compensation methods in the above embodiments.

[0097] It should be clarified that this application is not limited to the specific configurations and processes described above and shown in the figures. For the sake of brevity, detailed descriptions of known methods are omitted here. In the above embodiments, several specific steps are described and shown as examples. However, the method process of this application is not limited to the specific steps described and shown. Those skilled in the art can make various changes, modifications, and additions, or change the order of steps, after understanding the spirit of this application.

[0098] The functional blocks shown in the above block diagram can be implemented as hardware, software, firmware, or a combination thereof. When implemented in hardware, they can be, for example, electronic circuits, application-specific integrated circuits (ASICs), appropriate firmware, plug-ins, function cards, etc. When implemented in software, the elements of this application are programs or code segments used to perform the required tasks. Programs or code segments can be stored on a machine-readable medium or transmitted over a transmission medium or communication link via data signals carried on a carrier wave. "Machine-readable medium" can include any medium capable of storing or transmitting information. Examples of machine-readable media include electronic circuits, semiconductor memory devices, ROM, flash memory, erasable ROM (EROM), floppy disks, CD-ROMs, optical disks, hard disks, fiber optic media, radio frequency (RF) links, etc. Code segments can be downloaded via computer networks such as the Internet, intranets, etc.

[0099] It should also be noted that the exemplary embodiments mentioned in this application describe methods or systems based on a series of steps or apparatus. However, this application is not limited to the order of the above steps; that is, the steps can be performed in the order mentioned in the embodiments, or in a different order, or several steps can be performed simultaneously.

[0100] The aspects of this disclosure have been described above with reference to flowchart illustrations and / or block diagrams of methods, apparatus (systems), and computer program products according to embodiments of this disclosure. It should be understood that each block in the flowchart illustrations and / or block diagrams, and combinations of blocks in the flowchart illustrations and / or block diagrams, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, or other programmable data processing apparatus to produce a machine such that these instructions, executable via the processor of the computer or other programmable data processing apparatus, enable the implementation of the functions / actions specified in one or more blocks of the flowchart illustrations and / or block diagrams. Such a processor can be, but is not limited to, a general-purpose processor, a special-purpose processor, a special application processor, or a field-programmable logic circuit. It is also understood that each block in the block diagrams and / or flowcharts, and combinations of blocks in the block diagrams and / or flowcharts, can also be implemented by special-purpose hardware performing the specified functions or actions, or can be implemented by a combination of special-purpose hardware and computer instructions.

[0101] In summary, compared with the prior art, this application has the following beneficial effects:

[0102] 1. This application utilizes Transformer to fully learn the coupling relationship between multiple operating conditions, including temperature, driving frequency, and aging amount; at the same time, it considers the three factors that cause sensor error, namely temperature, driving frequency, and aging amount, and realizes nonlinear compensation of voltage sensing signal under multi-factor coupling conditions.

[0103] 2. The nonlinear error of a voltage sensor may change rapidly over time, especially when environmental conditions (such as temperature and frequency) fluctuate. This application uses feature extraction and fusion learning to represent the fused information of environmental features and voltage sequences, obtains latent variables, and uses a GRU model to iteratively calculate the time-series information corresponding to the fused latent variable sequence, thereby capturing the short-term changing trend of the voltage sequence and improving the model's adaptability to dynamic environments. The GRU model can accurately predict the nonlinear error of the voltage sensor, thus outputting a more accurate voltage estimate after compensation and ensuring the effectiveness of nonlinear compensation.

[0104] 3. This application corrects and compensates the voltage sensing signal data based on the environmental operating condition data corresponding to the voltage sensor. Based on the first batch of first target data, the preset Transformer network framework and the preset GRU network framework are jointly optimized and trained. The model used in this application is relatively simple and has strong universality. It can be used for different tasks and can also be transferred to different scenarios.

[0105] The above embodiments are only used to illustrate the technical solutions of the present invention, and are not intended to limit it. Although the present invention has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that modifications can still be made to the technical solutions described in the foregoing embodiments, or equivalent substitutions can be made to some of the technical features. Such modifications or substitutions do not cause the essence of the corresponding technical solutions to deviate from the spirit and scope of the technical solutions of the embodiments of the present invention.

Claims

1. A method of non-linearity compensation of a voltage sensing signal, characterized in that, The method comprises the following steps: obtaining preprocessed first target data and second target data, wherein the first target data and the second target data both comprise preprocessed voltage sensing signal data and environmental condition data, and the environmental condition data is used for compensating the voltage sensing signal data and comprises environmental variables such as temperature, driving frequency and aging amount of the voltage sensor; jointly optimizing a preset Transformer network framework and a preset GRU network framework based on the first target data to obtain a Transformer model and a GRU model; inputting the second target data into the Transformer model, performing feature extraction and fusion based on the encoder and the decoder of the Transformer model to obtain hidden variables representing fusion information of environmental features and voltage sequences; inputting the hidden variables into the GRU model, fusing time sequence information of the entire sequence of the hidden variables through recurrent calculation, and transforming through a fully connected layer to generate a target voltage sensing signal after nonlinear compensation; the Transformer model comprises an encoder and a decoder; the step of inputting the second target data into the Transformer model, performing feature extraction and fusion based on the encoder and the decoder of the Transformer model to obtain hidden variables representing fusion information of environmental features and voltage sequences comprises: performing feature extraction on the environmental condition data of the second target data through the encoder to convert the potential mode and interaction of environmental factors into high-dimensional features, so as to mine the complex dependency between environmental variables; performing feature extraction on the voltage sensing signal data of the second target data through the decoder and fusing the high-dimensional features to obtain hidden variables representing fusion information of environmental features and voltage sequences; the GRU model is a double-layer GRU structure and the number of hidden units is the output dimension of the Transformer; the step of inputting the hidden variables into the GRU model, fusing time sequence information of the entire sequence of the hidden variables through recurrent calculation, and transforming through a fully connected layer to generate a target voltage sensing signal after nonlinear compensation comprises: dynamically processing the sequence information of each frame of the hidden variables through the update gate and the reset gate of the GRU model; fusing time sequence information of the entire sequence of the hidden variables through recurrent calculation to represent the dynamic characteristics of the voltage sensing signal data in the time dimension and obtain the hidden state of the last frame; sending the hidden state of the last frame to a fully connected layer to perform linear transformation on the hidden state through the fully connected layer to generate a compensated voltage estimate and obtain a target voltage sensing signal representing fusion information of environmental features and voltage sequences.

2. The method of nonlinear compensation of a voltage sensing signal as recited in claim 1, wherein, Before the step of obtaining preprocessed first target data and second target data, the method further comprises: collecting first initial data and second initial data of the voltage sensor, wherein the first initial data and the second initial data both comprise initial voltage sensing signal data and environmental condition data; The initial voltage sensing signal data and initial environmental condition data are resampled to a uniform frequency by using a linear interpolation method, the gaps between the sampling points are smoothly filled by linear interpolation, and the trend and distribution of the data are retained; All resampled data are normalized by using a maximum-minimum normalization method, so that the numerical range of the data of different dimensions is controllable when inputting into the network; The square term of temperature is introduced to capture the quadratic effect of temperature on voltage, the gradient of temperature with respect to time is introduced to capture the influence of temperature variation law on voltage, and the interaction term of temperature and frequency is introduced to capture the coupling effect of the two, to obtain the first target data and the second target data after preprocessing.

3. The method of nonlinear compensation of a voltage sensing signal as recited in claim 1, wherein, The processing process of the decoder includes a self-attention stage and a cross-attention stage; The voltage sensing signal data of the second target data is extracted by the decoder and fused with the high-dimensional features to obtain hidden variables representing the fusion information of environmental features and voltage sequences, including: In the self-attention stage, the voltage sensing signal data is processed by the self-attention mechanism of the decoder to capture the time sequence dependence within the sequence to provide a structured voltage representation for subsequent environmental feature fusion; In the cross-attention stage, the environmental features output by the encoder are dynamically fused into the voltage sequence by the cross-attention mechanism of the decoder to obtain hidden variables representing the fusion information of environmental features and voltage sequences.

4. The method of nonlinear compensation of a voltage sense signal of claim 1, wherein, The encoder is stacked by a plurality of identical first target layers, and the first target layer includes two sub-layers, the first sub-layer is based on a multi-head self-attention mechanism, and the second sub-layer is based on a position-based feedforward network; each sub-layer uses a residual connection, and layer normalization is performed after the addition calculation of the residual connection; The decoder is stacked by a plurality of identical second target layers, and the second target layer uses residual connection and normalization; The decoder has three sub-layers, and the middle sub-layer is an encoder-decoder attention layer, which adopts the paradigm of cross-attention to query the output from the previous decoder layer, and the key and value come from the output of the entire encoder.

5. The method of nonlinear compensation of a voltage sensing signal of claim 1, wherein, The Transformer network framework and the GRU network framework are jointly optimized based on the first target data to obtain the Transformer model and the GRU model, including: The first target data is divided into a training set and a test set; In the training stage, the Transformer network framework and the GRU network framework are jointly trained based on the training set; An Adam optimizer is used, the initial learning rate is set to 0.001, the weight decay is set to 1e-5, the Huber loss function is used to determine the loss of the joint training process, and the robustness of the model to abnormal values and nonlinear errors is improved; wherein e is a natural constant; In the test stage, the test set and the model evaluation are used to evaluate the Transformer model and the GRU model by using the mean absolute error, the root mean square error, and the determination coefficient, to determine the Transformer model and the GRU model that pass the evaluation; The Huber loss function satisfies the expression: wherein is a loss value, is an adjustable parameter, is a true value, is a model estimate.

6. A system for compensating for non-linearity in a voltage sensing signal, the system comprising: The method comprises the following steps: The data acquisition module is configured to acquire preprocessed first target data and second target data, wherein the first target data and the second target data each comprise preprocessed voltage sensing signal data and environmental condition data, and the environmental condition data is used to compensate the voltage sensing signal data and comprises environmental variables such as temperature, driving frequency and aging amount of the voltage sensor; The joint optimization module is configured to jointly optimize a preset Transformer network framework and a preset GRU network framework based on the first target data, to obtain a Transformer model and a GRU model; The extraction and fusion module is configured to input the second target data into the Transformer model, perform feature extraction and fusion based on an encoder and a decoder of the Transformer model, and obtain hidden variables representing fusion information of environmental features and voltage sequences; The signal generation module is configured to input the hidden variables into the GRU model, fuse time sequence information of the entire sequence of the hidden variables through recurrent calculation, and generate a target voltage sensing signal after nonlinear compensation through a fully connected layer. The Transformer model comprises an encoder and a decoder. The inputting of the second target data into the Transformer model, the feature extraction based on the encoder and the decoder of the Transformer model, and the obtaining of the hidden variables representing fusion information of environmental features and voltage sequences comprise: The encoder is configured to perform feature extraction on environmental condition data of the second target data, convert potential modes and interaction relationships of environmental factors into high-dimensional features, and mine complex dependencies between environmental variables. The decoder is configured to perform feature extraction on voltage sensing signal data of the second target data and fuse the high-dimensional features, to obtain the hidden variables representing fusion information of environmental features and voltage sequences. The GRU model is a double-layer GRU structure and has a number of hidden units equal to the output dimension of the Transformer. The inputting of the hidden variables into the GRU model, the fusion of time sequence information of the entire sequence of the hidden variables through recurrent calculation, and the generation of a target voltage sensing signal after nonlinear compensation through a fully connected layer comprise: The update gate and the reset gate of the GRU model are configured to dynamically process sequence information of each frame of the hidden variables. The GRU model is configured to fuse time sequence information of the entire sequence of the hidden variables through recurrent calculation, to represent dynamic characteristics of voltage sensing signal data in the time dimension, and obtain a hidden state of the last frame. The hidden state of the last frame is sent to a fully connected layer, to perform linear transformation on the hidden state through the fully connected layer, generate a compensated voltage estimate, and obtain the target voltage sensing signal representing fusion information of environmental features and voltage sequences.

7. An electronic device, comprising: The method comprises the following steps: A processor, a memory, and a program stored on the memory and executable on the processor, the program, when executed by the processor, implements the voltage sensing signal non-linearity compensation method according to any one of claims 1 to 5.

8. A computer-readable storage medium, characterized in that, The computer readable storage medium stores a program or instructions, the program or instructions, when executed by the processor, implements the voltage sensing signal non-linearity compensation method according to any one of claims 1 to 5.

Citation Information

Patent Citations

  • Mine mining cost price prediction system and method based on deep learning

    CN116342202A

  • Transform and GRU fusion-based sensor error compensation method, system and device and medium

    CN116362140A