A method for correcting measurement error of CTD waterproof handheld machine in high salinity environment

By combining stratified sampling, Fourier transform, and the SalCorrNet ​​model, the measurement accuracy problem of CTD waterproof handheld devices in high salinity environments was solved, achieving accurate measurement in high salinity environments, reducing error fluctuations, and improving the reliability of measurement results.

CN120760752BActive Publication Date: 2026-07-07青岛道万科技有限公司

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
青岛道万科技有限公司
Filing Date
2025-06-23
Publication Date
2026-07-07

AI Technical Summary

Technical Problem

Traditional CTD waterproof handheld devices exhibit a significant decrease in measurement accuracy in high-salinity environments. Existing error correction methods are unable to effectively capture complex nonlinear error patterns and electrode state changes, resulting in measurement errors of up to 5-10%, which affects the accuracy and reliability of marine hydrological data.

Method used

The error spectrum features were extracted using a stratified sampling method and Fourier transform analysis. A nonlinear error mapping relationship was constructed by combining the pre-trained SalCorrNet ​​salinity error neural network model. Error correction was performed through an adaptive weight adjustment algorithm and a dynamic temperature and pressure compensation mechanism. The results were then integrated into the internal calibration module of the CTD waterproof handheld device.

Benefits of technology

It effectively reduces the error fluctuation at high salinity extreme points, significantly improves the measurement accuracy of the CTD waterproof handheld device in extreme marine environments, controls the measurement error to within 1%, and ensures the reliability and accuracy of the measurement results.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120760752B_ABST
    Figure CN120760752B_ABST
Patent Text Reader

Abstract

This invention provides a method for correcting measurement errors in high-salinity environments using a waterproof CTD handheld device, belonging to the field of electronic digital data processing technology. The proposed method first collects multiple sets of measurement data under high-salinity conditions, divides the salinity range through stratified sampling, and extracts error spectrum features using Fourier transform. Next, it calls a salinity error compensation function for preprocessing and calculates the error correction coefficient. Then, it introduces a pre-trained SalCorrNet ​​deep neural network model to establish a nonlinear error mapping relationship. Based on the model output, it optimizes the error correction function and uses an adaptive weight adjustment algorithm to reduce error fluctuations at extreme points. The optimized error correction function is integrated into the device's internal calibration module. Finally, a dynamic temperature and pressure compensation mechanism is established to eliminate the influence of temperature and pressure changes, achieving a significant improvement in measurement accuracy under high-salinity conditions.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention belongs to the field of electronic digital data processing technology, and more specifically, relates to a method for correcting measurement errors in a high-salinity environment using a waterproof CTD handheld device. Background Technology

[0002] Marine hydrological monitoring is a crucial foundation for marine scientific research and marine resource development. Waterproof CTD (Conductivity-Temperature-Depth) handheld devices are widely used as key equipment for on-site measurement of seawater parameters. Traditional CTD equipment measures seawater conductivity, temperature, and depth, and calculates important hydrological indicators such as salinity based on these parameters. These portable instruments are easy to operate and respond quickly, meeting the needs of routine marine hydrological parameter monitoring.

[0003] However, when seawater salinity exceeds 35‰, the measurement accuracy of traditional waterproof handheld CTD devices decreases significantly. This is mainly due to factors such as increased ion concentration leading to enhanced nonlinearity in conductivity measurement, enhanced polarization effect at the electrode interface, and changes in the response characteristics of the measurement circuit. Existing technologies primarily employ methods such as linear calibration, piecewise fitting, and fixed parameter compensation for error correction, but these methods cannot effectively capture the complex nonlinear error patterns and the impact of electrode state changes on measurements under high salinity conditions.

[0004] Especially in high-salinity extreme areas, the measurement error of traditional CTD equipment can reach 5-10%, seriously affecting the accuracy and reliability of marine hydrological data in high-salinity environments. How to improve the measurement accuracy of waterproof handheld CTD devices in high-salinity environments (salinity exceeding 35‰) and reduce the interference of environmental factors and equipment status on the measurement results has become an urgent technical problem to be solved in the field of marine hydrological monitoring. Summary of the Invention

[0005] In view of this, the present invention provides a method for correcting measurement errors of a CTD waterproof handheld device in a high salinity environment, which can solve the technical problem that the measurement accuracy of the CTD waterproof handheld device is significantly reduced in a high salinity environment in the prior art.

[0006] This invention is implemented as follows: It provides a method for correcting measurement errors in a CTD waterproof handheld device under high salinity conditions, comprising: collecting multiple sets of measurement data from the CTD waterproof handheld device under high salinity conditions, and recording the deviation between the actual salinity value and the measured value as the original error sample; using a stratified sampling method to divide the original error sample into several intervals according to the salinity concentration gradient; performing Fourier transform analysis on the original error sample within each salinity interval to extract error spectrum features and establish a model relating error and salinity; calling a salinity error compensation function for error correction preprocessing; introducing a pre-trained salinity error neural network model, SalCorrNet, to analyze the error spectrum features and construct a nonlinear error mapping relationship; optimizing the salinity error correction function based on the SalCorrNet ​​model output, and using an adaptive weight adjustment algorithm to reduce error fluctuations at high salinity extreme points; integrating the optimized salinity error correction function into the internal calibration module of the CTD waterproof handheld device; and establishing a dynamic temperature and pressure compensation mechanism to eliminate the influence of temperature and pressure changes on the accuracy of the salinity error correction function.

[0007] In this method, a stratified sampling approach is used to divide the original error samples into several intervals according to the salinity concentration gradient, ensuring that the data covers the entire measurement range.

[0008] Among them, the error spectrum characteristics refer to the periodic variation characteristics obtained by performing frequency domain analysis on the measurement error data, including amplitude, phase, and frequency distribution.

[0009] Among them, the adaptive weight adjustment algorithm refers to the algorithm that dynamically allocates the weight of the correction parameter according to the error distribution characteristics in different salinity intervals, thereby improving the measurement accuracy near the extreme point.

[0010] Among them, the dynamic temperature and pressure compensation mechanism refers to the measures to ensure the accuracy and stability of the measurement under various environmental conditions by jointly correcting the salinity measurement value based on real-time temperature and pressure change data through multiple parameters.

[0011] The salinity error compensation function is used to perform preliminary processing on the original error samples and calculate the error correction coefficients for each salinity interval. The inputs include the original salinity value, the measured salinity value, the measured temperature value, the measured depth value, and the electrode state parameters. The output is the salinity interval error correction coefficient matrix and the error statistical feature vector.

[0012] The SalCorrNet ​​model is a deep learning architecture that combines a multilayer perceptron and a recurrent neural network. It includes a three-layer convolutional neural network for extracting local features of the error spectrum, a two-layer long short-term memory network for capturing the temporal change pattern of the error, a multi-head attention mechanism for distinguishing between electrode contamination error and nonlinear conductivity error in high-salinity environment, and a three-layer fully connected network for outputting correction parameters.

[0013] Among them, the number of heads in the multi-head attention mechanism is determined based on the number of salinity intervals, the weight attenuation parameter is determined based on the amplitude distribution of the error spectrum characteristics, and the attention mask parameter is determined based on the degree of fluctuation of the electrode state parameters.

[0014] The steps for establishing the training dataset during the pre-training process of the SalCorrNet ​​model include collecting multi-depth salinity gradient measurement data from different sea areas and seasons, using high-precision laboratory-grade analytical instruments to obtain standard salinity values ​​as true references, recording measurement error cases in high-salinity environments under various electrode conditions, and labeling the relationship between electrode contamination levels and error types.

[0015] The pre-training process of the SalCorrNet ​​model includes several steps, such as building a supervised learning dataset containing the correspondence between error spectrum feature vectors and correction parameters, applying data augmentation techniques to simulate measurement scenarios under extreme salinity conditions, and establishing validation and test sets for model evaluation and to prevent overfitting.

