A geothermal reservoir water bicarbonate ion prediction method and device based on a neural network and a medium

CN122944630APending Publication Date: 2026-10-20CENT FOR HYDROGEOLOGY & ENVIRONMENTAL GEOLOGY CGS
View PDF 0 Cites 0 Cited by

Patent Information

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

AI Technical Summary

Technical Problem

[0007]因此,本发明提供了一种基于神经网络的地热储层水体碳酸氢根预测方法解决了传感漂移与水质变化混叠导致碳酸氢根预测失准的问题

Benefits of technology

[0018]本发明有益效果为:通过基于碳酸缓冲特征序列构建双支路神经网络,分别提取水团时序变化和缓冲响应关系,并利用门控融合形成碳酸氢根候选预测值,再以碳量闭合和电荷闭合偏差更新双支路连接权重和门控融合偏置,完成动态变化信息与闭合约束的协同表征,使智能传感系统能够抑制传感漂移和附加缓冲影响在预测链路中的传递,用于复杂水体碳酸氢根浓度的连续判定和趋势预测,提高了碳酸氢根预测的稳定性与准确性。

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure FT_1
    Figure FT_1
  • Figure FT_2
    Figure FT_2
  • Figure FT_3
    Figure FT_3
Patent Text Reader

Abstract

This invention discloses a method, device, and medium for predicting bicarbonate levels in geothermal reservoir water based on neural networks, relating to the field of intelligent monitoring technology for geothermal reservoir water quality. The method includes: collecting monitoring water quality data; calibrating bypass water samples from the monitoring water quality data using acid pulses and binding them with bicarbonate training labels to generate a water mass response sample set; real-time alignment of the monitoring water quality data based on the water mass response sample set to obtain channel change characteristics; distinguishing between sensor drift and actual water quality changes based on these channel change characteristics to obtain a water mass calibration sequence; extracting a water body carbonate buffer evolution fingerprint from the water mass calibration sequence; identifying the bicarbonate buffer contribution and separating additional buffer effects based on the water body carbonate buffer evolution fingerprint to generate a carbonate buffer feature sequence. This invention improves the stability and accuracy of bicarbonate prediction.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of intelligent water quality monitoring technology, and in particular to a method, equipment and medium for predicting bicarbonate in geothermal reservoir water based on neural networks. Background Technology

[0002] Geothermal reservoir water is characterized by high temperature and pressure, complex water-rock interaction, continuous dissolution of surrounding rock minerals, and strong disturbance from reinjection water. As a core parameter of the geothermal reservoir buffer system, bicarbonate ions in the water directly affect scaling, corrosion, reservoir porosity evolution, and the stability of geothermal resource development. However, its concentration is affected by multiple factors such as formation temperature, pressure, dissolution of surrounding rock carbonate minerals, mixing of external water, and high-temperature drift in the sensing environment. Conventional detection methods are difficult to achieve accurate and stable prediction.

[0003] Bicarbonate is the main ionic form in natural water bodies. Its concentration and proportion determine the alkalinity, buffering capacity, and inorganic carbon cycle characteristics of the water body, making it an important indicator for evaluating water quality chemistry, determining groundwater recharge sources, and monitoring ocean acidification. Traditional detection methods mainly employ acid-base titration or ion chromatography, but these methods require on-site sampling and laboratory analysis, which are cumbersome and time-consuming. Furthermore, the carbonic acid equilibrium of water samples is easily affected by temperature and pressure changes during sampling and transportation, causing shifts that fail to accurately reflect the original concentration.

[0004] With the development of online water environment monitoring, micro-electrochemical sensing, and data-driven analysis methods, an indirect prediction method for bicarbonate based on an intelligent sensing system has been developed. This method continuously collects information on water pH, conductivity, temperature, dissolved carbon dioxide, and flow rate, and uses the bicarbonate concentration measured from synchronous water samples as training labels to establish a neural network mapping relationship between multi-channel monitoring information and bicarbonate concentration. Combined with temperature compensation, outlier removal, and time series smoothing, the method continuously characterizes the alkalinity state of the water body, providing a predictive basis for monitoring the carbonate balance of rivers, lakes, reservoirs, and industrial circulating water.

[0005] Existing methods typically input multi-channel monitoring values ​​directly into a pre-trained neural network. In scenarios where sensors operate continuously for extended periods and the composition of the water buffer changes, channel shifts caused by electrode zero-point drift, sensitive membrane fouling, and changes in ionic strength may exhibit pH and conductivity responses similar to those of real water quality changes resulting from buffering by phosphates, silicates, and organic acids. Because the training samples lack water mass anchoring, buffer response identification, and carbon and charge closure constraints, the neural network tends to categorize responses from different formation mechanisms into the same feature path. This causes monitoring bias to accumulate along the prediction process and result in bicarbonate concentration shifts. Therefore, there is still room for improvement in the ability to separate sensor drift from real water quality changes. Summary of the Invention

[0006] In view of the aforementioned existing problems, the present invention is proposed.

[0007] Therefore, this invention provides a method for predicting bicarbonate in geothermal reservoir water based on neural networks, which solves the problem of inaccurate bicarbonate prediction caused by the overlap of sensor drift and water quality changes.

[0008] To solve the above-mentioned technical problems, the present invention provides the following technical solution: In a first aspect, the present invention provides a method for predicting bicarbonate levels in geothermal reservoir water based on a neural network, comprising: collecting monitoring water quality data; calibrating bypass water samples from the monitoring water quality data with acid pulses and binding bicarbonate training labels to generate a water mass response sample set; based on the water mass response sample set, performing time alignment on the monitoring water quality data to obtain channel change features; distinguishing between sensor drift and actual water quality changes based on the channel change features to obtain a water mass calibration sequence; extracting a water body carbonate buffer evolution fingerprint from the water mass calibration sequence; identifying bicarbonate buffer contribution and separating additional buffer effects based on the water body carbonate buffer evolution fingerprint to generate a carbonate buffer feature sequence; constructing a dual-branch neural network based on the carbonate buffer feature sequence and initializing the dual-branch connection weights and gating fusion bias; and extracting bicarbonate buffer features from the carbonate buffer feature sequence. The temporal changes of water masses and the buffer response relationship are collected, and the temporal changes of water masses and the buffer response relationship are gated and fused to obtain candidate predicted values ​​of bicarbonate. Carbon content closure and charge closure are verified on the candidate predicted values ​​of bicarbonate. The dual-branch connection weights and gating fusion bias are updated according to the closure deviation to generate a bicarbonate prediction model. Based on the bicarbonate prediction model, real-time water mass changes and the most recent buffer fingerprint are jointly inferred to predict the current concentration and subsequent changes, and carbonic acid form and charge closure verification are performed to generate a charge balance prediction sequence. The buffer response in the charge balance prediction sequence is anchored and compared with the synchronous water sample label to obtain the corrected monitoring bias and the terminal parameters of the dual-branch neural network. The monitoring bias and the terminal parameters of the dual-branch neural network are corrected according to the sensor drift and the actual water quality changes to generate a bicarbonate prediction record.

[0009] As a preferred embodiment of the neural network-based method for predicting bicarbonate in geothermal reservoir water according to the present invention, the specific steps of collecting and monitoring water quality data, calibrating bypass water samples in the monitoring water quality data with acid pulses and binding bicarbonate training labels to generate a water mass response sample set are as follows: After the acid-base state of the bypass water sample reaches stability, a quantitative acid solution is added. The acid-base changes after the addition of acid solution are continuously collected until stability is restored. The acid-base changes with continuous response and complete recovery process are correlated with the water quality monitoring data to generate acid pulse calibration records. Based on the acid pulse calibration record, synchronous water samples corresponding to the same water mass are collected. The bicarbonate concentration obtained from the synchronous water sample measurement is determined as the bicarbonate training label. The bicarbonate training label is then bound to the acid pulse calibration record and the water quality monitoring data according to the water mass affiliation and sampling time to generate a water mass response sample set.

[0010] As a preferred embodiment of the neural network-based method for predicting bicarbonate in geothermal reservoir water according to the present invention, the step of aligning the monitored water quality data based on the water mass response sample set, obtaining channel change characteristics, distinguishing between sensor drift and actual water quality changes based on the channel change characteristics, and obtaining a water mass calibration sequence is as follows: The pH and conductivity samples in the water mass response sample set are arranged according to the sampling time. Within the same water mass, the sampling time when the conductivity begins to change continuously is used as the alignment reference. The pH samples are moved to the sampling position with the highest degree of overlap with the conductivity change process to generate a water mass alignment sequence. Based on the water mass alignment sequence, the acidity and conductivity sampling values ​​at adjacent sampling times are compared respectively, and the channel change characteristics at which the two sampling values ​​begin to change are recorded. Based on the channel change characteristics, water masses whose pH values ​​change in the same direction for three consecutive sampling times but whose conductivity values ​​do not show a corresponding change are marked as sensor drift. Water masses whose pH and conductivity values ​​show a corresponding change for three consecutive sampling times are marked as true water quality changes. The change marks are written into the water mass alignment sequence to generate a water mass calibration sequence.

[0011] As a preferred embodiment of the neural network-based method for predicting bicarbonate in geothermal reservoir water according to the present invention, the specific steps of extracting the bicarbonate buffer evolution fingerprint from the water mass calibration sequence, identifying the bicarbonate buffer contribution and separating the additional buffer influence based on the bicarbonate buffer evolution fingerprint, and generating a bicarbonate buffer feature sequence are as follows: Based on the water mass calibration sequence, the stable pH before acid addition, the minimum pH after acid addition, and the time required to recover to the stable pH are determined from the acid pulse calibration record. The difference between the stable pH and the minimum pH is determined as the buffer amplitude. The buffer amplitude, channel change characteristics, and bicarbonate training labels corresponding to the same water mass are bound to the water mass isotope to generate a water body carbonic acid buffer evolution fingerprint. Based on the evolution fingerprint of water body carbonic acid buffering, under the condition of keeping the amount of acid added constant, each water mass is arranged from low to high according to the bicarbonate training label. The part of buffering amplitude and recovery time that increases synchronously with the bicarbonate training label is identified as bicarbonate buffering contribution, and the part that does not change synchronously with the bicarbonate training label is identified as additional buffering influence, and a buffering attribution record is generated. Excluding water masses marked as sensor drift in the buffer attribution record, the bicarbonate buffer contribution corresponding to the actual water quality change is determined as the main buffer feature, and the additional buffer effect is determined as the buffer correction feature. Then, the main buffer feature and the buffer correction feature are arranged according to the water mass number and sampling time to generate the bicarbonate buffer feature sequence.

