Temperature compensation method for pressure sensor

By establishing benchmark parameters and real-time temperature sequence prediction in the pressure sensor, and combining dynamic feature matching and template fusion, the measurement accuracy problem of the traditional static temperature compensation model under dynamic temperature conditions is solved, achieving higher measurement accuracy and response capability.

CN121347052BActive Publication Date: 2026-07-03NORTHERN SCI & TECH (BEIJING) TECH DEV CO LTD

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
NORTHERN SCI & TECH (BEIJING) TECH DEV CO LTD
Filing Date
2025-09-30
Publication Date
2026-07-03

Smart Images

  • Figure CN121347052B_ABST
    Figure CN121347052B_ABST
Patent Text Reader

Abstract

The application provides a temperature compensation method of a pressure sensor, comprising the following steps: applying a plurality of known pressures to the pressure sensor at a plurality of steady-state temperatures, and collecting corresponding output voltages of the pressure sensor at each steady-state temperature and known pressure; determining reference parameters of the pressure sensor for temperature compensation according to a mapping relationship among the steady-state temperature, the known pressure and the output voltage; continuously collecting environmental temperature data of the pressure sensor at a preset frequency during real-time operation of the pressure sensor, and forming a temperature sequence; predicting a temperature change trend of a future time period according to the temperature sequence; and obtaining a pressure value after dynamic temperature compensation based on the output voltage of the pressure sensor at the current time, the temperature change trend and the reference parameters, so that the hysteresis of the traditional static temperature compensation when the temperature dynamically changes is effectively overcome, and the measurement accuracy and the dynamic response capability of the pressure sensor under complex variable-temperature working conditions are significantly improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of pressure sensor technology, and in particular to a method for temperature compensation of a pressure sensor. Background Technology

[0002] Pressure sensors, as key devices that convert pressure signals into measurable electrical signals, are widely used in industrial control, automotive electronics, aerospace, and medical equipment. However, the material properties of the core sensing elements of pressure sensors (such as strain gauges and silicon diaphragms) are easily affected by changes in ambient temperature. This causes the sensor's output voltage to be related not only to the applied pressure but also to its own temperature. This temperature drift effect introduces significant measurement errors, severely limiting the measurement accuracy and reliability of sensors under wide temperature fields or conditions of drastic temperature fluctuations.

[0003] Traditional temperature compensation methods often rely on calibration at multiple steady-state temperature points to establish a static compensation model of temperature-pressure-output. However, in practical applications, especially in scenarios such as engine compartments and fluid pipelines, temperature is often dynamically changing, making it difficult for pressure sensors to reach thermal equilibrium. In such cases, traditional static compensation models cannot accurately track and respond to rapid temperature changes, leading to compensation lag or even new errors. Summary of the Invention

[0004] This invention provides a temperature compensation method for pressure sensors to solve the technical problem that the measurement accuracy of traditional static temperature compensation models in the prior art is significantly reduced due to compensation lag under dynamic temperature conditions.

[0005] On one hand, the present invention provides a temperature compensation method for a pressure sensor, comprising:

[0006] At multiple steady-state temperatures, multiple known pressures are applied to the pressure sensor, and the output voltage of the pressure sensor at each steady-state temperature and known pressure is collected.

[0007] Based on the mapping relationship between steady-state temperature, known pressure, and output voltage, the reference parameters for temperature compensation of the pressure sensor are determined.

[0008] During the real-time operation of the pressure sensor, ambient temperature data is continuously collected at a preset frequency to form a temperature sequence;

[0009] Based on the temperature sequence, predict the temperature change trend in the future time period;

[0010] Based on the current output voltage and temperature change trend of the pressure sensor, as well as the reference parameters, the pressure value after dynamic temperature compensation is obtained.

[0011] According to the present invention, a temperature compensation method for a pressure sensor predicts the temperature change trend over a future time period based on a temperature sequence, comprising:

[0012] The window dynamic features of the temperature sequence are extracted based on the sliding time window; the window dynamic features include the current temperature gradient, temperature fluctuation frequency, and temperature change acceleration.

[0013] The window dynamic features are matched with a pre-established temperature change pattern library; the temperature change pattern library contains temperature change templates under various operating conditions, and each template is associated with a corresponding temperature prediction function.

[0014] When the matching degree is higher than the first threshold, the temperature prediction function corresponding to the template with the highest matching degree is used to predict the trend.

[0015] When the matching degree is lower than the first threshold but higher than the second threshold, a prediction function that integrates multiple matching templates is used to predict the trend.

[0016] According to the temperature compensation method for a pressure sensor provided by the present invention, the temperature change pattern library is constructed using the following steps:

[0017] Collect temperature sequences of ambient temperature over time for pressure sensors in various working scenarios;

[0018] For each temperature sequence, time-domain and trend features are extracted to obtain a dynamic feature vector;

[0019] Based on dynamic feature vectors, cluster analysis is performed on all temperature sequences to generate multiple temperature change templates; each temperature change template represents a type of temperature change pattern.

[0020] For each temperature change template, the optimal prediction function is trained and determined based on its corresponding historical temperature sequence data.

[0021] Each temperature change template is associated with its corresponding optimal prediction function and stored to construct a temperature change model library.

[0022] According to the present invention, a temperature compensation method for a pressure sensor is provided, which performs cluster analysis on all temperature sequences based on dynamic feature vectors to generate multiple temperature change templates, including:

[0023] Clustering is performed on all dynamic feature vectors to group temperature sequences with similar changing trends into the same cluster;

[0024] Calculate the centroid of all dynamic feature vectors within each cluster, and define the centroid as the template feature vector corresponding to the cluster;

[0025] The template feature vector of each cluster is associated with the temperature-time curve of the temperature sequence within the cluster to form a temperature change template.

[0026] A temperature compensation method for a pressure sensor according to the present invention, which extracts window dynamic features of a temperature sequence based on a sliding time window, includes:

[0027] Within the sliding time window, the first-order difference of continuous temperature sampling points is calculated to obtain the current temperature gradient;

[0028] By analyzing the oscillation of temperature values ​​around their mean within a sliding time window, the frequency of temperature fluctuations can be obtained.

[0029] Calculate the first difference of the current temperature gradient within the sliding time window to obtain the acceleration of temperature change;

[0030] The dynamic characteristics of the window are composed of the current temperature gradient, the frequency of temperature fluctuations, and the acceleration of temperature changes.

[0031] According to the temperature compensation method for a pressure sensor provided by the present invention, when the matching degree is lower than a first threshold but higher than a second threshold, a trend prediction is performed by fusing prediction functions of multiple matching templates, including:

[0032] Multiple temperature change templates with similarity higher than the second threshold were selected;

