A water conservancy water level data acquisition and transmission system and method based on the Internet of Things

Through the Internet of Things water conservancy water level data collection and transmission system, the inefficiency and inaccuracy of traditional water conservancy water level data measurement methods are solved, real-time acquisition and prediction are realized, and data accuracy and security are improved.

CN118736550BActive Publication Date: 2024-11-12SHENYANG SURVEYING & MAPPING RES INST CO LTD
View PDF 0 Cites 1 Cited by

Patent Information

Application Number
CN202411226491.1
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-09-03
Publication Date
2024-11-12
Estimated Expiration
2044-09-03

AI Technical Summary

Technical Problem

Traditional water conservancy water level data measurement methods are time-consuming and labor-intensive, have large errors, low safety, and cannot achieve real-time acquisition and prediction, and there are a large amount of abnormal data.

Method used

Using the Internet of Things water level data acquisition and transmission system, the real-time water ruler image is obtained for cutting and processing, digital recognition is used for BP neural network, and missing data is filled with two-way exponential smoothing method, isolated forest and three-branch clustering algorithm are deleted Anomaly data and use LSTM neural network to predict data.

Benefits of technology

It improves the accuracy and recognition speed of water conservancy water level data, realizes real-time data acquisition and prediction, eliminates the impact of abnormal data, and enhances the accuracy and safety of data.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118736550B_ABST
    Figure CN118736550B_ABST
Patent Text Reader

Abstract

The present invention relates to the technical field of data processing, and discloses a water conservancy water level data collection and transmission system and method based on the Internet of Things. The present invention first cuts the real-time water gauge image, obtains the number of scale lines from the scale line area image, extracts the characteristic value of the digital area image, inputs the BP neural network for training, performs digital recognition, and obtains a water conservancy water level data set; then fills the missing data in the water conservancy water level data set with an exponential smoothing repair method; then uses an isolation forest algorithm and a three-branch clustering algorithm to delete the abnormal data in the water conservancy water level data set, introduces a red-billed blue magpie optimization algorithm to find the optimal initial clustering center in the three-branch clustering algorithm, eliminates the influence of randomly finding the initial clustering center, and improves the accuracy of the clustering result; finally, the water conservancy water level data of previous years is used to train the LSTM neural network prediction model to realize the prediction of water conservancy water level data.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of data processing, and in particular to a water conservancy water level data collection and transmission system and method based on the Internet of Things. Background Art

[0002] The collection of hydraulic water level data has an important impact on agricultural irrigation, flood warning and disaster prevention and mitigation. However, the traditional hydraulic water level data measurement method is time-consuming and labor-intensive, and the water gauge is read visually. The hydraulic water level data has large errors and low security. At the same time, there are many interferences on the water surface, which is not conducive to real-time measurement of hydraulic water level data. The obtained hydraulic water level data lacks many abnormal data, resulting in incorrect measurement results.

[0003] The Chinese invention patent application with publication number CN117972357A discloses an intelligent processing method for water level monitoring data of a water level measurement device. The method specifically includes: firstly, setting a water level monitoring data as a target data point, constructing a data interval to be compressed with the target data point as the starting point, and setting a thinning threshold in the data interval to be compressed; secondly, obtaining a thinning threshold adjustment coefficient of the data interval to be compressed according to the water level increment in the data interval to be compressed, determining the turning abnormal possibility of the peak and valley value points of the compressed data interval according to the difference of the peak and valley value points of the data interval to be compressed, and generating a constraint parameter of the compressed data interval from the turning abnormal possibility; then obtaining a modified thinning threshold according to the thinning threshold adjustment coefficient and the constraint parameter, and finally compressing the water level data according to the Douglas Peucker compression model by the modified thinning threshold to obtain the water level data. However, this method does not use high-tech technologies such as the Internet of Things, does not realize the real-time acquisition of water level data, and cannot realize water level data prediction. Summary of the invention

[0004] In view of the problems in the related technology, the present invention provides a water conservancy water level data collection and transmission system and method based on the Internet of Things to overcome the above-mentioned technical problems existing in the existing related technology.

[0005] In order to solve the above technical problems, the present invention is achieved through the following technical solutions:

[0006] The present invention is a method for collecting and transmitting water level data based on the Internet of Things, comprising the following steps:

[0007] S1, obtaining a real-time water gauge image, cutting the real-time water gauge image to obtain a scale area image and a digital area image, performing image processing on the scale area image to realize scale recognition, performing character segmentation and 13-point feature value extraction processing on the digital area image, and then using a BP neural network to perform digital recognition to obtain a water conservancy water level data set to be processed;

[0008] S2, fitting the water conservancy and water level data set to be processed to determine the smoothing coefficient, using the bidirectional exponential smoothing repair method to fill the missing data in the water conservancy and water level data set to be processed to obtain a processed water conservancy and water level data set, and introducing an error coefficient to evaluate the processed water conservancy and water level data set;

[0009] S3, generating a water conservancy and water level data matrix from the processed water conservancy and water level data set, using the isolation forest algorithm and the three-branch clustering algorithm to find abnormal data and delete the abnormal data, and finding the optimal initial clustering center based on the red-billed blue magpie optimization algorithm to obtain the final water conservancy and water level data set;

[0010] S4. Divide the water conservancy and water level data sets of previous years into a water conservancy and water level sample set and a water conservancy and water level test set, train the LSTM neural network prediction model to obtain a final LSTM neural network prediction model, and use the final water conservancy and water level data set to predict the water conservancy and water level data.

[0011] The invention obtains a real-time water gauge image and cuts it into a scale area image and a digital area image, performs morphological processing on the scale area image, performs four-neighbor pass processing on the scale line pixels, and uses a labeling method to obtain the number of scale line roots, thereby improving recognition speed and accuracy; then the digital area image is processed by character segmentation and 13-point feature value extraction method, 13 feature values ​​of the digital area image are extracted, and the BP neural network is input for training and digital recognition is performed to obtain a water conservancy and water level data set with good fault tolerance and self-adaptation; secondly, the missing data in the water conservancy and water level data set is filled using an exponential smoothing repair method, and the average value is obtained by obtaining the average value. The sliding coefficient is used to make forward and reverse predictions on missing data, and the predicted values ​​are used to fill in the missing data, which effectively improves the accuracy of water conservancy water level data; the isolation forest algorithm and the three-branch clustering algorithm are used to delete the abnormal data in the water conservancy water level data set, and the optimal initial clustering center in the three-branch clustering algorithm is found based on the red-billed blue magpie optimization algorithm. The optimal fitness function value is found by continuously updating the position during the foraging process of the red-billed blue magpie. This new algorithm has fast convergence speed and strong development capabilities, eliminates the influence of random search for initial clustering centers, and improves the accuracy of clustering results; finally, the water conservancy water level data of previous years is used to train the LSTM neural network prediction model to realize the prediction of water conservancy water level data.