[0012] As a preferred embodiment of the neural network-based method for predicting bicarbonate in geothermal reservoir water according to the present invention, the steps of constructing a dual-branch neural network based on the carbonate buffer feature sequence and initializing the dual-branch connection weights and gating fusion bias, extracting the temporal variation of water masses and the buffer response relationship from the carbonate buffer feature sequence, and gating fusion of the temporal variation of water masses and the buffer response relationship to obtain candidate predicted values ​​of bicarbonate are as follows: The main buffer features and buffer correction features are arranged according to the carbonate buffer feature sequence, and continuous training windows are divided. The continuous training windows are bound to the corresponding bicarbonate training labels to generate a dual-branch training sample set. Based on the continuous training window in the dual-branch training sample set, a gated loop structure and corresponding temporal connection relationship are set to obtain the gated loop temporal branch; Based on the main buffer features, buffer correction features, and bicarbonate training labels in the dual-branch training sample set, a mapping relationship between the buffer features and the bicarbonate training labels is set to obtain the buffer mapping branch. Connect the gated cyclic timing branch with the buffer mapping branch, and set the gated fusion relationship at the output of the two branches to construct a dual-branch neural network; Based on the dual-branch neural network, the connection positions between adjacent network layers in the gated recurrent temporal branch and the buffer mapping branch are determined respectively. The weight initialization range is determined according to the number of input nodes and output nodes corresponding to each connection position. Within the weight initialization range, the temporal connection weights and buffer connection weights are configured respectively. The gated fusion bias is set according to the initial scale of the output features of the two branches to generate the initial dual-branch neural network. Temporal correlation was performed on the carbonate buffer feature sequence to determine the direction and magnitude of change of each buffer feature with the sampling time, and the temporal change of water mass was extracted. The main buffer feature, buffer correction feature and corresponding bicarbonate training label were mapped and compared to determine the buffer response direction and response degree, the buffer response relationship was extracted, and a dual-branch response record was generated. Based on the response records of the two branches, the retention ratio of the water mass temporal change and the buffer response relationship is determined. The retained water mass temporal change and buffer response relationship are then fused by isotopic weighting, and the fused content is mapped to the corresponding bicarbonate concentration range to obtain the candidate predicted value of bicarbonate.

[0013] As a preferred embodiment of the neural network-based water bicarbonate prediction method of the present invention, the steps of performing carbon content closure and charge closure verification on the candidate bicarbonate prediction values, updating the dual-branch connection weights and gated fusion bias according to the closure deviation, and generating a bicarbonate prediction model are as follows: The candidate bicarbonate prediction values ​​are compared with the corresponding bicarbonate training labels to perform carbon closure verification, and the candidate bicarbonate prediction values ​​and the charge equivalents corresponding to the additional buffer effects are compared with the acid equivalents corresponding to the acid pulse calibration records to perform charge closure verification, thereby determining the carbon closure deviation and charge closure deviation, and generating a closure deviation record. Based on the closure deviation record, determine the weight adjustment direction and adjustment amount of the corresponding connection positions in the gated cyclic timing branch and the buffer mapping branch, and determine the gating fusion bias adjustment direction based on the proximity of the corresponding candidate outputs of the two branches to the bicarbonate training labels, and generate dual-branch parameter correction records. Based on the dual-branch parameter correction record, the temporal connection weights, buffer connection weights, and gated fusion bias in the initial dual-branch neural network are updated. The dual-branch training sample set is input into the updated dual-branch neural network for continuous deduction, and bicarbonate candidate prediction values ​​are re-formed. Carbon content closure and charge closure verification are carried out until the carbon content closure deviation and charge closure deviation meet the corresponding detection range, thus generating a bicarbonate prediction model.

[0014] As a preferred embodiment of the neural network-based method for predicting bicarbonate in geothermal reservoir water as described in this invention, the bicarbonate prediction model jointly infers real-time water mass changes with the most recent buffer fingerprint to predict the current concentration and subsequent changes, and performs a closed-loop verification of carbonate speciation and charge to generate a charge balance prediction sequence. The specific steps are as follows: Based on the sampling interval corresponding to the bicarbonate prediction model, water quality data is continuously collected and monitored, and new sampling content is processed by judgment rules. The real water quality changes are arranged according to the water mass number and sampling time to generate a real-time water mass change record. Based on real-time water mass change records, effective water mass carbonation buffer evolution fingerprints with the same monitoring point and the formation time closest to the current sampling time are selected from the water body carbonation buffer evolution fingerprints. The effective water body carbonation buffer evolution fingerprints are identified as the most recent buffer fingerprints, and the most recent buffer fingerprints are matched with the real-time water mass change records in a time-series proximity to generate water mass fingerprint matching records. Based on water mass fingerprint matching records, real-time water mass changes and the most recent buffer fingerprint are respectively input into the gated cyclic time-series branch and the buffer mapping branch corresponding to the bicarbonate prediction model for joint inference. According to the gated fusion relationship fixed in the bicarbonate prediction model, the gated cyclic time-series branch and the buffer mapping branch are gated and fused to generate a concentration prediction sequence. Based on the concentration prediction sequence, the acidity and temperature in the monitored water quality data are used to reconstruct the carbonic acid speciation relationship corresponding to the current predicted bicarbonate concentration. The reconstructed carbon and charge are compared with the fingerprint carbon equivalent corresponding to the most recent buffer fingerprint, and a closure verification is performed with the fingerprint charge equivalent. Carbonic acid speciation deviation and charge deviation are recorded to generate a closure verification record. Based on the closed verification record, the predicted concentrations of bicarbonate that have completed carbonic acid form closure and charge closure are retained. For the predicted concentrations of bicarbonate with correctable deviations, double closure is performed in a coordinated manner to reduce the deviations of carbonic acid form and charge. The predicted concentrations of bicarbonate that lack effective closure relationships are marked as concentrations to be verified. Then, the current closed prediction information is arranged according to the prediction time to generate a charge balance prediction sequence.

[0015] As a preferred embodiment of the neural network-based water bicarbonate prediction method of the present invention, the steps of anchoring and comparing the buffer response in the charge balance prediction sequence with the synchronous water sample tag to obtain the corrected monitoring bias and the terminal parameters of the dual-branch neural network, and correcting the monitoring bias and the terminal parameters of the dual-branch neural network according to the sensor drift and the actual water quality changes to generate a bicarbonate prediction record are as follows: Based on the prediction time recorded in the charge balance prediction sequence, acid pulse calibration is performed on the bypass water sample of the corresponding water mass and synchronous water sample is collected. The buffer amplitude and recovery time formed by the acid pulse calibration are determined as the new buffer response, and the bicarbonate concentration measured by the synchronous water sample is determined as the synchronous water sample label. The new buffer response and synchronous water sample label are anchored and compared with the closure prediction information and the most recent buffer fingerprint to generate an anchoring comparison record. Based on the channel change characteristics of pH and conductivity in the anchor comparison record and the relationship between the change of the newly added buffer response and the synchronous water sample label, the sensor drift and the actual water quality change are distinguished. The pH monitoring bias corresponding to the sensor drift is corrected, and the terminal output connection weight and output bias of the dual-branch neural network corresponding to the actual water quality change are corrected. The corrected content is written into the bicarbonate prediction model to generate a self-calibrating bicarbonate prediction model. Based on the self-calibrating bicarbonate prediction model, the real-time water mass change after monitoring bias correction is input into the gated cyclic timing branch, and the newly added buffer response is input into the buffer mapping branch. The outputs of the two branches are gated and fused, and the carbonic acid morphology closure and charge closure verification are performed to generate bicarbonate prediction records.

[0016] In a second aspect, the present invention provides a computer device including a memory and a processor, wherein the memory stores a computer program, wherein the computer program, when executed by the processor, implements any step of the neural network-based method for predicting bicarbonate in water as described in the first aspect of the present invention.

[0017] Thirdly, the present invention provides a computer-readable storage medium having a computer program stored thereon, wherein: when the computer program is executed by a processor, it implements any step of the neural network-based method for predicting bicarbonate in water as described in the first aspect of the present invention.

[0018] The beneficial effects of this invention are as follows: By constructing a dual-branch neural network based on the carbonate buffer feature sequence, the temporal changes of water masses and the buffer response relationship are extracted respectively. Then, the candidate predicted value of bicarbonate is formed by gating fusion. The dual-branch connection weights and gating fusion bias are updated with carbon content closure and charge closure deviations to complete the collaborative representation of dynamic change information and closure constraints. This enables the intelligent sensing system to suppress the transmission of sensing drift and additional buffer effects in the prediction link, and is used for continuous determination and trend prediction of bicarbonate concentration in complex water bodies, thereby improving the stability and accuracy of bicarbonate prediction. Attached Figure Description

[0019] To more clearly illustrate the technical solutions of the embodiments of the present invention, the drawings used in the following description of the embodiments will be briefly introduced. Obviously, the drawings described below are only some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.

[0020] Figure 1 This is a flowchart of a neural network-based method for predicting bicarbonate levels in water.

[0021] Figure 2 A flowchart for water mass calibration and carbonate buffer feature sequence generation.

[0022] Figure 3 This is a flowchart of the training and closure constraints for a two-branch neural network.

[0023] Figure 4 This is a flowchart for real-time joint inference and anchoring self-correction.

[0024] Figure 5 A comparison chart of the intensity of the additional buffer effect and the mean absolute error.

[0025] Figure 6 This is a graph showing the effect of sensor drift intensity on prediction stability. Detailed Implementation

[0026] To make the above-mentioned objects, features and advantages of the present invention more apparent and understandable, the specific embodiments of the present invention will be described in detail below with reference to the accompanying drawings.

[0027] Many specific details are set forth in the following description in order to provide a full understanding of the invention. However, the invention may also be practiced in other ways different from those described herein, and those skilled in the art can make similar extensions without departing from the spirit of the invention. Therefore, the invention is not limited to the specific embodiments disclosed below.

[0028] Secondly, the term "one embodiment" or "embodiment" as used herein refers to a specific feature, structure, or characteristic that may be included in at least one implementation of the present invention. The phrase "in one embodiment" appearing in different places in this specification does not necessarily refer to the same embodiment, nor is it a single or selective embodiment that is mutually exclusive with other embodiments.

[0029] Reference Figures 1-6 This is one embodiment of the present invention, which provides a method for predicting bicarbonate levels in geothermal reservoir water based on neural networks, comprising the following steps: S1. Collect and monitor water quality data, perform acid pulse calibration on bypass water samples in the monitoring water quality data and bind bicarbonate training labels to generate a water mass response sample set.

[0030] S1.1 After the acid-base state of the bypass water sample reaches stability, add a quantitative amount of acid solution and continuously collect the acid-base changes after the addition of acid solution until it returns to stability. Then, associate the continuous and complete acid-base changes in the response process with the water quality monitoring data to generate an acid pulse calibration record.

[0031] It should be noted that bypass water samples are collected at fixed sampling intervals to monitor acid-base changes. Sampling intervals continuously within a preset fluctuation range are defined as stable intervals. After the acid-base state stabilizes, a quantitative amount of acid is added, and sampling continues until the acid-base changes re-enter the preset fluctuation range. The continuity of sampling time and the end-of-pipe recovery status are verified. Acid-base changes without missing samples and with complete stable recovery are retained. Water masses are then assigned to corresponding locations based on sampling location and water flow arrival time difference, and acid pulse calibration records are generated.

[0032] It should also be noted that the fluctuation range is set based on the acid-base changes collected continuously when no quantitative acid solution is added and the water flow remains stable. First, abruptly jumping sampling values ​​are eliminated, and then the average level of the remaining sampling values ​​is used as the center of the range. The larger value between the stable fluctuation amplitude and the sampling repeatability error is used as the upper and lower boundaries. The fluctuation range is used to distinguish between normal sampling fluctuations and acid-base changes caused by acid pulses, and to determine whether the bypass water sample has reached stability and completed recovery, thereby improving the accuracy of acid pulse calibration and the comparability of response processes of different water masses.