[0033] Weights are assigned based on the similarity of each template; where the weights are directly proportional to the similarity.

[0034] The prediction functions corresponding to the selected templates are weighted and fused to obtain a comprehensive prediction function.

[0035] Trend forecasting is based on a comprehensive forecasting function.

[0036] A temperature compensation method for a pressure sensor provided by the present invention further includes:

[0037] The temperature change model library is updated online, including:

[0038] During the real-time operation of the pressure sensor, the error between the predicted temperature and the actual measured temperature is continuously monitored;

[0039] When the error continues to exceed the set tolerance and the matching degree between the window dynamic features and all existing templates is lower than the second threshold, it is determined that a new temperature change pattern that has not been recorded has been encountered.

[0040] A newly acquired continuous temperature sequence and its corresponding window dynamic features are recorded as a temporary template, and an initial prediction function is trained for the temporary template based on the newly acquired temperature sequence data.

[0041] Once the temporary template is successfully matched and verified to reach the preset confidence level in subsequent work, it is included in the temperature change pattern library.

[0042] According to the temperature compensation method for a pressure sensor provided by the present invention, after a temporary template is successfully matched and verified to reach a preset confidence level in subsequent work, it is formally incorporated into the temperature change pattern library, including:

[0043] If, within a set time period, the number of times a temporary template is successfully matched exceeds a set threshold, and after each match, the error between the predicted temperature obtained using its prediction function and the actual temperature is less than a set tolerance, then it is considered a valid verification.

[0044] Before being added to the database, the feature vector of the temporary template is compared with the feature vector of the existing template with the highest comprehensive matching degree in the pattern library to obtain the Euclidean distance between the two.

[0045] If the Euclidean distance between the two is less than the fusion threshold, no new template will be added. Instead, the temperature sequence data corresponding to the temporary template will be merged into the dataset of the existing template.

[0046] If the Euclidean distance between the two is greater than or equal to the fusion threshold, the temporary template will be formally stored as a new independent template in the temperature change model library.

[0047] According to a temperature compensation method for a pressure sensor provided by the present invention, clustering is performed on all dynamic feature vectors to group temperature sequences with similar changing trends into the same cluster, including:

[0048] Basic similarity is calculated based on the Euclidean distance between dynamic feature vectors;

[0049] Extract the symbolic gradient sequence of the original temperature sequence corresponding to each dynamic feature vector, and calculate the directional consistency weight between the sequences;

[0050] The basic similarity is corrected using directional consistency weights to generate a weighted similarity matrix;

[0051] Cluster analysis based on weighted similarity matrix is ​​used to divide the temperature series into clusters with similar changing trends.

[0052] According to the temperature compensation method for a pressure sensor provided by the present invention, during the real-time operation of the pressure sensor, ambient temperature data is continuously collected at a preset frequency to form a temperature sequence, and the method further includes:

[0053] Virtual temperature points are introduced into the temperature series; where virtual temperature points are future temperature values ​​predicted based on historical data and current trends.

[0054] Virtual temperature points and actual collected temperature points are alternately inserted into the temperature sequence to form a mixed temperature sequence.

[0055] The temperature compensation method for pressure sensors provided by this invention establishes a reference parameter that includes a mapping relationship between steady-state temperature, known pressure and output voltage, and collects ambient temperature sequences in real time to predict future temperature change trends. Finally, compensation is performed based on the current output voltage, the predicted temperature trend and the reference parameter. This effectively overcomes the lag of traditional static temperature compensation when the temperature changes dynamically, and significantly improves the measurement accuracy and dynamic response capability of pressure sensors under complex temperature variation conditions. Attached Figure Description

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

[0057] Figure 1 This is a schematic flowchart of the temperature compensation method for a pressure sensor provided in an embodiment of the present invention;

[0058] Figure 2 This is a schematic diagram of the structure of the temperature compensation device for the pressure sensor provided in an embodiment of the present invention;

[0059] Figure 3 This is a schematic diagram of the structure of the electronic device provided in an embodiment of the present invention. Detailed Implementation

[0060] To make the objectives, technical solutions, and advantages of this invention clearer, the technical solutions of this invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some, not all, of the embodiments of this invention. All other embodiments obtained by those skilled in the art based on the embodiments of this invention without creative effort are within the scope of protection of this invention.

[0061] Figure 1 This is a schematic flowchart of the temperature compensation method for a pressure sensor provided in an embodiment of the present invention.

[0062] See Figure 1 The temperature compensation method for pressure sensors includes the following steps.

[0063] Step 101: Apply multiple known pressures to the pressure sensor at multiple steady-state temperatures, and collect the output voltage of the pressure sensor at each steady-state temperature and known pressure.

[0064] In this step, multiple steady-state temperatures refer to the set of temperature points when the sensor is in thermal equilibrium. This can be achieved by controlling the ambient temperature in a constant-temperature chamber, and is used to establish a comprehensive influence model of temperature and pressure on the output voltage. Known pressure refers to a pre-calibrated standard pressure value, which can be applied using a precision pressure generator to eliminate the influence of pressure measurement errors on the reference parameters. Output voltage acquisition refers to recording the electrical signal output of the sensor under specific temperature and pressure combinations, which can be achieved using a high-precision analog-to-digital converter, providing raw data for establishing the compensation model.

[0065] Step 102: Determine the reference parameters of the pressure sensor for temperature compensation based on the mapping relationship between steady-state temperature, known pressure and output voltage.

[0066] In this step, the mapping relationship between steady-state temperature, known pressure, and output voltage can be established through mathematical modeling. For example, polynomial fitting (e.g., using least squares to fit the temperature-pressure-output compensation model coefficients), linear regression, or neural network models can be used to analyze the collected data to extract the correlation between the three. Alternatively, a lookup table can be used to store reference output voltage values ​​for different temperature and pressure combinations. The determination of the reference parameters depends on this mapping relationship, and its specific implementation may include calculating sensitivity coefficients, offsets, or nonlinear correction factors. These parameters are used for deviation calibration in the subsequent dynamic compensation process.

[0067] Step 103: During the real-time operation of the pressure sensor, continuously collect its ambient temperature data at a preset frequency to form a temperature sequence.

[0068] In this step, the temperature sequence refers to the set of environmental temperature observations arranged in chronological order. Specifically, it can be acquired by an embedded temperature sensor at a fixed sampling frequency to capture the temporal characteristics of temperature changes.

[0069] Step 104: Based on the temperature sequence, predict the temperature change trend in the future time period.

[0070] In this step, temperature change trend prediction refers to inferring future temperature trends based on historical temperature data. Specifically, this can be achieved by using sliding window analysis combined with pattern matching algorithms, providing a forward-looking adjustment basis for dynamic compensation.