[0016] Compared with existing technologies, this invention provides a method for correcting measurement errors in high-salinity environments using a waterproof CTD handheld device.

[0017] This invention proposes a data-driven method for correcting measurement errors in high-salinity environments using a waterproof CTD handheld device. By establishing a multi-level error processing mechanism and an intelligent compensation algorithm, the method effectively solves the measurement accuracy problem in high-salinity environments. The method first extracts error spectrum features through stratified sampling and Fourier transform analysis. Then, it introduces a pre-trained Salinity error neural network model, SalCorrNet, to construct a nonlinear error mapping relationship. Finally, it achieves real-time data correction through a dynamic temperature and pressure compensation mechanism.

[0018] This invention overcomes the accuracy limitations of traditional calibration methods in the extreme point region, significantly reducing error fluctuations at high salinity extreme points through an adaptive weight adjustment algorithm. In particular, the introduced SalCorrNet ​​model effectively distinguishes between electrode contamination errors and conductivity nonlinearity errors in high-salinity environments, addressing the technical limitation of traditional methods in failing to identify error sources. The application of a multi-head attention mechanism enables the system to dynamically adjust the correction strategy based on electrode conditions, thereby ensuring the reliability of the correction results.

[0019] By integrating a dynamic temperature and pressure compensation mechanism, this invention achieves comprehensive correction of measurement errors under complex marine environmental conditions, controlling the measurement error in high salinity environments (salinity exceeding 35‰) to within 1%, significantly improving the measurement accuracy and data reliability of the CTD waterproof handheld device in extreme marine environments, and providing more accurate hydrological data support for marine scientific research and resource exploration. Attached Figure Description

[0020] Figure 1This is a flowchart of the method of the present invention. Detailed Implementation

[0021] To make the objectives, technical solutions, and advantages of the embodiments of the present invention clearer, the technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings.

[0022] like Figure 1 The diagram shown is a flowchart of a method for correcting measurement errors in a high-salinity environment using a CTD waterproof handheld device, provided by this invention. This method includes the following steps:

[0023] S01. Collect multiple sets of measurement data from a CTD waterproof handheld device under high salinity conditions, and record the deviation between the actual salinity value and the measured value as the original error sample.

[0024] S02. Using stratified sampling, the original error samples are divided into several intervals according to the salinity concentration gradient to ensure that the data covers the entire measurement range.

[0025] S03. Perform Fourier transform analysis on the original error samples in each salinity interval, extract the error spectrum features, and establish a model of the relationship between error and salinity.

[0026] S04. Call the salinity error compensation function to perform error correction preprocessing, calculate the error correction coefficient in each salinity interval, and improve the accuracy of subsequent modeling.

[0027] S05. Introduce a pre-trained Salinity Error Neural Network Model (SalCorrNet) to analyze the error spectrum characteristics and construct a nonlinear error mapping relationship;

[0028] S06. Optimize the salinity error correction function based on the output of the SalCorrNet ​​model, and use an adaptive weight adjustment algorithm to reduce the error fluctuation at high salinity extreme points.

[0029] S07. Integrate the optimized salinity error correction function into the internal calibration module of the CTD waterproof handheld device to achieve real-time data correction;

[0030] S08. Establish a dynamic temperature and pressure compensation mechanism to eliminate the influence of temperature and pressure changes on the accuracy of the salinity error correction function and obtain the final detection data.

[0031] Among them, the CTD waterproof handheld device is an integrated design for measuring water conductivity, temperature and depth parameters and has a waterproof rating of IP68 or higher. It is a navigation instrument used in marine hydrological monitoring field operations.

[0032] Among them, a high salinity environment refers to an environment with a salinity value exceeding 35‰, that is, an environment containing more than 35 grams of dissolved salt per kilogram of seawater.

[0033] Among them, the error spectrum characteristics refer to the periodic variation characteristics obtained by performing frequency domain analysis on the measurement error data, including key parameters such as amplitude, phase, and frequency distribution;

[0034] Among them, the adaptive weight adjustment algorithm refers to the algorithm that dynamically allocates the weight of the correction parameter according to the error distribution characteristics in different salinity intervals, thereby improving the measurement accuracy near the extreme point.

[0035] Among them, the dynamic temperature and pressure compensation mechanism refers to the measures to ensure the accuracy and stability of the measurement under various environmental conditions by jointly correcting the salinity measurement value based on real-time temperature and pressure change data through multiple parameters.

[0036] The salinity error compensation function is used to perform preliminary processing on the original error samples and calculate the error correction coefficients for each salinity interval. The inputs include the original salinity value, the measured salinity value, the measured temperature value, the measured depth value, and the electrode state parameters. The output is the salinity interval error correction coefficient matrix and the error statistical feature vector.

[0037] The SalCorrNet ​​model is a deep learning architecture combining a multilayer perceptron and a recurrent neural network. It includes a three-layer convolutional neural network for extracting local features of the error spectrum, a two-layer long short-term memory network for capturing the temporal variation pattern of the error, a multi-head attention mechanism for distinguishing between electrode contamination error and conductivity nonlinearity error in high-salinity environment, and a three-layer fully connected network for outputting correction parameters. The number of heads in the multi-head attention mechanism is determined according to the number of salinity intervals, the weight decay parameter is determined according to the amplitude distribution of the error spectrum, and the attention mask parameter is determined according to the fluctuation degree of the electrode state parameters.

[0038] The steps for establishing the training dataset during the pre-training process of the SalCorrNet ​​model specifically include collecting multi-depth salinity gradient measurement data in different sea areas and seasons, using high-precision laboratory-grade analytical instruments to obtain standard salinity values ​​as true references, recording measurement error cases in high-salinity environments under various electrode conditions, labeling the relationship between electrode contamination degree and error type, constructing a supervised learning dataset containing the correspondence between the error spectrum feature vector and correction parameters, applying data augmentation techniques to simulate measurement scenarios under extreme salinity environments, and establishing validation and test sets for model evaluation and preventing overfitting.

[0039] The pre-training steps of the SalCorrNet ​​model specifically include initializing network parameters using standard normal distribution random values, setting the learning rate to 0.001 and using a cosine annealing learning rate scheduling strategy, using batch gradient descent algorithm for parameter optimization, using a combination of root mean square error and weighted cross-entropy loss function, introducing an early stopping strategy during training to avoid overfitting, using five-fold cross-validation to evaluate the model's generalization ability, using weight regularization to control model complexity, and compressing model parameters through quantization methods after training to adapt to the resource limitations of the CTD waterproof handheld embedded system.

[0040] The specific implementation methods of the above steps are described in detail below.

[0041] The specific implementation of step S01 involves data collection in a real-world application environment. First, test points are selected in marine areas with different salinity gradients, including nearshore low-salinity areas (20‰–28‰), standard seawater areas (28‰–35‰), and high-salinity areas (35‰–45‰). After initial calibration of the CTD waterproof handheld device using a standard solution, 10 sets of data are recorded at each test point. Each set includes the salinity, temperature, and depth values ​​measured by the instrument, as well as a simultaneously collected water sample. The collected water samples are sent to a laboratory for precise salinity measurement using a Salinor meter to obtain the true salinity value. By comparing the CTD waterproof handheld device readings with the laboratory measurement results, the original error sample is calculated and recorded as the difference between the measured value and the true value. The purpose of this step is to establish an original error database, providing basic data support for subsequent error analysis and model correction.

[0042] The specific implementation of step S02 involves using stratified sampling statistical methods to scientifically classify the original error samples obtained in S01. First, based on the salinity range of 20‰ to 45‰, a gradient interval of 5‰ is set, dividing the area into five main intervals: 20‰–25‰, 25‰–30‰, 30‰–35‰, 35‰–40‰, and 40‰–45‰. Considering that error changes are more sensitive in high-salinity areas, the high-salinity intervals above 35‰ are further subdivided into sub-intervals with 2‰ intervals. At least 30 sample points are randomly selected within each interval to ensure statistical significance, while ensuring that the sample size ratio of each interval matches the actual measurement frequency. For extremely high-salinity areas (42‰–45‰) with sparse samples, oversampling techniques are used to increase the sample size. The purpose of this step is to ensure that the error samples are representative and balanced across the entire salinity range, laying the foundation for targeted error correction in different salinity intervals.

