Sensor error self-calibration and state monitoring method based on domain adaptation feature alignment

By using a sensor error self-calibration method based on domain-adaptive feature alignment, the problems of identifying high-order nonlinear errors and irreversible damage in sensors are solved, achieving high-precision sensor calibration and fault detection.

CN122192399BActive Publication Date: 2026-08-04CHONGQING UNIV OF TECH
View PDF 1 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
CHONGQING UNIV OF TECH
Filing Date
2026-05-15
Publication Date
2026-08-04

AI Technical Summary

Technical Problem

Existing sensor calibration methods cannot effectively handle high-order nonlinear errors caused by complex spatial magnetic field distortions, resulting in limited absolute angular accuracy of sensor output and an inability to identify irreversibly damaged sensors.

Method used

A sensor error self-calibration method based on domain adaptation feature alignment is adopted. Through an unsupervised transfer learning model and a domain adaptation feature alignment algorithm, the source domain autoencoder and error compensation network are used to achieve accurate nonlinear compensation of high-order harmonic distortion. The sensor status is judged by the maximum mean difference and mean square error.

Benefits of technology

It achieves precise compensation for high-order harmonic distortion, significantly reducing the absolute angle error of the sensor to below 0.1°, and can identify irreversibly damaged sensors, preventing defective products from entering end applications.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122192399B_ABST
    Figure CN122192399B_ABST
Patent Text Reader

Abstract

The application relates to a sensor error self-calibration and state monitoring method based on domain adaptation feature alignment, and belongs to the field of sensor signal processing, and comprises the following steps: S1: obtaining source domain reference data, pre-training a source domain self-encoder, and freezing parameters; S2: obtaining target domain to-be-measured data of a to-be-measured sensor, and extracting target domain features; S3: inputting the target domain features into an error compensation network to obtain an initial error compensation sequence; S4: superimposing the target domain to-be-measured data and the initial error compensation sequence; S5: inputting the superimposed data into the source domain self-encoder, aligning feature distributions of the source domain and the target domain through a domain adaptation algorithm, constraining a predicted data distribution at an output end, and iteratively optimizing parameters of the error compensation network until convergence; and S6: counting a final error compensation sequence after convergence, and performing parameter calibration or outputting a fault alarm on the to-be-measured sensor according to a compensation value proportion exceeding a preset threshold in the final error compensation sequence.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention belongs to the field of sensor signal processing and intelligent calibration technology, and relates to a sensor error self-calibration and state monitoring method based on domain adaptation feature alignment. Background Technology

[0002] Sensors are widely used in industrial control and automotive electronics. Their output sine / cosine dual-channel signals typically exhibit a perfect Lissajous trajectory in the XY coordinate system. However, in practical engineering applications, limitations such as uneven coil winding, micro-manufacturing deviations in chips, and rotor misalignment often result in DC bias, amplitude differences, and phase non-orthogonality in the actual output signal. More seriously, when sensors work with specific mechanical structures (such as involute gears or worm gears), machining errors in the mechanical teeth can induce nonlinear air gap permeability fluctuations in the spatial magnetic field. This complex local physical distortion directly leads to a large number of high-order harmonics superimposed on the sensor's output signal. Existing industrial calibration methods often employ least squares ellipse fitting. This method can only handle first-order linear deviations and is completely ineffective against the high-order nonlinear errors caused by the complex spatial magnetic field distortions, severely limiting the absolute angular accuracy of the sensor's final output. Summary of the Invention

[0003] In view of this, the purpose of the present invention is to provide a sensor error self-calibration and state monitoring method based on domain adaptation feature alignment.

[0004] To achieve the above objectives, the present invention provides the following technical solution: A sensor error self-calibration and state monitoring method based on domain-adaptive feature alignment includes the following steps: S1: Obtain source domain baseline data, preprocess it, pre-train the source domain autoencoder, and freeze the network parameters of the source domain autoencoder after training is completed; S2: Acquire the target domain test data of the sensor under test, and after preprocessing, input it into the source domain autoencoder with frozen parameters to extract the target domain features; S3: Input the target domain features into the error compensation network to obtain the initial error compensation sequence; S4: Superimpose the preprocessed target domain test data with the initial error compensation sequence; S5: Input the superimposed data into the source domain autoencoder with frozen parameters, align the feature distributions of the source domain and the target domain through the domain adaptation algorithm, constrain the distribution of the predicted data at the output end, and jointly iteratively optimize the parameters of the error compensation network until convergence. S6: Statistically converged final error compensation sequence. Based on the proportion of compensation values ​​exceeding the preset threshold in the final error compensation sequence, perform parameter calibration or output fault alarm for the sensor under test.