[0071] Step 105: Based on the current output voltage and temperature change trend of the pressure sensor and the reference parameters, obtain the pressure value after dynamic temperature compensation.

[0072] In this step, dynamic temperature compensation refers to adjusting the pressure calculation parameters based on real-time temperature changes. This can be achieved through interpolation algorithms combined with a prediction model to offset measurement drift caused by temperature fluctuations. Specifically, Step 1: Determine the equivalent temperature for current compensation, including: obtaining the temperature change trend over a future time period provided by temperature prediction (e.g., predicted temperature values ​​per second over the next 30 seconds); selecting a short-term future window (e.g., the next 5 seconds) related to the sensor's thermal response time from this trend; calculating the average of all predicted temperature values ​​within this short-term window; and using this average as the current equivalent compensation temperature. Step 2: Select or calculate reference parameters based on the equivalent temperature, including: calling the reference parameters established during the calibration phase (such as pressure-voltage curve coefficients at different temperature points or lookup tables); using the current equivalent compensation temperature calculated in Step 1; finding the best-matching temperature point among the reference parameters or directly substituting it into the model. Step 3: Calculate the compensated pressure value using the current output voltage and reference parameters, including: reading the actual output voltage value of the pressure sensor at the current moment, and using the reference parameters selected or calculated in Step 2 to convert the current voltage value into a pressure value (for example, using a lookup table: performing interpolation calculations to find the final pressure value from the current voltage and equivalent temperature; or, using a mathematical model: substituting the current voltage value and equivalent temperature value into the mapping relationship to directly calculate the final pressure value).

[0073] Specifically, during the laboratory calibration phase, the pressure sensor is placed within a programmable temperature control device. Pressure values ​​of 0 kPa, 50 kPa, and 100 kPa are sequentially applied using a standard pressure source at steady-state temperatures of 20°C, 40°C, and 60°C, with simultaneous recording of the sensor's output voltage. A three-dimensional surface mapping of temperature, pressure, and output voltage is fitted using the least squares method, and the temperature sensitivity coefficient is extracted as a baseline parameter. In the real-time operation phase, the embedded temperature sensor collects ambient temperature data every 0.5 seconds, constructing a sliding window sequence containing data from the most recent 30 minutes. By calculating characteristic quantities such as temperature gradient and fluctuation frequency within the window, similarity matching is performed with pre-stored typical temperature change patterns, and the optimal prediction model is selected to infer the temperature change curve for the next 5 minutes. The current output voltage is substituted into the dynamic compensation equation, and the baseline parameter is corrected in real-time based on the predicted temperature curve, ultimately outputting a pressure measurement value free from the influence of temperature.

[0074] In this embodiment, by establishing a reference parameter that includes the mapping relationship between steady-state temperature, known pressure and output voltage, and by collecting the ambient temperature sequence in real time to predict future temperature change trends, compensation is finally performed based on the current output voltage, the predicted temperature trend and the reference parameter. This effectively overcomes the lag of traditional static temperature compensation when the temperature changes dynamically, and significantly improves the measurement accuracy and dynamic response capability of the pressure sensor under complex temperature change conditions.

[0075] In one embodiment of this specification, predicting the temperature change trend over a future time period based on a temperature sequence includes:

[0076] The window dynamic features of the temperature sequence are extracted based on the sliding time window; the window dynamic features include the current temperature gradient, temperature fluctuation frequency, and temperature change acceleration.

[0077] The window dynamic features are matched with a pre-established temperature change pattern library; the temperature change pattern library contains temperature change templates under various operating conditions, and each template is associated with a corresponding temperature prediction function.

[0078] When the matching degree is higher than the first threshold, the temperature prediction function corresponding to the template with the highest matching degree is used to predict the trend.

[0079] When the matching degree is lower than the first threshold but higher than the second threshold, a prediction function that integrates multiple matching templates is used to predict the trend.

[0080] In this embodiment, the sliding time window refers to the dynamic analysis interval used to extract the most recent continuous time data from the temperature sequence. Specifically, it can be implemented by periodically sliding a fixed-length time interval to capture the real-time dynamic characteristics of temperature changes. The window dynamic features refer to the instantaneous change attributes of the temperature sequence within the sliding window, which can be extracted through difference calculations and frequency domain analysis to characterize the rate of temperature change, fluctuation patterns, and acceleration information. The temperature change pattern library is a database storing typical temperature change patterns and their prediction methods under different operating conditions. It can be constructed through historical data clustering and prediction model training to provide the prediction strategy that best matches the current dynamic features. The matching degree is a quantitative indicator of the similarity between the current dynamic features and the template features, which can be implemented using cosine similarity or Euclidean distance calculations to select suitable prediction functions.

[0081] Specifically, in the temperature prediction process, the latest segment of the real-time temperature sequence is first extracted using a sliding window. The first-order difference of the temperature within the window is calculated to obtain the temperature gradient. The oscillation frequency of the temperature value around the mean is analyzed, and the difference of the gradient is further calculated to obtain the acceleration of temperature change. These features together constitute the dynamic feature vector of the window. Subsequently, this vector is matched with the features of each template in the pattern library for similarity. When a template with a matching degree higher than a first threshold is found, its associated prediction function is directly called for extrapolation prediction. If the matching degree does not reach the first threshold but is higher than the second threshold, multiple templates with high similarity are selected, and their prediction functions are weighted and fused according to similarity weights to generate a comprehensive prediction result. This realizes a differentiated prediction strategy for different temperature change patterns, improving prediction accuracy.

[0082] In this embodiment, by establishing a model library and introducing a dynamic feature matching mechanism, the optimal prediction strategy can be automatically selected for different operating conditions, maintaining prediction accuracy even when temperatures change rapidly. By fusing the prediction results of multiple models, prediction errors caused by model matching bias can be effectively reduced. This application can solve the compensation lag problem caused by the inability to track rapid temperature changes.

[0083] In one embodiment of this specification, the temperature change pattern library is constructed using the following steps:

[0084] Collect temperature sequences of ambient temperature over time for pressure sensors in various working scenarios;

[0085] For each temperature sequence, time-domain and trend features are extracted to obtain a dynamic feature vector. The dynamic feature vector includes the initial heating rate, steady-state fluctuation range, temperature rise acceleration, temperature fall acceleration, and periodic change frequency.

[0086] Based on dynamic feature vectors, cluster analysis is performed on all temperature sequences to generate multiple temperature change templates; each temperature change template represents a typical temperature change pattern.

