Method, device, equipment and storage medium for constructing electricity-water-conversion model for agricultural irrigation
By constructing an electric water decomposition model for agricultural irrigation and adjusting model parameters using multiple factor data, the problem of inaccurate calculation of electric water decomposition in the existing technology is solved, and a more accurate and widely applicable irrigation water consumption calculation is achieved.
Patent Information
- Application Number
- CN202411555256.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-11-04
- Publication Date
- 2025-02-07
- Estimated Expiration
- 2044-11-04
AI Technical Summary
In the prior art, the calculation results of electric water decomposition are inaccurate, resulting in large errors in calculating water consumption and narrow application areas.
By obtaining multiple sample data sets, including water flow data, equipment parameters, equipment electricity data and water level data, building a factor array, and substituting it into the basic model, adjusting the model parameters until the output deviation is less than the threshold, and building agricultural irrigation electricity to Water refraction model.
It improves the accuracy and applicability of irrigation water consumption measurement, reduces the calculation error, and expands the scope of application of the model.
Smart Images

Figure CN119046803B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of irrigation water calculation model construction, and in particular to a method, device, equipment and storage medium for constructing an agricultural irrigation electricity-to-water model. Background Art
[0002] The amount of water used for agricultural irrigation is affected by factors such as water use level, climate, soil, crops, farming methods, irrigation technology and canal utilization coefficient, and there are obvious regional differences. Due to different water source conditions, crop varieties and cultivated areas in different places, the amount of water used is also different.
[0003] Agricultural irrigation consumes a large amount of water. In some areas, irrigation water accounts for 30% of the total water consumption. In arid and rainless areas, it aggravates the expansion of underground funnel areas, seriously threatening the security of water resources.
[0004] Some related technologies attempt to calculate irrigation water consumption from irrigation electricity consumption. The general calculation method is to make a simple conversion based on well depth and water pump power, which has large errors and a narrow scope of application.
[0005] Based on this, it is necessary to develop and design a method for constructing an electricity-to-water model for agricultural irrigation. Summary of the invention
[0006] The embodiments of the present invention provide a method, device, equipment and storage medium for constructing an electricity-to-water model for agricultural irrigation, which are used to solve the problem of inaccurate electricity-to-water calculation results in the prior art.
[0007] In a first aspect, an embodiment of the present invention provides a method for constructing an agricultural irrigation electricity-to-water model, comprising:
[0008] Acquire multiple sample data sets, wherein the sample data sets include water flow data, equipment parameters, equipment power consumption data, and water level data;
[0009] Extracting equipment parameters, equipment power consumption data, and water level data from the plurality of sample data sets to construct factor arrays, thereby obtaining a plurality of factor arrays;
[0010] Substituting the multiple factor arrays into the basic model respectively to obtain multiple model outputs, and adjusting the parameters of the basic model according to the multiple model outputs and multiple target flow data until the output deviation of the basic model is less than the deviation threshold, wherein the target flow data is flow data determined according to the water flow data in the source sample data set of the factor array;
[0011] The basic model with output deviation less than the deviation threshold is used as the electricity-to-water model for agricultural irrigation.
[0012] In a possible implementation, the device parameters, the device power consumption data, and the water level data are respectively extracted from the multiple sample data sets to construct factor arrays, thereby obtaining multiple factor arrays, including:
[0013] Get the number of clusters;
[0014] dividing the water flow data in the plurality of sample data sets into a plurality of data segments;
[0015] Dividing the plurality of sample data sets into a plurality of data set groups according to the data segments where the water flow data in the sample data sets are located;
[0016] For each of the plurality of data set groups, the following steps are performed respectively:
[0017] Extracting equipment parameters, equipment power consumption data, and water level data from each sample data set to construct a first array, thereby obtaining multiple first arrays;
[0018] Clustering the plurality of first arrays according to a first clustering quantity to obtain a plurality of first array classes;
[0019] Calculating the ratio of the number of data sets in each first array class to the number of data sets in the data set group, respectively, to obtain multiple quantity ratios;
[0020] Deleting first array classes whose quantity ratio is less than a ratio threshold from the plurality of first array classes to obtain a plurality of second array classes;
[0021] A first array of the plurality of second array classes is used as a factor array.
[0022] In a possible implementation, the basic model is:
[0023]
[0024] In the formula, is the first data, For the The first coefficient, For the combined factors, For the The second coefficient, is the bias coefficient, For flow, is the total number of times, is the total number of data in the factor array.
[0025] In a possible implementation, the step of respectively substituting the multiple factor arrays into a basic model to obtain multiple model outputs, and adjusting the parameters of the basic model according to the multiple model outputs and multiple target flow data until the output deviation of the basic model is less than a deviation threshold, includes:
[0026] Get the sampling ratio;
[0027] Taking out factor arrays from the plurality of factor arrays according to the sampling ratio to form a first group, and forming the remaining factor arrays into a second group;
[0028] According to the number of factor arrays in the first group, adjusting the total number of times so that the total number of coefficients in the base model is less than the number of factor arrays in the first group;
[0029] Substituting the plurality of factor arrays in the first group into the basic model;
[0030] If the first model output deviation is greater than the deviation threshold, adjusting the parameters of the basic model according to the first model output deviation until the first model output deviation is less than the deviation threshold, wherein the first model output deviation is the deviation between a plurality of first outputs of the basic model and a plurality of target flow data, and the plurality of first outputs are outputs obtained by substituting a plurality of factor arrays in the first group into the basic model;
[0031] otherwise, substituting the plurality of factor arrays in the second group into the basic model;
[0032] If the deviation between the multiple second outputs and the multiple target flow data is greater than the deviation threshold, the sampling ratio is reduced and the process jumps to the step of taking out factor arrays from the multiple factor arrays according to the sampling ratio to form a first group and constructing the remaining factor arrays into a second group.
[0033] In a possible implementation, adjusting the parameters of the basic model according to the first model output deviation until the first model output deviation is less than the deviation threshold includes:
[0034] Get multiple parameter arrays;
[0035] Substituting the multiple parameter arrays into the basic model respectively to obtain multiple intermediate models;
[0036] Determine the deviation of each intermediate model according to the deviations of the multiple first outputs of each intermediate model and the multiple target flow data, thereby obtaining the deviations of the multiple intermediate models;
[0037] If the deviations of the plurality of intermediate models are all greater than the deviation threshold, determining the model fitness according to the deviations between the plurality of first outputs of each intermediate model and the plurality of target flow data, thereby obtaining a plurality of fitnesses;
[0038] Selecting three optimal parameter arrays from the multiple parameter arrays according to the multiple fitnesses;
[0039] According to the three optimal parameter arrays, other arrays in the multiple parameter arrays are adjusted, and the process jumps to the step of substituting the multiple parameter arrays into the basic model respectively to obtain multiple intermediate models.
[0040] In a possible implementation, determining the model fitness according to the deviations between the multiple first outputs of each intermediate model and the multiple target flow data includes:
[0041] The model fitness is determined according to the first formula, the deviations between the multiple first outputs of the intermediate model and the multiple target flow data, wherein the first formula is:
[0042]
[0043] In the formula, is the model fitness, The intermediate model The first output, For the Target flow data, The total number of first outputs of the intermediate model.
[0044] In a possible implementation manner, adjusting other arrays in the multiple parameter arrays according to the three optimal parameter arrays includes:
[0045] According to the second formula and the three optimal parameter arrays, other arrays in the multiple parameter arrays are adjusted, wherein the second formula is:
[0046]
[0047] In the formula, is the distance between the parameter arrays other than the three optimal parameter arrays and the optimal parameter array, is the distance between the parameter arrays other than the three optimal parameter arrays and the suboptimal parameter arrays, is the distance between the parameter array other than the three optimal parameter arrays and the third optimal parameter array, is the optimal parameter array, is a suboptimal parameter array, is the third optimal parameter array, The first adjustment direction of the parameter array other than the three parameter arrays, The second adjustment direction of the parameter array other than the three parameter arrays, The third adjustment direction of the parameter array other than the three parameter arrays, is the number of calls, To preset the maximum number of calls, is the fifth coefficient, is the sixth coefficient.
[0048] In a second aspect, an embodiment of the present invention provides a device for constructing an agricultural irrigation model by decomposing electricity into water, which is used to implement the method for constructing an agricultural irrigation model by decomposing electricity into water as described in the first aspect or any possible implementation of the first aspect, and the device for constructing an agricultural irrigation model by decomposing electricity into water comprises:
[0049] A sample acquisition module, used to acquire multiple sample data sets, wherein the sample data sets include water flow data, equipment parameters, equipment power consumption data and water level data;
[0050] A factor data preprocessing module is used to extract equipment parameters, equipment power consumption data and water level data from the multiple sample data sets to construct factor arrays, thereby obtaining multiple factor arrays;
[0051] A model parameter determination module, used for respectively substituting the multiple factor arrays into a basic model to obtain multiple model outputs, and adjusting the parameters of the basic model according to the multiple model outputs and multiple target flow data until the output deviation of the basic model is less than a deviation threshold, wherein the target flow data is flow data determined according to the water flow data in the source sample data set of the factor array;
[0052] as well as,
[0053] The model building module is used to use the basic model with output deviation less than the deviation threshold as the agricultural irrigation electricity-to-water model.
[0054] In a third 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.
[0055] In a fourth 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.
[0056] Compared with the prior art, the embodiments of the present invention have the following beneficial effects:
[0057] The embodiment of the present invention discloses a method for constructing an agricultural irrigation model using electricity to deduct water. The method first obtains multiple sample data sets, wherein the sample data sets include water flow data, equipment parameters, equipment power consumption data, and water level data; then, the equipment parameters, equipment power consumption data, and water level data are extracted from the multiple sample data sets to construct factor arrays, thereby obtaining multiple factor arrays; then, the multiple factor arrays are substituted into the basic model to obtain multiple model outputs, and the parameters of the basic model are adjusted according to the multiple model outputs and multiple target flow data until the output deviation of the basic model is less than the deviation threshold, wherein the target flow data is flow data determined according to the water flow data in the sample data set from the factor array; finally, the basic model with an output deviation less than the deviation threshold is used as the agricultural irrigation model using electricity to deduct water. The embodiment of the present invention constructs an irrigation model using electricity to deduct water based on multiple factors, and adjusts the parameters of the model through the relationship between the factor data and the water flow sample data, so that the model can fit the relationship between the factors and the water flow, so that the model output result is more accurate and has a wide adaptability. BRIEF DESCRIPTION OF THE DRAWINGS
[0058] 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.
[0059] Figure 1 It is a flow chart of a method for constructing an electricity-to-water model for agricultural irrigation provided by an embodiment of the present invention;
[0060] Figure 2 It is a schematic diagram of a first model output deviation determination method provided by an embodiment of the present invention;
[0061] Figure 3 It is a functional block diagram of a device for constructing an electricity-water model for agricultural irrigation provided by an embodiment of the present invention;
[0062] Figure 4 It is a functional block diagram of an electronic device provided by an embodiment of the present invention. DETAILED DESCRIPTION
[0063] 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.
[0064] In order to make the purpose, technical solutions and advantages of the present invention more clear, the following will be described through specific implementation methods in conjunction with the accompanying drawings.
[0065] 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.
[0066] Figure 1 A flow chart of a method for constructing an electricity-to-water model for agricultural irrigation provided in an embodiment of the present invention.
[0067] like Figure 1 As shown, it shows a flow chart of the method for constructing an electricity-to-water model for agricultural irrigation provided by an embodiment of the present invention, which is described in detail as follows:
[0068] In step 101, a plurality of sample data sets are obtained, wherein the sample data sets include water flow data, equipment parameters, equipment power consumption data, and water level data.
[0069] In step 102, device parameters, device power consumption data, and water level data are respectively extracted from the plurality of sample data sets to construct factor arrays, thereby obtaining a plurality of factor arrays.
[0070] In some implementations, step 102 includes:
[0071] Get the number of clusters;
[0072] dividing the water flow data in the plurality of sample data sets into a plurality of data segments;
[0073] Dividing the plurality of sample data sets into a plurality of data set groups according to the data segments where the water flow data in the sample data sets are located;
[0074] For each of the plurality of data set groups, the following steps are performed respectively:
[0075] Extracting equipment parameters, equipment power consumption data, and water level data from each sample data set to construct a first array, thereby obtaining multiple first arrays;
[0076] Clustering the plurality of first arrays according to a first clustering quantity to obtain a plurality of first array classes;
[0077] Calculating the ratio of the number of data sets in each first array class to the number of data sets in the data set group, respectively, to obtain multiple quantity ratios;
[0078] Deleting first array classes whose quantity ratio is less than a ratio threshold from the plurality of first array classes to obtain a plurality of second array classes;
[0079] A first array of the plurality of second array classes is used as a factor array.
[0080] Exemplarily, the embodiments of the present invention establish a mathematical model of converting electricity to water based on multiple factors that affect agricultural irrigation electricity consumption. These factors include equipment parameters, such as water pump power, head, motor speed, etc.; equipment power consumption data, such as rated voltage, active current, reactive current, etc.; water level data, such as water level height. These factors are the main factors that affect the irrigation water flow.
[0081] The data collected based on the above factors and the water flow data of the same period are constructed into a data set in the implementation mode of the present invention. In other words, each data set contains equipment parameters, equipment power consumption data, water level data and water flow data of the same period as the above data.
[0082] In these data sets, some of the data sets may have data noise. Before modeling based on the above data, the embodiment of the present invention processes the data and extracts factor data to construct a factor array. In terms of processing the noise data, the embodiment of the present invention divides the data set into multiple data segments based on the water flow data of the data set. For example, the distribution interval of the water flow data is Q1-Q50, and these data are divided into five segments, each segment occupies Q10, that is, the data set located in a water flow data interval is classified into a data set group. Then, the data set in the data set group extracts equipment parameters, equipment power consumption data and water level data to construct a first array, and multiple first arrays are clustered. For example, the DBSCAN clustering method is used to cluster multiple first arrays to form multiple first array classes. At this time, we find that the number of arrays in a part of the classes is small. This class is usually an array that is far away from other arrays and has a large deviation from other data. We delete it and use the remaining first array classes as factor arrays. Through the above steps, we can delete the data set with noise, thereby providing a guarantee for the accuracy of modeling.
[0083] In step 103, the multiple factor arrays are respectively substituted into the basic model to obtain multiple model outputs, and the parameters of the basic model are adjusted according to the multiple model outputs and multiple target flow data until the output deviation of the basic model is less than the deviation threshold, wherein the target flow data is flow data determined based on the water flow data in the sample data set from the factor array source.
[0084] In some embodiments, the base model is:
[0085]
[0086] In the formula, is the first data, For the The first coefficient, For the combined factors, For the The second coefficient, is the bias coefficient, For flow, is the total number of times, is the total number of data in the factor array.
[0087] In some implementations, the step of respectively substituting the multiple factor arrays into a basic model to obtain multiple model outputs, and adjusting the parameters of the basic model according to the multiple model outputs and multiple target flow data until the output deviation of the basic model is less than a deviation threshold, comprises:
[0088] Get the sampling ratio;
[0089] Taking out factor arrays from the plurality of factor arrays according to the sampling ratio to form a first group, and forming the remaining factor arrays into a second group;
[0090] According to the number of factor arrays in the first group, adjusting the total number of times so that the total number of coefficients in the base model is less than the number of factor arrays in the first group;
[0091] Substituting the plurality of factor arrays in the first group into the basic model;
[0092] If the first model output deviation is greater than the deviation threshold, adjusting the parameters of the basic model according to the first model output deviation until the first model output deviation is less than the deviation threshold, wherein the first model output deviation is the deviation between a plurality of first outputs of the basic model and a plurality of target flow data, and the plurality of first outputs are outputs obtained by substituting a plurality of factor arrays in the first group into the basic model;
[0093] otherwise, substituting the plurality of factor arrays in the second group into the basic model;
[0094] If the deviation between the multiple second outputs and the multiple target flow data is greater than the deviation threshold, the sampling ratio is reduced and the process jumps to the step of taking out factor arrays from the multiple factor arrays according to the sampling ratio to form a first group and constructing the remaining factor arrays into a second group.
[0095] In some embodiments, adjusting the parameters of the base model according to the first model output deviation until the first model output deviation is less than the deviation threshold comprises:
[0096] Get multiple parameter arrays;
[0097] Substituting the multiple parameter arrays into the basic model respectively to obtain multiple intermediate models;
[0098] Determine the deviation of each intermediate model according to the deviations of the multiple first outputs of each intermediate model and the multiple target flow data, thereby obtaining the deviations of the multiple intermediate models;
[0099] If the deviations of the plurality of intermediate models are all greater than the deviation threshold, determining the model fitness according to the deviations between the plurality of first outputs of each intermediate model and the plurality of target flow data, thereby obtaining a plurality of fitnesses;
[0100] Selecting three optimal parameter arrays from the multiple parameter arrays according to the multiple fitnesses;
[0101] According to the three optimal parameter arrays, other arrays in the multiple parameter arrays are adjusted, and the process jumps to the step of substituting the multiple parameter arrays into the basic model respectively to obtain multiple intermediate models.
[0102] In some implementations, determining the model fitness according to deviations between a plurality of first outputs of each intermediate model and a plurality of target flow data includes:
[0103] The model fitness is determined according to the first formula, the deviations between the multiple first outputs of the intermediate model and the multiple target flow data, wherein the first formula is:
[0104]
[0105] In the formula, is the model fitness, The intermediate model The first output, For the Target flow data, The total number of first outputs of the intermediate model.
[0106] In some implementations, adjusting other arrays in the plurality of parameter arrays according to the three optimal parameter arrays includes:
[0107] According to the second formula and the three optimal parameter arrays, other arrays in the multiple parameter arrays are adjusted, wherein the second formula is:
[0108]
[0109] In the formula, is the distance between the parameter arrays other than the three optimal parameter arrays and the optimal parameter array, is the distance between the parameter arrays other than the three optimal parameter arrays and the suboptimal parameter arrays, is the distance between the parameter array other than the three optimal parameter arrays and the third optimal parameter array, is the optimal parameter array, is a suboptimal parameter array, is the third optimal parameter array, The first adjustment direction of the parameter array other than the three parameter arrays, The second adjustment direction of the parameter array other than the three parameter arrays, The third adjustment direction of the parameter array other than the three parameter arrays, is the number of calls, To preset the maximum number of calls, is the fifth coefficient, is the sixth coefficient.
[0110] Exemplarily, the embodiment of the present invention is modeled based on the basic model and the factor array and water flow data extracted from the above sample data set. The basic model is:
[0111]
[0112] In the formula, is the first data, For the The first coefficient, For the combined factors, For the The second coefficient, is the bias coefficient, For flow, is the total number of times, is the total number of data in the factor array.
[0113] This model includes multiple undetermined coefficients that need to be determined. We divide the number of factor groups obtained in the previous steps according to a certain ratio, one part of which is used to solve the model and the other part is used for verification. Specifically, the array of the first part is substituted into the basic model, and multiple coefficients of the model are solved. After the coefficients are determined, they are inserted into the model, and then the data of the second part is substituted into the model to verify the deviation of the model. Only when the deviation of the model after verification is less than the threshold, it means that the model is successfully built. Otherwise, adjust the division ratio (generally speaking, the ratio of the first part is reduced and the ratio of the second part is increased), and repeat the above solution and verification process.
[0114] In terms of solving the problem, the embodiment of the present invention first obtains the output deviation of the model and adjusts the parameters of the model according to the output deviation. Figure 2 , which is a schematic diagram of a first model output deviation determination method provided by an embodiment of the present invention. The first part array 201 is substituted into the model 203, and the preset parameter array 204 is substituted into the model 203 (there are multiple parameter arrays), and the obtained multiple model outputs 205 are then compared with the flow data 202 of the source data set of the first part array 201 to calculate the deviation. If the deviation is large, the parameters in the model are corrected according to the deviation.
[0115] In terms of parameter correction, the embodiment of the present invention sets multiple parameter arrays, each parameter array determines a fitness according to the corresponding model output, and the embodiment of the present invention uses the first formula to determine:
[0116]
[0117] In the formula, is the model fitness, The intermediate model The first output, For the Target flow data, The total number of first outputs of the intermediate model.
[0118] After the fitness is determined, the three parameter arrays with the best fitness are selected from multiple parameter arrays, and then the other parameter arrays are adjusted using the second formula:
[0119]
[0120] In the formula, is the distance between the parameter arrays other than the three optimal parameter arrays and the optimal parameter array, is the distance between the parameter arrays other than the three optimal parameter arrays and the suboptimal parameter arrays, is the distance between the parameter array other than the three optimal parameter arrays and the third optimal parameter array, is the optimal parameter array, is a suboptimal parameter array, is the third optimal parameter array, The first adjustment direction of the parameter array other than the three parameter arrays, The second adjustment direction of the parameter array other than the three parameter arrays, The third adjustment direction of the parameter array other than the three parameter arrays, is the number of calls, To preset the maximum number of calls, is the fifth coefficient, is the sixth coefficient. After adjustment, the parameter array gradually converges, making the model output close to the water flow data in the sample.
[0121] It should be noted that in the above formula, , and Corresponding determination , and The three coefficients of distance, each of which is determined by a different combination of the fifth coefficient and the sixth coefficient (according to the formulas in the last three rows of the second formula), for example, corresponding to The fifth and sixth coefficients are and , the formulas in the last three lines of the second formula can be calculated to get ; Similarly, corresponding The fifth and sixth coefficients are and , the formulas in the last three lines of the second formula can be calculated to get ,correspond The fifth and sixth coefficients are and , the formulas in the last three lines of the second formula can be calculated to get .
[0122] Similarly, in the above formula, , and Corresponding determination , and The three coefficients of the distance parameter array, each of which is also determined by a different combination of the fifth coefficient and the sixth coefficient (according to the formulas in the last three rows of the second formula), for example, corresponding to The fifth and sixth coefficients are and , the formulas in the last three lines of the second formula can be calculated to get ; Similarly, corresponding The fifth and sixth coefficients are and , the formulas in the last three lines of the second formula can be calculated to get ,correspond The fifth and sixth coefficients are and , the formulas in the last three lines of the second formula can be calculated to get .
[0123] In step 104, the basic model whose output deviation is less than the deviation threshold is used as the electricity-to-water model for agricultural irrigation.
[0124] Exemplarily, when a situation occurs in multiple parameter arrays that makes the output deviation of the basic model less than a threshold, the parameter array with the best fitness is found from the multiple parameter arrays and substituted into the basic model. At this time, the basic model is the constructed agricultural irrigation electricity-to-water model.
[0125] The method for constructing a model of agricultural irrigation with electricity deducted from water is implemented in the following manner: first, a plurality of sample data sets are obtained, wherein the sample data sets include water flow data, equipment parameters, equipment power consumption data, and water level data; then, the equipment parameters, equipment power consumption data, and water level data are extracted from the plurality of sample data sets to construct factor arrays, thereby obtaining a plurality of factor arrays; then, the plurality of factor arrays are respectively substituted into the basic model to obtain a plurality of model outputs; according to the plurality of model outputs and a plurality of target flow data, the parameters of the basic model are adjusted until the output deviation of the basic model is less than the deviation threshold, wherein the target flow data is flow data determined according to the water flow data in the sample data set from the factor array; finally, the basic model with the output deviation less than the deviation threshold is used as the model of agricultural irrigation with electricity deducted from water. In the implementation manner of the present invention, the irrigation model of electricity deducted from water is constructed based on a plurality of factors, and the parameters of the model are adjusted through the relationship between the factor data and the water flow sample data, so that the model can fit the relationship between the factors and the water flow, and therefore, the output result of the model is more accurate and has a wide adaptability.
[0126] 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.
[0127] 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.
[0128] Figure 3This is a functional block diagram of a device for constructing an electricity-water model for agricultural irrigation provided by an embodiment of the present invention, referring to Figure 3 The device for constructing an electricity-to-water model for agricultural irrigation includes: a sample acquisition module 301, a factor data preprocessing module 302, a model parameter determination module 303 and a model construction module 304, wherein:
[0129] The sample acquisition module 301 is used to acquire multiple sample data sets, wherein the sample data sets include water flow data, equipment parameters, equipment power consumption data and water level data;
[0130] The factor data preprocessing module 302 is used to extract equipment parameters, equipment power consumption data and water level data from the multiple sample data sets to construct factor arrays, thereby obtaining multiple factor arrays;
[0131] A model parameter determination module 303 is used to substitute the multiple factor arrays into the basic model respectively to obtain multiple model outputs, and adjust the parameters of the basic model according to the multiple model outputs and multiple target flow data until the output deviation of the basic model is less than the deviation threshold, wherein the target flow data is flow data determined according to the water flow data in the source sample data set of the factor array;
[0132] The model building module 304 is used to use the basic model whose output deviation is less than the deviation threshold as the electricity-to-water model for agricultural irrigation.
[0133] Figure 4 is a functional block diagram of an electronic device provided by an embodiment of the present invention. Figure 4 As shown, the electronic device 4 of this embodiment includes: a processor 400 and a memory 401, wherein the memory 401 stores a computer program 402 that can be run on the processor 400. When the processor 400 executes the computer program 402, the steps in the above-mentioned agricultural irrigation electricity-water model construction method and implementation method are implemented, for example Figure 1 Steps 101 to 104 are shown.
[0134] Exemplarily, the computer program 402 may be divided into one or more modules / units, and the one or more modules / units are stored in the memory 401 and executed by the processor 400 to implement the present invention.
[0135] The electronic device 4 may be a computing device such as a desktop computer, a notebook, a PDA, or a cloud server. The electronic device 4 may include, but is not limited to, a processor 400 and a memory 401. Those skilled in the art will appreciate that Figure 4It is only an example of the electronic device 4 and does not constitute a limitation of the electronic device 4. 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 4 may also include input and output devices, network access devices, buses, etc.
[0136] The processor 400 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.
[0137] The memory 401 may be an internal storage unit of the electronic device 4, such as a hard disk or memory of the electronic device 4. The memory 401 may also be an external storage device of the electronic device 4, 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 4. Further, the memory 401 may also include both an internal storage unit and an external storage device of the electronic device 4. The memory 401 is used to store the computer program 402 and other programs and data required by the electronic device 4. The memory 401 may also be used to temporarily store data that has been output or is to be output.
[0138] 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.
[0139] 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.
[0140] 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.
[0141] 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.
[0142] 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.
[0143] 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.
[0144] 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.
[0145] 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 constructing an electricity-to-water model for agricultural irrigation, characterized in that: include: Acquire multiple sample data sets, wherein the sample data sets include water flow data, equipment parameters, equipment power consumption data, and water level data; Extracting equipment parameters, equipment power consumption data, and water level data from the plurality of sample data sets to construct factor arrays, thereby obtaining a plurality of factor arrays; Substituting the multiple factor arrays into the basic model respectively to obtain multiple model outputs, and adjusting the parameters of the basic model according to the multiple model outputs and multiple target flow data until the output deviation of the basic model is less than the deviation threshold, wherein the target flow data is flow data determined according to the water flow data in the source sample data set of the factor array; The basic model with output deviation less than the deviation threshold is used as the electricity-to-water model for agricultural irrigation; in, The device parameters, device power consumption data and water level data are extracted from the multiple sample data sets to construct factor arrays, thereby obtaining multiple factor arrays, including: Get the number of clusters; dividing the water flow data in the plurality of sample data sets into a plurality of data segments; Dividing the plurality of sample data sets into a plurality of data set groups according to the data segments where the water flow data in the sample data sets are located; For each of the plurality of data set groups, the following steps are performed respectively: Extracting equipment parameters, equipment power consumption data, and water level data from each sample data set to construct a first array, thereby obtaining multiple first arrays; Clustering the plurality of first arrays according to a first clustering quantity to obtain a plurality of first array classes; Calculating the ratio of the number of data sets in each first array class to the number of data sets in the data set group, respectively, to obtain multiple quantity ratios; Deleting first array classes whose quantity ratio is less than a ratio threshold from the plurality of first array classes to obtain a plurality of second array classes; taking a first array of the plurality of second array classes as a factor array; in, The basic model is: In the formula, is the first data, For the The first coefficient, For the combined factors, For the The second coefficient, is the bias coefficient, For flow, is the total number of times, is the total number of data in the factor array; in, Substituting the multiple factor arrays into the basic model respectively to obtain multiple model outputs, and adjusting the parameters of the basic model according to the multiple model outputs and multiple target flow data until the output deviation of the basic model is less than the deviation threshold, includes: Get the sampling ratio; Taking out factor arrays from the plurality of factor arrays according to the sampling ratio to form a first group, and forming the remaining factor arrays into a second group; According to the number of factor arrays in the first group, adjusting the total number of times so that the total number of coefficients in the base model is less than the number of factor arrays in the first group; Substituting the plurality of factor arrays in the first group into the basic model; If the first model output deviation is greater than the deviation threshold, adjusting the parameters of the basic model according to the first model output deviation until the first model output deviation is less than the deviation threshold, wherein the first model output deviation is the deviation between a plurality of first outputs of the basic model and a plurality of target flow data, and the plurality of first outputs are outputs obtained by substituting a plurality of factor arrays in the first group into the basic model; otherwise, substituting the plurality of factor arrays in the second group into the basic model; If the deviation between the multiple second outputs and the multiple target flow data is greater than the deviation threshold, the sampling ratio is reduced and the process jumps to the step of taking out factor arrays from the multiple factor arrays according to the sampling ratio to form a first group and constructing the remaining factor arrays into a second group.
2. The method for constructing an electricity-to-water model for agricultural irrigation according to claim 1, characterized in that: The step of adjusting the parameters of the basic model according to the first model output deviation until the first model output deviation is less than the deviation threshold comprises: Get multiple parameter arrays; Substituting the multiple parameter arrays into the basic model respectively to obtain multiple intermediate models; Determine the deviation of each intermediate model according to the deviations of the multiple first outputs of each intermediate model and the multiple target flow data, thereby obtaining the deviations of the multiple intermediate models; If the deviations of the plurality of intermediate models are all greater than the deviation threshold, determining the model fitness according to the deviations between the plurality of first outputs of each intermediate model and the plurality of target flow data, thereby obtaining a plurality of fitnesses; Selecting three optimal parameter arrays from the multiple parameter arrays according to the multiple fitnesses; According to the three optimal parameter arrays, other arrays in the multiple parameter arrays are adjusted, and the process jumps to the step of substituting the multiple parameter arrays into the basic model respectively to obtain multiple intermediate models.
3. The method for constructing an electricity-to-water model for agricultural irrigation according to claim 2, characterized in that: The step of determining the model fitness according to the deviations between the multiple first outputs of each intermediate model and the multiple target flow data comprises: The model fitness is determined according to the first formula, the deviations between the multiple first outputs of the intermediate model and the multiple target flow data, wherein the first formula is: In the formula, is the model fitness, The intermediate model The first output, For the Target flow data, The total number of first outputs of the intermediate model.
4. The method for constructing an electricity-to-water model for agricultural irrigation according to claim 2, characterized in that: The adjusting other arrays in the plurality of parameter arrays according to the three optimal parameter arrays includes: According to the second formula and the three optimal parameter arrays, other arrays in the multiple parameter arrays are adjusted, wherein the second formula is: In the formula, is the distance between the parameter arrays other than the three optimal parameter arrays and the optimal parameter array, is the distance between the parameter arrays other than the three optimal parameter arrays and the suboptimal parameter arrays, is the distance between the parameter array other than the three optimal parameter arrays and the third optimal parameter array, is the optimal parameter array, is a suboptimal parameter array, is the third optimal parameter array, The first adjustment direction of the parameter array other than the three parameter arrays, The second adjustment direction of the parameter array other than the three parameter arrays, The third adjustment direction of the parameter array other than the three parameter arrays, is the number of calls, To preset the maximum number of calls, is the fifth coefficient, is the sixth coefficient.
5. A device for constructing an electricity-water model for agricultural irrigation, characterized in that: Used to implement the method for constructing an agricultural irrigation model by decomposing electricity into water as described in any one of claims 1 to 4, the agricultural irrigation model by decomposing electricity into water construction device comprises: A sample acquisition module, used to acquire multiple sample data sets, wherein the sample data sets include water flow data, equipment parameters, equipment power consumption data and water level data; A factor data preprocessing module is used to extract equipment parameters, equipment power consumption data and water level data from the multiple sample data sets to construct factor arrays, thereby obtaining multiple factor arrays; A model parameter determination module, used for respectively substituting the multiple factor arrays into a basic model to obtain multiple model outputs, and adjusting the parameters of the basic model according to the multiple model outputs and multiple target flow data until the output deviation of the basic model is less than a deviation threshold, wherein the target flow data is flow data determined according to the water flow data in the source sample data set of the factor array; as well as, The model building module is used to use the basic model with output deviation less than the deviation threshold as the agricultural irrigation electricity-to-water model.
6. 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 4 are implemented.
7. 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 4 are implemented.
Citation Information
Patent Citations
Electricity-to-water calculation model construction method and water consumption determination method and device
CN113486594A