[0005] Furthermore, the source domain autoencoder includes a source domain encoder and a source domain decoder; The source domain encoder includes a downsampling layer and a fully connected layer. After the preprocessed source domain reference data is stacked through multiple downsampling layers, the high-dimensional feature map will be flattened into a one-dimensional vector and mapped to the final latent space through the fully connected layer to obtain the source domain features. The source domain decoder includes an upsampling layer and a signal reconstruction output layer. After the source domain features are stacked through multiple upsampling layers, the final reconstructed prediction signal is output through the signal reconstruction output layer.

[0006] Furthermore, the downsampling layer in the source domain encoder includes a convolutional layer, an activation function layer, a normalization layer, and a pooling layer; wherein, the convolutional layer is used to extract local features of the input signal, the activation function layer is used to introduce nonlinear mapping capability, the normalization layer is used to accelerate model convergence and improve training stability, and the pooling layer is used to reduce feature dimensionality and enhance feature robustness. The convolutional layer uses one-dimensional convolution to extract features from the sensor's time-series signals, and its calculation process can be represented as follows: (1) in, This represents the convolution operation. and They represent the first The kernel parameters and bias terms of the layer It is the first The output feature map of the layer (i.e., the first layer) (input data of the layer) It is a linear feature map output after the convolution operation; (2) in, and These represent the batch mean and variance, respectively. and For learnable parameters, It is a tiny constant to prevent the denominator from being zero. It is the normalized feature map; The activation function layer uses the ReLU function, whose expression is: (3) in It is a feature map after nonlinear mapping; The pooling layer employs max pooling, and its operation is represented as follows: (4) in It is the size of the one-dimensional pooling window. It is the sliding step size of the pooling. This is the dimensionality reduction feature output by this layer. k represents the position index (which data point) on the output feature map after dimensionality reduction, and n represents the local offset index that slides within the current pooling window. After multiple layers of downsampling and stacking, the high-dimensional feature map will be flattened into a one-dimensional vector, and then mapped to the final latent space through a fully connected layer to obtain the source domain features. ,in express The dimension of the real-valued feature space (i.e., the dimension of the final latent space) is mathematically expressed as: (5) in It is a one-dimensional feature vector that has been flattened after multiple convolutional pooling operations. and These are the weight matrix and bias vector of the fully connected layer, respectively. It is the activation function of the fully connected layer. It is a hidden space dimension.

[0007] Furthermore, the upsampling layer in the source domain decoder includes a one-dimensional transposed convolutional layer, a batch normalization layer, and an activation layer; The one-dimensional transposed convolutional layer is used to upsample and amplify the low-dimensional compressed features in the temporal dimension, gradually restoring the original resolution of the sensor signal. Its mathematical expression is: (6) in This represents a one-dimensional transpose convolution operation; The signal reconstruction output layer outputs the final reconstructed prediction signal, which is based on the reconstructed source domain prediction data. Its expression is: (7) in It is the feature output of the last hidden layer of the decoder. and These are the weights and biases of the output layer; Mean squared error is used as the reconstruction loss function: (8) in It is the total number of samples in the current training batch. It is the first One source domain benchmark data sample; It is the first output of the source domain decoder reconstruction. One source domain prediction data sample; The gradient descent algorithm is used to perform end-to-end iterative optimization of the network.

[0008] Furthermore, in step S2, the target domain data to be tested is... The input is fed into the source domain encoder with frozen parameters to extract the target domain feature vector. .

[0009] Furthermore, the error compensation network is composed of a multilayer perceptron. For the first layer of the multilayer perceptron... There are hidden layers with error compensation sequences. Represented as: (9) in and The first The learnable weight matrix and bias vector of each hidden layer It is a non-linear activation function.

[0010] Furthermore, in step S4, the error compensation network outputs the final error compensation sequence. Compared with the original target domain test data By superimposing the data point by point, a compensation sample is obtained. .