[0087] For each temperature change template, the optimal prediction function is trained and determined based on its corresponding historical temperature sequence data. The prediction function is selected from the candidate function set, which includes linear extrapolation model, multinomial fitting model and lightweight time series prediction model. The optimal prediction function is the function with the smallest prediction error on the template data.

[0088] Each temperature change template is associated with its corresponding optimal prediction function and stored to construct a temperature change model library.

[0089] In this embodiment, the dynamic feature vector refers to the set of parameters reflecting temperature change characteristics extracted from the temperature sequence using mathematical methods. Specifically, it can be implemented using difference operations, spectral analysis, and statistical calculations. For example, the initial heating rate can be obtained by calculating the temperature difference between adjacent time points, and the steady-state fluctuation range can be obtained by calculating the temperature standard deviation. This vector can comprehensively characterize the core features of the temperature change pattern. Cluster analysis refers to the method of classifying temperature sequences with similar characteristics. Specifically, it can be implemented using the k-means algorithm or hierarchical clustering algorithm. Data grouping is achieved by measuring the similarity of the dynamic feature vectors, thereby summarizing complex temperature change patterns into typical categories. The candidate function set refers to the combination of available prediction models. Specifically, it can be implemented using linear regression, quadratic polynomial fitting, or LSTM neural networks. Different models have differentiated predictive advantages under different change patterns. By comparing errors, the prediction function most suitable for a specific temperature change template can be selected.

[0090] Specifically, the ambient temperature changes during the operation of pressure sensors exhibit diverse characteristics. By collecting temperature time series data under different industrial scenarios, such as rapid temperature rise in engine compartments and periodic fluctuations in pipeline fluid temperature, a data foundation covering various actual temperature change patterns is established. When extracting features from each temperature series, a multi-dimensional feature vector is formed by calculating the initial temperature rise slope, the fluctuation amplitude in the stable phase, the acceleration parameter of temperature change, and the frequency value of periodic changes. These feature vectors are input into a clustering algorithm to group temperature series with similar change patterns into the same cluster. The centroid of each cluster represents the core feature of that category's temperature change template. For the historical temperature data corresponding to each template, linear extrapolation, multinomial fitting, and lightweight neural networks are used to test prediction performance. The model with the smallest mean absolute error is selected as the dedicated prediction function for that template. Finally, the template features are associated with and stored with the corresponding optimal prediction function, forming a prediction model library covering multiple temperature change patterns.

[0091] In this embodiment, a classification prediction mechanism is established to dynamically match the optimal prediction function for different temperature change patterns, ensuring both prediction accuracy and optimized computational efficiency. This application effectively solves the problem of poor adaptability of prediction models in dynamic temperature compensation, and can automatically select the most suitable prediction algorithm based on temperature change characteristics. During the rapid warm-up phase of engine cold start, the system can automatically match a linear extrapolation model for prediction; in the scenario of periodic temperature fluctuations in the hydraulic system, a multinomial fitting model is used to capture the fluctuation pattern. This classification prediction mechanism significantly improves the accuracy of temperature trend prediction.

[0092] In one embodiment of this specification, cluster analysis is performed on all temperature sequences based on dynamic feature vectors to generate multiple temperature change templates, including:

[0093] Clustering is performed on all dynamic feature vectors to group temperature sequences with similar changing trends into the same cluster;

[0094] Calculate the centroid of all dynamic feature vectors within each cluster, and define the centroid as the template feature vector corresponding to that cluster;

[0095] The template feature vector of each cluster is associated with the typical temperature-time curve of the temperature sequence within that cluster to form a temperature change template.

[0096] In this embodiment, the dynamic feature vector refers to a multi-dimensional data set obtained through time-domain analysis and trend feature extraction. Specifically, it can be implemented using a combination of parameters such as initial heating rate, steady-state fluctuation range, temperature rise acceleration, temperature fall acceleration, and periodic change frequency, used to characterize the dynamic behavior pattern of the temperature sequence. Clustering refers to the process of classifying temperature sequences with similar dynamic features. Specifically, it can be implemented using a similarity matrix corrected by Euclidean distance calculation combined with directional consistency weighting, used to identify common patterns in temperature change. The centroid refers to the average value of the dynamic feature vectors within a cluster, specifically calculated by the arithmetic mean of the parameters in each dimension, used to generate standardized features representing the temperature change pattern of that cluster. The typical temperature-time curve refers to the actual temperature change trajectory within the cluster temperature sequence that is closest to the centroid feature, specifically obtained through a similarity matching algorithm, used to visually display the temperature change pattern corresponding to the template.

[0097] Specifically, in constructing the temperature change pattern library, the collected temperature sequences are first dynamically feature-extracted to form dynamic feature vectors containing multi-dimensional parameters. Then, based on the similarity calculation between feature vectors, a clustering algorithm is used to divide the temperature sequences into multiple clusters, each representing a type of temperature pattern with similar changing trends. By calculating the centroid of all feature vectors within a cluster, a template feature vector representing the core features of that cluster is generated. Further, the actual temperature sequence with the highest centroid matching degree is selected from within the cluster, and its temperature-time curve is used as a typical example, forming a complete temperature change template together with the template feature vector. The resulting template contains both abstract feature parameters and retains intuitive information about specific temperature change trajectories, providing multi-dimensional matching basis for subsequent temperature trend prediction.

[0098] In this embodiment, by combining multidimensional dynamic feature vectors with cluster analysis, temperature change patterns under different operating conditions can be effectively distinguished, such as typical scenarios like rapid heating, periodic fluctuations, or gradual cooling. Simultaneously, by introducing directional consistency weights to correct similarity calculations, the misjudgment of patterns that may arise from relying solely on Euclidean distance is avoided, thus improving the accuracy of temperature change pattern segmentation. This application enables refined classification of complex temperature change patterns, providing a more accurate reference template for temperature prediction under different operating conditions. By combining a dual representation method of centroid feature vectors and typical temperature curves, both the abstract generalization ability of the template and the physical meaning of the actual temperature change process are preserved, thereby significantly improving the reliability and adaptability of temperature change trend prediction.

[0099] In one embodiment of this specification, extracting window dynamic features of a temperature sequence based on a sliding time window includes:

[0100] Within the sliding time window, the first-order difference of continuous temperature sampling points is calculated to obtain the current temperature gradient;

[0101] By analyzing the oscillation of temperature values ​​around their mean within a sliding time window, the frequency of temperature fluctuations can be obtained.

[0102] Calculate the first difference of the current temperature gradient within the window to obtain the acceleration of temperature change;

[0103] The dynamic characteristics of the window are composed of the current temperature gradient, the frequency of temperature fluctuations, and the acceleration of temperature changes.

