Irrigation canal water flow determination, model construction and standard flow information extraction method
By obtaining the similarity comparison and dimensionality reduction processing of the flow information of the irrigation canal water with the standard flow feature set, combined with the artificial neural network model, the problem of inaccurate calculation results in the irrigation canal water flow monitoring is solved, and more accurate and reliable water is achieved Traffic Measurement.
Patent Information
- Application Number
- CN202410076963.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-01-18
- Publication Date
- 2025-01-03
- Estimated Expiration
- 2044-01-18
AI Technical Summary
The existing irrigation canal water flow monitoring method has the problem of inaccurate calculation results, especially in the nonlinear sensor and complex water flow relationship, which is difficult to apply to larger flow ranges.
By obtaining the flow information of the irrigation canal water, comparing the similarity with the standard flow feature set, constructing a similarity matrix and performing dimensionality reduction processing, using the artificial neural network model to fit the relationship between the flow information characteristics and the measured flow data, and extracting the standard Flow information to determine the irrigation channel water flow.
It improves the accuracy and reliability of irrigation canal water flow calculation, is suitable for larger flow intervals, and the powerful fitting characteristics of the model make the calculation results more accurate.
Smart Images

Figure CN118035760B_ABST
Abstract
Description
Technical Field
[0001] The invention relates to the technical field of irrigation canal water flow monitoring, and in particular to a method for determining irrigation canal water flow, building a model and extracting standard flow information. Background Art
[0002] Irrigation canal water monitoring is an important means to ensure the comprehensive grain production capacity and efficient use of water resources and prevent over-exploitation of water resources. In related technologies, one technical means of monitoring irrigation canal water flow is to set up water level meters and flow meters on regular channels, and use the open channel standard section flow velocity method to determine the flow of irrigation canal water. Another means of monitoring water flow in irregularly shaped channels is to set up multiple channel radar water level meters at intervals on the channel, use the throatless method to determine the flow velocity, and further determine the flow of irrigation canal water.
[0003] The irrigation canal water flow data obtained by the above two methods have certain deviations relative to the true value. The relevant technology provides some improved water flow determination methods. For example, the flow coefficient is determined based on the measured water flow and the data returned by the sensor, and the calculated water flow data is adjusted for deviation through the flow coefficient, so as to determine a more accurate flow data.
[0004] However, due to the nonlinearity of the sensor itself and the complexity of the relationship between the sensor return data and the water flow in the irrigation area, the above-mentioned method for determining the irrigation canal water flow is only applicable to a smaller flow range.
[0005] Based on this, it is necessary to develop a method to determine the irrigation canal water flow. Summary of the invention
[0006] The embodiment of the present invention provides a method for determining irrigation canal water flow, building a model and extracting standard flow information, which is used to solve the problem of inaccurate calculation results of irrigation canal water flow in the prior art.
[0007] In a first aspect, an embodiment of the present invention provides a method for determining irrigation canal water flow, comprising:
[0008] Acquiring flow information of irrigation canal water for a first predetermined period of time, wherein the flow information includes flow velocity information and water level information;
[0009] Comparing the flow information with a standard flow feature set for similarity to obtain a plurality of similarity vectors, and constructing a similarity matrix based on the plurality of similarity vectors, wherein the standard flow feature set includes a plurality of standard flow information of a second predetermined time length, and the second predetermined time length is less than the first predetermined time length;
[0010] Performing dimensionality reduction processing on the similarity matrix to obtain a similarity feature matrix;
[0011] The similarity feature matrix is input into the water flow model to determine the irrigation canal water flow.
[0012] In a possible implementation, the flow information is compared with a standard flow feature set for similarity to obtain a plurality of similarity vectors, and a similarity matrix is constructed based on the plurality of similarity vectors, including:
[0013] Get multiple vectors to be processed;
[0014] Taking out a piece of standard flow information from the standard flow feature set as the standard flow information to be processed according to a predetermined order, taking out a vector to be processed from the plurality of vectors to be processed according to a predetermined order as the similarity vector, and resetting the first predetermined position to a preset value;
[0015] Extracting information having the same length as the standard flow information from the first predetermined position of the flow information as information to be processed;
[0016] Calculating the similarity between the information to be processed and the standard flow information to be processed, and adding the calculation result to the similarity vector;
[0017] If the information to be processed is not the information at the last position of the flow information, adjusting the first predetermined position according to a preset offset length, and jumping to the step of extracting information of the same length as the standard flow information from the first predetermined position of the flow information as the information to be processed;
[0018] Otherwise, the similarity vector is added to the similarity matrix, and it is determined whether the traversal of the standard traffic feature set is completed;
[0019] If the traversal of the standard traffic feature set is not completed, jump to the step of taking out a piece of standard traffic information from the standard traffic feature set in a predetermined order as the standard traffic information to be processed, taking out a vector to be processed from the multiple vectors to be processed in a predetermined order as the similarity vector, and resetting the first predetermined position to a preset value.
[0020] In a possible implementation, the calculating the similarity between the information to be processed and the standard flow information to be processed includes:
[0021] The similarity between the information to be processed and the standard flow information to be processed is calculated according to a first formula, wherein the first formula is:
[0022]
[0023] In the formula, is the similarity between the information to be processed and the standard flow information to be processed, The information to be processed data, The first data, The total amount of data for standard traffic information.
[0024] In a possible implementation, the performing dimensionality reduction processing on the similarity matrix to obtain a similarity feature matrix includes:
[0025] Extracting similarity vectors from the similarity matrix as vectors to be processed according to a predetermined order;
[0026] Dividing the vector to be processed into a predetermined number of data segments;
[0027] Extracting maximum values and minimum values from the plurality of data segments respectively, and reconstructing similar feature vectors according to the plurality of extracted maximum values and minimum values;
[0028] Adding the similar feature vector to the similar feature matrix;
[0029] If the traversal of the similarity matrix is not completed, the process jumps to the step of extracting similarity vectors from the similarity matrix as vectors to be processed in a predetermined order.
[0030] In a second aspect, an embodiment of the present invention provides a method for constructing an irrigation canal water flow model, which is used to determine the irrigation canal water flow according to the similarity feature matrix obtained by the irrigation canal water flow determination method described in the first aspect or any possible implementation of the first aspect, and the irrigation canal water flow model construction method includes:
[0031] Acquire a plurality of similar feature matrix samples and a plurality of irrigation canal water flow measured values, wherein the plurality of similar feature matrix samples correspond to the plurality of irrigation canal water flow measured values;
[0032] Input the plurality of similar feature matrix samples into an artificial neural network model in sequence to obtain a plurality of output results, wherein the artificial neural network model has an output node, a plurality of intermediate nodes, and input nodes having the same number of elements as the similar feature matrix, the plurality of intermediate nodes are fully connected to form a hidden layer of a multi-layer structure, the hidden layer receives the output of the plurality of input nodes and outputs the result to the output node, the output node outputs the calculation result, and the output node, the plurality of intermediate nodes, and the input ends of the plurality of input nodes are respectively provided with weight coefficients;
[0033] Determining a plurality of model calculation deviations according to the plurality of output results and the plurality of irrigation canal water flow measured values;
[0034] Adjusting the weight coefficients of the output node, the intermediate nodes, and the input nodes according to the deviations calculated by the multiple models;
[0035] Returning to the step of sequentially inputting the plurality of similar feature matrix samples into the artificial neural network model to obtain a plurality of output results until the calculation deviations of the plurality of models are less than the deviation threshold;
[0036] The artificial neural network model is used as the irrigation canal water flow model.
[0037] In a third aspect, an embodiment of the present invention provides a standard flow information extraction method for constructing a standard flow feature set used in the irrigation canal water flow determination method described in the first aspect or any possible implementation of the first aspect, wherein the standard flow information extraction method comprises:
[0038] Acquire multiple sample flow information according to a third predetermined time period, wherein the third predetermined time period is shorter than the first predetermined time period;
[0039] Calculating the norms of the plurality of sample flow information to obtain a plurality of first norms;
[0040] Determine a classification interval according to a preset proportionality coefficient and a difference between a maximum value and a minimum value among the plurality of first norms;
[0041] Clustering the plurality of sample flow information according to the classification interval;
[0042] If the number of classes obtained by clustering is greater than the class number threshold, the length of the third predetermined time length is adjusted, and the process jumps to the step of obtaining a plurality of sample flow information according to the third predetermined time length;
[0043] Otherwise, the elements of the class center of the class obtained by clustering are determined according to the second formula, a class center vector is constructed according to the elements of the class center, and the unit vector of the class center vector is added to the standard flow information set as standard flow information, wherein the second formula is:
[0044]
[0045] In the formula, The center of the class elements, For the category The first sample flow information elements, is the total number of sample flow information in the class.
[0046] In a possible implementation manner, clustering the plurality of sample flow information according to the classification interval includes:
[0047] From multiple sample flow information that have not been clustered, randomly specify one sample flow information as a clustering focus;
[0048] Searching for target sample flow information from a plurality of sample flow information that are not clustered according to the classification interval, wherein the searched target sample flow information is sample flow information whose norm of difference from the cluster focus is less than the classification interval;
[0049] If target sample flow information exists, the target sample flow information is added to the class where the clustering focus is located, the target sample flow information is used as the clustering focus, and the step of jumping to the step of searching for the target sample flow information from the multiple sample flow information that have not been clustered according to the classification interval;
[0050] Otherwise, if there are multiple unclustered sample flow information, the process jumps to the step of randomly specifying one sample flow information as a clustering focus from the multiple unclustered sample flow information.
[0051] In a fourth aspect, an embodiment of the present invention provides an irrigation canal water flow determination device, which is used to implement the irrigation canal water flow determination method described in the first aspect or any possible implementation of the first aspect, wherein the irrigation canal water flow determination device includes:
[0052] A flow information acquisition module, used to acquire flow information of irrigation canal water for a first predetermined period of time, wherein the flow information includes flow velocity information and water level information;
[0053] a similarity extraction module, configured to compare the flow information with a standard flow feature set for similarity, obtain a plurality of similarity vectors, and construct a similarity matrix based on the plurality of similarity vectors, wherein the standard flow feature set includes a plurality of standard flow information of a second predetermined time length, and the second predetermined time length is less than the first predetermined time length;
[0054] A similarity feature extraction module is used to perform dimensionality reduction processing on the similarity matrix to obtain a similarity feature matrix;
[0055] as well as,
[0056] The water flow determination module is used to input the similarity feature matrix into the water flow model to determine the irrigation canal water flow.
[0057] In a fifth aspect, an embodiment of the present invention provides an electronic device, comprising a memory and a processor, wherein the memory stores a computer program that can be run on the processor, and when the processor executes the computer program, it implements the steps of the method described in the first aspect or any possible implementation method of the first aspect.
[0058] In a sixth aspect, 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, the steps of the method described in the first aspect or any possible implementation of the first aspect are implemented.
[0059] Compared with the prior art, the embodiments of the present invention have the following beneficial effects:
[0060] The embodiment of the present invention discloses a method for determining the flow rate of irrigation canal water, which first obtains the flow rate information of the irrigation canal water for a first predetermined time period, wherein the flow rate information includes flow velocity information and water level information; then the flow rate information is compared with the standard flow rate feature set for similarity to obtain multiple similarity vectors, and a similarity matrix is constructed based on the multiple similarity vectors, wherein the standard flow rate feature set includes multiple standard flow rate information for a second predetermined time period, and the second predetermined time period is less than the first predetermined time period; then the similarity matrix is subjected to dimensionality reduction processing to obtain a similarity feature matrix; finally, the similarity feature matrix is input into a water flow model to determine the flow rate of irrigation canal water. The embodiment of the present invention constructs a similarity matrix based on the standard flow rate information, and inputs it into the measurement model after dimensionality reduction to obtain the canal water flow rate. Due to the use of extracting data segments and similarity feature processing, it is more accurate and reliable than the method of measuring flow rate with real-time data in the prior art.
[0061] The model of the embodiment of the present invention fits the relationship between the flow information characteristics and the measured flow data through an artificial neural network. Due to the powerful fitting characteristics of the model, the model is more accurate and the measurement results are more reliable and accurate.
[0062] The embodiment of the present invention extracts standard flow information by clustering. The extracted flow information is highly representative and suitable for comparison with existing data to separate typical features in the flow information and to extract features of flow data. BRIEF DESCRIPTION OF THE DRAWINGS
[0063] In order to more clearly illustrate the technical solutions in the embodiments of the present invention, the drawings required for use in the embodiments or the description of the prior art 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 labor.
[0064] Figure 1 is a flow chart of a method for determining irrigation canal water flow provided by an embodiment of the present invention;
[0065] Figure 2 It is a functional block diagram of an irrigation canal water flow determination device provided by an embodiment of the present invention;
[0066] Figure 3 It is a functional block diagram of an electronic device provided by an embodiment of the present invention. DETAILED DESCRIPTION
[0067] In the following description, specific details such as specific system structures and technologies are provided for the purpose of illustration rather than limitation so as to provide a thorough understanding of the embodiments of the present invention. However, it should be clear to those skilled in the art that the present invention may be implemented in other embodiments without these specific details. In other cases, detailed descriptions of well-known systems, devices, and methods are omitted so as not to obscure the description of the present invention with unnecessary details.
[0068] In order to make the purpose, technical solutions and advantages of the present invention more clear, a specific implementation method will be described below in conjunction with the accompanying drawings.
[0069] The following is a detailed description of an embodiment of the present invention. This example is implemented based on the technical solution of the present invention, and provides a detailed implementation method and a specific operation process, but the protection scope of the present invention is not limited to the following embodiments.
[0070] Figure 1 A flow chart of a method for determining irrigation channel water flow provided in an embodiment of the present invention.
[0071] like Figure 1 As shown, it shows a flow chart of the method for determining the irrigation canal water flow provided by an embodiment of the present invention, which is described in detail as follows:
[0072] In step 101, flow information of irrigation canal water for a first predetermined period of time is obtained, wherein the flow information includes flow rate information and water level information.
[0073] In step 102, the traffic information is compared with a standard traffic feature set for similarity to obtain multiple similarity vectors, and a similarity matrix is constructed based on the multiple similarity vectors, wherein the standard traffic feature set includes multiple standard traffic information of a second predetermined time length, and the second predetermined time length is less than the first predetermined time length.
[0074] In some implementations, step 102 includes:
[0075] Get multiple vectors to be processed;
[0076] Taking out a piece of standard flow information from the standard flow feature set as the standard flow information to be processed according to a predetermined order, taking out a vector to be processed from the plurality of vectors to be processed according to a predetermined order as the similarity vector, and resetting the first predetermined position to a preset value;
[0077] Extracting information having the same length as the standard flow information from the first predetermined position of the flow information as information to be processed;
[0078] Calculating the similarity between the information to be processed and the standard flow information to be processed, and adding the calculation result to the similarity vector;
[0079] If the information to be processed is not the information at the last position of the flow information, adjusting the first predetermined position according to a preset offset length, and jumping to the step of extracting information of the same length as the standard flow information from the first predetermined position of the flow information as the information to be processed;
[0080] Otherwise, the similarity vector is added to the similarity matrix, and it is determined whether the traversal of the standard traffic feature set is completed;
[0081] If the traversal of the standard traffic feature set is not completed, jump to the step of taking out a piece of standard traffic information from the standard traffic feature set in a predetermined order as the standard traffic information to be processed, taking out a vector to be processed from the multiple vectors to be processed in a predetermined order as the similarity vector, and resetting the first predetermined position to a preset value.
[0082] In some implementations, the calculating the similarity between the information to be processed and the standard flow information to be processed includes:
[0083] The similarity between the information to be processed and the standard flow information to be processed is calculated according to a first formula, wherein the first formula is:
[0084]
[0085] In the formula, is the similarity between the information to be processed and the standard flow information to be processed, The information to be processed data, The first data, The total amount of data for standard traffic information.
[0086] For example, in the implementation method of determining the irrigation canal water flow rate of the present invention, flow rate information of a predetermined time period is first obtained. The flow rate information may be water level information collected and transmitted back by multiple water level meters, or may include both water level information collected and transmitted back by water level meters and flow rate information collected and transmitted back by flow rate meters. The information is a collection of multiple transmitted data within a predetermined time period, in other words, a data segment of a predetermined time period intercepted from the data stream transmitted back by the water level meter and / or flow rate meter.
[0087] These data segments will be compared with the standard flow feature set for similarity, and multiple similarity vectors will be constructed, and then multiple similarity vectors will be constructed into a similarity matrix. The standard flow feature set here includes multiple standard flow information, which is typical, representative flow velocity information and / or water level information with different flow information characteristics. This information is actually obtained after processing data segments of a certain length. It should be noted that this length is shorter than the length of the flow information. The method for obtaining standard flow information is discussed in detail in the third aspect of the embodiment of the present invention.
[0088] The standard traffic information of the standard traffic feature set is compared with the traffic information one by one for similarity, thereby generating a similarity vector.
[0089] In specific implementation, since the length of the standard traffic information is shorter than the traffic information, a data segment with the same length as the standard traffic information is extracted from the traffic information each time, and the similarity between this data segment and the standard traffic information is calculated by the first formula:
[0090]
[0091] In the formula, is the similarity between the information to be processed and the standard flow information to be processed, The information to be processed data, The first data, The total amount of data for standard traffic information.
[0092] After the calculation is completed, the next data segment is taken from the traffic information in turn (sliding data), and the above operation is repeated. Finally, a similarity vector is constructed based on the multiple similarities obtained by calculation. Then the similarity vector is added to the similarity matrix.
[0093] The similarity matrix means the number of different standard traffic information contained in the length of the traffic information. Since the dimension of this matrix is relatively large, it brings difficulties to calculation and modeling. Therefore, the embodiment of the present invention reduces the dimension of this matrix.
[0094] In step 103, the similarity matrix is subjected to dimensionality reduction processing to obtain a similarity feature matrix.
[0095] In some implementations, step 103 includes:
[0096] Extracting similarity vectors from the similarity matrix as vectors to be processed according to a predetermined order;
[0097] Dividing the vector to be processed into a predetermined number of data segments;
[0098] Extracting maximum values and minimum values from the plurality of data segments respectively, and reconstructing similar feature vectors according to the plurality of extracted maximum values and minimum values;
[0099] Adding the similar feature vector to the similar feature matrix;
[0100] If the traversal of the similarity matrix is not completed, the process jumps to the step of extracting similarity vectors from the similarity matrix as vectors to be processed in a predetermined order.
[0101] For example, some related technologies use pooling to reduce the dimensionality of data blocks, but a significant disadvantage of pooling is that a lot of features are lost, which reduces the accuracy of modeling and traffic measurement. For example, maximum pooling will lose volatility features and cumulative sum features, while mean pooling will lose extreme value features and volatility features, and so on.
[0102] For massive data, this loss is acceptable, but when applied to the implementation of the present invention, it will bring obvious accuracy problems. Therefore, the implementation of the present invention is to use the segmentation-extreme value dimensionality reduction method. Specifically, it is to extract the similarity vector from the matrix, segment the similarity vector, extract the maximum value and the minimum value in each segment, and finally, arrange these maximum values and minimum values in the order of their precedence in the similarity vector to form a similar feature vector, and multiple similar feature vectors are recombined to form a similar feature matrix.
[0103] Through the above-mentioned segmentation-extreme value dimensionality reduction method, the fluctuation characteristics can be retained to the maximum extent (the fluctuation characteristics are an important point that affects the water flow measurement results), the extreme value characteristics are completely retained, and the accumulation and loss characteristics are also significantly better than the maximum pooling dimensionality reduction method.
[0104] Therefore, the dimensionality reduction method of the embodiment of the present invention can reduce the amount of data, simplify the water flow model, and ensure the accuracy of water flow measurement.
[0105] In step 104, the similarity feature matrix is input into a water flow model to determine the irrigation canal water flow.
[0106] Exemplarily, the water flow model is constructed by an artificial neural network, and outputs the irrigation canal water flow according to an extracted feature set similar to the standard flow feature set. The model has multiple input nodes and one output node. The multiple input nodes correspond to multiple elements of the similar feature matrix, and the output node outputs the measured irrigation canal water flow. The construction of the model is discussed in detail in the second aspect of the embodiment of the present invention.
[0107] In a second aspect, an embodiment of the present invention provides a method for constructing an irrigation canal water flow model, which is used to determine the irrigation canal water flow according to the similarity feature matrix obtained by the irrigation canal water flow determination method described in the first aspect or any possible implementation of the first aspect, and the irrigation canal water flow model construction method includes:
[0108] Acquire a plurality of similar feature matrix samples and a plurality of irrigation canal water flow measured values, wherein the plurality of similar feature matrix samples correspond to the plurality of irrigation canal water flow measured values;
[0109] Input the plurality of similar feature matrix samples into an artificial neural network model in sequence to obtain a plurality of output results, wherein the artificial neural network model has an output node, a plurality of intermediate nodes, and input nodes having the same number of elements as the similar feature matrix, the plurality of intermediate nodes are fully connected to form a hidden layer of a multi-layer structure, the hidden layer receives the output of the plurality of input nodes and outputs the result to the output node, the output node outputs the calculation result, and the output node, the plurality of intermediate nodes, and the input ends of the plurality of input nodes are respectively provided with weight coefficients;
[0110] Determining a plurality of model calculation deviations according to the plurality of output results and the plurality of irrigation canal water flow measured values;
[0111] Adjusting the weight coefficients of the output node, the intermediate nodes, and the input nodes according to the deviations calculated by the multiple models;
[0112] Returning to the step of sequentially inputting the plurality of similar feature matrix samples into the artificial neural network model to obtain a plurality of output results until the calculation deviations of the plurality of models are less than the deviation threshold;
[0113] The artificial neural network model is used as the irrigation canal water flow model.
[0114] Exemplarily, an embodiment of the present invention is based on an artificial neural network, for example, a BP neural network (BackPropagation) to construct an irrigation canal water flow model, which includes multiple input nodes (the number is the same as the number of elements in a similar feature matrix), a hidden layer constructed by multiple intermediate nodes in a fully connected form, and an output node, wherein the input node receives the input of the similar feature matrix, the output result is transformed by the hidden layer, and the irrigation canal water flow data is output at the output node.
[0115] In this network, each node's input end is equipped with a weight coefficient. By modifying these weight coefficients, the model can fit the relationship between the output irrigation canal water flow data and the similarity feature matrix.
[0116] To achieve the above purpose, in the implementation mode of the present invention, multiple data pairs are obtained: similar feature matrix samples and actual measured values of irrigation canal water flow. From the first aspect, we know that the similar feature matrix is constructed based on flow rate information and water level information. There is a certain specific relationship between the flow rate information and the water level information and the irrigation canal water flow in the same period. In other words, there is also a specific relationship between the similar feature matrix and the irrigation canal water flow.
[0117] We input the similar feature matrix samples into the above artificial neural network model to obtain the model results. The deviation between this result and the measured value of irrigation canal water flow is used as the basis for adjusting the weight coefficient of the node input. The BP neural network uses the back propagation algorithm to adjust these coefficients to fit the relationship between the similar feature matrix samples and the measured value of irrigation canal water flow. After a relatively accurate fitting, the artificial neural network model can be used as an irrigation canal water flow model.
[0118] In a third aspect, an embodiment of the present invention provides a standard flow information extraction method for constructing a standard flow feature set used in the irrigation canal water flow determination method described in the first aspect or any possible implementation of the first aspect, wherein the standard flow information extraction method comprises:
[0119] Acquire multiple sample flow information according to a third predetermined time period, wherein the third predetermined time period is shorter than the first predetermined time period;
[0120] Calculating the norms of the plurality of sample flow information to obtain a plurality of first norms;
[0121] Determine a classification interval according to a preset proportionality coefficient and a difference between a maximum value and a minimum value among the plurality of first norms;
[0122] Clustering the plurality of sample flow information according to the classification interval;
[0123] If the number of classes obtained by clustering is greater than the class number threshold, the length of the third predetermined time length is adjusted, and the process jumps to the step of obtaining a plurality of sample flow information according to the third predetermined time length;
[0124] Otherwise, the elements of the class center of the class obtained by clustering are determined according to the second formula, a class center vector is constructed according to the elements of the class center, and the unit vector of the class center vector is added to the standard flow information set as standard flow information, wherein the second formula is:
[0125]
[0126] In the formula, The center of the class elements, For the category The first sample flow information elements, is the total number of sample flow information in the class.
[0127] In a possible implementation manner, clustering the plurality of sample flow information according to the classification interval includes:
[0128] From multiple sample flow information that have not been clustered, randomly specify one sample flow information as a clustering focus;
[0129] Searching for target sample flow information from a plurality of sample flow information that are not clustered according to the classification interval, wherein the searched target sample flow information is sample flow information whose norm of difference from the cluster focus is less than the classification interval;
[0130] If target sample flow information exists, the target sample flow information is added to the class where the clustering focus is located, the target sample flow information is used as the clustering focus, and the step of jumping to the step of searching for the target sample flow information from the multiple sample flow information that have not been clustered according to the classification interval;
[0131] Otherwise, if there are multiple unclustered sample flow information, the process jumps to the step of randomly specifying one sample flow information as a clustering focus from the multiple unclustered sample flow information.
[0132] Exemplarily, in terms of standard flow information extraction, the implementation method of the present invention first presets a time length, and based on this time length, extracts data segments from a large amount of data as sample flow information. Multiple sample flow information are respectively calculated for their norms (e.g., L2 norm), and the range of multiple norms is multiplied by a predetermined proportional coefficient less than 1 (e.g., 0.1) as the classification interval. The sample flow information is clustered using this interval. If the number of clusters is large, it means that there is some deficiency in the sampling of this predetermined time length. For example, if the predetermined time length is too long, the deviation between the extracted data is large, and there are too many types of clusters, which are not typical. At this time, the length of the predetermined time length needs to be shortened. Conversely, if the predetermined time length is too short, there will also be a shortage in the number of clusters, and multiple attempts are required to select a more appropriate time length.
[0133] If the number of clusters meets expectations, the class center of each class is taken out and the unit vector of the class center is used as the standard flow information. In an embodiment of the present invention, a method for extracting class center elements is provided:
[0134]
[0135] In the formula, The center of the class elements, For the category The first sample flow information elements, is the total number of sample flow information in the class.
[0136] In terms of clustering, the implementation of the present invention adopts the steps of randomly specifying cluster centers and clustering sample flow information to cluster centers according to classification intervals to complete clustering. The result of this clustering does not have a specific shape and is a density classification method.
[0137] The implementation method of the irrigation canal water flow determination method of the present invention first obtains the flow information of the irrigation canal water for a first predetermined time period, wherein the flow information includes flow velocity information and water level information; then the flow information is compared with the standard flow feature set for similarity to obtain multiple similarity vectors, and a similarity matrix is constructed based on the multiple similarity vectors, wherein the standard flow feature set includes multiple standard flow information for a second predetermined time period, and the second predetermined time period is less than the first predetermined time period; then the similarity matrix is subjected to dimensionality reduction processing to obtain a similarity feature matrix; finally, the similarity feature matrix is input into the water flow model to determine the irrigation canal water flow. The implementation method of the present invention constructs a similarity matrix based on the standard flow information, and inputs it into the measurement model after dimensionality reduction to obtain the canal water flow. Due to the use of extracting data segments and similarity feature processing, it is more accurate and reliable than the method of measuring flow with real-time data in the prior art.
[0138] The model of the embodiment of the present invention fits the relationship between the flow information characteristics and the measured flow data through an artificial neural network. Due to the powerful fitting characteristics of the model, the model is more accurate and the measurement results are more reliable and accurate.
[0139] The embodiment of the present invention extracts standard flow information by clustering. The extracted flow information is highly representative and suitable for comparison with existing data to separate typical features in the flow information and to extract features of flow data.
[0140] It should be understood that the size of the serial numbers of the steps in the above implementation does not mean the order of execution. The execution order of each process should be determined by its function and internal logic, and should not constitute any limitation on the implementation process of the implementation method of the present invention.
[0141] The following is an implementation of the device of the present invention. For details not described in detail, reference may be made to the corresponding method implementation described above.
[0142] Figure 2 is a functional block diagram of an irrigation canal water flow determination device provided by an embodiment of the present invention, referring to Figure 2The irrigation canal water flow determination device comprises: a flow information acquisition module 201, a similarity extraction module 202, a similarity feature extraction module 203 and a water flow determination module 204, wherein:
[0143] The flow information acquisition module 201 is used to acquire the flow information of the irrigation canal water for a first predetermined period of time, wherein the flow information includes flow velocity information and water level information;
[0144] A similarity extraction module 202 is used to compare the flow information with a standard flow feature set to obtain a plurality of similarity vectors, and to construct a similarity matrix based on the plurality of similarity vectors, wherein the standard flow feature set includes a plurality of standard flow information of a second predetermined time length, and the second predetermined time length is less than the first predetermined time length;
[0145] A similarity feature extraction module 203 is used to perform dimensionality reduction processing on the similarity matrix to obtain a similarity feature matrix;
[0146] The water flow determination module 204 is used to input the similarity feature matrix into the water flow model to determine the irrigation canal water flow.
[0147] Figure 3 is a functional block diagram of an electronic device provided by an embodiment of the present invention. Figure 3 As shown, the electronic device 3 of this embodiment includes: a processor 300 and a memory 301, wherein the memory 301 stores a computer program 302 that can be run on the processor 300. When the processor 300 executes the computer program 302, the steps in the above-mentioned irrigation channel water flow determination method and the embodiment are implemented, for example Figure 1 Steps 101 to 104 are shown.
[0148] Exemplarily, the computer program 302 may be divided into one or more modules / units, and the one or more modules / units are stored in the memory 301 and executed by the processor 300 to implement the present invention.
[0149] The electronic device 3 may be a computing device such as a desktop computer, a notebook, a PDA, or a cloud server. The electronic device 3 may include, but is not limited to, a processor 300 and a memory 301. Those skilled in the art will appreciate that Figure 3 It is only an example of the electronic device 3 and does not constitute a limitation of the electronic device 3. It may include more or fewer components than shown in the figure, or a combination of certain components, or different components. For example, the electronic device 3 may also include input and output devices, network access devices, buses, etc.
[0150] The processor 300 may be a central processing unit (CPU), or other general-purpose processors, digital signal processors (DSP), application-specific integrated circuits (ASIC), field-programmable gate arrays (FPGA) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. A general-purpose processor may be a microprocessor or any conventional processor, etc.
[0151] The memory 301 may be an internal storage unit of the electronic device 3, such as a hard disk or memory of the electronic device 3. The memory 301 may also be an external storage device of the electronic device 3, such as a plug-in hard disk, a smart media card (SMC), a secure digital (SD) card, a flash card, etc. equipped on the electronic device 3. Further, the memory 301 may also include both an internal storage unit and an external storage device of the electronic device 3. The memory 301 is used to store the computer program 302 and other programs and data required by the electronic device 3. The memory 301 may also be used to temporarily store data that has been output or is to be output.
[0152] Those skilled in the art can clearly understand that for the convenience and simplicity of description, only the division of the above-mentioned functional units and modules is used as an example for illustration. In actual applications, the above-mentioned function allocation can be completed by different functional units and modules as needed, that is, the internal structure of the device can be divided into different functional units or modules to complete all or part of the functions described above. The functional units and modules in the implementation method can be integrated into a processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit. The above-mentioned integrated unit can be implemented in the form of hardware or in the form of software functional units. In addition, the specific names of the functional units and modules are only for the convenience of distinguishing each other, and are not used to limit the scope of protection of this application. The specific working process of the units and modules in the above-mentioned system can refer to the corresponding process in the aforementioned method implementation method, which will not be repeated here.
[0153] In the above-mentioned embodiments, the description of each embodiment has its own emphasis. For parts that are not described or recorded in detail in a certain embodiment, reference can be made to the relevant descriptions of other embodiments.
[0154] Those skilled in the art will appreciate that the units and algorithm steps of each example described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, or a combination of computer software and electronic hardware. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. Professional and technical personnel can use different methods to implement the described functions for each specific application, but such implementation should not be considered to be beyond the scope of the present invention.
[0155] In the embodiments provided by the present invention, it should be understood that the disclosed devices / electronic devices and methods can be implemented in other ways. For example, the device / electronic device embodiments described above are only schematic. For example, the division of the modules or units is only a logical function division. There may be other division methods in actual implementation, such as multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some interfaces, indirect coupling or communication connection of devices or units, which can be electrical, mechanical or other forms.
[0156] The units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed on multiple network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the present embodiment.
[0157] In addition, each functional unit in each embodiment of the present invention may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit. The above-mentioned integrated unit may be implemented in the form of hardware or in the form of software functional units.
[0158] If the integrated module / unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the present invention implements all or part of the processes in the above-mentioned implementation method, and can also be completed by instructing the relevant hardware through a computer program. The computer program can be stored in a computer-readable storage medium. When the computer program is executed by the processor, the steps of the above-mentioned various methods and device implementation methods can be implemented. Among them, the computer program includes computer program code, and the computer program code can be in source code form, object code form, executable file or some intermediate form. The computer-readable medium may include: any entity or device that can carry the computer program code, recording medium, U disk, mobile hard disk, disk, optical disk, computer memory, read-only memory (ROM), random access memory (RAM), electrical carrier signal, telecommunication signal and software distribution medium.
[0159] The above-described embodiments are only used to illustrate the technical solutions of the present invention, rather than to limit the same. Although the present invention has been described in detail with reference to the aforementioned embodiments, a person skilled in the art should understand that the technical solutions described in the aforementioned embodiments may still be modified, or some of the technical features may be replaced by equivalents. Such modifications or replacements do not deviate the essence of the corresponding technical solutions from the spirit and scope of the technical solutions of the various embodiments of the present invention, and should all be included in the protection scope of the present invention.
Claims
1. A method for determining irrigation canal water flow, characterized in that: include: Acquiring flow information of irrigation canal water for a first predetermined period of time, wherein the flow information includes flow velocity information and water level information; Comparing the flow information with a standard flow feature set for similarity to obtain a plurality of similarity vectors, and constructing a similarity matrix based on the plurality of similarity vectors, wherein the standard flow feature set includes a plurality of standard flow information of a second predetermined time length, and the second predetermined time length is less than the first predetermined time length; Performing dimensionality reduction processing on the similarity matrix to obtain a similarity feature matrix; Inputting the similarity feature matrix into a water flow model to determine the irrigation canal water flow, wherein the irrigation canal water flow model is an artificial neural network model; in, The standard flow information extraction method comprises: Acquire multiple sample flow information according to a third predetermined time period, wherein the third predetermined time period is shorter than the first predetermined time period; Calculating the norms of the plurality of sample flow information to obtain a plurality of first norms; Determine a classification interval according to a preset proportionality coefficient and a difference between a maximum value and a minimum value among the plurality of first norms; Clustering the plurality of sample flow information according to the classification interval; If the number of classes obtained by clustering is greater than the class number threshold, the length of the third predetermined time length is adjusted, and the process jumps to the step of obtaining a plurality of sample flow information according to the third predetermined time length; Otherwise, the elements of the class center of the class obtained by clustering are determined according to the second formula, a class center vector is constructed according to the elements of the class center, and the unit vector of the class center vector is added to the standard flow information set as standard flow information, wherein the second formula is: In the formula, The center of the class elements, For the category The first sample flow information elements, is the total number of sample flow information in the class.
2. The method for determining irrigation canal water flow according to claim 1, characterized in that: The comparing the traffic information with the standard traffic feature set to obtain a plurality of similarity vectors, and constructing a similarity matrix based on the plurality of similarity vectors, includes: Get multiple vectors to be processed; Taking out a piece of standard flow information from the standard flow feature set as the standard flow information to be processed according to a predetermined order, taking out a vector to be processed from the plurality of vectors to be processed according to a predetermined order as the similarity vector, and resetting the first predetermined position to a preset value; Extracting information having the same length as the standard flow information from the first predetermined position of the flow information as information to be processed; Calculating the similarity between the information to be processed and the standard flow information to be processed, and adding the calculation result to the similarity vector; If the information to be processed is not the information at the last position of the flow information, adjusting the first predetermined position according to a preset offset length, and jumping to the step of extracting information of the same length as the standard flow information from the first predetermined position of the flow information as the information to be processed; Otherwise, the similarity vector is added to the similarity matrix, and it is determined whether the traversal of the standard traffic feature set is completed; If the traversal of the standard traffic feature set is not completed, jump to the step of taking out a piece of standard traffic information from the standard traffic feature set in a predetermined order as the standard traffic information to be processed, taking out a vector to be processed from the multiple vectors to be processed in a predetermined order as the similarity vector, and resetting the first predetermined position to a preset value.
3. The method for determining irrigation canal water flow according to claim 2, characterized in that: The calculating the similarity between the information to be processed and the standard flow information to be processed includes: The similarity between the information to be processed and the standard flow information to be processed is calculated according to a first formula, wherein the first formula is: In the formula, is the similarity between the information to be processed and the standard flow information to be processed, The information to be processed data, The first data, The total amount of data for standard traffic information.
4. The method for determining irrigation canal water flow according to any one of claims 1 to 3, characterized in that: The step of performing dimensionality reduction processing on the similarity matrix to obtain a similarity feature matrix includes: Extracting similarity vectors from the similarity matrix as vectors to be processed according to a predetermined order; Dividing the vector to be processed into a predetermined number of data segments; Extracting maximum values and minimum values from the plurality of data segments respectively, and reconstructing similar feature vectors according to the plurality of extracted maximum values and minimum values; Adding the similar feature vector to the similar feature matrix; If the traversal of the similarity matrix is not completed, the process jumps to the step of extracting similarity vectors from the similarity matrix as vectors to be processed in a predetermined order.
5. The method for determining irrigation canal water flow according to claim 1, characterized in that: The clustering of the plurality of sample flow information according to the classification interval includes: From multiple sample flow information that have not been clustered, randomly specify one sample flow information as a clustering focus; Searching for target sample flow information from a plurality of sample flow information that are not clustered according to the classification interval, wherein the searched target sample flow information is sample flow information whose norm of difference from the cluster focus is less than the classification interval; If target sample flow information exists, the target sample flow information is added to the class where the clustering focus is located, the target sample flow information is used as the clustering focus, and the step of jumping to the step of searching for the target sample flow information from the multiple sample flow information that have not been clustered according to the classification interval; Otherwise, if there are multiple unclustered sample flow information, the process jumps to the step of randomly specifying one sample flow information as a clustering focus from the multiple unclustered sample flow information.
6. A method for constructing an irrigation canal water flow model, characterized in that: The irrigation canal water flow rate is determined by a similar feature matrix obtained by the irrigation canal water flow rate determination method according to any one of claims 1 to 4, wherein the irrigation canal water flow rate model construction method comprises: Acquire a plurality of similar feature matrix samples and a plurality of irrigation canal water flow measured values, wherein the plurality of similar feature matrix samples correspond to the plurality of irrigation canal water flow measured values; Input the plurality of similar feature matrix samples into an artificial neural network model in sequence to obtain a plurality of output results, wherein the artificial neural network model has an output node, a plurality of intermediate nodes, and input nodes having the same number of elements as the similar feature matrix, the plurality of intermediate nodes are fully connected to form a hidden layer of a multi-layer structure, the hidden layer receives the output of the plurality of input nodes and outputs the result to the output node, the output node outputs the calculation result, and the output node, the plurality of intermediate nodes, and the input ends of the plurality of input nodes are respectively provided with weight coefficients; Determining a plurality of model calculation deviations according to the plurality of output results and the plurality of irrigation canal water flow measured values; Adjusting the weight coefficients of the output node, the intermediate nodes, and the input nodes according to the deviations calculated by the multiple models; Returning to the step of sequentially inputting the plurality of similar feature matrix samples into the artificial neural network model to obtain a plurality of output results until the calculation deviations of the plurality of models are less than the deviation threshold; The artificial neural network model is used as the irrigation canal water flow model.
7. A device for determining irrigation canal water flow, characterized in that: Used to implement the method for determining the irrigation canal water flow rate according to any one of claims 1 to 4, the irrigation canal water flow rate determination device comprises: A flow information acquisition module, used to acquire flow information of irrigation canal water for a first predetermined period of time, wherein the flow information includes flow velocity information and water level information; a similarity extraction module, configured to compare the flow information with a standard flow feature set for similarity, obtain a plurality of similarity vectors, and construct a similarity matrix based on the plurality of similarity vectors, wherein the standard flow feature set includes a plurality of standard flow information of a second predetermined time length, and the second predetermined time length is less than the first predetermined time length; A similarity feature extraction module is used to perform dimensionality reduction processing on the similarity matrix to obtain a similarity feature matrix; as well as, The water flow determination module is used to input the similarity feature matrix into the water flow model to determine the irrigation canal water flow.
8. An electronic device comprising a memory and a processor, wherein the memory stores a computer program that can be run on the processor, characterized in that: When the processor executes the computer program, the steps of the method according to any one of claims 1 to 6 are implemented.
9. A computer-readable storage medium storing a computer program, characterized in that: When the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 6 are implemented.
