Acid-base value sensor temperature compensation method, device, equipment and medium
By obtaining the linear relational parameter values of the standard buffer and calculating the temperature difference, inputting the temperature compensation model to adjust the parameters, the problems of low accuracy and poor efficiency of the traditional method are solved, and temperature compensation with higher accuracy and efficiency are achieved.
Patent Information
- Application Number
- CN202510188127.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-02-20
- Publication Date
- 2025-05-27
AI Technical Summary
The traditional pH sensor temperature compensation method has low accuracy and poor efficiency, resulting in inaccurate measurement results.
By obtaining the linear relationship parameter values of the potential value and acid-base value of multiple standard buffers at the measured temperature, the temperature difference to be compensated is calculated, and these data are input into the temperature compensation model for processing, the parameter compensation value is output, and the linear relationship parameter value is adjusted to determine the target linear relationship.
The accuracy and efficiency of temperature compensation of the pH sensor are improved, ensuring the accuracy of measurement results under different temperature conditions.
Smart Images

Figure CN120045822A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of pH sensors, and in particular to a temperature compensation method, device, equipment and medium for a pH sensor. Background Art
[0002] With the continuous development and application of pH sensor technology, using a pH sensor to measure the pH value of a solution plays an increasingly important role in various fields. The measured value of a pH sensor is easily affected by temperature changes, resulting in inaccurate measurement results, and the linear relationship between the potential value and the pH value of the pH sensor shifts, and it is necessary to compensate the parameter values of this linear relationship.
[0003] Currently, traditional temperature compensation methods can adjust the incorrect measurement results caused by temperature differences through methods such as the look-up table method and the polynomial fitting method.
[0004] However, the above traditional methods have the defects of low accuracy and poor efficiency. Summary of the Invention
[0005] The present invention provides a temperature compensation method, device, equipment and medium for a pH sensor. Embodiments of the present invention can improve the accuracy and efficiency of temperature compensation for a pH sensor.
[0006] In a first aspect, an embodiment of the present invention provides a temperature compensation method for a pH sensor, and the method includes:
[0007] Obtain the linear relationship parameter values of the potential values and pH values of multiple standard buffer solutions at the measurement temperature;
[0008] Calculate the temperature difference to be compensated between the measurement temperature and the temperature to be compensated;
[0009] Input the linear relationship parameter values and the temperature difference to be compensated into a temperature compensation model for processing, and output parameter compensation values;
[0010] Adjust the linear relationship parameter values according to the parameter compensation values to obtain target linear relationship parameter values, and determine the target linear relationship.
[0011] In a second aspect, an embodiment of the present invention further provides a temperature compensation device for a pH sensor, and the device includes:
[0012] A parameter acquisition module, configured to obtain the linear relationship parameter values of the potential values and pH values of multiple standard buffer solutions at the measurement temperature;
[0013] A temperature difference calculation module, configured to calculate the temperature difference to be compensated between the measurement temperature and the temperature to be compensated;
[0014] A compensation amount output module, configured to input the linear relationship parameter value and the temperature difference to be compensated into a temperature compensation model for processing, and output a parameter compensation value;
[0015] A relationship determination module, configured to adjust the linear relationship parameter value according to the parameter compensation value to obtain a target linear relationship parameter value, and determine a target linear relationship.
[0016] In a third aspect, an embodiment of the present invention further provides an acid-base value sensor temperature compensation device, which includes:
[0017] At least one processor; and
[0018] A memory communicatively connected to the at least one processor; wherein,
[0019] The memory stores a computer program executable by the at least one processor, and the computer program is executed by the at least one processor so that the at least one processor can execute the acid-base value sensor temperature compensation method according to any embodiment of the present invention.
[0020] In a fourth aspect, an embodiment of the present invention further provides a computer-readable storage medium, which stores computer instructions for causing a processor to implement the acid-base value sensor temperature compensation method according to any embodiment of the present invention when executed.
[0021] The technical solution of the embodiment of the present invention can provide reference data for subsequent temperature compensation by obtaining the linear relationship parameter value of the potential value and the acid-base value of the standard buffer solution at the measurement temperature; by calculating the temperature difference between the measurement temperature and the temperature to be compensated, it can provide necessary temperature change information for temperature compensation, so as to make more accurate adjustments; by inputting the linear relationship parameter value and the temperature difference into the temperature compensation model for processing, a parameter compensation value corresponding to the temperature to be compensated can be obtained, thereby realizing the compensation of temperature for acid-base value measurement; by adjusting the linear relationship parameter value, a target linear relationship can be obtained according to temperature compensation, and thus the accuracy and efficiency of acid-base value sensor temperature compensation can be improved.
[0022] It should be understood that the content described in this part is not intended to identify the key or important features of the embodiments of the present invention, nor is it used to limit the scope of the present invention. Other features of the present invention will become easily understood through the following description. Description of the Drawings
[0023] To more clearly illustrate the technical solutions in the embodiments of the present invention, the following will briefly introduce the drawings required for the description of the embodiments. Obviously, the drawings in the following description are only some embodiments of the present invention. For those of ordinary skill in the art, without creative efforts, other drawings can be obtained based on these drawings.
[0024] Figure 1 Flow chart of a pH sensor temperature compensation method provided by an embodiment of the present invention Figure 1 ;
[0025] Figure 2 Flow chart of a pH sensor temperature compensation method provided by an embodiment of the present invention Figure 2 ;
[0026] Figure 3 Structural schematic diagram of a pH sensor temperature compensation device provided by an embodiment of the present invention;
[0027] Figure 4 Structural schematic diagram of a pH sensor temperature compensation device provided by an embodiment of the present invention. Detailed implementation manners
[0028] To enable those skilled in the art to better understand the solutions of the present invention, the following will clearly and completely describe the technical solutions in the embodiments of the present invention in conjunction with the drawings in the embodiments of the present invention. Obviously, the described embodiments are only some embodiments of the present invention, rather than all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those of ordinary skill in the art without creative efforts shall fall within the protection scope of the present invention.
[0029] It should be noted that the terms "first", "second", etc. in the specification and claims of the present invention and the above-mentioned drawings are used to distinguish similar objects, and do not necessarily need to describe a specific order or sequence. It should be understood that such data can be interchanged under appropriate circumstances so that the embodiments of the present invention described herein can be implemented in an order other than those illustrated or described herein. In addition, the terms "comprising" and "having" and any variations thereof are intended to cover non-exclusive inclusion. For example, a process, method, system, product or device that includes a series of steps or units does not necessarily have to be limited to those steps or units clearly listed, but may include other steps or units not clearly listed or inherent to these processes, methods, products or devices.
[0030] In the technical solutions of the embodiments of the present invention, the acquisition, storage, application, etc. of parameter values, temperature values, etc. all comply with the provisions of relevant laws and regulations and do not violate public order and good customs.
[0031] Figure 1 The flowchart of a temperature compensation method for an acid-base value sensor provided by an embodiment of the present invention Figure 1 Embodiments of the present invention are applicable to situations where accurate measurement of acid-base values is required. For example, in scenarios where the acid-base value of a solution is measured in a laboratory, this method can be executed by a temperature compensation device for an acid-base value sensor, and the temperature compensation device for an acid-base value sensor can be implemented in the form of hardware and / or software.
[0032] Refer to Figure 1 The temperature compensation method for an acid-base value sensor shown in the figure, including:
[0033] S101. Obtain the linear relationship parameter values of the potential values and acid-base values of multiple standard buffer solutions at the measurement temperature.
[0034] Among them, multiple standard buffer solutions may refer to multiple chemical solutions with different acid-base values (potential of Hydrogen, pH values), high stability, and repeatable pH value measurement. Multiple standard buffer solutions provide stable reference points for the pH sensor within different pH value ranges. For example, multiple standard buffer solutions may include standard buffer solutions with pH values of A, B, C, D, etc. The pH values of these standard buffer solutions are stable and unchanged at a certain temperature (such as 25 degrees Celsius).
[0035] Among them, the measurement temperature may refer to a specific temperature point. At the measurement temperature, the pH value of the standard buffer solution is considered stable and not affected by other factors. The change in temperature will cause the pH value of the standard buffer solution to change. Therefore, at the measurement temperature, using a pH sensor to measure the pH value of the standard buffer solution can ensure that the measured pH value at this temperature has high accuracy and repeatability. The measurement temperature is usually 25 degrees Celsius. At the measurement temperature, since the temperature does not fluctuate, the pH value of the standard buffer solution is also stable and does not fluctuate.
[0036] Among them, the potential value may refer to the voltage value measured by the probe of the pH sensor for the standard buffer solution. The electrode of the pH sensor generates a potential value related to the hydrogen ion concentration in the standard buffer solution through a chemical reaction with hydrogen ions in the standard buffer solution. The potential value can be used as a direct characterization of the hydrogen ion concentration. Exemplarily, the potential value measured by the pH sensor in the standard buffer solution with a pH value of X is a millivolts; the potential value measured by the pH sensor in the standard buffer solution with a pH value of Y is b millivolts.
[0037] Among them, the linear relationship parameter value can refer to the parameter value of the linear relationship between the pH value and the potential value. There is usually a linear relationship between the pH value and the potential value, and this linear relationship conforms to the Nernst equation or a linear equation similar to the Nernst equation. At the measured temperature, through a plurality of standard buffer solutions with different pH values and a pH sensor, the linear relationship parameter value between the potential value measured by the pH sensor and the pH value of the standard buffer solution can be obtained. Exemplarily, at the measured temperature, the pH values of the standard buffer solutions with a plurality of discrete values of X - Y for the pH value are respectively obtained, and the corresponding potential values measured by the pH sensor, so that the linear relationship formula between the potential value and the pH value can be obtained as follows:
[0038] pH = kV + b
[0039] In the formula, pH represents the pH value of the standard buffer solution, V represents the potential value, k represents the slope in the linear relationship, and b represents the intercept in the linear relationship; the linear relationship parameter value can refer to k and b.
[0040] S102. Calculate the temperature difference to be compensated between the measured temperature and the temperature to be compensated.
[0041] Among them, the temperature to be compensated can refer to the temperature at which the pH sensor is in the actual measurement work. There is a difference between the temperature to be compensated and the measured temperature, which affects the potential value output of the pH sensor, so that when measuring a chemical solution at the temperature to be compensated, the measurement result obtained at the temperature to be compensated will deviate from the true pH value of the chemical solution.
[0042] Among them, the temperature difference to be compensated can refer to the temperature difference between the temperature to be compensated and the measured temperature. The temperature to be compensated represents the deviation between the actual working temperature of the pH sensor and the measured temperature, and is a key calculation quantity in the temperature compensation process. The role of the temperature difference to be compensated is to provide an input parameter for temperature compensation. The temperature difference to be compensated is used to calculate the influence of temperature change on the potential value response of the pH sensor and is input into the temperature compensation model for correction, so as to obtain a more accurate pH value measurement result. Exemplarily, when the measured temperature is 25 degrees Celsius and the temperature to be compensated is 30 degrees Celsius, the temperature difference to be compensated is 5 degrees Celsius; when the measured temperature is 25 degrees Celsius and the temperature to be compensated is 20 degrees Celsius, the temperature difference to be compensated is -5 degrees Celsius.
[0043] S103. Input the linear relationship parameter value and the temperature difference to be compensated into the temperature compensation model for processing, and output the parameter compensation value.
[0044] Among them, the temperature compensation model may refer to a model that adjusts the measurement result of the pH sensor according to temperature changes. The temperature compensation model can enable the pH sensor to measure even at non-measured temperatures, compensate for the relationship between the actually measured potential value and the pH value, and thus obtain an accurate pH value measurement result. The role of the temperature compensation model is to convert the temperature difference into a compensation parameter, so as to provide correction when the pH sensor is actually used, enabling the pH sensor to output an accurate pH value under various temperature conditions. Exemplarily, assuming that the temperature difference to be compensated is 5 degrees Celsius, the pH value can be obtained by correcting according to the current potential value, and the temperature compensation model is used for temperature compensation adjustment to ensure an accurate pH value.
[0045] Among them, the parameter compensation value may refer to the parameter value of the linear relationship obtained after compensation through the temperature compensation model. When the temperature changes, the linear relationship of the pH sensor may deviate, and the parameter values of the corresponding linear relationship will also change. Through the compensated parameter compensation value, the pH sensor can output an accurate pH value measurement result even at the temperature to be compensated. In a specific example, the parameter compensation value may refer to the parameter value in the linear relationship obtained after compensation, and each parameter value may include the slope and intercept in the linear relationship obtained after compensation.
[0046] S104. Adjust the linear relationship parameter value according to the parameter compensation value to obtain the target linear relationship parameter value and determine the target linear relationship.
[0047] Among them, the adjustment may refer to the process of correcting the linear relationship parameter value of the pH sensor according to the parameter compensation amount. Through adjustment, the pH sensor can obtain an accurate pH value measurement result according to the current potential value, thus ensuring the accuracy of the pH value measurement result. The role of adjustment is to eliminate the influence of temperature on the measurement result of the pH sensor by modifying the linear relationship parameter value, so as to obtain an accurate pH value measurement result at different temperatures.
[0048] Among them, the target linear relationship parameter value may refer to the accurate linear relationship parameter value determined for the temperature to be compensated after adjustment. The target linear relationship parameter value can ensure that the pH sensor can still maintain the accuracy of the measured pH value at the temperature to be compensated.
[0049] It can be seen that in the embodiments of the present application, by obtaining the linear relationship parameter values of the potential value and the pH value of the standard buffer solution at the measurement temperature, benchmark data can be provided for subsequent temperature compensation; by calculating the temperature difference between the measurement temperature and the temperature to be compensated, necessary temperature change information can be provided for temperature compensation, so as to make more accurate adjustments; by inputting the linear relationship parameter values and the temperature difference into the temperature compensation model for processing, a parameter compensation value corresponding to the temperature to be compensated can be obtained, thereby realizing the compensation of the temperature for the pH value measurement; by adjusting the linear relationship parameter values, a target linear relationship can be obtained according to the temperature compensation, and further the accuracy and efficiency of the temperature compensation of the pH sensor can be improved.
[0050] In an alternative embodiment, Figure 2 is the flowchart of a method for temperature compensation of a pH sensor provided by an embodiment of the present invention Figure 2 , the step of "inputting the linear relationship parameter values and the temperature difference to be compensated into the temperature compensation model for processing and outputting a parameter compensation value" is refined into "through the temperature compensation model, performing feature extraction on the linear relationship parameter values and the temperature difference to obtain intermediate features; through the temperature compensation model, performing a first feature extraction process on the intermediate features to obtain first features; performing a prediction process on the first features to obtain an integer compensation amount; through the temperature compensation model, performing a second feature extraction process on the intermediate features to obtain second features; performing a prediction process on the second features to obtain a decimal compensation amount; and determining the integer compensation amount and the decimal compensation amount as the parameter compensation value", so as to improve the operation of the temperature compensation of the pH sensor.
[0051] It should be noted that for the parts not detailed in the embodiments of the present invention, reference may be made to the descriptions of other embodiments.
[0052] See Figure 2 The temperature compensation method of the pH sensor shown, includes:
[0053] S201. Obtain the linear relationship parameter values of the potential values and pH values of multiple standard buffer solutions at the measurement temperature.
[0054] S202. Calculate the temperature difference to be compensated between the measurement temperature and the temperature to be compensated.
[0055] S203. Through the temperature compensation model, perform feature extraction on the linear relationship parameter values and the temperature difference to obtain intermediate features.
[0056] Among them, the intermediate feature can refer to the feature representation generated after the input data is processed by the temperature compensation model through the dimension increase processing; wherein, the input data can refer to the linear relationship parameter value and the temperature difference to be compensated, and the dimension increase can refer to expanding the input data from one-dimensional data to multi-dimensional data, enhancing the feature expression ability of the data, so that the data can more fully express its internal structure and relationship in the high-dimensional feature space. The role of the intermediate feature is to expand the original input data to the high-dimensional space, so as to more fully describe the feature information of the linear relationship parameter value and the temperature difference. The dimension increase processing can enhance the nonlinear processing ability of the temperature compensation model for the input data and improve the accuracy of the subsequent prediction results. Exemplarily, the intermediate features of the linear relationship parameter value and the temperature difference can be obtained through the dimension increase multilayer perceptron module, wherein the dimension increase multilayer perceptron module can include a fully connected layer and a ReLU (Rectified Linear Unit) activation function.
[0057] S204 . Perform first feature extraction processing on the intermediate feature through a temperature compensation model to obtain a first feature.
[0058] Among them, the first feature may refer to a feature representation of an integer value extracted from the intermediate feature through a temperature compensation model. The first feature is used to represent a significant pattern related to the integer value compensation amount in the input data, and the first feature extracts global information related to the overall correction of the parameter value in the intermediate feature. Exemplarily, the linear relationship includes a slope and an intercept, and the slope and the intercept are divided into an integer part and a decimal part. The first feature is a feature that characterizes the integer part of the slope and the intercept in the linear relationship.
[0059] S205: Perform prediction processing on the first feature to obtain an integer value compensation amount.
[0060] The integer value compensation amount may refer to the integer value part obtained after predicting the first feature, which is used to represent the adjustment of the linear relationship parameters in the temperature compensation process. Based on the first feature, the temperature model to be compensated obtains the integer compensation amount through classification or regression prediction. For example, through the activation function and the output layer, the temperature model to be compensated calculates the overall impact of the temperature difference on the linear relationship parameters. The integer value compensation amount provides a rough temperature compensation, which is the main correction part of the adjustment of the linear relationship parameters and provides a basis for the fine adjustment of the small value compensation amount.
[0061] S206. Perform a second feature extraction process on the intermediate feature through a temperature compensation model to obtain a second feature.
[0062] The second feature may refer to a feature related to the small value compensation amount extracted from the intermediate feature by the temperature compensation model. The second feature is used to mine the key features that affect the small value compensation amount. The extraction of the second feature can be achieved through the attention gating mechanism.
[0063] In a specific example, the extraction of the second feature can be achieved through the following steps:
[0064] Input the intermediate feature output by the dimensionality - increasing multi - layer perceptron module into the subsequent multi - head structure for parallel computing, and then fuse the outputs of each head. Specifically:
[0065] Input the intermediate feature into two multi - layer perceptron modules respectively to obtain the feature vectors U mlp and V mlp ;
[0066] U mlp = MLP(X up ), V mlp = MLP(X up )
[0067] where X up represents the intermediate feature.
[0068] Introduce a trainable attention matrix A to enhance the model's attention to important features and calculate the weighted features:
[0069] V' = AV mlp , U' = AU mlp
[0070] Calculate the gating signal X' o :
[0071] X' o = φ(U mlp V')
[0072] where φ represents the Sigmoid activation function, and U mlp V' represents element - wise multiplication.
[0073] Calculate the auxiliary feature X″ o :
[0074] X″ o = (U'V mlp )
[0075] Final combined output out:
[0076] out = X up + MLP(X' o X″ o )
[0077] where X' o X″ o represents element - wise multiplication and fuses the features of the gating and attention mechanisms.
[0078] S207. Perform a prediction process on the second feature to obtain a fractional compensation amount.
[0079] Among them, the fractional compensation amount can be obtained by predicting the second feature through a model, and is used to describe the fractional part in the adjustment of the linear relationship parameter. By analyzing the detailed information of the second feature, the temperature compensation model calculates the influence of temperature change on the fractional part of the linear relationship parameter.
[0080] S208. Determine the integer compensation amount and the fractional compensation amount as the parameter compensation value.
[0081] Specifically, the integer compensation amount and the fractional compensation amount of the slope part in the linear relationship parameter value can be added to obtain the compensation amount of the slope part; the integer compensation amount and the fractional compensation amount of the intercept part in the linear relationship parameter value can be added to obtain the compensation amount of the intercept part.
[0082] S209. Adjust the linear relationship parameter value according to the parameter compensation value to obtain the target linear relationship parameter value and determine the target linear relationship.
[0083] It can be seen that in this embodiment, by performing feature extraction on the linear relationship parameter value and the temperature difference, the original input data can be dimensionally elevated to intermediate features, providing richer data expression capabilities for subsequent temperature compensation model processing, thereby improving the overall compensation accuracy; by performing the first feature extraction process on the intermediate features, significant patterns related to the integer compensation amount can be extracted; by performing a prediction process on the first feature, a large-amplitude correction value in temperature compensation can be obtained, thereby achieving rough compensation and correcting the main errors; by performing the second feature extraction process on the intermediate features, detailed features related to the fractional compensation amount can be captured, thereby enhancing the model's refined expression ability for temperature influence; by performing a prediction process on the second feature, a correction value for the fine-tuning part in temperature compensation can be obtained, thereby further improving the accuracy of the compensation result; by combining the integer compensation amount and the fractional compensation amount, a comprehensive adjustment of the linear relationship parameter can be achieved, and finally an accurate temperature compensation result can be provided.
[0084] In some embodiments, performing the second feature extraction process on the intermediate features to obtain the second feature includes:
[0085] Performing an attention enhancement process on the first feature to obtain a weighted feature;
[0086] Performing a gating process on the weighted feature to obtain a gated feature;
[0087] Fusing the first feature and the weighted feature to obtain an auxiliary feature;
[0088] Adjusting the intermediate features according to the weighted feature and the auxiliary feature to obtain a fused feature.
[0089] Among them, the enhancement process may refer to a feature processing method that highlights the key features related to the prediction of the small-value compensation amount while suppressing irrelevant features. The role of the enhancement process is to improve the effectiveness and pertinence of feature extraction, making the temperature compensation model more sensitive to the key information required for small-value compensation amount prediction. Through the dynamic adjustment of feature weights, the attention mechanism enables the model to focus on the contribution sizes of specific input dimensions or feature regions. The enhancement process usually adopts self-attention or multi-head attention mechanisms to weight different dimensions of the first feature.
[0090] Among them, the weighted feature may refer to a feature representation that assigns different weights to the first feature after the enhancement process. The weighted feature reflects the differential adjustment result of the temperature compensation model on the importance of different-dimensional features. The role of the weighted feature is to provide a more focused feature representation for subsequent gating processing and fusion, ensuring that key features are preferentially retained or amplified. The weighted feature calculates the weights through the attention mechanism and multiplies the first feature by the weight matrix to reallocate the contribution values of the features, with higher weights corresponding to features that have a greater impact on the target task.
[0091] Among them, the gating process may refer to an operation of screening and regulating the weighted feature through a specific gating mechanism. The gating process can control the flow and effectiveness of feature information. The role of the gating process is to reduce the interference of irrelevant features while strengthening the features related to the prediction target, further optimizing the feature extraction effect. The operation of the gating process can determine whether specific feature information is transmitted or suppressed.
[0092] Among them, the gated feature may refer to the feature result after the gating process, which contains the key feature information after screening and regulation. The role of the gated feature is to provide a highly refined input for feature fusion, ensuring that the fusion process can generate a more accurate comprehensive feature representation. The gated feature realizes the sparsification and optimization of feature information by controlling the channels of specific-dimensional information, making it contain less redundant information while enhancing the pertinence to the prediction target.
[0093] Among them, fusion may refer to the combined processing of the first feature and the weighted feature to generate a richer auxiliary feature representation. The role of fusion is to generate a comprehensive feature containing global and local information by combining the first feature and the weighted feature, providing an input for the subsequent adjustment of intermediate features. Fusion can adopt methods such as weighted summation, concatenation, or convolution to jointly represent feature information from different sources. The fusion process helps the model establish correlations between different features.
[0094] Among them, the auxiliary feature can refer to the comprehensive feature obtained by fusing the first feature and the weighted feature. The auxiliary feature includes the global information and local information after multiple extraction processes. The role of the auxiliary feature is to provide complete context information for the adjustment of the intermediate feature, ensuring that the adjusted feature can retain both the global trend and the detailed characteristics. The auxiliary feature utilizes the fusion process to synthesize the original input feature and the feature information after attention enhancement processing, providing multi-level input for further adjusting the intermediate feature.
[0095] Among them, the fused feature can refer to the final feature representation obtained by adjusting the intermediate feature according to the weighted feature and the auxiliary feature. The role of the fused feature is to provide high-quality input for the final prediction of the small-value compensation amount, ensuring the accuracy and stability of the prediction. The fused feature reallocates the weights and optimizes the structure of the intermediate feature by synthesizing the significance information of the weighted feature and the multi-dimensional context information of the auxiliary feature, thereby generating a more accurate and rich feature representation.
[0096] It can be seen that in this embodiment, by performing attention enhancement processing on the first feature, the important features related to the small-value compensation amount prediction can be highlighted, and the irrelevant or interfering features can be suppressed, thereby improving the sensitivity and recognition ability of the model to key features; by performing gating processing on the weighted feature, redundant information can be further filtered, and at the same time, the flow of feature information can be controlled, effectively improving the sparsity and pertinence of the features, providing optimized input for subsequent fusion; by fusing the first feature and the weighted feature, the global information and local significance information can be combined to generate an auxiliary feature containing multi-level feature expressions, providing richer and more comprehensive context information for the adjustment of the intermediate feature; by using the weighted feature and the auxiliary feature to adjust the intermediate feature, the feature weight distribution can be further optimized, generating a more accurate and expressive fused feature, providing high-quality input data for the small-value compensation amount prediction.
[0097] In some embodiments, performing prediction processing on the first feature to obtain an integer compensation amount includes:
[0098] Performing prediction processing on the first feature to obtain a slope integer compensation amount and an intercept integer compensation amount, and using them as the integer compensation amount;
[0099] Performing prediction processing on the second feature to obtain a small-value compensation amount includes:
[0100] Performing prediction processing on the second feature to obtain a slope small-value compensation amount and an intercept small-value compensation amount, and using them as the small-value compensation amount;
[0101] Adjusting the linear relationship parameter value according to the parameter compensation value to obtain the target linear relationship parameter value includes:
[0102] Add the slope integer compensation amount and the slope fractional compensation amount to obtain the slope compensation value;
[0103] Add the intercept integer compensation amount and the intercept fractional compensation amount to obtain the intercept compensation value;
[0104] Adjust the slope parameter value in the linear relationship parameter value according to the slope compensation value, and adjust the intercept parameter value in the linear relationship parameter value according to the intercept compensation value to obtain the target linear relationship parameter value.
[0105] Among them, the slope integer compensation amount can refer to the adjustment amount of the integer value used to describe the slope parameter in the linear relationship. The slope integer compensation amount is used to preliminarily correct the slope parameter value in the linear relationship to correct the large error caused by temperature change. For example, assuming that the temperature compensation model analyzes that the main influence of temperature change on the slope is 3.12, then the slope integer compensation amount is 3.
[0106] Among them, the intercept integer compensation amount can refer to the adjustment amount of the integer value used to describe the intercept parameter in the linear relationship. The intercept integer compensation amount is used to preliminarily correct the intercept parameter value in the linear relationship to compensate for the intercept compensation caused by temperature change. For example, assuming that the main influence of temperature change on the intercept is 5.13, then the intercept integer compensation amount is 5.
[0107] Among them, the slope fractional compensation amount can refer to the adjustment amount of the fractional value used to describe the slope parameter in the linear relationship. The slope fractional compensation amount is used to precisely adjust the slope parameter to further reduce the measurement error caused by temperature change. For example, assuming that the temperature compensation model analyzes that the main influence of temperature change on the slope is 3.12, then the slope fractional compensation amount is 0.12.
[0108] Among them, the intercept fractional compensation amount can refer to the adjustment amount of the fractional value used to describe the intercept parameter in the linear relationship. The intercept fractional compensation amount is used to precisely adjust the intercept parameter to improve the overall compensation accuracy of the linear relationship parameter. The intercept fractional compensation amount is used to precisely adjust the intercept parameter to improve the overall compensation accuracy of the linear relationship parameter. Assuming that the main influence of temperature change on the intercept is 5.13, then the intercept fractional compensation amount is 0.13.
[0109] It can be seen that by separately calculating the integer value compensation amounts of the slope and the intercept, the two key parameters of the linear relationship can be corrected hierarchically more precisely, so as to achieve rough compensation and correct large deviations; by separately calculating the fractional value compensation amounts of the slope and the intercept, fine adjustment of the linear relationship parameters can be achieved, further reducing the measurement error; by adding the slope integer value compensation amount and the slope fractional value compensation amount, the overall and subtle effects of temperature can be comprehensively considered, so as to generate the final slope compensation value; by adding the intercept integer value compensation amount and the intercept fractional value compensation amount, the comprehensive effect of temperature on the intercept can be accurately reflected, generating the final intercept compensation value; by adjusting the slope parameter value according to the slope compensation value, the influence of temperature on the slope parameter can be corrected to ensure the accuracy of the linear relationship; by adjusting the intercept parameter value according to the intercept compensation value, the deviation of temperature on the intercept can be corrected, and finally the accurate target linear relationship parameter value can be obtained.
[0110] In an optional embodiment, the slope compensation value and the intercept compensation value in calculating the parameter compensation amount can also be implemented in the following manner:
[0111] Input the temperature difference to be compensated into the multi-layer perceptron network. After passing through the fully connected layer, the temperature difference to be compensated outputs to obtain the scaling coefficient α, the translation coefficient β, and the gating coefficient g. Among them, the slope compensation value can be calculated through a non-linear functional relationship, and the mapping formula is specifically as follows:
[0112] k' = f(k, △T)
[0113] In the formula, k' represents the slope compensation value, △T represents the temperature difference to be compensated, k represents the uncompensated slope, and f represents the non-linear function of the slope compensation value and the temperature difference to be compensated.
[0114] Among them, the non-linear relationship can refer to scaling & translation of the initial slope and intercept, as well as gating processing. Among them, the calculation formula for scaling & translation is as follows:
[0115] k 1 = α * k 0 + β
[0116] Among them, the calculation formula for gating is as follows:
[0117] k 2 = k 0 + g * k 0
[0118] In the formula, k 1 represents the compensated slope obtained through scaling & translation, k 2 represents the compensated slope obtained through gating, k 0 represents the uncompensated initial slope.
[0119] Similarly, the intercept compensation value can be calculated through a non-linear functional relationship. Among them, the calculation formulas for scaling & translation are as follows:
[0120] b 1 = α * b 0 + β
[0121] Among them, the calculation formula for gating is as follows:
[0122] b 2 = b 0 + g * b 0
[0123] In the formula, b 1 represents the compensated intercept obtained through scaling & translation, k 2 represents the compensated intercept obtained through gating, k 0 represents the initial intercept without compensation.
[0124] The influence of temperature on parameters can be considered through a non-linear functional relationship, and the parameters are corrected in a more refined and accurate manner.
[0125] In some embodiments, before performing the first feature extraction process on the intermediate features to obtain the first features, it further includes:
[0126] Performing a dimensionality increase process on the intermediate features and updating the intermediate features.
[0127] It can be seen that in this embodiment, through the dimensionality increase process, the dimension of the features can be increased, making the feature representation more abundant, thereby potentially improving the performance of the temperature compensation model; by updating the intermediate features, the representation of the features can be optimized to ensure that the features are more adaptable to the subsequent processing flow, thereby improving the overall performance and accuracy.
[0128] In some embodiments, the temperature compensation model is trained through the following steps:
[0129] Obtaining the first linear relationship parameter values of the potential values and acid-base values of multiple sample buffers at the sample temperature;
[0130] Obtaining the second linear relationship parameter values of the potential values and acid-base values of each standard buffer at the measurement temperature;
[0131] Calculating the sample temperature difference between the measurement temperature and the sample temperature;
[0132] Taking the first linear relationship parameter values as the target labels, inputting the second linear relationship parameter values and the sample temperature difference into the temperature compensation model for training, and outputting the predicted relationship parameter values;
[0133] Adjusting the parameters of the temperature compensation model according to the difference between the predicted relationship parameter values and the first linear relationship parameter values.
[0134] Among them, the first linear relationship parameter value can be the linear relationship parameter value between the pH value and the potential value of the sample buffer solution obtained at the sample temperature. The first linear relationship parameter value serves as the sample data for training the temperature compensation model. The first linear relationship parameter value is the target for the temperature compensation model to learn how to make the second linear relationship parameter value tend towards the first linear relationship parameter value, that is, the model needs to learn how to adjust from the second linear relationship parameter value to obtain the first linear relationship parameter value during training.
[0135] Among them, the second linear relationship can refer to the linear relationship parameter value between the pH value and the potential value of the standard buffer solution obtained at the measurement temperature. The first linear relationship parameter value is compared with the linear relationship under the measurement temperature condition as the input feature, helping the temperature compensation model capture the compensation law caused by temperature changes. The training data set of the temperature compensation model is expanded through the experimental data of the sample buffer solution with different pH values, enabling the temperature compensation model to adapt to more diverse temperature and pH value environments.
[0136] Among them, the sample temperature difference can refer to the difference between the measurement temperature and the sample temperature. The sample temperature difference is used to help the temperature compensation model evaluate the influence of temperature on the relationship between the potential value and the pH value.
[0137] Among them, the predicted relationship parameter value can refer to the linear relationship parameter value obtained after adjusting the second linear relationship parameter value. The predicted relationship parameter value indicates that when the second linear relationship parameter value and the sample temperature difference input value are input into the temperature compensation model, the temperature compensation model adjusts the parameter value of the second linear relationship to tend towards the first linear relationship parameter value.
[0138] It can be seen that in this embodiment, by obtaining the first linear relationship parameter value of the sample buffer solution at the sample temperature, representative data samples can be provided for the model, thus better reflecting the relationship between the potential value and the pH value under actual temperature conditions; by obtaining the second linear relationship parameter value of the standard buffer solution at the measurement temperature, accurate reference data can be provided for the model to evaluate the deviation of the sample data and the training target of the model; by calculating the temperature difference between the measurement temperature and the sample temperature, information on temperature changes can be provided for the model, enabling the model to quantify the temperature difference as an input factor affecting the linear relationship; by using the first linear relationship parameter value as the target label and inputting the second linear relationship parameter value and the sample temperature difference into the temperature compensation model, the predicted relationship parameter value can be obtained; by adjusting the parameters of the temperature compensation model according to the difference between the predicted relationship parameter value and the first linear relationship parameter value, the parameter settings of the model can be optimized, thereby enhancing the temperature change compensation ability and generalization performance of the model.
[0139] In some embodiments, according to the difference between the predicted relationship parameter value and the first linear relationship parameter value, adjusting the parameters of the temperature compensation model includes:
[0140] Calculating a decimal difference according to the difference between the decimal value in the predicted relationship parameter value and the decimal value in the first linear relationship parameter value;
[0141] Calculating a loss coefficient with the decimal difference as the denominator;
[0142] Calculating a decimal loss according to the loss coefficient and the decimal difference;
[0143] Calculating an integer loss according to the difference between the integer value in the predicted relationship parameter value and the integer value in the first linear relationship parameter value; the decimal loss includes a decimal error value;
[0144] Adjusting the parameters of the temperature compensation model according to the decimal loss and the integer loss.
[0145] Wherein, the decimal difference may refer to the numerical difference between the decimal part of the predicted relationship parameter value and the decimal part of the first linear relationship parameter value. The decimal difference is used to quantify the deviation between the predicted value and the target value in the decimal part, and is a key indicator for evaluating the fine-grained error of the prediction result during the model training process.
[0146] Wherein, the loss coefficient may refer to a factor calculated in reverse according to the decimal difference and used to adjust the loss calculation ratio of the model. The loss coefficient is used to balance the weight of the error in the decimal part of the loss function, so that the model can reasonably focus on errors of different degrees. Calculating the loss coefficient with the decimal difference as the denominator. When the decimal difference is small, increasing the attention to the decimal loss helps the temperature compensation model to learn the decimal value in the predicted relationship parameter value.
[0147] Wherein, the integer loss may refer to a loss value calculated from the numerical difference between the integer part of the predicted relationship parameter value and the integer part of the first linear relationship parameter value.
[0148] Wherein, the decimal error value may refer to the specific deviation amount of the decimal difference. The decimal error value represents the precise error of the decimal value and is used to further optimize the fine-grained prediction of the model.
[0149] It can be seen that in this embodiment, by calculating the decimal difference, the deviation of the predicted value and the target value in the decimal part can be accurately quantified, facilitating subsequent optimization of fine-grained errors; by calculating the loss coefficient with the decimal difference as the denominator, the weight of the loss can be dynamically adjusted, thereby avoiding the model being overly sensitive to small or large errors and improving the adaptability of training; by calculating the decimal loss by combining the loss coefficient and the decimal difference, it can ensure that the attention to the error in the decimal part during the model training process is appropriate, further improving the prediction accuracy; considering the decimal error value included in the decimal loss can refine the description of the error in the decimal part, further enhancing the accuracy and flexibility of training; by comprehensively adjusting the model parameters based on the decimal loss and the integer loss, synchronous optimization of the model in terms of overall error and detail error can be achieved.
[0150] Figure 3 The structural schematic diagram of a pH sensor temperature compensation device provided by an embodiment of the present invention. The embodiment of the present invention is applicable to the situation of pH sensor temperature compensation. This device can execute the pH sensor temperature compensation method, and this device can be implemented in the form of hardware and / or software.
[0151] See Figure 3 The pH sensor temperature compensation device shown in the figure includes: a parameter acquisition module 301, a temperature difference calculation module 302, a compensation amount output module 303, and a relationship determination module 304, where
[0152] The parameter acquisition module 301 is configured to acquire the linear relationship parameter values of the potential values and pH values of multiple standard buffer solutions at the measured temperature.
[0153] The temperature difference calculation module 302 is configured to calculate the temperature difference to be compensated between the measured temperature and the temperature to be compensated.
[0154] The compensation amount output module 303 is configured to input the linear relationship parameter values and the temperature difference to be compensated into the temperature compensation model for processing, and output the parameter compensation value.
[0155] The relationship determination module 304 is configured to adjust the linear relationship parameter values according to the parameter compensation value to obtain the target linear relationship parameter values, and determine the target linear relationship.
[0156] In the technical solution of the embodiment of the present invention, by obtaining the linear relationship parameter values of the potential value and the acid-base value of the standard buffer solution at the measurement temperature, benchmark data can be provided for subsequent temperature compensation; by calculating the temperature difference between the measurement temperature and the temperature to be compensated, necessary temperature change information can be provided for temperature compensation, so as to make more accurate adjustments; by inputting the linear relationship parameter values and the temperature difference into the temperature compensation model for processing, a parameter compensation value corresponding to the temperature to be compensated can be obtained, thereby realizing the compensation of the acid-base value measurement by temperature; by adjusting the linear relationship parameter values and obtaining the target linear relationship according to temperature compensation, the accuracy and efficiency of the temperature compensation of the acid-base value sensor can be improved.
[0157] In some embodiments, in terms of inputting the linear relationship parameter values and the temperature difference to be compensated into the temperature compensation model for processing and outputting the parameter compensation value, the compensation amount output module 303 is specifically used for:
[0158] Through the temperature compensation model, the linear relationship parameter values and the temperature difference are subjected to feature extraction to obtain intermediate features;
[0159] Through the temperature compensation model, the intermediate features are subjected to the first feature extraction process to obtain first features;
[0160] The first features are subjected to prediction processing to obtain an integer value compensation amount;
[0161] Through the temperature compensation model, the intermediate features are subjected to the second feature extraction process to obtain second features;
[0162] The second features are subjected to prediction processing to obtain a decimal value compensation amount;
[0163] The integer value compensation amount and the decimal value compensation amount are determined as the parameter compensation value.
[0164] In some embodiments, in terms of subjecting the intermediate features to the second feature extraction process to obtain second features, the compensation amount output module 303 is specifically used for:
[0165] The first features are subjected to attention enhancement processing to obtain weighted features;
[0166] The weighted features are subjected to gating processing to obtain gated features;
[0167] The first features and the weighted features are fused to obtain auxiliary features;
[0168] According to the weighted features and the auxiliary features, the intermediate features are adjusted to obtain fused features.
[0169] In some embodiments, in terms of subjecting the first features to prediction processing to obtain an integer value compensation amount, the compensation amount output module 303 is specifically used for:
[0170] Perform a prediction process on the first feature to obtain a slope integer compensation amount and an intercept integer compensation amount, and use them as the integer compensation amount;
[0171] Perform a prediction process on the second feature to obtain a decimal compensation amount, including:
[0172] Perform a prediction process on the second feature to obtain a slope decimal compensation amount and an intercept decimal compensation amount, and use them as the decimal compensation amount;
[0173] Adjust the linear relationship parameter value according to the parameter compensation value to obtain the target linear relationship parameter value, including:
[0174] Add the slope integer compensation amount and the slope decimal compensation amount to obtain the slope compensation value;
[0175] Add the intercept integer compensation amount and the intercept decimal compensation amount to obtain the intercept compensation value;
[0176] Adjust the slope parameter value in the linear relationship parameter value according to the slope compensation value, and adjust the intercept parameter value in the linear relationship parameter value according to the intercept compensation value to obtain the target linear relationship parameter value.
[0177] In some embodiments, before performing the first feature extraction process on the intermediate feature to obtain the first feature, the compensation amount output module 303 is further specifically configured to:
[0178] Perform a dimensionality increase process on the intermediate feature and update the intermediate feature.
[0179] In some embodiments, the temperature compensation model is trained in the following manner:
[0180] Obtain the first linear relationship parameter values of the potential values and acid-base values of multiple sample buffers at the sample temperature;
[0181] Obtain the second linear relationship parameter values of the potential values and acid-base values of each of the standard buffers at the measurement temperature;
[0182] Calculate the sample temperature difference between the measurement temperature and the sample temperature;
[0183] Use the first linear relationship parameter value as the target label, input the second linear relationship parameter value and the sample temperature difference into the temperature compensation model for training, and output the predicted relationship parameter value;
[0184] Adjust the parameters of the temperature compensation model according to the difference between the predicted relationship parameter value and the first linear relationship parameter value.
[0185] In some embodiments, in terms of adjusting the parameters of the temperature compensation model according to the difference between the predicted relationship parameter value and the first linear relationship parameter value, the compensation amount output module 303 is specifically configured to:
[0186] Calculate a decimal difference according to the difference between the decimal value in the predicted relationship parameter value and the decimal value in the first linear relationship parameter value;
[0187] Calculate a loss coefficient with the decimal difference as the denominator;
[0188] Calculate a decimal loss according to the loss coefficient and the decimal difference;
[0189] Calculate an integer loss according to the difference between the integer value in the predicted relationship parameter value and the integer value in the first linear relationship parameter value; the decimal loss includes a decimal error value;
[0190] Adjust the parameters of the temperature compensation model according to the decimal loss and the integer loss.
[0191] The pH value sensor temperature compensation device provided by the embodiments of the present invention can execute the pH value sensor temperature compensation method provided by any embodiment of the present invention, and has the corresponding functional modules and beneficial effects for executing the pH value sensor temperature compensation method.
[0192] Figure 4 It is a schematic structural diagram of a pH value sensor temperature compensation device provided by an embodiment of the present invention.
[0193] As Figure 4 shown, the pH value sensor temperature compensation device 400 includes at least one processor 401 and a memory communicatively connected to the at least one processor 401, such as a read-only memory (ROM) 402, a random access memory (RAM) 403, etc. Among them, the memory stores a computer program executable by the at least one processor. The processor 401 can execute various appropriate actions and processes according to the computer program stored in the read-only memory (ROM) 402 or the computer program loaded from the storage unit 408 into the random access memory (RAM) 403. In the RAM 403, various programs and data required for the operation of the pH value sensor temperature compensation device 400 can also be stored. The processor 401, the ROM 402, and the RAM 403 are connected to each other through a bus 404. The input / output (I / O) interface 408 is also connected to the bus 404.
[0194] Multiple components in the pH sensor temperature compensation device 400 are connected to the I / O interface 405, including: an input unit 406, such as a keyboard, a mouse, etc.; an output unit 407, such as various types of displays, speakers, etc.; a storage unit 408, such as a magnetic disk, an optical disc, etc.; and a communication unit 409, such as a network card, a modem, a wireless communication transceiver, etc. The communication unit 409 allows the pH sensor temperature compensation device 400 to exchange information / data with other devices via a computer network such as the Internet and / or various telecommunication networks.
[0195] The processor 401 can be various general-purpose and / or special-purpose processing components with processing and computing capabilities. Some examples of the processor 401 include, but are not limited to, a central processing unit (CPU), a graphics processing unit (GPU), various dedicated artificial intelligence (AI) computing chips, various processors running machine learning model algorithms, a digital signal processor (DSP), and any suitable processor, controller, microcontroller, etc. The processor 401 executes the various methods and processes described above, such as the pH sensor temperature compensation method.
[0196] In some embodiments, the pH sensor temperature compensation method can be implemented as a computer program, which is tangibly contained in a computer-readable storage medium, such as the storage unit 408. In some embodiments, part or all of the computer program can be loaded and / or installed onto the pH sensor temperature compensation device 400 via the ROM 402 and / or the communication unit 409. When the computer program is loaded into the RAM 403 and executed by the processor 401, one or more steps of the pH sensor temperature compensation method described above can be executed. Alternatively, in other embodiments, the processor 401 can be configured to execute the pH sensor temperature compensation method by any other suitable means (e.g., by means of firmware).
[0197] The various embodiments of the systems and technologies described above herein can be implemented in digital electronic circuit systems, integrated circuit systems, field-programmable gate arrays (FPGA), application-specific integrated circuits (ASIC), application-specific standard products (ASSP), systems-on-chip (SOC), complex programmable logic devices (CPLD), computer hardware, firmware, software, and / or combinations thereof. These various embodiments can include: being implemented in one or more computer programs, which can be executed and / or interpreted on a programmable system including at least one programmable processor, the programmable processor can be a special or general programmable processor, can receive data and instructions from a storage system, at least one input device, and at least one output device, and transmit the data and instructions to the storage system, the at least one input device, and the at least one output device.
[0198] A computer program for implementing the method of the present invention can be written in any combination of one or more programming languages. These computer programs can be provided to a processor of a general-purpose computer, a special-purpose computer, or other programmable data processing device, such that when the computer program is executed by the processor, the functions / operations specified in the flowchart and / or block diagram are implemented. The computer program can be executed entirely on the machine, partially on the machine, executed partially on the machine and partially on a remote machine as a stand-alone software package, or executed entirely on a remote machine or server.
[0199] In the context of the present invention, a computer-readable storage medium can be a tangible medium that can contain or store a computer program for use by or in connection with an instruction execution system, apparatus, or device. The computer-readable storage medium can include, but is not limited to, electronic, magnetic, optical, electromagnetic, infrared, or semiconductor systems, apparatus, or devices, or any suitable combination of the foregoing. Alternatively, the computer-readable storage medium can be a machine-readable signal medium. More specific examples of the machine-readable storage medium would include an electrical connection based on one or more wires, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing.
[0200] In order to provide interaction with a user, the systems and techniques described herein can be implemented on an operation detection device, the pH sensor temperature compensation device having: a display device for displaying information to the user (e.g., a CRT (cathode ray tube) or LCD (liquid crystal display) monitor); and a keyboard and a pointing device (e.g., a mouse or a trackball), by which the user can provide input to the pH sensor temperature compensation device. Other kinds of devices can also be used to provide interaction with the user; for example, the feedback provided to the user can be any form of sensory feedback (e.g., visual feedback, auditory feedback, or tactile feedback); and input from the user can be received in any form (including acoustic input, voice input, or tactile input).
[0201] The systems and techniques described herein can be implemented in a computing system including backend components (e.g., as a data server), or a computing system including middleware components (e.g., an application server), or a computing system including frontend components (e.g., a user computer having a graphical user interface or a web browser through which a user can interact with an implementation of the systems and techniques described herein), or a computing system including any combination of such backend components, middleware components, or frontend components. The components of the system can be interconnected with each other by digital data communication in any form or medium (e.g., a communication network). Examples of communication networks include: local area network (LAN), wide area network (WAN), blockchain network, and the Internet.
[0202] The computing system can include clients and servers. The clients and servers are generally far from each other and typically interact through a communication network. The client-server relationship is created by computer programs running on the respective computers and having a client-server relationship with each other. The server can be a cloud server, also known as a cloud computing server or a cloud host, which is a host product in the cloud computing service system, solving the defects of difficult management and weak business scalability existing in traditional physical hosts and VPS (Virtual Private Server) services.
[0203] It should be understood that various forms of the processes shown above can be used, with steps reordered, added, or deleted. For example, the steps recited in the present invention can be executed in parallel, sequentially, or in a different order, as long as the desired results of the technical solution of the present invention can be achieved, and no limitation is made herein.
[0204] The above specific embodiments do not constitute a limitation on the protection scope of the present invention. Those skilled in the art should understand that various modifications, combinations, sub-combinations, and substitutions can be made according to design requirements and other factors. Any modifications, equivalent substitutions, and improvements made within the spirit and principles of the present invention shall be included within the protection scope of the present invention.
Claims
1. A temperature compensation method for a pH sensor, characterized in that: The method comprises: Obtain the linear relationship parameter values of the potential values and pH values of multiple standard buffer solutions at the measurement temperature; Calculating a temperature difference between the measured temperature and the temperature to be compensated; Inputting the linear relationship parameter value and the temperature difference to be compensated into a temperature compensation model for processing, and outputting a parameter compensation value; According to the parameter compensation value, the linear relationship parameter value is adjusted to obtain a target linear relationship parameter value, and a target linear relationship is determined.
2. The method according to claim 1, characterized in that The step of inputting the linear relationship parameter value and the temperature difference to be compensated into a temperature compensation model for processing and outputting a parameter compensation value comprises: By using the temperature compensation model, feature extraction is performed on the linear relationship parameter value and the temperature difference to obtain an intermediate feature; Performing a first feature extraction process on the intermediate feature through the temperature compensation model to obtain a first feature; Performing prediction processing on the first feature to obtain an integer value compensation amount; Performing a second feature extraction process on the intermediate feature through the temperature compensation model to obtain a second feature; Performing prediction processing on the second feature to obtain a small value compensation amount; The integer value compensation amount and the decimal value compensation amount are determined as parameter compensation values.
3. The method according to claim 2, characterized in that Performing a second feature extraction process on the intermediate feature to obtain a second feature includes: Performing attention enhancement processing on the first feature to obtain a weighted feature; Performing gate processing on the weighted features to obtain gated features; fusing the first feature and the weighted feature to obtain an auxiliary feature; The intermediate feature is adjusted according to the weighted feature and the auxiliary feature to obtain a fused feature.
4. The method according to claim 2, characterized in that: The predicting process of the first feature to obtain an integer value compensation amount includes: Performing prediction processing on the first feature to obtain a slope integer compensation amount and an intercept integer compensation amount, and using them as integer compensation amounts; The predicting process of the second feature to obtain a small value compensation amount includes: Performing prediction processing on the second feature to obtain a slope small value compensation amount and an intercept small value compensation amount, and using them as small value compensation amounts; The step of adjusting the linear relationship parameter value according to the parameter compensation value to obtain a target linear relationship parameter value includes: Adding the slope integer compensation amount and the slope decimal compensation amount to obtain a slope compensation value; Adding the intercept integer compensation amount and the intercept decimal compensation amount to obtain an intercept compensation value; The slope parameter value in the linear relationship parameter value is adjusted according to the slope compensation value, and the intercept parameter value in the linear relationship parameter value is adjusted according to the intercept compensation value to obtain a target linear relationship parameter value.
5. The method according to claim 2, characterized in that: Before performing first feature extraction processing on the intermediate feature to obtain the first feature, the method further includes: The intermediate features are subjected to dimensionality upgrading processing, and the intermediate features are updated.
6. The method according to claim 1, characterized in that The temperature compensation model is trained in the following way: Obtaining first linear relationship parameter values of potential values and pH values of a plurality of sample buffer solutions at the sample temperature; Obtaining a second linear relationship parameter value between the potential value and the pH value of each of the standard buffer solutions at the measurement temperature; calculating a sample temperature difference between the measured temperature and the sample temperature; Using the first linear relationship parameter value as a target label, inputting the second linear relationship parameter value and the sample temperature difference into a temperature compensation model for training, and outputting a predicted relationship parameter value; The parameters of the temperature compensation model are adjusted according to the difference between the predicted relationship parameter value and the first linear relationship parameter value.
7. The method according to claim 6, characterized in that The adjusting the parameters of the temperature compensation model according to the difference between the predicted relationship parameter value and the first linear relationship parameter value comprises: Calculating a decimal difference value according to a difference between a decimal value in the predicted relationship parameter value and a decimal value in the first linear relationship parameter value; The loss coefficient is calculated using the decimal difference as the denominator; Calculating a decimal loss according to the loss coefficient and the decimal difference; Calculating an integer loss based on a difference between an integer value in the predicted relationship parameter value and an integer value in the first linear relationship parameter value; the fractional loss includes a fractional error value; Parameters of the temperature compensation model are adjusted according to the fractional loss and the integer loss.
8. A temperature compensation device for a pH sensor, characterized in that: include: A parameter acquisition module is used to obtain the linear relationship parameter values of the potential values and pH values of multiple standard buffer solutions at the measurement temperature; A temperature difference calculation module, used for calculating the temperature difference to be compensated between the measured temperature and the temperature to be compensated; A compensation value output module, used for inputting the linear relationship parameter value and the temperature difference to be compensated into a temperature compensation model for processing, and outputting a parameter compensation value; The relationship determination module is used to adjust the linear relationship parameter value according to the parameter compensation value to obtain the target linear relationship parameter value and determine the target linear relationship.
9. A pH sensor temperature compensation device, characterized in that: The pH sensor temperature compensation device comprises: at least one processor; and a memory communicatively connected to the at least one processor; wherein, The memory stores a computer program executable by the at least one processor, and the computer program is executed by the at least one processor so that the at least one processor can execute the temperature compensation method for a pH value sensor according to any one of claims 1 to 7.
10. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores computer instructions, and the computer instructions are used to enable a processor to implement the temperature compensation method for a pH value sensor according to any one of claims 1 to 7 when executed.