Electrochemical sensing method and system for heavy metal ion detection in food

CN122882573APending Publication Date: 2026-10-09NANJING ZHENKE TESTING TECHNOLOGY CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202611110776.8
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2026-07-24
Publication Date
2026-10-09

AI Technical Summary

Technical Problem

若建模时未考虑此类相位效应,仅以失真的峰值参数作为输入特征,将导致机器学习模型在训练集上过拟合特定基质条件,而在新样本(如不同品牌大米、蔬菜汁液等)中泛化能力急剧下降,尤其在低浓度区间或高干扰背景下产生显著定量偏差,降低浓度预测精度

Benefits of technology

[0045]与现有技术相比,本申请提供的用于食品中重金属离子检测的电化学传感方法及系统,针对多金属共存体系中因忽略溶出电流相位耦合效应而导致定量失准的问题,通过二阶微分精确界定各重金属离子的有效溶出峰宽,并在此基础上计算一组结构化指标,包括峰值电位间距与有效峰宽差值比、峰形偏度指数、归一化失真度、峰间重叠度及基质漂移敏感度等。基于这些指标设定复合阈值逻辑,能够将传统笼统视为峰重叠的信号进一步细分为不同畸变主导的工况类型,特别是精准识别出由共沉积层中金属间电子相互作用、扩散边界层遮蔽及局部双电层动态扰动所引发的交叉相位偏移工况。针对该工况,本发明不再依赖对失真峰值电流的直接使用,而是通过局部高斯洛伦兹混合函数拟合重叠区域,并结合敏感因子计算交叉相位偏移特征。该偏移特征作为补偿特征与原始峰值参数、有效峰宽及工况标签共同构成混合特征向量输入神经网络模型。由此,模型得以学习到浓度变化与相位偏移之间的内在映射关系,而非被动接受被耦合干扰的电流信号,从而在复杂基质下实现对多金属离子浓度的高精度反演,提高浓度预测精度。

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122882573A_ABST
    Figure CN122882573A_ABST
Patent Text Reader

Abstract

The application provides an electrochemical sensing method and system for heavy metal ion detection in food, and relates to the technical field of heavy metal detection, and comprises the following steps: constructing a plurality of peak interference degree discrimination indexes according to the effective dissolution peak width and the voltammetric current potential curve; executing judgment logic to generate a plurality of matrix offset distortion dominant working conditions; calculating corresponding offset characteristics based on the matrix offset distortion dominant working conditions; identifying the peak current and the peak potential of each heavy metal ion based on the voltammetric current potential curve; splicing the peak current, the peak potential, the effective dissolution peak width, the offset characteristics of each working condition and the peak interference degree discrimination indexes to form a mixed feature vector, and taking the mixed feature vector as input data of a neural network model to perform prediction, so as to obtain the predicted concentration of each heavy metal ion. Therefore, the high-precision inversion of the concentration of multiple metal ions under a complex matrix is realized, and the concentration prediction accuracy is improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of heavy metal detection and identification technology, and in particular to an electrochemical sensing method and system for detecting heavy metal ions in food. Background Technology

[0002] In food safety testing, anodic stripping voltammetry is widely used for the detection of trace heavy metal ions (such as Pb²⁺, Cd²⁺, Hg²⁺, As³⁺, etc.) in food due to its advantages such as high sensitivity, ease of operation, and suitability for on-site analysis. This method relies on the characteristic current peaks generated by the oxidation and dissolution of different metal ions at specific potentials, and achieves qualitative and quantitative analysis by identifying the peak potential and peak current.

[0003] However, in actual food samples, multiple heavy metal ions often coexist, and their standard dissolution potentials are similar (for example, the dissolution peaks of Pb²⁺ and Cd²⁺ typically differ by only tens of millivolts), leading to significant peak overlap on the voltammetric curves. Traditional processing strategies often simplify this phenomenon to a peak overlap problem, using methods such as smoothing filtering, empirical peak division, or fixed correction factors for compensation. However, research shows that this simplification ignores a deeper physicochemical mechanism: in multi-metal coexistence systems, when two or more heavy metal ions dissolve at similar potentials, not only do the peak shapes overlap spatially, but the instantaneous phase response of their dissolution currents also undergoes a coupling shift.

[0004] This phase shift is not caused by external interference such as instrument noise, temperature drift, or global baseline drift, but by complex many-body interactions at the electrode / solution interface, mainly including: (1) the electronic coupling effect between atoms in the co-deposited metal layer (e.g., Pb and Cd easily form local alloy phases on mercury or bismuth film electrodes, changing their respective oxidation kinetics); (2) the dynamic disturbance of the local microenvironment (e.g., pH, ionic strength, double layer structure) during dissolution; and (3) the mutual shielding and competitive mass transfer effect between adjacent ion diffusion boundary layers. These factors together cause that even with a fixed concentration ratio and the same experimental conditions, in different batches or different food matrices, the oxidation peaks of Pb and Cd not only undergo a systematic shift in peak potential, but the differential slopes of the rising and falling edges of their current response in the time potential domain also exhibit a repeatable but nonlinear relative phase shift.

[0005] This phase shift manifests in the original voltammetric signal as subtle but structural distortions such as asymmetrical peak shoulders, split inflection points, and shifts in the zero point of the second derivative. If such phase effects are not considered during modeling, and only distorted peak parameters are used as input features, the machine learning model will overfit to specific matrix conditions on the training set, while its generalization ability will drop sharply on new samples (such as different brands of rice, vegetable juice, etc.), especially in low concentration ranges or under high interference backgrounds, resulting in significant quantitative bias and reduced concentration prediction accuracy. Summary of the Invention

[0006] This application aims to at least partially address one of the technical problems in the related art.

[0007] To achieve the above objectives, embodiments of this application propose an electrochemical sensing method for detecting heavy metal ions in food, comprising the following steps:

[0008] Step 1: Acquire the voltammetric current-potential curve of the food sample under test during the anodic dissolution stage using an electrochemical sensor; the voltammetric current-potential curve includes multiple sampling points, each sampling point being a one-to-one corresponding current and potential;

[0009] Step 2: Perform second-order differential processing on the current-potential curve to obtain the second-derivative curve; identify zero-crossing pairs based on the second-derivative curve, and calculate the effective dissolution peak width of each heavy metal ion based on the zero-crossing pairs.

[0010] Step 3: Based on the effective dissolution peak width and the current-voltage curve, construct multiple inter-peak interference discrimination indices, and execute the judgment logic to generate multiple matrix shift distortion dominant operating conditions;

[0011] Step 4: Calculate the corresponding offset features based on each of the matrix offset distortion dominant conditions;

[0012] Step 5: Based on the current-voltage curve, identify the peak current and peak potential of each heavy metal ion. Then, combine the peak current, peak potential, effective dissolution peak width, offset characteristics of each operating condition, and inter-peak interference discrimination index to form a mixed feature vector. Use this vector as input data for the neural network model to make predictions and obtain the predicted concentration of each heavy metal ion.

[0013] Furthermore, several matrix offset distortion-dominated conditions include: cross-phase offset condition, asymmetric distortion condition, and matrix drift-dominated condition.

[0014] Furthermore, based on the effective dissolution peak width and the current-voltage curve, multiple inter-peak interference discrimination indices are constructed, and judgment logic is executed to generate multiple matrix shift distortion-dominant operating conditions, including the following steps:

[0015] Step 31: Based on the standard dissolution potential window of each heavy metal ion, identify the local current maximum point of the volt-ampere current potential curve, and take the potential corresponding to the local current maximum point as the candidate peak potential.

[0016] Step 32: If the candidate peak potential is located inside the zero-crossing pair, then the current heavy metal ion is recorded as an effective heavy metal ion; otherwise, the process ends.

[0017] Step 33: Based on any two of the heavy metal effective ions, obtain the peak potential and calculate the peak potential difference, which is recorded as the peak potential interval; if the peak potential interval is less than a preset neighborhood threshold, then determine that the two current heavy metal effective ions are adjacent heavy metal effective ion pairs; otherwise, determine that the two current heavy metal effective ions are non-adjacent heavy metal effective ion pairs, and end.

[0018] Step 34: Calculate the absolute value of the difference between the effective dissolution peak widths of the two effective heavy metal ions in the adjacent effective heavy metal ion pairs; calculate the ratio between the absolute value of the difference and the peak potential spacing to obtain the cross-phase sensitivity factor.

[0019] Step 35: Based on each of the effective heavy metal ions, according to the left zero-crossing point, right zero-crossing point and peak potential defined by the effective dissolution peak width, calculate the potential span from the left zero-crossing point to the peak potential as the left half-peak width, and the potential span from the peak potential to the right zero-crossing point as the right half-peak width; calculate the ratio of the left half-peak width to the right half-peak width to obtain the peak skewness index.

[0020] Step 36: Based on the potential range corresponding to the effective dissolution peak width of each heavy metal effective ion, divide the region into a left sub-range and a right sub-range, with the peak potential of the current heavy metal effective ion as the boundary; based on the current-voltage curve of the current heavy metal effective ion in the left sub-range, determine the left peak edge response span, the right peak edge response span and the number of high curvature points, and execute the judgment conditions to generate normalized distortion.