[0011] Furthermore, in step S5, the compensation sample... The inputs are fed into the pre-trained encoder and decoder in the source domain to obtain the target domain features. and target domain prediction data ; The maximum mean difference is used as the distance metric: (10) in This represents the maximum mean difference loss function. and These represent the total number of samples in the current training batch and the number of samples in the target domain, respectively. Representing the infinite-dimensional regenerating kernel Hilbert space The mapping function in Represents the Gaussian kernel function; Indicates the first Each source domain feature sample Indicates the first One target domain feature sample; Calculate the compensated test data With target domain prediction data Mean square error between : (11) in Indicates the first A compensated target domain sample of test data. Indicates the first One target domain prediction data sample; Construct the total loss function for network training Through hyperparameters Dynamic equilibrium reconfiguration constraints and distribution convergence constraints: (12) The gradient descent algorithm is used to perform end-to-end iterative optimization of the network; when After convergence, the final error compensation sequence output by the error compensation network is extracted. .

[0012] Furthermore, in step S6, the final error compensation sequence is traversed. The statistics show that the absolute value of the deviation is greater than the preset maximum physical deviation threshold. The number of anomalies is then used to calculate the proportion of anomaly compensation points in the entire time series. ,like If the sensor is determined to have suffered irreversible and severe physical damage, compensation will be refused, and a sensor fault alarm signal will be output to the system-level control center; if This indicates that the signal offset of the sensor under test in the target domain is mainly caused by environmental interference, aging drift, or system errors, and is still within the range that the model can calibrate.

[0013] On the other hand, the present invention provides a sensor error self-calibration and state monitoring device based on domain-adaptive feature alignment, comprising: a signal acquisition module for acquiring orthogonal distortion signals; a data processing unit for running the sensor error self-calibration and state monitoring method based on domain-adaptive feature alignment as described above; and a non-volatile storage unit for storing electronic correction parameters.

[0014] The beneficial effects of this invention are as follows: Based on the comparative experiments described below, this invention: (1) Breaking through the bottleneck of high-order nonlinear error: By introducing an unsupervised transfer learning model and a domain-adaptive feature alignment algorithm, the network effectively narrows the feature distribution in the latent space, achieving accurate nonlinear compensation for high-order harmonic distortion. As can be seen from the comparison, the residual high-order harmonic distortion rate of the normal working condition samples (S01-S06) is significantly suppressed to within 0.2%, and the final absolute angle error is significantly converged to below 0.1°, achieving a leap in calibration accuracy by orders of magnitude.

[0015] (2) Achieving highly reliable intelligent waste interception: Before performing compensation, the system performs statistical judgment based on the final error compensation sequence output by the error compensation network. Faced with severely damaged samples (S07, S08), the system accurately identifies that the proportion of abnormal compensation points exceeding the maximum physical deviation threshold is too high, thus successfully rejecting the invalid calibration and outputting a fault alarm signal to the system-level control center, fundamentally preventing defective products from flowing into the end application.

[0016] Other advantages, objectives, and features of the invention will be set forth in part in the description which follows, and in part will be apparent to those skilled in the art from the following examination, or may be learned from practice of the invention. The objectives and other advantages of the invention can be realized and obtained through the following description. Attached Figure Description

[0017] To make the objectives, technical solutions, and advantages of the present invention clearer, the preferred embodiments of the present invention will be described in detail below with reference to the accompanying drawings, wherein: Figure 1 Flowchart of advanced sensor calibration and fault detection method; Figure 2 A system architecture diagram for implementing advanced calibration and testing methods. Detailed Implementation

[0018] The following specific examples illustrate the implementation of the present invention. Those skilled in the art can easily understand other advantages and effects of the present invention from the content disclosed in this specification. The present invention can also be implemented or applied through other different specific embodiments, and various details in this specification can be modified or changed based on different viewpoints and applications without departing from the spirit of the present invention. It should be noted that the illustrations provided in the following embodiments are only schematic representations of the basic concept of the present invention. Unless otherwise specified, the following embodiments and features can be combined with each other.

[0019] It should be noted that the illustrations provided in the following embodiments are only schematic representations of the basic concept of the present invention. Therefore, the drawings only show the components related to the present invention and are not drawn according to the actual number, shape and size of the components in the actual implementation. In the actual implementation, the form, quantity and proportion of each component can be arbitrarily changed, and the layout of the components may also be more complex.

[0020] In the following description, numerous details are explored to provide a more thorough explanation of embodiments of the invention. However, it will be apparent to those skilled in the art that embodiments of the invention may be practiced without these specific details. In other embodiments, well-known structures and devices are shown in block diagram form rather than in detail to avoid obscuring embodiments of the invention.

