Disclosure of Invention
Aiming at the situation, the system acquires water data by utilizing a plurality of water sensors through setting a network topological structure, preprocesses the water data, guarantees the data quality, provides a data basis for water level measurement, establishes a san-View southern path model to simulate water flow, combines a spectrum density function to simulate water surface waves, establishes a water level measurement model, extracts water level characteristic information, obtains a water level measurement result, and improves the accuracy of model prediction according to comparison verification of an evaluation index and an actual water level.
A water level measurement system based on water environment simulation comprises a data integration module, a data transmission module, a water body simulation module and a water level display module;
The data integration module is connected with the data transmission module, the data transmission module is connected with the water body simulation module and the water level display module, and the water body simulation module is connected with the water level display module.
The data integration module is used for acquiring and fusing water body data to obtain an analog signal of the water body data;
The data transmission module is used for converting the analog signals of the water body data into digital signals and transmitting the digital signals to the water body analog module;
the water body simulation module is used for establishing a water level measurement model, extracting water level characteristic information and generating a water level measurement result according to the water level characteristic information;
The water level display module displays water body data, water level characteristic information and water level measurement results.
The data integration module is used for acquiring and fusing water body data to obtain an analog signal of the water body data, and specifically comprises the following steps:
Step G1, setting a network topology structure, selecting a measurement position as a network node, setting a network node address, and connecting all network nodes for direct communication;
step G2, setting a coordinator, a router and a water body sensor according to a network topological structure, acquiring water body data by using the water body sensor, transmitting the water body data to the network topological structure, managing network nodes by using the coordinator, receiving and processing the water body data acquired by the water body sensor, and relaying signals by using the router;
And G3, setting a threshold range of the water body data, removing abnormal values of the water body data exceeding the threshold range, and filling missing values of the water body data by adopting an average value of adjacent data to obtain analog signals of the water body data.
Further, in step G2, water data is acquired using a water sensor, specifically including the steps of:
g21, measuring the temperature of the water body by using a temperature sensor to obtain water body temperature data;
G22, detecting induced electromotive force generated by water flow by using a flow velocity sensor, and determining the water flow velocity according to the induced electromotive force to obtain water flow velocity data;
Step G23, measuring the water pressure of different depths by using a pressure sensor to obtain water pressure data;
and G24, measuring the geometric parameters of the river channel, including the gradient and the section shape of the river bed, calculating the cross-sectional area and the roughness coefficient of the water, reflecting the resistance of the river channel wall to the water flow and obtaining water body resistance data by using a total station.
The data transmission module converts the analog signals of the water body data into digital signals and transmits the digital signals to the water body analog module, and the method specifically comprises the following steps of:
step T1, performing data calibration on analog signals of water body data, and converting the analog signals of the water body data into digital signals by using an analog-to-digital converter;
step T2, packaging digital signals of water body data into data packets, sending the data packets to a network topology structure by using a water body sensor, and forwarding the data packets to a coordinator through a router;
and step T3, the coordinator extracts the data packet and sends the data packet to the water body simulation module through the serial port.
The water body simulation module establishes a water level measurement model, extracts water level characteristic information, and generates a water level measurement result according to the water level characteristic information, and specifically comprises the following steps:
step S1, establishing a Saint View south equation model, and simulating the water flow conditions of rivers and lakes by using the following formula:
Continuity equation: ;
Momentum equation: ;
wherein A represents the cross-sectional area of water, t represents time, Q represents flow, x represents distance along the river channel, h represents water level, g represents gravitational acceleration, C represents a Xuezhen coefficient, Representing a deviation-solving operation;
S2, discretizing the Saint View south equation model by adopting a finite difference method, and dividing the river channel into computing units in space, wherein the length of each computing unit is Dividing time steps in time, each time step beingt;
For the continuity equation, discretization is performed by adopting a central differential format method, and the used formula is as follows:
;
Wherein j represents a calculation unit number in space, and n represents a time step number;
For the momentum equation, discretizing by adopting a windward format method;
s3, simulating an initial water surface wave by using a spectrum density function, and calculating the water surface waves in different directions by using a directional diffusion function;
S4, setting boundary conditions and initial conditions according to the initial water surface wave, wherein the boundary conditions comprise inlet boundary conditions, outlet boundary conditions and wall boundary conditions, and the initial conditions comprise initial water level setting and initial flow rate setting;
inlet boundary conditions, namely a calculation unit for determining the inflow position of the water body, water body flow velocity data and water body pressure data;
outlet boundary conditions, namely a calculation unit for determining the water outflow position, water flow velocity data and water resistance data;
Wall boundary conditions, namely adopting a non-slip boundary condition for the contact position of the water body and the solid wall surface, and assuming that the speed of the water body on the wall surface is zero;
S5, adopting a self-adaptive grid dividing technology, and carrying out grid refinement on the river channel on each computing unit according to the water flow velocity data and the water resistance data;
fine grids are used at the positions of the river bends and near the water gates, and coarse grids are used in the water flow stable areas;
and S6, establishing a convolutional neural network as a water level measurement model, and inputting water body data into the water level measurement model to obtain a water level measurement result.
Further, the step S3 specifically includes the following steps:
Step S31, simulating an initial water surface wave by using a spectrum density function, creating a two-dimensional initial wave state, and obtaining a nominal wave amplitude, wherein the used formula is as follows:
;
Wherein, Represents the vertical displacement generated on the horizontal axis of the water body surface, Y represents the horizontal axis of the water body surface, t represents time, i represents the parameter point of the water body surface wave,Representing the amplitude of the nominal wave,Representing the cosine function, T representing the matrix transpose operation,Representing wave vector, X represents the horizontal axis position of the surface wave of the water body,Which represents the angular frequency of the light emitted by the light source,Representing the displacement of the surface wave of the water body,Represents the angular frequency of the ith water body surface wave parameter point,Representing the displacement of the ith water surface wave parameter point;
Step S32, propagating the initial wave state forwards, and simulating the wavelength and the relative speed of the surface wave of the water body by using a directional spectrum, wherein the used formula is as follows:
;
Wherein, The change quantity of the angular frequency of the surface wave of the water body is represented,The displacement variation of the surface wave of the water body is represented,Indicating a directional spectrum;
Step S33, the nominal wave amplitude and the directional spectrum are connected in a time step, the relation between the vertical displacement of the surface wave of the water body on each computing unit and the directional spectrum is described, and the following formula is used:
;
Step S34, defining expansion factors in different directions, calculating the influence of the expansion factors in different directions on the surface wave of the water body by combining the expansion factors by using a directional diffusion function, and obtaining a calculation result of the surface wave of the water body, wherein the used formula is shown as follows:
;
Wherein, Representing a directional diffusion function, s representing a parameter related to angular frequency,As a function of the gamma-ray,Represents the directional characteristic of the water surface wave, p represents the expansion factor of the water surface wave,Indicating the directional characteristic of the ith water surface wave parameter point,Indicating the directional characteristic of the surface wave spreading factor of the water body.
Further, the step S6 specifically includes the following steps:
Step S61, building a convolutional neural network, wherein the convolutional neural network is used as a water level measurement model and comprises an input layer, a convolutional layer, a feature extraction layer, a pooling layer and an output layer;
Step S62, dividing a training set and a verification set, namely dividing the training set and the verification set, respectively inputting water pressure data, water flow velocity data and water temperature data as different channels into a convolutional neural network, setting parameters of the convolutional neural network, wherein the parameters comprise weights and offsets, performing forward propagation by using the training set, and obtaining water level measurement results on each calculation unit;
Step 63, determining a loss function, namely calculating a loss value by using the loss function, calculating the gradient of each layer of the convolutional neural network by using a back propagation algorithm, and updating parameters of the convolutional neural network;
step S64, performing iterative training, namely setting the number of training wheels and control parameters, performing iterative training, and repeating the steps S362-S363;
And step S65, water level measurement, namely evaluating the water level measurement model by using the verification set, calculating an evaluation index, and adjusting control parameters according to the evaluation index to obtain a final water level measurement result.
Further, in step S62, performing forward propagation specifically includes the steps of:
Step S621, performing multi-scale feature extraction by using convolution kernels with different sizes, and extracting water level feature information of water body data to obtain a feature map;
Step S622, extracting periodic variation of water body data by using SIREN periodic activation function, weighting and summing each calculation unit, adding bias, and finally obtaining an activated characteristic diagram through the activation function;
Step S623, introducing an attention mechanism in a pooling layer, downsampling the activated feature map, calculating the attention weight of each calculation unit, carrying out weighted pooling on water level feature information of different network nodes, and giving high attention weight to a fine grid.
Further, the step S63 specifically includes the following steps:
Step S631, using the mean square error loss function to provide constraint on the water level measurement results of each calculation unit;
Step S632, using Adam optimization algorithm, self-adaptively adjusting learning rate update parameters, wherein the following formula is used:
;
Wherein, Represents the number of iterative training times,Represent the firstThe parameter values at the time of the training of the next iteration,Represent the firstThe parameter values at the time of the training of the next iteration,The learning rate is indicated as being indicative of the learning rate,A first moment estimate representing the gradient is presented,A second moment estimate representing the gradient is presented,Representing a small constant.
The beneficial effects achieved by the invention are as follows:
(1) The system collects various water body data, provides an information basis for the subsequent accurate water level measurement, the temperature data influences the water body density, the water level is influenced, the flow speed and the pressure data are directly related to the flowing state and the energy of the water body, the water level change is greatly influenced, the actual condition of the water body can be more comprehensively known by integrating the water body data of different types, and the accuracy and the reliability of the water level measurement are improved;
(2) The system establishes a Saint Violet path model to simulate the water flow conditions of rivers and lakes, can accurately describe the flow characteristics of the water under different conditions, including the change of continuity and momentum, converts a continuous physical process into a discrete mathematical model, is convenient for solving and simulation, simulates initial water surface waves by using a spectrum density function, calculates water surface waves in different directions by using a directional diffusion function, and simultaneously sets boundary conditions and initial conditions, so that the model is more in line with the actual water conditions;
(3) The system establishes a convolutional neural network as a water level measurement model, can automatically learn a characteristic mode in water body data, and performs depth analysis and characteristic extraction on the input water body data. Secondly, training and optimizing a network by dividing a training set and a verification set and using a loss function and a back propagation algorithm, so that parameters can be continuously adjusted, the prediction capacity of a model is improved, multi-scale feature extraction and periodic change of neuron extraction of a periodic activation function are performed by adopting convolution kernels with different sizes, and an innovative method of introducing an attention mechanism in a pooling layer is adopted, so that the extraction capacity of the model on water level feature information and the accuracy of a predicted water level measurement result are further improved;
(4) The system can intuitively display water body data, water level characteristic information and water level measurement results, is convenient for a user to acquire related information, does not need to carry out complex data processing and analysis, and hydraulic engineering management staff can know the water level condition in real time through a water level display module to make reasonable decisions in time and adjust the opening of a river sluice.
Detailed Description
The technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings in the embodiments of the present invention.
Referring to FIG. 1, a water level measurement system based on water environment simulation comprises a data integration module, a data transmission module, a water body simulation module and a water level display module;
The data integration module is connected with the data transmission module, the data transmission module is connected with the water body simulation module and the water level display module, and the water body simulation module is connected with the water level display module.
Embodiment 2. The embodiment is based on the above embodiment, referring to fig. 2, the data integration module collects the fused water body data to obtain the analog signal of the water body data, and specifically includes the following steps:
Step G1, setting a network topology structure, selecting a measurement position as a network node, setting a network node address, and connecting all network nodes for direct communication;
step G2, setting a coordinator, a router and a water body sensor according to a network topological structure, acquiring water body data by using the water body sensor, transmitting the water body data to the network topological structure, managing network nodes by using the coordinator, receiving and processing the water body data acquired by the water body sensor, and relaying signals by using the router;
And G3, setting a threshold range of the water body data, removing abnormal values of the water body data exceeding the threshold range, and filling missing values of the water body data by adopting an average value of adjacent data to obtain analog signals of the water body data.
Embodiment 3. This embodiment is based on the above embodiment, and in step G2, the water body data is collected using a water body sensor, and specifically includes the following steps:
g21, measuring the temperature of the water body by using a temperature sensor to obtain water body temperature data;
G22, detecting induced electromotive force generated by water flow by using a flow velocity sensor, and determining the water flow velocity according to the induced electromotive force to obtain water flow velocity data;
Step G23, measuring the water pressure of different depths by using a pressure sensor to obtain water pressure data;
and G24, measuring the geometric parameters of the river channel, including the gradient and the section shape of the river bed, calculating the cross-sectional area and the roughness coefficient of the water, reflecting the resistance of the river channel wall to the water flow and obtaining water body resistance data by using a total station.
Embodiment 4. The data transmission module converts an analog signal of water body data into a digital signal and transmits the digital signal to the water body analog module based on the above embodiment, and specifically includes the following steps:
step T1, performing data calibration on analog signals of water body data, and converting the analog signals of the water body data into digital signals by using an analog-to-digital converter;
step T2, packaging digital signals of water body data into data packets, sending the data packets to a network topology structure by using a water body sensor, and forwarding the data packets to a coordinator through a router;
and step T3, the coordinator extracts the data packet and sends the data packet to the water body simulation module through the serial port.
Embodiment 5. The water body simulation module establishes a water level measurement model, extracts water level characteristic information, and generates a water level measurement result according to the water level characteristic information, wherein the water level measurement result comprises the following steps:
step S1, establishing a Saint View south equation model, and simulating the water flow conditions of rivers and lakes by using the following formula:
Continuity equation: ;
Momentum equation: ;
wherein A represents the cross-sectional area of water, t represents time, Q represents flow, x represents distance along the river channel, h represents water level, g represents gravitational acceleration, C represents a Xuezhen coefficient, Representing a deviation-solving operation;
S2, discretizing the Saint View south equation model by adopting a finite difference method, and dividing the river channel into computing units in space, wherein the length of each computing unit is Dividing time steps in time, each time step beingt;
For the continuity equation, discretization is performed by adopting a central differential format method, and the used formula is as follows:
;
Wherein j represents a calculation unit number in space, and n represents a time step number;
For the momentum equation, discretizing by adopting a windward format method;
s3, simulating an initial water surface wave by using a spectrum density function, and calculating the water surface waves in different directions by using a directional diffusion function;
S4, setting boundary conditions and initial conditions according to the initial water surface wave, wherein the boundary conditions comprise inlet boundary conditions, outlet boundary conditions and wall boundary conditions, and the initial conditions comprise initial water level setting and initial flow rate setting;
S5, adopting a self-adaptive grid dividing technology, and carrying out grid refinement on the river channel on each computing unit according to the water flow velocity data and the water resistance data;
and S6, establishing a convolutional neural network as a water level measurement model, and inputting water body data into the water level measurement model to obtain a water level measurement result.
Embodiment 6 this embodiment is based on the above embodiment, and step S3 specifically includes the following steps:
Step S31, simulating an initial water surface wave by using a spectrum density function, creating a two-dimensional initial wave state, and obtaining a nominal wave amplitude, wherein the used formula is as follows:
;
Wherein, Represents the vertical displacement generated on the horizontal axis of the water body surface, Y represents the horizontal axis of the water body surface, t represents time, i represents the parameter point of the water body surface wave,Representing the amplitude of the nominal wave,Representing the cosine function, T representing the matrix transpose operation,Representing wave vector, X represents the horizontal axis position of the surface wave of the water body,Which represents the angular frequency of the light emitted by the light source,Representing the displacement of the surface wave of the water body,Represents the angular frequency of the ith water body surface wave parameter point,Representing the displacement of the ith water surface wave parameter point;
Step S32, propagating the initial wave state forwards, and simulating the wavelength and the relative speed of the surface wave of the water body by using a directional spectrum, wherein the used formula is as follows:
;
Wherein, The change quantity of the angular frequency of the surface wave of the water body is represented,The displacement variation of the surface wave of the water body is represented,Indicating a directional spectrum;
Step S33, the nominal wave amplitude and the directional spectrum are connected in a time step, the relation between the vertical displacement of the surface wave of the water body on each computing unit and the directional spectrum is described, and the following formula is used:
;
Step S34, defining expansion factors in different directions, calculating the influence of the expansion factors in different directions on the surface wave of the water body by combining the expansion factors by using a directional diffusion function, and obtaining a calculation result of the surface wave of the water body, wherein the used formula is shown as follows:
;
Wherein, Representing a directional diffusion function, s representing a parameter related to angular frequency,As a function of the gamma-ray,Represents the directional characteristic of the water surface wave, p represents the expansion factor of the water surface wave,Indicating the directional characteristic of the ith water surface wave parameter point,Indicating the directional characteristic of the surface wave spreading factor of the water body.
Embodiment 7 this embodiment is based on the above embodiment, and step S6 specifically includes the steps of:
Step S61, building a convolutional neural network, wherein the convolutional neural network is used as a water level measurement model and comprises an input layer, a convolutional layer, a feature extraction layer, a pooling layer and an output layer;
Step S62, dividing a training set and a verification set, namely dividing the training set and the verification set, respectively inputting water pressure data, water flow velocity data and water temperature data as different channels into a convolutional neural network, setting parameters of the convolutional neural network, wherein the parameters comprise weights and offsets, performing forward propagation by using the training set, and obtaining water level measurement results on each calculation unit;
Step 63, determining a loss function, namely calculating a loss value by using the loss function, calculating the gradient of each layer of the convolutional neural network by using a back propagation algorithm, and updating parameters of the convolutional neural network;
step S64, performing iterative training, namely setting the number of training wheels and control parameters, performing iterative training, and repeating the steps S362-S363;
And step S65, water level measurement, namely evaluating the water level measurement model by using the verification set, calculating an evaluation index, and adjusting control parameters according to the evaluation index to obtain a final water level measurement result.
Embodiment 8. This embodiment is based on the above embodiment, and in step S62, performing forward propagation specifically includes the steps of:
Step S621, performing multi-scale feature extraction by using convolution kernels with different sizes, and extracting water level feature information of water body data to obtain a feature map;
In the embodiment, 3×3 and 5×5 convolution kernels are simultaneously used, the 3×3 convolution kernel captures the water body data change in a short time, and the 5×5 convolution kernel captures the water body data change trend on a long time scale;
Step S622, extracting periodic variation of water body data by using SIREN periodic activation function, weighting and summing each calculation unit, adding bias, and finally obtaining an activated characteristic diagram through the activation function;
Step S623, introducing an attention mechanism in a pooling layer, downsampling the activated feature map, calculating the attention weight of each calculation unit, carrying out weighted pooling on water level feature information of different network nodes, and giving high attention weight to a fine grid.
Embodiment 9 this embodiment is based on the above embodiment, and step S63 specifically includes the steps of:
Step S631, using the mean square error loss function to provide constraint on the water level measurement results of each calculation unit;
Step S632, using Adam optimization algorithm, self-adaptively adjusting learning rate update parameters, wherein the following formula is used:
;
Wherein, Represents the number of iterative training times,Represent the firstThe parameter values at the time of the training of the next iteration,Represent the firstThe parameter values at the time of the training of the next iteration,The learning rate is indicated as being indicative of the learning rate,A first moment estimate representing the gradient is presented,A second moment estimate representing the gradient is presented,Representing a small constant.
The present invention and its embodiments have been described in detail, but it should be understood that the invention is not limited to the embodiments and structural arrangements and examples described in the foregoing without departing from the spirit of the invention.