[0033] S1.2. Based on the acid pulse calibration record, collect synchronous water samples corresponding to the same water mass, determine the bicarbonate concentration obtained from the synchronous water sample measurement as the bicarbonate training label, and bind the bicarbonate training label with the acid pulse calibration record and the monitoring water quality data according to the water mass affiliation and sampling time to generate a water mass response sample set.

[0034] It should be noted that, based on the water mass attribution and the time of quantitative acid addition in the acid pulse calibration record, the stable sampling interval before the quantitative acid addition is locked, quantitative water samples are collected synchronously at the same bypass sampling location, and synchronous water samples are recorded according to the water mass attribution and sampling time.

[0035] After the synchronous water sample is brought to a constant volume, an equal amount of test sample is taken. Standard acid solution is added to the test sample until the specified titration endpoint is reached. The bicarbonate concentration is calculated based on the amount of standard acid solution consumed and the volume of the synchronous water sample. The bicarbonate concentration within the allowable range of parallel measurement deviation is determined as the bicarbonate training label. The corresponding calibration content is located in the acid pulse calibration record according to the water mass attribution. Then, the synchronous monitoring content is located in the monitoring water quality data according to the sampling time. The bicarbonate training label is bound to the corresponding calibration content and synchronous monitoring content one by one. The consistency of water mass attribution and the continuity of sampling time of the bound content are checked. The bound content that has been checked and consistent is retained and arranged according to water mass attribution and sampling time to generate a water mass response sample set.

[0036] S2. Based on the water mass response sample set, the monitoring water quality data is time-aligned to obtain channel change characteristics. Based on the channel change characteristics, the sensor drift and the actual water quality change are distinguished to obtain the water mass calibration sequence. The water body carbonic acid buffer evolution fingerprint is extracted from the water body carbonic acid buffer evolution fingerprint. Based on the water body carbonic acid buffer evolution fingerprint, the bicarbonate buffer contribution is identified and the additional buffer effect is separated to generate the carbonic acid buffer feature sequence.

[0037] S2.1 Arrange the pH and conductivity samples in the water mass response sample set according to the sampling time. Within the same water mass, use the sampling time when the conductivity begins to change continuously as the alignment reference. Move the pH sample to the sampling position that has the highest degree of overlap with the conductivity change process to generate a water mass alignment sequence.

[0038] It should be noted that the water mass response sample set is grouped according to water mass affiliation, and within the same water mass, pH and conductivity sample values ​​are arranged according to sampling time. The change amplitude of adjacent conductivity sample values ​​is compared hourly, and the first sampling time exceeding the stable fluctuation range for three consecutive sampling times is determined as the alignment benchmark. Changes not maintained for three consecutive sampling times are treated as instantaneous fluctuations. Maintaining the internal order and value of the pH sample values, the samples are moved forward and backward at intervals of one sampling position, and the number of overlapping sampling times between pH and conductivity change periods is counted. The sampling position with the most overlap is retained; if the number of overlaps is the same, the sampling position with the smaller movement distance is retained. The finally retained pH sample values ​​are matched item by item with the conductivity sample values ​​at the same sampling time, and arranged according to water mass affiliation and sampling time to generate a water mass alignment sequence.

[0039] S2.2. Based on the water mass alignment sequence, compare the pH and conductivity sampling values ​​at adjacent sampling times and record the channel change characteristics at which the two sampling values ​​begin to change.

[0040] It should be noted that, based on the water mass alignment sequence, adjacent sampling positions are locked one by one according to the sampling time, and the change range of pH and conductivity sampling values ​​at the later sampling time relative to the previous sampling time is calculated and compared with the corresponding stable fluctuation range.

[0041] When the change amplitude is within the stable fluctuation range, it is marked as channel stability. When the change amplitude exceeds the stable fluctuation range but is not maintained for three consecutive sampling times, it is marked as instantaneous fluctuation. When the change amplitude exceeds the stable fluctuation range for three consecutive sampling times, the first sampling time that exceeds the stable fluctuation range is marked as the start of change. When both the pH and conductivity sampling values ​​form the start of change, the interval between the two start of change times is compared. When the interval is no more than one sampling interval, it is marked as synchronous change. When the interval is more than one sampling interval, it is marked as delayed change, and the sampling value that changes first is recorded. When only one sampling value forms the start of change, it is marked as single-channel change. The change state, start of change time, and change state corresponding to each sampling time are arranged continuously according to the water mass affiliation to generate channel change characteristics.

[0042] It should also be noted that the channel change characteristics are used to characterize the direction of change, starting point of change, and linkage relationship of pH and conductivity sampling values ​​at adjacent sampling times. Based on this, the sensor drift caused by single-channel pH offset is distinguished from the real water quality change caused by multi-channel synchronous change, and a judgment basis is provided for subsequent water mass calibration and buffer feature extraction, thereby reducing the interference of sensor drift on the bicarbonate prediction process and improving the stability and accuracy of continuous prediction.

[0043] S2.3. Based on the channel change characteristics, water masses whose pH values ​​change in the same direction for three consecutive sampling times and whose conductivity values ​​do not change accordingly are marked as sensor drift. Water masses whose pH values ​​and conductivity values ​​change in the same direction for three consecutive sampling times are marked as true water quality changes. The change marks are written into the water mass alignment sequence to generate a water mass calibration sequence.

[0044] It should be noted that, based on the channel change characteristics, the water mass alignment sequence is divided into continuous judgment windows according to the water mass affiliation. Each continuous judgment window contains three consecutive sampling times, and the direction of change of the pH and conductivity sampling values ​​relative to the previous sampling time is determined item by item. The three consecutive sampling times are determined based on the duration of noise in stable water masses, the response time of pH and conductivity, and the effective change time during acid pulse calibration. After continuous sampling verification, a single instantaneous fluctuation usually subsides within two sampling times, while the actual water quality change can last for more than three sampling times. Therefore, three consecutive sampling times are used as the change judgment condition to eliminate misjudgments caused by isolated jumps and short-term noise.

[0045] When the pH value increases or decreases for three consecutive sampling times, while the conductivity value is in a stable state or only fluctuates momentarily, it is determined that the conductivity value has not changed accordingly, and the water mass belonging to the continuous judgment window is marked as sensor drift. When both the pH value and the conductivity value exceed the corresponding stable fluctuation range for three consecutive sampling times, and the interval between the start of the change of the two values ​​does not exceed one sampling interval, it is determined that the two values ​​have changed accordingly, and the water mass belonging to the continuous judgment window is marked as a real water quality change.

[0046] When the continuous decision window does not meet the criteria for determining sensor drift and actual water quality changes, the continuous decision window is moved back by one sampling time and re-determined until all sampling times of the water mass alignment sequence are checked. The change markers corresponding to sensor drift and actual water quality changes are written into the corresponding sampling times in the water mass alignment sequence and rearranged according to water mass affiliation and sampling time to generate a water mass calibration sequence.

[0047] like Figure 6As shown, the comparison chart of sensor drift intensity and prediction error standard deviation is used to verify the effect of channel change characteristics and water mass calibration sequence on improving prediction stability. The horizontal axis represents sensor drift intensity, and the vertical axis represents the prediction error standard deviation. The curves correspond to the method of this invention, the ordinary neural network prediction method, and the drift-free correction method, respectively. As the sensor drift intensity increases, the prediction error standard deviation of the ordinary neural network prediction method and the drift-free correction method remains at a high level, while the prediction error standard deviation of the method of this invention remains consistently low. This indicates that this invention, through channel-to-channel cross-checking of pH and conductivity sampling values, marks continuous single-channel pH shifts as sensor drift and retains the actual water quality changes in the water mass calibration sequence, reducing the propagation of sensor drift in subsequent prediction links, thereby improving continuous prediction stability.

[0048] The method of this invention distinguishes between sensor drift and actual water quality changes by identifying channel change characteristics. It weakens the single-channel pH offset corresponding to sensor drift from the water mass calibration sequence before prediction. The curve in the figure shows that the standard deviation of the prediction error of the method of this invention remains consistently low, and the fluctuation amplitude is small when the sensor drift intensity changes. This indicates that the invention can reduce the transmission of sensor drift to the bicarbonate prediction model, thus maintaining better stability in the continuous prediction process.

[0049] The conventional neural network prediction method directly utilizes water quality monitoring data such as pH and conductivity samples to establish predictive relationships, but it fails to adequately distinguish between sensor drift and actual water quality changes, as shown in the comparison curve. The standard deviation of the prediction error of the conventional neural network method is generally higher than that of the method described in this invention. This indicates that when pH channel drift occurs, the conventional neural network tends to learn the drift changes as valid water quality changes, leading to increased prediction fluctuations and decreased stability in continuous prediction.

[0050] The drift-free correction method does not identify or correct for sensor drift at all; instead, it directly uses the monitored water quality data containing drift offsets to predict the comparison curve. The drift-free correction method in the figure has the highest standard deviation of prediction error, indicating that sensor drift continuously amplifies unstable factors in the prediction chain, making the predicted bicarbonate value more prone to deviating from the normal range. This also highlights the necessity of sensor drift identification and water mass calibration in this invention.

[0051] S2.4 Based on the water mass calibration sequence, determine the stable pH before acid addition, the minimum pH after acid addition, and the time required to recover to the stable pH from the acid pulse calibration record. Determine the difference between the stable pH and the minimum pH as the buffer amplitude. Bind the buffer amplitude, channel change characteristics, and bicarbonate training labels corresponding to the same water mass to the water mass isotope to generate a water body carbonic acid buffer evolution fingerprint.

[0052] It should be noted that, based on the water mass calibration sequence, the acid pulse response process corresponding to the water mass attribution in the acid pulse calibration record is located. pH samples that were continuously within a stable fluctuation range before acid addition are selected, and the average value is determined as the stable pH. Starting from the moment of acid addition, the pH samples are compared hourly, and the lowest value is determined as the minimum pH. The difference between the stable pH and the minimum pH is determined as the buffer amplitude. When the pH sample re-enters the fluctuation range corresponding to the stable pH and remains there for three consecutive sampling moments, the sampling moment when it first enters the fluctuation range is determined as the recovery moment, and the time required to recover to the stable pH is calculated. The buffer amplitude and recovery time are combined to form a buffer response feature. Then, water mass isotopes are bound according to the water mass attribution, sampling moment, channel change characteristics, and bicarbonate training labels. Contents that have not completed stable recovery or have inconsistent bindings are excluded, generating a water body carbonic acid buffer evolution fingerprint.

[0053] It should also be noted that the water body carbonate buffer evolution fingerprint is used to characterize the response intensity, recovery speed and channel linkage state of the same water mass under the action of acid pulse, and provides a basis for identifying the contribution of bicarbonate buffer and separating the additional buffering effect. It can reduce the interference of sensor drift and additional buffering effect on feature extraction and improve the accuracy and stability of bicarbonate prediction.