[0021] Step 37: Based on the potential ranges corresponding to the effective dissolution peak widths of the two heavy metal ions, calculate the interval intersection length and interval union length, and use the ratio of the interval intersection length and interval union length as the inter-peak overlap index.

[0022] Step 38: Obtain a set of lower limit values ​​for the effective heavy metal ions within the corresponding standard dissolution potential window, and take the minimum value of the set of lower limit values ​​as the dissolution initiation potential; obtain the segment of the volt-ampere current-potential curve between the dissolution initiation potential and the minimum peak potential among all effective heavy metal ions; if the dissolution initiation potential is the same as the minimum peak potential, set the baseline slope to 0; otherwise, perform linear regression on the sampling points of the segment to obtain the baseline slope; define the ratio of the absolute value of the baseline slope to the maximum absolute value of the peak current among all effective heavy metal ions as the matrix drift sensitivity index.

[0023] Step 39: Based on the cross-phase sensitivity factor, peak skewness index, normalized peak distortion, inter-peak overlap index, and matrix drift sensitivity index, execute a multi-dimensional threshold composite judgment logic: when the cross-phase sensitivity factor is greater than the first threshold and the inter-peak overlap index is greater than the second threshold, the current-voltage curve is determined to belong to the cross-phase shift dominant condition; when the peak skewness index is less than the third threshold or greater than the fourth threshold, and the normalized peak distortion is greater than the fifth threshold, the current-voltage curve is determined to belong to the asymmetric distortion dominant condition; when the matrix drift sensitivity index is greater than the sixth threshold, and the cross-phase sensitivity factor is less than the first threshold, the inter-peak overlap index is less than the second threshold, the peak skewness index is within the target range, and the normalized peak distortion is less than the fifth threshold, the current-voltage curve is determined to belong to the matrix drift dominant condition; if none of the above conditions are met, no matrix shift distortion dominant condition is generated.

[0024] Furthermore, based on the potential range corresponding to the effective dissolution peak width of each effective heavy metal ion in the effective heavy metal ion pair, the system is divided into a left sub-range and a right sub-range, with the peak potential of the current effective heavy metal ion as the boundary. Based on the current-voltage curve of the current effective heavy metal ion in the left sub-range, the response span of the left peak edge, the response span of the right peak edge, and the number of high curvature points are determined, and judgment conditions are applied to generate normalized distortion, including the following steps:

[0025] Step 361: Based on the potential range corresponding to the effective dissolution peak width of each heavy metal effective ion, divide the region into a left sub-range and a right sub-range, with the peak potential of the current heavy metal effective ion as the boundary.

[0026] Step 362: Based on the current-voltage curve of the current effective heavy metal ion in the left sub-interval, calculate the absolute value of the first first derivative, identify the first maximum potential point based on the absolute value of the first first derivative, and calculate the potential distance between the first maximum potential point and the peak potential as the left peak edge response span; based on the current-voltage curve of the current effective heavy metal ion in the right sub-interval, calculate the absolute value of the second first derivative, identify the second maximum potential point based on the absolute value of the second first derivative, and calculate the potential distance between the second maximum potential point and the peak potential as the right peak edge response span;

[0027] Step 363: Based on the current-voltage curve of the current effective heavy metal ions in the left sub-interval, calculate the absolute value of the first second derivative, determine the number of sampling points where the first second derivative is greater than the preset curvature threshold, and record them as the number of high curvature points on the left; based on the current-voltage curve of the current effective heavy metal ions in the right sub-interval, calculate the absolute value of the second second derivative, determine the number of sampling points where the second second derivative is greater than the preset curvature threshold, and record them as the number of high curvature points on the right.

[0028] Step 364, the judgment conditions include a first judgment condition and a second judgment condition; the first judgment condition is specifically: calculate the ratio of the response span of the left peak edge to the response span of the right peak edge to obtain a first ratio value. If the first ratio value is less than the first lower limit of distortion or greater than the first upper limit of distortion, it is determined that the dissolution peak of the current heavy metal effective ion has significant peak edge asymmetry; the second judgment condition is specifically: if the absolute value of the difference between the number of high curvature points on the left and the number of high curvature points on the right exceeds the preset tolerance, it is determined that the dissolution peak of the current heavy metal effective ion has local curvature distribution distortion.

[0029] Step 365: When the current effective heavy metal ion meets the first judgment condition and the second judgment condition, the normalized distortion of the current effective heavy metal ion is set to the first preset constant; when the current effective heavy metal ion meets either the first judgment condition or the second judgment condition, the normalized distortion of the current effective heavy metal ion is set to the second preset constant; when the current effective heavy metal ion does not meet the first judgment condition or the second judgment condition, the normalized distortion of the current effective heavy metal ion is set to the third preset constant.

[0030] Furthermore, the first preset constant > the second preset constant > the third preset constant.

[0031] Furthermore, based on each of the matrix migration distortion-dominant conditions, the corresponding migration characteristics are calculated, including the following steps:

[0032] Step 41: Based on each adjacent pair of effective heavy metal ions in the cross-phase shift dominant working condition, determine the local fitting mismatch and combine it with the cross-phase sensitivity factor to obtain the cross-phase shift feature corresponding to the current effective heavy metal ion.

[0033] Step 42: Based on each of the effective heavy metal ions in the asymmetric distortion-dominated operating condition, calculate the span difference between the response span of the left peak edge and the response span of the right peak edge, and obtain the asymmetric distortion feature corresponding to the current effective heavy metal ion by multiplying the span difference and the normalized distortion.

[0034] Step 43: Based on the effective heavy metal ions in the matrix drift-dominant operating condition, obtain the potential difference between the peak potential and the dissolution initiation potential; multiply the baseline slope by the potential difference to obtain the matrix drift characteristics corresponding to the current effective heavy metal ions.

[0035] Furthermore, based on each adjacent pair of effective heavy metal ions in the cross-phase shift-dominant operating condition, the local fitting mismatch is determined and combined with the cross-phase sensitivity factor to obtain the cross-phase shift characteristics, including the following steps:

[0036] Step 411: Based on each of the adjacent effective heavy metal ion pairs, construct a local fitting window within the corresponding effective dissolution peak width range with the peak potential as the center; perform Gaussian-Lorentz mixture function fitting based on the current-voltage curve within the local fitting window to obtain the fitting residual sequence; calculate the absolute mean of the fitting residual sequence in the preset peak potential neighborhood interval, and record it as the local fitting mismatch degree.

[0037] Step 412: Multiply the local fitting mismatch degree by the cross-phase sensitivity factor of the corresponding adjacent heavy metal effective ion pair to obtain the preliminary cross-phase shift characteristics;

[0038] Step 413: If the preliminary cross-phase offset feature is less than the first lower threshold, then the cross-phase offset feature is set to zero; if the preliminary cross-phase offset feature is greater than the first upper threshold, then the preliminary cross-phase offset feature is defined as the first upper threshold; otherwise, the preliminary cross-phase offset feature is used as the cross-phase offset feature.

[0039] This application also provides an electrochemical sensing system for the detection of heavy metal ions in food, including the following modules:

[0040] The acquisition module is used to acquire the current-potential curve of the anodic dissolution stage of the food sample under test through an electrochemical sensor; the current-potential curve includes multiple sampling points, and each sampling point is a one-to-one corresponding current and potential.

[0041] The differential processing module is used to perform second-order differential processing based on the current-potential curve to obtain the second-order derivative curve; identify zero-crossing pairs based on the second-order derivative curve, and calculate the effective dissolution peak width of each heavy metal ion based on the zero-crossing pairs.

[0042] The identification module is used to construct multiple inter-peak interference discrimination indicators based on the effective dissolution peak width and the current-voltage curve, and execute judgment logic to generate multiple matrix shift distortion dominant conditions.

[0043] The feature processing module is used to calculate the corresponding offset features based on each of the matrix offset distortion dominant conditions.

[0044] The prediction module is used to identify the peak current and peak potential of each heavy metal ion based on the current-potential curve. It splices the peak current, peak potential, effective dissolution peak width, offset characteristics of each operating condition, and inter-peak interference discrimination index to form a mixed feature vector, which is used as input data for the neural network model to make predictions and obtain the predicted concentration of each heavy metal ion.

[0045] Compared with existing technologies, the electrochemical sensing method and system for detecting heavy metal ions in food provided in this application addresses the problem of quantitative inaccuracies caused by neglecting the phase coupling effect of dissolution current in multi-metal coexistence systems. It precisely defines the effective dissolution peak width of each heavy metal ion through second-order differential equations and calculates a set of structured indices, including the ratio of peak potential spacing to effective peak width difference, peak skewness index, normalized distortion, peak overlap, and matrix drift sensitivity. Based on these indices, a composite threshold logic is set, which can further subdivide signals traditionally considered as peak overlap into different distortion-dominated operating conditions. In particular, it accurately identifies the cross-phase shift condition caused by intermetallic electronic interactions, diffusion boundary layer shielding, and local double-layer dynamic perturbations in the co-deposited layer. For this condition, this invention no longer relies on the direct use of the distorted peak current, but instead fits the overlapping region through a local Gaussian-Lorentz mixture function and calculates the cross-phase shift characteristics by combining a sensitivity factor. This shift characteristic, as a compensation feature, together with the original peak parameters, effective peak width, and operating condition label, constitutes a hybrid feature vector input to the neural network model. Thus, the model learns the intrinsic mapping relationship between concentration changes and phase shifts, rather than passively accepting current signals that are coupled and interfered with, thereby achieving high-precision inversion of multi-metal ion concentrations in complex matrices and improving the accuracy of concentration prediction. Attached Figure Description

