A water level prediction method, device, electronic device and storage medium
The water level prediction method in manhole wells uses a pre-trained model with neural networks and a mercury switch circuit to address the challenge of monitoring in dark environments, ensuring timely and accurate water level warnings.
Patent Information
- Application Number
- CN202111632089.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-12-29
- Publication Date
- 2024-12-31
- Estimated Expiration
- 2041-12-29
AI Technical Summary
Manhole wells are difficult to monitor due to their dark and humid environments, lack of power and lighting, and current methods lack effective water level prediction solutions, leading to safety hazards from water ingress and delayed warnings.
A water level prediction method using a pre-trained model with a feature mapping attention network, bidirectional recurrent neural network, and back propagation neural network to predict water levels, combined with a mercury switch circuit for threshold detection and timely alarms.
Provides accurate and timely water level predictions and alarms, ensuring safety by automatically detecting and warning of excessive water levels in manhole wells.
Smart Images

Figure CN114548483B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of water level monitoring and early warning, and in particular to a water level prediction method, device, electronic equipment and storage medium. Background Art
[0002] As we all know, manholes are usually dark and humid, and water ingress is inevitable, so the equipment in manholes is partially submerged all year round. In addition, manholes are scattered and often in harsh environments. For safety reasons, they are usually not equipped with power and lighting, so daily monitoring is very difficult, and early warning of water levels in manholes is a technical blind spot. Furthermore, since some cable troughs are connected to some important places, such as distribution rooms, the troughs will seep water after being submerged for a long time, causing safety hazards, so it is necessary to deal with the problem of excessive water levels in a timely manner.
[0003] The existing means of monitoring water levels in manhole wells are generally through manual monitoring. In the manual monitoring method, each monitoring requires staff to go to the site and conduct manual surveys. It cannot be automatically executed and cannot timely warn the responsible person. If extreme weather occurs, the timeliness of water level warnings and the safety of equipment in the well are difficult to guarantee. In addition, for management, it is more meaningful to achieve water level prediction, but there is currently no effective water level prediction solution. Summary of the invention
[0004] The embodiments of the present invention provide a water level prediction method, device, electronic device and storage medium, which are used to provide an effective water level prediction solution.
[0005] An embodiment of the present invention provides a water level prediction method, the method comprising:
[0006] Get the water levels of the manhole well at various historical time periods;
[0007] Input each water level of the historical time period into a pre-trained water level prediction model, and determine the first predicted water level at each set time within the set prediction time period based on the feature mapping attention network in the water level prediction model;
[0008] Based on the bidirectional recurrent neural network in the water level prediction model, determining the second predicted water level at each set time within the set prediction time period;
[0009] Based on the back propagation BP neural network in the water level prediction model, nonlinear fitting is performed on the first predicted water level and the second predicted water level to obtain the water levels at each set time within the predicted set time period.
[0010] Furthermore, the obtaining of each water level of the manhole well in a historical time period includes:
[0011] The water levels of the manhole well in the historical time period are obtained by the water level sensor sent through the communication module.
[0012] Furthermore, the feature mapping attention network includes at least two feature mapping attention module groups; the feature mapping attention module groups include an intrinsic feature mapping module and a channel attention module; the intrinsic feature mapping module includes a convolutional layer; and the channel attention module includes a global average pooling layer and a convolutional layer.
[0013] Furthermore, the bidirectional recurrent neural network includes two unidirectional recurrent neural networks in opposite directions.
[0014] Furthermore, the method further comprises:
[0015] Receive electrode conduction indication information sent by the mercury switch circuit through the communication module; wherein the mercury switch circuit is connected to one end of a connecting line, the other end of the connecting line is connected to the bottom of the manhole well, and the length of the connecting line is used to characterize the set water level threshold; when the water level of the manhole well reaches the set water level threshold, the electrode of the mercury switch circuit is turned on and the electrode conduction indication information is sent.
[0016] Furthermore, the method further comprises:
[0017] If there is a water level exceeding the set water level threshold value among the water levels at each set time within the predicted set time period, a first water level alarm prompt information is output; wherein the first water level alarm prompt information carries the set time information corresponding to the water level exceeding the set water level threshold value;
[0018] If the duration of receiving the electrode conduction indication information reaches a preset duration, a second water level alarm prompt information is output; wherein the second water level alarm prompt information carries current time information.
[0019] Furthermore, the training process of the water level prediction model includes:
[0020] Input each sample water level within the first historical duration in the training set into the water level prediction model, and determine the first sample predicted water level at each set moment within the second historical duration after the first historical duration based on the feature mapping attention network in the water level prediction model;
[0021] Determine the second sample predicted water level at each set time within the second historical time period based on the bidirectional recurrent neural network in the water level prediction model;
[0022] Based on the back propagation BP neural network, nonlinear fitting is performed on the first sample predicted water level and the second sample predicted water level to obtain the predicted water level at each set time within the second historical time length;
[0023] Based on the predicted water levels at each set moment within the second historical time period, as well as the actual water levels and loss function at each set moment within the second historical time period, the feature mapping attention network, the bidirectional recurrent neural network and the back propagation BP neural network are trained.
[0024] On the other hand, an embodiment of the present invention provides a water level prediction device, the device comprising:
[0025] An acquisition unit, used for acquiring various water levels of the manhole well in historical time periods;
[0026] A prediction unit, configured to input each water level in the historical time period into a pre-trained water level prediction model, and determine a first predicted water level at each set time within a set prediction time period based on a feature mapping attention network in the water level prediction model;
[0027] Based on the bidirectional recurrent neural network in the water level prediction model, determining the second predicted water level at each set time within the set prediction time period;
[0028] Based on the back propagation BP neural network in the water level prediction model, nonlinear fitting is performed on the first predicted water level and the second predicted water level to obtain the water levels at each set time within the predicted set time period.
[0029] The acquisition unit is specifically used to acquire each water level of the manhole well in a historical time period sent by the water level sensor through the communication module.
[0030] Furthermore, the device also includes:
[0031] A receiving unit is used to receive electrode conduction indication information sent by a mercury switch circuit through a communication module; wherein the mercury switch circuit is connected to one end of a connecting line, the other end of the connecting line is connected to the bottom of the manhole, and the length of the connecting line is used to characterize a set water level threshold; when the water level of the manhole reaches the set water level threshold, the electrode of the mercury switch circuit is turned on and the electrode conduction indication information is sent.
[0032] The device also includes:
[0033] An alarm unit is used to output a first water level alarm prompt message if it is predicted that there is a water level exceeding a set water level threshold among the water levels at each set time within a set time period; wherein the first water level alarm prompt message carries the set time information corresponding to the water level exceeding the set water level threshold; and output a second water level alarm prompt message if the duration of the received electrode conduction indication information reaches a preset duration; wherein the second water level alarm prompt message carries the current time information.
[0034] The device also includes:
[0035] A training unit is used to input each sample water level within a first historical duration in a training set into a water level prediction model, determine the first sample predicted water level at each set moment within a second historical duration after the first historical duration based on a feature mapping attention network in the water level prediction model; determine the second sample predicted water level at each set moment within the second historical duration based on a bidirectional recurrent neural network in the water level prediction model; perform nonlinear fitting on the first sample predicted water level and the second sample predicted water level based on the back propagation BP neural network to obtain the predicted water level at each set moment within the second historical duration; train the feature mapping attention network, the bidirectional recurrent neural network and the back propagation BP neural network based on the predicted water level at each set moment within the second historical duration, as well as the actual water level and loss function at each set moment within the second historical duration.
[0036] On the other hand, an embodiment of the present invention provides an electronic device, including a processor, a communication interface, a memory and a communication bus, wherein the processor, the communication interface and the memory communicate with each other via the communication bus;
[0037] Memory, used to store computer programs;
[0038] The processor is used to implement any of the method steps described above when executing the program stored in the memory.
[0039] On the other hand, an embodiment of the present invention provides a computer-readable storage medium, wherein the computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, any of the method steps described above is implemented.
[0040] An embodiment of the present invention provides a water level prediction method, device, electronic device and storage medium, the method comprising: obtaining each water level of a manhole well in a historical time period; inputting each water level of the historical time period into a pre-trained water level prediction model, and determining a first predicted water level at each set moment within a predicted set time period based on a feature mapping attention network in the water level prediction model; determining a second predicted water level at each set moment within a predicted set time period based on a bidirectional recurrent neural network in the water level prediction model; and performing nonlinear fitting on the first predicted water level and the second predicted water level based on a back propagation BP neural network in the water level prediction model to obtain the water level at each set moment within the predicted set time period.
[0041] The above technical solution has the following advantages or beneficial effects:
[0042] Since a water level prediction model is pre-trained in an embodiment of the present invention, the water levels of the manhole well in the historical time period are first obtained, and then the water levels of the manhole well in the historical time period are input into the pre-trained water level prediction model. The water levels at each set time within the set time period are predicted based on the water level prediction model output. Specifically, the optimal weights for water level prediction are trained based on deep learning technology. The feature mapping attention network is used to capture short-term local dependencies in water level prediction, and the bidirectional recurrent neural network module is used to capture long-term macro dependencies in water level prediction; the BP neural network performs nonlinear fitting on the predicted values of the feature mapping attention network and the bidirectional recurrent neural network model, and determines the weights of the two predicted values in the nonlinear combination, thereby obtaining the final combined predicted water level result. Thus, an effective water level prediction solution is provided. BRIEF DESCRIPTION OF THE DRAWINGS
[0043] In order to more clearly illustrate the technical solutions in the embodiments of the present invention, the drawings required for use in the description of the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.
[0044] Figure 1 A schematic diagram of a water level prediction process provided in Example 1 of the present invention;
[0045] Figure 2 A schematic diagram of a water level prediction process provided in Example 2 of the present invention;
[0046] Figure 3 A schematic diagram of the structure of a lightweight feature mapping attention module provided in Example 2 of the present invention;
[0047] Figure 4 A schematic diagram of the mapping process of the intrinsic feature mapping module provided in Embodiment 2 of the present invention;
[0048] Figure 5 A bidirectional recurrent neural network structure diagram provided in Example 2 of the present invention;
[0049] Figure 6 A schematic diagram of a hardware module provided in a manhole well provided in Example 2 of the present invention;
[0050] Figure 7 A schematic diagram of a hardware module arranged in another manhole provided in Embodiment 2 of the present invention;
[0051] Figure 8 A schematic diagram of the structure of a water level prediction device provided in Example 3 of the present invention;
[0052] Fig. 9This is a schematic diagram of the structure of an electronic device provided in Example 4 of the present invention. DETAILED DESCRIPTION
[0053] The present invention will be further described in detail below in conjunction with the accompanying drawings. Obviously, the described embodiments are only part of the embodiments of the present invention, rather than all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.
[0054] Embodiment 1:
[0055] Figure 1 A schematic diagram of a water level prediction process provided by an embodiment of the present invention, the process includes the following steps:
[0056] S101: Obtaining various water levels of the manhole well in historical time periods.
[0057] S102: Input each water level in the historical time period into a pre-trained water level prediction model, and determine the first predicted water level at each set time within the set prediction time period based on the feature mapping attention network in the water level prediction model.
[0058] S103: Based on the bidirectional recurrent neural network in the water level prediction model, determine the second predicted water level at each set time within the set prediction time period.
[0059] S104: Based on the back propagation BP neural network in the water level prediction model, nonlinear fitting is performed on the first predicted water level and the second predicted water level to obtain the water levels at each set time within the predicted set time period.
[0060] The water level prediction method provided by the embodiment of the present invention is applied to an electronic device, which may be a PC, a tablet computer or the like, or a server, a cloud platform or the like.
[0061] The electronic device first obtains the various water levels of the manhole well in the historical time period. Specifically, a water level sensor and a communication module are arranged in the manhole well. The water level sensor is used to collect the water level of the manhole well in real time or according to a preset period, and send the collected water level to the electronic device through the communication module. The electronic device obtains the various water levels of the manhole well in the historical time period sent by the water level sensor through the communication module. Among them, the historical time period is a historical time period with a preset time length from the current time. For example, if the current time is 8 o'clock and the preset time length is 3 hours, then the various water levels of the manhole well sent by the water level sensor through the communication module between 5 o'clock and 8 o'clock are obtained.
[0062] The electronic device stores a pre-trained water level prediction model, wherein the water level prediction model includes a feature mapping attention network, a bidirectional recurrent neural network, and a back-propagation BP neural network. The water levels of each historical time period are input into the pre-trained water level prediction model, and the first predicted water level at each set moment within the predicted set time period is determined based on the feature mapping attention network; based on the bidirectional recurrent neural network, the second predicted water level at each set moment within the predicted set time period is determined. Finally, based on the back-propagation BP neural network, the first predicted water level and the second predicted water level are nonlinearly fitted to obtain the water levels at each set moment within the predicted set time period. Among them, the water levels at each set moment within the predicted set time period are, for example, the water levels every half hour in the next 6 hours.
[0063] The feature map attention network includes at least two feature map attention module groups; the feature map attention module group includes an intrinsic feature map module and a channel attention module; the intrinsic feature map module includes a convolution layer; the channel attention module includes a global average pooling layer and a convolution layer. The bidirectional recurrent neural network includes two unidirectional recurrent neural networks in opposite directions.
[0064] Since a water level prediction model is pre-trained in an embodiment of the present invention, the water levels of the manhole well in the historical time period are first obtained, and then the water levels of the manhole well in the historical time period are input into the pre-trained water level prediction model. The water levels at each set time within the set time period are predicted based on the water level prediction model output. Specifically, the optimal weights for water level prediction are trained based on deep learning technology. The feature mapping attention network is used to capture short-term local dependencies in water level prediction, and the bidirectional recurrent neural network module is used to capture long-term macro dependencies in water level prediction; the BP neural network performs nonlinear fitting on the predicted values of the feature mapping attention network and the bidirectional recurrent neural network model, and determines the weights of the two predicted values in the nonlinear combination, thereby obtaining the final combined predicted water level result. Thus, an effective water level prediction solution is provided.
[0065] The training process of the water level prediction model includes:
[0066] Input each sample water level within the first historical duration in the training set into the water level prediction model, and determine the first sample predicted water level at each set moment within the second historical duration after the first historical duration based on the feature mapping attention network in the water level prediction model;
[0067] Determine the second sample predicted water level at each set time within the second historical time period based on the bidirectional recurrent neural network in the water level prediction model;
[0068] Based on the back propagation BP neural network, nonlinear fitting is performed on the first sample predicted water level and the second sample predicted water level to obtain the predicted water level at each set time within the second historical time length;
[0069] Based on the predicted water levels at each set moment within the second historical time period, as well as the actual water levels and loss function at each set moment within the second historical time period, the feature mapping attention network, the bidirectional recurrent neural network and the back propagation BP neural network are trained.
[0070] When training the water level prediction model, each sample water level in the first historical time length in the training set is input into the water level prediction model, and the first sample predicted water level at each set moment in the second historical time length after the first historical time length is determined based on the feature mapping attention network; the second sample predicted water level at each set moment in the second historical time length is determined based on the bidirectional recurrent neural network; based on the back propagation BP neural network, the first sample predicted water level and the second sample predicted water level are nonlinearly fitted to obtain the predicted water level at each set moment in the second historical time length. Finally, according to the predicted water level at each set moment in the second historical time length, as well as the actual water level and loss function at each set moment in the second historical time length, the feature mapping attention network, the bidirectional recurrent neural network and the back propagation BP neural network are trained.
[0071] Embodiment 2:
[0072] In order to monitor the sudden surge of water level while predicting the water level, based on the above embodiment, in the embodiment of the present invention, the method further includes:
[0073] Receive electrode conduction indication information sent by the mercury switch circuit through the communication module; wherein the mercury switch circuit is connected to one end of a connecting line, the other end of the connecting line is connected to the bottom of the manhole well, and the length of the connecting line is used to characterize the set water level threshold; when the water level of the manhole well reaches the set water level threshold, the electrode of the mercury switch circuit is turned on and the electrode conduction indication information is sent.
[0074] In an embodiment of the present invention, a mercury switch circuit is arranged in the manhole, the mercury switch circuit is connected to one end of a connecting line, the other end of the connecting line is connected to the bottom of the manhole, and the length of the connecting line is used to characterize the set water level threshold. When the water level of the manhole reaches the set water level threshold, that is, the connecting line is straightened, the mercury switch circuit is tilted, and the electrodes of the mercury switch circuit are turned on. After the electrodes are turned on, electrode conduction indication information is sent to the electronic device through the communication module.
[0075] The method further comprises:
[0076] If there is a water level exceeding the set water level threshold value among the water levels at each set time within the predicted set time period, a first water level alarm prompt information is output; wherein the first water level alarm prompt information carries the set time information corresponding to the water level exceeding the set water level threshold value;
[0077] If the duration of receiving the electrode conduction indication information reaches a preset duration, a second water level alarm prompt information is output; wherein the second water level alarm prompt information carries current time information.
[0078] In an embodiment of the present invention, if it is predicted that there is a water level exceeding the set water level threshold value among the water levels at each set time within the set time period, a first water level alarm prompt information is output. The first water level alarm prompt information is an early warning information, which carries the set time information corresponding to the water level exceeding the set water level threshold value, so that the management personnel know the time when the water level exceeds the set water level threshold value. If the duration of receiving the electrode conduction indication information reaches a preset duration, a second water level alarm prompt information is output. The second water level alarm prompt information is an alarm information, which is used to characterize that the water level at the current moment exceeds the set water level threshold value. The condition for outputting the second water level alarm prompt information is that the duration of receiving the electrode conduction indication information reaches a preset duration. The purpose of such a setting is to avoid false alarms due to accidental water level fluctuations. If the duration of receiving the electrode conduction indication information reaches a preset duration, accidental water level fluctuations can be eliminated, making the alarm more accurate.
[0079] The water level prediction process provided by the embodiment of the present invention is described in detail below with reference to the accompanying drawings.
[0080] The embodiment of the present invention first measures the real-time manhole well water level through a water level sensor, and uses a communication module, such as narrowband cellular Internet of Things (NB-LOT) technology, to transmit the monitoring data to a cloud platform; secondly, the optimal weights for water level prediction are trained based on deep learning technology and visualized; finally, if a sudden over-limit water level problem occurs, the embodiment of the present invention designs a mercury switch circuit to ensure the normal operation of the manhole well water level warning system, so as to achieve the effects of timely automatic monitoring, timely warning and processing, and truly optimize the manhole well water level warning method from the aspects of intelligence, precision and timeliness. The water level prediction process provided by the embodiment of the present invention includes the following steps:
[0081] Step S1: The water level sensor measures the water level every half an hour and transmits the monitoring data to the cloud platform using narrowband cellular Internet of Things (NB-LOT) technology.
[0082] Step S2: Data preprocessing: 70% is used as training set and 30% is used as test set.
[0083] Step S3, put the data set into the manhole well water level prediction algorithm for training and prediction. The algorithm mainly consists of three parts: lightweight feature mapping attention network, bidirectional recurrent neural network and BP neural network. The overall flow chart of the algorithm is as follows Figure 2 shown.
[0084] In the manhole well water level prediction algorithm, the embodiment of the present invention firstly designs a lightweight feature mapping attention network. The network can be composed of four lightweight feature mapping attention modules. The lightweight feature mapping attention module is as follows: Figure 3 As shown, it should be noted that Figure 3 Only a lightweight feature map attention module is drawn in.
[0085] The lightweight feature map attention module includes the intrinsic feature map module and the lightweight channel attention module. The design ideas of the intrinsic feature map module are as follows:
[0086] For a given input h×1×c, c is the number of channels, and h is the input time series. After the historical water level data is processed by convolution, a time series can be obtained. When the size of the convolution kernel is k×1×c and there are n convolution kernels, the size of the output time series feature sequence is h′×1×n. Then, the convolution operation of this layer can be expressed as:
[0087] Y = X*f+b;
[0088] Among them, * represents the convolution operation, X represents the input feature sequence, and f∈R c×k×1×n represents the convolution kernel in this layer, b represents the bias term, and Y∈R h′×1×n Represents the output feature sequence of n channels.
[0089] In the intrinsic feature mapping module, the first step is also a regular convolution operation, but the number of convolution kernels is strictly specified. In the first step, only m original feature sequences are extracted for ordinary convolution operations, that is:
[0090] Y′=X*f′+b;
[0091] Where f′∈R c×k×1×m The m convolution kernels used by this module. In this layer of convolution, the hyperparameters such as the convolution kernel size and step size are the same as those in ordinary convolution. The only difference is that the number of convolution kernels m in this step is set to half of the normal convolution kernel. For example, 64 convolution kernels are normally used in traditional networks, and 32 convolution kernels can be used in the embodiment of the present invention.
[0092] After the original feature sequence is generated, in order to obtain another m feature sequence, just like ordinary convolution, the second step is to map and generate the remaining half of the feature sequence through cheap linear or nonlinear calculations, where mapping can be achieved through channel-by-channel convolution. Figure 4 Φ1 to Φ k This represents the second step of the intrinsic feature mapping module. We use a series of cheap linear or nonlinear operations on each original feature in Y′. In theory, each original feature can be mapped to generate s new feature sequences:
[0093]
[0094] Among them, y i ′ represents the i-th original feature sequence in Y′, and the function Φ i,j Indicates the mapping used to generate the jth new feature sequence y ij A linear or nonlinear function, s represents how many times the original feature sequence is linearly mapped. That is, y i ′ can theoretically map out one or more feature sequences. By using cheap operations, we can obtain at most m×s new feature sequences Y=[y 11 ,y 12 ,...,y ms ]. The cheap operations here can use affine transformation, wavelet transformation, exponential transformation, etc., but these operations are too simple and it is difficult to complete the conversion of multiple features. In the end, we chose 3×1 channel-by-channel convolution because the convolution operation includes many linear operations, such as smoothing, blurring, motion, etc. This ensures that an original feature sequence corresponds to the mapping to generate a new feature sequence, which is more intuitive. After completing the above operations, we concatenate the feature sequences generated in the first and second steps as the output feature sequence of the intrinsic feature mapping module, which includes m original feature sequences and m new feature sequences generated by feature mapping. It can be seen that the output feature sequence obtained by the intrinsic feature mapping module is the same as the output feature sequence obtained by ordinary convolution, but the number of parameters is less than that of ordinary convolution and it is economical and efficient.
[0095] In the embodiment of the present invention, a lightweight channel attention module is designed after the intrinsic feature mapping module. The design idea is as follows:
[0096] For a feature sequence U with an input size of W×1×C, U=[x1,x2,...,xc], the module first performs a one-dimensional operation on the feature sequence U to obtain a one-dimensional feature sequence Z; the embodiment of the present invention performs an average operation on each channel, that is, each feature channel is converted into a real number, which to a certain extent represents the global (W×1) receptive field, and the formula is as follows:
[0097]
[0098] Among them, z c ∈Z={z1,z2,…,z c}, F GAP (·) represents the linear operation of the feature sequence in the feature channel c, x i represents the i-th feature sequence data in feature channel c, and W represents the number of feature sequences in feature channel c.
[0099] After completing the above operations, the input W×1×C feature sequence becomes 1×1×C. After that, we use each channel and its k nearest neighbors to construct a fast one-dimensional convolution yc, and convolve the one-dimensional feature sequence Z with the fast one-dimensional convolution y to obtain the weight W k ; In this step, only z is considered c Information interaction between k nearest neighbors. Compared with the full connection operation, this operation will greatly reduce the complexity of the model. The formula is:
[0100]
[0101] Among them, F h(·) represents the weight of feature channel c learned using one-dimensional convolution, represents the one-dimensional convolution corresponding to the feature channel c, represents the set of non-zero values in all k adjacent channels among c channels, and * represents the convolution operation.
[0102] After that, add Sigmoid and set the weight W k Normalization is performed. However, since the normalized weights are between 0 and 1, the correlation and difference between feature channels are not obvious. Therefore, the normalized weights are amplified to obtain the final weights Fw. In the formula, n is the weight amplification factor. For example, n is 10, that is, the weight range is 0-10, making the important weights more significant.
[0103] Fw=n·σ(W k ), where σ(·) is the Sigmoid function;
[0104] The final weight Fw is used to weight the feature sequence U to obtain the optimized feature sequence; the optimized feature sequence is:
[0105] U′=Fw U; wherein U′ is the optimized feature sequence.
[0106] Through the above operations, the weights are suppressed or enhanced, that is, significant time series features are enhanced, and non-significant time series features are suppressed accordingly. The feature sequence that has completed feature recalibration then enters the next network to continue learning.
[0107] The above convolutional neural network is used to capture short-term local dependencies in water level prediction. In the embodiment of the present invention, in order to solve the problem of historical information loss often faced by time series prediction, a bidirectional recurrent neural network is used to capture the long-term macro dependencies in water level prediction. The structure diagram of the bidirectional recurrent neural network is shown in Figure 2. Figure 5 As shown in the figure. The main structure of the bidirectional recurrent neural network is the combination of two unidirectional recurrent neural networks. At each moment, the input time series will be provided to two recurrent neural networks in opposite directions at the same time. Each network performs calculations independently to generate its own state and output at that moment. The output of the bidirectional recurrent neural network is the concatenation of the outputs of the two unidirectional networks. This structure can provide complete past and future context information for each point in the input sequence of the output layer.
[0108] After completing the learning of the above two models, the present invention uses the BP neural network to perform nonlinear fitting on the predicted values of the lightweight feature mapping attention network and the bidirectional recurrent neural network model. The number of hidden layer neurons of the BP neural network is 12, and the number of network layers is 5. In the embodiment of the present invention, the output of the lightweight feature mapping attention network and the bidirectional recurrent neural network predicting the manhole well water level and the actual water level of the training set are used as the input data of the BP neural network model, and the input data is trained and fitted through the BP neural network model. The weights of the predicted values of the two models in the nonlinear combination are determined to obtain the final combined prediction model. Through the combined prediction model, the final output prediction sequence is the predicted value of the manhole well water level every 30 minutes in the next 6 hours.
[0109] It should be noted that by visualizing the predicted data and reflecting the changing trend of the manhole well water level, timely early warning of the manhole well water level can be completed.
[0110] For the problem of sudden over-limit water level, the embodiment of the present invention designs a mercury switch circuit to ensure the normal operation of the manhole well water level warning system. Its working principle is as follows Figure 6As shown. The mercury switch circuit is built into the hardware module, and the hardware module is wrapped with a lightweight rectangular float. The length of the line connecting the float and the bottom of the manhole is the threshold of the super-alert water level. When the water level in the manhole reaches the warning limit water level, the mercury switch tilts, the mercury can move, and the two electrodes are connected through the mercury. The warning information is sent to the cloud platform through the NB module, and the cloud platform sends it to the person in charge.
[0111] like Figure 6 and Figure 7 As shown, the mercury switch circuit has the following characteristics:
[0112] 1. It can be used in harsh environmental conditions. The mercury switch is sealed, and the mercury inside is isolated from the outside world. It can be used in environments with oil, steam, dust and corrosive gases.
[0113] 2. The external force required for switching on and off is small. When the water level in the manhole reaches the warning limit water level, the mercury switch tilts, the mercury can move, and the two electrodes realize the switching on and off through the mercury.
[0114] 3. Mercury has good conductivity, and the contact resistance between the electrodes of the mercury switch is generally less than 100mΩ.
[0115] 4. The contact point of the electrode is liquid contact, without any noise.
[0116] 5. No mechanical loss, can work repeatedly for a long time.
[0117] 6. Simple and reliable structure, low cost.
[0118] The manhole well water level monitoring and early warning method has the following advantages, which are compared and explained in the following three aspects:
[0119] 1. Design of manhole well warning system: The general manhole well water level monitoring and warning system has extremely high requirements for power supply and signal. The embodiment of the present invention adopts narrowband cellular Internet of Things (NB-LOT) technology to transmit monitoring data to the cloud platform, which is convenient for subsequent algorithm learning and prediction. Through this technology, data transmission cost becomes lower, power consumption becomes lower, and coverage is wider.
[0120] 2. Intelligent monitoring algorithm: At present, the monitoring of manhole well water level, whether manual or equipment monitoring, cannot intelligently analyze data and make predictions, and a single monitoring takes a long time. The present invention designs a manhole well water level prediction algorithm deployed in the cloud. The algorithm is based on deep learning technology to train the optimal weights for water level prediction, and the early warning is accurate and timely. Its core consists of three parts: a lightweight feature mapping attention network, which is used to capture short-term local dependencies in water level prediction, and a lightweight channel attention module is added to the convolutional neural network. By weighting the features of important time periods, the important features in time series analysis are highlighted; a bidirectional recurrent neural network module is used to capture long-term macro dependencies in water level prediction; the BP neural network performs nonlinear fitting on the predicted values of the convolutional neural network and the recurrent neural network model, and determines the weights of the predicted values of the two models in the nonlinear combination, thereby obtaining the final combined prediction model.
[0121] 3. Early warning notification: In the existing water level monitoring method, for sudden rainstorms, underground water seepage and other emergencies, the manhole well water level instantly reaches the over-alert water level threshold and no early warning notification can be given in time. In the present invention, while designing a manhole well water level prediction algorithm in a targeted manner, for the problem of sudden over-limit water level, the present invention designs a mercury switch circuit to ensure the normal operation of the manhole well water level early warning system.
[0122] Embodiment 3:
[0123] Figure 8 A schematic diagram of the structure of a water level prediction device provided by an embodiment of the present invention, the device comprises:
[0124] An acquisition unit 81 is used to acquire each water level of the manhole well in a historical time period;
[0125] The prediction unit 82 is used to input the various water levels in the historical time period into a pre-trained water level prediction model, and determine the first predicted water level at each set moment in the prediction set time period based on the feature mapping attention network in the water level prediction model; determine the second predicted water level at each set moment in the prediction set time period based on the bidirectional recurrent neural network in the water level prediction model; and perform nonlinear fitting on the first predicted water level and the second predicted water level based on the back propagation BP neural network in the water level prediction model to obtain the water level at each set moment in the prediction set time period.
[0126] The acquisition unit 81 is specifically used to acquire each water level of the manhole well in a historical time period sent by the water level sensor through the communication module.
[0127] Furthermore, the device also includes:
[0128] The receiving unit 83 is used to receive the electrode conduction indication information sent by the mercury switch circuit through the communication module; wherein the mercury switch circuit is connected to one end of a connecting line, and the other end of the connecting line is connected to the bottom of the manhole well, and the length of the connecting line is used to characterize the set water level threshold; when the water level of the manhole well reaches the set water level threshold, the electrode of the mercury switch circuit is turned on and the electrode conduction indication information is sent.
[0129] The device also includes:
[0130] The alarm unit 84 is used to output a first water level alarm prompt message if it is predicted that there is a water level exceeding the set water level threshold among the water levels at each set time within the set time period; wherein the first water level alarm prompt message carries the set time information corresponding to the water level exceeding the set water level threshold; if the duration of the received electrode conduction indication information reaches a preset duration, output a second water level alarm prompt message; wherein the second water level alarm prompt message carries the current time information.
[0131] The device also includes:
[0132] The training unit 85 is used to input each sample water level within the first historical time length in the training set into the water level prediction model, determine the first sample predicted water level at each set moment in the second historical time length after the first historical time length based on the feature mapping attention network in the water level prediction model; determine the second sample predicted water level at each set moment in the second historical time length based on the bidirectional recurrent neural network in the water level prediction model; perform nonlinear fitting on the first sample predicted water level and the second sample predicted water level based on the back propagation BP neural network to obtain the predicted water level at each set moment in the second historical time length; train the feature mapping attention network, the bidirectional recurrent neural network and the back propagation BP neural network based on the predicted water level at each set moment in the second historical time length, as well as the actual water level and loss function at each set moment in the second historical time length.
[0133] Embodiment 4:
[0134] Based on the above embodiments, an electronic device is also provided in an embodiment of the present invention, such as Fig. 9 As shown, it includes: a processor 301, a communication interface 302, a memory 303 and a communication bus 304, wherein the processor 301, the communication interface 302, and the memory 303 communicate with each other through the communication bus 304;
[0135] The memory 303 stores a computer program. When the program is executed by the processor 301, the processor 301 performs the following steps:
[0136] Obtain each water level of the manhole well in a historical time period; input each water level of the historical time period into a pre-trained water level prediction model, and determine the first predicted water level at each set moment within the predicted set time period based on the feature mapping attention network in the water level prediction model; determine the second predicted water level at each set moment within the predicted set time period based on the bidirectional recurrent neural network in the water level prediction model; perform nonlinear fitting on the first predicted water level and the second predicted water level based on the back propagation BP neural network in the water level prediction model to obtain the water level at each set moment within the predicted set time period.
[0137] Based on the same inventive concept, an electronic device is also provided in an embodiment of the present invention. Since the principle of solving the problem by the above electronic device is similar to that of the water level prediction method, the implementation of the above electronic device can refer to the implementation of the method, and the repeated parts will not be repeated.
[0138] The electronic device provided in the embodiment of the present invention may specifically be a desktop computer, a portable computer, a smart phone, a tablet computer, a personal digital assistant (PDA), a network side device, etc.
[0139] The communication bus mentioned in the above electronic device can be a Peripheral Component Interconnect (PCI) bus or an Extended Industry Standard Architecture (EISA) bus, etc. The communication bus can be divided into an address bus, a data bus, a control bus, etc. For ease of representation, only one thick line is used in the figure, but it does not mean that there is only one bus or one type of bus.
[0140] The communication interface 302 is used for communication between the electronic device and other devices.
[0141] The memory may include a random access memory (RAM) or a non-volatile memory (NVM), such as at least one disk memory. Optionally, the memory may also be at least one storage device located away from the aforementioned processor.
[0142] The above-mentioned processor can be a general-purpose processor, including a central processing unit, a network processor (NP), etc.; it can also be a digital signal processor (DSP), an application-specific integrated circuit, a field programmable gate array or other programmable logic device, a discrete gate or transistor logic device, a discrete hardware component, etc.
[0143] In the embodiment of the present invention, when the processor executes the program stored in the memory, it realizes obtaining each water level of the manhole well in the historical time period; inputting each water level of the historical time period into a pre-trained water level prediction model, and determining the first predicted water level at each set moment in the predicted set time period based on the feature mapping attention network in the water level prediction model; determining the second predicted water level at each set moment in the predicted set time period based on the bidirectional recurrent neural network in the water level prediction model; and performing nonlinear fitting on the first predicted water level and the second predicted water level based on the back propagation BP neural network in the water level prediction model to obtain the water level at each set moment in the predicted set time period.
[0144] Since a water level prediction model is pre-trained in an embodiment of the present invention, the water levels of the manhole well in the historical time period are first obtained, and then the water levels of the manhole well in the historical time period are input into the pre-trained water level prediction model. The water levels at each set time within the set time period are predicted based on the water level prediction model output. Specifically, the optimal weights for water level prediction are trained based on deep learning technology. The feature mapping attention network is used to capture short-term local dependencies in water level prediction, and the bidirectional recurrent neural network module is used to capture long-term macro dependencies in water level prediction; the BP neural network performs nonlinear fitting on the predicted values of the feature mapping attention network and the bidirectional recurrent neural network model, and determines the weights of the two predicted values in the nonlinear combination, thereby obtaining the final combined predicted water level result. Thus, an effective water level prediction solution is provided.
[0145] Embodiment 4:
[0146] On the basis of the above embodiments, an embodiment of the present invention further provides a computer storage readable storage medium, wherein the computer readable storage medium stores a computer program executable by an electronic device, and when the program is run on the electronic device, the electronic device implements the following steps when executing:
[0147] Obtain each water level of the manhole well in a historical time period; input each water level of the historical time period into a pre-trained water level prediction model, and determine the first predicted water level at each set moment within the predicted set time period based on the feature mapping attention network in the water level prediction model; determine the second predicted water level at each set moment within the predicted set time period based on the bidirectional recurrent neural network in the water level prediction model; perform nonlinear fitting on the first predicted water level and the second predicted water level based on the back propagation BP neural network in the water level prediction model to obtain the water level at each set moment within the predicted set time period.
[0148] Based on the same inventive concept, a computer-readable storage medium is also provided in an embodiment of the present invention. Since the principle of solving the problem when the processor executes the computer program stored on the above-mentioned computer-readable storage medium is similar to the water level prediction method, the implementation of the computer program stored on the above-mentioned computer-readable storage medium by the processor can refer to the implementation of the method, and the repeated parts will not be repeated.
[0149] The above-mentioned computer-readable storage medium can be any available medium or data storage device that can be accessed by the processor in the electronic device, including but not limited to magnetic storage such as floppy disks, hard disks, magnetic tapes, magneto-optical disks (MO), etc., optical storage such as CD, DVD, BD, HVD, etc., and semiconductor storage such as ROM, EPROM, EEPROM, non-volatile memory (NANDFLASH), solid-state drive (SSD), etc.
[0150] The present invention is described with reference to flowcharts and / or block diagrams of methods, devices (systems), and computer program products according to embodiments of the present invention. It should be understood that each process and / or block in the flowchart and / or block diagram, as well as the combination of processes and / or blocks in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing device to produce a machine, so that the instructions executed by the processor of the computer or other programmable data processing device generate instructions for implementing the processes in the flowchart and / or block diagram. Figure 1 A process or multiple processes and / or boxes Figure 1 A device that provides the functions specified in a block or multiple blocks.
[0151] These computer program instructions may also be stored in a computer-readable memory capable of directing a computer or other programmable data processing device to operate in a specific manner, so that the instructions stored in the computer-readable memory produce an article of manufacture comprising an instruction device, which implements the process Figure 1 A process or multiple processes and / or boxes Figure 1 A function specified in one or more boxes.
[0152] These computer program instructions can also be loaded onto a computer or other programmable data processing device so that a series of operating steps are executed on the computer or other programmable device to produce a computer-implemented process, thereby providing instructions for implementing the process. Figure 1 A process or multiple processes and / or boxes Figure 1 The steps for the functions specified in one or more boxes.
[0153] Although the preferred embodiments of the present invention have been described, those skilled in the art may make other changes and modifications to these embodiments once they have learned the basic creative concept. Therefore, the appended claims are intended to be interpreted as including the preferred embodiments and all changes and modifications that fall within the scope of the present invention.
[0154] Obviously, those skilled in the art can make various changes and modifications to the present invention without departing from the spirit and scope of the present invention. Thus, if these modifications and variations of the present invention fall within the scope of the claims of the present invention and their equivalents, the present invention is also intended to include these modifications and variations.
Claims
1. A water level prediction method, characterized in that: The method comprises: Get the water levels of the manhole well at various historical time periods; Input each water level of the historical time period into a pre-trained water level prediction model, and determine the first predicted water level at each set time within the set prediction time period based on the feature mapping attention network in the water level prediction model; Based on the bidirectional recurrent neural network in the water level prediction model, determining the second predicted water level at each set time within the set prediction time period; Based on the back propagation BP neural network in the water level prediction model, nonlinear fitting is performed on the first predicted water level and the second predicted water level to obtain the water level at each set time within the predicted set time period; The feature mapping attention network includes at least two feature mapping attention module groups; the feature mapping attention module groups include an intrinsic feature mapping module and a channel attention module; the intrinsic feature mapping module includes a convolutional layer; the channel attention module includes a global average pooling layer and a convolutional layer.
2. The method according to claim 1, characterized in that The method of obtaining the water levels of the manhole well in the historical time period includes: The water levels of the manhole well in the historical time period are obtained by the water level sensor sent through the communication module.
3. The method according to claim 1, characterized in that The bidirectional recurrent neural network includes two unidirectional recurrent neural networks in opposite directions.
4. The method according to claim 1, characterized in that The method further comprises: Receive electrode conduction indication information sent by the mercury switch circuit through the communication module; wherein the mercury switch circuit is connected to one end of a connecting line, the other end of the connecting line is connected to the bottom of the manhole well, and the length of the connecting line is used to characterize the set water level threshold; when the water level of the manhole well reaches the set water level threshold, the electrode of the mercury switch circuit is turned on and the electrode conduction indication information is sent.
5. The method according to claim 4, characterized in that The method further comprises: If there is a water level exceeding the set water level threshold value among the water levels at each set time within the predicted set time period, a first water level alarm prompt information is output; wherein the first water level alarm prompt information carries the set time information corresponding to the water level exceeding the set water level threshold value; If the duration of receiving the electrode conduction indication information reaches a preset duration, a second water level alarm prompt information is output; wherein the second water level alarm prompt information carries current time information.
6. The method according to claim 1, characterized in that The training process of the water level prediction model includes: Input each sample water level within the first historical duration in the training set into the water level prediction model, and determine the first sample predicted water level at each set moment within the second historical duration after the first historical duration based on the feature mapping attention network in the water level prediction model; Determine the second sample predicted water level at each set time within the second historical time period based on the bidirectional recurrent neural network in the water level prediction model; Based on the back propagation BP neural network, nonlinear fitting is performed on the first sample predicted water level and the second sample predicted water level to obtain the predicted water level at each set time within the second historical time length; Based on the predicted water levels at each set moment within the second historical time period, as well as the actual water levels and loss function at each set moment within the second historical time period, the feature mapping attention network, the bidirectional recurrent neural network and the back propagation BP neural network are trained.
7. A water level prediction device, characterized in that: The device comprises: An acquisition unit, used for acquiring various water levels of the manhole well in historical time periods; A prediction unit is used to input each water level of the historical time period into a pre-trained water level prediction model, and determine a first predicted water level at each set time within the predicted set time period based on a feature mapping attention network in the water level prediction model; determine a second predicted water level at each set time within the predicted set time period based on a bidirectional recurrent neural network in the water level prediction model; perform nonlinear fitting on the first predicted water level and the second predicted water level based on a back propagation BP neural network in the water level prediction model to obtain the water level at each set time within the predicted set time period; The feature mapping attention network includes at least two feature mapping attention module groups; the feature mapping attention module groups include an intrinsic feature mapping module and a channel attention module; the intrinsic feature mapping module includes a convolutional layer; the channel attention module includes a global average pooling layer and a convolutional layer.
8. An electronic device, characterized in that: It includes a processor, a communication interface, a memory and a communication bus, wherein the processor, the communication interface and the memory communicate with each other through the communication bus; Memory, used to store computer programs; A processor, for implementing the method steps described in any one of claims 1 to 6 when executing a program stored in a memory.
9. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the method steps described in any one of claims 1 to 6 are implemented.