[0043] The specific implementation of step S03 involves performing frequency domain analysis on the original error samples within each salinity interval. First, the error data within each interval are arranged in ascending order of salinity values ​​to form a time-series sequence. The Fast Fourier Transform (FFT) algorithm is then applied to transform the error data from the time domain to the frequency domain. During the transformation, a Hanning window function is used to reduce spectral leakage, with the window length set to 128 points. By analyzing the transformed spectrum, the main frequency components and corresponding amplitudes are extracted, and the top five frequency components with the largest amplitudes are defined as the main error spectral features. Based on these spectral features, the spectral energy distribution and phase angle are calculated to construct an error spectral feature vector. Then, the relationship between the error spectral features and salinity values ​​in each salinity interval is fitted using the least squares method to establish a multinomial regression model. The model order is determined based on the goodness of fit, typically chosen as 3 to 5. The purpose of this step is to reveal the periodic variation law of measurement errors under different salinity environments from a frequency domain perspective, providing spectral feature basis for subsequent error correction.

[0044] The specific implementation of step S04 involves constructing and calling a salinity error compensation function for data preprocessing. This function first receives the original salinity value, measured temperature value, measured depth value, and electrode state parameters as input parameters. For each salinity interval, an interval error correction coefficient is calculated, based on the functional relationship between temperature, salinity, and electrode state. Different weighting coefficients are used for different salinity intervals in the function design: a weighting coefficient of 0.8 for the low-salinity interval (20‰–35‰) and a weighting coefficient of 1.2 for the high-salinity interval (35‰–45‰) to balance the correction accuracy across different intervals. Simultaneously, an error statistical feature vector is calculated, including four statistical measures: mean, standard deviation, skewness, and kurtosis. The error correction coefficient matrix for each salinity interval is solved using a least-squares optimization method, with the number of matrix elements corresponding to the number of salinity intervals. The purpose of this step is to establish a preliminary error correction framework, provide basic error correction coefficients, and offer preprocessed data support for subsequent deep learning models.

[0045] Step S05 involves introducing a pre-trained SalCorrNet ​​neural network model for deep error analysis. This model first reads the error spectral feature vector extracted in S03 and inputs it into a three-layer convolutional neural network structure. The kernel sizes are 3×3, 3×3, and 2×2, and the number of channels in the convolutional layers are 32, 64, and 128, respectively. The ReLU activation function is used. After extracting local patterns of the error spectral features through the convolutional layers, the feature map is flattened and input into a two-layer Long Short-Term Memory (LSTM) network with 256 hidden units to capture the dynamic temporal characteristics of error changes with salinity. The LSTM output is then processed by a multi-head attention layer, with the number of attention heads set to 5 based on the number of salinity intervals, corresponding to the 5 main salinity intervals. Finally, a nonlinear error mapping relationship is constructed through a three-layer fully connected network (with 128, 64, and 32 hidden units, respectively), and the output layer uses a linear activation function to predict the final error correction value. The purpose of this step is to utilize a deep learning model to extract complex nonlinear error patterns under high salinity conditions and construct a more accurate error mapping relationship.

[0046] Step S06 is implemented by optimizing the salinity error correction function based on the output of the SalCorrNet ​​model. First, the error correction value predicted by the model is weighted and fused with the preliminary correction coefficients from S04. The fusion weights are dynamically adjusted according to the confidence level of the prediction error. For high-confidence predictions (confidence > 0.85), higher weights (0.8–0.95) are assigned; for low-confidence predictions (confidence < 0.6), lower weights (0.3–0.5) are assigned. To address the error fluctuation problem at high-salinity extreme points (salinity > 42‰), an adaptive weight adjustment algorithm is introduced. This algorithm dynamically calculates a smoothing factor α based on the magnitude of the local salinity gradient, with α ranging from 0.1 to 0.9; the larger the salinity gradient, the smaller the α value. A sliding window method (window width set to salinity value ± 1‰) is used to locally weight the error correction values ​​of adjacent salinity points, reducing abrupt error changes at extreme points. Finally, an optimized salinity error correction function is formed, which has different correction strategies and parameters for different salinity ranges. The purpose of this step is to further optimize the error correction function, improve the correction accuracy at extreme points, and reduce error fluctuations under high salinity conditions.

[0047] The specific implementation of step S07 involves integrating the optimized salinity error correction function into the internal calibration module of the CTD waterproof handheld device. First, the error correction function is converted into a lookup table format suitable for embedded systems to improve real-time calculation efficiency. The lookup table uses a two-dimensional matrix structure, with the horizontal axis representing salinity values ​​(0.5‰ intervals) and the vertical axis representing temperature values ​​(1℃ intervals), and the matrix elements representing correction coefficients under the corresponding conditions. For intermediate values ​​not covered by the lookup table, a bilinear interpolation algorithm is used to calculate the correction coefficients. The integration of the correction function adopts a modular design, embedding it as an independent functional unit into the instrument's data processing flow. Error correction calculations are automatically performed after the original measurement data is acquired and before the results are displayed. This integrated module includes a parameter update mechanism, supporting updates to the correction function parameters via firmware upgrades. The purpose of this step is to transform the theoretical correction method into a practical embedded algorithm, enabling the CTD waterproof handheld device to perform real-time data correction in high-salinity environments.

[0048] The specific implementation of step S08 involves constructing a dynamic temperature and pressure compensation mechanism to eliminate the influence of environmental factors on salinity error correction. First, a temperature influence model is established, and the influence coefficient β of temperature change on conductivity measurement is determined experimentally. T ,β T The value varies across different temperature ranges: 0.022–0.025 / ℃ in the low-temperature range (0℃–10℃), 0.018–0.022 / ℃ in the medium-temperature range (10℃–25℃), and 0.020–0.024 / ℃ in the high-temperature range (25℃–40℃). Similarly, a pressure influence model is established to determine the pressure change influence coefficient β. P The values ​​are typically taken as 0.001 to 0.003 / meter. Based on these influence coefficients, a temperature and pressure compensation function is designed. This function receives real-time temperature T and depth D data and calculates the temperature and pressure compensation coefficient K. TP The result is then multiplied by the error correction value optimized in step S06 to obtain the final correction result after temperature and pressure compensation. This compensation mechanism employs an adaptive algorithm to dynamically adjust the compensation intensity based on the rate of temperature and pressure change, ensuring stable measurement accuracy even under drastic temperature and pressure changes (such as crossing thermoclines). The purpose of this step is to eliminate the interference of temperature and pressure changes on salinity measurement through a multi-parameter joint correction method, thereby improving the stability and reliability of salinity measurement under various environmental conditions.

[0049] Optionally, step S09 is also included: conducting experimental verification, comparing the accuracy of measurement data before and after correction, and generating a correction method verification report. The specific implementation of this step involves conducting systematic experimental verification to evaluate the effectiveness of the correction method. First, at least three test points in different sea areas are selected, including typical high-salinity sea areas and areas with significant salinity gradient changes. At each test point, measurements are simultaneously taken using a CTD waterproof handheld device with integrated error correction function and an uncorrected instrument of the same model, recording at least 50 sets of data. Water samples are collected simultaneously for laboratory analysis to obtain the true salinity values. The correction effect is evaluated by calculating the measurement errors before and after correction. Evaluation indicators include: mean absolute error (MAE), root mean square error (RMSE), and maximum error (MaxE). The acceptance criteria are set as follows: in a high-salinity environment (>35‰), the mean absolute error is reduced by more than 50%, the root mean square error is reduced by more than 40%, and the maximum error is reduced by more than 30%. Based on the verification results, a correction method verification report is prepared, detailing the test environment conditions, data comparison analysis, and correction effect evaluation. The purpose of this step is to verify the actual effect of the correction method through experimental data, and to ensure that the method can significantly improve the measurement accuracy of CTD waterproof handheld devices in high salinity environments in practical applications.

