Intelligent water level detection method, system and equipment for water conservancy project and medium

By deploying a dual-mode electrode array downstream of the gate and utilizing a hidden Markov model, the reliability and accuracy issues of water level detection in hydraulic engineering under severe water flow conditions were solved, enabling precise differentiation and detection of surges and actual water levels.

CN120927094AActive Publication Date: 2025-11-11SICHUAN GUANMAO INFORMATION ENGINEERING CO LTD

Patent Information

Application Number
CN202511463487.1
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-10-14
Publication Date
2025-11-11
Estimated Expiration
2045-10-14

AI Technical Summary

Technical Problem

In existing water conservancy projects, under water conservancy conditions such as gate opening for flood discharge, the reliability and accuracy of water level detection results are poor, making it difficult to distinguish between the stable rise of the true water level and surges or splashing water.

Method used

Multiple dual-mode electrode arrays are vertically deployed downstream of the gate. By periodically switching the acquisition and reset modes, ionization interference is eliminated, surge contact voltage signals are captured, and a hidden Markov model is used to distinguish between surges and actual water levels. The state co-verification is performed by combining the spatial relationship of the electrodes.

Benefits of technology

It improves the reliability and accuracy of water level monitoring information in scenarios with drastic water flow fluctuations, effectively suppresses false triggers, and enhances the precision of water level detection.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120927094A_ABST
    Figure CN120927094A_ABST
Patent Text Reader

Abstract

The invention discloses an intelligent water level detection method, system and device for a water conservancy project and a medium, and belongs to the field of detection. The device is suitable for a surge water flow environment, and through the deployed dual-working-mode electrode, reset signals are circularly collected and filtered to obtain a pure target voltage sequence. Through difference calculation and threshold comparison, a continuous voltage sequence is converted into a discrete voltage jump event sequence containing time, direction and amplitude. The occurrence frequency, the interval duration and the amplitude statistical value of the event sequence are calculated through a sliding time window, and a time domain feature vector sequence is generated; the feature vector sequence is input into a pre-trained hidden Markov model to decode a non-contact, surge or continuous contact state sequence of each electrode. Finally, the state sequence of the multiple electrodes is analyzed, the final reliable water level monitoring information is determined by confirming the continuous and stable contact state, the real water level and surge interference are effectively distinguished, and the reliability and accuracy of the water level detection result can be improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application belongs to the field of testing, and in particular relates to an intelligent water level detection method, system, equipment and medium for water conservancy projects. Background Technology

[0002] Water level monitoring is a key technology in modern water conservancy projects, providing crucial data support for flood control and drought relief, water resource allocation, and the safe operation of hydraulic structures. High-precision and highly reliable automated water level monitoring has broad application prospects for improving the management efficiency and emergency response capabilities of water conservancy projects.

[0003] Currently, existing water level detection methods for hydraulic engineering mainly utilize non-contact measurement methods such as ultrasonic waves and radar. These methods primarily detect water level height by measuring the propagation time of the signal. Under stable water flow conditions, these existing methods can provide relatively accurate measurement results.

[0004] However, under specific hydraulic engineering conditions such as gate opening for flood discharge, downstream river channels experience violent surges, turbulence, and significant water splashing. In such scenarios of drastically fluctuating water flow, existing technologies struggle to effectively distinguish between the steady rise of the true water level and the surges and splashing, leading to abnormal jumps and severe distortions in water level detection results. Therefore, existing methods suffer from poor reliability and accuracy in water level detection. Summary of the Invention

[0005] This application provides an intelligent water level detection method, system, equipment, and computer storage medium for water conservancy projects, which can improve the reliability and accuracy of water level detection results.

[0006] In a first aspect, this application provides an intelligent water level detection method for hydraulic engineering projects, applicable to surge flow environments, the method comprising: Multiple electrodes with dual working modes are arrayed in a direction perpendicular to the horizontal plane at a preset position downstream of the gate. The dual working modes include an acquisition mode for acquiring contact voltage signals and a reset mode for grounding the electrodes. The working mode of each electrode is switched cyclically at a preset period. The initial voltage sequence is collected through the electrode, and the periodic voltage sequence generated in the reset mode is filtered out from the initial voltage sequence to obtain the target voltage sequence of each electrode. By using differential calculation and threshold comparison, multiple voltage jump points are determined in the target voltage sequence, along with the jump time, jump direction, and jump amplitude corresponding to each voltage jump point. This generates a voltage jump event sequence for each electrode, which includes multiple voltage jump events. Each voltage jump event includes a voltage jump point and the corresponding jump time, jump direction, and jump amplitude. Based on the voltage jump event sequence, the occurrence frequency, average interval duration and amplitude statistics of the voltage jump events are calculated using a sliding time window to generate a time-domain feature vector sequence for each electrode. The time-domain feature vector sequence is input into the constructed state discrimination model to obtain the water level state sequence of each electrode. The state discrimination model includes non-contact state, surge state and continuous contact state. The state discrimination model is trained using a hidden Markov model based on training samples including historical surge feature vector sequences and corresponding labels. Water level monitoring information is determined based on the discrimination status at different times in the water level status sequence of multiple electrodes.

[0007] In one feasible implementation, the method further includes: Obtain the rate of change of the gate opening; By inputting the time-domain feature vector sequence into the constructed state discrimination model, the water level state sequence of each electrode is obtained, including: The state transition probability between different discriminant states in the state discrimination model is adjusted by using the opening change rate. By inputting the time-domain feature vector sequence into the state discrimination model after adjusting the state transition probability, the water level state sequence of each electrode is obtained.

[0008] In one feasible implementation, the state transition probability between different discriminative states in the state discrimination model is adjusted using the opening change rate, including: Based on the opening change rate, the target surge probability coefficient corresponding to the opening change rate is determined in the preset mapping relationship between the opening change rate and the surge probability coefficient. Adjust the state transition probability from the uncontacted state or the continuous contact state to the surge state in the state discrimination model based on the target surge probability coefficient.

[0009] In one feasible implementation, before determining multiple voltage jump points in the target voltage sequence and the corresponding jump time, jump direction, and jump amplitude of each voltage jump point through differential calculation and threshold comparison, and generating a voltage jump event sequence for each electrode, the method further includes: The discharge curve of the electrode is collected when the electrode switches from the acquisition mode to the reset mode; By calculating the time constant of the discharge curve and comparing it with a preset reference time constant, dirt level information is generated. Based on the dirt level information, a first voltage compensation factor corresponding to the dirt level information is determined in the preset mapping relationship between dirt level and voltage compensation factor. The amplitude in the target voltage sequence is adjusted using the first voltage compensation factor.

[0010] In one feasible implementation, before determining multiple voltage jump points in the target voltage sequence and the corresponding jump time, jump direction, and jump amplitude of each voltage jump point through differential calculation and threshold comparison, and generating a voltage jump event sequence for each electrode, the method further includes: Obtain water temperature data downstream of the gate; Based on water temperature data, a second voltage compensation factor corresponding to the water temperature data is determined in the preset mapping relationship between temperature and voltage compensation factors. Using the first voltage compensation factor, the amplitude in the target voltage sequence is adjusted, including: The amplitude in the target voltage sequence is adjusted using the first voltage compensation factor and the second voltage compensation factor.

[0011] In one feasible implementation, multiple voltage jump points are determined in the target voltage sequence through differential calculation and threshold comparison, along with the jump time, jump direction, and jump amplitude corresponding to each voltage jump point, generating a voltage jump event sequence for each electrode, including: The target voltage sequence is differentially calculated to obtain the voltage change rate corresponding to each time point of the target voltage sequence, thereby generating a voltage change rate sequence; By comparing the voltage change rate with a preset change rate threshold, multiple candidate jump points are identified in the voltage change rate sequence; In the target voltage sequence, determine the voltage jump amplitude corresponding to each candidate jump point, and identify the candidate jump points whose voltage jump amplitude is greater than a preset amplitude threshold as voltage jump points; In the target voltage sequence, determine the transition time, transition direction and transition amplitude corresponding to each voltage transition point, and generate a voltage transition event sequence for each electrode.

[0012] In one feasible implementation, water level monitoring information is determined based on the discrimination states at different times in the water level state sequence of multiple electrodes, including: Calculate the duration of the continuous contact state in the water level state sequence of each electrode, and determine that the electrode is in an effective contact state if the duration is greater than a preset time threshold. According to the deployment location, all electrodes are traversed from bottom to top. When the target electrode is in effective contact and all electrodes below the target electrode are in effective contact, the deployment height of the target electrode is determined as the water level monitoring information. The target electrode is any one of the electrodes.

