Adaptive three-dimensional flow field reconstruction method, device, system, and medium for open channel flow
By using an adaptive 3D flow field reconstruction method, combined with multi-source sensor data and a large model guided by physical priors, the problem of measurement accuracy and robustness of open channel flow measurement under complex operating conditions was solved, realizing high-precision, real-time flow monitoring and intelligent operation and maintenance.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-12-09
- Publication Date
- 2026-04-03
AI Technical Summary
Existing open channel flow measurement methods suffer from decreased measurement accuracy under complex operating conditions. Sensors are susceptible to environmental influences and lack fault tolerance mechanisms, making it difficult to meet real-time and robustness requirements. Traditional methods also struggle to fully exploit the fluid dynamics laws of multi-source data.
An adaptive 3D flow field reconstruction method is adopted, which collects data through image sensors, radar current meters and ultrasonic current meters, and combines physical prior-guided large models and lightweight prediction models to predict the flow field. The U-Net network is used to generate virtual sensor data and quantify uncertainty. An edge-cloud collaborative architecture is introduced for data uploading and computation.
It achieves high-precision flow measurement under complex operating conditions, improves the robustness and business continuity of the system, reduces operation and maintenance costs, and enhances the intelligence level of the flow monitoring system.
Smart Images

Figure CN121280656B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of open channel flow measurement technology, and more specifically, to an adaptive three-dimensional flow field reconstruction method, device, system, and medium for open channel flow. Background Technology
[0002] Accurate measurement of open channel flow is of great significance for water resource management, flood control early warning, and environmental monitoring. Achieving high-precision and robust non-contact online metering has been a long-term goal in this field.
[0003] Existing technologies typically rely on data fusion algorithms based on fixed physical formulas or traditional interpolation methods to estimate cross-sectional flow rates. These methods can combine measurement results from different sensors to some extent, but their model parameters are usually preset and difficult to adjust. Some research has also attempted to introduce artificial intelligence models to establish a mapping relationship from sensor data to the flow field in a data-driven manner.
[0004] However, current methods have significant limitations. Traditional algorithms have rigid model structures that cannot adapt to complex and dynamically changing real-world flow conditions, leading to a significant decrease in measurement accuracy under unconventional conditions such as flood season and siltation. Sensors deployed in the field are susceptible to environmental influences, resulting in malfunctions or data drift, and existing systems lack effective fault tolerance mechanisms. Failure of critical sensors can directly lead to business interruptions and incur high maintenance costs.
[0005] Furthermore, existing methods are relatively superficial in terms of data fusion, making it difficult to fully explore the fluid dynamics laws underlying multi-source data. This results in a lack of physical accuracy in flow field estimations in areas not covered by sensors. Although artificial intelligence has been introduced, related applications often treat the model as a black box, and its generated results may violate basic physical laws. Moreover, they generally rely on cloud computing, making it difficult to meet the requirements of real-time operation and offline operation. Summary of the Invention
[0006] The present invention provides an adaptive three-dimensional flow field reconstruction method, apparatus, system, and medium for open channel flow to improve at least one of the above-mentioned technical problems.
[0007] In a first aspect, the present invention provides an adaptive three-dimensional flow field reconstruction method for open channel flow, which includes steps S1 to S5.
[0008] S1. Acquire multimodal data collected by image sensors, radar flow meters, ultrasonic flow meters, and water level gauges deployed at the open channel site, and perform preprocessing.
[0009] S2. The preprocessed data is initially predicted in three dimensions using a cloud-based large model distillation or a simplified lightweight prediction model, and the anomaly detection module performs consistency verification and anomaly detection.
[0010] S3. When an abnormal event is detected, the multimodal measurement data within the time window of the abnormal event is packaged and uploaded to the cloud server. Under normal operating conditions, only the measurement results and equipment status data are uploaded.
[0011] S4. The cloud server receives the uploaded data packets, guides the large model to reconstruct the three-dimensional flow field of the data through physical priors, and obtains the virtual sensor data of the failed sensor, as well as the three-dimensional uncertainty field.
[0012] S5. Based on the reconstructed complete three-dimensional flow field, combined with the real-time water level and the latest riverbed topography, the cross-sectional flow rate is obtained by numerical integration of the cross-section.
[0013] As a further aspect of the present invention, the reasoning process of the large model guided by physical priors is as follows:
[0014] A conditional tensor constructed based on data uploaded from the edge.
[0015] Generate a completely random noise tensor x_T in the flow field space dimension.
[0016] x_T=sample_from_gaussian_distribution(shape) .
[0017] In the formula, sample_from_gaussian_distribution indicates sampling from a Gaussian distribution; shape represents the dimensional information.
[0018] The conditional tensor and x_T are input into the trained U-Net network and iterated to predict the current noise.
[0019] predicted_noise=model(x_T,t,C_inference).
[0020] In the formula, predicted_noise is the noise predicted by the model at the current time step; t is the time step; and C_inference is the conditional tensor constructed based on the packaged data including the failed sensors.
[0021] The clean flow field is obtained by subtracting the predicted noise from the current noisy flow field.
[0022] x_T=reverse_diffusion_step(x_T,t,predicted_noise) .
[0023] In the formula, reverse_diffusion_step represents reverse diffusion.
[0024] After the cycle is complete, the clean flow field is the reconstructed complete three-dimensional flow field V.
[0025] Based on the complete three-dimensional flow field V, obtain the virtual sensor data virtual_sensor_value.
[0026] virtual_sensor_value=V(x,y,z) .
[0027] In the formula, (x,y,z) are the coordinates of the failed probe.
[0028] As a further aspect of the present invention, the physically-guided large model employs a physically-guided conditional diffusion U-Net model. A Dropout layer is inserted after each convolutional module of the encoder and decoder in the U-Net model.
[0029] The steps for generating a three-dimensional uncertainty field are as follows:
[0030] When the cloud receives data packets from the edge, it executes N independent inference processes. In each inference, due to the randomness of the Dropout layer, different neurons in the network are temporarily dropped, resulting in different flow field reconstruction results.
[0031] The average of the N results is taken as the final complete three-dimensional flow field V_final.
[0032] V_final(x_f,y_f,z_f)=(1 / N) .
[0033] Calculate the sample variance of the results at each spatial point N times. This represents the uncertainty of the prediction result at that point.
[0034] .
[0035] In the formula, N represents the number of inference attempts. (x_f, y_f, z_f) represents the final coordinates of the failed probe. For the first The complete three-dimensional flow field was simulated.
[0036] As a further aspect of the present invention, the training process of the large model guided by physical priors includes:
[0037] Add noise to x_0 by pressing step t.
[0038] x_t=forward_diffusion(x_0,t,noise) .
[0039] t=random_integer(1,T).
[0040] noise=sample_from_gaussian_distribution(shape=x_0.shape) .
[0041] In the formula, t is the time step; x_t is the sample at the t-th step. forward_diffusion indicates adding noise. x_0 is the noise-free image. noise represents noise. random_integer indicates generating random integers within a specified range. T is the total number of diffusion steps, such as 1000. sample_from_gaussian_distribution indicates sampling from a Gaussian distribution. shape is the dimensional information.
[0042] Input the noisy flow field, time step t, and condition C into the model to allow the model to learn and predict noise.
[0043] predicted_noise=model(x_t,t,C) .
[0044] In the formula, predicted_noise represents the noise predicted by the model at the current time step. model is the instantiated U-Net network. C is the conditional tensor.
[0045] Calculate the difference between the predicted noise and the actual noise.
[0046] loss=mean_squared_error(predicted_noise,noise) .
[0047] In the formula, loss represents the loss. mean_squared_error is the mean squared error.
[0048] Based on the gap, backpropagation is performed and the model parameters are updated to obtain the trained U-Net network.
[0049] As a further aspect of the present invention, the loss function for training a large model guided by physical priors is:
[0050] Loss_total = Loss_data + λ Loss_physics.
[0051] In the formula, Loss_total is the total loss, Loss_data is the fitting loss between the model output and the actual sensor measurement, λ is the weight coefficient, and Loss_physics is the physical residual loss.
[0052] As a further aspect of the present invention, Loss_physics is obtained by substituting the three-dimensional flow field generated by the model into the open channel fluid dynamics control equations and then summing them by weights from the "differentiable open channel hydraulic model constraint module".
[0053] The governing equations for open channel fluid dynamics include:
[0054] Continuity equation constraint L_continuity:
[0055] L_continuity=MSE( ·V_model,0).
[0056] In the formula, MSE is the mean square error. Here, is the Nabla operator, used to calculate the gradient or divergence. V_model is the velocity field of a five-dimensional tensor.
[0057] Momentum equation constraint L_momentum:
[0058] .
[0059] In the formula, , , They are respectively , , The velocity component in the direction. It is a partial derivative. It represents the rate of change of velocity u in the x-direction. This represents the rate of change of velocity u in the y-direction. This represents the rate of change of velocity u in the z-direction. ρ represents the water level elevation. g represents the acceleration due to gravity. This is the gravity gradient term. Frictional slope represents the resistance effect of riverbed friction on water flow.
[0060] Vertical velocity distribution constraint L_profile:
[0061] L_profile=MSE(w(z),w_surface (z / h)^(1 / n)) .
[0062] In the formula, w(z) is the actual flow velocity at depth z on a vertical line randomly sampled from V_model. w_surface is the flow velocity at the water surface on the same vertical line. z is the depth measured from the water surface. h is the total water depth at that vertical line. n is an empirical index.
[0063] Boundary constraints L_boundary include no-slip boundaries and free surface boundaries. No-slip boundary: Using a riverbed topographic mask, the flow velocity values corresponding to the riverbed or channel wall locations in V_model are directly extracted, and their mean square error relative to the zero vector is calculated. Free surface boundary: Using a water surface location mask, the flow field V_surface at the water surface is extracted. Then, automatic differentiation is used to calculate the values at the water surface locations, and their mean square error relative to zero is calculated.
[0064] As a further aspect of the present invention, the physical prior-guided large model adopts a physical-guided conditional diffusion U-Net model. The U-Net model includes 5 layers of encoding and decoding, 64 to 1024 to 64 convolutional kernels, ReLU activation, max pooling, deconvolution, and skip connections.
[0065] As a further aspect of the present invention, the calculation model for the cross-sectional flow rate is as follows:
[0066] Q=∫[A]V_final·dA.
[0067] In the formula, Q represents the final calculated total cross-sectional flow. ∫[A] represents the area integral over the entire wetted cross-section A. V_final is the complete three-dimensional flow field. dA represents an infinitesimal area element on the wetted cross-section A.
[0068] As a further aspect of the present invention, the adaptive three-dimensional flow field reconstruction method further includes: the cloud server fine-tunes and trains a backup lightweight model based on the data of this event, and after verification, sends the updated model parameter package to the edge computing unit 201 to improve its ability to predict similar siltation situations in the future, thereby completing a closed-loop collaborative reasoning and adaptive adjustment.
[0069] As a further aspect of the present invention, the preprocessing also includes: encoding the preprocessed data to obtain a conditional tensor C for inputting into the model. Specifically, the velocity values at the coordinates of the radar current meter are assigned to the corresponding positions at the top layer of C. The velocity values at different depths along the vertical line from the ultrasonic current meter are assigned to the corresponding positions at C. The two-dimensional surface flow field acquired by the image sensor is interpolated or mapped and assigned to the corresponding positions at the top layer of the conditional tensor C. A binary mask tensor M of the same size as C is created. At locations with real sensor data, the value of M is 1. At other locations, the value of M is 0. The conditional tensor C and the mask tensor M are concatenated along the channel dimension to form a multi-channel conditional input, which is then fed into the U-Net model.
[0070] As a further aspect of the present invention, the lightweight prediction model refers to a customized simplified U-Net model obtained from the large U-Net model in the cloud through model distillation or structural simplification, and running on PyTorch or TensorFlow.
[0071] As a further aspect of the present invention, the anomaly detection module performs consistency verification and anomaly detection, specifically including:
[0072] Continuously monitor the consistency between data from various sensors. This includes verifying whether the point velocity measured by the radar and the velocity at the corresponding location in the video flow field are within a preset deviation range.
[0073] Determine if any of the following abnormal events occur: Sensor data exceeds physical thresholds. Measurements from different sensors show a persistent deviation exceeding the threshold. Key sensor signals are lost. The prediction residuals of the lightweight model consistently exceed a preset threshold.
[0074] Secondly, the present invention provides an adaptive three-dimensional flow field reconstruction device for open channel flow, which includes a preprocessing module, a prediction module, an uploading module, a reconstruction module and a flow calculation module.
[0075] The preprocessing module is used to acquire and preprocess multimodal data collected by image sensors, radar flow meters, ultrasonic flow meters, and water level gauges deployed at the open channel site.
[0076] The prediction module is used to perform preliminary three-dimensional flow field prediction on the preprocessed data through cloud-based large model distillation or simplified lightweight prediction model, and the anomaly detection module performs consistency verification and anomaly detection.
[0077] The upload module is used to package and upload multimodal measurement data within the time window of the detected abnormal event to the cloud server. Under normal operating conditions, only measurement results and equipment status data are uploaded.
[0078] The reconstruction module is used by the cloud server to receive the uploaded data packets, guide the large model to reconstruct the three-dimensional flow field of the data through physical priors, and obtain the virtual sensor data of the failed sensor, as well as the three-dimensional uncertainty field.
[0079] The flow calculation module is used to obtain the cross-sectional flow value by numerically integrating the cross-section based on the reconstructed complete three-dimensional flow field, combined with the real-time water level and the latest riverbed topography.
[0080] Thirdly, the present invention provides an adaptive three-dimensional flow field reconstruction system for open channel flow, comprising a processor, a memory, and a computer program stored in the memory. The computer program can be executed by the processor to implement an adaptive three-dimensional flow field reconstruction method for open channel flow as described in any paragraph of the first aspect.
[0081] Fourthly, the present invention provides a computer-readable storage medium comprising a stored computer program, wherein, when the computer program is executed, it controls the system containing the computer-readable storage medium to perform an adaptive three-dimensional flow field reconstruction method for open channel flow as described in any paragraph of the first aspect.
[0082] By adopting the above technical solution, the present invention can achieve the following technical effects:
[0083] This invention constructs a collaborative technical system integrating a sensor layer, an edge computing layer, and a cloud service layer in an open channel scenario. It introduces a large-scale physical prior-guided model centered on a built-in differentiable open channel hydraulic model constraint module. Under sparse point-line-surface multi-source data conditions, it achieves high-precision reconstruction of the complete three-dimensional flow field. The reconstruction results macroscopically satisfy the conservation of flow and momentum, and locally conform to hydraulic laws such as vertical distribution and boundary conditions, thus significantly improving the accuracy and long-term stability of cross-sectional flow measurement. The lightweight prediction model on the edge side and the high-precision model in the cloud are updated incrementally through a "shadow model," enabling the system to maintain high fitting and adaptive capabilities even under long-term disturbances such as riverbed evolution and changes in operating conditions. Simultaneously, relying on a virtual sensor generation mechanism, it still provides continuous and reliable flow data output even when key probes are silted up, damaged, or data is interrupted, effectively improving the robustness and business continuity of the overall system.
[0084] This invention employs an edge-cloud collaborative trigger-based data upload and computation strategy, offloading high-frequency, low-complexity flow prediction tasks to the edge while centralizing complex 3D flow field reconstruction, uncertainty field generation, and operational decision analysis in the cloud. This significantly reduces data transmission and cloud computing overhead while ensuring rapid response to anomalies, achieving a balance between real-time performance and cost-effectiveness. The cloud-generated 3D uncertainty field, combined with virtual sensor data, not only quantifies the reliability of prediction results for each spatial region but also guides sensor deployment optimization and maintenance prioritization. This transforms the operational mode from reactive, reactive repair to proactive, predictive intelligent operation and maintenance, reducing the frequency of manual inspections and on-site maintenance costs. Overall, this improves the intelligence level and lifecycle benefits of the open channel flow monitoring system. Attached Figure Description
[0085] To more clearly illustrate the technical solution of the present invention, the accompanying drawings used in the specific embodiments of the present invention will be briefly introduced below. It should be understood that the following drawings only show some specific embodiments of the present invention and should not be regarded as a limitation on the scope. For those skilled in the art, other related drawings can be obtained from these drawings without creative effort.
[0086] Figure 1This is a hardware structure diagram of an adaptive 3D flow field reconstruction system.
[0087] Figure 2 This is a logic block diagram of the adaptive 3D flow field reconstruction method.
[0088] Figure 3 This is the working logic diagram of the edge computing layer.
[0089] Figure 4 This is a flowchart of high-precision reconstruction in the cloud.
[0090] Figure 5 This is a schematic diagram of the cloud-based intelligent analysis and decision generation process. Detailed Implementation
[0091] The technical solutions of the present invention will now be clearly and completely described with reference to the accompanying drawings in the embodiments of the present invention.
[0092] Example 1, please refer to Figures 1 to 5 The first embodiment of the present invention provides an adaptive three-dimensional flow field reconstruction method for open channel flow, which can be executed by an adaptive three-dimensional flow field reconstruction system for open channel flow (hereinafter referred to as: three-dimensional flow field reconstruction system). In particular, it is executed by one or more processors in the three-dimensional flow field reconstruction system.
[0093] Figure 1 This is a hardware architecture diagram of an adaptive 3D flow field reconstruction system. It illustrates the three-layer structure of the sensor layer, edge computing layer, and cloud service layer, and their interaction relationships. (Refer to...) Figure 1 The system described in this invention includes a sensor layer 100, an edge computing layer 200, and a cloud service layer 300.
[0094] The sensor layer 100 is deployed on the measurement section of the open channel. The sensor layer 100 includes at least one image sensor 101 for acquiring surface flow field images, a radar current meter 102 for acquiring high-precision surface point flow velocities, an ultrasonic current meter 103 for acquiring underwater stratification line flow velocities, and a water level gauge 104 for measuring real-time water levels.
[0095] The edge computing layer 200 is deployed at the measurement site and is typically an edge computing unit 201 with a built-in AI acceleration chip such as a GPU or NPU. This unit is connected to the sensor layer 100 via wired or wireless means and has the ability to access public or private networks. A lightweight prediction model 202 and an anomaly detection module 203 run within the edge computing unit 201.
[0096] The cloud service layer 300 is deployed in a remote data center and includes cloud servers 301 for data storage and high-performance computing. The core physical prior guidance large model 302, intelligent analysis engine 303, and database are deployed on cloud servers 301.
[0097] The adaptive three-dimensional flow field reconstruction method for open channel flow in this invention is specifically an adaptive three-dimensional flow field reconstruction and flow calculation method for open channel flow measurement. This method, through an original edge-cloud collaborative architecture and utilizing a large-scale physical prior guided model centered on a "differentiable open channel hydraulic model constraint module," can not only accurately reconstruct the complete three-dimensional flow field, but also self-adjust under complex operating conditions, diagnose sensor anomalies, and ensure business continuity, thereby improving the accuracy, robustness, and intelligence level of open channel flow measurement.
[0098] The adaptive three-dimensional flow field reconstruction method for open channel flow includes the following steps.
[0099] S1. Acquire multimodal data collected by image sensors, radar flow meters, ultrasonic flow meters, and water level gauges deployed at the open channel site, and perform preprocessing.
[0100] Specifically, it acquires and processes multimodal and multidimensional measurement data from image sensors, radar current meters, ultrasonic current meters, and water level gauges in real time. Preprocessing includes time synchronization and formatting.
[0101] S2. The preprocessed data is initially predicted in three dimensions using a cloud-based large model distillation or a simplified lightweight prediction model, and the anomaly detection module performs consistency verification and anomaly detection.
[0102] Specifically, a lightweight prediction model, pre-distilled or simplified from a large cloud model, is used for high-frequency (e.g., second-level or sub-second-level) preliminary 3D flow field predictions on real-time data. Preferably, the lightweight prediction model refers to a customized simplified U-Net model obtained from a large cloud U-Net model through model distillation or structural simplification (Pruning or Quantization), running on PyTorch or TensorFlow.
[0103] The anomaly detection module performs consistency checks and anomaly detection, as detailed below.
[0104] Continuously monitor the consistency between data from various sensors. This includes verifying whether the point velocity measured by the radar and the velocity at the corresponding location in the video flow field are within a preset deviation range.
[0105] Determine if any of the following abnormal events occur: Sensor data exceeding physical thresholds or drastic fluctuations (such as a sudden surge in water level). Dramatic fluctuations are defined as a squared difference exceeding a preset range. Measurements from different sensors show a sustained deviation exceeding a threshold. This deviation is defined as lasting for one minute. Signal loss from critical sensors. Critical sensors include depth ultrasonic probes or cameras. The prediction residuals of the lightweight model consistently exceed a preset threshold.
[0106] S3. When an abnormal event is detected, the multimodal measurement data within the time window of the abnormal event is packaged and uploaded to the cloud server. Under normal operating conditions, only the measurement results and equipment status data are uploaded.
[0107] Specifically, under normal operating conditions without any abnormalities, only regular, compressed metering results and equipment status data are uploaded to save bandwidth. When the edge computing unit detects an abnormal event, it packages the pre-processed multimodal sensor data within the time window of the event occurrence, along with an abnormal event type tag, and uploads it to the cloud server via the network.
[0108] Figure 3 This is a working logic diagram of the edge computing layer. It shows the complete steps from data acquisition to final traffic calculation, and specifically highlights the collaborative logic between the edge and the cloud.
[0109] Edge computing unit 201 performs the following operations every 1 second: It acquires raw data from various sensors via a data acquisition interface, performs time alignment and filtering / denoising. The processed data is then input into a lightweight prediction model 202 to quickly generate a preliminary 3D flow field. Simultaneously, the anomaly detection module 203 verifies the consistency between the input data and the model output. Under normal circumstances, after calculating the flow rate, the results are cached and the status data is packaged and uploaded to the cloud at a frequency of minutes.
[0110] Anomaly Triggering and Reporting: Suppose that at a certain moment, the bottom probe of the ultrasonic current meter 103 is covered by silt, causing signal interruption. The anomaly detection module 203 immediately detects the loss of sensor data stream and determines it as a "critical sensor failure" anomaly event. Module 203 immediately packages all sensor data (video frames, radar readings, remaining ultrasonic probe data, water level data) from 30 seconds before the event to 10 seconds after the event, marks it as "US_Failure_Event", and uploads it to the cloud service layer 300 via the 4G / 5G network.
[0111] S4. The cloud server receives the uploaded data packets, reconstructs the three-dimensional flow field using a physical prior-guided large model, and acquires virtual sensor data from the failed sensor, as well as a three-dimensional uncertainty field. The physical prior-guided large model employs a physically-guided conditional diffusion U-Net model. During the inference phase, the Dropout layer in the neural network remains active to generate the three-dimensional uncertainty field.
[0112] The physics-prior-guided large-scale model is a pre-trained generative AI model with built-in physics priors. On the cloud server, the following operations are performed: High-precision 3D flow field reconstruction: It receives abnormal data packets uploaded from the edge and invokes a pre-trained generative AI model with built-in physics priors to perform high-precision 3D flow field reconstruction on the data. Virtual sensor data generation: When a sensor gap is detected in the input data (e.g., a failed ultrasonic probe), the large model, based on other valid sensor data and built-in physical laws, infers and generates a "virtual measurement data stream" for the failed probe in the corresponding time period to fill the data gap and perform high-precision reconstruction. 3D uncertainty field generation: Utilizing the probabilistic output characteristics of the large model (e.g., through MC Dropout or inherent model design), a corresponding 3D uncertainty field is generated simultaneously with the flow field generation. This uncertainty field quantifies the reliability of the prediction result at each point in the flow field.
[0113] Figure 4 This is a flowchart of high-precision reconstruction in the cloud. It illustrates the process by which data loss and physical residual loss work together during model training.
[0114] Figure 5 This is a schematic diagram of the cloud-based intelligent analysis and decision-making process. It comprehensively demonstrates how a large cloud-based model intelligently analyzes and guides decision-making when anomalies such as sensor failures are reported at the edge: On one hand, it can infer and generate "virtual sensor" data streams based on other valid data and physical laws to fill data gaps and ensure the integrity of the reconstruction. On the other hand, while generating a high-precision three-dimensional flow field, it outputs a corresponding three-dimensional uncertainty field. By quantifying the predictive reliability of each region, it provides accurate decision-making basis for maintenance work such as increasing sensor deployment or on-site investigation.
[0115] The physical prior-guided large model adopts a physically guided conditional diffusion U-Net model. Its technical details are as follows.
[0116] Network Structure and Parameters (Reproducible U-Net): U-Net consists of 5 layers of encoding and decoding, with the number of convolutional kernels changing from 64 to 1024 and then to 64. It also includes ReLU activation, max pooling, deconvolution, and skip connections. The rationale for choosing this architecture is that U-Net's structure is adept at handling and fusing multi-scale spatial features, effectively integrating heterogeneous sensor data from points, lines, and surfaces. Furthermore, the probabilistic generative nature of the diffusion model provides a solid theoretical foundation for handling missing sensor data (realizing virtual sensors) and quantifying prediction uncertainties.
[0117] The preprocessed data is encoded to obtain the conditional tensor C. The input to the model is not the raw sensor readings, but the encoded conditional tensor C with dimensions consistent with the target flow field grid (e.g., 128×128×64).
[0118] Radar flow velocity (i.e. point data) encoding: The flow velocity value at the (x,y) coordinates of the radar flow meter is assigned to the corresponding position at the top layer of C.
[0119] Ultrasonic flow velocity (i.e. line data) encoding: The flow velocity values of the ultrasonic flow meter at different depths z_j on the vertical line (x_adcp, y_adcp) are assigned to the corresponding positions of C in (x_adcp, y_adcp, z_j).
[0120] Surface flow field (i.e. surface data) encoding: The two-dimensional surface flow field acquired by the image sensor is interpolated or mapped and assigned to the corresponding (x,y) position of the top layer (z=z_surface) of the conditional tensor C.
[0121] Sensor mask encoding: Create a binary mask tensor M of the same size as C. At locations with actual sensor data, M has a value of 1. At other locations (including locations of failed sensors), M has a value of 0.
[0122] Final condition: The condition tensor C and the mask tensor M are concatenated along the channel dimension to form the final, multi-channel condition input, which is then fed into the U-Net model.
[0123] The training process of a large model guided by physical priors includes steps A1 to A4.
[0124] A1. Add noise to x_0 by step t.
[0125] x_t=forward_diffusion(x_0,t,noise) .
[0126] t=random_integer(1,T).
[0127] noise=sample_from_gaussian_distribution(shape=x_0.shape) .
[0128] In the formula, t represents the time step; x_t represents the sample at the t-th step. forward_diffusion indicates adding noise. x_0 is the noise-free image (a real, high-precision 3D flow field training sample during training). noise represents noise. random_integer indicates generating a random integer within a specified range. T is the total number of diffusion steps, such as 1000. sample_from_gaussian_distribution indicates sampling from a Gaussian distribution. shape represents dimensional information.
[0129] A2. Input the noisy flow field, time step t, and condition C into the model to allow the model to learn and predict noise.
[0130] predicted_noise=model(x_t,t,C) .
[0131] In the formula, predicted_noise represents the noise predicted by the model at the current time step. model is an instantiated U-Net network. C is a conditional tensor, constructed based on the sparse sensor data corresponding to x_0.
[0132] A3. Calculate the difference between the predicted noise and the actual noise.
[0133] loss=mean_squared_error(predicted_noise,noise) .
[0134] In the formula, loss represents the loss. mean_squared_error is the mean squared error.
[0135] A4. Backpropagate and update the model parameters based on the gap to finally obtain the trained U-Net network.
[0136] Specifically, the training aims to teach U-Net how to predict the "noise" that needs to be removed based on a noisy image and cues.
[0137] The training data during the training process includes: a large amount of pre-paired, clear and complete flow field maps, and corresponding incomplete sensor data.
[0138] The training process includes noise generation, instruction issuance, core exercises, and iterative optimization. Noise generation: A clear flow field image is randomly selected, called the original image (equivalent to x_0). Then, simulating a sandstorm, a random time step t is chosen, and noise of a corresponding level is added to the original image, resulting in a noisy image (equivalent to x_t). Instruction issuance: Based on the clear flow field corresponding to the original image, an incomplete sensor data sketch is generated, called the conditional sketch (equivalent to C). Core exercises: The "noisy image," "step number," and "conditional sketch" are input into U-Net. The training goal is for U-Net to accurately predict the "noise" added in step 1. Iterative optimization: By comparing the difference between the noise predicted by U-Net and the actual added noise, the internal parameters of U-Net are continuously adjusted.
[0139] The reasoning process includes steps B1 to B6. Among them, the reasoning process reveals the generation principle of the "virtual sensor".
[0140] B1. A conditional tensor constructed from data uploaded from the edge (which may include data from malfunctioning sensors).
[0141] B2. Generate a completely random noise tensor x_T in the spatial dimension of the flow field.
[0142] x_T=sample_from_gaussian_distribution(shape) .
[0143] In the formula, sample_from_gaussian_distribution indicates sampling from a Gaussian distribution; shape represents the dimensional information.
[0144] B3. Input the conditional tensor and x_T into the trained U-Net network and iterate to predict the current noise. The initial value of the loop is T. The final value of the loop is 0. The loop step size is -1.
[0145] predicted_noise=model(x_T,t,C_inference).
[0146] In the formula, predicted_noise is the noise predicted by the model at the current time step; t is the time step; and C_inference is the conditional tensor constructed based on the packaged data including the failed sensors.
[0147] B4. Subtract the predicted noise from the current noisy flow field to obtain a clean flow field (i.e., a noise-free image x_0).
[0148] x_T=reverse_diffusion_step(x_T,t,predicted_noise) .
[0149] In the formula, reverse_diffusion_step represents reverse diffusion.
[0150] B5. After the cycle is completed, the clean flow field is the reconstructed complete three-dimensional flow field V.
[0151] V=x_0.
[0152] B6. Based on the complete three-dimensional flow field V, obtain the virtual sensor data virtual_sensor_value.
[0153] virtual_sensor_value=V(x,y,z) .
[0154] In the formula, (x,y,z) are the coordinates of the failed probe.
[0155] Specifically, the final predicted complete 3D flow field V_final includes the predicted values from the failed sensor (i.e., virtual values, which can be directly extracted). The above inference and training processes realize the combination mechanism of the diffusion model and U-Net.
[0156] Through the above process, those skilled in the art can clearly understand that when the model is inferring, even if some regions of C_inference are missing data, it can still iteratively and completely recover the entire flow field because the model has learned to predict noise from global information (other valid data) and physical laws (through Loss_physics) during training. The data at the missing locations is then naturally inferred and generated.
[0157] This invention employs Monte Carlo Dropout technology to generate the uncertainty field. Specifically, the physical prior-guided large model uses a physically-guided conditional diffusion U-Net model. In this model, a Dropout layer is inserted after each convolutional module of the encoder and decoder, with a dropout rate p set to an empirical value, such as p=0.2. This method keeps the Dropout layers in the neural network active during the inference phase.
[0158] First, multiple random inferences: When the cloud receives data packets from the edge, it does not perform a single 3D flow field reconstruction, but executes N independent inference processes (e.g., N=30). In each inference, due to the randomness of the Dropout layer, different neurons in the network are temporarily dropped, resulting in a slightly different flow field reconstruction result V_i(x,y,z), where i=1...N.
[0159] Then, calculate the statistic:
[0160] The average of the N results is taken as the final complete three-dimensional flow field V_final.
[0161] V_final(x_f,y_f,z_f)=(1 / N) .
[0162] Calculate the sample variance of the results at each spatial point N times. This represents the uncertainty of the prediction result at that point.
[0163] .
[0164] In the formula, N represents the number of inference attempts. (x_f, y_f, z_f) represents the final coordinates of the failed probe. For the first The complete three-dimensional flow field was simulated.
[0165] Through the above steps, those skilled in the art can clearly and repeatably calculate the quantified three-dimensional uncertainty field from the model.
[0166] The core innovation of this model is not simply adding up the loss functions, but rather calculating the physical residual loss Loss_physics through an original "differentiable open channel hydraulic model constraint module," which is an integral part of the model. This module forces the model to conform to the accepted physical laws in the field at every step of data generation, thereby "taming" a general generative model into an expert model in the field of fluid mechanics.
[0167] like Figure 4 As shown, the innovation of the aforementioned large-scale artificial intelligence model lies in its loss function design.
[0168] Loss_total = Loss_data + λ Loss_physics.
[0169] In the formula, Loss_total is the total loss, Loss_data is the fitting loss between the model output and the actual sensor measurement, λ is the weight coefficient, and Loss_physics is the physical residual loss.
[0170] Loss_physics is calculated by a "differentiable open channel hydraulic model constraint module". This module substitutes the three-dimensional flow field generated by the model into the governing equations of open channel fluid dynamics (such as the simplified Navier-Stokes equations, the boundary layer logarithmic / parabolic velocity distribution law, etc.) and calculates the degree to which it deviates from physical laws. This design forces the model to generate a flow field that conforms to hydraulic characteristics while fitting the data, thus solving the "physical black box" problem of general large models.
[0171] The “differentiable open channel hydraulic model constraint module” transforms a set of physical and empirical laws that can be adaptively selected according to the scenario into differentiable mathematical constraints, including core control equation constraints, cross-sectional velocity distribution morphology constraints, and boundary condition constraints.
[0172] The core governing equations include continuity and momentum constraints. By substituting the three-dimensional flow field generated by the model into the Saint-Venant equations for one-dimensional non-uniform flow (expressed in a differentiable form), it is ensured that the reconstructed flow field macroscopically satisfies the conservation laws of flow rate and momentum.
[0173] Continuity equation constraint L_continuity:
[0174] L_continuity=MSE( ·V_model,0).
[0175] In the formula, MSE is the mean square error. Here, is the Nabla operator, used to calculate the gradient or divergence. V_model is the velocity field of a five-dimensional tensor.
[0176] V_model is a five-dimensional tensor representing the velocity field generated by a large model guided by physical priors. Shape: (B, C, D, H, W). B: Batch Size. Represents the number of samples processed simultaneously (e.g., inferring 1 or 8 flow fields at a time). C: Channels. Usually 3 or 4, representing the velocity vector of each spatial point. For example, (u, v, w) represent the velocity components in the x, y, and z directions, respectively. D: Depth. Represents the number of grid points along the channel flow direction (longitudinal). H: Height. Represents the number of grid points along the water depth direction (vertical). W: Width. Represents the number of grid points along the channel width direction (lateral).
[0177] V_model is a velocity field of a five-dimensional tensor (B, C, D, H, W). Its divergence... • The V_model can be efficiently computed by applying a pre-defined, differentiable finite-difference convolution kernel to the velocity tensor along the spatial dimensions (D, H, W). For example, u / x can be obtained by convolving a kernel of the form [-1, 1] in the x-direction.
[0178] Momentum equation constraint L_momentum:
[0179] .
[0180] In the formula, , , They are respectively , , The velocity component in the direction. It is a partial derivative. It represents the rate of change of velocity u in the x-direction. This represents the rate of change of velocity u in the y-direction. This represents the rate of change of velocity u in the z-direction. ρ represents the water level elevation. g represents the acceleration due to gravity. This is the gravity gradient term. Frictional slope represents the resistance effect of riverbed friction on water flow.
[0181] All partial derivative terms in the equation (e.g.) u / x, h / x) are all calculated directly on the velocity field V_model using the framework's automatic differentiation tools such as torch.autograd.grad or tf.GradientTape, without the need to manually write derivative formulas. This ensures that the entire physical constraint is end-to-end differentiable. u, v, w are the components of the velocity field V_model in the x, y, and z directions, respectively.
[0182] Cross-sectional velocity distribution morphology constraints: Different constraints are applied according to the channel type. For example, for regular artificial channels, it is verified whether the vertical velocity distribution conforms to the logarithmic / parabolic distribution law implied by the Chezy-Manning formula.
[0183] Vertical velocity distribution constraint L_profile:
[0184] L_profile=MSE(w(z),w_surface (z / h)^(1 / n)).
[0185] In the formula, w(z) represents the actual flow velocity (usually the velocity in the mainstream direction) at depth z on a vertical line randomly sampled from V_model. w_surface represents the flow velocity at the water surface (z=0) on the same vertical line. z is the depth measured from the water surface, where z=0 at the water surface and z=h at the riverbed. h is the total water depth at that vertical line. n is an empirical index (such as the Manning coefficient) used to control the shape of the velocity distribution along the vertical line.
[0186] Multiple vertical lines are randomly sampled in the velocity field V_model. For each vertical line, the velocity sequence from the water surface to the bottom is extracted and the mean square error (MSE) is calculated between it and the theoretical log / power law distribution sequence calculated based on the water surface velocity w_surface of that vertical line.
[0187] Boundary condition constraints: Strong constraints are applied to the physical boundaries. At the canal walls and riverbed determined by the latest topographic data, the flow field is rigorously verified to satisfy the no-slip condition (velocity approaching zero). At the free water surface determined by level gauge 104, the zero shear stress condition is verified.
[0188] Boundary condition constraints L_boundary include no-slip boundaries and free surface boundaries.
[0189] No-slip boundary: Using the riverbed topographic mask, the flow velocity value corresponding to the riverbed or canal wall position in V_model is directly extracted, and the mean square error between it and the zero vector is calculated.
[0190] Free surface boundary: The flow field V_surface at the water surface is extracted using a water surface position mask. Then, automatic differentiation is used to calculate ( u / z) and ( v / The value of z) at the water surface position is calculated, and its mean square error with respect to zero is also calculated.
[0191] The final Loss_physics is obtained by weighted summation of the above multiple physical residuals, which together guide the model to generate a complete three-dimensional flow field that fits sparse measurement data and strictly follows the corresponding hydraulic principles both globally and locally, including the flow velocity at the location of the failed probe.
[0192] Specifically, the calculation of each loss in Loss_physics can be achieved based on the automatic differentiation function provided by modern deep learning frameworks (such as PyTorch or TensorFlow). This "combinatorial physics constraint" mechanism is one of the key technical contributions of this invention, such as... Figure 4 As shown.
[0193] S5. Based on the reconstructed complete three-dimensional flow field V_final, combined with the real-time water level (upper boundary) and the latest riverbed topography (lower boundary), the cross-sectional flow rate value with high accuracy and high reliability is calculated by numerical integration of the cross-section.
[0194] Q=∫[A]V_final·dA.
[0195] In the formula, Q represents the final calculated total cross-sectional flow. ∫[A] represents the area integral over the entire wetted cross-section A. V_final is the complete three-dimensional flow field. dA represents an infinitesimal area element on the wetted cross-section A.
[0196] The unit of Q is cubic meters per second (m³ / s). The boundary of the wetted cross-section area is determined by real-time water level and the latest riverbed topography data. The complete three-dimensional flow field is a velocity vector field reconstructed in the cloud, with a definite magnitude and direction at each point (x,y,z) in space. V_final·dA represents the product of the projection of the velocity vector onto the normal direction of the area element and the size of that area element, representing the instantaneous flow rate through this tiny area.
[0197] The S6 intelligent analysis engine 303 compares virtual sensor data with historical data from the same period to confirm its rationality. Based on the three-dimensional uncertainty field, it generates maintenance recommendations when the uncertainty around a failed probe is significantly higher than in other areas. For example, a maintenance recommendation might be: "Ultrasonic probe #3 at a certain site is suspected of being faulty; it is recommended to send personnel to check. Temporary data has been compensated by virtual sensors, and business operations have not been interrupted."
[0198] Reference Figure 5 During the reconstruction process in step S4, the physical prior guides the large model to naturally generate flow velocity data at the original location of the failed probe, thus forming the "virtual sensor data." Simultaneously, the engine invokes the large model's probability output function to generate a three-dimensional uncertainty field. Finding that the uncertainty in the area surrounding the failed probe is significantly higher than in other areas, the system automatically generates an operational suggestion.
[0199] The S7 cloud server will send the high-precision reconstruction results of this event (including flow field and flow), virtual sensor data, operation and maintenance suggestions, etc. to the user monitoring platform.
[0200] S7. Based on the data from this event, the cloud server fine-tunes and trains a backup lightweight model. After verification, the updated model parameter package can be sent to the edge computing unit 201 to improve its ability to predict similar congestion situations in the future, thereby completing a closed-loop collaborative reasoning and adaptive adjustment.
[0201] The cloud-based system uses the high-precision flow field results generated after processing abnormal events as the "ground truth" to perform supervised incremental learning on a "shadow model" with the same structure as the edge model. Specifically, the "edge input, cloud high-precision output" of the event is used as a high-quality training sample to fine-tune the "shadow model".
[0202] After verification, the updated model parameters are sent to the edge computing unit 201, enabling it to "learn" and adapt to new flow patterns (such as the flow characteristics after riverbed siltation), thereby completing a closed-loop adaptive evolution.
[0203] Through the above implementation methods, this invention constructs a complete technical system from data perception, edge intelligence, cloud brain to closed-loop control, accurately solving the core pain points in open channel flow measurement and demonstrating significant creativity and practical value.
[0204] High precision and strong adaptability: By introducing a large model with built-in physical priors, the reconstructed flow field is ensured to conform to the laws of fluid mechanics under any operating conditions, greatly improving measurement accuracy. The edge-cloud collaborative adaptive update mechanism enables the system to learn and adapt to long-term changes in flow regime (such as riverbed evolution), and the accuracy will not decay over time.
[0205] High robustness and business continuity: The unique "virtual sensor" generation capability enables the system to maintain high-precision flow measurement even when some sensors fail, ensuring business continuity and greatly reducing losses caused by equipment failure.
[0206] Intelligent operation and maintenance and cost reduction: The edge-cloud collaborative architecture enables automatic detection, diagnosis and reporting of anomalies. The generated three-dimensional uncertainty field can guide sensor layout optimization and maintenance planning, transforming "passive maintenance" into "proactive and predictive operation and maintenance", significantly reducing the cost of manual inspection and maintenance.
[0207] Balancing real-time performance with cost-effectiveness: By placing high-frequency, low-complexity tasks at the edge and high-complexity, low-frequency analyses in the cloud, and employing a trigger-based upload mechanism, this invention ensures millisecond-level response for critical events while significantly saving data transmission bandwidth and cloud computing resources, achieving the best balance between real-time performance and operating costs.
[0208] Example 2: The present invention provides an adaptive three-dimensional flow field reconstruction device for open channel flow, which includes a preprocessing module, a prediction module, an uploading module, a reconstruction module and a flow calculation module.
[0209] The preprocessing module is used to acquire and preprocess multimodal data collected by image sensors, radar flow meters, ultrasonic flow meters, and water level gauges deployed at the open channel site.
[0210] The prediction module is used to perform preliminary three-dimensional flow field prediction on the preprocessed data through cloud-based large model distillation or simplified lightweight prediction model, and the anomaly detection module performs consistency verification and anomaly detection.
[0211] The upload module is used to package and upload multimodal measurement data within the time window of the detected abnormal event to the cloud server. Under normal operating conditions, only measurement results and equipment status data are uploaded.
[0212] The reconstruction module is used by the cloud server to receive the uploaded data packets, guide the large model to reconstruct the three-dimensional flow field of the data through physical priors, and obtain the virtual sensor data of the failed sensor, as well as the three-dimensional uncertainty field.
[0213] The flow calculation module is used to obtain the cross-sectional flow value by numerically integrating the cross-section based on the reconstructed complete three-dimensional flow field, combined with the real-time water level and the latest riverbed topography.
[0214] Example 3: This invention provides an adaptive three-dimensional flow field reconstruction system for open channel flow, comprising a processor, a memory, and a computer program stored in the memory. The computer program can be executed by the processor to implement an adaptive three-dimensional flow field reconstruction method for open channel flow as described in any paragraph of Example 1.
[0215] Example 4: The present invention provides a computer-readable storage medium, the computer-readable storage medium including a stored computer program, wherein, when the computer program is executed, it controls the system where the computer-readable storage medium is located to execute an adaptive three-dimensional flow field reconstruction method for open channel flow as described in any paragraph of Example 1.
[0216] Obviously, the embodiments described above are only some embodiments of the present invention, and not all embodiments. All other embodiments obtained by those skilled in the art based on the embodiments of the present invention without inventive effort are within the scope of protection of the present invention.
[0217] In the several embodiments provided in this invention, it should be understood that the disclosed apparatus and methods can also be implemented in other ways. The apparatus and method embodiments described above are merely illustrative. For example, the flowcharts and block diagrams in the accompanying drawings illustrate the architecture, functionality, and operation of possible implementations of apparatus, methods, and computer program products according to various embodiments of the present invention. In this regard, each block in a flowchart or block diagram may represent a module, segment, or portion of code containing one or more executable instructions for implementing a specified logical function. It should also be noted that in some alternative implementations, the functions marked in the blocks may occur in a different order than those marked in the drawings. For example, two consecutive blocks may actually be executed substantially in parallel, and they may sometimes be executed in reverse order, depending on the functions involved. It should also be noted that each block in a block diagram and / or flowchart, and combinations of blocks in block diagrams and / or flowcharts, can be implemented using a dedicated hardware-based system that performs the specified function or action, or using a combination of dedicated hardware and computer instructions.
[0218] In addition, the functional modules in the various embodiments of the present invention can be integrated together to form an independent part, or each module can exist independently, or two or more modules can be integrated to form an independent part.
[0219] If the aforementioned functions are implemented as software functional modules and sold or used as independent products, they can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present invention, or the part that contributes to the prior art, or a part of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions to cause a computer device (which may be a personal computer, electronic device, or network device, etc.) to execute all or part of the steps of the methods described in the various embodiments of the present invention. The aforementioned storage medium includes various media capable of storing program code, such as USB flash drives, portable hard drives, read-only memory, random access memory, magnetic disks, or optical disks. It should be noted that, in this document, the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such a process, method, article, or apparatus. Without further limitations, an element defined by the phrase "comprising one..." does not exclude the presence of other identical elements in the process, method, article, or apparatus that includes said element.
[0220] The terminology used in the embodiments of this invention is for the purpose of describing particular embodiments only and is not intended to be limiting of the invention. The singular forms “a,” “the,” and “the” used in the embodiments of this invention are also intended to include the plural forms unless the context clearly indicates otherwise.
[0221] It should be understood that the term "and / or" used in this article is merely a description of the relationship between related objects, indicating that three relationships can exist. For example, A and / or B can represent: A existing alone, A and B existing simultaneously, and B existing alone. Additionally, the character " / " in this article generally indicates that the preceding and following related objects have an "or" relationship.
[0222] Depending on the context, the word "if" as used here can be interpreted as "when," "when," "in response to determination," or "in response to detection." Similarly, depending on the context, the phrase "if determination" or "if detection (of the stated condition or event)" can be interpreted as "when determination," "in response to determination," "when detection (of the stated condition or event)," or "in response to detection (of the stated condition or event)."
[0223] The terms "first" and "second" used in the embodiments are merely to distinguish similar objects and do not represent a specific ordering of objects. It is understood that "first" and "second" can be interchanged in a specific order or sequence where permitted. It should be understood that the objects distinguished by "first" and "second" can be interchanged where appropriate so that the embodiments described herein can be implemented in an order other than those illustrated or described herein.
[0224] The above description is merely a preferred embodiment of the present invention and is not intended to limit the invention. Various modifications and variations can be made to the present invention by those skilled in the art. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of the present invention should be included within the scope of protection of the present invention.
Claims
1. An adaptive three-dimensional flow field reconstruction method for open channel flow, characterized in that, Include: S1. Acquire multimodal data collected by image sensors, radar flow meters, ultrasonic flow meters, and water level gauges deployed at the open channel site, and perform preprocessing. S2. The preprocessed data is initially predicted in three dimensions using a cloud-based large model distillation or a simplified lightweight prediction model, and the anomaly detection module performs consistency verification and anomaly detection. S3. When an abnormal event is detected, the multimodal measurement data within the time window of the abnormal event occurrence is packaged and uploaded to the cloud server. Under normal operating conditions, only the metering results and equipment status data are uploaded; S4. The cloud server receives the uploaded data packets, guides the large model to reconstruct the three-dimensional flow field of the data through physical priors, and obtains the virtual sensor data of the failed sensor, as well as the three-dimensional uncertainty field. The reasoning process of the large model guided by physical priors is as follows: Based on the conditional tensor constructed from the data uploaded from the edge, a completely random noise tensor is generated in the flow field space dimension; the conditional tensor and the noise tensor are input into the trained U-Net network for looping to predict the current noise; the predicted noise is subtracted from the current noisy flow field to obtain a clean flow field; after the loop ends, the clean flow field is the reconstructed complete three-dimensional flow field; virtual sensor data is obtained based on the complete three-dimensional flow field. The physical prior-guided large model adopts a physical-guided conditional diffusion U-Net model, and a Dropout layer is inserted after each convolutional module of the encoder and decoder of the U-Net model. The steps for generating a three-dimensional uncertainty field are as follows: After the cloud server receives the data packet, it executes N independent inference processes. In each inference, due to the randomness of the Dropout layer, different neurons in the network are temporarily dropped, resulting in a different flow field reconstruction result. The N results are averaged to obtain the final complete three-dimensional flow field; the sample variance of the N results at each spatial point is calculated as the uncertainty of the prediction result at that spatial point. S5. Based on the reconstructed complete three-dimensional flow field, combined with the real-time water level and the latest riverbed topography, the cross-sectional flow rate is obtained by numerical integration of the cross-section.
2. The adaptive three-dimensional flow field reconstruction method for open channel flow according to claim 1, characterized in that, The noise tensor x_T generated in the spatial dimension of the flow field is represented as: x_T=sample_from_gaussian_distribution(shape); In the formula, sample_from_gaussian_distribution indicates sampling from a Gaussian distribution; shape represents the dimensional information. The conditional tensor and x_T are input into the trained U-Net network and iterated to predict the current noise: predicted_noise=model(x_T,t,C_inference); In the formula, predicted_noise is the noise predicted by the model at the current time step; t is the time step; C_inference is the conditional tensor constructed based on the packaged data including the failed sensors; Subtract the predicted noise from the current noisy flow field to obtain a clean flow field; After the cycle is completed, the clean flow field is the reconstructed complete three-dimensional flow field V; Based on the complete three-dimensional flow field V, obtain the virtual sensor data virtual_sensor_value; virtual_sensor_value=V(x',y',z'); In the formula, (x',y',z') are the coordinates of the failed probe.
3. The adaptive three-dimensional flow field reconstruction method for open channel flow according to claim 2, characterized in that, The N results are averaged to obtain the final complete three-dimensional flow field V_final: V_final(x_f,y_f,z_f)= ; Calculate the sample variance of the results at each spatial point N times. This represents the uncertainty of the spatial point prediction result; ; In the formula, N is the number of inference attempts; (x_f, y_f, z_f) are the final coordinates of the failed probe; For the first The complete three-dimensional flow field was simulated.
4. The adaptive three-dimensional flow field reconstruction method for open channel flow according to claim 1, characterized in that, The training process of a large model guided by physical priors includes: Add noise to x_0 at time step t; x_t=forward_diffusion(x_0,t,noise); t = random_integer(1, T); noise=sample_from_gaussian_distribution(shape=x_0.shape); In the formula, t is the time step; x_t is the sample at the t-th step; forward_diffusion represents adding noise; x_0 is the noise-free image; noise represents noise; random_integer represents generating random integers within a specified range; T is the total number of diffusion steps; sample_from_gaussian_distribution represents sampling from a Gaussian distribution; shape is the dimension information; Input the noisy flow field, time step t, and conditional tensor C into the model, and let the model learn to predict the noise; Calculate the difference between the predicted noise and the actual noise; Based on the gap, backpropagation is performed and the model parameters are updated to obtain the trained U-Net network.
5. The adaptive three-dimensional flow field reconstruction method for open channel flow according to claim 4, characterized in that, The loss function for training large models guided by physical priors is: Loss_total=Loss_data+λ Loss_physics; In the formula, Loss_total is the total loss, Loss_data is the fitting loss between the model output and the actual sensor measurement, λ is the weight coefficient, and Loss_physics is the physical residual loss; Loss_physics is derived by weighted summation of the three-dimensional flow field generated by the model and substituted into the control equations of open channel fluid dynamics by the constraint module of the differentiable open channel hydraulic model. The governing equations for open channel fluid dynamics include: Continuity equation constraint L_continuity: L_continuity=MSE( ·V_model,0); In the formula, MSE is the mean square error; Here, is the Nabla operator, representing the calculation of gradient or divergence; V_model is the velocity field of a five-dimensional tensor. Momentum equation constraint L_momentum: ; In the formula, , , They are respectively , , Flow velocity component in the direction; These are partial derivatives; This represents the rate of change of u in the x-direction; This represents the rate of change of u in the y direction; This represents the rate of change of u in the z direction; Where is the water level elevation; g is the acceleration due to gravity; This is the gravity gradient term; Frictional slope represents the resistance effect of riverbed friction on water flow; Vertical velocity distribution constraint L_profile: L_profile=MSE(w(k),w_surface (k / h)^(1 / n)); In the formula, w(k) is the actual flow velocity at depth k on a vertical line randomly sampled from V_model; w_surface is the flow velocity at the water surface on the same vertical line; z is the depth; h is the total water depth at the vertical line; and n is the empirical index. Boundary condition constraints L_boundary include no-slip boundary and free surface boundary; No-slip boundary: using a riverbed topographic mask, extract the flow velocity values in V_model corresponding to the riverbed or canal wall location, and calculate their mean square error with the zero vector; Free surface boundary: using a surface location mask, extract the flow field V_surface at the water surface; use automatic differentiation to calculate the values at the water surface location, and calculate their mean square error with zero.
6. The adaptive three-dimensional flow field reconstruction method for open channel flow according to claim 1, characterized in that, The calculation model for cross-sectional flow rate is as follows: Q = ∫[A]V_final·dA; In the formula, Q represents the final calculated total cross-sectional flow; ∫[A] represents the area integral over the entire cross-sectional area A; V_final is the complete three-dimensional flow field; dA represents an infinitesimal area element on the cross-sectional area A.
7. The adaptive three-dimensional flow field reconstruction method for open channel flow according to claim 1, characterized in that, Preprocessing also includes: encoding the preprocessed data to obtain the conditional tensor C used as input to the model; specifically, assigning the velocity values at the coordinates of the radar current meter to the corresponding positions at the top layer of C; assigning the velocity values at different depths on the vertical line of the ultrasonic current meter to the corresponding positions of C; assigning the two-dimensional surface flow field acquired by the image sensor to the corresponding positions at the top layer of the conditional tensor C through interpolation or mapping; creating a binary mask tensor M of the same size as C; setting the value of M to 1 at locations with real sensor data and 0 at other locations; concatenating the conditional tensor C and the mask tensor M along the channel dimension to form a multi-channel conditional input, which is then fed into the U-Net model. The lightweight prediction model refers to a simplified U-Net model obtained from the large U-Net model in the cloud through model distillation or structural simplification, and running on PyTorch or TensorFlow. The anomaly detection module performs consistency checks and anomaly detection, specifically including: Continuously monitor the consistency between data from various sensors; including: verifying whether the point velocity measured by the radar and the velocity at the corresponding location in the video flow field are within the preset deviation range; Determine if any of the following abnormal events occur: sensor data exceeds physical thresholds; measurement values between different sensors show a continuous deviation exceeding the threshold; key sensor signals are lost; the prediction residuals of the lightweight model continuously exceed the preset thresholds.
8. An adaptive three-dimensional flow field reconstruction device for open channel flow, used to perform the method according to any one of claims 1-7, characterized in that, The device includes: The preprocessing module is used to acquire and preprocess multimodal data collected by image sensors, radar flow meters, ultrasonic flow meters, and water level gauges deployed at the open channel site. The prediction module is used to perform preliminary three-dimensional flow field prediction on the preprocessed data through a cloud-based large model distillation or a simplified lightweight prediction model, and the anomaly detection module performs consistency verification and anomaly detection. The upload module is used to package and upload multimodal measurement data within the time window of the abnormal event when an abnormal event is detected to the cloud server. Under normal operating conditions, only the metering results and equipment status data are uploaded; The reconstruction module is used to receive the uploaded data packets from the cloud server, guide the large model to reconstruct the three-dimensional flow field of the data through physical priors, and obtain the virtual sensor data of the failed sensor, as well as the three-dimensional uncertainty field. The flow calculation module is used to obtain the cross-sectional flow value by numerically integrating the cross-section based on the reconstructed complete three-dimensional flow field, combined with the real-time water level and the latest riverbed topography.
9. An adaptive three-dimensional flow field reconstruction system for open channel flow, characterized in that, It includes a processor, a memory, and a computer program stored in the memory; the computer program can be executed by the processor to implement an adaptive three-dimensional flow field reconstruction method for open channel flow as described in any one of claims 1 to 7.
10. A computer-readable storage medium, characterized in that, The computer-readable storage medium includes a stored computer program, wherein, when the computer program is executed, it controls the system on which the computer-readable storage medium resides to perform an adaptive three-dimensional flow field reconstruction method for open channel flow as described in any one of claims 1 to 7.
Citation Information
Patent Citations
River flow field reconstruction method based on multilayer flow velocity measurement
CN113642259A