[0050] The SalCorrNet ​​model employs a multi-layer hybrid neural network architecture, comprising three main functional modules: feature extraction, temporal analysis, and output prediction. The feature extraction module consists of three convolutional neural network layers: the first convolutional layer uses 32 3×3 kernels with a stride of 1 and padding of 1; the second convolutional layer uses 64 3×3 kernels with a stride of 2 and padding of 1; and the third convolutional layer uses 128 2×2 kernels with a stride of 2 and no padding. Each convolutional layer is followed by a batch normalization layer and a ReLU activation function, and a max-pooling layer (2×2, stride 2) is used to reduce the feature map dimensionality. The temporal analysis module contains two stacked LSTM layers, each with 256 hidden units. The input is the flattened convolutional features, and the dropout rate is set to 0.3 to prevent overfitting. The multi-head attention mechanism layer contains five attention heads, corresponding to five main salinity intervals. Each attention head has a dimension of 64, the scaling factor of the attention layer is set to 8, and the mask parameters are dynamically adjusted according to the electrode state parameters. The output prediction module consists of a three-layer fully connected network with 128, 64, and 32 neurons respectively. The first two layers use the ReLU activation function with a dropout rate of 0.2, and the last layer uses a linear activation function to output the final predicted value. The total number of parameters in the model is approximately 2.4 million, which is reduced to approximately 600,000 after quantization and compression, making it suitable for deployment in embedded systems.

[0051] The specific implementation method for establishing the SalCorrNet ​​model training dataset first involves large-scale data collection, selecting sampling points covering different sea areas such as the North Pacific, South China Sea, and Persian Gulf to ensure that the salinity range covers the full spectrum from 20‰ to 45‰. Data was collected at each sampling point during spring, summer, autumn, and winter, recording salinity gradient data at different depths (0–200 meters, 10-meter intervals). An Autosal laboratory-grade salinity analyzer was used as the standard reference, achieving an accuracy of ±0.001. Experiments simulated different levels of electrode contamination (mild, moderate, and severe) to record the impact of contamination levels on measurement error. An original dataset containing a total of 50,000 samples was constructed, with each sample including an error spectral feature vector (10-dimensional) and corresponding correction parameters (5-dimensional). Data augmentation techniques were applied, including Gaussian noise addition (σ = 0.01–0.05), random scaling (factor range 0.95–1.05), and simulating extreme salinity fluctuations (±3‰), expanding the dataset to 100,000 samples. The training set, validation set, and test set are divided into three groups in an 8:1:1 ratio to ensure that the salinity distribution is similar in each set.

[0052] This invention relates to a portable CTD waterproof handheld device, an integrated hydrological monitoring instrument. The outer shell is made of a high-strength polycarbonate and stainless steel composite structure, with a waterproof rating of IP68, suitable for operation in water depths of up to 100 meters. Internally, it integrates three sensors—conductivity, temperature, and depth—and a signal processing system. The conductivity sensor uses four-electrode conductivity measurement technology, with a measurement range of 0–70 millisieverts / cm and an accuracy of ±0.003 millisieverts / cm. The temperature sensor uses platinum resistance technology, with a measurement range of -5℃ to 45℃ and an accuracy of ±0.01℃. The depth sensor uses a silicon piezoresistive pressure sensor, with a measurement range of 0–100 meters and an accuracy of ±0.1 meters. The signal processing system uses a 32-bit ARM processor, has 4GB of built-in storage, a 2.8-inch color TFT display, and is equipped with a GPS positioning module and a Bluetooth communication module. The power system uses a rechargeable lithium battery, providing a battery life of at least 12 hours. The software system integrates a salinity calculation module, an error correction module, and a data management module, supporting real-time data display, historical data query, and wireless data transmission functions.

[0053] The mathematical model or calculation process involved in this invention will be described in detail below.

[0054] In step S03, Fourier transform analysis is performed on the original error samples within each salinity interval to extract the error spectrum features and establish a model for the relationship between error and salinity. The specific calculation process is as follows:

[0055] First, the error data within each salinity interval are arranged in ascending order of salinity values ​​to form a time-series sequence. Then, the Fast Fourier Transform (FFT) algorithm is applied to transform the error data from the time domain to the frequency domain. The time-domain error sequence is represented as follows:

[0056] E = {e1, e2, ..., e} N};

[0057] In the formula, E is the error sequence; e i is the error value of the i-th sampling point, i.e., the difference between the measured salinity value and the actual salinity value; N is the sequence length.

[0058] Applying the Hanning window function to the error sequence reduces spectral leakage effects:

[0059] E w ={e1·w1, e2·w2, ..., e N ·w N};

[0060] In the formula, E w The error sequence after windowing; w i The i-th value of the Hanning window function is calculated using the formula w. i =0.5·(1-cos(2πi / (N-1))).

[0061] Perform a Fast Fourier Transform (FFT) on the windowed error sequence:

[0062] F = FFT(E) w )={F0,F1,...,F N-1};

[0063] In the formula, F represents the frequency domain; F k Let F be the k-th frequency component, which is a complex number. k =a k +b k j, where j is the imaginary unit.

[0064] Calculate the spectral amplitude and phase:

[0065]

[0066] φ k =arctan(b k / a k );

[0067] In the formula, A k φ is the amplitude of the k-th frequency component; k This represents the corresponding phase angle.

[0068] Extract the top 5 frequency components with the largest amplitude as the main error spectrum features:

[0069]

[0070] In the formula, A max For the set of maximum amplitude values; φ max For the corresponding set of phase angles; i1, i2, ..., i5 are the first 5 frequency indices after amplitude sorting.

[0071] Calculate the spectral energy distribution:

[0072]

[0073] In the formula, E total E represents the total spectral energy. ratio The energy percentage of the first 5 largest amplitude frequency components.

[0074] Constructing the error spectrum feature vector:

[0075]

[0076] In the formula, V spec This is an error spectrum feature vector containing 15 elements.

[0077] A model is established using multinomial regression to model the relationship between the error spectrum characteristics and salinity values ​​for each salinity interval:

[0078]

[0079] In the formula, f(S) is the prediction error; S is the salinity value; c j ∈ represents the polynomial coefficients; n represents the polynomial order, ranging from 3 to 5; ∈ represents the error term, whose standard deviation is usually less than 0.01.

[0080] The polynomial coefficients are solved using the least squares method:

[0081] C = (X T X) -1 X T Y;

[0082] In the formula, C is the coefficient vector [c0, c1, ..., c2]. n X is the design matrix for salinity values; Y is the vector of actual error values.

[0083] This polynomial regression model considers the nonlinear relationship between error and salinity, and the power-law form can better fit the error variation trend in each interval. Higher-order terms are used to capture abrupt error changes near salinity extremes, while lower-order terms reflect the overall trend.

[0084] In step S04, the salinity error compensation function receives the original salinity value, the measured temperature value, the measured depth value, and the electrode state parameters as input, and calculates the interval error correction coefficient and the error statistical feature vector. The specific calculation process is as follows:

[0085] The input parameters for the salinity error compensation function include:

[0086] S0: Original salinity value, in ‰;

[0087] T: Measured temperature value, in °C;

[0088] d: Measured depth value, in meters;

[0089] E: Electrode condition parameter, dimensionless, ranging from 0 to 1, where 0 indicates complete electrode contamination and 1 indicates optimal electrode condition.

[0090] For each salinity interval i, the interval error correction coefficient K i The calculation formula is:

[0091] K i =α i ·[1+β T ·(TT ref )+β D ·(DD ref )]·(1-γ·(1-E));