[0104] In this embodiment, the current temperature gradient refers to the rate of change between adjacent temperature sampling points. Specifically, it can be calculated by comparing the temperature difference between two consecutive sampling points with their time interval, for example, using backward difference or central difference methods, to characterize the temperature's upward or downward trend over a short period. Temperature fluctuation frequency refers to the frequency with which the temperature fluctuates around its mean within a window. Specifically, it can be achieved by analyzing the spectral energy distribution of the temperature sequence using Fast Fourier Transform, or by calculating the number of times the temperature crosses the mean per unit time, reflecting the periodic oscillation characteristics of the temperature. Temperature change acceleration refers to the rate of change of the temperature gradient over time. Specifically, it can be obtained by further differencing the temperature gradient sequence, for example, using the second-order difference method, to describe whether the temperature change trend exhibits acceleration or deceleration.

[0105] Specifically, during the real-time operation of the pressure sensor, the latest temperature sampling point sequence is continuously captured through a sliding time window. For example, when the window length is 10 seconds and the sampling frequency is 10Hz, the window contains 100 temperature data points. First, a first-order difference calculation is performed on adjacent temperature points within the window to obtain the temperature gradient value at each time point, and the gradient value at the end of the window is taken as the current temperature gradient. Subsequently, the mean of all temperature points within the window is calculated, and the number of times the temperature value fluctuates around the mean is counted. Combined with the window duration, the temperature fluctuation frequency is calculated. Further, the temperature gradient sequence is subjected to another difference operation to obtain the acceleration value of temperature change. Finally, the current temperature gradient, temperature fluctuation frequency, and temperature change acceleration are combined into a dynamic feature vector for the window, which is used for subsequent temperature trend prediction.

[0106] In this embodiment, multi-dimensional feature extraction within a sliding window simultaneously characterizes the trend, fluctuation characteristics, and acceleration of temperature changes, providing richer dynamic information for subsequent prediction models. For example, in scenarios where temperatures rise rapidly and are accompanied by high-frequency fluctuations, the acceleration features extracted by this solution can provide early warning of the risk of sudden temperature changes, while traditional methods may lead to prediction lag due to neglecting acceleration information. This application can capture the dynamic characteristics of temperature changes in real time, especially under conditions of drastic temperature fluctuations or sudden temperature trends. By combining gradient, frequency, and acceleration features, it significantly improves the response speed and accuracy of temperature change trend prediction, thereby providing a reliable data foundation for dynamic temperature compensation. For example, during the rapid temperature rise in the cold start phase of an engine, this solution can identify changes in the heating acceleration in advance, dynamically adjust compensation parameters, and avoid pressure measurement deviations caused by sudden temperature changes.

[0107] In one embodiment of this specification, when the matching degree is lower than a first threshold but higher than a second threshold, a prediction function that fuses multiple matching templates is used for trend prediction, including:

[0108] Multiple temperature change templates with similarity higher than the second threshold were selected;

[0109] Weights are assigned based on the similarity of each template, with the weights being directly proportional to the similarity.

[0110] The prediction functions corresponding to the selected templates are weighted and fused to obtain a comprehensive prediction function.

[0111] Trend forecasting is based on a comprehensive forecasting function.

[0112] In this embodiment, the matching threshold refers to a pre-set similarity standard used to filter suitable temperature change templates. It can be determined using statistical analysis methods or empirical values, and its purpose is to avoid prediction failure caused by a single template mismatch. Similarity allocation weights dynamically adjust the contribution of a template in the fusion process based on its matching degree with the current feature. Normalized similarity values ​​can be used as weighting coefficients, thereby ensuring that templates with high matching degrees have a greater influence on the prediction results. Weighted fusion refers to superimposing the outputs of multiple prediction functions according to their weights. This can be done using linear weighting or a non-linear combination method, combining the advantages of different prediction models to improve the robustness of trend prediction.

[0113] Specifically, when the matching degree between the real-time acquired temperature sequence dynamic features and the existing templates in the model library is in the middle range, the system filters out multiple templates with partial similarity and calculates weights based on the similarity values ​​of each template. For example, if the similarity of three templates are 0.7, 0.6, and 0.55 respectively, and the second threshold is 0.5, then the weight allocation is 0.7 / (0.7+0.6+0.55), 0.6 / (0.7+0.6+0.55), and 0.55 / (0.7+0.6+0.55). Subsequently, the prediction function outputs corresponding to each template are superimposed according to the weights to generate a comprehensive prediction curve. This process, by dynamically adjusting the contribution ratio of multiple models, can adapt to the transitional state of temperature changes and avoid compensation errors caused by the prediction bias of a single model.

[0114] In this embodiment, a multi-template fusion mechanism effectively utilizes the correlation information in the historical pattern library even in partially matched scenarios, significantly improving the continuity of prediction results. For example, in cases of rapid temperature fluctuations but incomplete matching, this solution uses weighted fusion to smooth the transition, making the prediction curve more closely match the actual trend. This application can achieve more stable trend prediction during dynamic temperature changes, reducing compensation lag caused by insufficient template matching, thereby improving the measurement accuracy of pressure sensors under complex operating conditions. For example, during the engine cold start phase, when the temperature exhibits a non-steady-state rise and its fluctuation characteristics are partially similar to historical patterns, this solution, by fusing the prediction results of multiple temperature rise templates, can accurately capture the trend of accelerated temperature rise, avoiding pressure value compensation deviations caused by insufficient prediction from a single model.

[0115] In one embodiment of this specification, the method further includes the step of online self-updating of the temperature change pattern library:

[0116] During the real-time operation of the pressure sensor, the error between the predicted temperature and the actual measured temperature is continuously monitored;

[0117] When, in a specific working scenario, the error continues to exceed the set tolerance and the matching degree between the window dynamic features and all existing templates is lower than the second threshold, it is determined that a new temperature change pattern that has not been recorded has been encountered.

[0118] A newly acquired continuous temperature sequence and its corresponding window dynamic features are recorded as a temporary template, and an initial prediction function is trained based on this newly acquired temperature sequence data for the temporary template.

[0119] Once the temporary template is successfully matched and verified to reach the preset confidence level in subsequent work, it will be formally incorporated into the temperature change pattern library.

[0120] In this embodiment, the set tolerance refers to the pre-defined maximum allowable deviation range between the predicted temperature and the actual temperature. Specifically, it can be determined by statistical analysis methods using percentile truncation of historical error data, used to determine whether a new pattern recognition process needs to be initiated. The temporary template refers to a candidate template dynamically generated from the current temperature sequence. Specifically, it can be implemented by extracting the window dynamic features of the current temperature sequence and constructing an initial prediction function, used to temporarily store new temperature change patterns not covered by the pattern library. The pre-set reliability refers to the minimum reliability index for a temporary template to be verified as valid. Specifically, it can be quantified by setting a matching count threshold and an error accumulation threshold, used to ensure the stability of newly added templates.