[0012] Preferably, the S1 comprises the following steps:

[0013] S11, obtaining a real-time water gauge image, and setting the lateral characteristic dimension of the real-time water gauge image to , the vertical feature dimension is , generate real-time water gauge image matrix as follows,

[0014] ,

[0015] in, Indicates that the horizontal feature dimension in the real-time water gauge image is , the vertical feature dimension is Pixels of

[0016] Set the vertical projection function of the real-time water gauge image. When the vertical projection function of the real-time water gauge image takes the minimum value, the corresponding horizontal coordinate value is , with the horizontal axis value The real-time water gauge image matrix is ​​divided into a first segmentation matrix and a second segmentation matrix; the pixels in the first segmentation matrix are filled with white to obtain a scale line area image, and the pixels in the second segmentation matrix are filled with white to obtain a digital area image, thereby completing the real-time water gauge image cutting;

[0017] S12, performing scale recognition on the scale line area image, the specific process is as follows:

[0018] S121, setting the horizontal feature dimension of the scale line area image to , the vertical feature dimension is , generate the scale area image matrix as follows,

[0019] ,

[0020] in, Indicates that the horizontal feature dimension in the scale line area image is , the vertical feature dimension is Pixels of

[0021] Performing an erosion operation on the scale line region image, setting a structural element, the structural element including an origin, and selecting a pixel point in the scale line region image matrix; moving the origin point to a pixel point in the scale line region image matrix, and when the pixel point in the scale line region image matrix completely includes the origin point, recording the pixel point in the scale line region image matrix as 1, otherwise recording the pixel point in the scale line region image matrix as 0, to obtain a scale line region image after erosion processing; and then performing an opening operation on the scale line region image after erosion processing to obtain a denoised scale line region image;

[0022] S122, generating a denoised scale line region image matrix from the denoised scale line region image, and setting an image label And the label value is 0, the number of image labels has been attached , the denoised scale line area image is labeled and the image is obtained ; Scan the image matrix of the scale line area after denoising in turn to find the pixel points with a pixel value of 1, and update the number of image labels that have been attached ; The pixel point with the pixel value of 0 is recorded as a pixel point without a label, and the four neighboring labels of the lower right, directly below, lower left and left of the pixel point without a label are set to form a neighboring domain; when the label value of the neighboring domain is equal to 0, then ,image The number of pixels in ; When the label value of the adjacent domain is 1, the image The number of pixels in ; When the label value of the neighboring domain is 2, the label value is and , the label value Replace with and ; Repeat S122 to complete the processing of the pixels in the denoised scale line area image matrix to obtain a processed scale line area image matrix;

[0023] Count the number of pixels with the same label value, then calculate the average number of pixels in the neighboring domain, and set the pixel threshold to , when the absolute value of the difference between the number of pixels with the same label value and the average number of pixels in the neighboring domain is greater than , then the pixel value of the pixel in the adjacent domain is modified to 0 and Otherwise, the pixel values ​​of the pixels in the neighboring domain are not modified, and the updated number of image labels is obtained. ,when If the numbering is not continuous, the number of image labels that have been updated Performing a coding mapping operation to obtain a corrected number of image labels that have been affixed; selecting the maximum label number of the corrected number of image labels that have been affixed, recording the maximum label number as the number of scale lines, and realizing scale recognition;

[0024] S13, digital recognition is performed on the digital area image, and the specific process is as follows:

[0025] S131, setting the horizontal feature dimension of the digital area image to , the vertical feature dimension is , generate digital region image matrix as follows,

[0026] ,

[0027] in, Indicates that the horizontal feature dimension in the digital region image is , the vertical feature dimension is Pixels of

[0028] Scan the digital area image matrix from top to bottom and from left to right to obtain the number of black pixels in each row and a projection histogram, wherein there are gaps in the projection histogram, and the gaps are row segmentation points. The digital area image matrix is ​​segmented by the row segmentation points, and the characters in the bottom row of the digital area image after row segmentation are selected and recorded as row segmentation characters; then, the row segmentation characters are contour projected on the columns, and there are gaps in the contour projections. The row segmentation characters are segmented by the gaps to obtain segmented character images;

[0029] The segmented character image is normalized to obtain a normalized segmented character image, and the normalized segmented character image is resized using a cubic spline interpolation method to obtain a standard segmented character image; the standard segmented character image is set to generate a standard segmented character image matrix, and the standard segmented character image matrix is ​​divided into 2×4 sub-matrices of the same size, and the number of black pixels in the sub-matrix is ​​counted to obtain 8 eigenvalues ​​of the black pixels in the sub-matrix; the number of black pixels in the middle two columns in the horizontal direction and the middle two columns in the vertical direction of the standard segmented character image matrix is ​​counted to obtain 4 eigenvalues ​​of the middle two columns in the horizontal direction and the middle two columns in the vertical direction of the standard segmented character image matrix; the number of black pixels in the standard segmented character image matrix is ​​counted to obtain 1 eigenvalue of the standard segmented character image matrix, and 13 eigenvalues ​​are obtained, which are recorded as eigenvalues ​​to be processed;

[0030] S132, set the number of nodes in the input layer of the BP (back propagation) neural network to 13, the activation function to the Sigmoid function, the number of nodes in the output layer to 4, correct the 0 in the BP neural network to 0.1, correct the 1 to 0.9, and the output layer outputs 8421 code; set the learning rate to , the expected error is , the current number of iterations is , the maximum number of iterations is , obtain a training sample set, wherein the sample data in the training sample set contains 13 eigenvalues; input the training sample set into the BP neural network, and set the error threshold to ,when Less than When the current number of iterations is equal to the maximum number of iterations, the trained BP neural network is obtained; otherwise, the weights are adjusted until Less than And the current number of iterations is equal to the maximum number of iterations; the feature value to be processed is input into the trained BP neural network, and the number closest to the water surface is output to complete the number recognition;

[0031] S14, setting the number of scale lines to , the number closest to the water surface is , the water gauge accuracy is , then the water level The calculation formula is as follows,

[0032]

[0033] The hydraulic water levels constitute a hydraulic water level data set to be processed.