[0092] In the formula, α i The basic correction factor, which is related to the salinity range; β T This is a temperature correction parameter, with a value ranging from 0.01 to 0.03 °C; β D This is a depth correction parameter, with a value range of 0.001 to 0.003 / meter; T ref For reference temperature, 20℃ is usually taken; D ref The reference depth is usually taken as 0 meters; γ is the electrode state influence coefficient, with a value ranging from 0.1 to 0.3.

[0093] Basic correction factor α i The value varies depending on the salinity range:

[0094]

[0095] In the formula, w is the average value of the error samples within interval i; l The weighting coefficient for the low-salinity region is 0.8; w h This is the weighting coefficient for the high-salinity region, with a value of 1.2.

[0096] Error statistical eigenvector V stat The calculation is as follows:

[0097]

[0098]

[0099] V stat =[μ i , σ i , skew i , kurt i ];

[0100] In the formula, μ i σ is the mean of the error within interval i; i skew is the standard deviation; i skewness; kurt i For kurtosis; n i e is the number of samples within interval i; ij Let be the j-th error sample value within interval i.

[0101] Construction of the interval error correction coefficient matrix K:

[0102]

[0103] In the formula, K i K is the main correction coefficient for interval i; ij is the cross-correction coefficient between intervals i and j, used to smooth the correction effect at the interval boundaries; m is the total number of salinity intervals, usually 5.

[0104] Cross correction factor K ij The calculation uses a weighted average method:

[0105]

[0106] In the formula, d i and d j , respectively, are the distances from the current salinity value to the center of intervals i and j.

[0107] This salinity error compensation function considers the combined effects of temperature, depth, and electrode condition on salinity measurement, and balances the correction accuracy across different salinity ranges by introducing different weighting coefficients. The base correction coefficient reflects the average error level of each range, the temperature correction term considers the effect of temperature on conductivity measurement, the depth correction term considers the effect of pressure on conductivity measurement, and the electrode condition correction term considers the effect of electrode contamination on measurement accuracy.

[0108] In step S06, the adaptive weight adjustment algorithm is used to optimize the salinity error correction function, especially to reduce error fluctuations at high salinity extreme points. The calculation process is as follows:

[0109] First, the error correction values ​​predicted by the SalCorrNet ​​model are weighted and fused with the initial correction coefficients:

[0110] M fused =w pred ·M pred +(1-w pred )·K i ;

[0111] In the formula, M fused M is the corrected value after fusion. pred K represents the error correction value predicted by the SalCorrNet ​​model. i This is the initial correction factor; w pred To predict the weights, based on the prediction confidence C pred Dynamic adjustment.

[0112] Predicted weight w pred The calculation formula is as follows:

[0113]

[0114] In the formula, C pred The confidence level is predicted by the SalCorrNet ​​model output, with a value ranging from 0 to 1.

[0115] To address the error fluctuation problem at high salinity extreme points, an adaptive smoothing factor α is introduced:

[0116]

[0117] In the formula, α base β is the basic smoothing factor, with a value of 0.5; β is the salinity gradient influence coefficient, with a value of 0.1. It is the absolute value of the local salinity gradient, calculated by dividing the salinity difference between adjacent measurement points by the measurement interval.

[0118] The error correction values ​​of adjacent salinity points are locally weighted and averaged using the sliding window method.

[0119]

[0120] In the formula, M final (S0) is the final correction value; M fused (S0) is the fusion correction value for the current salinity point; W is a sliding window centered on S0, with a window width of ±1‰ of the salinity value; w j The weight of the j-th point within the window is calculated using the following formula: Where σ w This is the window weight decay parameter, with a value of 0.5.

[0121] The final optimized salinity error correction function is in piecewise form:

[0122]

[0123] In the formula, F corr (S) represents the final error correction function value corresponding to salinity S; S min and S max These are the minimum and maximum salinity values ​​covered by the training data, typically S min =20‰, S max =45‰.

[0124] This adaptive weight adjustment algorithm balances the contributions of model predictions and initial correction coefficients by dynamically adjusting prediction weights. By introducing an adaptive smoothing factor, it reduces error fluctuations at high-salinity extrema while maintaining correction accuracy. The sliding window weighted averaging method achieves local smoothing without affecting the global trend. Piecewise function design ensures the effectiveness of correction across the entire salinity range. The power and reciprocal relationships in the algorithm primarily consider the nonlinear characteristics of error changes in high-salinity environments, and the sliding window weighted averaging uses exponentially decaying weights to preserve local features.

[0125] In step S08, the dynamic temperature and pressure compensation mechanism is used to eliminate the influence of temperature and pressure changes on salinity error correction. Its calculation process is as follows:

[0126] First, a temperature influence model is established to determine the influence coefficient β of temperature change on conductivity measurement. T :

[0127]

[0128] In the formula, β T is the temperature influence coefficient, in units of / ℃; T is the measured temperature, in units of ℃.

[0129] Similarly, a pressure influence model is established to determine the influence coefficient β of pressure changes. P :

[0130]

[0131] In the formula, β P is the pressure influence coefficient, in meters; D is the measurement depth, in meters.

[0132] Based on these influence coefficients, the temperature and pressure compensation coefficient K is calculated. TP :

[0133] K TP =1+β T ·(TT ref )+β P·(DD ref );

[0134] In the formula, T ref For reference temperature, 20℃ is usually taken; D ref For reference depth, 0 meters is usually taken.

[0135] To cope with drastic changes in temperature and pressure, an adaptive factor λ is introduced:

[0136]

[0137] In the formula, λ is the adaptive factor, with a value ranging from 0 to 1; γ T γ is the influence coefficient of the rate of temperature change, with a value of 0.5; P The coefficient representing the influence of the rate of change of pressure is 0.3. This represents the absolute value of the rate of temperature change, expressed in °C / second. This represents the absolute value of the rate of change of depth, expressed in meters per second.

[0138] The final corrected result after temperature and pressure compensation is calculated as follows:

[0139]

[0140] In the formula, This is the final corrected result after temperature and pressure compensation; M final This is the final correction value obtained in step S06.

[0141] This dynamic temperature and pressure compensation mechanism describes the variation of the temperature influence coefficient within different temperature ranges using a piecewise function, and the variation of the pressure influence coefficient with depth using a linear function. An adaptive factor is introduced to address situations with drastic temperature and pressure changes. Specifically, the temperature influence model considers the nonlinear variation of conductivity with temperature, the pressure influence model considers the impact of seawater compression due to increasing depth on conductivity, and the adaptive factor is designed to account for the hysteresis effect of drastic environmental changes on the sensor response.

[0142] Specifically, the principle of this invention is as follows: The core technical principle of this invention is based on a comprehensive correction strategy that combines error spectrum feature extraction with deep learning, thereby improving measurement accuracy in high salinity environments through multi-level error identification, modeling, and compensation.

[0143] First, this invention employs a stratified sampling method to divide the original error samples into several intervals according to the salinity concentration gradient, ensuring that the correction model can cover the entire measurement range and solving the problem of insufficient adaptability of traditional single calibration models in different salinity intervals. Fourier transform analysis is performed on the original error samples within each salinity interval, converting time-domain error information into frequency-domain features, which can effectively capture the periodic variation patterns and frequency distribution characteristics of errors under different salinity environments. Compared with traditional time-domain analysis, this spectral analysis method can more accurately identify the inherent patterns of measurement errors under high salinity environments.

[0144] Secondly, this invention introduces a pre-trained SalCorrNet ​​neural network model. This model employs a deep learning architecture combining a multilayer perceptron and a recurrent neural network, enabling the establishment of nonlinear error mapping relationships. The three-layer convolutional neural network of the SalCorrNet ​​model is used to extract local characteristics of the error spectrum features, the two-layer long short-term memory network can capture the temporal variation patterns of the error, and the multi-head attention mechanism is used to distinguish between electrode contamination errors and nonlinear conductivity errors in high-salinity environments. This composite deep learning architecture allows the system to automatically learn feature representations of different error types, thereby achieving more accurate error correction.