[0121] Specifically, during the operation of the pressure sensor, the error between the predicted temperature and the actual temperature is calculated and recorded in real time. If the error exceeds the tolerance value for multiple consecutive sampling periods, and the dynamic characteristics of the current temperature sequence cannot fully match any template in the pattern library, a new pattern recognition mechanism is triggered. At this time, the current temperature sequence is automatically extracted, its dynamic characteristics are extracted, and an initial prediction function is generated to form a temporary template. When the temporary template is called multiple times in subsequent operations and the prediction error is always below the tolerance, its effectiveness is verified, and it is finally integrated into the pattern library, completing the self-updating process.

[0122] In this embodiment, by dynamically monitoring errors and autonomously generating temporary templates, unknown temperature change patterns can be captured in real time. A progressive verification mechanism ensures the reliability of newly added templates, thereby improving the system's adaptability to complex operating conditions. This application realizes online expansion and optimization of the temperature change pattern library, solving the problem of decreased compensation accuracy caused by pattern loss in dynamic temperature scenarios, and effectively improving the measurement stability of pressure sensors in environments with drastic temperature fluctuations.

[0123] In one embodiment of this specification, once the temporary template is successfully matched and verified to reach a preset confidence level in subsequent work, it is formally incorporated into the temperature change pattern library, specifically including:

[0124] If, within a set time period, the number of times a temporary template is successfully matched exceeds a set threshold, and after each match, the error between the predicted temperature obtained using its prediction function and the actual temperature is less than a set tolerance, then it is considered a valid verification.

[0125] Before being added to the database, the feature vector of the temporary template is compared with the feature vector of the existing template with the highest comprehensive matching degree in the pattern library. If the Euclidean distance between the two is less than the fusion threshold, no new template is added. Instead, the temperature sequence data corresponding to the temporary template is merged into the dataset of the existing template, and the prediction function of the existing template is retrained and optimized.

[0126] If the distance is greater than or equal to the fusion threshold, the temporary template will be officially stored as a new independent template in the temperature change pattern library.

[0127] In this embodiment, the set time period refers to a predefined time range used to count the number of times a temporary template is successfully matched. This can be implemented using a fixed number of days or working hours, such as 72 consecutive hours or 50 cumulative hours. Its purpose is to ensure the stability and reliability of the temporary template. Effective verification refers to the process where the temporary template meets the prediction accuracy requirements in multiple practical applications. This can be achieved by calculating whether the mean square error between the predicted temperature and the actual temperature is lower than a set threshold. Its purpose is to filter out templates with practical application value. The fusion threshold is a critical value used to determine whether a temporary template and an existing template belong to the same type of change pattern. This can be determined through historical data analysis or experimental calibration, for example, set to the 80th percentile of the Euclidean distance between the feature vectors. Its purpose is to avoid storing redundant templates in the pattern library while retaining new patterns with significant differences.

[0128] Specifically, when a temporary template is matched multiple times within a set period and the prediction error remains below the tolerance, the system automatically triggers a verification process. At this point, the similarity between the temporary template's feature vector and the existing template is determined by calculating the Euclidean distance. If the distance is less than the fusion threshold, it indicates that the temporary template and the existing template belong to the same pattern. In this case, the temporary template's data is merged into the existing template dataset, and the prediction function is retrained based on the expanded data, thereby optimizing the prediction performance of the existing template. If the distance exceeds the threshold, the temporary template is stored as an independent new template in the pattern library to expand the system's adaptability to unknown temperature change patterns.

[0129] In this embodiment, by dynamically evaluating the similarity between temporary templates and existing templates, similar templates are effectively merged and their prediction functions are optimized while ensuring pattern diversity. This reduces storage resource consumption and improves the generalization ability of the prediction model. This application can dynamically optimize the temperature change pattern library according to actual application scenarios, avoid template redundancy when adding unknown temperature patterns, and continuously improve the prediction accuracy of existing templates through data merging and model retraining, thereby enhancing the dynamic compensation effect of pressure sensors in complex temperature environments.

[0130] In one embodiment of this specification, clustering is performed on all dynamic feature vectors to group temperature sequences with similar changing trends into the same cluster, including:

[0131] Basic similarity is calculated based on the Euclidean distance between dynamic feature vectors;

[0132] Extract the symbolic gradient sequence of the original temperature sequence corresponding to each dynamic feature vector, and calculate the directional consistency weight between the sequences;

[0133] The basic similarity is corrected using directional consistency weights to generate a weighted similarity matrix;

[0134] Cluster analysis based on weighted similarity matrix is ​​used to divide the temperature series into clusters with similar changing trends.

[0135] In this embodiment, the dynamic feature vector refers to a multidimensional data set representing the temperature sequence change pattern obtained through time-domain analysis and trend feature extraction. Specifically, it can be implemented using a combination of parameters such as initial heating rate, steady-state fluctuation range, temperature rise acceleration, temperature fall acceleration, and periodic change frequency, used to quantify the dynamic characteristics of different temperature sequences. The symbolic gradient sequence refers to converting the continuous change trend of the original temperature sequence into a discrete sequence represented by symbols. Specifically, it can be implemented by encoding the slope direction with positive and negative signs after piecewise linear fitting, used to capture the macroscopic trend characteristics of temperature changes. The directional consistency weight is a correction coefficient reflecting the similarity of different temperature sequences in their overall change trend. Specifically, it can be determined by calculating the proportion of matching symbol positions in the symbolic gradient sequence, used to enhance the correlation between temperature sequences with the same change direction.

[0136] Specifically, the clustering process first calculates the Euclidean distance between dynamic feature vectors as the basic similarity, reflecting the closeness of temperature sequences in the static feature dimension. Next, the symbolic gradient sequences of the original temperature sequences are extracted, and directional consistency weights are generated by comparing the matching degree of sign changes in each sequence. These weights characterize the similarity of temperature sequences in their dynamic trends. The directional consistency weights are then multiplied by the basic similarity to generate a weighted similarity matrix that integrates static features and dynamic trends. Clustering analysis based on this matrix considers both the local feature differences of the temperature sequences and the similarity of their overall trends, ensuring that temperature sequences grouped into the same cluster exhibit high consistency in both morphology and evolutionary patterns.