[0034] The invention obtains a real-time water gauge image and cuts it into a scale line area image and a digital area image, performs morphological processing on the scale line area image, connects the scale line pixels on four sides, and uses a labeling method to obtain the number of scale line roots. The method is clever and simple, and improves recognition speed and accuracy. The digital area image is then processed by character segmentation and 13-point feature value extraction method to extract 13 feature values ​​of the digital area image, and then inputs the BP neural network for training to perform digital recognition, thereby improving character extraction and recognition efficiency.

[0035] Preferably, S2 comprises the following steps:

[0036] S21, the water conservancy and water level data to be processed in the water conservancy and water level data set to be processed are processed

[0037] Perform first-order difference and second-order difference operations to obtain first-order difference results and second-order difference results. Fit the first-order difference results and second-order difference results to obtain the smoothing coefficient ; Select the water level data set to be processed Missing data at any time, set The time parameter is , and ,but time, Moment and The calculation formula of the moment prediction value is as follows:

[0038]

[0039] in, express time, Moment and The predicted value at that moment, and ;

[0040] when When , the predicted values ​​at time 1, time 2 and time 3 are obtained, and the initial estimated values ​​are obtained by combining the smoothing coefficient, and the initial estimated values ​​are used to replace the initial water conservancy water level data in the water conservancy water level data set to be processed to obtain the replaced water conservancy water level data set;

[0041] S22, setting the replaced water level data set ,in express Real-time water level data; setting The missing data at the moment is , split the replaced water level data set into a forward prediction set and the reverse prediction set ,in express The previous digit of the missing data at the moment, express The last bit of the missing data at the moment is used to perform forward prediction on the forward prediction set and reverse prediction on the reverse prediction set. The calculation formula is as follows:

[0042]

[0043]

[0044] in, express The forward prediction value at time, express The reverse prediction value at time , and the forward prediction parameter is , and , the reverse prediction parameter is , and , , ;

[0045] The The forward prediction value at time The weighted sum of the reverse prediction values ​​at the time is calculated to get the final prediction result, which is When there are missing data at any moment, the final prediction results are used to fill in the missing data of the replaced water level data set;

[0046] S23, repeat S22 to calculate the missing data in the replaced water conservancy and water level data set to obtain a final prediction result set, fill the replaced water conservancy and water level data set with the final prediction result set to obtain a processed water conservancy and water level data set; fit the processed water conservancy and water level data set to obtain a fitting data set, calculate the error coefficient of the fitting data set and the water conservancy and water level data set to be processed, set the fitting data in the fitting data set to , the average value of the fitting data in the fitting data set is The water level data to be processed in the water level data set to be processed is , the calculation formula is as follows,

[0047] ,

[0048] in, represents the error coefficient, Indicates the first Fitting data, Indicates the first The average value of the fitted data, Indicates the first Water level data to be processed, ;

[0049] Set the first threshold to , when the error coefficient is less than When the final prediction result set is accurate, a processed water level data set is obtained; otherwise, the final prediction result set is inaccurate, and S21 and S22 are repeated until the error coefficient is less than .

[0050] The invention fills the missing data using an exponential smoothing repair method. First, the data in the hydraulic water level data set is fitted to obtain a smoothing coefficient to get an initial prediction value. Then, the forward prediction and reverse prediction of the missing data are weighted and summed to get the prediction value, i.e., the missing data. The prediction value is used to fill the missing data, and an error coefficient is introduced to evaluate the accuracy of the prediction value, thereby effectively improving the accuracy of the hydraulic water level data.

[0051] Preferably, S3 comprises the following steps:

[0052] S31, setting the processed water level data set to ,in Indicates The processed water level data has the following characteristic dimensions: , generate water level data matrix as follows,

[0053] ,

[0054] in, Indicates The feature dimension is Processed water level data of water resources;

[0055] Select a column in the water level data matrix as the water level sampling sample set, denoted as ,in Indicates The feature dimension is The water conservancy water level sampling sample data is used to calculate the abnormal score of the water conservancy water level sampling sample set using the isolation forest algorithm, and the second threshold is set to , when the abnormal score of the water level sampling sample set is greater than When the abnormal score of the water conservancy water level sampling sample set is equal to the water conservancy water level sample data set, the water conservancy water level sample data set corresponding to the abnormal score of the water conservancy water level sampling sample set is added to the normal water conservancy water level sample data set; otherwise, the water conservancy water level sample data set corresponding to the abnormal score of the water conservancy water level sampling sample set is added to the abnormal water conservancy water level sample data set, and the abnormal water conservancy water level sample data set is discarded;

[0056] S32, using a three-branch clustering algorithm on the normal water level sample data set, select The sample data is used as the initial cluster center to obtain the cluster set, and the distance from the sample data in the normal water conservancy water level sample data set to the initial cluster center is calculated, which is recorded as , the smallest The corresponding sample data in the normal water conservancy water level sample data set is added to the cluster set, and the red-billed blue magpie optimization algorithm is used to find the optimal initial clustering center in the cluster set. The specific process is as follows:

[0057] S321, set the cluster set to include sample data, the characteristic dimension of the sample data is , among the red-billed blue magpie population, the population size of the red-billed blue magpie is , the characteristic dimension of the red-billed blue magpie is ,set up Indicates that the red-billed blue magpie Dimension upper limit, Indicates that the red-billed blue magpie Dimension lower limit, represents a random number and , initial position of red-billed blue magpie The calculation formula is as follows,

[0058]

[0059] S322, set the fitness function to ,in represents the number of samples in the cluster set, represents the number of cluster sets, Represents the first The centroid of the samples, represents the centroid of the cluster set, Represents the first Sample data, , ;

[0060] In the process of searching for food, the red-billed blue magpie sets the current number of iterations to , No. The food position for the next iteration is The population of red-billed blue magpie is , the position of a randomly selected individual red-billed blue magpie in the red-billed blue magpie population is , No. The position of a randomly selected red-billed blue magpie individual in the red-billed blue magpie population in the iteration is , represents a random number and , then The calculation formula for the position of the red-billed blue magpie in the iteration is as follows:

[0061]

[0062] in, Indicates the first The individual locations of the red-billed blue magpie, Indicates The position of the red-billed blue magpie in the second iteration, Indicates The position of the red-billed blue magpie in the second iteration, ;

[0063] The red-billed blue magpie keeps moving in the process of searching for food, and the cluster set keeps iterating to find the minimum fitness function value;

[0064] S323, the red-billed blue magpie is in the process of attacking food. At this time, the fitness function value is updated and the food position is set to , the food coefficient is , Represents a normally distributed random number, with a maximum number of iterations of , then The red-billed blue magpie updates its position in the second iteration The calculation formula is as follows,

[0065] ,

[0066] ;