[0021] Example 1: like Figure 1 As shown, this invention provides a sensor error self-calibration and state monitoring method based on domain-adaptive feature alignment, comprising the following steps: S1: Obtain source domain baseline data, preprocess it, pre-train the source domain autoencoder, and freeze the network parameters of the source domain autoencoder after training is completed; S2: Acquire the target domain test data of the sensor under test, and after preprocessing, input it into the source domain autoencoder with frozen parameters to extract the target domain features; S3: Input the target domain features into the error compensation network to obtain the initial error compensation sequence; S4: Superimpose the preprocessed target domain test data with the initial error compensation sequence; S5: Input the superimposed data into the source domain autoencoder with frozen parameters, align the feature distributions of the source domain and the target domain through the domain adaptation algorithm, constrain the distribution of the predicted data at the output end, and jointly iteratively optimize the parameters of the error compensation network until convergence. S6: Statistically converged final error compensation sequence. Based on the proportion of compensation values ​​exceeding the preset threshold in the final error compensation sequence, perform parameter calibration or output fault alarm for the sensor under test.

[0022] In this embodiment, the source domain reference data is an ideal signal sequence derived from the analytical model of the air gap magnetic permeability of the target mechanical structure; the sensor under test includes a magnetoresistive sensor, a Hall position sensor, or an electromagnetic rotary transformer.

[0023] In this embodiment, the constructed source domain autoencoder includes a source domain encoder and a source domain decoder.

[0024] The source domain encoder consists of downsampling layers and fully connected layers. The downsampling layers include convolutional layers, activation function layers, normalization layers, and pooling layers. Among them, convolutional layers are used to extract local features of the input signal, activation function layers are used to introduce nonlinear mapping capabilities, normalization layers are used to accelerate model convergence and improve training stability, and pooling layers are used to reduce feature dimensionality and enhance feature robustness.

[0025] The convolutional layer uses one-dimensional convolution to extract features from the sensor's time-series signals. Its calculation process can be represented as follows: (1) in, This represents the convolution operation. and They represent the first The kernel parameters and bias terms of the layer It is the first The output feature map of the layer (i.e., the first layer) (input data of the layer) It is a linear feature map output after the convolution operation.

[0026] The normalization layer uses batch normalization, and its calculation process is as follows: (2) in, and These represent the batch mean and variance, respectively. and For learnable parameters, It is a tiny constant to prevent the denominator from being zero. It is the normalized feature map.

[0027] The activation function layer uses the ReLU function, whose expression is: (3) in It is a feature map after nonlinear mapping.

[0028] The pooling layer uses max pooling, and its operation can be represented as follows: (4) in It is the size of the one-dimensional pooling window. It is the sliding step size of the pooling. This is the dimensionality reduction feature output by this layer. k represents the position index (which data point) on the output feature map after dimensionality reduction, and n represents the local offset index that slides within the current pooling window. After multiple layers of downsampling and stacking, the high-dimensional feature map will be flattened into a one-dimensional vector, and then mapped to the final latent space through a fully connected layer to obtain the source domain features. ,in express The dimension of the real-valued feature space (i.e., the dimension of the final latent space) is mathematically expressed as: (5) in It is a one-dimensional feature vector that has been flattened after multiple convolutional pooling operations. and These are the weight matrix and bias vector of the fully connected layer, respectively. It is the activation function of the fully connected layer. It is a hidden space dimension.

[0029] The source domain decoder consists of an upsampling layer and a signal reconstruction output layer. The upsampling layer includes: a one-dimensional transposed convolutional layer, a batch normalization layer, and an activation layer.

[0030] A one-dimensional transposed convolutional layer is used to upsample and amplify low-dimensional compressed features in the temporal dimension, gradually restoring the original resolution of the sensor signal. Its mathematical expression is: (6) in This represents a one-dimensional transpose convolution operation.

[0031] After multiple upsampling layers are stacked, the signal reconstruction output layer is used to output the final reconstructed prediction signal. This is for the reconstructed source domain prediction data. Its expression is: (7) in It is the feature output of the last hidden layer of the decoder. and These are the weights and biases of the output layer.

[0032] To measure the difference between the predicted data output by the source domain decoder and the true benchmark data, this embodiment uses mean squared error as the reconstruction loss function: (8) in It is the total number of samples in the current training batch. It is the first One source domain baseline data sample, It is the first output of the source domain decoder reconstruction. One source domain prediction data sample.

[0033] After constructing the loss function, the gradient descent algorithm is used to perform end-to-end iterative optimization of the network.