[0046] The above and / or additional aspects and advantages of this application will become apparent and readily understood from the following description of the embodiments taken in conjunction with the accompanying drawings, wherein:

[0047] Figure 1A flowchart illustrating the electrochemical sensing method for detecting heavy metal ions in food provided in this application embodiment;

[0048] Figure 2 This is a structural block diagram of an electrochemical sensing system for detecting heavy metal ions in food provided in an embodiment of this application.

[0049] Figure 3 This is a block diagram of an electronic device provided in an embodiment of this application. Detailed Implementation

[0050] The embodiments of this application are described in detail below. Examples of these embodiments are shown in the accompanying drawings, wherein the same or similar reference numerals denote the same or similar elements or elements having the same or similar functions throughout. The embodiments described below with reference to the accompanying drawings are exemplary and intended to explain this application, and should not be construed as limiting this application.

[0051] The following describes, with reference to the accompanying drawings, an electrochemical sensing method and system for detecting heavy metal ions in food according to embodiments of this application.

[0052] like Figure 1 As shown, an electrochemical sensing method and system for detecting heavy metal ions in food includes the following steps:

[0053] Step 1: Acquire the voltammetric current-potential curve of the anodic dissolution stage of the food sample to be tested using an electrochemical sensor; the voltammetric current-potential curve includes multiple sampling points, each sampling point being a one-to-one corresponding current and potential.

[0054] In this embodiment, the food sample to be tested is pretreated (including digestion, filtration, and pH adjustment) and then transferred to an electrochemical detection cell. A supporting electrolyte is added to ensure good conductivity and stable ionic strength of the solution. Subsequently, the working electrode, reference electrode, and counter electrode are immersed in the sample solution to form a three-electrode system, which is then connected to an electrochemical workstation. During the enrichment stage, a constant negative potential is applied to reduce the target heavy metal ions on the surface of the working electrode and co-deposit them to form a metal or alloy layer. The enrichment time is set according to the target concentration range (usually 60–300 seconds). After enrichment is completed, the anodic dissolution stage begins: the electrochemical workstation scans from the enrichment potential to the preset termination potential (e.g., −0.1 V) at a constant scan rate (e.g., 50 mV / s). During this process, the metal deposited on the electrode surface is sequentially oxidized and dissolved, generating a characteristic oxidation current response. The workstation simultaneously records the volt-ampere potential curve of the entire anodic dissolution stage. This curve consists of a series of discrete sampling points or discrete signals, each containing a precisely corresponding current and potential value.

[0055] Step 2: Perform second-order differential processing on the current-potential curve to obtain the second-order derivative curve; identify zero-crossing pairs based on the second-order derivative curve, and calculate the effective dissolution peak width of each heavy metal ion based on the zero-crossing pairs.

[0056] The current-voltage curve is preprocessed, including removing abnormal jump points and smoothing with filters to suppress the amplification effect of high-frequency noise on the differential operation. Based on the smoothed current-voltage curve, the first derivative is calculated point by point using the central difference method or numerical differentiation algorithm. The same differential operation is then repeated on the first derivative curve to obtain the corresponding second derivative curve. This second derivative curve is also composed of second derivative values ​​and potential values ​​corresponding one-to-one with the original sampling points, preserving complete potential axis information. The second derivative curve is traversed to identify all adjacent data point pairs where the sign changes from positive to negative or from negative to positive. The potential value corresponding to each zero crossing is accurately located through linear interpolation, forming several zero crossing pairs. Each pair of adjacent zero crossings with opposite signs corresponds to the start and end positions of a local peak on the original current-voltage curve. For the target heavy metal ion, the standard dissolution potential window (for Cd) is used. 2+ Its standard dissolution potential window can be set from -0.90 V to -0.80 V (vs. Ag / AgCl), while for Pb... 2+ If the range is set to -0.70 V to -0.60 V, the nearest zero-crossing pair is matched on the second derivative curve, and the difference between the two potential values ​​corresponding to the zero-crossing pair is defined as the effective dissolution peak width of the heavy metal ion, so as to reflect the degree of peak broadening.

[0057] Step 3: Based on the effective dissolution peak width and the current-voltage curve, construct multiple inter-peak interference discrimination indices, and execute the judgment logic to generate multiple matrix shift distortion dominant conditions; the multiple matrix shift distortion dominant conditions include: cross phase shift condition, asymmetric distortion condition and matrix drift dominant condition.

[0058] Step 31: Based on the standard dissolution potential window of each heavy metal ion, identify the local current maximum point of the volt-ampere current potential curve, and take the potential corresponding to the local current maximum point as the candidate peak potential.

[0059] Within the entire potential scan range of the voltammetric current-potential curve, for each standard dissolution potential window, a subsequence of current potentials within that window is extracted. Local extrema detection is performed on this subsequence: traversing all sampling points within the window, if the current value at a point is simultaneously greater than the current values ​​of both the preceding and following sampling points, that point is determined to be a local current maximum. To avoid false extrema caused by minor fluctuations, at least three consecutive monotonically increasing / decreasing points on either side of the maximum point are required to define it as a local current maximum. The potential corresponding to each identified local current maximum is recorded as a candidate peak potential. If no local maximum meeting the criteria is detected within a window, the ion is marked as undetected or an abnormality verification process is triggered. This ensures that the extraction of candidate peak potentials is strictly limited to a physicochemically reasonable potential range, effectively suppressing false identifications caused by noise peaks in non-target regions or baseline drift.

[0060] Step 32: If the candidate peak potential is located inside the zero-crossing point pair, then the current heavy metal ion is recorded as an effective heavy metal ion; otherwise, the process ends.

[0061] If the value of the candidate peak potential is greater than the lower potential value and less than the higher potential value in the zero-crossing pair, then the candidate peak potential is determined to be located inside the zero-crossing pair, and the current heavy metal ion is marked as an effective heavy metal ion. Conversely, if the value is less than the lower potential value, then the peak is considered to lack structural consistency and may originate from noise interference, non-specific oxidation reactions, or peak identification errors. In this case, it is not included in the subsequent quantitative analysis process, and further processing of the ion is terminated. This judgment logic is based on the mathematical essence of the voltammetric peak: a true dissolution peak must necessarily exhibit a complete positive-negative zero-crossing pair in the second derivative domain, with its first derivative being zero at the peak apex. The local maxima of the original current curve must fall within the potential range enclosed by this zero-crossing pair; otherwise, it violates the basic differential characteristics of the peak shape.

[0062] This embodiment effectively integrates peak position information and peak shape structure information, avoiding false positive identification caused by traditional methods that rely solely on current maxima (e.g., misjudging baseline spikes or coexisting ion tails as target peaks). On the other hand, only targets confirmed as effective heavy metal ions have reliable parameters such as peak width, peak potential, and peak current for subsequent operating condition classification and concentration inversion, thereby significantly improving the accuracy and robustness of detection results in multi-component coexisting systems.

[0063] Step 33: Based on any two of the heavy metal effective ions, obtain the peak potential and calculate the peak potential difference, which is recorded as the peak potential interval; if the peak potential interval is less than a preset neighborhood threshold, then determine that the two current heavy metal effective ions are adjacent heavy metal effective ion pairs; otherwise, determine that the two current heavy metal effective ions are non-adjacent heavy metal effective ion pairs, and end.

[0064] For any two different effective heavy metal ions, their respective candidate peak potential values ​​are read, and the absolute difference between them is calculated; this difference is recorded as the peak potential interval. This peak potential interval is then compared with a pre-set neighborhood threshold. If the peak potential interval is less than the neighborhood threshold, the two selected effective heavy metal ions are determined to be adjacent effective heavy metal ion pairs; if the peak potential interval is greater than or equal to the neighborhood threshold, the two effective heavy metal ions are determined to be non-adjacent effective heavy metal ion pairs, and further processing of these ion pairs is terminated.

[0065] The preset neighborhood threshold is set based on the statistical analysis results of the volt-ampere potential curves collected from a large number of standard samples under the same detection conditions. By repeatedly measuring the standard dissolution peak potentials of common heavy metal ions such as lead, cadmium, copper, and zinc with known concentration combinations, the peak potential fluctuation range under different batches, different electrode states, and different matrix backgrounds was statistically analyzed. Therefore, in this embodiment, the neighborhood threshold is uniformly set to ninety millivolts.

[0066] Step 34: Calculate the absolute value of the difference between the effective dissolution peak widths of the two effective heavy metal ions in the adjacent effective heavy metal ion pairs; calculate the ratio between the absolute value of the difference and the peak potential spacing to obtain the cross-phase sensitivity factor.