[0067] The red-billed blue magpie stores food. The fitness function value of the iteration is less than The fitness function value of the iteration is saved. The fitness function value of the iteration is continuously updated, and when the current number of iterations is equal to the maximum number of iterations, the iteration is stopped to obtain the best position of the red-billed blue magpie, which is the optimal initial clustering center;

[0068] S33, calculating the membership of the sample data in the normal water conservancy water level sample data set to the optimal initial clustering center, obtaining a membership set, dividing the membership set into a core domain and a boundary domain, and setting a third threshold value to , and add the members with a membership greater than The corresponding cluster center is added to the core domain, and the membership in the membership set is less than or equal to The corresponding cluster center is added to the boundary domain; the average value of the sample data in the normal water conservancy water level sample data set is calculated as the new cluster center, and S33 is repeated until the cluster center no longer changes, and the clustering of the normal water conservancy water level sample data set is completed. The sample data in the normal water conservancy water level sample data set corresponding to the membership in the boundary domain is deleted, and the abnormal data is deleted to obtain the final water conservancy water level data set.

[0069] The invention uses the isolation forest algorithm and the three-branch clustering algorithm to delete abnormal data in the water conservancy water level data set, distinguishes and clusters the abnormal values ​​and normal values, and then finds the optimal initial clustering center in the three-branch clustering algorithm based on the red-billed blue magpie optimization algorithm, thereby eliminating the influence of randomly searching for the initial clustering center and improving the accuracy of the clustering results. The red-billed blue magpie optimization algorithm converges quickly and has strong development capabilities.

[0070] Preferably, S4 comprises the following steps:

[0071] S41, obtaining water level data of previous years, and forming a water level data set of previous years: ,in Indicates previous years Water conservancy water level data sets of previous years are divided into water conservancy water level sample sets and water level test set ,in Indicates previous years Water conservancy water level data; the water conservancy water level sample set is input into the LSTM (Long Short-Term Memory) neural network for training, the sample data in the water conservancy water level sample set updates the cell state through the input gate, and then is processed by the sigmoid activation function of the forget gate and input into the input gate, and the cell state outputs the predicted value;

[0072] Set the root mean square error and learning rate of the LSTM neural network, and the root mean square error threshold is , when the RMS error is less than When , the LSTM neural network stops iterating and obtains the LSTM neural network prediction model, otherwise the weight is adjusted until the root mean square error is less than ; Then input the water level test set into the LSTM neural network prediction model, and set the accuracy threshold to , when the precision of the output result is greater than When , the iteration stops and the final LSTM neural network prediction model is obtained. Otherwise, S41 and S42 are repeated until the accuracy of the output result is greater than ; Input the final water conservancy water level data set into the final LSTM neural network prediction model, output the water conservancy water level prediction value, realize the water conservancy water level data prediction, and upload the processed water conservancy water level data set and water conservancy water level prediction value to the water conservancy water level monitoring platform.

[0073] This invention divides the water level data of previous years into a training set and a test set, uses the training set and the test set to train and verify the LSTM neural network, and obtains the final LSTM neural network prediction model to achieve the prediction of water level data. The LSTM neural network maintains long-term storage of information through a recurrent network architecture with a complex gating mechanism added to hidden units, and has a better prediction effect than other neural networks.

[0074] This embodiment also discloses a system for collecting and transmitting water level data based on the Internet of Things, which specifically includes: a real-time water gauge image recognition and processing module, a water level missing data filling module, a water level abnormal data deletion module and a water level data prediction module;

[0075] The real-time water gauge image recognition and processing module is used to process and recognize the scale and numbers of the real-time water gauge image respectively, and calculate the water level data;

[0076] The water conservancy water level missing data filling module is used to fill the missing data in the water conservancy water level data set to be processed using a two-way exponential smoothing repair method;

[0077] The water conservancy water level abnormal data deletion module is used to delete abnormal data after finding it using the isolation forest algorithm and the three-branch clustering algorithm;

[0078] The water conservancy water level data prediction module is used to predict the water conservancy water level data using the LSTM neural network prediction model.

[0079] The present invention has the following beneficial effects:

[0080] 1. The invention obtains a real-time water gauge image and cuts it into a scale line area image and a digital area image, performs morphological processing on the scale line area image, thereby improving recognition speed and accuracy; then the digital area image is processed by character segmentation and 13-point feature value extraction method, and then input into the BP neural network for training to achieve digital recognition and improve character extraction and recognition efficiency.

[0081] 2. The invention uses an exponential smoothing repair method to fill in missing data in a hydraulic water level data set. By obtaining smoothing coefficients for forward and reverse predictions of missing data, the predicted values ​​are used to fill in missing data, thereby effectively improving the accuracy of hydraulic water level data.

[0082] 3. The invention uses the isolation forest algorithm and the three-branch clustering algorithm to delete abnormal data in the water conservancy and water level data set, and then finds the optimal initial clustering center in the three-branch clustering algorithm based on the red-billed blue magpie optimization algorithm, thereby eliminating the influence of randomly searching for the initial clustering center and improving the accuracy of the clustering results; finally, the water conservancy and water level data of previous years are used to train the LSTM neural network prediction model to realize the prediction of water conservancy and water level data. The LSTM neural network can maintain long-term storage of information, and the prediction effect is higher than other neural networks.

[0083] Of course, any product implementing the present invention does not necessarily need to achieve all of the advantages described above at the same time. BRIEF DESCRIPTION OF THE DRAWINGS

[0084] In order to more clearly illustrate the technical solutions of the embodiments of the invention, the drawings required for describing the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the invention. For ordinary technicians in this field, they can also obtain drawings based on these drawings without paying creative work.

[0085] Figure 1 The present invention provides a schematic flow chart of water conservancy water level data collection and transmission by a water conservancy water level data collection and transmission system based on the Internet of Things. DETAILED DESCRIPTION

[0086] The following will be combined with the drawings in the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not 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.

[0087] In the description of the present invention, it is necessary to understand that the terms "opening", "upper", "lower", "top", "middle", "inside" and the like indicating orientation or positional relationship are only for the convenience of describing the invention and simplifying the description, and do not indicate or imply that the components or elements referred to must have a specific orientation, be constructed and operate in a specific orientation, and therefore cannot be understood as limiting the invention.

[0088] This embodiment discloses a method for collecting and transmitting water level data based on the Internet of Things, which specifically includes the following contents:

[0089] S1, obtaining a real-time water gauge image, cutting the real-time water gauge image to obtain a scale area image and a digital area image, performing image processing on the scale area image to realize scale recognition, performing character segmentation and 13-point feature value extraction processing on the digital area image, and then using a BP neural network to perform digital recognition to obtain a water conservancy water level data set to be processed;