[0034] The error compensation network consists of a multilayer perceptron. This network takes target domain features as input and, through nonlinear feature mapping of multiple fully connected layers, outputs an error compensation sequence with the same dimensionality as the original target domain test data, as detailed below: The target domain data to be tested The input is fed into the parameter-frozen source domain encoder to extract the target domain feature vector. .

[0035] For the first multilayer perceptron There are hidden layers with error compensation sequences. Represented as: (9) in and The first The learnable weight matrix and bias vector of each hidden layer It is a non-linear activation function, specifically the ReLU function.

[0036] The error compensation network outputs the final error compensation sequence. Compared with the original target domain test data By superimposing the data point by point, a compensation sample is obtained. .

[0037] Compensation sample The inputs are fed into the pre-trained encoder and decoder in the source domain to obtain the target domain features. and target domain prediction data .

[0038] To make the feature distribution of the compensated target domain data in the latent space approximate the feature distribution of the source domain, the maximum mean difference is used as the distance metric. (10) in This represents the maximum mean difference loss function. and These represent the total number of samples in the current training batch and the number of samples in the target domain, respectively. Representing the infinite-dimensional regenerating kernel Hilbert space The mapping function in Represents the Gaussian kernel function; Indicates the first Each source domain feature sample Indicates the first One target domain feature sample; Calculate the compensated test data With target domain prediction data Mean square error between : (11) in Indicates the first A compensated target domain sample of test data. Indicates the first One target domain prediction data sample; Construct the total loss function for network training Through hyperparameters Dynamic equilibrium reconfiguration constraints and distribution convergence constraints: (12) After constructing the loss function, the gradient descent algorithm is used to perform end-to-end iterative optimization of the network.

[0039] when After convergence, the final error compensation sequence output by the error compensation network is extracted. .

[0040] Based on the sensor's parameter manual, safety margin requirements, and historical operating experience, a maximum tolerable physical deviation threshold for the sensor signal is pre-set, denoted as . .

[0041] Traversing the final error compensation sequence Statistically, those with absolute values ​​greater than the threshold are counted. The number of anomalies is then used to calculate the proportion of anomaly compensation points in the entire time series. ,like If the sensor is determined to have suffered irreversible and severe physical damage, compensation will be refused, and a sensor fault alarm signal will be output to the system-level control center.

[0042] like This indicates that the signal offset of the sensor under test in the target domain is mainly caused by environmental interference, aging drift, or system errors, and is still within the range that the model can calibrate.

[0043] Combination Figure 2 As shown, the sensor error self-calibration and state monitoring system based on domain adaptation feature alignment described in this invention mainly comprises the following modules working together in its hardware structure: (1) Sensor module under test: used to sense the physical magnetic field or displacement alternation generated by external mechanical excitation sources (such as gears with machining tolerances or rotors with eccentric mounting) and convert the physical quantity into orthogonal analog signals. This module can be a TMR magnetoresistive sensor, Hall position sensor or electromagnetic rotary transformer, etc.

[0044] (2) Signal acquisition module: Electrically connected to the sensor module under test, it contains a front-end amplifier and an analog-to-digital converter (ADC). It is used to receive the above-mentioned orthogonal analog signals, discretize them, and convert them into digital distortion signals containing nonlinear errors (i.e., the target domain test data), and then transmit them to the data processing unit.

[0045] (3) Data Processing Unit: As the core computing power carrier of this system, it can be a digital signal processor (DSP), microcontroller (MCU), or field-programmable gate array (FPGA). The source domain autoencoder model with frozen parameters is stored in the memory of this unit, and error compensation and domain adaptation algorithms are run in real time. After receiving the digital distortion signal, it calculates the reconstruction features, performs distribution alignment and extracts the final error compensation sequence, and then performs fault diagnosis and threshold determination logic.

[0046] (4) Non-volatile storage unit (such as EEPROM or OTP register), connected to the data processing unit and the sensor module under test. When the data processing unit determines that the abnormal proportion of the error compensation sequence is less than a preset threshold, it will burn the final electronic correction parameters (such as bias, gain and higher harmonic compensation matrix) into this storage unit. The sensor will then directly call these parameters for real-time signal correction during normal operation.

[0047] (5) Alarm and communication interface: Provides standard industrial bus protocols such as SPI, CAN or I2C. On the one hand, when the data processing unit determines that the error exceeds the threshold (i.e. the sensor has suffered irreversible physical damage), it immediately outputs a fault warning signal to the host computer, automotive ECU or industrial PLC through this interface to achieve waste interception; on the other hand, when the sensor has completed calibration and is in normal condition, it is responsible for outputting high-precision absolute angle data to the external system.

