A method, system, device and medium for measuring and controlling water level and flow of a dual-purpose channel
By employing measurement and control devices for benchmark calibration and real-time data processing in irrigation and drainage channels, combined with PID closed-loop control and flow formulas, the problems of low measurement and control accuracy and insufficient automation in bidirectional irrigation and drainage were solved, achieving efficient and accurate channel water resource management.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- NORTHWEST A & F UNIV
- Filing Date
- 2026-04-13
- Publication Date
- 2026-07-10
AI Technical Summary
Existing irrigation and drainage channel flow measurement and control devices have low accuracy and insufficient automation in bidirectional irrigation and drainage, and cannot adapt to periodic changes in water flow direction. Furthermore, the repeated construction of traditional equipment and frequent manual intervention lead to inconvenient operation and management and poor data continuity.
The system employs measurement and control devices for benchmark calibration, collects water level data in real time, performs outlier removal and smoothing filtering, identifies operating conditions through a weighted judgment algorithm, uses PID closed-loop control to adjust the gate opening, combines gate outflow and weir flow formulas to measure flow rate, and achieves local data storage and remote transmission, triggering early warnings and periodic self-calibration.
It has enabled efficient and accurate monitoring and control of water resources in irrigation and drainage channels, improved measurement accuracy and automation management, reduced manual intervention, and ensured data continuity and system stability.
Smart Images