[0145] Finally, this invention achieves real-time response and compensation to changes in environmental factors through an adaptive weight adjustment algorithm and a dynamic temperature and pressure compensation mechanism. The adaptive weight adjustment algorithm dynamically allocates correction parameter weights according to the error distribution characteristics within different salinity ranges, effectively improving measurement accuracy near extreme points. The dynamic temperature and pressure compensation mechanism performs multi-parameter joint correction on salinity measurements based on real-time temperature and pressure change data, ensuring the stability of measurement accuracy under various environmental conditions.

[0146] Through this multi-level and multi-dimensional comprehensive correction strategy, the present invention achieves effective correction of measurement errors of CTD waterproof handheld devices in high salinity environments, and solves the technical problem of insufficient accuracy of traditional correction methods under extreme salinity conditions.

[0147] The following provides a specific embodiment 1 of the present invention, and the specific implementation of each step in this embodiment 1 is described in detail below.

[0148] The specific implementation method of step S01 is the same as described above, and will not be repeated here.

[0149] The specific implementation of step S03 involves performing frequency domain analysis on the original error samples within each salinity interval. First, the error data within each interval are arranged in ascending order of salinity values ​​to form a time-series sequence. Then, the Fast Fourier Transform (FFT) algorithm is applied to transform the error data from the time domain to the frequency domain. The time-domain error sequence is represented as follows:

[0150] E = {e1, e2, ..., e} N};

[0151] In the formula, E is the error sequence; e i is the error value of the i-th sampling point, i.e., the difference between the measured salinity value and the actual salinity value; N is the sequence length.

[0152] During the conversion process, a Hanning window function is used to reduce spectral leakage, with a window length set to 128 points. The Hanning window function is applied to the error sequence:

[0153] E w ={e1·w1, e2·w2, ..., e N ·w N};

[0154] In the formula, E w The error sequence after windowing; w i The i-th value of the Hanning window function is calculated using the formula w. i =0.5·(1-cos(2πi / (N-1))).

[0155] Perform a Fast Fourier Transform on the windowed error sequence:

[0156] F = FFT(E) w )={F0,F1,...,F N-1};

[0157] In the formula, F represents the frequency domain; F k Let F be the k-th frequency component, which is a complex number. k =a k +b k j, where j is the imaginary unit.

[0158] Calculate the spectral amplitude and phase:

[0159]

[0160] φ k =arctan(b k / a k );

[0161] In the formula, A k φ is the amplitude of the k-th frequency component; k This represents the corresponding phase angle.

[0162] By analyzing the converted spectrum, the main frequency components and their corresponding amplitudes are extracted, and the top 5 frequency components with the largest amplitudes are defined as the main error spectrum features:

[0163]

[0164]

[0165] In the formula, A max For the set of maximum amplitude values; φ max For the corresponding set of phase angles; i1, i2, ..., i5 are the first 5 frequency indices after amplitude sorting.

[0166] Calculate the spectral energy distribution and energy percentage:

[0167]

[0168] In the formula, E total E represents the total spectral energy. ratio The energy percentage of the first 5 largest amplitude frequency components.

[0169] Based on these spectral characteristics, an error spectral feature vector is constructed:

[0170]

[0171] In the formula, V spec This is an error spectrum feature vector containing 15 elements.

[0172] Then, the relationship between the error spectrum characteristics of each salinity interval and the salinity value is fitted using the least squares method to establish a multinomial regression model:

[0173]

[0174] In the formula, f(S) is the prediction error; S is the salinity value; c j ∈ represents the polynomial coefficients; n represents the polynomial order, usually chosen as 3 to 5; ∈ represents the error term, whose standard deviation is usually less than 0.01.

[0175] The polynomial coefficients are solved using the least squares method:

[0176] C = (X T X) -1 X T Y;

[0177] In the formula, C is the coefficient vector [c0, c1, ..., c2]. n X is the design matrix for salinity values; Y is the vector of actual error values.

[0178] The purpose of this step is to reveal the periodic variation pattern of measurement errors under different salinity environments from a frequency domain perspective, providing spectral characteristics as a basis for subsequent error correction. The establishment of this polynomial regression model considers the nonlinear relationship between error and salinity, and the use of a power-law form can better fit the error variation trend within each interval.

[0179] The specific implementation of step S04 involves constructing and calling a salinity error compensation function for data preprocessing. This function first receives the original salinity value S0, the measured temperature value T, the measured depth value D, and the electrode state parameter E as input parameters. The electrode state parameter E is a dimensionless parameter, ranging from 0 to 1, where 0 indicates complete electrode contamination and 1 indicates optimal electrode condition.

[0180] For each salinity interval i, calculate the interval error correction coefficient K. i The calculation formula is:

[0181] K i =α i ·[1+β T ·(TT ref )+β D ·(DD ref )]·(1-γ·(1-E));

[0182] In the formula, α i The basic correction factor, which is related to the salinity range; β T This is a temperature correction parameter, with a value ranging from 0.01 to 0.03 °C; β D This is a depth correction parameter, with a value range of 0.001 to 0.003 / meter; T ref For reference temperature, 20℃ is usually taken; D ref The reference depth is usually taken as 0 meters; γ is the electrode state influence coefficient, with a value ranging from 0.1 to 0.3.

[0183] Basic correction factor α i The value varies depending on the salinity range:

[0184]

[0185] In the formula, w is the average value of the error samples within interval i; l The weighting coefficient for the low-salinity region is 0.8; w h This is the weighting coefficient for the high-salinity region, with a value of 1.2.

[0186] Simultaneously, the error statistical feature vector is calculated, which includes four statistical measures: mean, standard deviation, skewness, and kurtosis.

[0187]

[0188] V stat =[μ i , σ i , skew i , kurt i ];

[0189] In the formula, μi σ is the mean of the error within interval i; i skew is the standard deviation; i skewness; kurt i For kurtosis; n i e is the number of samples within interval i; ij Let be the j-th error sample value within interval i.

[0190] The error correction coefficient matrix for each salinity range is constructed as follows:

[0191]

[0192] In the formula, K i K is the main correction coefficient for interval i; i j is the cross-correction coefficient between intervals i and j; m is the total number of salinity intervals, usually 5.

[0193] Cross correction factor K ij The calculation uses a weighted average method:

[0194]

[0195] In the formula, d i and d j , respectively, are the distances from the current salinity value to the center of intervals i and j.

[0196] The purpose of this step is to establish a preliminary error correction framework, provide basic error correction coefficients, and offer preprocessed data support for subsequent deep learning models. This salinity error compensation function considers the combined effects of temperature, depth, and electrode condition on salinity measurement, and balances the correction accuracy across different salinity ranges by introducing different weighting coefficients.

[0197] The specific implementation method of step S05 is the same as described above, and will not be repeated here.

[0198] The specific implementation of step S06 is to optimize the salinity error correction function based on the output of the SalCorrNet ​​model. First, the error correction value predicted by the model is weighted and fused with the preliminary correction coefficients from S04:

[0199] M fused =w pred ·M pred +(1-w pred )·K i ;

[0200] In the formula, M fused M is the corrected value after fusion. pred K represents the error correction value predicted by the SalCorrNet ​​model. iThis is the initial correction factor; w pred To predict the weights, based on the prediction confidence C pred Dynamic adjustment.

[0201] Predicted weight w pred The calculation formula is:

[0202]

[0203] In the formula, C pred The confidence level is predicted by the SalCorrNet ​​model output, with a value ranging from 0 to 1.

[0204] To address the error fluctuation problem at high salinity extreme points (salinity > 42‰), an adaptive smoothing factor α is introduced:

[0205]

[0206] In the formula, α base β is the basic smoothing factor, with a value of 0.5; β is the salinity gradient influence coefficient, with a value of 0.1. It is the absolute value of the local salinity gradient, calculated by dividing the salinity difference between adjacent measurement points by the measurement interval.