[0054] S2.5. Based on the evolution fingerprint of water body carbonic acid buffering, under the condition that the amount of acid added is kept constant, the water masses are arranged from low to high according to the bicarbonate training label. The part of buffering amplitude and recovery time that increases synchronously with the bicarbonate training label is determined as bicarbonate buffering contribution, and the part that does not change synchronously with the bicarbonate training label is determined as additional buffering influence, and a buffering attribution record is generated.

[0055] It should be noted that, based on the evolutionary fingerprint of water body carbonic acid buffering, water masses were grouped according to the amount of acid added. Water masses with the same allowable acid addition amount were grouped into the same equal-volume water mass group, and within each equal-volume water mass group, they were arranged from low to high according to the bicarbonate training label. When the bicarbonate training labels were the same, the average values ​​of the corresponding buffering amplitude and recovery time were calculated. A monotonically increasing benchmark for buffering amplitude and recovery time was established with the bicarbonate training label as a reference, and water masses with adjacent label differences not exceeding the allowable measurement error were grouped into the same label interval. The benchmark values ​​for buffering amplitude and recovery time were obtained according to the bicarbonate training label corresponding to each water mass, and the two benchmark values ​​constituted the bicarbonate buffering contribution. The difference between the actual buffering amplitude and the benchmark value for buffering amplitude, and the difference between the actual recovery time and the benchmark value for recovery time were calculated separately, and the two differences constituted the additional buffering effect. When the actual response is within the allowable deviation range, the additional buffer effect is recorded as zero; when the actual response exceeds the allowable deviation range, the corresponding difference is retained, and the bicarbonate buffer contribution, additional buffer effect, water mass attribution, and sampling time are recorded to generate a buffer attribution record.

[0056] S2.6. Exclude water masses marked as sensor drift in the buffer attribution record, determine the bicarbonate buffer contribution corresponding to the actual water quality change as the main buffer feature, and determine the additional buffer effect as the buffer correction feature. Then, arrange the main buffer feature and the buffer correction feature according to the water mass number and sampling time to generate the carbonate buffer feature sequence.

[0057] It should be noted that each water mass is checked against the change markers in the buffer attribution record, excluding those marked as sensor drift, and retaining the buffer amplitude baseline value, recovery time baseline value, buffer amplitude difference, and recovery time difference corresponding to the actual water quality change. The retained content is arranged from low to high according to the bicarbonate training label. The slope of the change in the buffer amplitude baseline value and recovery time baseline value relative to the bicarbonate training label within adjacent label intervals is calculated. The buffer amplitude baseline value, recovery time baseline value, and corresponding slope are used to form the main buffer feature, and the buffer amplitude difference and recovery time difference are used to form the buffer correction feature. The main buffer feature and buffer correction feature are normalized, and then a time-series index is formed using the water mass number and sampling time. The features are arranged according to the time-series index to generate a bicarbonate buffer feature sequence.

[0058] S3. Construct a dual-branch neural network based on the carbonate buffer feature sequence and initialize the dual-branch connection weights and gating fusion bias. Extract the temporal variation of water mass and the buffer response relationship from the carbonate buffer feature sequence. Perform gating fusion on the temporal variation of water mass and the buffer response relationship to obtain candidate bicarbonate prediction values. Verify the carbon content closure and charge closure of the candidate bicarbonate prediction values. Update the dual-branch connection weights and gating fusion bias according to the closure deviation to generate a bicarbonate prediction model.

[0059] S3.1 Arrange the main buffer features and buffer correction features according to the carbonate buffer feature sequence, divide the continuous training window, bind the continuous training window with the corresponding bicarbonate training label, and generate a dual-branch training sample set.

[0060] It should be noted that, based on the carbonate buffer feature sequence, the water mass number is used as the arrangement boundary. Within the same water mass, the main buffer feature and buffer correction feature are arranged according to the sampling time, and the main buffer feature and buffer correction feature corresponding to the same sampling time are bound to the same feature position. The window length is determined according to the number of samples that can cover the complete buffer response process. Starting from the first sampling time, continuous training windows are divided by sliding backward at one sampling interval, retaining continuous training windows with continuous sampling times that do not cross water mass numbers. The sampling time at the end of the continuous training window is used as the binding position, and bicarbonate training labels with the same sampling time are matched first. When the sampling times are inconsistent, the bicarbonate training label with the closest time distance and not exceeding one sampling interval is selected to complete the window label binding, and continuous training windows without matching labels are excluded. The samples are then arranged according to water mass number and sampling time to generate a dual-branch training sample set.

[0061] It should also be noted that the main buffer feature is used to characterize the buffer amplitude benchmark value, recovery time benchmark value, and their relationship with the bicarbonate training label corresponding to the bicarbonate buffer contribution. This provides the main basis for the buffer mapping branch to extract the stable correspondence between bicarbonate concentration and buffer response, thereby improving the accuracy of bicarbonate concentration change determination.

[0062] The buffer correction feature is used to characterize the deviation of the actual buffer amplitude and recovery time from the corresponding benchmark value. It provides a basis for identifying and correcting the additional buffer effects of the buffer mapping branch, reduces the bias of non-target buffer response on the candidate bicarbonate prediction value, and thus improves the stability of continuous prediction under complex water conditions.

[0063] S3.2. Based on the continuous training window in the dual-branch training sample set, set the gated loop structure and the corresponding temporal connection relationship to obtain the gated loop temporal branch.

[0064] It should be noted that, based on the continuous training window in the dual-branch training sample set, the main buffer features and buffer correction features at each feature position are arranged according to the sampling time, and the main buffer features and buffer correction features corresponding to the same sampling time are merged into the time-series input information.

[0065] The number of input nodes is determined based on the number of features contained in the time-series input information, and the number of iterations is determined based on the number of sampling times contained in the continuous training window. Reset control and update control are set between adjacent sampling times. The reset control is used to determine the retention ratio of the information from the previous sampling time in the current sampling time. The retained information from the previous sampling time is proportionally merged with the current time-series input information. Then, the update control is used to determine the fusion ratio of the proportionally merged content with the information from the previous sampling time, forming the time-series representation of the current sampling time. The time-series representation of the current sampling time is continued to be passed to the next sampling time, and the retention, proportional merging and fusion operations are repeated until the iteration of all sampling times in the continuous training window is completed. The time-series representation formed at the end of the continuous training window is determined as the branch output, and the gated cyclic time-series branch is obtained.

[0066] S3.3. Based on the main buffer features, buffer correction features, and bicarbonate training labels in the dual-branch training sample set, set the mapping relationship between the buffer features and the bicarbonate training labels to obtain the buffer mapping branch.

[0067] It should be noted that, based on the dual-branch training sample set, the main buffer feature, buffer correction feature, and bicarbonate training label corresponding to the same feature position are extracted according to the water mass number and continuous training window. The main buffer feature and buffer correction feature are merged into buffer input information, and the buffer input information is arranged from low to high according to the bicarbonate training label.

[0068] The buffer amplitude baseline, recovery time baseline, corresponding change slope, buffer amplitude difference, and recovery time difference in adjacent buffer input information are compared with the change direction and degree of the bicarbonate training label to determine the concentration response direction and concentration response amplitude corresponding to the main buffer feature and the deviation correction direction corresponding to the buffer correction feature, forming buffer response correspondence information. The number of input nodes is determined according to the number of features contained in the buffer input information. The concentration response direction and concentration response amplitude corresponding to the main buffer feature are set as the main transitive relationship, and the deviation correction direction corresponding to the buffer correction feature is set as the compensation transitive relationship. The connection positions between adjacent network layers are set in the order of first forming the main transitive relationship and then superimposing the compensation transitive relationship. The buffer input information is passed through each connection position in sequence for proportional transformation and nonlinear mapping, so that the stable response content formed by the main buffer feature determines the basic output, and the deviation content formed by the buffer correction feature increases or decreases the basic output. Then, the corrected output is transformed to the concentration range corresponding to the bicarbonate training label, and the mapping relationship between the main buffer feature, the buffer correction feature, and the bicarbonate training label is established to obtain the buffer mapping branch.

[0069] S3.4 Connect the gated cyclic timing branch with the buffer mapping branch, and set the gated fusion relationship at the output of the two branches to construct a dual-branch neural network.

[0070] It should be noted that the branch outputs of the gated cyclic timing branch and the buffer mapping branch are bound in the same position according to the water cluster number and the continuous training window, and the branch outputs of the two branches are adjusted to the same feature length to form branch output information.

[0071] The numerical ranges of the water mass temporal variation and buffer response relationship in the branch output information are scaled uniformly, and then the scaled uniform branch output information is connected to the gated fusion position. At the gated fusion position, the retention ratios of the gated cyclic temporal branch and the buffer mapping branch are calculated respectively, and the two retention ratios are normalized so that the sum of the two retention ratios equals one. The water mass temporal variation and buffer response relationship are retained according to the two retention ratios respectively, and then the retained water mass temporal variation and buffer response relationship are merged in the same position to form the gated fusion information. The gated fusion information is connected to the bicarbonate concentration output position so that the gated fusion information can be converted into the corresponding bicarbonate concentration, thereby completing the connection between the gated cyclic temporal branch, the buffer mapping branch, the gated fusion position and the bicarbonate concentration output position, and constructing a dual-branch neural network.

[0072] S3.5. Based on the dual-branch neural network, determine the connection positions between adjacent network layers in the gated cyclic temporal branch and the buffer mapping branch respectively. Determine the weight initialization range according to the number of input nodes and output nodes corresponding to each connection position. Configure the temporal connection weights and buffer connection weights within the weight initialization range respectively. Set the gated fusion bias according to the initial scale of the output features of the two branches to generate the initial dual-branch neural network.

[0073] It should be noted that, based on the dual-branch neural network, the connection positions between adjacent network layers are determined layer by layer along the feature propagation direction of the gated cyclic temporal branch and the buffer mapping branch. The number of input nodes of the preceding adjacent network layer and the number of output nodes of the following adjacent network layer are counted for each connection position. The sum of the number of input nodes and the number of output nodes is substituted into the preset square root relationship calculation range boundary, and the corresponding weight initialization range is determined from the negative range boundary to the positive range boundary. The connection position, the number of input nodes, the number of output nodes, and the weight initialization range are uniformly formed into a connection configuration record.

[0074] Based on the connection configuration records, temporal connection weights are configured for each connection position within the weight initialization range corresponding to the gated cyclic temporal branch, and buffer connection weights are configured for each connection position within the weight initialization range corresponding to the buffer mapping branch, ensuring that both temporal connection weights and buffer connection weights are evenly distributed in both positive and negative directions. Then, the numerical mean and fluctuation amplitude of the output features of the gated cyclic temporal branch and the buffer mapping branch are statistically analyzed. These numerical mean and fluctuation amplitudes are converted into the initial scale of the output features of the two branches. The gating fusion bias is determined based on the difference in the initial scale of the output features of the two branches, ensuring that the branch with the smaller initial scale obtains a higher retention ratio and the branch with the larger initial scale obtains a lower retention ratio. Finally, the temporal connection weights are written into the gated cyclic temporal branch, the buffer connection weights are written into the buffer mapping branch, and the gating fusion bias is written into the output of both branches, generating the initial dual-branch neural network.

[0075] S3.6 Perform time-series correlation on the carbonate buffer feature sequence to determine the direction and magnitude of change of each buffer feature with the sampling time, extract the time-series change of water mass, map and compare the main buffer feature, buffer correction feature with the corresponding bicarbonate training label to determine the buffer response direction and response degree, extract the buffer response relationship, and generate dual-branch response records.