[0013] Secondly, this application provides an intelligent water level detection system for hydraulic engineering projects, suitable for surge flow environments, the system comprising: The deployment module is used to deploy multiple dual-mode electrodes in an array at a preset position downstream of the gate along a direction perpendicular to the horizontal plane. The dual-mode includes an acquisition mode for acquiring contact voltage signals and a reset mode for grounding the electrodes. The acquisition module is used to cyclically switch the working mode of each electrode at a preset period, acquire the initial voltage sequence through the electrode, and filter out the periodic voltage sequence generated in the reset mode from the initial voltage sequence to obtain the target voltage sequence of each electrode. The determination module is used to determine multiple voltage jump points in the target voltage sequence through differential calculation and threshold comparison, as well as the jump time, jump direction and jump amplitude corresponding to each voltage jump point, and generate a voltage jump event sequence for each electrode. The voltage jump event sequence includes multiple voltage jump events, and each voltage jump event includes a voltage jump point and the corresponding jump time, jump direction and jump amplitude. The calculation module is used to calculate the occurrence frequency, average interval duration and amplitude statistics of voltage jump events based on the voltage jump event sequence using a sliding time window, and generate a time-domain feature vector sequence for each electrode. The calculation module is also used to input the time-domain feature vector sequence into the constructed state discrimination model to obtain the water level state sequence of each electrode. The state discrimination model includes the non-contact state, the surge state, and the continuous contact state. The state discrimination model is trained using a hidden Markov model based on training samples including historical surge feature vector sequences and corresponding labels. The determination module is also used to determine water level monitoring information based on the discrimination status at different times in the water level state sequence of multiple electrodes.

[0014] Thirdly, this application provides an electronic device, the device including: a processor, and a memory storing computer program instructions; the processor reads and executes the computer program instructions to implement the intelligent water level detection method for water conservancy projects as described in any embodiment of the first aspect.

[0015] Fourthly, this application provides a computer-readable storage medium storing computer program instructions, which, when executed by a processor, implement the intelligent water level detection method for a water conservancy project as described in any embodiment of the first aspect.

[0016] This application discloses an intelligent water level detection method, system, equipment, and computer storage medium for water conservancy projects. By vertically deploying a dual-mode electrode array downstream of a gate and periodically switching between acquisition and reset modes, surge contact voltage signals are captured while eliminating ionization interference. Furthermore, the voltage signals are converted into a sequence of transition events, and time-domain features are extracted, enabling a state discrimination model based on a Hidden Markov Model to accurately distinguish between the brief impact of a surge and the continuous rise of the actual water level. Finally, state co-verification is performed by combining the spatial relationship of the electrodes, effectively suppressing false triggering caused by violent water flow fluctuations. Therefore, the reliability and accuracy of water level monitoring information under scenarios of violent water flow fluctuations can be improved.

[0017] Furthermore, since the rapid change of the gate is the direct physical cause of surges, the rate of change of gate opening provides strong prior knowledge for the state discrimination model. By dynamically adjusting the state transition probability based on the rate of change of gate opening, the model can predict the impending surge when the gate opens rapidly. Therefore, when faced with subsequently acquired voltage jump characteristics, it is more inclined to classify them as surge states. This avoids the ambiguity that may occur when the model relies solely on passively observed voltage characteristics for discrimination, improves the speed and accuracy of distinguishing between surge pseudo-signals and real water level signals, and enhances the reliability of water level monitoring information in scenarios of violent water flow fluctuations. Attached Figure Description

[0018] To more clearly illustrate the technical solutions of the embodiments of this application, the accompanying drawings used in the embodiments of this application will be briefly introduced below. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.

[0019] Figure 1 This is a flowchart illustrating an intelligent water level detection method for water conservancy projects provided in one embodiment of this application. Figure 2 This is a flowchart illustrating a method for generating a voltage jump event sequence according to an embodiment of this application; Figure 3 This is a flowchart illustrating a method for determining water level monitoring information according to an embodiment of this application; Figure 4 This is a schematic diagram of the structure of an intelligent water level detection system for a water conservancy project provided in one embodiment of this application; Figure 5 This is a schematic diagram of the hardware structure of an electronic device provided in one embodiment of this application. Detailed Implementation

[0020] The features and exemplary embodiments of various aspects of this application will be described in detail below. To make the objectives, technical solutions, and advantages of this application clearer, the application will be further described in detail below with reference to the accompanying drawings and specific embodiments. It should be understood that the specific embodiments described herein are only intended to explain this application and not to limit it. For those skilled in the art, this application can be implemented without some of these specific details. The following description of the embodiments is merely to provide a better understanding of this application by illustrating examples.

[0021] It should be noted that, in this document, relational terms such as "first" and "second" are used merely to distinguish one entity or operation from another, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Furthermore, the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such a process, method, article, or apparatus. Without further limitations, an element defined by the phrase "comprising..." does not exclude the presence of additional identical elements in the process, method, article, or apparatus that includes said element.

[0022] Currently, existing water level detection methods for hydraulic engineering mainly utilize non-contact measurement methods such as ultrasonic waves and radar. These methods primarily detect water level height by measuring signal propagation time, and under stable water flow conditions, they can provide relatively accurate results. However, in specific hydraulic engineering conditions such as gate opening for flood discharge, downstream river channels experience violent surges, turbulence, and significant water splashing. In such scenarios of drastically fluctuating water flow, existing technologies struggle to effectively distinguish between the stable rise of the true water level and surges / splashing, leading to abnormal jumps and severe distortions in water level detection results. Therefore, existing methods suffer from poor reliability and accuracy in water level detection.

[0023] To address the problems of existing technologies, embodiments of this application provide an intelligent water level detection method, system, device, and computer storage medium for water conservancy projects. The intelligent water level detection method for water conservancy projects provided in this application embodiment will be described first below.

[0024] Figure 1 A flowchart illustrating an embodiment of the intelligent water level detection method for hydraulic engineering provided in this application is shown. This method is applicable to surge flow environments, such as... Figure 1 As shown, the method includes steps S110 to S160.

[0025] Surge flow environment refers to a scenario in water conservancy projects where the rapid opening of gates for flood discharge or flow regulation causes drastic changes in the downstream river flow. It is mainly characterized by high water velocity, violent water surface fluctuations, and turbulence and splashing water.

[0026] S110: Multiple electrodes with dual working modes are arrayed in a direction perpendicular to the horizontal plane at a preset position downstream of the gate. The dual working modes include an acquisition mode for acquiring contact voltage signals and a reset mode for grounding the electrodes.

[0027] The array deployment of sensors downstream of the gate, perpendicular to the horizontal plane, involves selecting a fixed cross-section downstream of the floodgate and installing a set of sensor probes at predetermined intervals along the vertical direction of this cross-section, i.e., perpendicular to the still water surface. The dual operating modes are two periodically switchable operating states set for each electrode: an acquisition mode for sensing water contact and measuring voltage signals, and a reset mode for actively eliminating electrical signal interference and forcibly clearing the electrode potential to zero. In this embodiment, the electrodes can be made of corrosion-resistant conductive materials, such as stainless steel or titanium alloy.

[0028] First, the bridge piers in the main flow area near the gate outlet were selected as installation points to ensure the electrodes were positioned at the monitoring section where surge energy was strongest and the water flow direction was stable. Multiple electrodes were fixed to an insulated support rod to form a vertical array, with the spacing between electrodes set according to the required water level resolution. During installation, measuring tools such as a level were used to calibrate the placement height of each electrode relative to a unified elevation benchmark. Simultaneously, to establish a stable potential reference benchmark, grounding electrodes were buried in the riverbed silt. Each electrode was connected to a central control and acquisition unit. This central control and acquisition unit, through its built-in microcontroller, controlled the configuration of general purpose input / output (GPIO) pins to achieve dual-mode switching. In acquisition mode, the GPIO pins were configured as high-impedance analog inputs and connected to an analog-to-digital converter (ADC) to read voltage signals at high frequency; in reset mode, the same GPIO pin was reconfigured as a low-level output, forcibly grounding the electrode line.

[0029] For example, in the spillway of a large reservoir, intelligent and precise water level detection is required. First, a concrete sidewall 15 meters downstream of the spillway gate is selected as the monitoring section, where surge energy is strongest and water flow direction is stable. Then, using stainless steel probes as electrodes, an electrode array of 15 stainless steel probes is constructed. All probes are fixed to an insulating rod, ensuring a vertical distance of 30 centimeters between any two adjacent probes. The assembled insulating rod is securely installed at the predetermined position on the concrete sidewall, and the grounding electrode is buried in the riverbed silt. A total station is used to measure the elevation of the tip of each stainless steel probe, obtaining and recording the deployment height of probes 1 to 15, for example, from 25 meters to 29.2 meters. Each probe is connected to a central controller via an independent coaxial cable. The controller is set to control 15 electrodes to switch synchronously in a 200-millisecond cycle. The first 180 milliseconds are in acquisition mode, where the microcontroller configures the GPIO of the corresponding channel as an ADC input and continuously acquires the contact voltage at a sampling rate of 1kHz. The next 20 milliseconds are switched to reset mode, where the GPIO is configured as an output mode and forced to output a low level (0V), so that the electrode is quickly grounded through the MOSFET to release the accumulated charge.

[0030] S120: The working mode of each electrode is switched cyclically at a preset period. The initial voltage sequence is collected through the electrode, and the periodic voltage sequence generated in the reset mode is filtered out from the initial voltage sequence to obtain the target voltage sequence of each electrode.