[0090] The S1 comprises the following steps:

[0091] S11, obtaining a real-time water gauge image, and setting the lateral characteristic dimension of the real-time water gauge image to , the vertical feature dimension is , generate real-time water gauge image matrix as follows,

[0092] ,

[0093] in, Indicates that the horizontal feature dimension in the real-time water gauge image is , the vertical feature dimension is Pixels of

[0094] Set the vertical projection function of the real-time water gauge image. When the vertical projection function of the real-time water gauge image takes the minimum value, the corresponding horizontal coordinate value is , with the horizontal axis value The real-time water gauge image matrix is ​​divided into a first segmentation matrix and a second segmentation matrix; the pixels in the first segmentation matrix are filled with white to obtain a scale line area image, and the pixels in the second segmentation matrix are filled with white to obtain a digital area image, thereby completing the real-time water gauge image cutting;

[0095] S12, performing image processing on the scale line area image to realize scale recognition, the specific process is as follows:

[0096] S121, setting the horizontal feature dimension of the scale line area image to , the vertical feature dimension is , generate the scale area image matrix as follows,

[0097] ,

[0098] in, Indicates that the horizontal feature dimension in the scale line area image is , the vertical feature dimension is Pixels of

[0099] Performing an erosion operation on the scale line region image, setting a structural element, the structural element including an origin, and selecting a pixel point in the scale line region image matrix; moving the origin point to a pixel point in the scale line region image matrix, and when the pixel point in the scale line region image matrix completely includes the origin point, recording the pixel point in the scale line region image matrix as 1, otherwise recording the pixel point in the scale line region image matrix as 0, to obtain a scale line region image after erosion processing; and then performing an opening operation on the scale line region image after erosion processing to obtain a denoised scale line region image;

[0100] S122, generating a denoised scale line region image matrix from the denoised scale line region image, and setting an image label And the label value is 0, the number of image labels has been attached , the denoised scale line area image is labeled and the image is obtained ; Scan the image matrix of the scale line area after denoising in turn to find the pixel points with a pixel value of 1, and update the number of image labels that have been attached ; The pixel point with the pixel value of 0 is recorded as a pixel point without a label, and the four neighboring labels of the lower right, directly below, lower left and left of the pixel point without a label are set to form a neighboring domain; when the label value of the neighboring domain is equal to 0, then ,image The number of pixels in ; When the label value of the adjacent domain is 1, the image The number of pixels in ; When the label value of the neighboring domain is 2, the label value is and , the label value Replace with and ; Repeat S122 to complete the processing of the pixels in the denoised scale line area image matrix to obtain a processed scale line area image matrix;

[0101] Count the number of pixels with the same label value, then calculate the average number of pixels in the neighboring domain, and set the pixel threshold to , when the absolute value of the difference between the number of pixels with the same label value and the average number of pixels in the neighboring domain is greater than , then the pixel value of the pixel in the adjacent domain is modified to 0 and Otherwise, the pixel values ​​of the pixels in the neighboring domain are not modified, and the updated number of image labels is obtained. ,when If the numbering is not continuous, the number of image labels that have been updated Performing a coding mapping operation to obtain a corrected number of image labels that have been affixed; selecting the maximum label number of the corrected number of image labels that have been affixed, recording the maximum label number as the number of scale lines, and realizing scale recognition;

[0102] S13, after segmenting the digital area image by characters and extracting the 13-point feature value, use the BP neural network to perform digital recognition, the specific process is as follows:

[0103] S131, setting the horizontal feature dimension of the digital area image to , the vertical feature dimension is , generate digital region image matrix as follows,

[0104] ,

[0105] in, Indicates that the horizontal feature dimension in the digital region image is , the vertical feature dimension is Pixels of

[0106] Scan the digital area image matrix from top to bottom and from left to right to obtain the number of black pixels in each row and a projection histogram, wherein there are gaps in the projection histogram, and the gaps are row segmentation points. The digital area image matrix is ​​segmented at the row segmentation points, and the characters in the bottom row of the digital area image after row segmentation are selected and recorded as row segmentation characters; then, the row segmentation characters are contour projected on the columns, and there are gaps in the contour projections. The row segmentation characters are segmented into columns at the gaps to obtain segmented character images;

[0107] The segmented character image is normalized to obtain a normalized segmented character image, and the normalized segmented character image is resized using a cubic spline interpolation method to obtain a standard segmented character image; the standard segmented character image is set to generate a standard segmented character image matrix, and the standard segmented character image matrix is ​​divided into 2×4 sub-matrices of the same size, and the number of black pixels in the sub-matrix is ​​counted to obtain 8 eigenvalues ​​of the black pixels in the sub-matrix; the number of black pixels in the middle two columns in the horizontal direction and the middle two columns in the vertical direction of the standard segmented character image matrix is ​​counted to obtain 4 eigenvalues ​​of the middle two columns in the horizontal direction and the middle two columns in the vertical direction of the standard segmented character image matrix; the number of black pixels in the standard segmented character image matrix is ​​counted to obtain 1 eigenvalue of the standard segmented character image matrix, and 13 eigenvalues ​​are obtained, which are recorded as eigenvalues ​​to be processed;

[0108] S132, set the number of nodes in the BP neural network input layer to 13, the activation function to the Sigmoid function, the number of nodes in the output layer to 4, correct the 0 in the BP neural network to 0.1, correct the 1 to 0.9, and the output layer outputs 8421 code; set the learning rate to , the expected error is , the current number of iterations is , the maximum number of iterations is , obtain a training sample set, wherein the sample data in the training sample set contains 13 eigenvalues; input the training sample set into the BP neural network, and set the error threshold to ,when Less than When the current number of iterations is equal to the maximum number of iterations, the trained BP neural network is obtained; otherwise, the weights are adjusted until Less than And the current number of iterations is equal to the maximum number of iterations; the feature value to be processed is input into the trained BP neural network, and the number closest to the water surface is output to complete the number recognition;

[0109] S14, setting the number of scale lines to , the number closest to the water surface is , the water gauge accuracy is , then the water level The calculation formula is as follows,

[0110]

[0111] A water resources water level data set to be processed is formed by the water resources water level;

[0112] S2, fitting the water conservancy and water level data set to be processed to determine the smoothing coefficient, using the bidirectional exponential smoothing repair method to fill the missing data in the water conservancy and water level data set to be processed to obtain a processed water conservancy and water level data set, and introducing an error coefficient to evaluate the processed water conservancy and water level data set;

[0113] The S2 comprises the following steps:

[0114] S21, the water conservancy and water level data to be processed in the water conservancy and water level data set to be processed are processed

[0115] Perform first-order difference and second-order difference operations to obtain first-order difference results and second-order difference results. Fit the first-order difference results and second-order difference results to obtain the smoothing coefficient ; Select the water level data set to be processed Missing data at any time, set The time parameter is , and ,but time, Moment and The calculation formula of the moment prediction value is as follows:

[0116]

[0117] in, express time, Moment and The predicted value at that moment, and ;

[0118] when When , the predicted values ​​at time 1, time 2 and time 3 are obtained, and the initial estimated values ​​are obtained by combining the smoothing coefficient, and the initial estimated values ​​are used to replace the initial water conservancy water level data in the water conservancy water level data set to be processed to obtain the replaced water conservancy water level data set;

[0119] S22, setting the replaced water level data set ,in express Real-time water level data; setting The missing data at the moment is , split the replaced water level data set into a forward prediction set and the reverse prediction set ,in express The previous digit of the missing data at the moment, express The last bit of the missing data at the moment is used to perform forward prediction on the forward prediction set and reverse prediction on the reverse prediction set. The calculation formula is as follows:

[0120]

[0121]

[0122] in, express The forward prediction value at time, express The reverse prediction value at time , and the forward prediction parameter is , and , the reverse prediction parameter is , and , , ;

[0123] The The forward prediction value at time The weighted sum of the reverse prediction values ​​at the time is calculated to get the final prediction result, which is When there are missing data at any moment, the final prediction results are used to fill in the missing data of the replaced water level data set;

[0124] S23, repeat S22 to calculate the missing data in the replaced water conservancy and water level data set to obtain a final prediction result set, fill the replaced water conservancy and water level data set with the final prediction result set to obtain a processed water conservancy and water level data set; fit the processed water conservancy and water level data set to obtain a fitting data set, calculate the error coefficient of the fitting data set and the water conservancy and water level data set to be processed, set the fitting data in the fitting data set to , the average value of the fitting data in the fitting data set is The water level data to be processed in the water level data set to be processed is , the calculation formula is as follows,

[0125] ,

[0126] in, represents the error coefficient, Indicates the first Fitting data, Indicates the first The average value of the fitted data, Indicates the first Water level data to be processed, ;

[0127] Set the first threshold to , when the error coefficient is less than When the final prediction result set is accurate, a processed water level data set is obtained; otherwise, the final prediction result set is inaccurate, and S21 and S22 are repeated until the error coefficient is less than ;

[0128] S3, generating a water conservancy and water level data matrix from the processed water conservancy and water level data set, using the isolation forest algorithm and the three-branch clustering algorithm to find abnormal data and delete the abnormal data, and finding the optimal initial clustering center based on the red-billed blue magpie optimization algorithm to obtain the final water conservancy and water level data set;

[0129] The S3 comprises the following steps:

[0130] S31, setting the processed water level data set to ,in Indicates The processed water level data has the following characteristic dimensions: , generate water level data matrix as follows,

[0131] ,

[0132] in, Indicates The feature dimension is Processed water level data of water resources;

[0133] Select a column in the water level data matrix as the water level sampling sample set, denoted as ,in Indicates The feature dimension is The water conservancy water level sampling sample data is used to calculate the abnormal score of the water conservancy water level sampling sample set using the isolation forest algorithm, and the second threshold is set to , when the abnormal score of the water level sampling sample set is greater than When the abnormal score of the water conservancy water level sampling sample set is equal to the water conservancy water level sample data set, the water conservancy water level sample data set corresponding to the abnormal score of the water conservancy water level sampling sample set is added to the normal water conservancy water level sample data set; otherwise, the water conservancy water level sample data set corresponding to the abnormal score of the water conservancy water level sampling sample set is added to the abnormal water conservancy water level sample data set, and the abnormal water conservancy water level sample data set is discarded;

[0134] S32, using a three-branch clustering algorithm on the normal water level sample data set, select The sample data is used as the initial cluster center to obtain the cluster set, and the distance from the sample data in the normal water conservancy water level sample data set to the initial cluster center is calculated, which is recorded as , the smallest The corresponding sample data in the normal water conservancy water level sample data set is added to the cluster set, and the red-billed blue magpie optimization algorithm is used to find the optimal initial clustering center in the cluster set. The specific process is as follows:

[0135] S321 Set the cluster set to include sample data, the characteristic dimension of the sample data is , among the red-billed blue magpie population, the population size of the red-billed blue magpie is , the characteristic dimension of the red-billed blue magpie is ,set up Indicates that the red-billed blue magpie Dimension upper limit, Indicates that the red-billed blue magpie Dimension lower limit, represents a random number and , initial position of red-billed blue magpie The calculation formula is as follows,

[0136]

[0137] S322, set the fitness function to ,in represents the number of samples in the cluster set, represents the number of cluster sets, Represents the first The centroid of the samples, represents the centroid of the cluster set, Represents the first Sample data, , ;

[0138] In the process of searching for food, the red-billed blue magpie sets the current number of iterations to , No. The food position for the next iteration is The population of red-billed blue magpie is , randomly select red-billed blue magpie individuals from the red-billed blue magpie population , No. In the iteration, a red-billed blue magpie individual is randomly selected from the red-billed blue magpie population. , represents a random number and , then The calculation formula for the position of the red-billed blue magpie in the iteration is as follows:

[0139]

[0140] in, Indicates the first The location of each individual red-billed blue magpie, Indicates The position of the red-billed blue magpie in the second iteration, Indicates The position of the red-billed blue magpie in the second iteration, ;

[0141] The red-billed blue magpie keeps moving in the process of searching for food, and the cluster set keeps iterating to find the minimum fitness function value;

[0142] S323, the red-billed blue magpie is in the process of attacking food. At this time, the fitness function value is updated and the food position is set to , the food coefficient is , Represents a normally distributed random number, with a maximum number of iterations of , then The red-billed blue magpie updates its position in the second iteration The calculation formula is as follows,

[0143] ,

[0144] ;

[0145] The red-billed blue magpie stores food. The fitness function value of the iteration is less than The fitness function value of the iteration is saved. The fitness function value of the iteration is continuously updated, and when the current number of iterations is equal to the maximum number of iterations, the iteration is stopped to obtain the best position of the red-billed blue magpie, which is the optimal initial clustering center;