[0076] It should be noted that, based on the carbonate buffer feature sequence, the main buffer feature and buffer correction feature corresponding to each water mass are divided according to the water mass number, and arranged continuously within the same water mass according to the sampling time. The difference between the main buffer feature and the buffer correction feature corresponding to adjacent sampling times is calculated item by item. The sign of the difference determines the direction of change of each buffer feature with the sampling time, and the absolute value of the difference determines the magnitude of change of each buffer feature with the sampling time. Then, the direction of change, magnitude of change, and number of continuous samplings corresponding to continuous changes in the same direction are sequentially associated to extract the temporal change of the water mass. The main buffer feature and buffer correction feature are associated with the corresponding bicarbonate training label according to the water mass number and sampling time. Co-location binding is performed, comparing the main buffer feature difference, buffer correction feature difference, and bicarbonate training label difference in adjacent bound content. When the feature difference is in the same direction as the bicarbonate training label difference, it is determined as a positive buffer response; when the feature difference is in the opposite direction, it is determined as a negative buffer response. The degree of buffer response is determined based on the change ratio of the bicarbonate training label difference relative to the corresponding feature difference. The buffer response relationship is extracted from the buffer response direction and the buffer response degree. Finally, co-location binding is performed between the water mass number and the buffer response relationship according to the water mass number and continuous training window to generate a dual-branch response record.

[0077] S3.7. Based on the response records of the two branches, determine the retention ratio of the water mass time series change and the buffer response relationship respectively. Perform water mass isotopic weighted fusion on the retained water mass time series change and buffer response relationship, and map the fused content to the corresponding bicarbonate concentration range to obtain the candidate predicted value of bicarbonate.

[0078] It should be noted that, based on the dual-branch response records, the retention degree of water mass temporal changes and buffer response relationships corresponding to water mass numbers and continuous training windows is determined according to the continuity of the direction of change, the stability of the amplitude of change, and the number of continuous samples in the water mass temporal changes. Similarly, the retention degree of the buffer response relationship is determined based on the consistency of the buffer response direction with the direction of change of the bicarbonate training label and the stability of the buffer response degree. These two retention degrees are then converted into a retention ratio that sums to one. The direction of change, amplitude of change, and number of continuous samples are scaled proportionally according to the retention ratio of the water mass temporal changes, and the buffer response direction and buffer response ratio are scaled proportionally according to the retention ratio of the buffer response relationship. The response level is scaled proportionally, and the scaled water mass temporal changes and buffer response relationships are merged item by item according to the water mass number and continuous training window to form fused content. The minimum and maximum values ​​of the bicarbonate training label in the dual-branch training sample set are used to limit the corresponding bicarbonate concentration range. The fused content is proportionally converted according to the position of the lowest and highest response levels in the dual-branch response records. The converted values ​​below the bicarbonate concentration range are adjusted to the minimum value, and the converted values ​​above the bicarbonate concentration range are adjusted to the maximum value. The converted values ​​within the bicarbonate concentration range are output according to the water mass number and the sampling time at the end of the continuous training window to obtain the candidate predicted values ​​of bicarbonate.

[0079] S3.8 Perform carbon closure verification between the candidate bicarbonate prediction values ​​and the corresponding bicarbonate training labels, and perform charge closure verification between the candidate bicarbonate prediction values ​​and the charge equivalents corresponding to the additional buffer effects and the acid equivalents corresponding to the acid pulse calibration records. Determine the carbon closure deviation and charge closure deviation, and generate a closure deviation record.

[0080] It should be noted that, according to the water mass number, continuous training window, and end sampling time, the candidate predicted values ​​of bicarbonate are co-located with the corresponding bicarbonate training labels. The candidate predicted values ​​and bicarbonate training labels are then converted into candidate carbon equivalents and label carbon equivalents according to a uniform water sample volume. The difference between the candidate carbon equivalent and the label carbon equivalent is determined as the carbon content closure deviation. The sign of the difference determines the direction of carbon content deviation, and the absolute value of the difference determines the magnitude of carbon content deviation. Following the same water mass number and continuous training window, the difference in buffer amplitude and recovery time in the additional buffer effect are converted into the charge equivalent corresponding to the additional buffer effect, and the bicarbonate content is then converted based on the candidate predicted values ​​of bicarbonate. The charge equivalent corresponding to the candidate predicted value is then combined with the charge equivalent corresponding to the additional buffer effect to form the predicted charge equivalent. The acid equivalent corresponding to the acid pulse calibration record is converted according to the standard acid concentration and acid addition volume in the acid pulse calibration record. The difference between the predicted charge equivalent and the acid equivalent corresponding to the acid pulse calibration record is determined as the charge closure deviation. The direction of charge deviation is determined by the sign of the difference, and the magnitude of charge deviation is determined by the absolute value of the difference. The carbon content closure deviation, charge closure deviation, carbon content deviation direction, charge deviation direction, corresponding water mass number, continuous training window, and end sampling time are bound together to generate a closure deviation record.

[0081] S3.9. Based on the closure deviation record, determine the weight adjustment direction and adjustment amount of the corresponding connection positions in the gated cyclic timing branch and the buffer mapping branch, and determine the gating fusion bias adjustment direction based on the proximity of the corresponding candidate outputs of the two branches to the bicarbonate training labels, and generate dual-branch parameter correction records.

[0082] It should be noted that, based on the closure deviation record, the corresponding connection positions in the gated cyclic timing branch and buffer mapping branch that participate in the formation of bicarbonate candidate prediction values ​​are located according to the water mass number, continuous training window, and end sampling time. The current weights of each corresponding connection position are then changed, and the bicarbonate candidate prediction values ​​are recalculated. The direction of the increase or decrease in the bicarbonate candidate prediction value determines the direction of influence of each corresponding connection position on the bicarbonate candidate prediction value. When both the carbon content closure deviation and the charge closure deviation are positive, the weights of the corresponding connection positions that increase the bicarbonate candidate prediction value are reduced, and the weights of the corresponding connection positions that decrease the bicarbonate candidate prediction value are increased. When both the carbon content closure deviation and the charge closure deviation are negative, the opposite adjustment is performed. When the directions of the carbon content closure deviation and the charge closure deviation are different... When adjusting, the direction that can simultaneously reduce the absolute values ​​of the two deviations is retained; the absolute values ​​of carbon closure deviation, charge closure deviation, and the changes in bicarbonate candidate prediction values ​​caused by the corresponding connection positions are proportionally converted to determine the weight adjustment amount for the corresponding connection positions; then, the absolute difference between the candidate outputs of the gated cyclic timing branches and the candidate outputs of the buffer mapping branches and the bicarbonate training labels are calculated respectively, and the gated fusion bias is adjusted towards the branch with the smaller absolute difference, and the adjustment range of the gated fusion bias is determined based on the difference between the two absolute differences; finally, the corresponding connection positions, weight adjustment directions, weight adjustment amounts, gated fusion bias adjustment directions, and gated fusion bias adjustment ranges are recorded according to the water mass number and the continuous training window to generate dual-branch parameter correction records.

[0083] S3.10. Based on the dual-branch parameter correction record, update the temporal connection weights, buffer connection weights, and gated fusion bias in the initial dual-branch neural network. Input the dual-branch training sample set into the updated dual-branch neural network for continuous deduction, re-form the candidate prediction value of bicarbonate, and carry out carbon closure and charge closure verification until the carbon closure deviation and charge closure deviation meet the corresponding detection range, and generate the bicarbonate prediction model.

[0084] It should be noted that, based on the dual-branch parameter correction record, according to the water mass number, continuous training window, and connection position, the weight adjustment direction and weight adjustment amount are applied to the temporal connection weights and buffer connection weights in the initial dual-branch neural network, respectively, and the gating fusion bias adjustment direction and gating fusion bias adjustment magnitude are applied to the gating fusion bias; the updated temporal connection weights, buffer connection weights, and gating fusion bias are checked for numerical range, and values ​​exceeding the corresponding configuration range are adjusted to the corresponding range boundary, forming the updated dual-branch neural network; according to the water mass number and sampling time, the dual-branch training sample set is input into the updated dual-branch neural network one by one, the continuous training window is input into the gating cyclic temporal branch to form the temporal change of the water mass, the main buffer feature and buffer correction feature are input into the buffer mapping branch to form the buffer response relationship, and then the retention ratio of the two branches is determined according to the updated gating fusion bias, and the retained... The temporal changes of water masses and the relationship with buffer response are fused isotopically and mapped to the corresponding bicarbonate concentration range to regenerate candidate bicarbonate prediction values. These regenerative candidate bicarbonate prediction values ​​are then compared with the bicarbonate training labels for carbon closure verification. Additionally, the candidate bicarbonate prediction values ​​and the charge equivalent corresponding to the additional buffer effect are compared with the acid equivalent corresponding to the acid pulse calibration record for charge closure verification, thus redetermining the carbon closure deviation and charge closure deviation. When the carbon closure deviation or charge closure deviation exceeds the corresponding detection range, the corresponding deviation direction and magnitude are rewritten into the closure deviation record. The temporal connection weights, buffer connection weights, and gated fusion bias are then updated based on the closure deviation record. When both the carbon closure deviation and charge closure deviation corresponding to the dual-branch training sample set are within the corresponding detection range, the temporal connection weights, buffer connection weights, and gated fusion bias are fixed to generate the bicarbonate prediction model.

[0085] like Figure 5 As shown, the comparison chart of the additional buffering influence intensity and the mean absolute error is used to verify the suppressive effect of the water body carbonic acid buffering evolution fingerprint, carbonic acid buffering feature sequence, and closure deviation update on complex water body interference. The horizontal axis represents the additional buffering influence intensity, and the vertical axis represents the mean absolute error. The curves correspond to the method of this invention, the method without separating the additional buffering influence, and the method without closure constraints, respectively. As the additional buffering influence intensity increases, the mean absolute error of the method without separating the additional buffering influence and the method without closure constraints rises rapidly, while the mean absolute error of the method of this invention maintains a lower growth trend. This indicates that this invention, by identifying the bicarbonate buffering contribution through the water body carbonic acid buffering evolution fingerprint and converting the additional buffering influence into buffer correction features, can reduce the interference of non-target buffer responses on bicarbonate candidate prediction values. Simultaneously, the carbon content closure and charge closure verification further constrain prediction deviations, enabling the dual-branch neural network to maintain high prediction accuracy under complex buffering conditions.

[0086] The method of this invention separates the bicarbonate buffer contribution and the additional buffering effect in the carbonation buffer evolution fingerprint of water bodies. It converts the bicarbonate buffer contribution into a main buffer feature and the additional buffering effect into a buffer correction feature, then uses a dual-branch neural network and gated fusion to generate the prediction curve. The figure shows that the mean absolute error of the method increases slowly with the increase of the intensity of the additional buffering effect, indicating that this invention can weaken the biasing effect of the additional buffering effect on the candidate bicarbonate prediction value, demonstrating higher prediction accuracy under complex water body conditions.