[0048] Based on the above Figure 2 To further verify the effectiveness and advancement of the algorithm of this invention, six typical test samples, including TMR magnetoresistive sensors, rotary transformers, and Hall position sensors, were selected for comparative experiments. The experiments simulated complex industrial application conditions such as high-order magnetic permeability fluctuations caused by involute gears, rotor eccentricity, and physical damage to the sensors. Table 1 shows the calibration results using the traditional first-order least squares method for linear fitting.

[0049] Table 1

[0050] As shown in Table 1, when faced with spatial magnetic field distortion introduced by complex mechanical structures (such as gear tooth profile errors in samples S01-S02 and rotor eccentricity in samples S03-S04), traditional calibration methods, possessing only first-order linear correction capabilities, cannot eliminate higher harmonics (THD generally greater than 3.5%), resulting in limited final absolute angle errors (all greater than 1°). More seriously, for irreversibly damaged sensors (samples S07 and S8) with internal short circuits or severe magnet demagnetization, traditional methods lack the ability to differentiate and still force the output of incorrect correction parameters, leading to operation with defects and posing significant system safety hazards. Table 2 shows the results after processing with the high-order calibration and fault detection system described in this invention for the same batch of samples.

[0051] Table 2

[0052] Based on the data in Table 2 and the technical solution of this invention, it can be seen that this invention has achieved the following significant gains: (1) Breaking through the bottleneck of high-order nonlinear error: By introducing an unsupervised transfer learning model and a domain adaptation feature alignment algorithm, the network effectively narrows the feature distribution in the latent space, realizing accurate nonlinear compensation for high-order harmonic distortion. As can be seen from the comparison, the residual high-order harmonic distortion rate of the normal working condition samples (S01-S06) is significantly suppressed to within 0.2%, and the final absolute angle error is significantly converged to below 0.1°, and the calibration accuracy has achieved a leap of orders of magnitude. (2) Achieving highly reliable intelligent waste interception: Before performing compensation, the system performs statistical judgment based on the final error compensation sequence output by the error compensation prediction network. In the face of severely damaged samples (S07, S08), the system accurately identifies that the proportion of abnormal compensation points exceeding the maximum physical deviation threshold is too high, thus successfully rejecting the invalid calibration and outputting a fault alarm signal to the system-level control center, fundamentally preventing defective products from flowing into the terminal application.

[0053] Example 2: An electronic device, comprising a memory and a processor; The memory is used to store computer programs; The processor is configured to implement the method described in Embodiment 1 when executing the computer program.

[0054] Example 3: A computer-readable storage medium storing a computer program that, when executed by a processor, implements the method described in Embodiment 1.

[0055] Example 4: A computer program product includes a computer program that, when executed by a processor, implements the method described in Example 1.

[0056] In the above embodiments, the reference to "this embodiment" in the specification indicates that a specific feature, structure, or characteristic described in connection with the embodiment is included in at least some embodiments, but not necessarily all embodiments. Multiple appearances of "this embodiment" do not necessarily refer to the same embodiment.

[0057] In the above embodiments, although the invention has been described in conjunction with specific embodiments thereof, many substitutions, modifications, and variations of these embodiments will be apparent to those skilled in the art from the foregoing description. For example, other memory structures (e.g., dynamic RAM (DRAM)) may be used with the embodiments discussed. The embodiments of the invention are intended to cover all such substitutions, modifications, and variations falling within the broad scope of the appended claims.

[0058] As will be understood by those skilled in the art, the computer-readable storage medium described in this embodiment allows for the implementation of all or part of the steps in the above method embodiments by computer program-related hardware. The aforementioned computer program can be stored in a computer-readable storage medium. When executed, the program performs the steps of the above method embodiments; and the aforementioned storage medium includes various media capable of storing program code, such as ROM, RAM, magnetic disks, or optical disks.

[0059] The electronic terminal provided in this embodiment includes a processor, a memory, a transceiver, and a communication interface. The memory and the communication interface are connected to the processor and the transceiver and complete communication between them. The memory is used to store computer programs, the communication interface is used to perform communication, and the processor and the transceiver are used to run the computer programs, so that the electronic terminal performs the steps of the above method.