[0207] The error correction values ​​of adjacent salinity points are locally weighted and averaged using a sliding window method (window width set to salinity value ±1‰):

[0208]

[0209] In the formula, M final (S0) is the final correction value; M fused (S0) is the fusion correction value for the current salinity point; W is the sliding window centered on S0; w j The weight of the j-th point within the window is calculated using the following formula: Where σ w This is the window weight decay parameter, with a value of 0.5.

[0210] The final optimized salinity error correction function is in piecewise form:

[0211]

[0212] In the formula, F corr (S) represents the final error correction function value corresponding to salinity S; S min and S max These are the minimum and maximum salinity values ​​covered by the training data, typically S min =20‰, S max =45‰.

[0213] The purpose of this step is to further optimize the error correction function, improve the correction accuracy at extreme points, and reduce error fluctuations under high salinity conditions. This adaptive weight adjustment algorithm balances the contributions of model predictions and initial correction coefficients by dynamically adjusting the prediction weights; and by introducing an adaptive smoothing factor, it reduces error fluctuations at high salinity extreme points while maintaining correction accuracy.

[0214] The specific implementation method of step S07 is the same as described above, and will not be repeated here.

[0215] The specific implementation of step S08 involves constructing a dynamic temperature and pressure compensation mechanism to eliminate the influence of environmental factors on salinity error correction. First, a temperature influence model is established to determine the influence coefficient β of temperature changes on conductivity measurement. T :

[0216]

[0217] In the formula, β T is the temperature influence coefficient, in units of / ℃; T is the measured temperature, in units of ℃.

[0218] Similarly, a pressure influence model is established to determine the influence coefficient β of pressure changes. P :

[0219]

[0220] In the formula, β P is the pressure influence coefficient, in meters; D is the measurement depth, in meters.

[0221] Based on these influence coefficients, a temperature and pressure compensation function is designed, and the temperature and pressure compensation coefficient K is calculated. TP :

[0222] K TP =1+β T ·(TT ref )+β P ·(DD ref );

[0223] In the formula, T ref For reference temperature, 20℃ is usually taken; D ref For reference depth, 0 meters is usually taken.

[0224] To cope with drastic changes in temperature and pressure, an adaptive factor λ is introduced:

[0225]

[0226] In the formula, λ is the adaptive factor, with a value ranging from 0 to 1; γ T γ is the influence coefficient of the rate of temperature change, with a value of 0.5; PThe coefficient representing the influence of the rate of change of pressure is 0.3. This represents the absolute value of the rate of temperature change, expressed in °C / second. This represents the absolute value of the rate of change of depth, expressed in meters per second.

[0227] Multiply the temperature and pressure compensation coefficient by the error correction value optimized in step S06 to obtain the final correction result after temperature and pressure compensation:

[0228]

[0229] In the formula, This is the final corrected result after temperature and pressure compensation; M final This is the final correction value obtained in step S06.

[0230] This compensation mechanism employs an adaptive algorithm to dynamically adjust the compensation intensity based on the rates of temperature and pressure change, ensuring stable measurement accuracy even under drastic temperature and pressure fluctuations (such as crossing thermoclines). The aim of this step is to eliminate the interference of temperature and pressure changes on salinity measurements through a multi-parameter joint correction method, thereby improving the stability and reliability of salinity measurements under various environmental conditions.

[0231] To better understand and implement this invention, a specific application scenario is provided below as Example 2: A certain sea area exhibits high and unevenly distributed salinity due to unique climatic and geographical conditions. In traditional CTD waterproof handheld measurements, when seawater salinity exceeds 35‰, the measurement error amplifies significantly with increasing salinity, severely impacting marine scientific research and operations. To address this issue, researchers have applied a measurement error correction method for CTD waterproof handheld devices in high-salinity environments, as described in this invention, in a practical application.

[0232] First, researchers selected 15 test points in different areas of the sea area to be tested, representing low salinity areas (20‰–28‰), standard seawater areas (28‰–35‰), and high salinity areas (35‰–45‰). Multiple samples were taken at each test point using a CT-H810 waterproof CTD handheld device, and water samples were simultaneously sent to the onboard laboratory for precise salinity determination. A total of 185 sets of raw error sample data were recorded, as shown in Table 1.

[0233] Table 1. CTD measurement data and error samples for different salinity regions.

[0234]

[0235]

[0236] The second step involved stratified sampling of the collected original error samples, dividing them into five main ranges based on salinity: 20‰–25‰, 25‰–30‰, 30‰–35‰, 35‰–40‰, and 40‰–45‰. For high-salinity areas, the range above 40‰ was further subdivided into three sub-ranges: 40‰–42‰, 42‰–44‰, and 44‰–46‰, to ensure accurate capture of error characteristics at extreme high-salinity points. During sampling, at least 30 samples were collected for each range. For extremely high-salinity ranges (44‰–46‰) with fewer samples, oversampling techniques were used to increase the sample size to 35.

[0237] In the third step, the researchers performed frequency domain analysis on the original error samples within each salinity range. Taking the 40‰–42‰ salinity range as an example, the 38 error samples in this range were arranged in ascending order of salinity value to form a time series. The Fast Fourier Transform (FFT) algorithm was applied, and the Hanning window function was used for spectral analysis. The first five main error spectral features extracted, along with their corresponding amplitudes and phase angles, are shown in Table 2.

[0238] Table 2. Analysis Results of Error Spectrum Characteristics in the Salinity Range of 40‰~42‰

[0239] Feature number Frequency (Hz) Amplitude Phase angle (rad) Energy percentage (%) 1 0.015 0.75 0.42 38.5 2 0.048 0.58 1.23 23.1 3 0.103 0.43 2.18 12.7 4 0.156 0.28 0.87 5.4 5 0.192 0.26 1.65 4.6

[0240] Based on the aforementioned spectral characteristics, researchers established an error spectral feature vector and used a fourth-order polynomial regression model to fit the relationship between the error and salinity values ​​for each salinity interval. For the 40‰–42‰ interval, the fitted polynomial coefficients were c0 = 12.568, c1 = -1.235, c2 = 0.0478, and c3 = -8.24 × 10⁻⁶. -4 c4 = 5.31 × 10 -6 The standard deviation of the fitting error is 0.0086.

[0241] Fourthly, the researchers constructed and invoked a salinity error compensation function for data preprocessing. In practical applications, the average temperature of the measurement environment was 28.6℃, the average depth was 25.4 meters, and the electrode state parameter was 0.92 (indicating good electrode condition). For the high salinity range (40‰~42‰), the calculated basic correction coefficient α... 40-42 =0.975, temperature correction parameter β t =0.0216 / ℃, depth correction parameter β p = 0.0015 / meter. Based on these parameters, the error correction coefficient K for this interval is calculated. 40-42 =1.047. The error statistical eigenvector was also calculated, including statistics such as mean 0.815, standard deviation 0.093, skewness 0.276, and kurtosis 2.912.

[0242] Next, the researchers introduced a pre-trained SalCorrNet ​​neural network model for in-depth error analysis. This model had been pre-trained on 82,500 data points covering regions including the North Pacific and the Persian Gulf. Inputting the error spectrum feature vector in the 40‰–42‰ range into the SalCorrNet ​​model, the model output an error correction prediction value of 0.832 and a prediction confidence level of 0.91.

[0243] In step six, the researchers optimized the salinity error correction function based on the prediction results of the SalCorrNet ​​model. Since the prediction confidence level was 0.91 (greater than 0.85), the calculated prediction weights w... prep =0.891. The local average salinity gradient is 0.42‰ / m, and the calculated adaptive smoothing factor α = 0.458. The sliding window method is used to perform a local weighted average of the error correction values ​​of adjacent salinity points, and finally the final correction value M_final = 0.856 is obtained in the interval of 40‰ to 42‰.