[0087] The comparison curve for the method that does not separate the additional buffering effect corresponds to the method that does not distinguish between the bicarbonate buffer contribution and the additional buffering effect, but directly uses the overall buffer response as the basis for prediction. In the figure, the mean absolute error of the method that does not separate the additional buffering effect increases rapidly with the increase of the intensity of the additional buffering effect, indicating that the additional buffering effect is incorrectly absorbed into the prediction feature, causing the non-target buffer response to continuously interfere with the bicarbonate concentration prediction, resulting in a continuous increase in prediction bias.

[0088] The method without closure constraints, while using buffer-related features for prediction, does not update the dual-branch connection weights and gating fusion biases through carbon closure and charge closure deviations. The figure shows that the mean absolute error of the method without closure constraints is higher than that of the method in this invention, and it increases significantly with the increase of the added buffer influence strength. This indicates that without closure deviation constraints, the predicted values ​​are difficult to promptly align with the bicarbonate training label and closure relationship, demonstrating the role of the closure verification and parameter update in reducing prediction errors in this invention.

[0089] S4. Based on the bicarbonate prediction model, the real-time water mass changes are combined with the most recent buffer fingerprint to predict the current concentration and subsequent changes, and the carbonic form and charge closure verification is performed to generate a charge balance prediction sequence.

[0090] S4.1. Based on the sampling interval corresponding to the bicarbonate prediction model, continuously collect and monitor water quality data, and process newly added sampling content according to the judgment rules. Arrange the real water quality changes according to the water mass number and sampling time to generate a real-time water mass change record.

[0091] It should be noted that water quality data were continuously collected and monitored according to the sampling interval corresponding to the bicarbonate prediction model, and the pH and conductivity sampling values ​​were arranged according to the sampling time.

[0092] When the time distance between adjacent sampling times equals the sampling interval, they are arranged continuously. When the time distance exceeds the sampling interval, the continuous sampling segments are re-divided. New sampling content is screened based on the rules for determining sensor drift and actual water quality changes. When the pH sampling value changes in the same direction for three consecutive sampling times and the conductivity sampling value does not show a corresponding change, the corresponding new sampling content is marked as sensor drift and excluded. When the pH sampling value and the conductivity sampling value show corresponding changes for three consecutive sampling times, the corresponding new sampling content is marked as actual water quality change and retained. A water mass number is assigned to the first occurrence of an actual water quality change. New sampling content belonging to the same continuous change process is grouped into the same water mass number. After the continuous change process ends, water mass numbers are reassigned to subsequent actual water quality changes. The retained new sampling content is then arranged according to the water mass number and sampling time to generate a real-time water mass change record.

[0093] S4.2. Based on the real-time water mass change records, select the effective water mass carbonation buffer evolution fingerprints from the water body carbonation buffer evolution fingerprints that have the same monitoring point and the formation time is closest to the current sampling time. Determine the effective water body carbonation buffer evolution fingerprints as the most recent buffer fingerprints, and perform time-series proximity matching between the most recent buffer fingerprints and the real-time water mass change records to generate water mass fingerprint matching records.

[0094] It should be noted that the current sampling time is determined one by one based on real-time water mass change records, and the monitoring point and the current sampling time form a filtering index. According to the filtering index, water body carbonation buffer evolution fingerprints with the same monitoring point, formation time no later than the current sampling time, and time distance within the continuous training window duration are retained from the water body carbonation buffer evolution fingerprint. Then, the completeness of water mass isotopic binding is checked, and water body carbonation buffer evolution fingerprints with complete isotopic binding are determined as valid water body carbonation buffer evolution fingerprints. When no valid water body carbonation buffer evolution fingerprint is found, the corresponding real-time water mass change is marked as pending matching, and the next sampling time is processed. When a valid water body carbonation buffer evolution fingerprint is found, it is directly determined as the most recent one. Buffer fingerprinting involves calculating the time distance between the formation time and the current sampling time for each valid water body carbonation buffer evolution fingerprint when multiple valid water body carbonation buffer evolution fingerprints are selected. The valid water body carbonation buffer evolution fingerprint with the smallest time distance is identified as the most recent buffer fingerprint. Using the current sampling time as the matching position, the most recent buffer fingerprint is bound to the corresponding water mass number in the real-time water mass change record. Adjacent sampling times are checked forward and backward according to the sampling interval. When adjacent sampling times belong to the same continuous change process, the most recent buffer fingerprint is used. When adjacent sampling times enter a new continuous change process, the most recent buffer fingerprint is re-selected. The content of the completed temporal proximity matching and the state to be matched are arranged according to the water mass number and sampling time to generate a water mass fingerprint matching record.

[0095] The expression for calculating the time distance between the formation time and the current sampling time is: ; in, This represents the time distance between the current sampling time and the most recent buffered fingerprint formation time. This is the current sampling sequence number; This is the fingerprint sequence number for the evolution of carbonic buffering in water bodies; A set of effective water body carbonic buffer evolution fingerprints with the same monitoring points and complete isotopic binding of water masses; This is the current sampling time; The formation time of the fingerprint of water body carbonation buffer evolution; This is the duration of the continuous training window.

[0096] The current sampling time is located based on the current sampling sequence number. Then, the set of valid water body carbonation buffer evolution fingerprints is traversed according to the water body carbonation buffer evolution fingerprint sequence number. The current sampling time is subtracted from the formation time of each water body carbonation buffer evolution fingerprint. The continuous training window duration is used as the upper limit of the time range to exclude water body carbonation buffer evolution fingerprints with a time difference less than zero or exceeding the continuous training window duration. Then, the minimum value is selected from the retained time differences as the time distance. The water body carbonation buffer evolution fingerprint sequence number corresponding to the minimum value is used to determine the nearest buffer fingerprint.

[0097] S4.3 Based on water mass fingerprint matching records, real-time water mass changes and the most recent buffer fingerprint are respectively input into the gated cyclic time-series branch and the buffer mapping branch corresponding to the bicarbonate prediction model for joint inference. According to the gated fusion relationship fixed in the bicarbonate prediction model, the gated cyclic time-series branch and the buffer mapping branch are gated and fused to generate a concentration prediction sequence.

[0098] It should be noted that, based on water mass fingerprint matching records, real-time water mass changes and the most recent buffer fingerprints are collected according to water mass numbers and arranged according to sampling times to divide continuous inference windows. The continuous inference window is input into a gated cyclic temporal branch, and temporal inference output is extracted according to the fixed dual-branch connection weights of the bicarbonate prediction model. The corresponding most recent buffer fingerprint is input into a buffer mapping branch, and buffer inference output is extracted according to the fixed mapping relationship. The outputs of the two branches are bound according to water mass number and sampling time, and the retention ratio is determined according to the gating fusion relationship. The retained content is merged and converted into bicarbonate concentration prediction values. The continuous inference window slides backward with a sampling time as the moving interval, and the sampling time at the end of the window is determined as the prediction time. Then, it is arranged according to water mass number and prediction time to generate a concentration prediction sequence.

[0099] S4.4 Based on the concentration prediction sequence, reconstruct the relationship between the current bicarbonate prediction concentration and the carbonic acid form from the pH and temperature data in the monitored water quality data. Compare the reconstructed carbon and charge with the fingerprint carbon equivalent corresponding to the most recent buffer fingerprint, and perform a closure verification with the fingerprint charge equivalent. Record the carbonic acid form deviation and charge deviation, and generate a closure verification record.

[0100] It should be noted that, based on the water mass number and prediction time in the concentration prediction sequence, the pH and temperature corresponding to the same water mass are matched in the monitored water quality data. The carbonic acid form conversion relationship is corrected according to the temperature. Then, the distribution ratio of each carbonic acid form is determined according to the pH. The current bicarbonate prediction concentration is used as the reconstruction benchmark to reverse the carbonic acid form composition at the same time and form the carbonic acid form relationship.

[0101] The carbon content in the carbon dioxide morphology relationship is summarized according to the unified conversion volume, and the charge is converted according to the charge state of different carbon dioxide morphologies to form reconstructed carbon content and reconstructed charge content. The fingerprint carbon equivalent and fingerprint charge equivalent are matched in the most recent buffer fingerprint according to the water mass number. The difference between the reconstructed carbon content and the fingerprint carbon equivalent is determined as the carbon dioxide morphology deviation, and the difference between the reconstructed charge content and the fingerprint charge equivalent is determined as the charge deviation. When the carbon dioxide morphology deviation is within the corresponding detection range, it is marked as carbon dioxide morphology closure. When the carbon dioxide morphology deviation exceeds the corresponding detection range, the deviation direction and deviation magnitude are recorded. When the charge deviation is within the corresponding detection range, it is marked as charge closure. When the charge deviation exceeds the corresponding detection range, the deviation direction and deviation magnitude are recorded. The carbon dioxide morphology deviation, charge deviation, and corresponding closure state are written according to the water mass number and the predicted time to generate a closure verification record.

[0102] It should also be noted that the fingerprint carbon equivalent is derived from the bicarbonate training label corresponding to the same water mass, and combined with the uniform water sample volume, pH, temperature, and carbon dioxide speciation distribution, bicarbonate, carbonate, and dissolved carbon dioxide are converted into a uniform carbon content. The fingerprint carbon equivalent is used as a reference benchmark for carbon content closure verification, enabling the predicted inorganic carbon content to be compared with the actual carbon content in the water body's carbon dioxide buffer evolution fingerprint, thereby limiting the carbon content deviation of the predicted bicarbonate concentration.

[0103] The fingerprint charge equivalent is derived from the standard acid concentration, acid addition volume, and corresponding buffer response in the acid pulse calibration record. It is then converted into a unified charge equivalent by combining the bicarbonate buffer contribution and the additional buffer effect. The fingerprint charge equivalent serves as a reference standard for charge closure verification, enabling the predicted bicarbonate equivalent, predicted carbonate equivalent, and additional buffer equivalent to correspond to the charge consumed by the acid pulse. This reduces the impact of additional buffering and the transmission of ion response deviations to the prediction process.

[0104] S4.5 Based on the closed verification record, retain the bicarbonate predicted concentrations that have completed carbonic acid form closure and charge closure. For bicarbonate predicted concentrations with correctable deviations, perform double closure collaborative correction in the direction of reducing carbonic acid form deviation and charge deviation. Mark the bicarbonate predicted concentrations that lack effective closure relationships as concentrations to be verified. Then arrange the current closure prediction information according to the prediction time to generate a charge balance prediction sequence.

[0105] It should be noted that, based on the closed verification record, the bicarbonate concentration is predicted according to the water mass number and the predicted time, and the fingerprint carbon equivalent and fingerprint charge equivalent are used as the basis for closure.

[0106] When both the carbonic acid form deviation and charge deviation are within their respective detection ranges, the predicted bicarbonate concentration and corresponding closure state are retained. When at least one deviation exceeds the corresponding detection range and the closure basis is complete, equal fine adjustments are applied in both the increasing and decreasing directions of the predicted bicarbonate concentration. The carbonic acid form relationship is reconstructed, and the two deviations are calculated. An adjustment direction that can simultaneously reduce the absolute values ​​of both the carbonic acid form deviation and the charge deviation is selected to perform a double-closure synergistic correction on the predicted bicarbonate concentration. After each correction, the closure verification is re-executed. When both deviations decrease simultaneously, the current correction is retained and adjustments continue. When one deviation increases, the correction magnitude is reduced and readjustment is performed until both deviations are within their respective detection ranges. When the closure basis is incomplete or neither the increasing nor decreasing direction can simultaneously reduce the two deviations, the predicted bicarbonate concentration is marked as a concentration to be verified. The retained predicted bicarbonate concentration, the predicted bicarbonate concentration after the double-closure synergistic correction, and the concentration to be verified are all written into the current closure prediction information, and the current closure prediction information is arranged according to the prediction time to generate a charge balance prediction sequence.