[0031] First, the central control and acquisition unit precisely controls the operating mode of each electrode according to a preset switching cycle, such as 200 milliseconds. For most of each cycle, such as the first 180 milliseconds, the electrode is in a high-impedance acquisition mode, and the analog-to-digital converter (ADC) continuously acquires voltage data at a high sampling rate in the kilohertz range. For the remaining time of each cycle, such as the last 20 milliseconds, it switches to reset mode, forcibly grounding the electrode. The voltage signal acquired at this time is the periodic voltage sequence, and the voltage signal acquired in a complete acquisition cycle is the initial voltage sequence. The periodic voltage sequence generated in reset mode, within the initial voltage sequence, consists of a series of voltage valley signals with fixed time intervals due to the periodic forced grounding of the electrode. These signals are actively introduced to eliminate interference and do not reflect the actual water level contact situation.

[0032] Next, the acquired initial voltage sequence is filtered. First, a digital bandpass filter is applied to remove high-frequency random noise and common power frequency interference in the field environment. A valley detection process is used to identify periodic voltage sequences generated by the reset mode. First, a very low voltage threshold is set, for example, slightly above zero V, and all consecutive data points below this threshold are marked as candidate valley segments. Next, the duration of each candidate segment is calculated. Since the reset mode duration is fixed, the duration is compared with the preset reset duration. Only candidate segments with precisely matching durations are ultimately confirmed as periodic voltage sequences to be removed. Finally, all confirmed periodic voltage sequence segments are removed from the initial voltage sequence, and the remaining valid data segments belonging to the acquisition mode are seamlessly stitched together in chronological order to generate a continuous target voltage sequence.

[0033] For example, an initial voltage sequence consisting of 200 data points is acquired within a 200-millisecond period starting from timestamp T=10.000 seconds, at a sampling rate of 1 kHz. This initial voltage sequence records voltage changes during the acquisition mode; for example, initially, with the electrode in air, the voltage stabilizes at around 3.3V; at approximately 10.150 seconds, the voltage drops rapidly to around 1.5V when a wave touches the electrode. This initial voltage sequence also records the forced grounding process during reset mode, where the voltage approaches 0V. After bandpass filtering this sequence, an extremely low voltage threshold of, for example, 0.1V is set, and combined with the duration, low-voltage segments that perfectly match the preset reset duration are identified from the initial voltage sequence and confirmed as periodic voltage sequences that need to be removed; for example, a periodic voltage sequence is a set of 20 consecutive data points. Finally, these 20 data points are removed from the initial voltage sequence, and the remaining 180 valid data points are concatenated to generate the target voltage sequence for that period. The data can be a series of timestamps paired with voltage values, such as [{10.001s, 3.31V}, {10.002s, 3.30V}, ..., {10.149s, 3.29V}, {10.150s, 1.51V}, {10.151s, 1.48V}, ...].

[0034] S130: Through differential calculation and threshold comparison, multiple voltage jump points are determined in the target voltage sequence, as well as the jump time, jump direction and jump amplitude corresponding to each voltage jump point, and a voltage jump event sequence for each electrode is generated. The voltage jump event sequence includes multiple voltage jump events, and each voltage jump event includes a voltage jump point and the corresponding jump time, jump direction and jump amplitude.

[0035] A voltage jump event is a structured data record describing a significant and rapid voltage change in a target voltage sequence. Each voltage jump event includes the jump time, jump direction, and jump magnitude. The jump time is the point in time when the voltage changes rapidly; the jump direction, also known as polarity, is used to distinguish whether the voltage drop is due to contact with water or the voltage rise is due to leaving the water; the jump magnitude is the absolute value of the voltage change. A voltage jump event sequence is a discrete time series composed of all voltage jump events detected in the target voltage sequence, arranged in chronological order.

[0036] First, a first-order difference calculation is performed on the generated target voltage sequence. Specifically, the voltage difference between two adjacent time points is calculated point by point to obtain a voltage change rate sequence of the same length as the target voltage sequence. Second, a threshold comparison is performed on this change rate sequence to identify valid transition points. A noise level threshold based on historical data analysis is set, for example, 0.5V. Only when the absolute value of the calculated voltage change rate exceeds this threshold is the time point initially identified as a candidate transition point, which can effectively filter out changes caused by small fluctuations or residual noise. For each confirmed valid voltage transition point, its corresponding three attributes are extracted: the transition time is directly taken as the timestamp of the data point; the transition direction is determined by the sign of the voltage change rate, with a negative value representing a voltage decrease and a positive value representing a voltage increase; and the transition amplitude is the absolute value of the voltage difference before and after the transition. All voltage transition events are collected and sorted by transition time to form the voltage transition event sequence of the electrode. For example, a voltage jump event in a voltage jump event sequence can be represented as {occurrence time: 10.150s, polarity: drop, amplitude: 1.79V}.

[0037] S140: Based on the voltage jump event sequence, the occurrence frequency, average interval duration and amplitude statistics of the voltage jump events are calculated using a sliding time window to generate a time-domain feature vector sequence for each electrode.

[0038] A time-domain feature vector sequence is a set of multidimensional data vectors arranged in chronological order. The time-domain feature vector includes the event frequency, the average transition interval, and amplitude statistics. The event frequency is the number of transitions per unit time, and the average transition interval is used to measure the stability of the signal. The amplitude statistics can include the mean and variance of the transition amplitude.

[0039] First, two key parameters are set: the width of the sliding window and the sliding step size. The window width is determined based on the typical duration of surges in a hydraulic scenario, for example, set to 1 second; the step size determines the temporal resolution of the feature vector sequence, for example, set to 0.5 seconds. Starting from the beginning of the voltage jump event sequence, all events occurring within the first time window are extracted. Then, for the event set within this window, a series of temporal features are calculated: the event frequency is obtained by counting the total number of events within the window and dividing by the window width; the average jump interval is obtained by calculating the time difference between all adjacent events within the window and averaging them; if there are fewer than two events within the window, this value can be set to the window width itself; the amplitude statistics are obtained by calculating the arithmetic mean and variance of the jump amplitudes of all events within the window. These calculated feature values ​​constitute a temporal feature vector associated with the beginning of the time window. After completing one calculation, the window slides backward by one step size, and the above feature extraction process is repeated until the entire voltage jump event sequence has been scanned. Finally, all generated time-domain feature vectors are sorted according to the start time of their time windows, forming a complete sequence of time-domain feature vectors.

[0040] For example, suppose that after a gate opens, an electrode is subjected to intense wave impacts, generating the following event sequence fragments: [{10.15s, drop, 1.79V}, {10.23s, rise, 1.75V}, {10.55s, drop, 1.81V}, {10.61s, rise, 1.80V}, {10.70s, drop, 1.20V}, {10.85s, rise, 1.15V}]. A sliding window with a width of 1 second and a step size of 0.5 seconds is used for processing. The first window covers the period from 10.0 seconds to 11.0 seconds, containing all six events mentioned above. The calculations show that the event frequency is 6 Hz; the average transition interval is 0.14 seconds; the mean transition amplitude is 1.58V, and the variance is 0.08. Therefore, the first time-domain feature vector is {10.0s, 6Hz, 0.14s, 1.58V, 0.08}. Then, by sliding the window for 0.5 seconds, the above calculation process is repeated, transforming the originally discrete event points into a continuous sequence of time-domain feature vectors.

[0041] S150: Input the time-domain feature vector sequence into the constructed state discrimination model to obtain the water level state sequence of each electrode. The state discrimination model can distinguish the states of non-contact, surge, and continuous contact. The state discrimination model is trained using a hidden Markov model based on training samples including historical surge feature vector sequences and corresponding labels.

[0042] The state discrimination model is a pre-built mathematical model that infers the true physical state of an electrode based on an input time-domain feature vector sequence. The state discrimination model primarily uses Hidden Markov Models (HMMs), statistical models used to describe a Markov process with hidden unknown parameters. HMMs can analyze a series of observable events to deduce hidden states that cannot be directly observed. The water level state sequence is a time series composed of discrimination states aligned with the time-domain feature vector sequence. Each element indicates the most probable physical state of the electrode determined by the model within the corresponding time window; that is, the discrimination state of the state discrimination model, which can be either no contact (S0), surge (S1), or continuous contact (S2).

[0043] The generated temporal feature vector sequence is used as the observation sequence and input into the pre-constructed state discrimination model based on a Hidden Markov Model. The model immediately calls the Viterbi algorithm to analyze the input sequence to find the hidden state path most likely to have generated the observation sequence. Assume that the electrode generates a temporal feature vector sequence during water level rise, with the first two vectors being {10.0s, 6Hz, 0.14s, 1.58V, 0.08} and {10.5s, 4Hz, 0.10s, 1.49V, 0.11}. When the first vector is input, the Viterbi algorithm calculates its emission probability under three states: no contact (S0), surge (S1), and continuous contact (S2). Since this vector has a high event frequency and significant amplitude variance, it highly matches the characteristics of the surge state S1 in the model. Therefore, its emission probability is highest under state S1, and the most likely state is initially determined to be S1. Next, for the second vector, not only is its emission probability calculated, but the transition probabilities from state S1 to S0, S1, and S2 are also combined. Since its characteristics still exhibit surge, and the transition probability from S1 to S1 is relatively high, the state of the second time window is determined to be S1.