[0244] The seventh step involved integrating the optimized salinity error correction function into the internal calibration module of the CTD waterproof handheld device. Researchers converted the correction function into a two-dimensional lookup table, with the horizontal axis representing salinity values ​​(in 0.5‰ increments) and the vertical axis representing temperature values ​​(in 1°C increments). The elements in the table represent correction coefficients under the corresponding conditions. Partial lookup table data is shown in Table 3.

[0245] Table 3 Salinity-Temperature Correction Coefficient Lookup Table (Partial)

[0246] Salinity (‰) / Temperature (°C) 20 21 22 23 24 25 40.0 0.836 0.839 0.843 0.846 0.850 0.854 40.5 0.846 0.849 0.853 0.857 0.861 0.864 41.0 0.867 0.870 0.874 0.878 0.882 0.886 41.5 0.898 0.902 0.906 0.910 0.914 0.918 42.0 0.932 0.936 0.940 0.944 0.948 0.953

[0247] In step eight, the researchers constructed a dynamic temperature and pressure compensation mechanism. In practical applications, the highest temperature change rate reached 0.42°C / second, and the highest depth change rate reached 0.38 m / second. Based on these parameters, the temperature and pressure compensation coefficient K was calculated. tp P = 1.182, adaptive factor λ = 0.638, and the final correction result after temperature and pressure compensation M*_final = 0.913.

[0248] Finally, the researchers conducted systematic experimental verification. Comparative tests were carried out at three typical high-salinity test points in the sea area to be tested. Measurements were simultaneously performed using a CTD waterproof handheld device with integrated error correction function and an uncorrected version of the same model. Sixty sets of data were recorded at each test point. The experimental results are shown in Table 4:

[0249] Table 4 Comparison of measurement errors before and after correction

[0250]

[0251] This embodiment successfully solves the problem of decreased measurement accuracy of CTD waterproof handheld devices in high-salinity environments by introducing techniques such as error spectrum analysis, salinity error compensation function, SalCorrNet ​​deep learning model, adaptive weight adjustment algorithm, and dynamic temperature and pressure compensation mechanism. Compared with traditional technical solutions, this invention has the following significant advantages:

[0252] Traditional CTD measurement error correction methods in high-salinity environments primarily employ linear calibration or simple polynomial fitting, which cannot adapt to the nonlinear response characteristics of conductivity sensors in high-salinity environments. This results in limited correction accuracy, especially in extreme regions where salinity exceeds 40‰, where errors can even exceed 2‰. This invention, by introducing frequency domain analysis and deep learning techniques, can accurately capture the complex nonlinear characteristics of measurement errors in high-salinity environments, reducing the average absolute error in high-salinity regions (>35‰) from 1.16‰ to 0.31‰, a reduction of 73.3%.

[0253] Traditional methods typically ignore the impact of temperature and pressure changes on salinity measurements or employ simple linear compensation methods, which can significantly increase errors in environments with drastic temperature and pressure changes (such as crossing thermoclines). The dynamic temperature and pressure compensation mechanism introduced in this invention can adaptively adjust the compensation intensity based on real-time changes in temperature and depth, effectively eliminating interference from environmental factors and ensuring stable measurement accuracy under various environmental conditions.

[0254] Traditional methods often struggle to adapt to varying sea areas and seasons after model correction, requiring frequent recalibration. This invention utilizes the SalCorrNet ​​deep learning model and an adaptive weight adjustment algorithm to achieve adaptive optimization of the correction method, enabling it to adapt to changes in different sea areas and measurement conditions, significantly improving the method's versatility and practicality.

[0255] It should be noted that the variables involved in this invention are explained in detail in Tables 5 and 6 below.

[0256] Table 5. Variable Explanation Table (Part 1)

[0257]

[0258] Table 6. Variable Explanation Table (Part Two)

[0259]

[0260]

[0261] The above description is merely a specific embodiment of the present invention, but the scope of protection of the present invention is not limited thereto. Any changes or substitutions that can be easily conceived by those skilled in the art within the scope of the technology disclosed in the present invention should be included within the scope of protection of the present invention.

Claims

1. A method for correcting measurement errors in a CTD waterproof handheld device under high salinity conditions, characterized in that, include: Multiple sets of measurement data were collected using a CTD waterproof handheld device under high salinity conditions, and the deviation between the actual salinity value and the measured value was recorded as the original error sample. The original error samples were divided into several intervals according to the salinity concentration gradient using a stratified sampling method; Fourier transform analysis was performed on the original error samples in each salinity interval to extract error spectrum features and establish a model of the relationship between error and salinity; the salinity error compensation function was called to perform error correction preprocessing; a pre-trained salinity error neural network model SalCorrNet ​​was introduced to analyze the error spectrum features and construct a nonlinear error mapping relationship. The salinity error correction function is optimized based on the output of the SalCorrNet ​​model, and an adaptive weight adjustment algorithm is used to reduce the error fluctuation at high salinity extreme points. The optimized salinity error correction function is integrated into the internal calibration module of the CTD waterproof handheld device. A dynamic temperature and pressure compensation mechanism is established to eliminate the impact of temperature and pressure changes on the accuracy of the salinity error correction function. Among them, the dynamic temperature and pressure compensation mechanism refers to the joint correction of salinity measurement values ​​based on real-time temperature and pressure change data; the adaptive weight adjustment algorithm refers to the dynamic allocation of correction parameter weights according to the error distribution characteristics in different salinity ranges. The SalCorrNet ​​model is a deep learning architecture that combines a multilayer perceptron and a recurrent neural network. It includes a three-layer convolutional neural network for extracting local features of the error spectrum, a two-layer long short-term memory network for capturing the temporal change pattern of the error, a multi-head attention mechanism for distinguishing between electrode contamination error and nonlinear conductivity error in high-salinity environment, and a three-layer fully connected network for outputting correction parameters.

2. The method for correcting measurement errors in high-salinity environments using a waterproof CTD handheld device according to claim 1, characterized in that, A stratified sampling method was used to divide the original error samples into several intervals according to the salinity concentration gradient, ensuring that the data covered the entire measurement range.

3. The method for correcting measurement errors in a high-salinity environment using a waterproof CTD handheld device according to claim 2, characterized in that, Error spectrum characteristics refer to the periodic variation characteristics obtained by performing frequency domain analysis on measurement error data, including amplitude, phase, and frequency distribution.

4. The method for correcting measurement errors in high-salinity environments using a waterproof CTD handheld device according to claim 3, characterized in that, The salinity error compensation function is used to perform preliminary processing on the original error samples and calculate the error correction coefficients for each salinity interval. The inputs include the original salinity value, the measured salinity value, the measured temperature value, the measured depth value, and the electrode state parameters. The output is the salinity interval error correction coefficient matrix and the error statistical feature vector.

5. The method for correcting measurement errors in a high-salinity environment using a waterproof CTD handheld device according to claim 4, characterized in that, The number of heads in the multi-head attention mechanism is determined based on the number of salinity intervals, the weight attenuation parameter is determined based on the amplitude distribution of the error spectrum characteristics, and the attention mask parameter is determined based on the degree of fluctuation of the electrode state parameters.

6. The method for correcting measurement errors in a high-salinity environment using a waterproof CTD handheld device according to claim 5, characterized in that, The steps for establishing the training dataset during the pre-training process of the SalCorrNet ​​model include collecting salinity gradient measurement data at multiple depths in different sea areas and seasons, using high-precision laboratory-grade analytical instruments to obtain standard salinity values ​​as true references, recording measurement error cases in high-salinity environments under various electrode conditions, and labeling the relationship between electrode contamination levels and error types.

7. The method for correcting measurement errors in a high-salinity environment using a waterproof CTD handheld device according to claim 6, characterized in that, The pre-training process of the SalCorrNet ​​model also includes building a supervised learning dataset containing the correspondence between error spectrum feature vectors and correction parameters, applying data augmentation techniques to simulate measurement scenarios under extreme salinity conditions, and establishing validation and test sets for model evaluation and to prevent overfitting.