[0146] S33, calculating the membership of the sample data in the normal water conservancy water level sample data set to the optimal initial clustering center, obtaining a membership set, dividing the membership set into a core domain and a boundary domain, and setting a third threshold value to , and add the members with a membership greater than The corresponding cluster center is added to the core domain, and the membership in the membership set is less than or equal to The corresponding cluster center is added to the boundary domain; the average value of the sample data in the normal water conservancy water level sample data set is calculated as the new cluster center, and S33 is repeated until the cluster center no longer changes, and the clustering of the normal water conservancy water level sample data set is completed, and the sample data in the normal water conservancy water level sample data set corresponding to the membership degree in the boundary domain is deleted, and the abnormal data is deleted to obtain the final water conservancy water level data set;

[0147] S4, dividing the water conservancy water level data set of previous years into a water conservancy water level sample set and a water conservancy water level test set, training the LSTM neural network prediction model to obtain a final LSTM neural network prediction model, inputting the final water conservancy water level data set into the final LSTM neural network prediction model, and outputting the water conservancy water level prediction value;

[0148] The S4 comprises the following steps:

[0149] S41, obtaining water level data of previous years, and forming a water level data set of previous years: ,in Indicates previous years Water conservancy water level data sets of previous years are divided into water conservancy water level sample sets and water level test set ,in Indicates previous years Water conservancy water level data; the water conservancy water level sample set is input into the LSTM neural network for training, the sample data in the water conservancy water level sample set updates the cell state through the input gate, and then is processed by the sigmoid activation function of the forget gate and input into the input gate, and the cell state outputs the predicted value;

[0150] Set the root mean square error and learning rate of the LSTM neural network, and the root mean square error threshold is , when the RMS error is less than When , the LSTM neural network stops iterating and obtains the LSTM neural network prediction model, otherwise the weight is adjusted until the root mean square error is less than ; Then input the water level test set into the LSTM neural network prediction model, and set the accuracy threshold to , when the precision of the output result is greater than When , the iteration stops and the final LSTM neural network prediction model is obtained. Otherwise, S41 is repeated until the accuracy of the output result is greater than ; Input the final water conservancy water level data set into the final LSTM neural network prediction model, output the water conservancy water level prediction value, realize the water conservancy water level data prediction, and upload the processed water conservancy water level data set and water conservancy water level prediction value to the water conservancy water level monitoring platform.

[0151] This embodiment also discloses a system for collecting and transmitting water level data based on the Internet of Things, which specifically includes: a real-time water gauge image recognition and processing module, a water level missing data filling module, a water level abnormal data deletion module and a water level data prediction module;

[0152] The real-time water gauge image recognition and processing module is used to process and recognize the scale and numbers of the real-time water gauge image respectively, and calculate the water level data;

[0153] The water conservancy water level missing data filling module is used to fill the missing data in the water conservancy water level data set to be processed using a two-way exponential smoothing repair method;

[0154] The water conservancy water level abnormal data deletion module is used to delete abnormal data after finding it using the isolation forest algorithm and the three-branch clustering algorithm;

[0155] The water conservancy water level data prediction module is used to predict the water conservancy water level data using the LSTM neural network prediction model.

[0156] In the description of this specification, the description with reference to the terms "one embodiment", "example", "specific example", etc. means that the specific features, structures, materials or characteristics described in conjunction with the embodiment or example are included in at least one embodiment or example of the invention. In this specification, the schematic representation of the above terms does not necessarily refer to the same embodiment or example. Moreover, the specific features, structures, materials or characteristics described can be combined in any one or more embodiments or examples in a suitable manner.

[0157] The preferred embodiments of the invention disclosed above are only used to help explain the invention. The preferred embodiments do not describe all the details in detail, nor do they limit the invention to the specific implementation methods described. Obviously, many modifications and changes can be made according to the content of this specification. This specification selects and specifically describes these embodiments in order to better explain the principles and practical applications of the invention, so that those skilled in the art can understand and use the invention well.

Claims

1. A method for collecting and transmitting water level data based on the Internet of Things, characterized in that: The steps include: S1, obtaining a real-time water gauge image, cutting the real-time water gauge image to obtain a scale area image and a digital area image, performing image processing on the scale area image to realize scale recognition, performing character segmentation and 13-point feature value extraction processing on the digital area image, and then using a BP neural network to perform digital recognition to obtain a water conservancy water level data set to be processed; S2, fitting the water conservancy and water level data set to be processed to determine the smoothing coefficient, using the bidirectional exponential smoothing repair method to fill the missing data in the water conservancy and water level data set to be processed to obtain a processed water conservancy and water level data set, and introducing an error coefficient to evaluate the processed water conservancy and water level data set; S3, generating a water conservancy and water level data matrix from the processed water conservancy and water level data set, using the isolation forest algorithm and the three-branch clustering algorithm to find and delete abnormal data, and find the optimal initial clustering center to obtain the final water conservancy and water level data set; S4. Divide the water conservancy and water level data set of previous years into a water conservancy and water level sample set and a water conservancy and water level test set, train the LSTM neural network to obtain a final LSTM neural network prediction model, input the final water conservancy and water level data set into the final LSTM neural network prediction model, and output the water conservancy and water level prediction value.

2. According to the method for collecting and transmitting water level data based on the Internet of Things in claim 1, it is characterized in that: The S1 comprises the following steps: S11, obtaining a real-time water gauge image, performing vertical projection on the real-time water gauge image, obtaining a scale line area image and a digital area image, and completing the real-time water gauge image cutting; S12, performing image processing on the scale line area image to realize scale recognition and obtain the number of scale line roots; S13, performing character segmentation and 13-point feature value extraction processing on the digital area image, and then using a BP neural network to perform digital recognition to obtain the number closest to the water surface; S14, calculating the hydraulic level according to the number of scale lines and the number closest to the water surface to form a hydraulic level data set to be processed.

3. The method for collecting and transmitting water level data based on the Internet of Things according to claim 2 is characterized in that: The S12 comprises the following steps: S121, performing image recognition on the scale line region image to obtain a denoised scale line region image; S122, using the four-neighbor pass method and the labeling method to process the denoised scale line area image to obtain the maximum label number of the image labels, and record the maximum label number as the number of scale line roots to achieve scale recognition.

4. The method for collecting and transmitting water level data based on the Internet of Things according to claim 3 is characterized in that: The S13 comprises the following steps: S131, performing character segmentation and 13-point feature value extraction processing on the digital area image, extracting 13 feature values ​​of the digital area image, and recording them as feature values ​​to be processed; S132, set the number of nodes in the BP neural network input layer to 13, the activation function to Sigmoid function, the number of nodes in the output layer to 4, correct the 0 in the BP neural network to 0.1, correct the 1 to 0.9, and the output layer outputs 8421 code; set the learning rate to , the expected error is , the current number of iterations is , the maximum number of iterations is , obtain a training sample set, wherein the sample data in the training sample set includes 13 eigenvalues; Input the training sample set into the BP neural network and set the error threshold to ,when Less than When the current number of iterations is equal to the maximum number of iterations, the trained BP neural network is obtained; Otherwise adjust the weights until Less than And the current number of iterations is equal to the maximum number of iterations; The feature value to be processed is input into the trained BP neural network, and the number closest to the water surface is output to complete the number recognition.

