Canal water resource self-regulating flow detection mechanism
The integrated system with SVR analysis corrects flow measurement errors in complex water conditions, enhancing accuracy and stability through advanced hardware and machine learning, improving river water resource flow detection.
Patent Information
- Application Number
- CN202410523601.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-04-28
- Publication Date
- 2025-07-15
- Estimated Expiration
- 2044-04-28
AI Technical Summary
The existing river water resources self-regulating flow detection mechanism still has measurement errors under complex water conditions, which affects the accuracy and stability of flow detection.
The combination of flow sensors, water level sensors, signal conditioning circuits, microcontroller circuits, display and alarm circuits, communication modules, power management circuits and cloud servers is used to analyze the correlation between water level and flow sensor output signals using support vector regression model (SVR), and the flow detection deviation is calculated and corrected by cloud servers to achieve self-regulation of flow.
It improves the stability and accuracy of flow detection, enhances the system's intelligence level and remote management capabilities, and reduces measurement errors under complex water conditions.
Smart Images

Figure GDA0004993132240000051 
Figure GDA0004993132240000061 
Figure GDA0004993132240000063
Abstract
Description
Technical Field
[0001] The present invention belongs to the technical field of water resource regulation, and more specifically, relates to a self-regulating flow detection mechanism for canal water resources. Background Art
[0002] The existing "self-regulating flow detection mechanism for river water resources" is a design aimed at reducing the impact of water level changes on detection. Generally, it can adaptively adjust the size of the drainage outlet, adjust the flow according to the real-time water level, and cooperate with the water level detection float board and the uniform damping control component, which can reduce the measurement error caused by water level changes to a certain extent and improve the accuracy and stability of flow detection. However, even this self-regulating mechanism still has a certain measurement error under complex water conditions. Summary of the Invention
[0003] To solve the above technical problems, the basic concept of the technical solution adopted by the present invention is:
[0004] A self-regulating flow detection mechanism for canal water resources, comprising:
[0005] A flow sensor, a water level sensor, a signal conditioning circuit, a single-chip microcomputer circuit, a display and alarm circuit, a communication module, a power management circuit, and a cloud server. The signal conditioning circuit is used to amplify, filter, and convert the original signal output by the sensor 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 the data to the cloud server; the power management circuit is used to supply power to 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;
[0006] 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 based on the canal water level and the flow measured by the water flow sensor, calculates the true 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.
[0007] Preferably, the flow sensor includes a turbine flow sensor and an ultrasonic flow sensor.
[0008] The water level sensor includes a capacitive water level sensor and a float type liquid level sensor.
[0009] The single-chip microcomputer circuit includes STM32, Arduino, and 51 single-chip microcomputer.
[0010] Preferably, the power management circuit includes a battery, a solar charging system, or an AC / DC power conversion module.
[0011] Preferably, the cloud server calculates the deviation detected by the water flow sensor according to the canal water level and the flow rate measured by the water flow sensor, calculates the true flow rate detected by the water flow sensor based on the deviation detected by the water flow sensor, and self-adjusts the flow rate measured by the water flow sensor. Specifically, it includes:
[0012] Collect the actual flow rate data of the turbine flow sensor or ultrasonic flow sensor corresponding to different water level conditions, and record the water level values detected by the water level sensor at the same time; analyze the correlation between the water level and the output signal of the flow sensor through a support vector machine, and fit a mathematical model between the water level and the detection deviation of the flow sensor;
[0013] Deploy the constructed mathematical model on the cloud server. When receiving the water level and flow rate data on-site, the cloud server calculates the flow rate detection deviation that can be generated under the current water level according to the model; adjusts the flow rate reading according to the deviation correction formula to obtain the data of the true flow rate.
[0014] Preferably, analyzing the correlation between the water level and the output signal of the flow sensor through a support vector machine, and fitting a mathematical model between the water level and the detection deviation of the flow sensor. The steps are as follows:
[0015] Construct an SVR model, and set the kernel function, the regularization parameter C, and the parameter ε of the ε-insensitive loss function;
[0016] Use the training data set to solve the optimal solution of the SVR through the Lagrange multiplier method to obtain the best decision function;
[0017] Use cross-validation or an independent test set to evaluate the performance of the trained SVR model, and check the degree of agreement between the prediction result and the true deviation;
[0018] Use the SVR model to input real-time water level data, and the model will output the predicted measurement deviation of the flow sensor;
[0019] The objective of the 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.
[0020] Preferably, the kernel function is the radial basis function RBF.
[0021] Use cross-validation or an independent test set to evaluate the performance of the trained SVR model. The evaluation metrics include the mean squared error and the coefficient of determination.
[0022] The present invention has the following beneficial effects compared with the prior art:
[0023] Through advanced software and hardware combination technology, this application uses modern data mining and machine learning means to accurately calibrate the flow detection results, effectively solves the measurement error problem under complex water conditions, improves the stability and accuracy of flow detection, and enhances the intelligent level and remote management ability of the system. Specific embodiments
[0024] To make the objectives, technical solutions, and advantages of the embodiments of the present invention clearer, the following will clearly and completely describe the technical solutions in the embodiments of the present invention in conjunction with the accompanying drawings in the embodiments of the present invention. The following embodiments are used to illustrate the present invention.
[0025] This application discloses a canal water resource self-regulating flow detection mechanism, including:
[0026] Flow sensor:
[0027] Turbine flow sensor: The turbine rotates under the drive of water flow. Each time the built-in magnet rotates one circle, it will trigger a Hall effect sensor or an optocoupler, and output a corresponding pulse signal, which is proportional to the amount of water flowing through;
[0028] Ultrasonic flow sensor: Measures the fluid velocity by emitting and receiving ultrasonic waves, and then calculates the flow rate, including a transmitting circuit, a receiving circuit, and a signal processing circuit;
[0029] Water level sensor:
[0030] Capacitive water level sensor: Used to detect the water level of the canal. The change in water level will cause a change in the capacitance value of the sensor, which is converted into a voltage or frequency signal through a conversion circuit;
[0031] Float type liquid level sensor: Utilizes a magnetic reed switch or a resistive sensor. The float floats with the water level, driving the internal components to change states and output an electrical signal;
[0032] Signal conditioning circuit:
[0033] Amplifies, filters, and converts the original signal output by the sensor into a standardized signal processed by the single-chip microcomputer;
[0034] Single-chip microcomputer circuit:
[0035] Such as STM32, Arduino or 51 series single-chip microcomputers. The single-chip microcomputer circuit is responsible for receiving the signals of each sensor, performing data processing, including flow calculation and water level control logic judgment, and may execute control commands for valve or pump equipment;
[0036] Display and alarm circuit:
[0037] Set up an LCD or LED display screen to display the flow rate and water level information in real time;
[0038] Set up a buzzer or indicator light to give an alarm when the flow rate exceeds the preset threshold or an abnormality occurs;
[0039] Communication module:
[0040] Adopt a wireless transmission module (such as GPRS, LoRa, NB-IoT) or a wired communication interface (RS-485, Ethernet) to transmit data to the cloud server;
[0041] Power management circuit:
[0042] The power management circuit supplies power to the entire system. The power management circuit includes a battery, a solar charging system or an AC / DC power conversion module;
[0043] The connection relationships between the various parts are as follows:
[0044] 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 circuits according to the processing result, and uploads the data to the cloud server through the communication module;
[0045] The cloud server calculates the deviation detected by the water flow sensor based on the water level of the canal and the flow rate measured by the water flow sensor, and calculates the real flow rate detected by the water flow sensor based on the deviation detected by the water flow sensor, and self-regulates the flow rate measured by the water flow sensor.
[0046] Since the change of water level will affect factors such as the velocity distribution and flow channel cross-sectional area of the fluid, and further affect the measurement accuracy of the flow sensor, the cloud server calculates the deviation detected by the water flow sensor based on the water level of the canal and the flow rate measured by the water flow sensor, and calculates the real flow rate detected by the water flow sensor based on the deviation detected by the water flow sensor, and self-regulates the flow rate measured by the water flow sensor. Specifically, it includes:
[0047] 1. Data collection stage:
[0048] Collect the actual flow rate data of the turbine flow sensor or ultrasonic flow sensor corresponding to different water level conditions, and at the same time record the water level values detected by the water level sensor;
[0049] At the same time, it is also necessary to collect data under known standard flow rates as a reference for comparative analysis of deviations; 2. Data analysis stage:
[0050] Analyze the correlation between the water level and the output signal of the flow sensor through a support vector machine, and fit a mathematical model between the detection deviation of the water level and the flow sensor; use the support vector regression (SVR) method in the support vector machine (SVM) to analyze the relationship between the water level and the output signal of the flow sensor and establish a mathematical model. Steps:
[0051] Construct an SVR model, and set the kernel function (such as the radial basis function RBF), the regularization parameter C, and the parameter ε of the ε-insensitive loss function;
[0052] Use the training data set to solve the optimal solution of SVR through the Lagrange multiplier method to obtain the best decision function (i.e., the model);
[0053] Use cross-validation or an independent test set to evaluate the performance of the trained SVR model, check the degree of agreement between the prediction result and the true deviation, and the evaluation indicators include the mean square error (MSE), the coefficient of determination (R 2 ); Using the SVR model, input real-time water level data, and the model will output the predicted measurement deviation of the flow sensor; The goal 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.
[0054] Steps to analyze the relationship between the water level and the output signal of the flow sensor using support vector regression (SVR) and establish a model: The SVR model is a generalized non-linear regression model, and its goal is to minimize the following optimization problem:
[0055]
[0056] Among them,
[0057] xi is the water level observation value of the i-th sample,
[0058] yi is the true value output by the corresponding flow sensor,
[0059] 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′),
[0060] ε is the threshold of the ε-insensitive loss function,
[0061] ξi and ξi * are the slack variables within the regularization insensitive band respectively,
[0062] C is the regularization parameter, which controls the trade-off between the empirical error and the model complexity.
[0063] Solve for the optimal solution using the Lagrange multiplier method: After introducing the Lagrange multipliers, form the Lagrangian function and solve the dual problem to find the optimal hyperplane parameters w and b, as well as the Lagrange multipliers α and α*.
[0064] Model performance evaluation: Use cross-validation or an independent test set to calculate the difference between the predicted values and the actual values. The main evaluation metrics are:
[0065] Mean squared error (MSE):
[0066]
[0067] where is the flow value of the i-th sample predicted by the model.
[0068] Coefficient of determination (R 2 ):
[0069]
[0070] where is the average of the true flow values of all samples.
[0071] Apply the model for prediction: Given real-time water level data x, perform prediction through the trained SVR model:
[0072]
[0073] Here, is the flow value predicted based on the real-time water level x, and the prediction result can be used to correct the measurement deviation of the flow sensor.
[0074] The specific code is as follows:
[0075]
[0076] 3. Implementation of the calibration algorithm:
[0077] Deploy the constructed mathematical model on the cloud server. When receiving the water level and flow data from the site, the cloud server calculates the flow detection deviation that can be generated at the current water level according to the model;
[0078] According to the deviation correction formula, adjust the flow reading to obtain the data of the true flow.
[0079] The progress and advantages of this application compared with the prior art are reflected in the following aspects:
[0080] 1. Integrated intelligent hardware:
[0081] This application not only includes traditional flow sensors and water level sensors, but also combines various hardware facilities such as signal conditioning circuits, single-chip microcomputer circuits, display and alarm circuits, communication modules, and power management circuits to form a highly integrated intelligent monitoring system. The single-chip microcomputer circuit is responsible for real-time data processing, logical judgment, and issuing control instructions, realizing functions of automatic regulation and data analysis.
[0082] 2. Real-time Monitoring and Remote Transmission:
[0083] Through the communication module, the 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.
[0084] 3. Precise Self-regulation Mechanism:
[0085] Utilizing the powerful computing ability of the cloud server, this application introduces the machine learning algorithm - Support Vector Regression (SVR) to mathematically model and predict the relationship between the water level and the detection deviation of the flow sensor. Through the pre-trained SVR model, it can calculate the possible measurement deviation of the flow sensor under real-time water level conditions and correct it accordingly, greatly improving the accuracy of flow detection.
[0086] 4. Model Optimization and Performance Evaluation:
[0087] 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 ε.
[0088] The model is verified by cross-validation or an independent test set to ensure that the model has good generalization ability and high prediction accuracy. The evaluation metrics include but are not limited to the Mean Squared Error (MSE) and the Coefficient of Determination (R 2 )). In summary, compared with the existing self-regulating flow detection mechanisms for canal water resources, the technical improvement of this application lies in accurately calibrating the flow detection results through advanced software and hardware combination technologies, using modern data mining and machine learning means, effectively solving the measurement error problem under complex water conditions, improving the stability and accuracy of flow detection, and enhancing the intelligent level and remote management ability of the system.
[0089] The embodiments to be protected by this application include:
[0090] A self-regulating flow detection mechanism for canal water resources, including:
[0091] 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 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 supply power to the entire system. The flow sensor and the water level sensor are respectively connected to the signal conditioning circuit, converting physical signals into electrical signals. 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 based on 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-adjusts the flow measured by the water flow sensor.
[0092] Preferably, the flow sensor includes a turbine flow sensor and an ultrasonic flow sensor.
[0093] The water level sensor includes a capacitive water level sensor and a float type liquid level sensor.
[0094] The single-chip microcomputer circuit includes STM32, Arduino, and 51 single-chip microcomputer.
[0095] Preferably, the power management circuit includes a battery, a solar charging system or an AC / DC power conversion module.
[0096] Preferably, the cloud server calculates the deviation detected by the water flow sensor based on 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-adjusts the flow measured by the water flow sensor. Specifically, it includes:
[0097] Collect the actual flow data of the turbine flow sensor or the ultrasonic flow sensor corresponding to different water level conditions, and record the water level values detected by the water level sensor at the same time. Analyze the correlation between the water level and the output signal of the flow sensor through a support vector machine, and fit a mathematical model between the water level and the detection deviation of the flow sensor.
[0098] Deploy the constructed mathematical model 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 according to the model. According to the deviation correction formula, adjust the flow reading to obtain the data of the real flow.
[0099] Preferably, by analyzing the correlation between the water level and the output signal of the flow sensor using a support vector machine, a mathematical model between the water level and the detection deviation of the flow sensor is fitted. The steps are as follows:
[0100] Construct an SVR model, and set the kernel function, the regularization parameter C, and the parameter ε of the ε-insensitive loss function;
[0101] Using the training data set, solve the optimal solution of the SVR by the Lagrange multiplier method to obtain the best decision function;
[0102] Use cross-validation or an independent test set to evaluate the performance of the trained SVR model, and check the degree of agreement between the prediction result and the true deviation;
[0103] Using the SVR model, input the real-time water level data, and the model will output the predicted measurement deviation of the flow sensor. The objective of the 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 the bias term of the model respectively.
[0104] Preferably, the kernel function is the radial basis function RBF.
[0105] Use cross-validation or an independent test set to evaluate the performance of the trained SVR model. The evaluation metrics include the mean squared error and the coefficient of determination.
[0106] The cloud service here can be implemented through a variety of specific products or architectures. For example:
[0107] 1. Alibaba Cloud: Alibaba Cloud IoT Suite (IoT Hub) and Alibaba Cloud Function Compute can be used to receive, process, and store data transmitted from on-site devices, and deploy and run a support vector machine (SVM) model on it for real-time analysis and prediction.
[0108] 2. AWS (Amazon Web Services): AWS IoT Core can be used to connect and manage the sensor devices of the flow detection agency, and then perform real-time data processing and model operations through AWS Lambda. The model is deployed on the Amazon SageMaker platform, and Amazon S3 or DynamoDB is used to store historical data and model parameters.
[0109] 3. Microsoft Azure: Use Azure IoT Hub to collect device data, process data streams in real time through Azure Stream Analytics, deploy the support vector machine model in the Azure Machine Learning service for online prediction, and store the data in Azure Cosmos DB or Blob Storage.
[0110] 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 completed on Google Cloud AI Platform, while storage requirements can be addressed through Cloud Storage or Bigtable.
[0111] 5. Private cloud or hybrid cloud architecture: It is also possible to choose to build a private cloud environment, such as based on OpenStack or other open-source frameworks, deploy model services in combination with the Kubernetes container orchestration service, 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.
[0112] As described above, it is only a specific implementation manner of this application, but the protection scope of this application is not limited thereto. Any changes or substitutions that can be easily thought of by those skilled in the art within the technical scope disclosed by this application should be covered by the protection scope of this application.
Claims
1. Canal water resource self-regulating flow detection mechanism, characterized in that, It includes a flow sensor, a water level sensor, a signal conditioning circuit, a microcontroller circuit, a display and alarm circuit, a communication module, a power management circuit, and a cloud server. The signal conditioning circuit is used to amplify, filter, and convert the original signals output by the sensors, and convert them into standardized signals processed by the microcontroller. The microcontroller circuit is used to receive the signals from 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 supply power to the entire system. The flow sensor and the water level sensor are respectively connected to the signal conditioning circuit to convert physical signals into electrical signals. The signals output by the signal conditioning circuit are read and processed by the microcontroller. The microcontroller controls the working state 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 detected by the flow sensor based on the water level of the canal and the flow measured by the flow sensor, calculates the true flow detected by the flow sensor based on the deviation detected by the flow sensor, and self-regulates the flow measured by the flow sensor. The cloud server calculates the deviation detected by the flow sensor based on the water level of the canal and the flow measured by the flow sensor, calculates the true flow detected by the flow sensor based on the deviation detected by the flow sensor, and self-regulates the flow measured by the flow sensor. Specifically, it includes: 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 values detected by the water level sensor at the same time. Analyze the correlation between the water level and the output signal of the flow sensor through a support vector machine, and fit a mathematical model between the water level and the detection deviation of the flow sensor. Deploy the constructed mathematical model on the cloud server. When receiving the on-site water level and flow data, the cloud server calculates the flow detection deviation that can be generated at the current water level according to the model. According to the deviation correction formula, adjust the flow reading to obtain the data of the true flow. Analyze the correlation between the water level and the output signal of the flow sensor through a support vector machine, and fit a mathematical model between the water level and the detection deviation of the flow sensor. The steps are as follows: Construct an SVR model, and set the kernel function, the regularization parameter C, and the parameter ε of the ε-insensitive loss function. Use the training data set to solve the optimal solution of the SVR through the Lagrange multiplier method to obtain the best decision function. Use cross-validation or an independent test set to evaluate the performance of the trained SVR model, and check the degree of agreement between the prediction results and the true deviation. Use the SVR model to input real-time water level data, and the model will output the predicted measurement deviation of the flow sensor. The objective function of the SVR is 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.
2. The canal water resource self-regulating flow detection mechanism according to claim 1, characterized in that The flow sensor includes a turbine flow sensor and an ultrasonic flow sensor.
3. The canal water resource self-regulating flow detection mechanism according to claim 2, characterized in that, The water level sensor includes a capacitive water level sensor and a float type liquid level sensor.
4. The canal water resource self-regulating flow detection mechanism according to claim 3, characterized in that, The microcontroller circuit includes STM32, Arduino, and 51 microcontrollers.
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 1, characterized in that, The kernel function is the radial basis function RBF.
7. The canal water resource self-regulating flow detection mechanism according to claim 6, characterized in that, The performance of the trained SVR model is evaluated using cross-validation or an independent test set, and the evaluation metrics include the mean squared error and the coefficient of determination.
Citation Information
Patent Citations
Water level and runoff volume data acquisition and processing system and method
CN108204848A