[0067] For the two effective heavy metal ions identified as adjacent effective heavy metal ion pairs in step 33, their effective dissolution peak width values ​​are read respectively; the difference between the two effective dissolution peak widths is calculated, and the absolute value of the difference is taken; the peak potential spacing of the adjacent effective heavy metal ion pair obtained in step 33 is read; the absolute value of the difference is divided by the peak potential spacing, and the result is the cross-phase sensitivity factor.

[0068] Step 35: Based on each of the effective heavy metal ions, according to the left zero-crossing point, right zero-crossing point and peak potential defined by the effective dissolution peak width, calculate the potential span from the left zero-crossing point to the peak potential as the left half-peak width, and the potential span from the peak potential to the right zero-crossing point as the right half-peak width; calculate the ratio of the left half-peak width to the right half-peak width to obtain the peak skewness index.

[0069] For each effective heavy metal ion, its left zero-crossing potential, right zero-crossing potential, and candidate peak potential are read; the potential difference between the left zero-crossing potential and the candidate peak potential is calculated as the left half-width; the potential difference between the candidate peak potential and the right zero-crossing potential is calculated as the right half-width; the left half-width is divided by the right half-width, and the result is the peak skewness index of the effective heavy metal ion.

[0070] Step 36: Based on the potential range corresponding to the effective dissolution peak width of each heavy metal effective ion, divide the region into a left sub-range and a right sub-range, with the peak potential of the current heavy metal effective ion as the boundary; based on the current-voltage curve of the current heavy metal effective ion in the left sub-range, determine the left peak edge response span, the right peak edge response span and the number of high curvature points, and execute the judgment conditions to generate normalized distortion.

[0071] Step 361: Based on the potential range corresponding to the effective dissolution peak width of each heavy metal effective ion, divide the region into a left sub-range and a right sub-range, with the peak potential of the current heavy metal effective ion as the boundary.

[0072] For each effective heavy metal ion, the potential range corresponding to its effective dissolution peak width is read. This range is defined by the left zero-crossing potential and the right zero-crossing potential. At the same time, the peak potential of the effective heavy metal ion is read. Using the peak potential as the dividing point, the potential range is divided into two parts: the part from the left zero-crossing potential to the peak potential is defined as the left sub-range, and the part from the peak potential to the right zero-crossing potential is defined as the right sub-range.

[0073] Step 362: Based on the current-voltage curve of the current effective heavy metal ion in the left sub-interval, calculate the absolute value of the first first derivative, identify the first maximum potential point based on the absolute value of the first first derivative, and calculate the potential distance between the first maximum potential point and the peak potential as the left peak edge response span; based on the current-voltage curve of the current effective heavy metal ion in the right sub-interval, calculate the absolute value of the second first derivative, identify the second maximum potential point based on the absolute value of the second first derivative, and calculate the potential distance between the second maximum potential point and the peak potential as the right peak edge response span.

[0074] Based on the current effective heavy metal ion, the first derivative of the current-voltage curve is calculated point by point within its left sub-interval, and the absolute value of each derivative is taken to form a sequence of absolute values ​​of the first first derivative (or the sequence of absolute values ​​of the first derivative of the current-voltage curve within the left sub-interval can be extracted without using the first derivative curve in step 2, and used as the sequence of absolute values ​​of the first first derivative); the potential position corresponding to the maximum value in this sequence is found and recorded as the first maximum potential point; the potential difference between the first maximum potential point and the peak potential of the effective heavy metal ion is calculated as the left peak edge response. The span should be determined; subsequently, within its right sub-interval, the first derivative of the current-voltage curve is calculated point by point, and the absolute value of each derivative value is taken to form a second first derivative absolute value sequence (or the first derivative absolute value sequence of the current-voltage curve within the right sub-interval can be extracted without using the first derivative curve in step 2, and used as the second first derivative absolute value sequence); the potential position corresponding to the maximum value in this sequence is found and recorded as the second maximum potential point; the potential difference between the second maximum potential point and the peak potential of the effective heavy metal ion is calculated and used as the right peak edge response span.

[0075] Step 363: Based on the current-voltage curve of the current effective heavy metal ions in the left sub-interval, calculate the absolute value of the first second derivative, determine the number of sampling points where the first second derivative is greater than the preset curvature threshold, and record them as the number of high curvature points on the left; based on the current-voltage curve of the current effective heavy metal ions in the right sub-interval, calculate the absolute value of the second second derivative, determine the number of sampling points where the second second derivative is greater than the preset curvature threshold, and record them as the number of high curvature points on the right.

[0076] Based on the current effective heavy metal ions, the second derivative of the current-voltage curve is calculated point-by-point within the left sub-interval, and the absolute value of each derivative value is taken to form a sequence of absolute values ​​of the first second derivative (or the sequence of absolute values ​​of the second derivative of the current-voltage curve within the left sub-interval can be extracted from the second derivative curve in step 2 and used as the sequence of absolute values ​​of the first second derivative). The value of each sampling point in this sequence is compared with a preset curvature threshold, and the number of sampling points that are greater than the preset curvature threshold is counted and recorded as the number of high curvature points on the left. Similarly, the second derivative of the current-voltage curve is calculated point-by-point within the right sub-interval, and the absolute value of each derivative value is taken. The absolute value of the second derivative is used to form a second second derivative absolute value sequence (or the second derivative absolute value sequence of the current-voltage curve in the right sub-interval can be extracted from the second derivative curve in step 2 and used as the first second derivative absolute value sequence); the value of each sampling point in this sequence is compared with the preset curvature threshold, and the number of sampling points that are greater than the preset curvature threshold is counted and recorded as the number of high curvature points on the right; wherein, the preset curvature threshold is determined according to the distribution of the absolute value of the second derivative of the current-voltage curve obtained by the system from multiple measurements of blank samples under the condition of no heavy metal interference, specifically the value corresponding to the 95th percentile of the distribution is taken as the preset curvature threshold.

[0077] Step 364, the judgment conditions include a first judgment condition and a second judgment condition; the first judgment condition is specifically: calculate the ratio of the response span of the left peak edge to the response span of the right peak edge to obtain a first ratio value. If the first ratio value is less than the first lower limit of distortion or greater than the first upper limit of distortion, it is determined that the dissolution peak of the current heavy metal effective ion has significant peak edge asymmetry; the second judgment condition is specifically: if the absolute value of the difference between the number of high curvature points on the left and the number of high curvature points on the right exceeds the preset tolerance, it is determined that the dissolution peak of the current heavy metal effective ion has local curvature distribution distortion.

[0078] Step 365: When the current effective heavy metal ion meets the first and second judgment conditions, the normalized distortion of the current effective heavy metal ion is set to a first preset constant; when the current effective heavy metal ion meets either the first or second judgment condition, the normalized distortion of the current effective heavy metal ion is set to a second preset constant; when the current effective heavy metal ion does not meet the first or second judgment conditions, the normalized distortion of the current effective heavy metal ion is set to a third preset constant. First preset constant > Second preset constant > Third preset constant.

[0079] Based on the current effective heavy metal ions, the ratio of the response span of the left peak edge to the response span of the right peak edge is calculated to obtain a first ratio. This first ratio is compared with a first lower distortion limit and a first upper distortion limit. If the first ratio is less than the first lower distortion limit or greater than the first upper distortion limit, the first judgment condition is met, that is, the dissolution peak of the current effective heavy metal ions has significant peak edge asymmetry. At the same time, the difference between the number of high curvature points on the left and the number of high curvature points on the right is calculated, and its absolute value is taken. This absolute value is compared with a preset tolerance. If it exceeds the preset tolerance, the second judgment condition is met, that is, the dissolution peak of the current effective heavy metal ions has local curvature distribution distortion.

[0080] The first lower distortion limit and the first upper distortion limit are determined based on the distribution of the ratio of the left and right peaks along the response span of the dissolution peaks obtained by the system in repeated measurements of typical heavy metal ions under standard concentration conditions. Specifically, the 5th percentile of this distribution is taken as the first lower distortion limit, and the 95th percentile is taken as the first upper distortion limit. The preset tolerance is set based on the statistical distribution of the absolute value of the difference between the number of left and right high curvature points measured under the same test conditions for blank samples and standard samples. The maximum observed value is taken and rounded up as the preset tolerance to ensure that the criterion is triggered only when obvious asymmetric curvature features appear.

[0081] The peak-edge response span ratio directly reflects the symmetry of the overall rising and falling edges of the dissolution peak, while the difference in the number of high curvature points can capture subtle local distortions in the peak shape. These two factors complement each other, characterizing peak shape distortion from macroscopic and microscopic perspectives respectively. The dual-criteria design effectively distinguishes between normal peak shapes caused by genuine heavy metal signals and abnormal peak shapes caused by interference, electrode contamination, or background noise, thereby improving identification reliability and anti-interference capabilities.

[0082] After completing the judgment in step 364, if the current effective heavy metal ion simultaneously meets the first judgment condition and the second judgment condition, its normalized distortion is set to the first preset constant; if it only meets the first judgment condition or only meets either the second judgment condition, its normalized distortion is set to the second preset constant; if neither judgment condition is met, its normalized distortion is set to the third preset constant. The first preset constant, the second preset constant, and the third preset constant are all fixed values, and the first preset constant is greater than the second preset constant, and the second preset constant is greater than the third preset constant.