5. The method for collecting and transmitting water level data based on the Internet of Things according to claim 4 is characterized in that: The S2 comprises the following steps: S21, performing differential operation on the water resources and water level data set to be processed and then performing fitting to obtain a smoothing coefficient and a replaced water resources and water level data set; S22. Divide the replaced water conservancy water level data set into a forward prediction set and a reverse prediction set, use the bidirectional exponential smoothing repair method to perform forward prediction and reverse prediction, then perform weighted summation on the forward prediction value and the reverse prediction value and calculate the mean to obtain the final prediction result, and use the final prediction result to fill in the missing data of the replaced water conservancy water level data set to obtain the processed water conservancy water level data set.

6. The method for collecting and transmitting water level data based on the Internet of Things according to claim 5 is characterized in that: The final prediction result set is composed of missing data, and the error coefficient is calculated; the first threshold is set to , when the error coefficient is less than When the final prediction result set is accurate, a processed water level data set is obtained; otherwise, the final prediction result set is inaccurate, and S21 and S22 are repeated until the error coefficient is less than .

7. The method for collecting and transmitting water level data based on the Internet of Things according to claim 6 is characterized in that: The S3 comprises the following steps: S31, the processed water conservancy and water level data set generates a water conservancy and water level data matrix, selects a column in the water conservancy and water level data matrix as a water conservancy and water level sampling sample set, uses an isolation forest algorithm to divide the water conservancy and water level sampling sample set into a normal water conservancy and water level sample data set and an abnormal water conservancy and water level sample data set, and discards the abnormal water conservancy and water level sample data set; S32, using a three-branch clustering algorithm on the normal water level sample data set, select The sample data is used as the initial cluster center to obtain the cluster set, and the red-billed blue magpie optimization algorithm is used to find the optimal initial cluster center in the cluster set; S33. Calculate the membership of the sample data in the normal water conservancy and water level sample data set to the optimal initial clustering center to obtain a membership set, divide the membership set into a core domain and a boundary domain, delete the sample data in the normal water conservancy and water level sample data set corresponding to the membership in the boundary domain, complete the deletion of abnormal data, and obtain the final water conservancy and water level data set.

8. The method for collecting and transmitting water level data based on the Internet of Things according to claim 7 is characterized in that: The S32 comprises the following steps: S321, set the cluster set to include sample data, the characteristic dimension of the sample data is , among the red-billed blue magpie population, the population size of the red-billed blue magpie is , the characteristic dimension of the red-billed blue magpie is ,set up Indicates that the red-billed blue magpie Dimension upper limit, Indicates that the red-billed blue magpie Dimension lower limit, represents a random number and , initial position of red-billed blue magpie The calculation formula is as follows, ; S322, set the fitness function, the red-billed blue magpie in the process of searching for food, set the current number of iterations to , No. The food position for the next iteration is , randomly select red-billed blue magpie individuals from the red-billed blue magpie population , No. In the iteration, a red-billed blue magpie individual is randomly selected from the red-billed blue magpie population. , represents a random number and , Indicates The first iteration of the red-billed blue magpie position, The calculation formula for the position of the red-billed blue magpie in the iteration is as follows: , in, Indicates The position of the red-billed blue magpie in the second iteration, Indicates the first The individual location of the red-billed blue magpie, ; The red-billed blue magpie keeps moving in the process of searching for food, and the cluster set keeps iterating to find the minimum fitness function value; S323, the red-billed blue magpie is in the process of attacking food. At this time, the fitness function value is updated and the food position is set to , the food coefficient is , Represents a normally distributed random number, with a maximum number of iterations of , then The red-billed blue magpie updates its position in the second iteration The calculation formula is as follows, ; The red-billed blue magpie stores food. The fitness function value of the iteration is less than The fitness function value of the iteration is saved. The fitness function value of the iteration is updated continuously, and when the current number of iterations is equal to the maximum number of iterations, the iteration is stopped to obtain the best red-billed blue magpie position, which is the optimal initial clustering center.

9. The method for collecting and transmitting water level data based on the Internet of Things according to claim 8 is characterized in that: The S4 comprises the following steps: S41, obtaining water conservancy and water level data of previous years, forming a water conservancy and water level data set of previous years, dividing the water conservancy and water level data set of previous years into a water conservancy and water level sample set and a water conservancy and water level test set; inputting the water conservancy and water level sample set into the LSTM neural network for training, setting the root mean square error and learning rate of the LSTM neural network, and the root mean square error threshold is , when the RMS error is less than When , the LSTM neural network stops iterating and obtains the LSTM neural network prediction model, otherwise the weight is adjusted until the root mean square error is less than ; Then input the water level test set into the LSTM neural network prediction model, and set the accuracy threshold to , when the precision of the output result is greater than When , the iteration stops and the final LSTM neural network prediction model is obtained. Otherwise, S41 is repeated until the accuracy of the output result is greater than ; The final water conservancy water level data set is input into the final LSTM neural network prediction model, the water conservancy water level prediction value is output, the water conservancy water level data prediction is realized, and the processed water conservancy water level data set and water conservancy water level prediction value are uploaded to the water conservancy water level monitoring platform.

10. A system for implementing the method for collecting and transmitting water level data based on the Internet of Things as claimed in any one of claims 1 to 9, characterized in that: Specifically include: Real-time water gauge image recognition and processing module, water conservancy water level missing data filling module, water conservancy water level abnormal data deletion module and water conservancy water level data prediction module; The real-time water gauge image recognition and processing module is used to process and recognize the scale and numbers of the real-time water gauge image respectively, and calculate the water level data; The water conservancy water level missing data filling module is used to fill the missing data in the water conservancy water level data set to be processed using a two-way exponential smoothing repair method; The water conservancy water level abnormal data deletion module is used to delete abnormal data after finding it using the isolation forest algorithm and the three-branch clustering algorithm; The water conservancy water level data prediction module is used to predict the water conservancy water level data using the LSTM neural network prediction model.

Citation Information

Cited By

  • Water conservancy internet of things multi-dimensional data acquisition and hierarchical fusion method

    CN122970097A