[0060] In this embodiment, the memory may include random access memory (RAM) and may also include non-volatile memory, such as at least one disk storage device.

[0061] The processors mentioned above can be general-purpose processors, including central processing units (CPUs), network processors (NPs), etc.; they can also be digital signal processors (DSPs), application-specific integrated circuits (ASICs), field-programmable gate arrays (FPGAs), or other programmable logic devices, discrete gate or transistor logic devices, or discrete hardware components.

[0062] This invention can be used in a wide range of general-purpose or special-purpose computing system environments or configurations. Examples include: personal computers, server computers, handheld or portable devices, tablet devices, multiprocessor systems, microprocessor-based systems, set-top boxes, programmable consumer electronics, network PCs, minicomputers, mainframe computers, and distributed computing environments including any of the above systems or devices, etc.

[0063] This invention can be described in the general context of computer-executable instructions, such as program modules, that are executed by a computer. Generally, program modules include routines, programs, objects, components, data structures, etc., that perform a specific task or implement a specific abstract data type. This invention can also be practiced in distributed computing environments where tasks are performed by remote processing devices connected via a communication network. In distributed computing environments, program modules can reside in local and remote computer storage media, including storage devices.

[0064] Finally, it should be noted that 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 preferred embodiments, those skilled in the art should understand that modifications or equivalent substitutions can be made to the technical solutions of the present invention without departing from the spirit and scope of the present invention, and all such modifications or substitutions should be covered within the scope of the claims of the present invention.

Claims

1. A sensor error self-calibration and state monitoring method based on domain-adaptive feature alignment, characterized in that: Includes the following steps: S1: Obtain source domain reference data, preprocess it, and pre-train the source domain autoencoder. After training, freeze the network parameters of the source domain autoencoder. The source domain reference data is an ideal signal sequence derived from the analytical model of the air gap magnetic permeability of the target mechanical structure. S2: Acquire the target domain test data of the sensor under test, and after preprocessing, input it into the source domain autoencoder with frozen parameters to extract the target domain features; the sensor under test includes a magnetoresistive sensor, a Hall position sensor or an electromagnetic rotary transformer. In step S2, the target domain test data is... The input is fed into the source domain encoder with frozen parameters to extract the target domain feature vector. ; S3: Input the target domain features into the error compensation network to obtain the initial error compensation sequence; the error compensation network is composed of a multilayer perceptron, and for the multilayer perceptron... There are hidden layers with error compensation sequences. Represented as: ,in and The first The learnable weight matrix and bias vector of each hidden layer It is a non-linear activation function; S4: Superimpose the preprocessed target domain test data with the initial error compensation sequence; In step S4, the error compensation network outputs the final error compensation sequence. Compared with the original target domain test data By superimposing the data point by point, a compensation sample is obtained. ; S5: Input the superimposed data into the source domain autoencoder with frozen parameters, align the feature distributions of the source and target domains using a domain adaptation algorithm, constrain the distribution of the predicted data at the output, and jointly iteratively optimize the parameters of the error compensation network until convergence; in step S5, the compensation samples... The inputs are fed into the pre-trained encoder and decoder in the source domain to obtain the target domain features. and target domain prediction data ; The maximum mean difference is used as the distance metric: ,in This represents the maximum mean difference loss function. and These represent the total number of samples in the current training batch and the number of samples in the target domain, respectively. Representing the infinite-dimensional regenerating kernel Hilbert space The mapping function in Represents the Gaussian kernel function; Indicates the first Each source domain feature sample Indicates the first One target domain feature sample; Calculate the compensated test data With target domain prediction data Mean square error between : ,in Indicates the first A compensated target domain sample of test data. Indicates the first One target domain prediction data sample; Construct the total loss function for network training Through hyperparameters Dynamic equilibrium reconfiguration constraints and distribution convergence constraints: The gradient descent algorithm is used to perform end-to-end iterative optimization of the network; when After convergence, the final error compensation sequence output by the error compensation network is extracted. ; S6: Statistically converged final error compensation sequence. Based on the proportion of compensation values ​​exceeding the preset threshold in the final error compensation sequence, perform parameter calibration or output fault alarm for the sensor under test.