[0083] The above three preset constants are based on the offline verification results of a large number of known samples (including pure standard solutions, mixed interference solutions and actual environmental samples). By statistically analyzing the influence of peak shape of different distortion levels on quantitative accuracy, the normalized distortion is divided into three levels: high, medium and low, corresponding to severe distortion, slight distortion and basically no distortion, respectively.

[0084] Step 37: Based on the potential ranges corresponding to the effective dissolution peak widths of the two heavy metal ions, calculate the interval intersection length and interval union length, and use the ratio of the interval intersection length and interval union length as the inter-peak overlap index.

[0085] For any two effective heavy metal ions, obtain the potential range corresponding to their respective effective dissolution peak widths. Each range is defined by a left boundary potential and a right boundary potential. Calculate the overlapping portion of these two potential ranges. If there is overlap, the length of the overlapping portion is the difference between the smaller right boundary potential and the larger left boundary potential. If there is no overlap, the length of the overlapping portion is zero, denoted as the interval intersection length. Simultaneously, calculate the overall coverage of these two potential ranges, the length of which is the difference between the larger right boundary potential and the smaller left boundary potential, denoted as the interval union length. Calculate the ratio between the interval intersection length and the interval union length; the result is the interpeak overlap index.

[0086] Step 38: Obtain a set of lower limit values ​​for the effective heavy metal ions within the corresponding standard dissolution potential window, and take the minimum value of the set of lower limit values ​​as the dissolution initiation potential; obtain the segment of the volt-ampere current-potential curve between the dissolution initiation potential and the minimum peak potential among all effective heavy metal ions; if the dissolution initiation potential is the same as the minimum peak potential, set the baseline slope to 0; otherwise, perform linear regression on the sampling points of the segment to obtain the baseline slope; define the ratio of the absolute value of the baseline slope to the maximum absolute value of the peak current among all effective heavy metal ions as the matrix drift sensitivity index.

[0087] First, the lower limits of the standard dissolution potential windows corresponding to each of the effective heavy metal ions are obtained, and these lower limits are grouped into a set. The lower limit with the smallest value is selected from this set as the dissolution initiation potential. The minimum peak potential among all effective heavy metal ions is determined, and the segment of the volt-ampere potential curve between the dissolution initiation potential and this minimum peak potential is extracted. If the dissolution initiation potential is equal to the minimum peak potential, the baseline slope is directly set to zero. If they are not equal, linear regression is performed on all sampling points within this segment to obtain a characterization of the dissolution potential. The baseline slope of the overall trend of the segment is determined; the maximum absolute value of the peak current among all effective heavy metal ions is identified; the baseline slope is normalized by dividing the baseline slope by the total potential span corresponding to the potential scan range; the absolute value of the maximum peak current is normalized by dividing the absolute value of the maximum peak current by the reference current amplitude set by the system; finally, the ratio between the normalized absolute value of the baseline slope and the normalized absolute value of the maximum peak current is calculated, and the result is the matrix drift sensitivity index.

[0088] Step 39: Based on the cross-phase sensitivity factor, peak skewness index, normalized peak distortion, inter-peak overlap index, and matrix drift sensitivity index, execute a multi-dimensional threshold composite judgment logic: when the cross-phase sensitivity factor is greater than the first threshold and the inter-peak overlap index is greater than the second threshold, the current-voltage curve is determined to belong to the cross-phase shift dominant condition; when the peak skewness index is less than the third threshold or greater than the fourth threshold, and the normalized peak distortion is greater than the fifth threshold, the current-voltage curve is determined to belong to the asymmetric distortion dominant condition; when the matrix drift sensitivity index is greater than the sixth threshold, and the cross-phase sensitivity factor is less than the first threshold, the inter-peak overlap index is less than the second threshold, the peak skewness index is within the target range, and the normalized peak distortion is less than the fifth threshold, the current-voltage curve is determined to belong to the matrix drift dominant condition; if none of the above conditions are met, no matrix shift distortion dominant condition is generated.

[0089] First, determine if the cross-phase sensitivity factor is greater than the first threshold, and simultaneously determine if the peak overlap index is greater than the second threshold. If both conditions are met, the current current-potential curve is determined to be in a cross-phase shift-dominated condition. Second, determine if the peak skewness index is less than the third threshold or greater than the fourth threshold, and simultaneously determine if the normalized peak distortion is greater than the fifth threshold. If both conditions are met, the current current-potential curve is determined to be in an asymmetric distortion-dominated condition. Third, determine if the matrix drift sensitivity index is greater than the sixth threshold, and simultaneously confirm that the cross-phase sensitivity factor is less than the first threshold, the peak overlap index is less than the second threshold, the peak skewness index is between the third and fourth thresholds (i.e., the target interval), and the normalized peak distortion is less than the fifth threshold. If all the above conditions are met, the current current-potential curve is determined to be in a matrix drift-dominated condition. If none of the above three conditions are met, no matrix shift distortion-dominated condition determination result is generated.

[0090] The first and second thresholds are determined based on the joint distribution of the cross-phase sensitivity factor and the inter-peak overlap index measured under interference-free conditions using a large number of standard mixed solutions. The 95th percentile is taken as the upper limit threshold to ensure that the cross-phase shift judgment is triggered only when both are significantly abnormal. The third and fourth thresholds are set according to the statistical distribution of the peak shape skewness index of pure single-component heavy metal dissolution peaks under ideal symmetry conditions. The 5th and 95th percentiles are taken respectively to define the normal symmetry range. The fifth threshold is determined by rounding up the maximum observed value of normalized peak shape distortion in the standard sample and retaining a safety margin. It is used to identify obvious distortion. The sixth threshold is determined by the distribution of the matrix drift sensitivity index measured by blank matrix and low-concentration actual samples under different background electrolyte conditions. 1.2 times the maximum value is taken as the conservative threshold.

[0091] Different types of interference mechanisms exhibit distinct multidimensional characteristics in their current-voltage response. The criterion design for the cross-phase shift-dominant operating condition is specifically designed to address coupling deviations caused by intermetallic electronic interactions, diffusion boundary layer shielding effects, and local double-layer dynamic perturbations in the co-deposited layer. These physicochemical processes lead to synchronous potential shifts in the dissolution peaks of multiple metal ions, and their overlap is exacerbated by peak compression or broadening, resulting in a significant increase in both the cross-phase sensitivity factor and the inter-peak overlap index. Therefore, only when both of these indicators exceed the threshold can this type of systematic phase shift caused by complex interactions at the electrode / solution interface be accurately identified, effectively distinguishing it from other isolated distortions.

[0092] The asymmetric distortion-dominated operating condition is specifically designed to identify peak shape distortion interference caused by localized contamination on the electrode surface, uneven distribution of adsorption sites, or asymmetric mass transfer kinetics. This type of interference usually does not cause overall peak shift or severe overlap, but it disrupts the symmetry of the dissolution peaks and causes contour distortion, manifested as a significant deviation of the peak skewness index from the normal range and a marked increase in normalized peak shape distortion. By using both skewness and distortion anomalies as criteria, the influence of simple noise or slight baseline drift can be effectively eliminated, accurately capturing the real asymmetric structural distortion.

[0093] The matrix drift-dominant condition aims to identify slow baseline tilting interference caused by fluctuations in background electrolyte composition, changes in temperature gradients, or instability in supporting electrolyte concentrations. This type of interference does not alter peak structure, induce peak shifts or overlaps, and only manifests as a low-frequency baseline trend change; therefore, it must be determined solely by the matrix drift sensitivity index, after confirming that the other four indicators are within normal ranges, to avoid confusion with other higher-order distortions.

[0094] Cross-phase shift reflects the complexity of microscopic interactions at the electrode interface and is a core characteristic of non-ideal co-deposition systems; asymmetric distortion reveals local anomalies in electrode surface states or reaction kinetics; and matrix drift reflects the macroscopic impact of measurement environment stability. These three factors correspond to interference sources at three levels: microscopic interface coupling, mesoscopic surface effects, and macroscopic environmental disturbances, respectively. Through the multidimensional threshold composite criterion in this embodiment, the decoupling identification and classification of these three fundamentally different coupling deviations can be achieved, providing a clear basis for subsequent targeted correction strategies. This significantly improves the accuracy, robustness, and interpretability of heavy metal leaching voltammetry detection in complex real-world samples.

[0095] Step 4: Calculate the corresponding offset features based on each of the matrix offset distortion dominant conditions.

[0096] Step 41: Based on each adjacent pair of effective heavy metal ions in the cross-phase shift dominant working condition, determine the local fitting mismatch and combine it with the cross-phase sensitivity factor to obtain the cross-phase shift feature corresponding to the current effective heavy metal ion.

[0097] Step 411: Based on each of the adjacent effective heavy metal ion pairs, construct a local fitting window within the corresponding effective dissolution peak width range centered on the peak potential; perform Gaussian-Lorentz mixture function fitting based on the current-voltage curve within the local fitting window to obtain the fitting residual sequence; calculate the absolute mean of the fitting residual sequence in the preset peak potential neighborhood interval, and record it as the local fitting mismatch.