[0137] In some specific implementations, the generation of symbolic gradient sequences can employ a sliding window approach to segment the temperature sequence, encoding the rate of temperature change within each window with symbols, such as labeling positive slopes as "+", negative slopes as "-", and zero slopes as "0". The calculation of directional consistency weights can utilize a dynamic time warping algorithm to align symbol sequences of different lengths, using the proportion of matching symbols to the total number of symbols as the weight value. The generation of the weighted similarity matrix can employ a linear combination method, for example, superimposing the basic similarity and directional consistency weights according to a preset ratio.

[0138] In this embodiment, by introducing symbolic gradient sequences and directional consistency weights, the dual information of static features and dynamic trends is simultaneously integrated into the similarity measurement. This effectively solves the misclassification problem that may occur in traditional methods for temperature sequence clustering, where sequences may have similar morphologies but different trends, or similar trends but numerical discrepancies. This application can more accurately identify sequences with similar temperature change patterns, providing a reliable classification basis for subsequently establishing accurate temperature compensation models. Especially under dynamic operating conditions with rapid temperature fluctuations, it can significantly improve the matching degree between clustering results and actual physical scenarios, thereby enhancing the adaptability of temperature compensation models to complex temperature changes.

[0139] In one embodiment of this specification, during the real-time operation of the pressure sensor, ambient temperature data is continuously collected at a preset frequency to form a temperature sequence, and the method further includes:

[0140] Virtual temperature points are introduced into the temperature series; virtual temperature points are future temperature values ​​predicted based on historical data and current trends.

[0141] Virtual temperature points and actual collected temperature points are alternately inserted into the temperature sequence to form a mixed temperature sequence.

[0142] In this embodiment, a virtual temperature point refers to a future temperature estimate predicted based on the time-series characteristics of historical temperature data and the current temperature change trend. Specifically, it can be implemented using a temperature gradient extrapolation method within a sliding window or a lightweight time-series prediction model, such as using an ARIMA model or an LSTM network to predict the temperature values ​​for the next two sampling periods. A hybrid temperature sequence refers to a sequence formed by alternating actual and virtual temperature points in chronological order. This can be achieved using an interval insertion method, for example, inserting a virtual temperature point after each actual temperature point is collected, thus forming a sequence structure with predictive expansion.

[0143] Specifically, in the dynamic temperature compensation process, a raw temperature sequence is generated by real-time acquisition of ambient temperature data. Simultaneously, the short-term trend of this sequence is used to predict future temperature values ​​as virtual temperature points. These virtual temperature points are inserted between actual acquisition points, forming an alternating mixed sequence. The mixed sequence contains not only current and historical temperature information but also predictions of future temperature changes. In the subsequent temperature trend prediction stage, the virtual temperature points in the mixed sequence serve as early signals, allowing the compensation model to perceive the direction of temperature change in advance, thereby reducing the impact of compensation lag. For example, when an upward temperature trend is detected, the insertion of virtual temperature points allows the compensation algorithm to begin adjusting parameters before the next actual temperature point arrives, achieving synchronization between compensation actions and temperature changes.

[0144] In this embodiment, the temporal resolution of the temperature sequence is expanded by introducing virtual temperature points, enabling the compensation model to adjust parameters in advance based on predicted values, effectively shortening the system response time. This application can improve the temporal resolution of the temperature sequence without increasing the hardware sampling frequency, making the dynamic temperature compensation process forward-looking, significantly reducing compensation lag errors under conditions of drastic temperature fluctuations, and improving the real-time performance and accuracy of pressure measurement.

[0145] Based on the same general inventive concept, this invention also protects a temperature compensation device for a pressure sensor, such as... Figure 2 As shown, Figure 2 This is a schematic diagram of the temperature compensation device for a pressure sensor provided in an embodiment of the present invention. The temperature compensation device for a pressure sensor provided by the present invention will be described below, and the temperature compensation device described below can be referred to in correspondence with the temperature compensation method for a pressure sensor described above.

[0146] The temperature compensation device for the pressure sensor includes:

[0147] The pressure acquisition module 201 is used to apply multiple known pressures to the pressure sensor under multiple steady-state temperatures and to acquire the output voltage of the pressure sensor at each steady-state temperature and known pressure.

[0148] The compensation parameter module 202 is used to determine the reference parameters of the pressure sensor for temperature compensation based on the mapping relationship between steady-state temperature, known pressure and output voltage.

[0149] The temperature acquisition module 203 is used to continuously acquire ambient temperature data at a preset frequency during the real-time operation of the pressure sensor to form a temperature sequence.

[0150] The temperature prediction module 204 is used to predict the temperature change trend over a future period based on the temperature sequence.

[0151] The pressure compensation module 205 is used to obtain the pressure value after dynamic temperature compensation based on the current output voltage and temperature change trend of the pressure sensor and the reference parameters.

[0152] Figure 3 This is a schematic diagram of the structure of the electronic device provided in an embodiment of the present invention.

[0153] like Figure 3As shown, the electronic device may include a processor 310, a communication interface 320, a memory 330, and a communication bus 340. The processor 310, communication interface 320, and memory 330 communicate with each other via the communication bus 340. The processor 310 can call logic instructions stored in the memory 330 to execute a temperature compensation method for the pressure sensor.

[0154] Furthermore, the logical instructions in the aforementioned memory 330 can be implemented as software functional units and, when sold or used as independent products, can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present invention, essentially, or the part that contributes to the prior art, or a part of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute all or part of the steps of the methods described in the various embodiments of the present invention. The aforementioned storage medium includes various media capable of storing program code, such as USB flash drives, portable hard drives, read-only memory (ROM), random access memory (RAM), magnetic disks, or optical disks.

[0155] On the other hand, the present invention also provides a computer program product, the computer program product including a computer program that can be stored on a non-transitory computer-readable storage medium, and when the computer program is executed by a processor, the computer is able to execute the temperature compensation method for the pressure sensor provided by the above methods.

[0156] In another aspect, the present invention also provides a non-transitory computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the temperature compensation method for the pressure sensor provided by the methods described above.

[0157] The device embodiments described above are merely illustrative. The units described as separate components may or may not be physically separate. The components shown as units may or may not be physical units; that is, they may be located in one place or distributed across multiple network units. Some or all of the modules can be selected to achieve the purpose of this embodiment according to actual needs. Those skilled in the art can understand and implement this without any creative effort.

[0158] Through the above description of the embodiments, those skilled in the art can clearly understand that each embodiment can be implemented by means of software plus necessary general-purpose hardware platforms, and of course, it can also be implemented by hardware. Based on this understanding, the above technical solutions, in essence or the part that contributes to the prior art, can be embodied in the form of a software product. This computer software product can be stored in a computer-readable storage medium, such as ROM / RAM, magnetic disk, optical disk, etc., and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute the methods described in the various embodiments or some parts of the embodiments.

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

Claims

