Temperature data processing method of pressure gauge based on temperature calibration drift error compensation
By constructing a learnable compensation function and adaptive noise filtering of temperature deviation and rate of change, combined with the temperature gating mechanism, the measurement error problem caused by temperature changes of the pressure gauge is solved, dynamic compensation and accurate identification of fault characteristics are achieved, and the accuracy and adaptability of fault diagnosis are improved.
Patent Information
- Application Number
- CN202510874610.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-06-27
- Publication Date
- 2025-09-02
- Estimated Expiration
- 2045-06-27
AI Technical Summary
The prior art cannot effectively separate temperature changes and fault sudden changes, resulting in misjudgment of pressure gauge measurement data and degradation of performance, and traditional methods cannot adapt to dynamic temperature changes, affecting the accuracy of fault diagnosis.
By constructing a learnable compensation function based on temperature deviation and rate of change, combining adaptive noise filtering and temperature gating mechanism, dynamically adjusting the pressure gauge temperature data processing method, nonlinear drift compensation and fault feature extraction are realized.
The dynamic compensation method can automatically weaken nonlinear drift when temperature changes, retain fault characteristics, enhance the response ability to sudden faults, improve the accuracy and adaptability of fault prediction, and reduce errors caused by temperature changes.
Smart Images

Figure CN120372233B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of data processing, and in particular to a method for processing temperature data of a pressure gauge based on temperature calibration drift error compensation. Background Art
[0002] Industrial pressure gauges are widely used in various production and monitoring systems, fulfilling critical pressure measurement tasks. However, the measurement signals of pressure sensors are easily affected by changes in ambient temperature, resulting in nonlinear drift in the measured data. This temperature-induced drift is often confused with sudden changes in signals caused by faults, thus affecting the accuracy of fault diagnosis. In practical applications, under conditions of drastic temperature fluctuations, conventional normalization and drift compensation methods often fail to effectively separate temperature changes from sudden fault changes, leading to model misjudgment and performance degradation. Furthermore, existing temperature drift compensation methods mostly rely on static linear transformations, which cannot adapt to the dynamically changing temperature conditions in real environments, resulting in unsatisfactory drift compensation results.
[0003] The existing technologies, such as patents with publication numbers CN119782759A, CN119783060A, and CN119760592A, have problems such as the inability to dynamically adjust, the inability of noise filtering methods to adapt to changes in ambient temperature, the failure to fully consider the impact of temperature changes on timing feature extraction, thereby affecting the accuracy of fault identification, and the failure to address the impact of temperature changes on the probability of fault occurrence. Summary of the Invention
[0004] In order to solve the technical problem of pressure gauge temperature drift in the prior art, the present invention provides a pressure gauge temperature data processing method and system based on temperature calibration drift error compensation.
[0005] The present invention is achieved through the following technical solutions:
[0006] A method for processing temperature data of a pressure gauge based on temperature calibration drift error compensation, comprising:
[0007] S1, data acquisition, synchronously collects the original pressure readings and ambient temperature time series data of the industrial pressure gauge through the pressure sensor and thermocouple temperature sensor;
[0008] S2, data preprocessing, including temperature and pressure synchronization verification and outlier processing;
[0009] S3, dynamic temperature drift compensation preprocessing, constructing a learnable compensation function based on temperature deviation and temperature change rate to achieve dynamic compensation of nonlinear drift;
[0010] S4, adaptive noise filtering and feature enhancement, extracts frequency domain coefficients at each scale through multi-layer discrete wavelet transform, calculates the adaptive threshold of each layer according to the temperature change rate at the current moment, combines the soft threshold function to perform nonlinear compression processing on the wavelet coefficients, and uses the reconstructed wavelet basis function to inverse transform the processed coefficients to restore them to the time domain signal, obtaining the pressure time series output after noise reduction;
[0011] S5. Modeling of pressure gauge temperature data;
[0012] S6, stop iterating condition judgment;
[0013] S7. Model reasoning.
[0014] Furthermore, the verification of the synchronization of temperature and pressure adopts a spatiotemporal alignment method, which synchronizes the data of the two by interpolation based on the temporal characteristics of the temperature and pressure data, combined with the temperature change rate and timestamp information.
[0015] Furthermore, the construction of a learnable compensation function based on temperature deviation and temperature change rate includes: calculating a drift baseline term based on the difference between the original pressure reading, the real-time temperature value and the reference temperature, combined with the drift compensation bias term and the linear coefficient term, and then adaptively adjusting the compensation amount in combination with an adjustment factor that exponentially decays with the temperature change rate, and obtaining a pressure compensation value after removing the temperature drift by deducting the calculated compensation amount from the original pressure reading.
[0016] Furthermore, the pressure compensation value is calculated as follows:
[0017]
[0018] Where, is the pressure value after compensation, is the raw pressure reading; is the real-time temperature value; is the reference temperature; is the temperature change rate; is the drift compensation bias term; is the drift compensation linear coefficient; It is a temperature mutation inhibitor.
[0019] Furthermore, the adaptive noise filtering and feature enhancement are expressed as:
[0020]
[0021] Where, is the pressure time series signal after noise reduction; Indicates the Temperature-adaptive thresholding of layer wavelet coefficients; To reconstruct the wavelet basis function, Signal reconstruction of layer wavelet coefficients; is the soft threshold function; is the discrete wavelet transform operator, outputting The wavelet coefficients of the layer; is the pressure value after compensation.
[0022] Further, The calculation method is expressed as ; is the pressure value after compensation; is a symbolic function.
[0023] Furthermore, the step S5 includes:
[0024] Construct a bidirectional temperature-gated recurrent network structure model, use the core layer for data processing, the feature decoupling layer for fault feature decoupling and regularization, the output layer for result output, prediction probability distribution correction, calculation of temperature-aware cross-entropy loss function, backpropagation and parameter update.
[0025] Furthermore, the feature decoupling layer performs fault feature decoupling regularization by adopting a temperature condition mask mechanism to dynamically adjust the discard probability by calculating the temperature sensitivity of the feature.
[0026] Furthermore, the predicted probability distribution correction includes performing a temperature-aware Bayesian correction operation through a temperature binning prior matrix.
[0027] Furthermore, the temperature-aware cross entropy loss function is calculated as follows:
[0028]
[0029] Where, is the temperature-aware cross entropy loss function; is the total number of training samples; For the The true fault category of each sample is one-hot encoded; After correction The predicted probability distribution of samples; is the KL divergence; is the empirical probability of failure under temperature bin conditions; is the global failure prior probability; is the balance weight of the KL divergence penalty term; The center value of the target temperature bin.
[0030] Compared with the prior art, the present invention has the following beneficial effects:
[0031] 1. The present invention constructs a learnable compensation function based on temperature deviation and temperature change rate to dynamically adjust the nonlinear drift compensation caused by temperature. It automatically weakens the compensation strength in the temperature mutation area to prevent the real fault characteristics from being mistakenly erased. Through the exponential decay mechanism of the temperature change rate, dynamic temperature drift compensation is achieved, avoiding the problem that traditional static linear transformation cannot distinguish between temperature changes and fault mutations.
[0032] 2. Based on the compensated pressure signal, the present invention adopts the dynamic temperature change rate to calculate the adaptive wavelet threshold, adjusts the degree of retention of high-frequency signals during sudden temperature changes, suppresses noise interference while retaining potential fault characteristics, and enhances the expression of key abnormal points by combining the soft threshold function to perform nonlinear compression on the wavelet coefficients.
[0033] 3. The present invention adopts a temperature gating mechanism, combines pressure and temperature data, and dynamically adjusts the degree of retention of historical states. It can automatically adjust the memory strategy according to changes in the temperature environment, strengthen historical memory when the temperature is stable, and strengthen the role of current input when the temperature changes drastically, thereby effectively improving the response capability to sudden failures.
[0034] 4. The present invention adopts a temperature condition mask mechanism, calculates the sensitivity of the hidden state to the real-time temperature, and dynamically adjusts the discard rate, thereby forcing the network to learn fault characteristics that are independent of temperature. It can effectively decouple temperature drift and fault characteristics, ensure that the network does not depend on specific temperature conditions, and enhance the model's adaptability to different temperature scenarios.
[0035] 5. The present invention adopts a temperature-aware Bayesian correction mechanism in the cross-entropy loss function, and performs posterior correction under temperature conditions through the temperature binning prior matrix to further improve the accuracy of fault prediction. During the training process, the output of the model is corrected by the prior probability of the temperature range, thereby reducing the prediction error caused by temperature changes. BRIEF DESCRIPTION OF THE DRAWINGS
[0036] The drawings described herein are used to provide a further understanding of the present application and constitute a part of the present application. The illustrative embodiments of the present application and their descriptions are used to explain the present application and do not constitute an improper limitation on the present application. In the drawings:
[0037] Figure 1 This is a flow chart of a method for processing temperature data of a pressure gauge based on temperature calibration drift error compensation according to an embodiment of the present application;
[0038] Figure 2(a)-Figure 2(c)Figure 2(a) shows the experimental results of the static linear compensation method, the wavelet denoising method, and the method of the present invention, respectively. Figure 2(b) shows the experimental results of the wavelet denoising method, and Figure 2(c) shows the experimental results of the method of the present invention.
[0039] Figure 3(a)-Figure 3(c) The experimental results of the temperature gating mechanism's impact on fault detection according to an embodiment of the present application are as follows: FIG3(a) is a temperature variation curve showing temperature fluctuations between 25°C and 50°C in an industrial scenario; FIG3(b) is a temperature change rate curve, identifying areas of rapid temperature change; and FIG3(c) compares the fault detection probabilities of a standard gated cyclic unit and the method of the present invention.
[0040] Figure 4 This is a comparison of cross-temperature generalization capabilities according to the embodiments of the present application. DETAILED DESCRIPTION
[0041] The embodiments of the present invention are described in detail below with reference to the accompanying drawings.
[0042] The following describes the embodiments of the present invention through specific examples. Those skilled in the art can easily understand other advantages and effects of the present invention from the contents disclosed in this specification. Obviously, the described embodiments are only a part of the embodiments of the present invention, rather than all the embodiments. The present invention can also be implemented or applied through other different specific embodiments, and the details in this specification can also be modified or changed in various ways based on different viewpoints and applications without departing from the spirit of the present invention. It should be noted that, in the absence of conflict, the following embodiments and features in the embodiments can be combined with each other. Based on the embodiments in the present invention, all other embodiments obtained by ordinary technicians in this field without making creative work are within the scope of protection of the present invention.
[0043] It should also be noted that the illustrations provided in the following embodiments are only schematic illustrations of the basic concept of the present invention. The illustrations only show components related to the present invention and are not drawn according to the number, shape and size of components in actual implementation. In actual implementation, the form, quantity and proportion of each component can be changed at will, and the component layout form may also be more complicated.
[0044] See also Figure 1 A method for processing temperature data of a pressure gauge based on temperature calibration drift error compensation comprises the following steps:
[0045] S1. Data Collection
[0046] The original pressure readings and ambient temperature time series data of the industrial pressure gauge are collected synchronously through high-precision pressure sensors and thermocouple temperature sensors;
[0047] Optionally, the pressure sensor sampling frequency is set to 1kHz, and the temperature sampling frequency is synchronized to 1Hz;
[0048] Optionally, if the temperature changes dramatically, it can be increased to 10Hz. For example, if the temperature changes by more than 50°C, the temperature sampling frequency is synchronized to 10Hz.
[0049] The data collection duration covers the complete working cycle of the pressure gauge and typical temperature change scenarios, including equipment startup, steady-state operation, shutdown and cooling stages;
[0050] The data collected includes the digital value (unit: MPa) of the original pressure analog signal converted by 24-bit ADC, the digital value of K-type thermocouple temperature (unit: °C), and a timestamp accurate to milliseconds.
[0051] All data is transmitted to the edge computing unit in real time via the industrial bus and stored as a structured time series data set.
[0052] Furthermore, data labeling needs to be completed synchronously during the collection phase. Experts manually mark the fault type, such as leakage, blockage, sensor failure, etc., and the time interval when the fault occurred based on the equipment operation log to form a multi-classification label vector. The storage format is strictly aligned with the original data timestamp.
[0053] S2. Data Preprocessing
[0054] S201. Temporal and spatial alignment of temperature and pressure data
[0055] To verify the synchronization and physical relationship of temperature and pressure sensors, during the installation process, different equipment layouts may cause certain delays or spatial temperature differences in temperature measurement. If this delay or temperature difference affects data synchronization, the data needs to be aligned in time and space.
[0056] The present invention adopts a spatiotemporal alignment method, based on the temporal characteristics of temperature and pressure data, combined with temperature change rate and timestamp information, and synchronizes the data of the two through interpolation.
[0057] For example, suppose that during the device startup phase, the temperature sensor measurement value is at the timestamp Time record is , but the pressure sensor is The pressure recorded is , because the temperature sensor has a 0.2 second delay, the actual temperature value is It is recorded as ,from arrive The rate of temperature change is approximately equal to , where 24°C is temperature;
[0058] Furthermore, by linear interpolation Estimated temperature at ;
[0059] Furthermore, the estimated temperature value and pressure value In timestamp Alignment ensures that temperature-pressure data are strictly synchronized in timing, eliminating the delay caused by sensor layout.
[0060] S202. Abnormal value processing
[0061] The raw pressure data may contain outliers caused by sensor failure or external environmental interference, such as electromagnetic pulse noise, equipment drift, etc. The present invention adopts a robust filtering mechanism to process abnormal fluctuations in the data through a median filter, and identifies and eliminates obviously abnormal measurement points through an anomaly detection mechanism based on time series trends.
[0062] Specifically, for each preset time window, the mean and standard deviation of the pressure data are calculated, and the set threshold is used to determine whether the data is an outlier. The outlier will be marked and removed.
[0063] For example, assuming that within a 1-second time window, the pressure data sequence is,
[0064] ,
[0065] The sampling frequency is 1kHz, with a total of 1000 points, which are simplified to 5 points here;
[0066] Furthermore, the mean of the pressure data within the window is calculated and standard deviation ;
[0067] Furthermore, the threshold is set to , is the mean, is the standard deviation, that is, the threshold is , the range is to ;
[0068] Points , is within the range, but its adjacent point mutation exceeds 10%, which significantly deviates from the temporal trend and is identified as an outlier;
[0069] Furthermore, the median value in the window is taken by processing with a median filter. , replace the outliers for , eliminating abnormal fluctuations caused by electromagnetic pulse noise and retaining the true pressure trend.
[0070] In one embodiment, a heat map is used to quantitatively evaluate the ability of different preprocessing methods to retain key fault features. The vertical axis of the heat map covers six typical industrial faults, and the horizontal axis includes six core diagnostic features such as pressure mutation and pulse characteristics. The experiment compares static linear compensation, wavelet denoising and the method of the present invention, and the feature retention score is represented by color depth. The experimental results are shown as follows: Figure 2(a)-Figure 2(c) As shown in the figure, Figure 2(a) is the experimental result of the static linear compensation method, Figure 2(b) is the experimental result of the wavelet denoising method, and Figure 2(c) is the experimental result of the method of the present invention. The static compensation method shows obvious light-colored areas in the pressure mutation and pulse feature columns, indicating that the transient features are seriously lost. Although the wavelet denoising method has improved, there are still patchy attenuation areas in the high-temperature fault type row. The thermal map of the method of the present invention is uniformly dark red as a whole, especially in the intersection area of the sensor failure row and the pulse feature column. It maintains a high retention rate, which verifies that its temperature adaptive threshold mechanism can dynamically balance noise reduction and feature retention, avoiding the traditional method from mistakenly deleting weak fault features when the temperature changes.
[0071] S3. Dynamic temperature drift compensation preprocessing
[0072] The raw measurement data of pressure gauges is easily affected by changes in ambient temperature, resulting in nonlinear drift in the signal due to temperature changes. This drift obscures the true fault mutation information and causes feature confusion. Traditional normalization methods usually use static linear transformation to scale the data range. This is unable to dynamically separate the slowly changing offset caused by temperature from the rapid mutation caused by the fault. Therefore, under conditions of drastic temperature changes, drift is easily misidentified as an anomaly or real faults are mistaken for normal fluctuations, resulting in degraded model performance and misdiagnosis.
[0073] The present invention achieves dynamic compensation for nonlinear drift caused by temperature in the original pressure reading by constructing a learnable compensation function based on temperature deviation and temperature change rate. Specifically, the drift baseline term is first calculated based on the difference between the original pressure reading, the real-time temperature value and the reference temperature, combined with the drift compensation bias term and the linear coefficient term. Then, the compensation amount is adaptively adjusted by combining an adjustment factor that decays exponentially with the temperature change rate, thereby weakening the compensation strength in the temperature mutation area and preventing the true fault characteristics from being mistakenly erased. Then, by deducting the calculated compensation amount from the original pressure reading, the pressure compensation value after removing the temperature drift is obtained, thereby achieving the effect of retaining the fault characteristics while suppressing temperature interference, which is expressed as:
[0074]
[0075] Where, To compensate the pressure value and eliminate the baseline drift caused by temperature;
[0076] is the raw pressure reading, representing the unprocessed sensor measurement;
[0077] is the real-time temperature value, which is the time series data collected synchronously with the pressure;
[0078] As the reference temperature, take the median of the training set temperature;
[0079] is the temperature change rate, which is calculated by the difference between adjacent time steps, that is, ;
[0080] is the temperature value at the previous moment;
[0081] is the drift compensation bias term, and the calculation method is expressed as being obtained by optimizing the training data. Specifically, the optimal value is obtained by minimizing the mean square error of the compensation residual, which is expressed as , during the optimization process, the pressure value after compensation The initial value of is set to 0;
[0082] is the drift compensation linear coefficient, and the drift compensation bias term Joint optimization learning, using linear regression to fit the relationship between temperature deviation and drift, expressed as ;
[0083] is the temperature mutation suppression factor, which controls the exponential decay strength, such as, ;
[0084] It is a natural exponential function, which realizes adaptive attenuation when the temperature changes suddenly.
[0085] It should be noted that The term characterizes the adaptive drift, where An exponential form is used to suppress overcompensation during sudden temperature changes.
[0086] S4. Adaptive noise filtering and feature enhancement
[0087] Industrial pressure data is often accompanied by frequent temperature fluctuations and non-stationary noise. This noise exhibits irregularities in the time domain, especially during periods of drastic temperature fluctuations. Its energy is concentrated in high frequencies, making it easily confused with sudden fault events. Conventional wavelet denoising or filtering methods often use fixed threshold settings, which can mistakenly delete high-frequency details with subtle fault information when the temperature fluctuates significantly, or retain excess noise when the temperature is stable. This makes it difficult to achieve both fidelity preservation and noise reduction, resulting in a lack of robustness and discriminability in the filtering results.
[0088] Based on the compensated pressure signal, the present invention first extracts the frequency domain coefficients at each scale through multi-layer discrete wavelet transform. Then, the adaptive threshold of each layer is calculated according to the temperature change rate at the current moment. The adaptive threshold is dynamically scaled with the temperature severity, thereby retaining more high-frequency details when the temperature suddenly changes. Then, the wavelet coefficients are nonlinearly compressed in combination with the soft threshold function to suppress noise interference while retaining potential fault characteristics. Then, the processed coefficients are inversely transformed and restored to the time domain signal using the reconstructed wavelet basis function to obtain the denoised pressure time series output, achieving enhanced expression of key abnormal points and effective reduction of background noise, which is expressed as:
[0089]
[0090] Where, is the pressure time series signal after noise reduction, that is, the output after filtering and feature enhancement;
[0091] Indicates the The temperature adaptive threshold of the layer wavelet coefficient is dynamically adjusted with the temperature change rate, and the calculation method is expressed as ;
[0092] To reconstruct the wavelet basis function, Signal reconstruction of layer wavelet coefficients;
[0093] is the soft threshold function, The calculation method is expressed as ;
[0094] is the discrete wavelet transform operator, outputting The wavelet coefficients of the layer;
[0095] is the pressure value after compensation;
[0096] As the benchmark threshold, take the standard deviation of the wavelet coefficients;
[0097] is the temperature sensitivity factor, which controls the sensitivity of the threshold to the temperature change rate, such as ;
[0098] is the temperature change rate;
[0099] is the maximum value function;
[0100] is a symbolic function;
[0101] The maximum value representing the temperature change rate is obtained by statistics within the training set or sliding window;
[0102] is a positive integer;
[0103] Is a positive integer.
[0104] It should be noted that the core rule of the threshold adjustment mechanism is: Increased Reduce, thereby preserving high-frequency details.
[0105] It should also be noted that in In the item, if If greater than 0, the sign function takes the value 1. is equal to 0, then the sign function takes the value 0, if If it is less than 0, the sign function takes the value of -1.
[0106] S5. Pressure gauge temperature data modeling
[0107] S501. Build model structure
[0108] The model adopts a bidirectional temperature-gated recurrent network structure, including:
[0109] Input layer: The input layer receives the preprocessed pressure-temperature time series pairs ,in is the total time step of the time series data, that is, the length of the model input sequence;
[0110] Core layer: The core layer is a three-layer bidirectional gated recurrent network with 128 hidden units per layer, which implements forward / backward temporal feature extraction.
[0111] Feature decoupling layer: The feature decoupling layer implements temperature-conditional mask regularization;
[0112] Output layer: The output layer is a fully connected network that uses the Softmax function as the activation function to generate the probability distribution of fault categories.
[0113] The training process is supervised training. The training data uses the fault type labels annotated in the S1 stage and is strictly aligned with the input sequence using one-hot encoding. The batch size is set to 64.
[0114] S502, core layer data processing
[0115] Traditional gated recurrent units (GRUs) are unable to proactively detect potential drift caused by temperature changes when processing time-series pressure data. When the temperature suddenly changes, their reliance on historical states remains unadapted, causing the model to mistakenly store temperature fluctuations as historical patterns, which in turn interferes with the identification of current fault features. In environments with drastic temperature fluctuations, this indiscriminate state update mechanism can easily lead to feature ambiguity and memory contamination, reducing the network's ability to discriminate at key nodes.
[0116] This step uses a temperature gating mechanism in the gated loop structure to jointly encode the current temperature information with the historical hidden state and pressure signal to generate a temperature gating vector, which is used to dynamically adjust the degree of retention of the historical state in the current hidden state update. When the temperature is stable, the temperature gating vector increases the weight of historical memory and enhances the ability to model long-term dependencies. When the temperature changes rapidly, it actively reduces the participation of historical information and enhances the dominant role of the current input on the hidden state. Through the temperature gating mechanism, the model can automatically adjust the memory strategy according to changes in the temperature environment, effectively enhancing the ability to respond to and extract sudden fault characteristics immediately, which is expressed as:
[0117]
[0118]
[0119]
[0120]
[0121]
[0122] Where, is the temperature gating vector, which has the same dimension as the hidden state. It outputs values in the range [0, 1] through the Sigmoid activation function and controls the historical state fusion weight.
[0123] is the Sigmoid activation function;
[0124] is the temperature gating weight matrix, which is a trainable parameter and learns the temperature-pressure-state coupling relationship;
[0125] It is a vector concatenation operation that connects multiple vectors along the feature dimension;
[0126] It is the hidden state of the previous moment and stores historical time series features;
[0127] is the pressure time series signal after noise reduction;
[0128] is the temperature gate bias vector, which is a trainable parameter;
[0129] To update the gate vector, control the historical state update ratio;
[0130] To update the gate weight matrix, it is a trainable parameter;
[0131] To reset the gate vector, control the degree of historical state reset;
[0132] To reset the gate weight matrix, it is a trainable parameter;
[0133] is a candidate hidden state, calculated based on the current input and reset state;
[0134] It is element-by-element multiplication, which realizes element-level operation between vectors;
[0135] is the candidate state weight matrix, which is a trainable parameter;
[0136] is the hyperbolic tangent function;
[0137] is the hidden state at the current moment, which is used as the feature extraction output.
[0138] It should be noted that the temperature gating vector The input contains the real-time temperature value And the pressure time series signal after noise reduction , directly perceive environmental changes, and hide the current state In the calculation process, if If it approaches 1, it means that the historical memory is strengthened when the temperature is stable. When it approaches 0, it indicates that the current characteristics are emphasized when the temperature changes drastically.
[0139] It should also be noted that the difference between the present invention and the standard GRU is that the state update method of the standard GRU is expressed as , and the present invention combines the temperature gating vector as a combined temperature weight to achieve temperature-adaptive timing feature extraction.
[0140] In one embodiment, Figure 3(a)-Figure 3(c)As shown in the figure, in order to analyze the working principle of the temperature gating mechanism, Figure 3(a) is a temperature change curve, showing the temperature fluctuation of 25-50°C in an industrial scenario, Figure 3(b) is a temperature change rate curve, marking the temperature sudden change area, and Figure 3(c) compares the fault detection probability of the standard gated cycle unit and the method of the present invention. The experiment observed at four fault points that in the temperature stable period, both methods can effectively detect faults, but in the temperature sudden change period, the detection probability of the standard method shows a significant attenuation, while the method of the present invention maintains a stable high probability, indicating that the temperature gating vector can dynamically adjust the historical memory weight, reduce the impact of outdated states when the temperature suddenly changes, and avoid the feature ambiguity problem caused by temperature interference in traditional methods.
[0141] S503, feature decoupling layer performs fault feature decoupling regularization
[0142] Pressure fault features and temperature drift have a high-order coupling relationship. Conventional dropout methods randomly discard some features during processing, which may cause some key fault features to be mistakenly discarded, affecting the model's accurate extraction and identification of fault features and failing to effectively decouple the impact of fault features and temperature drift.
[0143] This paper adopts a temperature conditional mask mechanism to dynamically adjust the discard probability by calculating the temperature sensitivity of the feature, thereby forcing the network to learn the essential fault characteristics that are independent of temperature. The specific steps are as follows:
[0144] 1) Temperature sensitivity calculation
[0145] By calculating the gradient matrix of the hidden state to the real-time temperature value and obtaining its Frobenius norm, we can obtain the sensitivity scalar value that characterizes the strength of the characteristic temperature dependence, which is expressed as:
[0146]
[0147] Where, for The scalar value of the sensitivity of the hidden state to temperature at each moment, which represents the measure of the characteristic temperature sensitivity;
[0148] Hidden Temperature The partial derivative matrix of ;
[0149] Real-time temperature value , that is, time series data collected synchronously with pressure;
[0150] is the Frobenius norm.
[0151] 2) Temperature condition mask generation
[0152] Based on the sensitivity scalar value, the baseline drop rate is dynamically scaled and the temperature condition mask vector is generated by Bernoulli sampling to achieve high probability drop of highly sensitive features, which is expressed as:
[0153]
[0154] Where, is the temperature condition mask vector;
[0155] Represents Bernoulli distribution sampling, sampling each element in the vector independently;
[0156] is the baseline drop rate, e.g. .
[0157] 3) Regularized feature synthesis
[0158] By fusing the original hidden state with the temperature average feature vector and performing weighted synthesis using the mask vector, we can obtain the regularized hidden state that decouples the temperature interference, forcing the network to learn the essential fault characteristics that are independent of temperature, which can be expressed as:
[0159]
[0160] Where, is the regularized hidden state after decoupling;
[0161] represents element-wise multiplication;
[0162] is the average temperature eigenvector, and the calculation method is expressed as ;
[0163] is the sample set within the current temperature range;
[0164] Indicates the The hidden state of each sample.
[0165] It should be noted that the decoupled regularized hidden state During the calculation process, dynamic discarding based on characteristic temperature sensitivity is performed. The term represents the probability of discarding. When the characteristic temperature sensitivity is high, that is, When the sensitivity is large, the probability of discarding increases, forcing the network to reduce its dependence on temperature-related features. When the sensitivity is low, the original features are retained to avoid the loss of key fault features.
[0166] It should also be noted that the decoupled regularized hidden state During the calculation, the discarded features are represented by the temperature average feature vector Replace to maintain the stability of feature distribution.
[0167] S504, the output layer outputs the results
[0168] The decoupled regularized hidden state is input into the fully connected classification layer to predict the pressure gauge fault category. The output is normalized into a probability distribution through the Softmax function, which is expressed as:
[0169]
[0170] Where, is the classification layer weight matrix, which is a trainable parameter;
[0171] is the classification layer bias vector, which is a trainable parameter;
[0172] For the model The predicted probability distribution of samples;
[0173] is the Softmax function.
[0174] S505, prediction probability distribution correction
[0175] In the prediction probability distribution correction step, the temperature-aware Bayesian correction operation is performed using the temperature binning prior matrix. The specific steps are as follows:
[0176] 1) Temperature-aware Bayesian correction mechanism
[0177] By counting the occurrence frequencies of each fault category in different temperature intervals in the training data, a temperature binning prior matrix is constructed. Specifically, samples are first binned based on real-time temperature values, and all samples are divided into preset temperature binning intervals. Then, for each binning interval, the number of samples belonging to each type of fault in the interval is counted, and the relative probability of occurrence of the category in the current temperature interval is calculated. This probability is an element in the temperature binning prior matrix, which represents the empirical distribution of each fault type under specific temperature conditions. By constructing this prior matrix, the prior preference pattern of fault occurrence in different temperature intervals can be reflected, which is expressed as:
[0178]
[0179] Where, is the temperature bin prior matrix Rank Column elements, indicating the temperature bins Conditions, No. The prior probability of the occurrence of a fault category, that is, the probability of the training data belonging to the bin And it is the first The proportion of samples in each fault category;
[0180] is the total number of training samples;
[0181] No. Temperature bin intervals are preset manually, such as ;
[0182] is the indicator function;
[0183] Indicates that when The true fault category of the sample is Fault category, and its real-time temperature value belongs to The value is 1 when there is a temperature bin interval, otherwise it is 0;
[0184] For the The real-time temperature value of each sample is time series data collected synchronously with the pressure.
[0185] 2) Calculate the posterior correction distribution
[0186] After obtaining the temperature bin prior matrix, the fault prediction probability distribution of the original output of the model is fused with the prior matrix to complete the posterior correction processing of temperature perception. Specifically, based on the real-time temperature value of the current input sample, the corresponding temperature bin interval is determined, and the prior probability distribution of each fault category in the bin is extracted. Then, the prior probability is weightedly fused with the logarithmic probability of the original output of the model. During the fusion process, the positive intensity factor is combined to adjust the influence of the prior to avoid excessive interference with the original prediction. Then, the fused logarithmic probability is normalized to reconstruct an effective prediction distribution as the final correction result. Through the adjustment mechanism of the posterior distribution, the model output fully refers to the historical distribution pattern under temperature conditions, reduces the risk of misjudgment caused by sample distribution offset, and achieves improved robustness of fault prediction in temperature-sensitive environments, which is expressed as:
[0187]
[0188] Where, After correction The predicted probability distribution of samples;
[0189] is an exponential function with a natural constant as its base;
[0190] It is a logarithmic function, and the default base is 10;
[0191] To correct the intensity factor, set it to ;
[0192] is the temperature bin prior matrix Rank Column elements, indicating the temperature bins Conditions, No. The prior probability of the occurrence of a fault category, that is, the probability of the training data belonging to the bin And it is the first The proportion of samples in each fault category;
[0193] The bin index to which the current sample's real-time temperature value belongs;
[0194] is the temperature bin prior matrix Rank Column elements, indicating the temperature bins Conditions, No. The prior probability of the occurrence of a fault category, that is, the probability of the training data belonging to the bin And it is the first The proportion of samples in each fault category;
[0195] is the total number of fault categories;
[0196] For the model The predicted probability distribution of samples.
[0197] S506. Calculate temperature-aware cross entropy loss function
[0198] In industrial environments, different temperature ranges may correspond to significantly different fault distributions. The probability distributions of some fault types exhibit shifts at high or low temperatures. Traditional cross-entropy loss functions ignore this conditional shift in distribution during training and assume that the sample distributions are independent and identically distributed. This causes the model to overfit frequently occurring fault categories in certain temperature ranges, while reducing recognition capabilities in other ranges, impacting generalization performance.
[0199] The present invention adopts a penalty term based on temperature conditional probability on the basis of cross-entropy loss to constrain the model's learning of fault types from being dependent on a specific temperature environment. Specifically, by dividing the training data into temperature intervals, statistically analyzing the empirical probability distribution of faults within each interval, and calculating the difference between the probability distribution and the global fault distribution, the difference is then used as a regularization target to jointly train network parameters, guiding the model to extract fault features that are stable across temperature conditions. This results in strong discrimination capabilities in different temperature scenarios, significantly improving the model's cross-temperature generalization performance and robustness. The loss function is calculated as follows:
[0200]
[0201] Where, is the temperature-aware cross entropy loss function;
[0202] is the total number of training samples;
[0203] For the The true fault category of each sample is one-hot encoded;
[0204] After correction The predicted probability distribution of samples;
[0205] is the KL divergence, which is used to measure the difference between conditional probability and prior probability;
[0206] is the empirical probability of failure under temperature bin conditions, and the calculation method is expressed as ;
[0207] is the global fault prior probability, that is, the overall distribution of various types of faults in the training set;
[0208] is the balance weight of the KL divergence penalty term, such as, ;
[0209] is the center value of the target temperature bin;
[0210] is a positive integer;
[0211] is the half-width of the temperature bin, such as, ;
[0212] is the indicator function of the fault occurrence, when the sample is marked as a fault, the value is , otherwise ;
[0213] is the indicator function;
[0214] Characterize the temperature bin indicator function, when Belong to the interval When the value is , otherwise .
[0215] It should be noted that the KL divergence term The penalty model’s tendency to overfit a certain type of fault within a specific temperature range is used to constrain the empirical probability of faults under temperature binning conditions. Approximating the global prior probability of failure , forcing the classifier to extract essential fault features that are independent of temperature.
[0216] S507, Back Propagation and Parameter Update
[0217] The model optimizes parameters through the back-propagation algorithm and uses the Adam optimizer to minimize the temperature-aware cross-entropy loss function. The training process includes the following steps:
[0218] Forward propagation calculates the predicted probability distribution of the predicted output samples;
[0219] Calculate temperature-aware cross entropy loss function;
[0220] Backpropagation updates all trainable parameters, such as, 、 、 、 、 The weight matrix, and 、 Bias vector;
[0221] Iterative training.
[0222] S6. Stop iterative condition judgment
[0223] The termination criterion of the training process is that the fluctuation range of the loss function is less than 0.05 for 15 consecutive iterations, or the preset maximum number of iterations is reached, for example, the preset maximum number of iterations is 1000.
[0224] S7. Model Reasoning
[0225] During the deployment phase, a real-time processing path is constructed. Specifically, the raw pressure-temperature flow data is input. After data preprocessing, dynamic temperature drift compensation preprocessing, adaptive noise filtering, and feature enhancement processing are performed in sequence, the resulting time series segments are input into the trained bidirectional temperature-gated recurrent network model. The output layer generates a fault probability vector, and the fault category with the largest probability value is taken as the final output result.
[0226] It should be noted that during the model inference stage, the predicted probability distribution cannot be calculated, so there is no need to perform predicted probability distribution correction operations.
[0227] In one embodiment, Figure 4 As shown in the figure, the cross-temperature generalization capability is compared through the average accuracy distribution of 7 temperature ranges. The experimental results show that the traditional method has a significant performance drop at the two ends of the temperature range (below zero and high temperature of 60°C), while the histogram of the proposed method presents a stable high-level platform, and the height difference of each column is less than 5%. This proves that the temperature condition masking mechanism and Bayesian correction effectively decouple the fault characteristics and temperature interference, and solve the misjudgment problem of the traditional method at extreme temperatures.
[0228] In this embodiment, dynamic temperature drift compensation is achieved, avoiding the problem that traditional static linear transformation cannot distinguish between temperature changes and sudden fault changes; while suppressing noise interference, potential fault characteristics are retained, and the expression of key abnormal points is enhanced; the response capability to sudden faults is effectively improved; temperature drift and fault characteristics are effectively decoupled, ensuring that the network does not depend on specific temperature conditions, and enhancing the adaptability of the model to different temperature scenarios; the accuracy of fault prediction is improved, and the prediction error caused by temperature changes is reduced.
[0229] The embodiments described above are merely descriptions of preferred implementations of the present invention and are not intended to limit the scope of the present invention. Without departing from the spirit of the present invention, various modifications and improvements made to the technical solutions of the present invention by ordinary technicians in this field should fall within the scope of protection determined by the claims of the present invention.
Claims
1. A method for processing pressure gauge temperature data based on temperature calibration drift error compensation, characterized in that: include: S1, data acquisition, synchronously collects the original pressure readings and ambient temperature time series data of the industrial pressure gauge through the pressure sensor and thermocouple temperature sensor; S2, data preprocessing, including temperature and pressure synchronization verification and outlier processing; S3, dynamic temperature drift compensation preprocessing, constructing a learnable compensation function based on temperature deviation and temperature change rate to achieve dynamic compensation of nonlinear drift; The construction of a learnable compensation function based on temperature deviation and temperature change rate includes: calculating a drift baseline term based on the difference between the original pressure reading, the real-time temperature value, and the reference temperature, in combination with a drift compensation bias term and a linear coefficient term; then adaptively adjusting the compensation amount by combining an adjustment factor that exponentially decays with the temperature change rate; and obtaining a pressure compensation value after removing the temperature drift by subtracting the calculated compensation amount from the original pressure reading; S4, adaptive noise filtering and feature enhancement, extracts frequency domain coefficients at each scale through multi-layer discrete wavelet transform, calculates the adaptive threshold of each layer according to the temperature change rate at the current moment, combines the soft threshold function to perform nonlinear compression processing on the wavelet coefficients, and uses the reconstructed wavelet basis function to inverse transform the processed coefficients to restore them to the time domain signal, obtaining the pressure time series output after noise reduction; S5. Pressure gauge temperature data modeling. This specifically includes: generating a temperature gating vector based on the joint encoding of the current temperature information with the historical hidden state and pressure signal, and constructing a bidirectional temperature-gated recurrent network structure model based on the temperature gating vector. This model includes a feature decoupling layer, and implements temperature-conditional mask regularization based on the feature decoupling layer. By calculating the gradient matrix of the hidden state with respect to the real-time temperature value and obtaining its Frobenius norm, a sensitivity scalar value representing the temperature dependence of the feature is obtained. Based on the sensitivity scalar value, the baseline discard rate is dynamically scaled, and a temperature-conditional mask vector is generated through Bernoulli sampling to achieve high-probability discarding of highly sensitive features. By fusing the original hidden state with the temperature average feature vector and performing weighted synthesis using the mask vector, a regularized hidden state that decouples temperature interference is obtained, forcing the network to learn the essential characteristics of temperature-independent faults. S6, stop iterating condition judgment; S7. Model reasoning.
2. The method for processing pressure gauge temperature data based on temperature calibration drift error compensation according to claim 1, characterized in that: The temperature and pressure synchronization verification adopts a spatiotemporal alignment method, based on the time series characteristics of the temperature and pressure data, combined with the temperature change rate and timestamp information, and synchronizes the data of the two through interpolation.
3. The method for processing pressure gauge temperature data based on temperature calibration drift error compensation according to claim 2, characterized in that: The pressure compensation value is calculated as follows: ; Where, is the pressure value after compensation, is the raw pressure reading; is the real-time temperature value; is the reference temperature; is the temperature change rate; is the drift compensation bias term; is the drift compensation linear coefficient; It is a temperature mutation inhibitor.
4. The method for processing pressure gauge temperature data based on temperature calibration drift error compensation according to claim 1, characterized in that: The adaptive noise filtering and feature enhancement are expressed as: ; Where, is the pressure time series signal after noise reduction; Indicates the Temperature-adaptive thresholding of layer wavelet coefficients; To reconstruct the wavelet basis function, Signal reconstruction of layer wavelet coefficients; is the soft threshold function; is the discrete wavelet transform operator, outputting The wavelet coefficients of the layer; is the pressure value after compensation.
5. The method for processing pressure gauge temperature data based on temperature calibration drift error compensation according to claim 4, characterized in that: The calculation method is expressed as ; is the pressure value after compensation; is a symbolic function.
6. The method for processing pressure gauge temperature data based on temperature calibration drift error compensation according to claim 1, characterized in that: The S5 includes: The core layer of the bidirectional temperature-gated recurrent network structure model performs data processing, the feature decoupling layer performs fault feature decoupling regularization, and the output layer performs result output, prediction probability distribution correction, calculation of temperature-aware cross-entropy loss function, backpropagation and parameter update.
7. The method for processing pressure gauge temperature data based on temperature calibration drift error compensation according to claim 6, characterized in that: The predicted probability distribution correction includes performing a temperature-aware Bayesian correction operation through a temperature binning prior matrix.
8. The method for processing pressure gauge temperature data based on temperature calibration drift error compensation according to claim 6, characterized in that: The temperature-aware cross entropy loss function is calculated as follows: ; Where, is the temperature-aware cross entropy loss function; is the total number of training samples; For the The true fault category of each sample is one-hot encoded; After correction The predicted probability distribution of samples; is the KL divergence; is the empirical probability of failure under temperature bin conditions; is the global failure prior probability; is the balance weight of the KL divergence penalty term; The center value of the target temperature bin.
Citation Information
Patent Citations
A gas flow meter anomaly detection method based on machine learning
CN119760592A
Ultrasonic water meter fault prediction system based on machine learning
CN119782759A
A method for predicting errors of digital temperature and humidity instruments in workshops based on machine learning
CN119783060A
Three-dimensional positioning method based on Kalman filtering algorithm and positioning system thereof
CN111854762A
Temperature compensation method, circuit and device of pressure sensor
CN116593060A