[0098] For each pair of adjacent effective heavy metal ions, a local fitting window is constructed by extending half the width of the corresponding effective dissolution peak to the left and right, with the peak potential as the center of symmetry. This window is centered on the peak potential and has a total width equal to the effective dissolution peak width. If the local fitting windows of adjacent ions overlap, their independent windows are maintained without merging or cropping. Subsequently, the potential values ​​and corresponding current values ​​of all sampling points within the local fitting window are extracted from the current-voltage curve and used as the fitting input data. A Gaussian-Lorentz mixture function is used to perform nonlinear least-squares fitting on the current-potential data within the window. The Gaussian-Lorentz mixture function consists of a linear superposition of a Gaussian component and a Lorentz component, and is automatically adjusted during the fitting process. The four parameters—peak position, peak height, half-maximum width at half-maximum (WWHM), and Gaussian / Lorentz weighting ratio—are optimized until the sum of squared residuals converges to a preset tolerance range. After fitting, the actual current value at each sampling point is subtracted from the theoretical current value output by the fitting function at the corresponding potential to obtain point-by-point residuals, forming a fitted residual sequence. Next, a preset peak potential neighborhood interval is constructed: this neighborhood interval is centered on the peak potential of the same heavy metal effective ion, extending to both sides by one-quarter of its effective dissolution peak width, thus forming a sub-interval covering the core region of the peak. All residual values ​​whose potentials fall within this neighborhood interval are selected from the aforementioned fitted residual sequence. The arithmetic mean of the absolute values ​​of these residual values ​​is calculated, and this mean is recorded as the local fitting mismatch degree corresponding to the heavy metal effective ion. The method of fitting the theoretical current value using the Gaussian-Lorentz mixture function is a conventional technique and will not be described in detail in this embodiment.

[0099] Step 412: Based on the multiplication of the local fitting mismatch degree with the cross-phase sensitivity factor of the corresponding adjacent heavy metal effective ion pair, the preliminary cross-phase shift characteristics are obtained.

[0100] For each pair of adjacent heavy metal effective ions, obtain its corresponding local fitting mismatch and the cross-phase sensitivity factor calculated in the previous stage; multiply the local fitting mismatch by the cross-phase sensitivity factor, and the result is the preliminary cross-phase shift characteristic of the adjacent heavy metal effective ion pair.

[0101] Step 413: If the preliminary cross-phase offset feature is less than the first lower threshold, then the cross-phase offset feature is set to zero; if the preliminary cross-phase offset feature is greater than the first upper threshold, then the preliminary cross-phase offset feature is defined as the first upper threshold; otherwise, the preliminary cross-phase offset feature is used as the cross-phase offset feature.

[0102] For each pair of adjacent heavy metal effective ions, the preliminary cross-phase shift feature is first compared with a preset first lower threshold. If the preliminary cross-phase shift feature is less than the first lower threshold, it is determined to be a non-substantial shift caused by measurement noise or small fluctuations in numerical fitting, and has no physical meaning. Therefore, the final cross-phase shift feature is set to zero. If the preliminary cross-phase shift feature is greater than the first upper threshold, it is considered to have exceeded the maximum reasonable phase perturbation range that the co-deposition system may have under typical working conditions. It is very likely to be affected by abnormal interference (such as electrode contamination, strong adsorption, or external electromagnetic interference). To avoid over-amplification of errors in subsequent correction, it is truncated and defined as the first upper threshold. If the preliminary cross-phase shift feature is between the first lower threshold and the first upper threshold (including the boundary), it is considered to truly reflect the effective phase shift caused by intermetallic electronic interactions, diffusion boundary layer shielding, and local double-layer dynamic perturbation, and is directly used as the final cross-phase shift feature.

[0103] The first lower limit threshold is based on the repeated measurement statistical characteristics of interference-free standard mixtures. Under strictly controlled experimental conditions, at least 50 independent repeated voltammetric scans were performed on standard mixtures of the same concentration combination, and a complete feature extraction process was executed to obtain 50 preliminary cross-phase shift feature values. The 5th percentile of this sample set is then calculated as the first lower limit threshold.

[0104] The first upper limit threshold is set based on the measured data of a large number of actual complex samples (such as industrial wastewater, soil extract, and seafood digestion liquid) under the known maximum co-deposition interference intensity. The upper tail distribution of the preliminary cross phase shift characteristics is analyzed, the 99th percentile is taken, and a safety margin of 10% to 20% is reserved upward as the first upper limit threshold.

[0105] Step 42: Based on each of the effective heavy metal ions in the asymmetric distortion-dominated operating condition, calculate the span difference between the response span of the left peak edge and the response span of the right peak edge, and obtain the asymmetric distortion feature corresponding to the current effective heavy metal ion by multiplying the span difference and the normalized distortion.

[0106] Step 43: Based on the effective heavy metal ions in the matrix drift-dominant operating condition, obtain the potential difference between the peak potential and the dissolution initiation potential; multiply the baseline slope by the potential difference to obtain the matrix drift characteristics corresponding to the current effective heavy metal ions.

[0107] For each effective heavy metal ion in the asymmetric distortion-dominated operating condition, firstly, determine the left peak-edge response span of its dissolution peak, i.e., the length of the potential interval corresponding to the current drop to 10% of the peak current extending from the peak potential to the lower potential direction; then determine the right peak-edge response span, i.e., the length of the potential interval corresponding to the current drop to 10% of the peak current extending from the peak potential to the higher potential direction; subtract the left peak-edge response span from the right peak-edge response span to obtain the span difference; subsequently, obtain the normalized distortion degree previously calculated for this effective heavy metal ion; multiply the span difference by the normalized distortion degree, and the result is the asymmetric distortion characteristic corresponding to the current effective heavy metal ion.

[0108] For each heavy metal effective ion in the matrix drift-dominated operating condition, its peak potential is first read, and its dissolution initiation potential is determined. The dissolution initiation potential is defined as the potential corresponding to the starting point where the current at the front of the dissolution peak first significantly deviates from the background baseline and continues to rise. The potential difference between the peak potential and the dissolution initiation potential is calculated. At the same time, the baseline slope of the background baseline within the scanning interval where the heavy metal effective ion is located is obtained. This baseline slope is obtained by fitting the trend of background current with potential change using linear regression in the signal-free region before the dissolution peak. The baseline slope is multiplied by the potential difference, and the result is the matrix drift characteristic corresponding to the current heavy metal effective ion.

[0109] It should be noted that the aforementioned cross-phase shift feature, asymmetric distortion shift feature, and matrix drift shift feature serve as quantitative indicators characterizing the perturbation state of the current-voltage response signal under different dominant interference conditions. Specifically, the cross-phase shift feature quantifies the perturbation intensity of the overall amplitude and shape of the current response caused by electron competition and surface shielding effects during the co-deposition of adjacent heavy metal ions; the asymmetric distortion shift feature (based on the product of the difference in the span between the left and right peak edges and the normalized distortion) quantifies the degree of left-right asymmetry and its directional bias (i.e., left- or right-tilted) of the dissolution peak shape caused by uneven diffusion at the electrode interface or surface passivation; and the matrix drift shift feature quantifies the perturbation intensity and drift direction of the overall current-voltage curve shifting along the potential axis due to a complex matrix background. These three types of shift features together constitute a multi-dimensional characterization of signal distortion characteristics under three typical conditions: cross-interference, peak distortion, and matrix drift, providing highly discriminative input for subsequent signal analysis.

[0110] Step 5: Based on the current-voltage curve, identify the peak current and peak potential of each heavy metal ion. Then, combine the peak current, peak potential, effective dissolution peak width, offset characteristics of each operating condition, and inter-peak interference discrimination index to form a mixed feature vector. Use this vector as input data for the neural network model to make predictions and obtain the predicted concentration of each heavy metal ion.

[0111] For each candidate peak, the potential value corresponding to its peak position is recorded as the peak potential of the heavy metal ion, and the current value at that potential is read as the peak current. The above data are arranged in a fixed order, including peak current, peak potential, effective dissolution peak width, cross phase shift characteristics, asymmetric distortion shift characteristics, matrix drift shift characteristics, and inter-peak interference discrimination index. They are then spliced ​​together to form a one-dimensional hybrid feature vector (all possible shift characteristics (regardless of whether the corresponding working condition is triggered) are used as inputs of a fixed dimension, and the feature value of the non-triggered working condition is set to 0 or a preset default value).

[0112] Historical sample dataset construction: A large number of standard samples or spiked actual samples with known concentration combinations were collected, and the corresponding voltammetric current-potential curves were obtained under the same electrochemical detection conditions (such as deposition potential, deposition time, scan rate, etc.). The same signal processing procedure as the current sample was performed on each curve, including peak identification, effective dissolution peak width calculation, extraction of three types of shift features (cross-phase shift feature, asymmetric distortion shift feature, matrix drift shift feature), and calculation of inter-peak interference discrimination index, forming a mixed feature sample that corresponds one-to-one with the true concentration label (the concentration value corresponding to each heavy metal ion). All samples constitute the training dataset.

[0113] Neural network model training: A multi-layer fully connected feedforward neural network is used as the basic architecture, and its structure includes:

[0114] Input layer: Receives a 7-dimensional mixed feature vector;

[0115] Hidden layer: It contains two fully connected layers with 64 and 32 nodes respectively. Each layer is followed by a ReLU activation function and batch normalization to improve training stability.

[0116] Output layer: Contains m neurons (m is the number of heavy metal ions to be tested), uses a linear activation function, and directly outputs the predicted concentration value of each ion;

[0117] Loss function: Mean squared error (MSE) is used to measure the difference between the predicted concentration and the actual concentration;

[0118] Optimizer: The Adam optimization algorithm is used, with an initial learning rate of 0.001, and an early stopping strategy is employed to prevent overfitting.

[0119] Perform end-to-end training on the aforementioned training dataset until the validation set loss converges, save the optimal weight parameters, and obtain the trained neural network model.

[0120] The mixed feature vector is input into a pre-trained neural network model. The input layer first standardizes the features to eliminate dimensional differences; the first hidden layer initially fuses the original features and learns the low-order interaction relationship between the peak current and various interference features; the second hidden layer further abstracts high-order nonlinear modes to achieve joint compensation for multiple interferences such as matrix effects, peak overlap, and signal distortion; the output layer directly regresses and outputs the predicted concentration values ​​of m heavy metal ions. Since the model has fully learned the mapping law between mixed features and true concentrations through a large number of labeled samples during the training phase, in the inference phase, as long as the feature distribution of the sample to be tested is within the coverage of the training data, the model can automatically decouple the influence of various interferences and accurately restore the true concentration of each ion. If there are multiple effective dissolution peaks on the voltammetric curve, the above feature extraction and inference process is executed independently for each peak to generate a unique 7-dimensional mixed feature vector, which is then input into the same neural network model to finally obtain the predicted concentration values ​​of heavy metal ions corresponding to each dissolution peak, thereby achieving simultaneous, high-precision quantitative analysis of multiple components.

[0121] The combined eigenvectors constitute a comprehensive input structure that reflects both the essence of the electrochemical response and the influence of various interferences in actual detection. Peak current, as the most direct signal related to ion concentration, provides the basis for prediction; peak potential is used to accurately identify the target ion species and help determine the presence of interference from other ions. The effective dissolution peak width reflects the broadening degree of the dissolution peak. When the electrode surface is contaminated or complexes are present in the solution, the peak shape will broaden or become distorted. In such cases, even if the peak current is the same, the corresponding true concentration may differ. This feature allows the model to correct for such non-ideal conditions. Furthermore, the three features of cross-phase shift, peak asymmetry distortion, and overall baseline drift quantify the systematic interference caused by complex food matrices (such as proteins, salts, or organic components) on the voltammetric curve from the aspects of signal synchronization, peak symmetry, and background stability, respectively. Although these factors do not change the actual content of heavy metals in the sample, they significantly affect the measured value of the current signal. During the training process, the neural network learns from a large number of standard samples with known concentrations that when the baseline drift is large or the peak shape is significantly asymmetrical, the same peak current often corresponds to a higher true concentration, thus compensating for this type of interference by the model itself during the prediction stage. Finally, the inter-peak interference index is used to evaluate the superposition or masking effect of adjacent dissolution peaks on the target peak current, enabling the model to distinguish between truly high concentrations and false high currents caused by multiple peak overlaps. Crucially, these features are interrelated and synergistically influential during the prediction process: for example, when multiple ions coexist, there are often simultaneous phenomena such as slight peak position shifts, increased peak asymmetry, and increased interference levels. The neural network captures these combination patterns through multi-layer nonlinear transformations, thus accurately separating and quantifying each target ion even in complex overlapping peak scenarios. Therefore, this seven-dimensional feature combination not only covers the main concentration signal, but also systematically incorporates key interference information that affects the accurate interpretation of the signal. This allows the model to reliably predict the true concentration without relying on the original current-potential curve, using only this set of structured inputs. This is the core reason why the method in this embodiment is superior to the traditional method that relies solely on peak current for quantitative analysis.

[0122] like Figure 2 As shown, this embodiment also discloses an electrochemical sensing system for detecting heavy metal ions in food, including the following modules:

[0123] The acquisition module is used to acquire the current-potential curve of the anodic dissolution stage of the food sample under test through an electrochemical sensor; the current-potential curve includes multiple sampling points, and each sampling point is a one-to-one corresponding current and potential.

[0124] The differential processing module is used to perform second-order differential processing based on the current-potential curve to obtain the second-order derivative curve; identify zero-crossing pairs based on the second-order derivative curve, and calculate the effective dissolution peak width of each heavy metal ion based on the zero-crossing pairs.

[0125] The identification module is used to construct multiple inter-peak interference discrimination indicators based on the effective dissolution peak width and the current-voltage curve, and execute judgment logic to generate multiple matrix shift distortion dominant conditions.

[0126] The feature processing module is used to calculate the corresponding offset features based on each of the matrix offset distortion dominant conditions.

[0127] The prediction module is used to identify the peak current and peak potential of each heavy metal ion based on the current-potential curve. It splices the peak current, peak potential, effective dissolution peak width, offset characteristics of each operating condition, and inter-peak interference discrimination index to form a mixed feature vector, which is used as input data for the neural network model to make predictions and obtain the predicted concentration of each heavy metal ion.

[0128] To implement the above embodiments, this application also proposes an electronic device. Please see [link to relevant documentation]. Figure 3 , Figure 3 This is a schematic diagram of the structure of the electronic device provided in an embodiment of this application. For example... Figure 3 As shown, the electronic device 500 includes: a processor 501 and a memory 502 communicatively connected to the processor 501; the memory 502 stores computer-executable instructions; the processor 501 executes the computer-executable instructions stored in the memory to implement the method provided in the foregoing embodiments.

[0129] To implement the above embodiments, this application also proposes a computer-readable storage medium storing computer-executable instructions, which, when executed by a processor, are used to implement the methods provided in the foregoing embodiments.

[0130] To implement the above embodiments, this application also proposes a computer program product, including a computer program that, when executed by a processor, implements the methods provided in the foregoing embodiments.

[0131] The storage medium mentioned above can be a read-only memory, a disk, or an optical disk, etc. Although embodiments of this application have been shown and described above, it is understood that the above embodiments are exemplary and should not be construed as limiting this application. Those skilled in the art can make changes, modifications, substitutions, and variations to the above embodiments within the scope of this application.

Claims

1. An electrochemical sensing method for detecting heavy metal ions in food, characterized in that, Includes the following steps: Step 1: Acquire the voltammetric current-potential curve of the anodic dissolution stage of the food sample to be tested using an electrochemical sensor; The current-potential curve includes multiple sampling points, each sampling point being a one-to-one corresponding current and potential; Step 2: Perform second-order differential processing on the current-potential curve to obtain the second-derivative curve; identify zero-crossing pairs based on the second-derivative curve, and calculate the effective dissolution peak width of each heavy metal ion based on the zero-crossing pairs. Step 3: Based on the effective dissolution peak width and the current-voltage curve, construct multiple inter-peak interference discrimination indices, and execute the judgment logic to generate multiple matrix shift distortion dominant conditions; Step 4: Calculate the corresponding offset features based on each of the matrix offset distortion dominant conditions; Step 5: Based on the current-voltage curve, identify the peak current and peak potential of each heavy metal ion. Then, combine the peak current, peak potential, effective dissolution peak width, offset characteristics of each operating condition, and inter-peak interference discrimination index to form a mixed feature vector. Use this vector as input data for the neural network model to make predictions and obtain the predicted concentration of each heavy metal ion.

2. The electrochemical sensing method for detecting heavy metal ions in food according to claim 1, characterized in that, Multiple matrix offset distortion-dominated scenarios include: cross-phase offset scenario, asymmetric distortion scenario, and matrix drift-dominated scenario.