[0044] As decoding progresses, suppose the last two vectors of the sequence become {11.0s, 0Hz, 1.00s, 0.00V, 0.00} and {11.5s, 0Hz, 1.00s, 0.00V, 0.00}. When processing the third vector, it is found that its event frequency and amplitude variance are both zero. This zero-event characteristic makes the emission probability of this vector high in both the uncontacted state S0 and the continuous contact state S2, causing ambiguity in the judgment. At this point, the Viterbi algorithm comprehensively considers the state transition probability. Under the condition of rising water level, the probability of transitioning from the surge state S1 to the continuous contact state S2 in the model is set to be much greater than the probability of returning from the surge S1 to the uncontacted state S0. Based on this key transition probability, the optimal state of the third time window can be determined to be continuous contact S2 with a very high confidence. Similarly, for the fourth vector, since its characteristics are the same as the third, and the self-transition probability from S2 to S2 is very high, its state will continue to be determined to be S2. Finally, after traversing the entire sequence, the Viterbi algorithm backtracks and outputs a globally optimal state path S1, S1, S2, S2, generating the final water level state sequence of the electrode: [{10.0s, S1}, {10.5s, S1}, {11.0s, S2}, {11.5s, S2}].

[0045] As one implementation of this application, before inputting the time-domain feature vector sequence into the constructed state discrimination model to obtain the water level state sequence in step S150, the method further includes a step of training the state discrimination model using a hidden Markov model. First, a training sample set including a large amount of diverse historical working condition data is obtained. This training sample set includes multiple training samples, each of which includes a historical surge feature vector sequence generated by steps S110 to S140, and its corresponding real water level state sequence label, such as {S0, S0, ..., S1, S1, S2, ...}.

[0046] Based on this training sample set, the following model training steps are performed: First, the parameters of the Hidden Markov Model in the state discrimination model are initialized. These parameters mainly include the initial state probability (the probability of being initially in the uncontacted S0, surging S1, or continuously contacted S2 states); the state transition probability matrix (the probability of transitioning from one state to another); and the emission probability distribution (the probability of generating a specific time-domain feature vector in a specific state). Next, the historical surge feature vector sequences from all training samples are used as observation sequences, combined with their corresponding real water level state sequence labels, and calculated using direct maximum likelihood estimation. Specifically, the initial state probability is determined by statistically analyzing the frequency of S0, S1, and S2 as initial states in all samples; the state transition probability matrix is ​​calculated by statistically analyzing the number of transitions from one state to another in all samples; and the emission probability distribution is determined by analyzing the distribution of various time-domain feature vectors in each state. Through this statistical calculation process, a set of optimized model parameters is directly obtained, thus completing the model training and ultimately obtaining the trained state discrimination model.

[0047] S160: Determine water level monitoring information based on the discrimination status at different times in the water level status sequence of multiple electrodes.

[0048] Water level monitoring information represents the measurement results of the actual water level, that is, the currently confirmed water level height value, which corresponds to the preset deployment height of a specific electrode.

[0049] First, the water level status sequence of each electrode is processed in parallel. For a single electrode's water level status sequence, its determination state (S2) is continuously monitored to determine if it is in continuous contact state, and the duration of continuous occurrence of this S2 state is calculated. A preset time threshold, such as 1 second, is used to effectively filter out short-duration surges or splashes. Only when the duration of an electrode's S2 state exceeds this preset time threshold is the electrode considered to have entered a valid contact state. After determining the valid contact state of all electrodes, a bottom-up traversal check logic begins. Starting with the electrode at the lowest installation position, checks are performed one by one upwards. When a target electrode is checked, two conditions are confirmed: first, the target electrode itself must be in a valid contact state; second, all electrodes deployed below the target electrode must also be in a valid contact state. Only when both conditions are met simultaneously is the deployment height of the target electrode confirmed as the latest water level monitoring information. Once any electrode that does not meet the conditions is encountered, the traversal process stops, and the height of the previous electrode that met the conditions is taken as the final result. Finally, a water level monitoring message is output, such as the deployment height of electrode 8, for example, 27.1 meters. This indicates that despite the presence of violent surges and splashing water, the actual water level is 27.1 meters.

[0050] This embodiment utilizes a dual-mode electrode array vertically deployed downstream of the gate, employing periodic switching between acquisition and reset modes to capture surge contact voltage signals while eliminating ionization interference. Furthermore, the voltage signal is converted into a sequence of transition events, and time-domain features are extracted. This enables a state discrimination model based on a Hidden Markov Model to accurately distinguish between the brief impact of a surge and the continuous rise in the actual water level. Finally, state co-verification is performed by combining the spatial relationship of the electrodes, effectively suppressing false triggering caused by drastic water flow fluctuations. Therefore, the reliability and accuracy of water level monitoring information under scenarios of drastic water flow fluctuations can be improved.

[0051] In one feasible implementation, the method further includes: Obtain the rate of change of the gate opening.

[0052] The gate opening change rate represents the speed at which gates controlling flood discharge in a water conservancy project open or close, quantifying the increase or decrease in gate opening per unit time. A positive change rate indicates that the gate is opening rapidly, and the downstream river channel is about to experience or is experiencing an increase in flow and the formation of surges. A change rate close to zero indicates that the water flow is relatively stable, while a negative change rate indicates that the gate is closing and the water flow is becoming calmer. The central control and acquisition unit sends data requests to the gate main control system at fixed time intervals, such as once per second, to obtain the latest gate opening percentage or height value. Then, by performing a difference calculation on two consecutive acquisition opening values—that is, subtracting the previous opening value from the current opening value and then dividing by the time interval between the two acquisitions—the real-time opening change rate is calculated.

[0053] In step S150, the time-domain feature vector sequence is input into the constructed state discrimination model to obtain the water level state sequence for each electrode, including: The state transition probability between different discriminant states in the state discrimination model is adjusted by using the opening change rate.

[0054] The state transition probability is a numerical value in the state discrimination model that describes the inherent possibility of transitioning from one hidden state to another. By introducing the external prior information of the gate opening change rate, the state transition probability matrix, which is fixed after training, becomes a matrix that can dynamically change in real time according to the actual working conditions.

[0055] A pre-established mapping relationship between the gate opening change rate and the surge probability coefficient is constructed. This relationship can be set through historical data analysis or expert experience, and its form can be a continuous function. Once the latest gate opening change rate is obtained, the corresponding target surge probability coefficient is found or calculated within this mapping relationship. This surge probability coefficient, acting as a multiplier factor, is used to adjust the original state transition probability in the state discrimination model from the uncontacted state S0 or the continuously contacted state S2 to the surge state S1. For example, the new transition probability equals the original probability multiplied by this coefficient. After increasing the probability of transitioning to the surge state, to ensure that the sum of all transition probabilities starting from any state is always equal to one, the probability of transitioning from that state to other states is proportionally reduced, thereby completing the dynamic adjustment of the entire state transition probability matrix.

[0056] By inputting the time-domain feature vector sequence into the state discrimination model after adjusting the state transition probability, the water level state sequence of each electrode is obtained.

[0057] The time-domain feature vector sequence generated by S140 is used as the observation sequence and input into the state discrimination model whose state transition probabilities have been adjusted in real time. The model calls the Viterbi algorithm to find the optimal hidden state path. In each iteration of the Viterbi algorithm, when it evaluates the probability of transitioning from the state at the previous time point to a candidate state at the current time point, it uses a new transition probability dynamically generated based on the gate opening change rate. Since the new transition probability has been combined with the prediction of the surge probability, the Viterbi algorithm can more accurately identify the surge state caused by gate opening during decoding and can more accurately distinguish between surges and actual water level inundation, ultimately outputting a water level state sequence that better reflects the physical process.

[0058] For example, suppose the gate opening is obtained at 10% and 11% at T=9.0 seconds and T=10.0 seconds respectively, and the opening change rate of 1% per second is calculated accordingly. Based on this change rate, a target surge probability coefficient of, for example, 1.8 is obtained by querying a preset mapping relationship, and this coefficient is used to dynamically adjust the state discrimination model, increasing the probability of transitioning from "uncontacted S0" to "surge S1" from 0.1 to 0.18, thereby enabling the model to anticipate the impending surge. Subsequently, when an electrode generates a time-domain feature vector sequence [{10.0s, 6Hz, ...}, {10.5s, 4Hz, ...}, {11.0s, 0Hz, ...}, {11.5s, 0Hz, ...}] and inputs it into the adjusted model, the Viterbi algorithm can confidently classify the first two high-frequency event vectors as surge state S1. Furthermore, when processing subsequent zero-event frequency vectors, it utilizes the enhanced transition probability from surge S1 to sustained contact S2 to classify the state as S2, rather than reverting to non-contact S0. Ultimately, the water level state sequence [{10.0s, S1}, {10.5s, S1}, {11.0s, S2}, {11.5s, S2}] output by the model incorporates the macroscopic physical background of gate opening, making the final water level monitoring information more reliable.

[0059] In one feasible implementation, the state transition probability between different discriminative states in the state discrimination model is adjusted using the opening change rate, including: Based on the opening change rate, the target surge probability coefficient corresponding to the opening change rate is determined in the preset mapping relationship between the opening change rate and the surge probability coefficient.

[0060] The preset mapping relationship between the gate opening change rate and the surge probability coefficient is a non-linear mathematical function. It can be used to convert the gate opening change rate into a surge probability coefficient to adjust the state transition probability from the uncontacted state or the continuous contact state to the surge state in the state discrimination model.