1. A temperature compensation method for a pressure sensor, characterized in that, include: At multiple steady-state temperatures, multiple known pressures are applied to the pressure sensor, and the output voltage of the pressure sensor at each steady-state temperature and known pressure is collected. Based on the mapping relationship between the steady-state temperature, the known pressure, and the output voltage, the reference parameters for temperature compensation of the pressure sensor are determined; During the real-time operation of the pressure sensor, ambient temperature data is continuously collected at a preset frequency to form a temperature sequence; Based on the temperature sequence, predict the temperature change trend in the future time period; Based on the temperature change trend, a short-term future window related to the sensor thermal response time is selected, and the average value of all predicted temperature values ​​within the future window is calculated. The average value is then used as the equivalent compensation temperature. By calling the reference parameters and using the equivalent compensation temperature, the best matching temperature point is found in the reference parameters. Read the actual output voltage value of the pressure sensor at the current moment, and use the reference parameter to convert the current voltage value into a pressure value.

2. The temperature compensation method for a pressure sensor according to claim 1, characterized in that, The step of predicting the temperature change trend over a future time period based on the temperature sequence includes: The window dynamic features of the temperature sequence are extracted based on a sliding time window; the window dynamic features include the current temperature gradient, temperature fluctuation frequency, and temperature change acceleration. The dynamic features of the window are matched with a pre-established temperature change pattern library; the temperature change pattern library contains temperature change templates under various operating conditions, and each template is associated with a corresponding temperature prediction function. When the matching degree is higher than the first threshold, the temperature prediction function corresponding to the template with the highest matching degree is used to predict the trend. When the matching degree is lower than the first threshold but higher than the second threshold, a prediction function that integrates multiple matching templates is used to predict the trend.

3. The temperature compensation method for a pressure sensor according to claim 2, characterized in that, The temperature change pattern library was constructed using the following steps: The temperature sequence of the ambient temperature changing over time under various working scenarios of the pressure sensor is collected; For each temperature sequence, time-domain and trend features are extracted to obtain a dynamic feature vector; Based on the dynamic feature vector, cluster analysis is performed on all temperature sequences to generate multiple temperature change templates; each temperature change template represents a type of temperature change pattern. For each temperature change template, the optimal prediction function is trained and determined based on its corresponding historical temperature sequence data. Each temperature change template is associated with and stored with its corresponding optimal prediction function to construct the temperature change pattern library.

4. The temperature compensation method for the pressure sensor according to claim 3, characterized in that, Based on the dynamic feature vector, cluster analysis is performed on all temperature sequences to generate multiple temperature change templates, including: Clustering is performed on all the dynamic feature vectors to group temperature sequences with similar changing trends into the same cluster; Calculate the centroid of all dynamic feature vectors within each cluster, and define the centroid as the template feature vector corresponding to the cluster; The template feature vector of each cluster is associated with the temperature-time curve of the temperature sequence within the cluster to form a temperature change template.

5. The temperature compensation method for a pressure sensor according to claim 2, characterized in that, The step of extracting the window dynamic features of the temperature sequence based on a sliding time window includes: Within the sliding time window, the first-order difference of continuous temperature sampling points is calculated to obtain the current temperature gradient; The temperature fluctuation frequency is obtained by analyzing the oscillation of the temperature value around its mean within the sliding time window. Calculate the first-order difference of the current temperature gradient within the sliding time window to obtain the acceleration of temperature change; The dynamic characteristics of the window are composed of the current temperature gradient, temperature fluctuation frequency, and temperature change acceleration.

6. The temperature compensation method for a pressure sensor according to claim 5, characterized in that, When the matching degree is lower than the first threshold but higher than the second threshold, a prediction function that integrates multiple matching templates is used for trend prediction, including: Multiple temperature change templates with similarity higher than the second threshold were selected; Weights are assigned based on the similarity of each template; where the weights are directly proportional to the similarity. The prediction functions corresponding to the selected templates are weighted and fused to obtain a comprehensive prediction function. Trend forecasting is based on a comprehensive forecasting function.

7. The temperature compensation method for a pressure sensor according to claim 2, characterized in that, Also includes: The online self-updating of the temperature change pattern library includes: During the real-time operation of the pressure sensor, the error between the predicted temperature and the actual measured temperature is continuously monitored; When the error continues to exceed the set tolerance and the matching degree between the window dynamic features and all existing templates is lower than the second threshold, it is determined that a new temperature change pattern that has not been recorded has been encountered. A newly acquired continuous temperature sequence and its corresponding window dynamic features are recorded as a temporary template, and an initial prediction function is trained for the temporary template based on the newly acquired temperature sequence data. Once the temporary template is successfully matched and verified to reach the preset confidence level in subsequent work, it is included in the temperature change pattern library.

8. The temperature compensation method for a pressure sensor according to claim 7, characterized in that, Once the temporary template is successfully matched and verified to reach a preset confidence level in subsequent work, it is formally incorporated into the temperature change pattern library, including: If, within a set time period, the number of times the temporary template is successfully matched exceeds a set threshold, and after each match, the error between the predicted temperature obtained using its prediction function and the actual temperature is lower than the set tolerance, then it is considered a valid verification. Before being added to the database, the feature vector of the temporary template is compared with the feature vector of the existing template with the highest comprehensive matching degree in the pattern library to obtain the Euclidean distance between the two. If the Euclidean distance between the two is less than the fusion threshold, no new template will be added. Instead, the temperature sequence data corresponding to the temporary template will be merged into the dataset of the existing template. If the Euclidean distance between the two is greater than or equal to the fusion threshold, the temporary template will be formally stored as a new independent template in the temperature change pattern library.

9. The temperature compensation method for a pressure sensor according to claim 4, characterized in that, The clustering process performed on all the dynamic feature vectors, grouping temperature sequences with similar changing trends into the same cluster, includes: Basic similarity is calculated based on the Euclidean distance between dynamic feature vectors; Extract the symbolic gradient sequence of the original temperature sequence corresponding to each dynamic feature vector, and calculate the directional consistency weight between the sequences; The basic similarity is corrected using the directional consistency weight to generate a weighted similarity matrix; Cluster analysis is performed based on the weighted similarity matrix to divide the temperature series into clusters with similar changing trends.

10. The temperature compensation method for a pressure sensor according to claim 1, characterized in that, The method of continuously collecting ambient temperature data at a preset frequency to form a temperature sequence during the real-time operation of the pressure sensor also includes: Virtual temperature points are introduced into the temperature series; where virtual temperature points are future temperature values ​​predicted based on historical data and current trends. Virtual temperature points and actual collected temperature points are alternately inserted into the temperature sequence to form a mixed temperature sequence.