Canal water resource self-adjusting flow detection mechanism
Through the integrated software and hardware system and support vector machine model, the measurement error problem of the self-regulating flow detection mechanism of river water resources under complex water conditions has been solved, and the accuracy and intelligence level of detection have been improved.
Patent Information
- Application Number
- CN202410523601.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-04-28
- Publication Date
- 2024-09-10
- Estimated Expiration
- 2044-04-28
AI Technical Summary
The existing self-regulating flow detection mechanism of river water resources still has measurement errors under complex water conditions, which affects the accuracy and stability of detection.
Using an integrated software and hardware system, including flow sensors, water level sensors, signal conditioning circuits, microcontroller circuits, display and alarm circuits, communication modules, power management circuits and cloud servers, the support vector machine is used to analyze the relationship between the water level and flow sensor output signals. Correlation, fit the mathematical model, calculate and correct the flow detection deviation, and realize flow self-regulation.
It effectively solves the problem of measurement errors under complex water conditions, improves the stability and accuracy of flow detection, and enhances the system's intelligence level and remote management capabilities.
Smart Images

Figure SMS_9 
Figure SMS_1 
Figure SMS_2
Abstract
Description
Technical Field
[0001] The invention belongs to the technical field of water resource regulation, and in particular relates to a canal water resource self-regulating flow detection mechanism. Background Art
[0002] The existing "self-regulating flow detection mechanism for river water resources" is a design that aims to reduce the impact of water level changes on detection. Generally, the size of the drainage outlet is adaptively adjusted to adjust the flow rate according to the real-time water level. In conjunction with the water level detection float and uniform damping control components, the measurement error caused by water level changes can be reduced to a certain extent, and the accuracy and stability of flow detection can be improved. However, even with this self-regulating mechanism, there is still a certain measurement error under complex water conditions. Summary of the invention
[0005] In order to solve the above technical problems, the basic concept of the technical solution adopted by the present invention is:
[0006] The canal water resources self-regulating flow detection agency includes the canal water resources self-regulating flow detection agency, including:
[0007] Flow sensor, water level sensor, signal conditioning circuit, single-chip circuit, display and alarm circuit, communication module, power management circuit, cloud server. The signal conditioning circuit is used to amplify, filter and convert the original signal output by the sensor, and convert it into a standardized signal processed by the single-chip microcomputer; the single-chip microcomputer circuit is used to receive the signals of each sensor and perform data processing, including flow calculation and water level control logic judgment; the communication module is used to transmit data to the cloud server; the power management circuit is used to power the entire system; the flow sensor and the water level sensor are respectively connected to the signal conditioning circuit to convert the physical signal into an electrical signal;
[0008] The signal output by the signal conditioning circuit is read and processed by the single-chip microcomputer; the single-chip microcomputer controls the working status of the display and alarm circuit according to the processing results, and uploads the data to the cloud server through the communication module; the cloud server calculates the deviation of the water flow sensor detection according to the water level of the canal and the flow measured by the water flow sensor, and calculates the actual flow detected by the water flow sensor based on the deviation of the water flow sensor detection, and self-adjusts the flow measured by the water flow sensor.
[0009] Preferably, the flow sensor includes a turbine flow sensor and an ultrasonic flow sensor.
[0010] Water level sensors include capacitive water level sensors and float type liquid level sensors.
[0011] The single-chip microcomputer circuits include STM32, Arduino, and 51 single-chip microcomputers.
[0012] Preferably, the power management circuit includes a battery, a solar charging system or an AC / DC power conversion module.
[0013] Preferably, the cloud server calculates the deviation of the water flow sensor detection according to the water level of the canal and the flow measured by the water flow sensor, calculates the real flow detected by the water flow sensor based on the deviation detected by the water flow sensor, and self-regulates the flow measured by the water flow sensor, specifically including:
[0014] Collect the actual flow data of the turbine flow sensor or ultrasonic flow sensor under different water level conditions, and record the water level value detected by the water level sensor; use the support vector machine to analyze the correlation between the water level and the output signal of the flow sensor, and fit the mathematical model between the water level and the flow sensor detection deviation;
[0015] The constructed mathematical model is deployed on the cloud server. When the on-site water level and flow data are received, the cloud server calculates the flow detection deviation that may be generated under the current water level based on the model; according to the deviation correction formula, the flow reading is adjusted to obtain the actual flow data.
[0016] Preferably, the correlation between the water level and the output signal of the flow sensor is analyzed by a support vector machine, and a mathematical model between the water level and the detection deviation of the flow sensor is fitted, the steps are:
[0017] Build the SVR model, set the kernel function, regularization parameter C, and parameter ε of the ε-insensitive loss function;
[0018] Using the training data set, the optimal solution of SVR is solved by Lagrange multiplier method to obtain the best decision function;
[0019] Use cross-validation or an independent test set to evaluate the performance of the trained SVR model to see how well the predictions match the true deviations;
[0020] Using the SVR model, input the real-time water level data, and the model will output the expected flow sensor measurement deviation;
[0021] The target of SVR is the function f(x)=w·φ(x)+b, where x represents the water level, φ(x) is the high-dimensional feature vector after being mapped by the kernel function, and w and b are the weight vector and bias term of the model respectively.
[0022] Preferably, the kernel function is a radial basis function RBF.
[0023] The performance of the trained SVR model was evaluated using cross validation or an independent test set. The evaluation indicators included mean square error and determination coefficient.
[0024] Compared with the prior art, the present invention has the following beneficial effects:
[0025] This application uses advanced software and hardware combination technology and modern data mining and machine learning methods to accurately calibrate flow detection results, effectively solving the measurement error problem under complex water conditions, improving the stability and accuracy of flow detection, and enhancing the system's intelligence level and remote management capabilities. DETAILED DESCRIPTION
[0026] In order to make the purpose, technical solutions and advantages of the embodiments of the present invention clearer, the technical solutions in the embodiments will be clearly and completely described below. The following embodiments are used to illustrate the present invention.
[0027] The present application discloses a canal water resource self-regulating flow detection mechanism, comprising:
[0028] Flow sensor:
[0029] Turbine flow sensor: The turbine rotates driven by the water flow, and the built-in magnet triggers the Hall effect sensor or photoelectric coupler once every rotation, outputting a corresponding pulse signal, which is proportional to the amount of water flowing;
[0030] Ultrasonic flow sensor: It measures the fluid velocity by transmitting and receiving ultrasonic waves, and then calculates the flow rate, including transmitting circuit, receiving circuit and signal processing circuit;
[0031] Water level sensor:
[0032] Capacitive water level sensor: used to detect the water level in the canal. Changes in water level will cause changes in the sensor capacitance value, which is converted into a voltage or frequency signal through a conversion circuit;
[0033] Float-type liquid level sensor: Using a reed switch or a resistive sensor, the float floats with the water level, driving the internal components to change state and output electrical signals;
[0034] Signal conditioning circuit:
[0035] Amplify, filter and convert the original signal output by the sensor, and convert it into a standardized signal processed by the microcontroller;
[0036] Microcontroller circuit:
[0037] Such as STM32, Arduino or 51 series single-chip microcomputer, the single-chip microcomputer circuit is responsible for receiving the signals from various sensors and performing data processing, including flow calculation, water level control logic judgment, and may execute control commands for valves or pump equipment;
[0038] Display and alarm circuit:
[0039] Set up an LCD or LED display to display flow and water level information in real time;
[0040] Set a buzzer or indicator light to sound an alarm when the flow exceeds a preset threshold or an abnormality occurs;
[0041] Communication module:
[0042] Use wireless transmission modules (such as GPRS, LoRa, NB-IoT) or wired communication interfaces (RS-485, Ethernet) to transmit data to the cloud server;
[0043] Power management circuit:
[0044] The power management circuit provides power to the entire system, and the power management circuit includes a battery, a solar charging system, or an AC / DC power conversion module;
[0045] The connection relationship between the various parts is as follows:
[0046] The flow sensor and water level sensor are respectively connected to the signal conditioning circuit to convert the physical signal into an electrical signal; the signal output by the signal conditioning circuit is read and processed by the single chip microcomputer; the single chip microcomputer controls the working state of the display and alarm circuit according to the processing result, and uploads the data to the cloud server through the communication module;
[0047] The cloud server calculates the deviation of the water flow sensor detection according to the water level of the canal and the flow measured by the water flow sensor. Based on the deviation of the water flow sensor detection, it calculates the actual flow detected by the water flow sensor and self-adjusts the flow measured by the water flow sensor.
[0048] Since water level changes will affect factors such as the velocity distribution and flow channel cross-sectional area of the fluid, and thus affect the measurement accuracy of the flow sensor, the cloud server calculates the deviation of the water flow sensor detection based on the canal water level and the flow measured by the water flow sensor. Based on the deviation of the water flow sensor detection, the cloud server calculates the actual flow detected by the water flow sensor and self-adjusts the flow measured by the water flow sensor. Specifically, the following are performed:
[0049] 1. Data collection phase:
[0050] Collect the actual flow data of the turbine flow sensor or ultrasonic flow sensor corresponding to different water level conditions, and record the water level value detected by the water level sensor;
[0051] At the same time, it is also necessary to collect data under known standard flow as a benchmark to compare and analyze deviations; 2. Data analysis stage:
[0052] The correlation between the water level and the output signal of the flow sensor is analyzed by support vector machine, and the mathematical model between the water level and the flow sensor detection deviation is fitted; the support vector regression (SVR) method in the support vector machine (SVM) is used to analyze the relationship between the water level and the output signal of the flow sensor and establish a mathematical model. The steps are as follows:
[0053] Construct an SVR model, set the kernel function (such as radial basis function RBF), regularization parameter C, and parameter ε of the ε-insensitive loss function;
[0054] Using the training data set, the optimal solution of SVR is solved by the Lagrange multiplier method to obtain the best decision function (i.e., model);
[0055] Use cross-validation or independent test sets to evaluate the performance of the trained SVR model to see how well the prediction results match the actual deviation. The evaluation indicators include mean square error (MSE), determination coefficient (R 2 ); using the SVR model, input the real-time water level data, and the model will output the expected flow sensor measurement deviation; the target of SVR is the function f(x) = w·φ(x)+b, where x represents the water level, φ(x) is the high-dimensional feature vector after kernel function mapping, w and b are the weight vector and bias term of the model respectively.
[0056] Steps to use support vector regression (SVR) to analyze the relationship between water level and flow sensor output signals and establish a model: The SVR model is a generalized nonlinear regression model whose goal is to minimize the following optimization problem:
[0057]
[0058] sty i -f(x i )≤ε+ξ i
[0059]
[0060] in,
[0061] xi is the water level observation value of the i-th sample,
[0062] yi is the true value of the corresponding flow sensor output,
[0063] f(x)=<w,φ(x)> +b is the ideal decision function we are looking for, w is the weight vector, b is the bias term, φ(x) is the feature vector that maps the input space to the high-dimensional feature space through the kernel function K(x,x′)=φ(x)Tφ(x′),
[0064] ε is the threshold of the ε-insensitive loss function,
[0065] ξi and ξi * are the slack variables in the regularization insensitive band,
[0066] C is the regularization parameter that controls the trade-off between empirical error and model complexity.
[0067] The optimal solution is obtained by the Lagrange multiplier method: After the Lagrange multiplier is introduced, the Lagrange function is formed, and the dual problem is solved to find the optimal hyperplane parameters w and b, as well as the Lagrange multipliers α and α*.
[0068] Model performance evaluation: Use cross-validation or independent test sets to calculate the difference between the predicted value and the actual value. The main evaluation indicators are:
[0069] Mean Squared Error (MSE):
[0070] in, is the flow value of the i-th sample predicted by the model.
[0071] Coefficient of determination (R 2 ):
[0072]
[0073] in, It is the average of all sample true flow values.
[0074] Apply the model for prediction: Given real-time water level data x, make predictions using the trained SVR model:
[0075]
[0076] here, It is the flow value predicted based on the real-time water level x. The prediction result can be used to correct the measurement deviation of the flow sensor.
[0077] The specific code is as follows:
[0078]
[0079] 3. Correction algorithm implementation:
[0080] The constructed mathematical model is deployed on the cloud server. When receiving the water level and flow data on site, the cloud server calculates the flow detection deviation that can be generated under the current water level based on the model.
[0081] According to the deviation correction formula, the flow reading is adjusted to obtain the real flow data.
[0082] The progress and advantages of this application over the prior art are reflected in the following aspects:
[0083] 1. Integrated intelligent hardware:
[0084] This application not only includes traditional flow sensors and water level sensors, but also combines a variety of hardware facilities such as signal conditioning circuits, single-chip circuits, display and alarm circuits, communication modules and power management circuits to form a highly integrated intelligent monitoring system. The single-chip circuit is responsible for real-time data processing, logical judgment and control command issuance, realizing automatic control and data analysis functions.
[0085] 2. Real-time monitoring and remote transmission:
[0086] Through the communication module, real-time collected data can be instantly transmitted to the cloud server to achieve remote monitoring and data analysis, improving management efficiency and response speed.
[0087] 3. Precise self-adjustment mechanism:
[0088] Taking advantage of the powerful computing power of cloud servers, this application introduces a machine learning algorithm, support vector regression (SVR), to mathematically model and predict the relationship between water level and flow sensor detection deviation. Through the pre-trained SVR model, the possible measurement deviation of the flow sensor can be calculated under real-time water level conditions and corrected accordingly, greatly improving the accuracy of flow detection.
[0089] 4. Model optimization and performance evaluation:
[0090] When constructing the SVR model, the radial basis function (RBF) is used as the kernel function, and the model performance is optimized by reasonably setting the regularization parameter C and the ε-insensitive loss function parameter ε.
[0091] The model is cross-validated or validated with an independent test set to ensure that the model has good generalization ability and high prediction accuracy. Evaluation indicators include but are not limited to mean square error (MSE) and determination coefficient (R 2 ). In summary, compared with the existing river water resources self-regulating flow detection mechanism, the technical improvement of this application lies in the use of advanced software and hardware combination technology, the use of modern data mining and machine learning methods to accurately calibrate the flow detection results, effectively solve the measurement error problem under complex water conditions, improve the stability and accuracy of flow detection, and enhance the intelligence level and remote management capabilities of the system.
[0092] The embodiments that require protection in this application include:
[0093] The canal water resources self-regulation flow detection agency includes:
[0094] Flow sensor, water level sensor, signal conditioning circuit, single-chip microcomputer circuit, display and alarm circuit, communication module, power management circuit, cloud server, the signal conditioning circuit is used to amplify, filter and convert the original signal output by the sensor, and convert it into a standardized signal processed by the single-chip microcomputer; the single-chip microcomputer circuit is used to receive the signals of each sensor and perform data processing, including flow calculation and water level control logic judgment; the communication module is used to transmit data to the cloud server; the power management circuit is used to power the entire system; the flow sensor and the water level sensor are respectively connected to the signal conditioning circuit to convert the physical signal into an electrical signal; the signal output by the signal conditioning circuit is read and processed by the single-chip microcomputer; the single-chip microcomputer controls the working state of the display and alarm circuit according to the processing result, and uploads the data to the cloud server through the communication module; the cloud server calculates the deviation detected by the water flow sensor according to the water level of the canal and the flow measured by the water flow sensor, calculates the actual flow detected by the water flow sensor based on the deviation detected by the water flow sensor, and self-regulates the flow measured by the water flow sensor.
[0095] Preferably, the flow sensor includes a turbine flow sensor and an ultrasonic flow sensor.
[0096] Water level sensors include capacitive water level sensors and float type liquid level sensors.
[0097] The single-chip microcomputer circuits include STM32, Arduino, and 51 single-chip microcomputers.
[0098] Preferably, the power management circuit includes a battery, a solar charging system or an AC / DC power conversion module.
[0099] Preferably, the cloud server calculates the deviation of the water flow sensor detection according to the water level of the canal and the flow measured by the water flow sensor, calculates the real flow detected by the water flow sensor based on the deviation detected by the water flow sensor, and self-regulates the flow measured by the water flow sensor, specifically including:
[0100] Collect the actual flow data of the turbine flow sensor or ultrasonic flow sensor under different water level conditions, and record the water level value detected by the water level sensor; use the support vector machine to analyze the correlation between the water level and the output signal of the flow sensor, and fit the mathematical model between the water level and the flow sensor detection deviation;
[0101] The constructed mathematical model is deployed on the cloud server. When the on-site water level and flow data are received, the cloud server calculates the flow detection deviation that may be generated under the current water level based on the model; according to the deviation correction formula, the flow reading is adjusted to obtain the actual flow data.
[0102] Preferably, the correlation between the water level and the output signal of the flow sensor is analyzed by a support vector machine, and a mathematical model between the water level and the detection deviation of the flow sensor is fitted, the steps are:
[0103] Build the SVR model, set the kernel function, regularization parameter C, and parameter ε of the ε-insensitive loss function;
[0104] Using the training data set, the optimal solution of SVR is solved by Lagrange multiplier method to obtain the best decision function;
[0105] Use cross-validation or an independent test set to evaluate the performance of the trained SVR model to see how well the predictions match the true deviations;
[0106] By using the SVR model and inputting real-time water level data, the model will output the expected flow sensor measurement deviation; the target of SVR is the function f(x)=w·φ(x)+b, where x represents the water level, φ(x) is the high-dimensional feature vector after kernel function mapping, and w and b are the weight vector and bias term of the model respectively.
[0107] Preferably, the kernel function is a radial basis function RBF.
[0108] The performance of the trained SVR model was evaluated using cross validation or an independent test set. The evaluation indicators included mean square error and determination coefficient.
[0109] The cloud services here can be implemented through a variety of specific products or architectures, such as:
[0110] 1. Alibaba Cloud: You can use Alibaba Cloud IoT Hub and Alibaba Cloud Function Compute to receive, process, and store data from field devices, and deploy and run support vector machine (SVM) models on them for real-time analysis and prediction.
[0111] 2. AWS (Amazon Web Services): You can use AWS IoT Core to connect and manage the sensor devices of the traffic detection agency, and then use AWS Lambda to perform real-time data processing and model calculations, deploy the model on the Amazon SageMaker platform, and use Amazon S3 or DynamoDB to store historical data and model parameters.
[0112] 3. Microsoft Azure: Use Azure IoT Hub to collect device data, process data streams in real time through Azure Stream Analytics, deploy support vector machine models in Azure Machine Learning service for online prediction, and store data in Azure Cosmos DB or Blob Storage.
[0113] 4. Google Cloud Platform (GCP): Receive and manage device data with Cloud IoT Core, use Cloud Functions or Cloud Dataflow for data preprocessing and real-time analysis, model training and deployment can be done on Google Cloud AIPlatform, and storage requirements can be solved through Cloud Storage or Bigtable.
[0114] 5. Private cloud or hybrid cloud architecture: You can also choose to build a private cloud environment, such as based on OpenStack or other open source frameworks, combined with Kubernetes container orchestration services to deploy model services, use time series databases such as InfluxDB or TimescaleDB to store real-time data, and combine tools such as Elasticsearch or Prometheus for data retrieval and visualization.
[0115] The above is only a specific implementation of the present application, but the protection scope of the present application is not limited thereto. Any changes or substitutions that can be easily conceived by any technician familiar with the technical field within the technical scope disclosed in the present application should be covered by the protection scope of the present application.
Claims
1. A canal water resource self-regulating flow detection mechanism, characterized in that: It includes flow sensor, water level sensor, signal conditioning circuit, single-chip circuit, display and alarm circuit, communication module, power management circuit and cloud server. The signal conditioning circuit is used to amplify, filter and convert the original signal output by the sensor, and convert it into a standardized signal processed by the single-chip microcomputer; the single-chip microcomputer circuit is used to receive the signals of each sensor and perform data processing, including flow calculation and water level control logic judgment; the communication module is used to transmit data to the cloud server; the power management circuit is used to power the entire system; the flow sensor and the water level sensor are respectively connected to the signal conditioning circuit to convert the physical signal into an electrical signal; The signal output by the signal conditioning circuit is read and processed by the single chip microcomputer; the single chip microcomputer controls the working status of the display and alarm circuit according to the processing result, and uploads the data to the cloud server through the communication module; The cloud server calculates the deviation of the water flow sensor detection according to the water level of the canal and the flow measured by the water flow sensor. Based on the deviation of the water flow sensor detection, it calculates the actual flow detected by the water flow sensor and self-adjusts the flow measured by the water flow sensor.
2. The canal water resource self-regulating flow detection mechanism according to claim 1 is characterized in that: Flow sensors include turbine flow sensors and ultrasonic flow sensors.
3. The canal water resource self-regulating flow detection mechanism according to claim 2 is characterized in that: Water level sensors include capacitive water level sensors and float type liquid level sensors.
4. The canal water resource self-regulating flow detection mechanism according to claim 3 is characterized in that: The single-chip microcomputer circuits include STM32, Arduino, and 51 single-chip microcomputers.
5. The canal water resource self-regulating flow detection mechanism according to claim 4, characterized in that: The power management circuit includes a battery, a solar charging system or an AC / DC power conversion module.
6. The canal water resource self-regulating flow detection mechanism according to claim 5, characterized in that: The cloud server calculates the deviation of the water flow sensor detection based on the water level of the canal and the flow measured by the water flow sensor. Based on the deviation of the water flow sensor detection, it calculates the actual flow detected by the water flow sensor and self-regulates the flow measured by the water flow sensor. Specifically, it includes: Collect the actual flow data of the turbine flow sensor or ultrasonic flow sensor under different water level conditions, and record the water level value detected by the water level sensor; use the support vector machine to analyze the correlation between the water level and the output signal of the flow sensor, and fit the mathematical model between the water level and the flow sensor detection deviation; The constructed mathematical model is deployed on the cloud server. When the on-site water level and flow data are received, the cloud server calculates the flow detection deviation that may be generated under the current water level based on the model; according to the deviation correction formula, the flow reading is adjusted to obtain the actual flow data.
7. The canal water resource self-regulating flow detection mechanism according to claim 6, characterized in that: The correlation between the water level and flow sensor output signals is analyzed by support vector machine, and a mathematical model between the water level and flow sensor detection deviation is fitted. The steps are as follows: Build the SVR model, set the kernel function, regularization parameter C, and parameter ε of the ε-insensitive loss function; Using the training data set, the optimal solution of SVR is solved by Lagrange multiplier method to obtain the best decision function; Use cross-validation or independent test sets to evaluate the performance of the trained SVR model to see how well the predictions match the true deviations; By using the SVR model and inputting real-time water level data, the model will output the expected flow sensor measurement deviation; the target of SVR is the function f(x)=w·φ(x)+b, where x represents the water level, φ(x) is the high-dimensional feature vector after kernel function mapping, and w and b are the weight vector and bias term of the model respectively.
8. The canal water resource self-regulating flow detection mechanism according to claim 7, characterized in that: The kernel function is radial basis function RBF.
9. The canal water resource self-regulating flow detection mechanism according to claim 8, characterized in that: The performance of the trained SVR model was evaluated using cross validation or an independent test set. The evaluation indicators included mean square error and determination coefficient.
Citation Information
Patent Citations
Ultrasonic open channel flow rate comprehensive monitoring instrument and measuring method thereof
CN101672647A
Hydrological information monitoring equipment, hydrological information monitoring system and hydropower station
CN105698773A
Water level and runoff volume data acquisition and processing system and method
CN108204848A
Flow monitoring method and device, equipment and readable storage medium
CN110426088A
Water level measurement series error analysis method related to water level-flow relationship
CN110553631A