3. The electrochemical sensing method for detecting heavy metal ions in food according to claim 2, characterized in that, Based on the effective dissolution peak width and the current-voltage curve, multiple inter-peak interference discrimination indices are constructed, and judgment logic is executed to generate multiple matrix shift distortion-dominant operating conditions, including the following steps: Step 31: Based on the standard dissolution potential window of each heavy metal ion, identify the local current maximum point of the volt-ampere current potential curve, and take the potential corresponding to the local current maximum point as the candidate peak potential. Step 32: If the candidate peak potential is located inside the zero-crossing pair, then the current heavy metal ion is recorded as an effective heavy metal ion; otherwise, the process ends. Step 33: Based on any two of the heavy metal effective ions, obtain the peak potential and calculate the peak potential difference, which is recorded as the peak potential interval; if the peak potential interval is less than a preset neighborhood threshold, then determine that the two current heavy metal effective ions are adjacent heavy metal effective ion pairs; otherwise, determine that the two current heavy metal effective ions are non-adjacent heavy metal effective ion pairs, and end. Step 34: Calculate the absolute value of the difference between the effective dissolution peak widths of the two effective heavy metal ions in the adjacent effective heavy metal ion pairs; calculate the ratio between the absolute value of the difference and the peak potential spacing to obtain the cross-phase sensitivity factor. Step 35: Based on each of the effective heavy metal ions, according to the left zero-crossing point, right zero-crossing point and peak potential defined by the effective dissolution peak width, calculate the potential span from the left zero-crossing point to the peak potential as the left half-peak width, and the potential span from the peak potential to the right zero-crossing point as the right half-peak width; calculate the ratio of the left half-peak width to the right half-peak width to obtain the peak skewness index. Step 36: Based on the potential range corresponding to the effective dissolution peak width of each heavy metal effective ion, divide the region into a left sub-range and a right sub-range, with the peak potential of the current heavy metal effective ion as the boundary; based on the current-voltage curve of the current heavy metal effective ion in the left sub-range, determine the left peak edge response span, the right peak edge response span and the number of high curvature points, and execute the judgment conditions to generate normalized distortion. Step 37: Based on the potential ranges corresponding to the effective dissolution peak widths of the two heavy metal ions, calculate the interval intersection length and interval union length, and use the ratio of the interval intersection length and interval union length as the inter-peak overlap index. Step 38: Obtain a set of lower limit values ​​for the effective heavy metal ions within the corresponding standard dissolution potential window, and take the minimum value of the set of lower limit values ​​as the dissolution initiation potential; obtain the segment of the volt-ampere current-potential curve between the dissolution initiation potential and the minimum peak potential among all effective heavy metal ions; if the dissolution initiation potential is the same as the minimum peak potential, set the baseline slope to 0; otherwise, perform linear regression on the sampling points of the segment to obtain the baseline slope; define the ratio of the absolute value of the baseline slope to the maximum absolute value of the peak current among all effective heavy metal ions as the matrix drift sensitivity index. Step 39: Based on the cross-phase sensitivity factor, peak skewness index, normalized peak distortion, inter-peak overlap index, and matrix drift sensitivity index, execute a multi-dimensional threshold composite judgment logic: when the cross-phase sensitivity factor is greater than the first threshold and the inter-peak overlap index is greater than the second threshold, the current-voltage curve is determined to belong to the cross-phase shift dominant condition; when the peak skewness index is less than the third threshold or greater than the fourth threshold, and the normalized peak distortion is greater than the fifth threshold, the current-voltage curve is determined to belong to the asymmetric distortion dominant condition; when the matrix drift sensitivity index is greater than the sixth threshold, and the cross-phase sensitivity factor is less than the first threshold, the inter-peak overlap index is less than the second threshold, the peak skewness index is within the target range, and the normalized peak distortion is less than the fifth threshold, the current-voltage curve is determined to belong to the matrix drift dominant condition; if none of the above conditions are met, no matrix shift distortion dominant condition is generated.

4. The electrochemical sensing method for detecting heavy metal ions in food according to claim 3, characterized in that, Based on the potential range corresponding to the effective dissolution peak width of each effective heavy metal ion in the effective heavy metal ion pair, the system is divided into a left sub-range and a right sub-range, with the peak potential of the current effective heavy metal ion as the boundary. Based on the current-voltage curve of the current effective heavy metal ion in the left sub-range, the response span of the left peak edge, the response span of the right peak edge, and the number of high curvature points are determined, and judgment conditions are applied to generate normalized distortion, including the following steps: Step 361: Based on the potential range corresponding to the effective dissolution peak width of each heavy metal effective ion, divide the region into a left sub-range and a right sub-range, with the peak potential of the current heavy metal effective ion as the boundary. Step 362: Based on the current-voltage curve of the current effective heavy metal ion in the left sub-interval, calculate the absolute value of the first first derivative, identify the first maximum potential point based on the absolute value of the first first derivative, and calculate the potential distance between the first maximum potential point and the peak potential as the left peak edge response span; based on the current-voltage curve of the current effective heavy metal ion in the right sub-interval, calculate the absolute value of the second first derivative, identify the second maximum potential point based on the absolute value of the second first derivative, and calculate the potential distance between the second maximum potential point and the peak potential as the right peak edge response span; Step 363: Based on the current-voltage curve of the current effective heavy metal ions in the left sub-interval, calculate the absolute value of the first second derivative, determine the number of sampling points where the first second derivative is greater than the preset curvature threshold, and record them as the number of high curvature points on the left; based on the current-voltage curve of the current effective heavy metal ions in the right sub-interval, calculate the absolute value of the second second derivative, determine the number of sampling points where the second second derivative is greater than the preset curvature threshold, and record them as the number of high curvature points on the right. Step 364, the judgment conditions include a first judgment condition and a second judgment condition; the first judgment condition is specifically: calculate the ratio of the response span of the left peak edge to the response span of the right peak edge to obtain a first ratio value. If the first ratio value is less than the first lower limit of distortion or greater than the first upper limit of distortion, it is determined that the dissolution peak of the current heavy metal effective ion has significant peak edge asymmetry; the second judgment condition is specifically: if the absolute value of the difference between the number of high curvature points on the left and the number of high curvature points on the right exceeds the preset tolerance, it is determined that the dissolution peak of the current heavy metal effective ion has local curvature distribution distortion. Step 365: When the current effective heavy metal ion meets the first judgment condition and the second judgment condition, the normalized distortion of the current effective heavy metal ion is set to the first preset constant; when the current effective heavy metal ion meets either the first judgment condition or the second judgment condition, the normalized distortion of the current effective heavy metal ion is set to the second preset constant; when the current effective heavy metal ion does not meet the first judgment condition or the second judgment condition, the normalized distortion of the current effective heavy metal ion is set to the third preset constant.

5. The electrochemical sensing method for detecting heavy metal ions in food according to claim 4, characterized in that, First preset constant > Second preset constant > Third preset constant.

6. The electrochemical sensing method for detecting heavy metal ions in food according to claim 4, characterized in that, Based on each of the aforementioned matrix migration distortion-dominant conditions, the corresponding migration characteristics are calculated, including the following steps: Step 41: Based on each adjacent pair of effective heavy metal ions in the cross-phase shift dominant working condition, determine the local fitting mismatch and combine it with the cross-phase sensitivity factor to obtain the cross-phase shift feature corresponding to the current effective heavy metal ion. Step 42: Based on each of the effective heavy metal ions in the asymmetric distortion-dominated operating condition, calculate the span difference between the response span of the left peak edge and the response span of the right peak edge, and obtain the asymmetric distortion feature corresponding to the current effective heavy metal ion by multiplying the span difference and the normalized distortion. Step 43: Based on the effective heavy metal ions in the matrix drift-dominant operating condition, obtain the potential difference between the peak potential and the dissolution initiation potential; multiply the baseline slope by the potential difference to obtain the matrix drift characteristics corresponding to the current effective heavy metal ions.

7. The electrochemical sensing method for detecting heavy metal ions in food according to claim 6, characterized in that, Based on each adjacent effective heavy metal ion pair in the cross-phase shift-dominant operating condition, the local fitting mismatch is determined and combined with the cross-phase sensitivity factor to obtain the cross-phase shift characteristics, including the following steps: Step 411: Based on each of the adjacent effective heavy metal ion pairs, construct a local fitting window within the corresponding effective dissolution peak width range with the peak potential as the center; perform Gaussian-Lorentz mixture function fitting based on the current-voltage curve within the local fitting window to obtain the fitting residual sequence; calculate the absolute mean of the fitting residual sequence in the preset peak potential neighborhood interval, and record it as the local fitting mismatch degree. Step 412: Multiply the local fitting mismatch degree by the cross-phase sensitivity factor of the corresponding adjacent heavy metal effective ion pair to obtain the preliminary cross-phase shift characteristics; Step 413: If the preliminary cross-phase offset feature is less than the first lower threshold, then the cross-phase offset feature is set to zero; if the preliminary cross-phase offset feature is greater than the first upper threshold, then the preliminary cross-phase offset feature is defined as the first upper threshold; otherwise, the preliminary cross-phase offset feature is used as the cross-phase offset feature.

8. An electrochemical sensing system for detecting heavy metal ions in food, used to perform the electrochemical sensing method for detecting heavy metal ions in food according to any one of claims 1-9, characterized in that, Includes the following modules: The acquisition module is used to acquire the voltammetric current-potential curve of the anodic dissolution stage of the food sample under test through an electrochemical sensor; The current-potential curve includes multiple sampling points, each sampling point being a one-to-one corresponding current and potential; The differential processing module is used to perform second-order differential processing based on the current-voltage curve to obtain the second-order derivative curve. The zero-crossing pairs are identified based on the second derivative curves, and the effective dissolution peak width of each heavy metal ion is calculated based on the zero-crossing pairs. The identification module is used to construct multiple inter-peak interference discrimination indicators based on the effective dissolution peak width and the current-voltage curve, and execute judgment logic to generate multiple matrix shift distortion dominant conditions. The feature processing module is used to calculate the corresponding offset features based on each of the matrix offset distortion dominant conditions. The prediction module is used to identify the peak current and peak potential of each heavy metal ion based on the current-potential curve. It splices the peak current, peak potential, effective dissolution peak width, offset characteristics of each operating condition, and inter-peak interference discrimination index to form a mixed feature vector, which is used as input data for the neural network model to make predictions and obtain the predicted concentration of each heavy metal ion.