Figure CN122363376A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of farmland irrigation and drainage technology, and in particular to a method, system, equipment and medium for measuring and controlling water level and flow in a dual-purpose irrigation and drainage channel. Background Technology
[0002] In farmland water conservancy projects, irrigation and drainage channels are key infrastructure for water resource regulation. Their measurement and control accuracy and operational efficiency directly affect the rational utilization of water resources and the stability of agricultural production. Traditional channel water measurement often uses devices such as fixed weirs and standard cross-section water level gauges. These devices are often designed for a single flow direction (irrigation or drainage) and are difficult to adapt to the complex working conditions of dual-purpose irrigation and drainage channels, such as periodic changes in water flow direction, large water level fluctuations, and high sediment content. In existing technologies, irrigation area water measurement mostly relies on independently installed irrigation water measurement equipment and drainage monitoring equipment. This not only results in redundant construction and increased costs, but also requires manual intervention or sensor replacement when the flow direction changes, leading to inconvenient operation and management and poor data continuity.
[0003] Currently, commonly used methods for measuring and controlling channel flow mainly include ultrasonic flow meters, electromagnetic flow meters, and weir and flume flow measurement systems. Although ultrasonic flow meters are suitable for open channels, they require multiple probes under bidirectional flow conditions, resulting in a complex structure and high installation requirements. While electromagnetic flow meters offer high measurement accuracy, they are not suitable for large-section open channels and are easily affected by the channel lining material. Traditional weir and flume flow measurement devices (such as Parshall flumes and triangular weirs) have simple structures, but they suffer from large head losses and are prone to siltation or blockage by debris under drainage conditions, affecting their accuracy. They also lack the ability to automatically adapt to changes in flow direction.
[0004] Furthermore, existing water level methods are mostly based on steady flow or single-direction models to establish water level-flow relationships. In irrigation and drainage channels, the flow pattern becomes non-constant due to changes in flow direction, reducing the applicability of traditional calibration formulas and significantly increasing measurement errors. At the same time, existing devices often lack integrated control functions, failing to achieve automatic gate adjustment or pump start / stop control based on flow data, thus hindering the automation and intelligent management level of irrigation and drainage systems. Summary of the Invention
[0005] The purpose of this invention is to provide a method, system, equipment, and medium for measuring and controlling water level and flow in a dual-purpose irrigation and drainage channel, aiming to solve or improve at least one of the above-mentioned technical problems.
[0006] To achieve the above objectives, the present invention provides the following solution: A method for measuring and controlling water level and flow rate in a dual-purpose irrigation and drainage channel, comprising: Set the initial state of the measurement and control device and perform benchmark calibration; the benchmark calibration includes power-on self-test, sensor zero-point calibration and coefficient calibration; The water level at the channel cross section was collected in real time using the calibrated monitoring and control device, and outlier removal and smoothing filtering were performed to obtain the pre-processed hydrological parameters. The preprocessed hydrological parameters are compared with preset thresholds, and the current operating condition is automatically identified through a weighted judgment algorithm; the current operating condition is either irrigation or drainage. Dual-model flow metering is performed based on the identified operating conditions, including calculating flow using the gate outflow formula under irrigation conditions and the weir flow formula under drainage conditions. Based on the preset operating conditions and the real-time calculated flow rate, water level regulation is achieved by adjusting the gate opening through PID closed-loop control. The system collects real-time data on channel cross-section water level, flow rate calculation results, and equipment status, stores them locally, and transmits them remotely. It also triggers early warnings when sensor data is abnormal, equipment malfunctions, or the channel exceeds the warning water level. Optimize the thresholds and gate control parameters used for operating condition identification based on historical operating data, and trigger automatic sensor calibration periodically.
[0007] Optionally, the process for identifying the current operating condition is as follows: When the real-time collected channel cross-section water level h ≤ design irrigation water level and the flow rate Q ≤ irrigation flow rate threshold, it is determined to be an irrigation condition. When the real-time collected channel cross-section water level h > drainage warning water level and the flow rate Q > drainage flow rate threshold, it is determined to be a drainage working condition. When the parameter is within the preset transition threshold range, a sliding window weighted average algorithm is used to dynamically determine the condition, and the working condition switching lag time is set to ≥30s.
[0008] Optionally, the specific calculation method for the dual-model flow meter is as follows: Under irrigation conditions, the outflow formula for the gate is adopted: in, Q The free outflow rate of the gate orifice is expressed in cubic meters per second (m³). 3 / s; The flow coefficient of the gate outlet; b The effective width of the gate for water retention is measured in meters (m). e This refers to the gate opening, expressed in meters (m). g This is the acceleration due to gravity, measured in m / s². 2 ; H 0 represents the total head of water upstream of the sluice gate, in meters (m). , H The upstream head is measured in meters (m). This is the kinetic energy correction factor. v 0 represents the approach velocity, in m / s; Under drainage conditions, the formula for rectangular thin-walled weir flow is adopted: Where Q is the flow rate through the weir, in m³ / s. 3 / s; m denoted as ρ, where ρ is the free outflow coefficient of a rectangular thin-walled weir; b is the effective width of the weir flow in meters (m); and g is the acceleration due to gravity (m / s²). 2 H0 represents the total head of water on the weir, in meters (m).
[0009] When the operating condition judgment result changes, the switch is completed within 60 seconds, and the flow data before and after the switch is smoothed and filtered.
[0010] Optionally, the water level regulation process includes: Under irrigation conditions, with the goal of maintaining a constant water level in the canal, when the actual water level is lower than the set target water level, the gate is controlled to open to the set opening degree, and when the actual water level is higher than the set target water level, the gate is controlled to descend to the set opening degree. In drainage operation, when the water level reaches the set warning level, the gate is fully opened. When the water level drops to the set safe level, the flow control mode is switched. When the water level reaches the set extreme threshold, the emergency full opening mechanism is triggered. The gate opening adjustment response time is ≤5s.
[0011] Optionally, the automatic calibration process is as follows: Based on hydrological parameters obtained from long-term operation, reinforcement learning algorithms are used to optimize the operating condition identification threshold and gate control parameters, and automatic sensor calibration is triggered every 3 months. The flow coefficient and water level zero point are corrected by combining historical data. When the photovoltaic power supply in the monitoring and control device is interrupted, the energy storage battery automatically switches to power supply to ensure the core equipment operates for ≥72 hours, and when the battery power is exhausted, the control gate automatically resets to the set safe opening degree.
[0012] This invention also provides a water level and flow rate monitoring and control system for a dual-purpose irrigation and drainage channel, which applies the method described above, including: The photovoltaic power supply and support module, including photovoltaic panel components, energy storage battery packs, support columns and concrete base, is used to provide power supply for the system; The intelligent measurement, control, and communication module includes a sealed measurement and control enclosure, housing a core control unit, a data acquisition unit, a wireless communication unit, and a human-machine interface. It is used to execute local algorithm control, enabling bidirectional data interaction between local logic control and a remote platform, and supports remote parameter configuration, status monitoring, and fault early warning. The local algorithm control includes: The initial state of the monitoring and control device is set, and a benchmark calibration is performed. The benchmark calibration includes power-on self-test, sensor zero-point calibration, and coefficient calibration. The calibrated monitoring and control device is used to collect the channel cross-section water level in real time, and outlier removal and smoothing filtering are performed to obtain pre-processed hydrological parameters. The pre-processed hydrological parameters are compared with preset thresholds, and the current operating condition is automatically identified through a weighted judgment algorithm. The current operating condition is either irrigation or drainage. Dual-model flow measurement is performed according to the identified operating condition, including calculating the flow rate using the gate outflow formula under irrigation conditions and the weir flow formula under drainage conditions. Based on the preset operating condition target and the real-time calculated flow rate, the gate opening is adjusted through PID closed-loop control to achieve water level regulation. The real-time collected channel cross-section water level, flow calculation results, and equipment status are stored locally and transmitted remotely, and an early warning is triggered when sensor data is abnormal, equipment malfunctions, or the channel exceeds the warning water level. The threshold and gate regulation parameters used for operating condition identification are optimized based on historical operating data, and automatic sensor calibration is triggered periodically. The gate drive and execution module, including a lifting drive mechanism and a bidirectional sealing gate, is used to adjust the flow area of the channel by adjusting the valve opening, and is suitable for both irrigation and drainage.
[0013] The present invention also provides an electronic device, including a memory and a processor, wherein the memory is used to store a computer program, and the processor runs the computer program to enable the electronic device to perform the water level and flow rate measurement and control method for irrigation and drainage channels as described above.
[0014] The present invention also provides a computer-readable storage medium storing a computer program, which, when executed by a processor, implements the water level and flow rate measurement and control method for irrigation and drainage channels as described above.
[0015] According to specific embodiments provided by the present invention, the present invention discloses the following technical effects: This invention discloses a method, system, equipment, and medium for measuring and controlling water level and flow in a dual-purpose irrigation and drainage channel. The method includes initializing the measurement and control device and completing benchmark calibration, including self-testing, sensor zero-point calibration, and coefficient calibration. Water level is collected in real time, pre-processed, and compared with a threshold. Irrigation or drainage conditions are identified through weighted judgment, and flow is measured using either gate outflow or weir flow formulas, respectively. PID closed-loop control is used to adjust the gate opening to achieve water level regulation. Data is stored locally and transmitted remotely, triggering early warnings in case of anomalies, and optimizing parameters and performing periodic self-calibration based on historical data. This invention solves the problems of low accuracy and insufficient automation in existing bidirectional flow measurement technologies, thereby achieving efficient and accurate measurement, control, and management of water resources in irrigation and drainage channels. Attached Figure Description
[0016] To more clearly illustrate the technical solutions in the embodiments of the present invention or the prior art, the drawings used in the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0017] Figure 1 This is an isometric view of the irrigation and drainage channel monitoring and control device in this embodiment; Figure 2 This is a front view of the irrigation and drainage dual-purpose channel monitoring and control device in this embodiment; Figure 3 This is a left view of the irrigation and drainage dual-purpose channel monitoring and control device in this embodiment; Figure 4 This is a top view of the irrigation and drainage dual-purpose channel monitoring and control device in this embodiment; Figure 5 This is a flowchart of the water level and flow rate measurement and control method for the irrigation and drainage dual-purpose channel in this embodiment.
[0018] Reference numerals in the attached drawings: 1. Side wall of the device; 2. Channel gate pier; 3. Gate plate; 4. Gate frame; 5. Triangular plate; 6. Measurement and control box; 7. Solar panel; 8. Reverse slope; 9. Water stop strip; 10. Fastener; 11. Screw rod; 12. Slide rail; 13. Adjustable mounting bracket. Detailed Implementation
[0019] The technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.
[0020] The purpose of this invention is to provide a method, system, equipment, and medium for measuring and controlling water level and flow in a dual-purpose irrigation and drainage channel, aiming to solve or improve at least one of the above-mentioned technical problems.
[0021] To make the above-mentioned objects, features and advantages of the present invention more apparent and understandable, the present invention will be further described in detail below with reference to the accompanying drawings and specific embodiments.
[0022] As a first aspect, the present invention provides a method for measuring and controlling water level and flow rate in a dual-purpose irrigation and drainage channel, comprising: Step 1: Set the initial state of the measurement and control device and perform benchmark calibration; the benchmark calibration includes power-on self-test, sensor zero-point calibration and coefficient calibration.
[0023] Step 2: Use the calibrated monitoring and control device to collect the water level of the channel section in real time, and perform outlier removal and smoothing filtering to obtain the pre-processed hydrological parameters.
[0024] Step 3: Compare the preprocessed hydrological parameters with preset thresholds, and automatically identify the current working condition through a weighted judgment algorithm; the current working condition is irrigation or drainage.
[0025] The process for identifying the current operating condition is as follows: When the real-time collected channel cross-section water level h ≤ design irrigation water level and the flow rate Q ≤ irrigation flow rate threshold, it is determined to be irrigation operation; when the real-time collected channel cross-section water level h > drainage warning water level and the flow rate Q > drainage flow rate threshold, it is determined to be drainage operation.
[0026] When the parameter is within the preset transition threshold range, a sliding window weighted average algorithm is used to dynamically determine the condition, and the working condition switching lag time is set to ≥30s.
[0027] As a specific implementation method, the specific calculation method for the dual-model flow meter is as follows: Under irrigation conditions, the outflow formula for the gate is adopted: in, Q The free outflow rate of the gate orifice is expressed in cubic meters per second (m³). 3 / s; The flow coefficient of the gate outlet; b The effective width of the gate for water retention is measured in meters (m). e This refers to the gate opening, expressed in meters (m). g This is the acceleration due to gravity, measured in m / s². 2 ; H 0 represents the total head of water upstream of the sluice gate, in meters (m). , H The upstream head is measured in meters (m). This is the kinetic energy correction factor. v 0 represents the approach velocity, in m / s; Under drainage conditions, the formula for rectangular thin-walled weir flow is adopted: Where Q is the flow rate through the weir, in m³ / s. 3 / s; m denoted as ρ, where ρ is the free outflow coefficient of a rectangular thin-walled weir; b is the effective width of the weir flow in meters (m); and g is the acceleration due to gravity (m / s²). 2 H0 represents the total head of water on the weir, in meters (m).
[0028] When the operating condition judgment result changes, the switch is completed within 60 seconds, and the flow data before and after the switch is smoothed and filtered.
[0029] Step 4: Perform dual-model flow measurement based on the identified operating conditions, including calculating the flow rate using the gate outflow formula under irrigation conditions and the weir flow formula under drainage conditions.
[0030] Step 5: Based on the preset operating condition target and the real-time calculated flow rate, the water level is regulated by adjusting the gate opening through PID closed-loop control. The water level regulation process includes: Under irrigation conditions, with the goal of maintaining a constant water level in the channel, when the actual water level is lower than the set target water level, the gate is controlled to open to the set opening degree; when the actual water level is higher than the set target water level, the gate is controlled to lower to the set opening degree. Under drainage conditions, when the water level reaches the set warning water level, the gate is controlled to open fully; when the water level drops to the set safe water level, the flow control mode is switched; when the water level reaches the set extreme threshold, the emergency full opening mechanism is triggered. The gate opening adjustment response time is ≤5s.
[0031] Step 6: Store the real-time collected channel cross-section water level, flow calculation results and equipment status locally and transmit them remotely, and trigger an early warning when sensor data is abnormal, equipment malfunctions or the channel exceeds the warning water level.
[0032] Step 7: Optimize the threshold and gate control parameters used for operating condition identification based on historical operating data, and periodically trigger automatic sensor calibration. The automatic calibration process is as follows: Based on hydrological parameters obtained from long-term operation, reinforcement learning algorithms are used to optimize the operating condition identification threshold and gate control parameters. Sensors are automatically calibrated every 3 months, and the flow coefficient and water level zero point are corrected by combining historical data. When the photovoltaic power supply in the monitoring and control device is interrupted, the energy storage battery automatically switches to power supply to ensure that the core equipment operates for ≥72 hours. When the battery power is exhausted, the gate is automatically reset to the set safe opening degree.
[0033] In addition, this method also supports: 1. Local storage: The control box has a built-in industrial-grade SD card to store raw hydrological data, flow calculation results, and gate operation records. The storage period is ≥1 year, and it supports data export and retrospective analysis.
[0034] 2. Remote transmission: Real-time data, cumulative flow, and device status are uploaded to the water resource management platform via LoRa / 4G dual-mode communication unit. The transmission interval is configurable and supports resume transmission after interruption.
[0035] 3. Anomaly warning: When sensor data is abnormal, equipment malfunctions, or the channel exceeds the warning water level, a local audible and visual warning and a remote platform alarm are triggered, and a fault log is recorded to facilitate operation and maintenance troubleshooting.
[0036] As a second aspect, the present invention also provides a water level and flow rate monitoring and control system for a dual-purpose irrigation and drainage channel, which applies the method described above, including: The photovoltaic power supply and support module includes photovoltaic panel components, energy storage battery packs, support columns and concrete bases, which are used to provide power supply for the system.
[0037] The intelligent measurement, control, and communication module includes a sealed measurement and control enclosure, housing a core control unit, a data acquisition unit, a wireless communication unit, and a human-machine interface. It is used to execute local algorithm control, enabling bidirectional data interaction between local logic control and a remote platform, and supports remote parameter configuration, status monitoring, and fault early warning. The local algorithm control includes: The initial state of the monitoring and control device is set, and a benchmark calibration is performed. The benchmark calibration includes power-on self-test, sensor zero-point calibration, and coefficient calibration. The calibrated monitoring and control device is used to collect the channel cross-section water level in real time, and outlier removal and smoothing filtering are performed to obtain pre-processed hydrological parameters. The pre-processed hydrological parameters are compared with preset thresholds, and the current operating condition is automatically identified through a weighted judgment algorithm. The current operating condition is either irrigation or drainage. Dual-model flow measurement is performed according to the identified operating condition, including calculating the flow rate using the gate outflow formula under irrigation conditions and the weir flow formula under drainage conditions. Based on the preset operating condition target and the real-time calculated flow rate, the gate opening is adjusted through PID closed-loop control to achieve water level regulation. The real-time collected channel cross-section water level, flow calculation results, and equipment status are stored locally and transmitted remotely, and an early warning is triggered when sensor data is abnormal, equipment malfunctions, or the channel exceeds the warning water level. The threshold and gate regulation parameters used for operating condition identification are optimized based on historical operating data, and automatic sensor calibration is triggered periodically. The gate drive and execution module, including a lifting drive mechanism and a bidirectional sealing gate, is used to adjust the flow area of the channel by adjusting the valve opening, and is suitable for both irrigation and drainage.
[0038] As a specific implementation method, such as... Figures 1-4 The measurement and control device shown.
[0039] First, the photovoltaic power supply and support module includes: Photovoltaic data collection unit: An adjustable solar panel 7 is installed on the top and connected to the support column through a hinge mechanism. The tilt angle can be adaptively adjusted according to the angle of sunlight to improve the solar energy conversion efficiency. It is equipped with a built-in energy storage battery pack to achieve 24-hour continuous power supply in the field without external power supply.
[0040] Support and base unit: High-strength galvanized steel columns are used as the main support structure, and an integrated concrete base is cast at the bottom. It is installed in conjunction with the side wall of the channel to ensure the structural stability of the device under harsh conditions such as strong winds and floods.
[0041] Secondly, the intelligent measurement, control, and communication module includes: Measurement and control box 6: A sealed measurement and control box is set in the middle, which is fixedly connected to the side wall 1 of the device and the slotted gate pier 2 through the adjustable mounting bracket 13. All connection points are locked with fasteners 10. The box adopts IP67 waterproof and dustproof design, and has a built-in core control unit (industrial-grade PLC), data acquisition unit (integrated water level and pressure sensor interface), wireless communication unit (LoRa / 4G dual-mode transmission) and local human-machine interface.
[0042] Data processing unit: It analyzes hydrological data in real time through edge computing algorithms, realizes two-way data interaction between local logic control and remote platform, and supports remote parameter configuration, status monitoring and fault early warning.
[0043] Furthermore, the gate drive and execution module includes: Lifting drive mechanism: adopts a combined lifting structure of lead screw 11 and connecting rod (e.g. Figure 1 The vertical transmission component drives the gate 3 to move up and down precisely via a servo motor, with a stroke control accuracy of ±1mm, adapting to the flow area adjustment requirements of different channel cross-sections.
[0044] Two-way sealing gate: The gate body consists of a gate frame 4 and a gate plate 3. The gate plate is made of 304 stainless steel and has a water-stop strip 9 embedded at the bottom. The gate frame is equipped with slide rails 12 on both sides, and the gate plate moves vertically up and down along the slide rails. The bottom is equipped with a reverse slope 8. The gate frame and the trough gate pier 2 are reinforced by triangular plates 5 and fasteners 10. It has a two-way water-stop function and can simultaneously meet the sealing requirements of irrigation forward water flow and drainage reverse water flow, avoiding channel leakage and loss.
[0045] Finally, the data processing unit also includes a hydrological monitoring subunit and a flow calculation subunit. The hydrological monitoring subunit is used to deploy radar water level gauges at the channel cross-section to collect water level data in real time. The flow calculation subunit is used to: integrate the gate outflow formula and the weir flow formula, automatically switch the calculation model for irrigation (low flow, stable flow) and drainage (high flow, fluctuating flow) dual working conditions, and control the flow measurement error within ±3%.
[0046] As a third aspect, the present invention also provides an electronic device, including a memory and a processor, wherein the memory is used to store a computer program, and the processor runs the computer program to enable the electronic device to perform the water level and flow rate measurement and control method for irrigation and drainage channels as described above.
[0047] As a fourth aspect, the present invention also provides a computer-readable storage medium storing a computer program that, when executed by a processor, implements the water level and flow rate measurement and control method for irrigation and drainage channels as described above.
[0048] The various embodiments in this specification are described in a progressive manner, with each embodiment focusing on the differences from other embodiments. The same or similar parts between the various embodiments can be referred to each other.
[0049] This document uses specific examples to illustrate the principles and implementation methods of the present invention. The descriptions of the above embodiments are only for the purpose of helping to understand the core ideas of the present invention. Furthermore, those skilled in the art will recognize that, based on the ideas of the present invention, there will be changes in the specific implementation methods and application scope. Therefore, the content of this specification should not be construed as a limitation of the present invention.
Claims
1. A method for measuring and controlling water level and flow rate in a dual-purpose irrigation and drainage channel, characterized in that, include: Set the initial state of the measurement and control device and perform benchmark calibration; The benchmark calibration includes power-on self-test, sensor zero-point calibration, and coefficient calibration. The water level at the channel cross section was collected in real time using the calibrated monitoring and control device, and outlier removal and smoothing filtering were performed to obtain the pre-processed hydrological parameters. The preprocessed hydrological parameters are compared with preset thresholds, and the current working condition is automatically identified through a weighted judgment algorithm. The current operating condition is either irrigation or drainage. Dual-model flow metering is performed based on the identified operating conditions, including calculating flow using the gate outflow formula under irrigation conditions and the weir flow formula under drainage conditions. Based on the preset operating conditions and the real-time calculated flow rate, water level regulation is achieved by adjusting the gate opening through PID closed-loop control. The system collects real-time data on channel cross-section water level, flow rate calculation results, and equipment status, stores them locally, and transmits them remotely. It also triggers early warnings when sensor data is abnormal, equipment malfunctions, or the channel exceeds the warning water level. Optimize the thresholds and gate control parameters used for operating condition identification based on historical operating data, and trigger automatic sensor calibration periodically.
2. The method for measuring and controlling water level and flow rate in a dual-purpose irrigation and drainage channel according to claim 1, characterized in that, The process for identifying the current operating condition is as follows: When the real-time collected channel cross-section water level h ≤ design irrigation water level and the flow rate Q ≤ irrigation flow rate threshold, it is determined to be an irrigation condition. When the real-time collected channel cross-section water level h > drainage warning water level and the flow rate Q > drainage flow rate threshold, it is determined to be a drainage working condition. When the parameter is within the preset transition threshold range, a sliding window weighted average algorithm is used to dynamically determine the condition, and the working condition switching lag time is set to ≥30s.
3. The method for measuring and controlling water level and flow rate in a dual-purpose irrigation and drainage channel according to claim 2, characterized in that, The specific calculation method for the dual-model flow metering is as follows: Under irrigation conditions, the outflow formula for the gate is adopted: in, Q The free outflow rate of the gate orifice is expressed in cubic meters per second (m³). 3 / s; The flow coefficient of the gate outlet; b The effective width of the gate for water retention is measured in meters (m). e This refers to the gate opening, expressed in meters (m). g This is the acceleration due to gravity, measured in m / s². 2 ; H 0 represents the total head of water upstream of the sluice gate, in meters (m). , H The upstream head is measured in meters (m). This is the kinetic energy correction factor. v 0 represents the approach velocity, in m / s; Under drainage conditions, the formula for rectangular thin-walled weir flow is adopted: Where Q is the flow rate through the weir, in m³ / s. 3 / s; m denoted as ρ, where ρ is the free outflow coefficient of a rectangular thin-walled weir; b is the effective width of the weir flow in meters (m); and g is the acceleration due to gravity (m / s²). 2 H0 represents the total head above the weir, in meters (m). When the operating condition judgment result changes, the switch is completed within 60 seconds, and the flow data before and after the switch is smoothed and filtered.
4. The method for measuring and controlling water level and flow rate in a dual-purpose irrigation and drainage channel according to claim 1, characterized in that, The water level regulation process includes: Under irrigation conditions, with the goal of maintaining a constant water level in the canal, when the actual water level is lower than the set target water level, the gate is controlled to open to the set opening degree, and when the actual water level is higher than the set target water level, the gate is controlled to descend to the set opening degree. In drainage operation, when the water level reaches the set warning level, the gate is fully opened. When the water level drops to the set safe level, the flow control mode is switched. When the water level reaches the set extreme threshold, the emergency full opening mechanism is triggered. The gate opening adjustment response time is ≤5s.
5. The method for measuring and controlling water level and flow rate in a dual-purpose irrigation and drainage channel according to claim 1, characterized in that, The automatic calibration process is as follows: Based on hydrological parameters obtained from long-term operation, reinforcement learning algorithms are used to optimize the operating condition identification threshold and gate control parameters, and automatic sensor calibration is triggered every 3 months. The flow coefficient and water level zero point are corrected by combining historical data. When the photovoltaic power supply in the monitoring and control device is interrupted, the energy storage battery automatically switches to power supply to ensure the core equipment operates for ≥72 hours, and when the battery power is exhausted, the control gate automatically resets to the set safe opening degree.
6. A water level and flow rate monitoring and control system for a dual-purpose irrigation and drainage channel, using the method described in any one of claims 1-5, characterized in that, include: The photovoltaic power supply and support module, including photovoltaic panel components, energy storage battery packs, support columns and concrete base, is used to provide power supply for the system; The intelligent measurement, control, and communication module includes a sealed measurement and control enclosure, housing a core control unit, a data acquisition unit, a wireless communication unit, and a human-machine interface. It is used to execute local algorithm control, enabling bidirectional data interaction between local logic control and a remote platform, and supports remote parameter configuration, status monitoring, and fault early warning. The local algorithm control includes: The initial state of the monitoring and control device is set, and a benchmark calibration is performed. The benchmark calibration includes power-on self-test, sensor zero-point calibration, and coefficient calibration. The calibrated monitoring and control device is used to collect the channel cross-section water level in real time, and outlier removal and smoothing filtering are performed to obtain pre-processed hydrological parameters. The pre-processed hydrological parameters are compared with preset thresholds, and the current operating condition is automatically identified through a weighted judgment algorithm. The current operating condition is either irrigation or drainage. Dual-model flow measurement is performed according to the identified operating condition, including calculating the flow rate using the gate outflow formula under irrigation conditions and the weir flow formula under drainage conditions. Based on the preset operating condition target and the real-time calculated flow rate, the gate opening is adjusted through PID closed-loop control to achieve water level regulation. The real-time collected channel cross-section water level, flow calculation results, and equipment status are stored locally and transmitted remotely, and an early warning is triggered when sensor data is abnormal, equipment malfunctions, or the channel exceeds the warning water level. The threshold and gate regulation parameters used for operating condition identification are optimized based on historical operating data, and automatic sensor calibration is triggered periodically. The gate drive and execution module, including a lifting drive mechanism and a bidirectional sealing gate, is used to adjust the flow area of the channel by adjusting the valve opening, and is suitable for both irrigation and drainage.
7. An electronic device, characterized in that, The device includes a memory and a processor, wherein the memory stores a computer program and the processor runs the computer program to enable the electronic device to perform the water level and flow rate measurement and control method for irrigation and drainage channels according to any one of claims 1-5.
8. A computer-readable storage medium, characterized in that, It stores a computer program, which, when executed by a processor, implements the method for measuring and controlling the water level and flow rate of a dual-purpose irrigation and drainage channel as described in any one of claims 1-5.