[0107] It should also be noted that the fingerprint carbon equivalent is used to characterize the actual carbon content of the same water mass under a uniform water sample volume, and serves as a reference for the verification of carbonic acid speciation closure. This allows the carbon content reconstructed from the predicted bicarbonate concentration to be compared with the carbon content benchmark in the carbonic buffer evolution fingerprint of the water body, thereby promptly identifying deviations in the predicted carbon content, limiting abnormal predicted values ​​from entering subsequent processes, and improving the accuracy and reliability of bicarbonate prediction.

[0108] S5. Anchor and compare the buffer response in the charge balance prediction sequence with the synchronous water sample tag to obtain the corrected monitoring bias and the terminal parameters of the dual-branch neural network. Based on the sensor drift and the actual water quality changes, correct the monitoring bias and the terminal parameters of the dual-branch neural network respectively to generate the bicarbonate prediction record.

[0109] S5.1. Based on the prediction time recorded in the charge balance prediction sequence, perform acid pulse calibration on the bypass water sample of the corresponding water mass and collect synchronous water samples. Determine the buffer amplitude and recovery time formed by the acid pulse calibration as the new buffer response, determine the bicarbonate concentration measured by the synchronous water sample as the synchronous water sample label, and compare the new buffer response and synchronous water sample label with the closure prediction information and the most recent buffer fingerprint to generate an anchoring comparison record.

[0110] It should be noted that, based on the prediction time recorded in the charge balance prediction sequence, the bypass sampling range of the corresponding water mass is locked according to the water mass number. Bypass water samples are collected at the sampling positions corresponding to the prediction time. After the acid-base state of the bypass water samples stabilizes, acid pulse calibration is performed according to the acid addition amount and sampling interval used in the water mass response sample set. Acid-base changes are continuously collected until stability is restored. The difference between the stable acid-base state and the lowest acid-base state is calculated, and the time required to recover to the stable acid-base state is determined. The buffer amplitude and recovery time are determined as the new buffer response. Synchronous water samples of the same water mass are collected before adding acid, and carbon is measured according to the measurement method used in the bicarbonate training label. The concentration of bicarbonate is determined and identified as the synchronous water sample label. Based on the water mass number and prediction time, the newly added buffer response is compared item by item with the buffer response in the most recent buffer fingerprint, recording the direction and magnitude of the buffer change. Then, the synchronous water sample label is compared with the predicted bicarbonate concentration in the closed prediction information, recording the direction and magnitude of the concentration deviation. When the direction of buffer change is consistent with the direction of concentration deviation, it is marked as synchronous anchoring; when the direction of buffer change is inconsistent with the direction of concentration deviation, it is marked as deviation anchoring. The newly added buffer response, synchronous water sample label, and corresponding anchoring status are written according to the water mass number and prediction time to generate an anchoring comparison record.

[0111] S5.2 Based on the channel change characteristics of pH and conductivity in the anchored comparison record and the relationship between the change of the newly added buffer response and the synchronous water sample label, the sensor drift and the actual water quality change are distinguished. The pH monitoring bias corresponding to the sensor drift is corrected, and the terminal output connection weight and output bias of the dual-branch neural network corresponding to the actual water quality change are corrected. The corrected content is written into the bicarbonate prediction model to generate a self-calibrating bicarbonate prediction model.

[0112] It should be noted that, based on the anchoring comparison record, the channel change characteristics of pH and conductivity corresponding to the water mass number and the predicted time are checked, and the relationship between the changes of the newly added buffer response and the synchronous water sample label is verified. When the pH changes continuously and the conductivity does not change accordingly, and the newly added buffer response and the synchronous water sample label do not change synchronously, the corresponding water mass is determined to be sensor drift.

[0113] When pH and conductivity change in a corresponding manner, and the newly added buffer response and synchronous water sample label change synchronously, the corresponding water mass is identified as a true water quality change. For the monitored water quality data corresponding to sensor drift, the pH at the predicted time is compared with the stable pH before acid pulse calibration. The difference between the two is calculated to determine the pH monitoring bias. Then, the pH monitoring bias is subtracted from the pH sampling value of the corresponding water mass to form the monitoring bias correction content. The connection weights and output bias of the dual-branch neural network are summarized as terminal parameters. The predicted bicarbonate concentration corresponding to the true water quality change is compared with the synchronous water sample label. When the predicted bicarbonate concentration is higher than the synchronous water sample label, the terminal parameters are adjusted in the direction of decreasing the output value. When the predicted bicarbonate concentration is lower than the synchronous water sample label, the terminal parameters are adjusted in the direction of increasing the output value until the deviation between the two is within the corresponding detection range, forming the terminal parameter correction content. The monitoring bias correction content is written into the input correction position of the bicarbonate prediction model, and the terminal parameter correction content is written into the terminal of the dual-branch neural network to generate a self-calibrating bicarbonate prediction model.

[0114] S5.3. Based on the self-calibrating bicarbonate prediction model, the real-time water mass change after monitoring bias correction is input into the gated cyclic timing branch, and the newly added buffer response is input into the buffer mapping branch. The outputs of the two branches are gated and fused, and the carbonic acid morphology closure and charge closure verification are performed to generate bicarbonate prediction records.

[0115] It should be noted that, based on the self-calibrating bicarbonate prediction model, the real-time changes of water masses after bias correction are monitored and arranged according to water mass number and sampling time. A continuous inference window input gated cyclic time-series branch is defined, and the time-series inference output is extracted. The newly added buffer response corresponding to the same water mass is input into the buffer mapping branch, and the buffer inference output is extracted. The outputs of the two branches are bound according to the water mass number, and the retention ratio is determined based on the fixed gating fusion relationship. The retained content is merged and converted into bicarbonate prediction concentration through the corrected terminal parameters. The carbonic acid speciation relationship is reconstructed based on the pH and temperature corresponding to the prediction time, and the reconstructed carbon amount and reconstructed charge amount are respectively closed-loop verified against the fingerprint carbon equivalent and fingerprint charge equivalent. The bicarbonate prediction concentrations where both deviations are within the corresponding detection range are retained, and the bicarbonate prediction concentrations exceeding the detection range are marked as concentrations to be verified. Then, bicarbonate prediction records are generated by arranging them according to water mass number and prediction time.

[0116] This embodiment also provides a computer device applicable to the method for predicting bicarbonate in geothermal reservoir water based on neural networks, comprising: a memory and a processor; the memory is used to store computer-executable instructions, and the processor is used to execute the computer-executable instructions to implement the method for predicting bicarbonate in water based on neural networks as proposed in the above embodiment.

[0117] The computer device can be a terminal, comprising a processor, memory, communication interface, display screen, and input devices connected via a system bus. The processor provides computing and control capabilities. The memory includes non-volatile storage media and internal memory. The non-volatile storage media stores the operating system and computer programs. The internal memory provides an environment for the operation of the operating system and computer programs stored in the non-volatile storage media. The communication interface is used for wired or wireless communication with external terminals; wireless communication can be achieved through Wi-Fi, carrier networks, NFC (Near Field Communication), or other technologies. The display screen can be an LCD screen or an e-ink screen. The input devices can be a touch layer covering the display screen, buttons, a trackball, or a touchpad on the computer device's casing, or an external keyboard, touchpad, or mouse.

[0118] This embodiment also provides a storage medium storing a computer program that, when executed by a processor, implements the neural network-based method for predicting bicarbonate levels in water as proposed in the above embodiments. The storage medium can be implemented by any type of volatile or non-volatile storage device or a combination thereof, such as Static Random Access Memory (SRAM), Electrically Erasable Programmable Read-Only Memory (EEPROM), Erasable Programmable Read Only Memory (EPROM), Programmable Read-Only Memory (PROM), Read-Only Memory (ROM), magnetic storage, flash memory, magnetic disk, or optical disk.

[0119] In summary, this invention constructs a dual-branch neural network based on the carbonate buffer feature sequence, extracts the temporal changes of water masses and the buffer response relationship, and uses gated fusion to form candidate predicted values ​​of bicarbonate. Then, it updates the dual-branch connection weights and gated fusion bias with carbon content closure and charge closure deviations to complete the collaborative representation of dynamic change information and closure constraints. This enables the intelligent sensing system to suppress the transmission of sensing drift and additional buffer effects in the prediction link, and is used for continuous determination and trend prediction of bicarbonate concentration in complex water bodies, improving the stability and accuracy of bicarbonate prediction.

[0120] It should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention and are not intended to limit it. Although the present invention has been described in detail with reference to preferred embodiments, those skilled in the art should understand that modifications or equivalent substitutions can be made to the technical solutions of the present invention without departing from the spirit and scope of the technical solutions of the present invention, and all such modifications or substitutions should be covered within the scope of the claims of the present invention.

Claims

1. A method for predicting bicarbonate levels in geothermal reservoir water based on neural networks, characterized in that, include: Collect and monitor water quality data, perform acid pulse calibration on bypass water samples in the monitoring water quality data and bind bicarbonate training labels to generate a water mass response sample set; Based on the water mass response sample set, the monitored water quality data is time-aligned to obtain channel change characteristics. Based on the channel change characteristics, sensor drift and actual water quality changes are distinguished to obtain the water mass calibration sequence. The water body carbonate buffer evolution fingerprint is extracted from the water mass calibration sequence. Based on the water body carbonate buffer evolution fingerprint, the bicarbonate buffer contribution is identified and the additional buffer effect is separated to generate the carbonate buffer feature sequence. A dual-branch neural network is constructed based on the carbonate buffer feature sequence, and the dual-branch connection weights and gating fusion bias are initialized. The temporal variation of water mass and the buffer response relationship are extracted from the carbonate buffer feature sequence. The temporal variation of water mass and the buffer response relationship are gating fusion to obtain bicarbonate candidate prediction values. The carbon content closure and charge closure are verified on the bicarbonate candidate prediction values. The dual-branch connection weights and gating fusion bias are updated according to the closure deviation to generate a bicarbonate prediction model. Based on the bicarbonate prediction model, the real-time water mass changes are combined with the most recent buffer fingerprint to predict the current concentration and subsequent changes, and the carbonic form and charge closure verification are performed to generate a charge balance prediction sequence. Anchoring comparisons were made between the buffer response in the charge balance prediction sequence and the synchronous water sample tag to obtain the corrected monitoring bias and the terminal parameters of the dual-branch neural network. Based on the sensor drift and the actual water quality changes, the monitoring bias and the terminal parameters of the dual-branch neural network were corrected respectively to generate bicarbonate prediction records.