[0061] The mapping relationship between the preset gate opening change rate and the surge probability coefficient is specifically expressed as shown in formula (1). Substituting the calculated gate opening change rate v into formula (1), the target surge probability coefficient at the current moment is directly calculated. .

[0062] (1) in, represents the target surge probability coefficient; v represents the rate of change of gate opening; A is the maximum adjustment range, a constant greater than zero, representing the maximum increase that the coefficient can achieve, and determining that the upper limit of the coefficient is 1+A; k represents the growth rate of the curve. This represents the rate of change threshold. For example, assuming the current gate opening change rate v is 1.2 percentage points per second, and the preset mapping function parameters are maximum adjustment amplitude A = 2, growth rate k = 1.5, the rate of change threshold... =0.5.

[0063] Substituting these values ​​into formula (1), the target surge probability coefficient is calculated. It is approximately 2.5.

[0064] Adjust the state transition probability from the uncontacted state or the continuous contact state to the surge state in the state discrimination model based on the target surge probability coefficient.

[0065] First, locate the two specific elements in the state transition probability matrix that need adjustment: P(S0→S1) and P(S2→S1). Multiply these two original state transition probability values ​​by the calculated target surge probability coefficient. This yields two new, amplified transition probability values, P'(S0→S1) and P'(S2→S1). Subsequently, to ensure that the sum of all transition probabilities originating from any state is always equal to one, normalization is required. Taking the transition from state S0 as an example, after increasing the probability of transitioning to S1, the probabilities of transitioning from S0 to S0 itself and from S0 to S2 are proportionally reduced. This reduction factor... Finally, the adjusted new probabilities are: as well as By performing this amplification and compensation reduction operation on all affected transition probabilities, a completely new state transition probability matrix is ​​generated. For example, the calculated target surge probability coefficient is used... =2.5 to adjust the state transition probability. Assume that in the original matrix, the transition probability starting from the untouched state S0 is: [P(S0→S0)=0.85, P(S0→S1)=0.10, P(S0→S2)=0.05]. First, increase the probability of transitioning to the surge state: Next, the reduction scaling factor used for normalization is calculated. Finally, update the other transition probabilities. . Therefore, the adjusted new probability behavior starting from S0 is approximately: [P'(S0→S0)=0.71, P'(S0→S1)=0.25, P'(S0→S2)=0.04], which sums to 1.0. A similar operation is performed on the transition probability starting from the continuous contact state S2, thereby generating a complete dynamically adjusted state transition probability matrix.

[0066] This embodiment dynamically adjusts the state transition probability based on the rate of change of gate opening, enabling the model to predict an impending surge when the gate opens rapidly. Consequently, when faced with subsequently acquired voltage jump characteristics, it is more inclined to classify them as surge conditions. This avoids the ambiguity that may occur when the model relies solely on passively observed voltage characteristics for discrimination, improves the speed and accuracy of distinguishing between surge pseudo-signals and true water level signals, and enhances the reliability of water level monitoring information in scenarios of violent water flow fluctuations.

[0067] In one feasible implementation, before step S130: determining multiple voltage jump points in the target voltage sequence and the jump time, jump direction, and jump amplitude corresponding to each voltage jump point through differential calculation and threshold comparison, and generating a voltage jump event sequence for each electrode, the method further includes: The discharge curve of the electrode is collected when the electrode switches from the acquisition mode to the reset mode.

[0068] The discharge curve is a detailed data record of the complete process of the electrode's voltage rapidly dropping from a relatively high stable value to near zero V the instant the electrode switches from acquisition mode to reset mode. The process of acquiring the electrode's discharge curve is synchronized with the signal acquisition in S120. When the central control and acquisition unit switches the electrode's operating mode from acquisition to reset, its built-in analog-to-digital converter (ADC) does not stop working but continues to acquire the electrode voltage at a high sampling rate in the kilohertz range. All voltage data points acquired within each reset cycle, for example, the last 20 milliseconds, are extracted and stored as an independent sequence. This data segment, including the complete voltage decay process from high to low, constitutes the discharge curve. For example, a sequence of collected discharge curves can be represented as a pair of timestamps and voltage values: [{T+0.001s, 3.30V}, {T+0.002s, 2.55V}, {T+0.003s, 1.98V}, ..., {T+0.005s, 1.21V}, ..., {T+0.020s, 0.05V}].

[0069] By calculating the time constant of the discharge curve and comparing it with a preset benchmark time constant, dirt level information is generated.

[0070] The time constant is a key physical quantity describing the decay rate of a discharge curve. It represents the time required for the electrode voltage to decay from its initial value to a set percentage. A larger time constant indicates a slower discharge. The set percentage can be 36.8%. The reference time constant is a value calibrated for a clean electrode in standard water under laboratory conditions and can serve as a reference for its health status. Fouling level information is a discrete label determined based on the degree of deviation between the measured time constant and the reference time constant, such as clean, lightly fouled, moderately fouled, or heavily fouled.

[0071] First, the collected discharge curve is analyzed to determine its initial voltage value, which is the last voltage reading before switching to reset mode. Then, the time elapsed when the voltage decays to 36.8% of the initial value is found by searching the curve; this time is the measured time constant. Next, this measured time constant is compared with a preset reference time constant within the system. A series of thresholds are preset; for example, if the measured value is within 110% of the reference value, it is considered clean; if it is between 110% and 150%, it is considered lightly soiled. Through this range comparison, a clear soiling level is finally output. For example, assuming the initial voltage in the discharge curve is 3.30V, the target voltage for 36.8% is 1.21V. The time required to reach this voltage is found in the sequence and is 5 milliseconds, which is the measured time constant. Assuming the preset reference time constant is 3 milliseconds, since 5 milliseconds is greater than 150% of 3 milliseconds, through range comparison, the final output soiling level information is moderately soiled.

[0072] Based on the dirt level information, a first voltage compensation factor corresponding to the dirt level information is determined in the preset mapping relationship between dirt level and voltage compensation factor.

[0073] The first voltage compensation factor is a coefficient used to correct for voltage signal amplitude attenuation caused by electrode fouling, and its value is typically greater than or equal to one. The mapping relationship between fouling level and voltage compensation factor is a pre-defined lookup table that directly associates discrete fouling levels with specific numerical compensation factors. For example, the mapping relationship between fouling level and voltage compensation factor is shown in Table 1.

[0074] Table 1: Comparison Table of Fouling Level and Voltage Compensation Factor Dirt level information First voltage compensation factor clean 1.00 Light dirt 1.05 Moderate dirt 1.15 Heavy dirt 1.30 Table 1 shows the direct mapping between electrode fouling levels and quantitative compensation factors used to correct signal amplitude. The generated fouling level information, such as moderate fouling, is used as the lookup key. A search is performed in the mapping table shown in Table 1 to determine the corresponding first voltage compensation factor, for example, 1.15.

[0075] The amplitude in the target voltage sequence is adjusted using the first voltage compensation factor.

[0076] The algorithm iterates through each voltage value in the target voltage sequence generated in S120. For each voltage value, it multiplies it by the first voltage compensation factor determined in the previous step to obtain a new compensated voltage value. This new value then replaces the original voltage values ​​in the sequence, while the timestamp remains unchanged. For example, suppose that in the target voltage sequence generated in S120, the electrode voltage drops from 3.3V to 1.4V due to a wave impact. The compensation iterates through the target voltage sequence and multiplies the voltage value of 1.4V by the first voltage compensation factor of 1.15, obtaining a new compensated voltage value of 1.61V. This data point in the target voltage sequence is updated from {..., 1.40V} to {..., 1.61V}.

[0077] In one feasible implementation, before step S130: determining multiple voltage jump points in the target voltage sequence and the jump time, jump direction, and jump amplitude corresponding to each voltage jump point through differential calculation and threshold comparison, and generating a voltage jump event sequence for each electrode, the method further includes: Obtain water temperature data downstream of the gate.

[0078] Water temperature data refers to the real-time water temperature measured by a sensor at the location of the electrode array. An industrial-grade temperature sensor is mounted on a support rod where the electrode array is deployed, ensuring that its sensing element and the electrodes are in the same water flow environment. The temperature sensor is connected to a central control and acquisition unit, which actively queries the temperature sensor at preset intervals to obtain the current water temperature reading. For example, the central control and acquisition unit might send a query command to the temperature sensor and receive a reported current water temperature of 12.5 degrees Celsius.

[0079] Based on the water temperature data, a second voltage compensation factor corresponding to the water temperature data is determined in the preset mapping relationship between temperature and voltage compensation factors.

[0080] The second voltage compensation factor is a coefficient used to correct for changes in voltage signal amplitude caused by variations in water conductivity due to changes in water temperature. The mapping relationship between temperature and the voltage compensation factor is a pre-defined lookup table that associates different water temperature ranges with the second voltage compensation factor. For example, the mapping relationship between temperature and the voltage compensation factor is shown in Table 2. For instance, 12.5 degrees Celsius falls within the range of 10 to 15 degrees Celsius, and the required second voltage compensation factor is matched and determined to be 1.08.

[0081] Table 2: Comparison Table of Temperature and Voltage Compensation Factors Water temperature range (degrees Celsius) Second voltage compensation factor 0-5 1.18 5-10 1.12 10-15 1.08 15-20 1.00 20-25 0.94 25-30 0.89 Table 2 establishes a direct mapping relationship between water temperature ranges and quantitative compensation factors used to correct signal amplitude to offset changes in water conductivity.

[0082] Using the first voltage compensation factor, the amplitude in the target voltage sequence is adjusted, including: The amplitude in the target voltage sequence is adjusted using the first voltage compensation factor and the second voltage compensation factor.

[0083] Iterate through each voltage value in the target voltage sequence generated by S120. For each voltage value, multiply it simultaneously by a first voltage compensation factor obtained from fouling analysis and a second voltage compensation factor obtained from a water temperature lookup table to obtain a new voltage value that has undergone double compensation. Replace the original voltage value in the sequence with this new value. For example, the first voltage compensation factor has been determined to be 1.15, and the second voltage compensation factor has been determined to be 1.08. Now, assume that the original voltage value in the target voltage sequence is 1.4V. Perform a joint compensation calculation on this value: the new voltage after compensation = 1.4V × 1.15 × 1.08 ≈ 1.74V. Finally, this data point in the target voltage sequence will be updated from {..., 1.40V} to {..., 1.74V}.

[0084] Figure 2 A flowchart illustrating a method for generating a voltage transition event sequence according to an embodiment of this application is shown. Figure 2 As shown, the method includes steps S210 to S240.

[0085] In one feasible implementation, step S130: by differential calculation and threshold comparison, multiple voltage jump points are determined in the target voltage sequence, along with the jump time, jump direction, and jump amplitude corresponding to each voltage jump point, generating a voltage jump event sequence for each electrode, including: S210: Perform differential calculation on the target voltage sequence to obtain the voltage change rate corresponding to each time point of the target voltage sequence, and generate a voltage change rate sequence.

[0086] Each value in the voltage change rate sequence represents the instantaneous speed and direction of the voltage signal change at the corresponding moment. Traversing the target voltage sequence, starting from the second data point, for each time point, the voltage value at the current point is subtracted from the voltage value at the previous time point to obtain the voltage difference. To obtain the voltage change rate, i.e., the amount of voltage change per unit time, this voltage difference needs to be divided by the time interval between the two points. This time interval is a constant sampling period determined by the analog-to-digital converter (ADC) sampling rate. This process continues until the entire target voltage sequence has been traversed. Finally, all calculated voltage change rates and their corresponding timestamps are combined to form a new voltage change rate sequence of the same length as the target voltage sequence. For example, for a target voltage sequence segment [{..., 10.149s, 3.30V}, {10.150s, 1.51V}, ...], assuming a sampling rate of 1 kHz, the sampling period is 1 millisecond. The voltage change rate calculated at 10.150 seconds is -1.79V / ms. This value represents the rate at which the voltage drops sharply at that moment.

[0087] S220: By comparing the voltage change rate with a preset change rate threshold, multiple candidate jump points are identified in the voltage change rate sequence.

[0088] Candidate transition points are initially selected time points that may represent actual water contact events. Using a pre-set rate of change threshold, the voltage rate of change sequence generated in the previous step is iterated. For each voltage rate of change in the sequence, its absolute value is taken and compared with this pre-set threshold. If the absolute value of the voltage rate of change at a certain time point is greater than the threshold, then this time point is considered a candidate transition point and recorded. Assuming the pre-set rate of change threshold is 0.5 V / ms, the absolute value of the rate of change calculated at 10.150 seconds (-1.79 V / ms) is compared with this threshold. Since 1.79 V / ms is greater than 0.5 V / ms, time point 10.150 seconds is initially identified as a candidate transition point.

[0089] S230: Determine the voltage jump amplitude corresponding to each candidate jump point in the target voltage sequence, and determine the candidate jump points whose voltage jump amplitude is greater than the preset amplitude threshold as voltage jump points.

[0090] Iterate through all candidate voltage transition points selected in the previous step. For each candidate transition point, determine the actual voltage transition amplitude. This amplitude is obtained by calculating the absolute value of the difference between the voltage value at the candidate transition point and the voltage value at the previous moment. Then, compare this actual voltage transition amplitude with a preset amplitude threshold. Only when the voltage transition amplitude is greater than this amplitude threshold is the candidate transition point finally confirmed as a valid voltage transition point. For example, for the candidate transition point of 10.150 seconds determined in the previous step, calculate its actual voltage transition amplitude, i.e., |1.51V - 3.30V| = 1.79V. Assuming the preset amplitude threshold is 1.0V, since 1.79V is greater than 1.0V, the candidate transition point is confirmed as a valid voltage transition point.

[0091] S240: Determine the transition time, transition direction, and transition amplitude corresponding to each voltage transition point in the target voltage sequence, and generate a voltage transition event sequence for each electrode.

[0092] Iterate through all the voltage jump points confirmed in the previous step, and extract three key attributes for each voltage jump point: jump time, i.e., the timestamp corresponding to the point; jump direction, determined by checking the sign of the value in the voltage change rate sequence generated in S210; and jump amplitude, i.e., the absolute value of the actual voltage difference of the jump calculated in S230. Then, combine these three attributes into a structured voltage jump event and sort them according to the order of their occurrence, ultimately forming the voltage jump event sequence for that electrode. For example, for the voltage jump point 10.150 seconds confirmed in the previous step, its jump time is extracted as 10.150 seconds; its voltage change rate calculated in S210 is negative, determining the jump direction to be decreasing; and its actual voltage jump amplitude calculated in S230 is 1.79V. These three attributes constitute a structured voltage jump event {occurrence time: 10.150s, polarity: decrease, amplitude: 1.79V}, and are added to the final voltage jump event sequence of the electrode.

[0093] Figure 3 A flowchart illustrating a method for determining water level monitoring information according to an embodiment of this application is shown. Figure 3 As shown, the method includes steps S310 to S320.

[0094] In one feasible implementation, step S160: determining water level monitoring information based on the discrimination states at different times in the water level state sequence of multiple electrodes, including: S310: Calculate the duration of the continuous contact state in the water level state sequence of each electrode, and determine that the electrode is in an effective contact state if the duration is greater than a preset time threshold.

[0095] An effective contact state refers to an electrode being labeled as having an effective contact state only after it has been determined by the state discrimination model to be in a continuous contact state and the continuous holding time of this state exceeds a set time threshold.

[0096] The water level state sequence generated by S150 is processed in parallel. For a single electrode, its latest determination state is monitored in real time. When the state first enters or remains in the continuous contact state S2, an internal timer starts counting. If the state switches to non-contact S0 or surge S1 midway, the timer is immediately reset to zero. The duration of the S2 state recorded by this timer is continuously compared with a preset time threshold. This time threshold is set based on the difference between the typical duration of a surge in a hydraulic scenario and the stability of the actual water level rise, for example, 1 second. Only when the duration recorded by the timer successfully exceeds this preset time threshold is the current state of the electrode marked as a valid contact state. For example, suppose the preset time threshold is 1 second. For a certain electrode, its water level state sequence is [{..., 11.0s, S2}, {11.5s, S2}, {12.0s, S2}]. Its S2 state starts from 11.0 seconds and has lasted for 1 second at the current 12.0 seconds, which meets the threshold condition. Therefore, electrode No. 8 is determined to be in an effective contact state.

[0097] S320: Traverse all electrodes from bottom to top according to their deployment positions. When the target electrode is in effective contact and all electrodes below the target electrode are in effective contact, determine the deployment height of the target electrode as the water level monitoring information. The target electrode is any one of the electrodes.

[0098] After obtaining the effective contact status of all electrodes, the process begins with the lowest-positioned electrode and proceeds upwards. For the first electrode detected, if it is in effective contact, its placement height is temporarily taken as the current water level. The process continues upwards to check the next electrode; if it is also in effective contact, the current water level is updated to the placement height of this higher electrode. This process continues until the first electrode not in effective contact is encountered. Once such a breakpoint is reached, the process stops immediately, and the last electrode that satisfies the condition—the last continuously in effective contact—becomes the target electrode. The placement height of the target electrode is then output as the final, reliable water level monitoring information.

[0099] For example, it has been determined that electrodes 1 through 8 are in effective contact, while electrode 9 is not. Starting from electrode 1, the process iterates upwards. When electrode 8 is checked, since it and all electrodes below it are in effective contact, the provisional water level is updated to the deployment height of electrode 8, for example, 27.1 meters. When checking upwards to electrode 9, it is found that it is not in effective contact, and the process stops. Therefore, the final output water level monitoring information is the deployment height of electrode 8, 27.1 meters.

[0100] Based on the same concept, embodiments of this application provide an intelligent water level detection system for water conservancy projects, which will be described below in conjunction with... Figure 4 The intelligent water level detection system for water conservancy projects provided in the embodiments of this application will be described in detail.

[0101] Figure 4 This is a structural block diagram of an intelligent water level detection system for a water conservancy project, as shown in an embodiment of this application.

[0102] like Figure 4 As shown, the intelligent water level detection system for this water conservancy project is suitable for surge flow environments. The system may include: Deployment module 410 is used to deploy multiple dual-mode electrodes in an array at a preset position downstream of the gate along a direction perpendicular to the horizontal plane. The dual-mode includes an acquisition mode for acquiring contact voltage signals and a reset mode for grounding the electrodes. The acquisition module 420 is used to cyclically switch the working mode of each electrode at a preset period, acquire the initial voltage sequence through the electrode, and filter out the periodic voltage sequence generated in the reset mode from the initial voltage sequence to obtain the target voltage sequence of each electrode. The determination module 430 is used to determine multiple voltage jump points in the target voltage sequence through differential calculation and threshold comparison, as well as the jump time, jump direction and jump amplitude corresponding to each voltage jump point, and generate a voltage jump event sequence for each electrode. The voltage jump event sequence includes multiple voltage jump events, and each voltage jump event includes a voltage jump point and the corresponding jump time, jump direction and jump amplitude. The calculation module 440 is used to calculate the occurrence frequency, average interval duration and amplitude statistics of voltage jump events based on the voltage jump event sequence using a sliding time window, and generate a time-domain feature vector sequence for each electrode. The calculation module 440 is also used to input the time-domain feature vector sequence into the constructed state discrimination model to obtain the water level state sequence of each electrode. The state discrimination model includes the non-contact state, the surge state, and the continuous contact state. The state discrimination model is trained using a hidden Markov model based on training samples including historical surge feature vector sequences and corresponding labels. The determination module 430 is also used to determine water level monitoring information based on the discrimination status at different times in the water level state sequence of multiple electrodes.

[0103] In one embodiment, the acquisition module 420 is also used to acquire the gate opening change rate; use the opening change rate to adjust the state transition probability between different discrimination states in the state discrimination model; input the time domain feature vector sequence into the state discrimination model after the state transition probability is adjusted to obtain the water level state sequence of each electrode.

[0104] In one embodiment, the acquisition module 420 is specifically used to determine the target surge probability coefficient corresponding to the opening change rate based on the opening change rate and in a preset mapping relationship between the opening change rate and the surge probability coefficient; and to adjust the state transition probability in the state discrimination model from the uncontacted state or the continuous contact state to the surge state according to the target surge probability coefficient.

[0105] In one embodiment, before determining multiple voltage jump points and the corresponding jump time, jump direction, and jump amplitude of each voltage jump point in the target voltage sequence through differential calculation and threshold comparison, and generating a voltage jump event sequence for each electrode, the acquisition module 420 is further configured to acquire the discharge curve of the electrode when the electrode switches from the acquisition mode to the reset mode; generate fouling level information by calculating the time constant of the discharge curve and comparing it with a preset reference time constant; determine a first voltage compensation factor corresponding to the fouling level information based on the fouling level information in a preset mapping relationship between fouling level and voltage compensation factor; and adjust the amplitude in the target voltage sequence using the first voltage compensation factor.

[0106] In one embodiment, before determining multiple voltage jump points in the target voltage sequence and the jump time, jump direction, and jump amplitude corresponding to each voltage jump point through differential calculation and threshold comparison, and generating a voltage jump event sequence for each electrode, the acquisition module 420 is also used to acquire water temperature data downstream of the gate; based on the water temperature data, a second voltage compensation factor corresponding to the water temperature data is determined in a preset mapping relationship between temperature and voltage compensation factors; and the amplitude in the target voltage sequence is adjusted using the first voltage compensation factor and the second voltage compensation factor.

[0107] In one embodiment, the determining module 420 is specifically used to perform differential calculation on the target voltage sequence to obtain the voltage change rate corresponding to each time point of the target voltage sequence, and generate a voltage change rate sequence; by comparing the voltage change rate with a preset change rate threshold, multiple candidate jump points are determined in the voltage change rate sequence; the voltage jump amplitude corresponding to each candidate jump point is determined in the target voltage sequence, and candidate jump points with voltage jump amplitudes greater than a preset amplitude threshold are determined as voltage jump points; the jump time, jump direction and jump amplitude corresponding to each voltage jump point are determined in the target voltage sequence, and a voltage jump event sequence for each electrode is generated.

[0108] In one embodiment, the determining module 420 is specifically used to calculate the duration of the continuous contact state in the water level state sequence of each electrode, and determine that the electrode is in a valid contact state if the duration is greater than a preset time threshold; traverse all electrodes from bottom to top according to the deployment position, and determine the deployment height of the target electrode as water level monitoring information if the target electrode is in a valid contact state and all electrodes below the target electrode are in a valid contact state. The target electrode is any one of the electrodes.

[0109] Figure 4 Each module in the system shown has an implementation Figures 1 to 3 The functions of each step in the process and their corresponding technical effects are described in detail here for the sake of brevity.

[0110] Figure 5 A schematic diagram of the hardware structure of an electronic device provided in one embodiment of this application is shown.

[0111] The electronic device may include a processor 510 and a memory 520 storing computer program instructions.

[0112] Specifically, the processor 510 may include a central processing unit (CPU), an application-specific integrated circuit (ASIC), or one or more integrated circuits that can be configured to implement the embodiments of this application.

[0113] Memory 520 may include mass storage for data or instructions. For example, and not limitingly, memory 520 may include a hard disk drive (HDD), floppy disk drive, flash memory, optical disk, magneto-optical disk, magnetic tape, or Universal Serial Bus (USB) drive, or a combination of two or more of these. Where appropriate, memory 520 may include removable or non-removable (or fixed) media. Where appropriate, memory 520 may be internal or external to the integrated gateway disaster recovery device. In a particular embodiment, memory 520 is non-volatile solid-state memory.

[0114] Memory may include read-only memory (ROM), random access memory (RAM), disk storage media devices, optical storage media devices, flash memory devices, and electrical, optical, or other physical / tangible memory storage devices. Therefore, typically, memory includes one or more tangible (non-transitory) computer-readable storage media (e.g., memory devices) encoded with software including computer-executable instructions, and when the software is executed (e.g., by one or more processors), it is operable to perform the operations described with reference to the method according to the first aspect of this disclosure.

[0115] The processor 510 reads and executes computer program instructions stored in the memory 520 to implement any of the intelligent water level detection methods for water conservancy projects in the above embodiments.

[0116] In one example, the electronic device may also include a communication interface 530 and a bus 540. Wherein, such as Figure 5 As shown, the processor 510, memory 520, and communication interface 530 are connected through bus 540 and complete communication with each other.

[0117] The communication interface 530 is mainly used to realize communication between various modules, devices, units and / or equipment in the embodiments of this application.

[0118] Bus 540 includes hardware, software, or both, that couples components of an online data traffic metering device together. For example, and not limitingly, the bus may include an Accelerated Graphics Port (AGP) or other graphics bus, an Enhanced Industry Standard Architecture (EISA) bus, a Front Side Bus (FSB), HyperTransport (HT) interconnect, an Industry Standard Architecture (ISA) bus, an Infinite Bandwidth Interconnect, a Low Pin Count (LPC) bus, a memory bus, a Microchannel Architecture (MCA) bus, a Peripheral Component Interconnect (PCI) bus, a PCI-Express (PCI-X) bus, a Serial Advanced Technology Attachment (SATA) bus, a Video Electronics Standards Association Local (VLB) bus, or other suitable buses, or combinations of two or more of these. Where appropriate, bus 540 may include one or more buses. Although specific buses are described and illustrated in embodiments of this application, any suitable bus or interconnect is contemplated herein.

[0119] This electronic device can execute the intelligent water level detection method for water conservancy projects as described in this application, thereby achieving a combination of... Figures 1 to 3 The method for intelligent water level detection in water conservancy projects is described.

[0120] Furthermore, in conjunction with the intelligent water level detection method for water conservancy projects in the above embodiments, this application embodiment can provide a computer-readable storage medium for implementation. This computer-readable storage medium stores computer program instructions; when these computer program instructions are executed by a processor, they implement any of the intelligent water level detection methods for water conservancy projects in the above embodiments.

[0121] It should be clarified that this application is not limited to the specific configurations and processes described above and shown in the figures. For the sake of brevity, detailed descriptions of known methods are omitted here. In the above embodiments, several specific steps are described and shown as examples. However, the method process of this application is not limited to the specific steps described and shown. Those skilled in the art can make various changes, modifications, and additions, or change the order of steps, after understanding the spirit of this application.

[0122] The functional blocks shown in the above-described structural diagram can be implemented as hardware, software, firmware, or a combination thereof. When implemented in hardware, they can be, for example, electronic circuits, application-specific integrated circuits (ASICs), appropriate firmware, plug-ins, function cards, etc. When implemented in software, the elements of this application are programs or code segments used to perform the required tasks. Programs or code segments can be stored on a machine-readable medium or transmitted over a transmission medium or communication link via data signals carried on a carrier wave. "Machine-readable medium" can include any medium capable of storing or transmitting information. Examples of machine-readable media include electronic circuits, semiconductor memory devices, ROM, flash memory, erasable ROM (EROM), floppy disks, CD-ROMs, optical disks, hard disks, fiber optic media, radio frequency (RF) links, etc. Code segments can be downloaded via computer networks such as the Internet, intranets, etc.

[0123] It should also be noted that the exemplary embodiments mentioned in this application describe methods or systems based on a series of steps or apparatus. However, this application is not limited to the order of the above steps; that is, the steps can be performed in the order mentioned in the embodiments, or in a different order, or several steps can be performed simultaneously.

[0124] The aspects of this application have been described above with reference to flowchart illustrations and / or block diagrams of methods, apparatus (systems), and computer program products according to embodiments of this application. It should be understood that each block in the flowchart illustrations and / or block diagrams, and combinations of blocks in the flowchart illustrations and / or block diagrams, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, or other programmable data processing apparatus to produce a machine such that these instructions, executable via the processor of the computer or other programmable data processing apparatus, enable the implementation of the functions / actions specified in one or more blocks of the flowchart illustrations and / or block diagrams. Such a processor can be, but is not limited to, a general-purpose processor, a special-purpose processor, a special application processor, or a field-programmable logic circuit. It is also understood that each block in the block diagrams and / or flowcharts, and combinations of blocks in the block diagrams and / or flowcharts, can also be implemented by dedicated hardware performing the specified functions or actions, or can be implemented by a combination of dedicated hardware and computer instructions.

[0125] The above description is merely a specific implementation of this application. Those skilled in the art will clearly understand that, for the sake of convenience and brevity, the specific working processes of the systems, modules, and units described above can be referred to the corresponding processes in the foregoing method embodiments, and will not be repeated here. It should be understood that the protection scope of this application is not limited thereto. Any person skilled in the art can easily conceive of various equivalent modifications or substitutions within the technical scope disclosed in this application, and these modifications or substitutions should all be covered within the protection scope of this application.

Claims

1. An intelligent water level detection method for hydraulic engineering, suitable for surge flow environments, characterized in that, The method includes: Multiple electrodes with dual working modes are arrayed in a direction perpendicular to the horizontal plane at a preset position downstream of the gate. The dual working modes include a sampling mode for collecting contact voltage signals and a reset mode for grounding the electrodes. The working mode of each electrode is switched cyclically at a preset period. An initial voltage sequence is acquired through the electrode, and the periodic voltage sequence generated in the reset mode is filtered out from the initial voltage sequence to obtain the target voltage sequence of each electrode. By differential calculation and threshold comparison, multiple voltage jump points are determined in the target voltage sequence, as well as the jump time, jump direction and jump amplitude corresponding to each voltage jump point, and a voltage jump event sequence for each electrode is generated. The voltage jump event sequence includes multiple voltage jump events, and each voltage jump event includes a voltage jump point and the corresponding jump time, jump direction and jump amplitude. Based on the voltage jump event sequence, the occurrence frequency, average interval duration, and amplitude statistics of the voltage jump events are calculated using a sliding time window to generate a time-domain feature vector sequence for each electrode. The time-domain feature vector sequence is input into the constructed state discrimination model to obtain the water level state sequence of each electrode. The state discrimination model includes non-contact state, surge state and continuous contact state. The state discrimination model is trained using a hidden Markov model based on training samples including historical surge feature vector sequences and corresponding labels. Water level monitoring information is determined based on the discrimination state at different times in the water level state sequence of the multiple electrodes.

2. The method according to claim 1, characterized in that, The method further includes: Obtain the rate of change of the gate opening; The step of inputting the time-domain feature vector sequence into the constructed state discrimination model to obtain the water level state sequence of each electrode includes: The state transition probability between different discrimination states in the state discrimination model is adjusted using the opening change rate. The time-domain feature vector sequence is input into the state discrimination model after the state transition probability is adjusted to obtain the water level state sequence of each electrode.

3. The method according to claim 2, characterized in that, The step of adjusting the state transition probability between different discriminative states in the state discrimination model using the opening change rate includes: Based on the opening change rate, a target surge probability coefficient corresponding to the opening change rate is determined in a preset mapping relationship between the opening change rate and the surge probability coefficient. The state transition probability in the state discrimination model, which is the transition from the uncontacted state or the continuous contact state to the surge state, is adjusted according to the target surge probability coefficient.

4. The method according to claim 1, characterized in that, Before determining multiple voltage jump points and the corresponding jump time, jump direction, and jump amplitude of each voltage jump point in the target voltage sequence through differential calculation and threshold comparison, and generating a voltage jump event sequence for each electrode, the method further includes: When the electrode switches from the acquisition mode to the reset mode, the discharge curve of the electrode is acquired; By calculating the time constant of the discharge curve and comparing it with a preset reference time constant, dirt level information is generated. Based on the dirt level information, a first voltage compensation factor corresponding to the dirt level information is determined in a preset mapping relationship between dirt level and voltage compensation factor. The amplitude in the target voltage sequence is adjusted using the first voltage compensation factor.

5. The method according to claim 4, characterized in that, Before determining multiple voltage jump points and the corresponding jump time, jump direction, and jump amplitude of each voltage jump point in the target voltage sequence through differential calculation and threshold comparison, and generating a voltage jump event sequence for each electrode, the method further includes: Obtain the water temperature data downstream of the gate; Based on the water temperature data, a second voltage compensation factor corresponding to the water temperature data is determined in a preset mapping relationship between temperature and voltage compensation factors. The step of adjusting the amplitude in the target voltage sequence using the first voltage compensation factor includes: The amplitude in the target voltage sequence is adjusted using the first voltage compensation factor and the second voltage compensation factor.

6. The method according to claim 1, characterized in that, The process involves determining multiple voltage jump points in the target voltage sequence through differential calculation and threshold comparison, along with the jump time, jump direction, and jump amplitude corresponding to each voltage jump point, to generate a voltage jump event sequence for each electrode, including: The target voltage sequence is differentially calculated to obtain the voltage change rate corresponding to each time point of the target voltage sequence, thereby generating a voltage change rate sequence; By comparing the voltage change rate with a preset change rate threshold, multiple candidate jump points are determined in the voltage change rate sequence; In the target voltage sequence, determine the voltage jump amplitude corresponding to each candidate jump point, and determine the candidate jump point whose voltage jump amplitude is greater than a preset amplitude threshold as the voltage jump point; In the target voltage sequence, the transition time, transition direction and transition amplitude corresponding to each voltage transition point are determined, and the voltage transition event sequence of each electrode is generated.

7. The method according to claim 1, characterized in that, The step of determining water level monitoring information based on the discrimination state at different times in the water level state sequence of the multiple electrodes includes: Calculate the duration of the discrimination state being the continuous contact state in the water level state sequence of each electrode, and determine that the electrode is in an effective contact state if the duration is greater than a preset time threshold; According to the deployment position, all the electrodes are traversed from bottom to top. When the target electrode is in the effective contact state and all the electrodes below the target electrode are in the effective contact state, the deployment height of the target electrode is determined as the water level monitoring information. The target electrode is any one of the electrodes.

8. An intelligent water level detection system for hydraulic engineering, suitable for surge flow environments, characterized in that, The system includes: The deployment module is used to deploy multiple electrodes with dual working modes in an array at a preset position downstream of the gate along a direction perpendicular to the horizontal plane. The dual working modes include a collection mode for collecting contact voltage signals and a reset mode for grounding the electrodes. The acquisition module is used to cyclically switch the working mode of each electrode at a preset period, acquire an initial voltage sequence through the electrode, and filter out the periodic voltage sequence generated in the reset mode from the initial voltage sequence to obtain the target voltage sequence of each electrode. The determination module is used to determine multiple voltage jump points in the target voltage sequence through differential calculation and threshold comparison, as well as the jump time, jump direction and jump amplitude corresponding to each voltage jump point, and generate a voltage jump event sequence for each electrode. The voltage jump event sequence includes multiple voltage jump events, and each voltage jump event includes a voltage jump point and the corresponding jump time, jump direction and jump amplitude. The calculation module is used to calculate the occurrence frequency, average interval duration and amplitude statistics of the voltage jump events based on the voltage jump event sequence using a sliding time window, and generate a time-domain feature vector sequence for each electrode. The calculation module is also used to input the time-domain feature vector sequence into the constructed state discrimination model to obtain the water level state sequence of each electrode. The state discrimination model includes non-contact state, surge state and continuous contact state. The state discrimination model is trained using a hidden Markov model based on training samples including historical surge feature vector sequences and corresponding labels. The determining module is further configured to determine water level monitoring information based on the discrimination state at different times in the water level state sequence of the multiple electrodes.

9. An electronic device, characterized in that, The device includes: a processor and a memory storing computer program instructions; When the processor executes the computer program instructions, it implements the intelligent water level detection method for water conservancy projects as described in any one of claims 1-7.

10. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores computer program instructions, which, when executed by a processor, implement the intelligent water level detection method for water conservancy projects as described in any one of claims 1-7.

Citation Information

Patent Citations

  • Control circuitry for water level control of pools

    CA1167136A

  • Self-powered water level monitoring device and method

    CN111307247A

  • Distributed electric contact water level gauge measuring system and control method thereof

    CN114646369A

  • Cleaning device, water tank, water level state detection method and storage medium

    CN116406993A

  • Water tank, water tank monitoring method and system, equipment, medium and program product

    CN118243194A

Cited By

  • Anti-overflow liquid level detection method based on multi-target tracking algorithm and water dispenser

    CN121877148A