2. The sensor error self-calibration and state monitoring method based on domain-adaptive feature alignment according to claim 1, characterized in that: The source domain autoencoder includes a source domain encoder and a source domain decoder; The source domain encoder includes a downsampling layer and a fully connected layer. After the preprocessed source domain reference data is stacked through multiple downsampling layers, the high-dimensional feature map will be flattened into a one-dimensional vector and mapped to the final latent space through the fully connected layer to obtain the source domain features. The source domain decoder includes an upsampling layer and a signal reconstruction output layer. After the source domain features are stacked through multiple upsampling layers, the final reconstructed prediction signal is output through the signal reconstruction output layer.

3. The sensor error self-calibration and state monitoring method based on domain-adaptive feature alignment according to claim 2, characterized in that: The downsampling layer in the source domain encoder includes a convolutional layer, an activation function layer, a normalization layer, and a pooling layer; wherein, the convolutional layer is used to extract local features of the input signal, the activation function layer is used to introduce nonlinear mapping capability, the normalization layer is used to accelerate model convergence and improve training stability, and the pooling layer is used to reduce feature dimensionality and enhance feature robustness. The convolutional layer uses one-dimensional convolution to extract features from the sensor's time-series signals, and its calculation process is as follows: ,in, This represents the convolution operation. and They represent the first The kernel parameters and bias terms of the layer It is the first The output feature map of the layer, It is a linear feature map output after the convolution operation; The normalization layer uses batch normalization, and its calculation process is as follows: ,in, and These represent the batch mean and variance, respectively. and For learnable parameters, It is a tiny constant to prevent the denominator from being zero. It is the normalized feature map; The activation function layer uses the ReLU function, whose expression is: ,in It is a feature map after nonlinear mapping; The pooling layer employs max pooling, and its operation is represented as follows: ,in It is the size of the one-dimensional pooling window. It is the sliding step size of the pooling. It is the dimensionality reduction feature of the final output of this layer; k This represents the position index on the output feature map after dimensionality reduction. n This represents the local offset index that slides within the current pooling window; After the sensor time-series signal is processed by a multi-layer downsampling stack consisting of convolutional layers, normalization layers, activation function layers, and pooling layers, the network extracts multi-channel high-dimensional local feature maps. Subsequently, a flattening operation is performed to sequentially concatenate and reshape the multi-dimensional feature matrices into a one-dimensional feature vector. Finally, this one-dimensional feature vector is mapped to the final latent space through a fully connected layer to obtain the source domain features. ,in express The dimensional real characteristic space is mathematically expressed as: ,in It is a one-dimensional feature vector that has been flattened after multiple convolutional pooling operations. and These are the weight matrix and bias vector of the fully connected layer, respectively. It is the activation function of the fully connected layer. It is a hidden space dimension.

4. The sensor error self-calibration and state monitoring method based on domain adaptation feature alignment according to claim 3, characterized in that: The upsampling layer in the source domain decoder includes a one-dimensional transposed convolutional layer, a batch normalization layer, and an activation layer. The one-dimensional transposed convolutional layer is used to upsample and amplify the low-dimensional compressed features in the temporal dimension, gradually restoring the original resolution of the sensor signal. Its mathematical expression is: ,in This represents a one-dimensional transpose convolution operation; The signal reconstruction output layer outputs the final reconstructed prediction signal, which is based on the reconstructed source domain prediction data. Its expression is: ,in It is the feature output of the last hidden layer of the decoder. and These are the weights and biases of the output layer; Mean squared error is used as the reconstruction loss function: ,in It is the total number of samples in the current training batch. It is the first One source domain baseline data sample, It is the first output of the source domain decoder reconstruction. One source domain prediction data sample; The gradient descent algorithm is used to perform end-to-end iterative optimization of the network.

5. The sensor error self-calibration and state monitoring method based on domain-adaptive feature alignment according to claim 1, characterized in that: In step S6, the final error compensation sequence is traversed. The statistics show that the absolute value of the deviation is greater than the preset maximum physical deviation threshold. The number of outliers is then used to calculate the proportion of outlier compensation points in the entire time series. ,like If the sensor is determined to have suffered irreversible and severe physical damage, compensation will be refused, and a sensor fault alarm signal will be output to the system-level control center; if This indicates that the signal offset of the sensor under test in the target domain is mainly caused by environmental interference, aging drift, or system errors, and is still within the range that the model can calibrate.

6. A sensor error self-calibration and state monitoring device based on domain-adaptive feature alignment, characterized in that: include: Signal acquisition module used to acquire orthogonal distortion signals; A data processing unit that runs the sensor error self-calibration and state monitoring method based on domain adaptation feature alignment as described in any one of claims 1-5; And a non-volatile memory cell for storing electronic correction parameters.