2. The method for predicting bicarbonate in water based on neural networks as described in claim 1, characterized in that, The process of collecting and monitoring water quality data, calibrating bypass water samples from the monitoring water quality data with acid pulses, and binding bicarbonate training labels to generate a water mass response sample set is as follows: After the acid-base state of the bypass water sample reaches stability, a quantitative acid solution is added. The acid-base changes after the addition of acid solution are continuously collected until stability is restored. The acid-base changes with continuous response and complete recovery process are correlated with the water quality monitoring data to generate acid pulse calibration records. Based on the acid pulse calibration record, synchronous water samples corresponding to the same water mass are collected. The bicarbonate concentration obtained from the synchronous water sample measurement is determined as the bicarbonate training label. The bicarbonate training label is then bound to the acid pulse calibration record and the water quality monitoring data according to the water mass affiliation and sampling time to generate a water mass response sample set.

3. The method for predicting bicarbonate in water based on neural networks as described in claim 2, characterized in that, The water mass response sample set is used to align the monitored water quality data in time, obtain channel change characteristics, and distinguish between sensor drift and actual water quality changes based on these characteristics to obtain the water mass calibration sequence. The specific steps are as follows: The pH and conductivity samples in the water mass response sample set are arranged according to the sampling time. Within the same water mass, the sampling time when the conductivity begins to change continuously is used as the alignment reference. The pH samples are moved to the sampling position with the highest degree of overlap with the conductivity change process to generate a water mass alignment sequence. Based on the water mass alignment sequence, the acidity and conductivity sampling values ​​at adjacent sampling times are compared respectively, and the channel change characteristics at which the two sampling values ​​begin to change are recorded. Based on the channel change characteristics, water masses whose pH values ​​change in the same direction for three consecutive sampling times but whose conductivity values ​​do not show a corresponding change are marked as sensor drift. Water masses whose pH and conductivity values ​​show a corresponding change for three consecutive sampling times are marked as true water quality changes. The change marks are written into the water mass alignment sequence to generate a water mass calibration sequence.

4. The method for predicting bicarbonate in water based on neural networks as described in claim 3, characterized in that, The process involves extracting the water body carbonate buffer evolution fingerprint from the water mass calibration sequence, identifying the bicarbonate buffer contribution based on the water body carbonate buffer evolution fingerprint, separating the additional buffering effect, and generating a carbonate buffer feature sequence. The specific steps are as follows: Based on the water mass calibration sequence, the stable pH before acid addition, the minimum pH after acid addition, and the time required to recover to the stable pH are determined from the acid pulse calibration record. The difference between the stable pH and the minimum pH is determined as the buffer amplitude. The buffer amplitude, channel change characteristics, and bicarbonate training labels corresponding to the same water mass are bound to the water mass isotope to generate a water body carbonic acid buffer evolution fingerprint. Based on the evolution fingerprint of water body carbonic acid buffering, under the condition of keeping the amount of acid added constant, each water mass is arranged from low to high according to the bicarbonate training label. The part of buffering amplitude and recovery time that increases synchronously with the bicarbonate training label is identified as bicarbonate buffering contribution, and the part that does not change synchronously with the bicarbonate training label is identified as additional buffering influence, and a buffering attribution record is generated. Excluding water masses marked as sensor drift in the buffer attribution record, the bicarbonate buffer contribution corresponding to the actual water quality change is determined as the main buffer feature, and the additional buffer effect is determined as the buffer correction feature. Then, the main buffer feature and the buffer correction feature are arranged according to the water mass number and sampling time to generate the bicarbonate buffer feature sequence.

5. The method for predicting bicarbonate in water based on neural networks as described in claim 1 or 4, characterized in that, The process involves constructing a dual-branch neural network based on the carbonate buffer feature sequence, initializing the dual-branch connection weights and gating fusion bias, extracting the temporal variation of water masses and the buffer response relationship from the carbonate buffer feature sequence, and then gating and fusing the temporal variation of water masses and the buffer response relationship to obtain candidate predicted values ​​for bicarbonate ions. The specific steps are as follows: The main buffer features and buffer correction features are arranged according to the carbonate buffer feature sequence, and continuous training windows are divided. The continuous training windows are bound to the corresponding bicarbonate training labels to generate a dual-branch training sample set. Based on the continuous training window in the dual-branch training sample set, a gated loop structure and corresponding temporal connection relationship are set to obtain the gated loop temporal branch; Based on the main buffer features, buffer correction features, and bicarbonate training labels in the dual-branch training sample set, a mapping relationship between the buffer features and the bicarbonate training labels is set to obtain the buffer mapping branch. Connect the gated cyclic timing branch with the buffer mapping branch, and set the gated fusion relationship at the output of the two branches to construct a dual-branch neural network; Based on the dual-branch neural network, the connection positions between adjacent network layers in the gated recurrent temporal branch and the buffer mapping branch are determined respectively. The weight initialization range is determined according to the number of input nodes and output nodes corresponding to each connection position. Within the weight initialization range, the temporal connection weights and buffer connection weights are configured respectively. The gated fusion bias is set according to the initial scale of the output features of the two branches to generate the initial dual-branch neural network. Temporal correlation was performed on the carbonate buffer feature sequence to determine the direction and magnitude of change of each buffer feature with the sampling time, and the temporal change of water mass was extracted. The main buffer feature, buffer correction feature and corresponding bicarbonate training label were mapped and compared to determine the buffer response direction and response degree, the buffer response relationship was extracted, and a dual-branch response record was generated. Based on the response records of the two branches, the retention ratio of the water mass temporal change and the buffer response relationship is determined. The retained water mass temporal change and buffer response relationship are then fused by isotopic weighting, and the fused content is mapped to the corresponding bicarbonate concentration range to obtain the candidate predicted value of bicarbonate.

6. The method for predicting bicarbonate in water based on neural networks as described in claim 5, characterized in that, The process involves verifying the carbon content closure and charge closure of the candidate bicarbonate prediction values, updating the dual-branch connection weights and gated fusion bias based on the closure deviation, and generating a bicarbonate prediction model. The specific steps are as follows: The candidate bicarbonate prediction values ​​are compared with the corresponding bicarbonate training labels to perform carbon closure verification, and the candidate bicarbonate prediction values ​​and the charge equivalents corresponding to the additional buffer effects are compared with the acid equivalents corresponding to the acid pulse calibration records to perform charge closure verification, thereby determining the carbon closure deviation and charge closure deviation, and generating a closure deviation record. Based on the closure deviation record, determine the weight adjustment direction and adjustment amount of the corresponding connection positions in the gated cyclic timing branch and the buffer mapping branch, and determine the gating fusion bias adjustment direction based on the proximity of the corresponding candidate outputs of the two branches to the bicarbonate training labels, and generate dual-branch parameter correction records. Based on the dual-branch parameter correction record, the temporal connection weights, buffer connection weights, and gated fusion bias in the initial dual-branch neural network are updated. The dual-branch training sample set is input into the updated dual-branch neural network for continuous deduction, and bicarbonate candidate prediction values ​​are re-formed. Carbon content closure and charge closure verification are carried out until the carbon content closure deviation and charge closure deviation meet the corresponding detection range, thus generating a bicarbonate prediction model.

7. The method for predicting bicarbonate in water based on neural networks as described in claim 6, characterized in that, The bicarbonate-based prediction model combines real-time water mass changes with the most recent buffer fingerprint to predict the current concentration and subsequent changes, and performs a carbonic speciation and charge closure check to generate a charge balance prediction sequence. The specific steps are as follows: Based on the sampling interval corresponding to the bicarbonate prediction model, water quality data is continuously collected and monitored, and new sampling content is processed by judgment rules. The real water quality changes are arranged according to the water mass number and sampling time to generate a real-time water mass change record. Based on real-time water mass change records, effective water mass carbonation buffer evolution fingerprints with the same monitoring point and the formation time closest to the current sampling time are selected from the water body carbonation buffer evolution fingerprints. The effective water body carbonation buffer evolution fingerprints are identified as the most recent buffer fingerprints, and the most recent buffer fingerprints are matched with the real-time water mass change records in a time-series proximity to generate water mass fingerprint matching records. Based on water mass fingerprint matching records, real-time water mass changes and the most recent buffer fingerprint are respectively input into the gated cyclic time-series branch and the buffer mapping branch corresponding to the bicarbonate prediction model for joint inference. According to the gated fusion relationship fixed in the bicarbonate prediction model, the gated cyclic time-series branch and the buffer mapping branch are gated and fused to generate a concentration prediction sequence. Based on the concentration prediction sequence, the acidity and temperature in the monitored water quality data are used to reconstruct the carbonic acid speciation relationship corresponding to the current predicted bicarbonate concentration. The reconstructed carbon and charge are compared with the fingerprint carbon equivalent corresponding to the most recent buffer fingerprint, and a closure verification is performed with the fingerprint charge equivalent. Carbonic acid speciation deviation and charge deviation are recorded to generate a closure verification record. Based on the closed verification record, the predicted concentrations of bicarbonate that have completed carbonic acid form closure and charge closure are retained. For the predicted concentrations of bicarbonate with correctable deviations, double closure is performed in a coordinated manner to reduce the deviations of carbonic acid form and charge. The predicted concentrations of bicarbonate that lack effective closure relationships are marked as concentrations to be verified. Then, the current closed prediction information is arranged according to the prediction time to generate a charge balance prediction sequence.

8. The method for predicting bicarbonate in water based on neural networks as described in claim 7, characterized in that, The process involves correlating and verifying the buffer response and synchronous water sample tags in the charge balance prediction sequence, obtaining corrected monitoring bias and dual-branch neural network terminal parameters, and correcting the monitoring bias and dual-branch neural network terminal parameters based on sensor drift and actual water quality changes to generate bicarbonate prediction records. The specific steps are as follows: Based on the prediction time recorded in the charge balance prediction sequence, acid pulse calibration is performed on the bypass water sample of the corresponding water mass and synchronous water sample is collected. The buffer amplitude and recovery time formed by the acid pulse calibration are determined as the new buffer response, and the bicarbonate concentration measured by the synchronous water sample is determined as the synchronous water sample label. The new buffer response and synchronous water sample label are anchored and compared with the closure prediction information and the most recent buffer fingerprint to generate an anchoring comparison record. Based on the channel change characteristics of pH and conductivity in the anchor comparison record and the relationship between the change of the newly added buffer response and the synchronous water sample label, the sensor drift and the actual water quality change are distinguished. The pH monitoring bias corresponding to the sensor drift is corrected, and the terminal output connection weight and output bias of the dual-branch neural network corresponding to the actual water quality change are corrected. The corrected content is written into the bicarbonate prediction model to generate a self-calibrating bicarbonate prediction model. Based on the self-calibrating bicarbonate prediction model, the real-time water mass change after monitoring bias correction is input into the gated cyclic timing branch, and the newly added buffer response is input into the buffer mapping branch. The outputs of the two branches are gated and fused, and the carbonic acid morphology closure and charge closure verification are performed to generate bicarbonate prediction records.

9. A computer device comprising a memory and a processor, wherein the memory stores a computer program, characterized in that, When the processor executes the computer program, it implements the steps of the neural network-based water bicarbonate prediction method according to any one of claims 1 to 8.

10. A computer-readable storage medium having a computer program stored thereon, characterized in that, When the computer program is executed by the processor, it implements the steps of the neural network-based water bicarbonate prediction method according to any one of claims 1 to 8.