Optimized regulation and control method and device for water transportation and distribution of irrigation district canal network, electronic equipment and medium

By using the canal network hydrodynamic model to generate simulation data sets, and combining with the particle swarm algorithm, the problem of low simulation accuracy of the water transfer and distribution optimization model of the irrigation canal network is solved, and efficient and flexible water transfer and distribution in the irrigation canal network is achieved. Regulation has improved the scientificity and efficiency of irrigation area management.

CN119168427AActive Publication Date: 2024-12-20HANGZHOU DINGCHUAN INFORMATION TECH CO LTD

Patent Information

Application Number
CN202411660261.6
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-11-20
Publication Date
2024-12-20
Estimated Expiration
2044-11-20

AI Technical Summary

Technical Problem

The simulation accuracy of the existing irrigation zone canal network water distribution optimization model is not high enough, resulting in a far different subsequent tuning plan from the actual situation, making it difficult to achieve scientific management and efficient scheduling.

Method used

The channel network hydrodynamic model is used to generate simulation data sets to train the Transformer model, and combine the particle swarm algorithm to find the optimal gate scheduling solution. Through iterative training, the model accuracy and flexibility are improved, and the application difficulty of insufficient information construction is reduced.

Benefits of technology

It improves the simulation accuracy of the water transport model, enhances the robustness and calculation speed of the model, can flexibly adjust the model complexity according to actual conditions, reduces the threshold for use, and continuously iterates the prediction accuracy after deployment.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119168427A_ABST
    Figure CN119168427A_ABST
Patent Text Reader

Abstract

The invention discloses an irrigation district canal network water transmission and distribution optimization regulation and control method and device, electronic equipment and a medium. The method comprises the steps that irrigation district irrigation data recorded by historical characters and irrigation district irrigation data collected by a sensor after informatization construction are collected; constructing a canal network hydrodynamic model; calibrating the canal network hydrodynamic model by using the irrigation data of the irrigation area, and generating a simulation data set by using the calibrated canal network hydrodynamic model; constructing a Transform model, and training the model by using the simulation data set; using the trained model and a particle swarm algorithm, and combining with an optimization target to find an optimal gate scheduling scheme; and acquiring actual irrigation data of the irrigation area applying the optimal gate scheduling scheme, and retraining the trained model by taking the actual irrigation data of the irrigation area as negative feedback. The water demand of crops in an irrigation area is more accurately met, and popularization and use and future model iteration are facilitated while optimal utilization of water resources is achieved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the technical field of irrigation water distribution in irrigation areas, and in particular to a method and device, electronic equipment, and medium for optimizing and controlling water supply and distribution in irrigation channel networks. Background Art

[0002] With global climate change and population growth, the contradiction between water supply and demand has become increasingly prominent, especially in the agricultural sector, where the rational allocation of water resources is crucial to ensuring food security and sustainable development. Therefore, how to scientifically guide the optimization of irrigation area water distribution, reduce canal losses, and improve irrigation water utilization has become the key to the steady development of farmland water conservancy.

[0003] In the traditional irrigation water distribution process, due to the lack of real-time data support and intelligent management, water distribution plans are often formulated based on crop growth systems, irrigation canal distribution and manual experience. This model is relatively fixed in time scale and difficult to respond to changes in meteorological conditions and water sources in real time, resulting in a rough water distribution model that lacks flexibility and timeliness. With the development of information technology and artificial intelligence, real-time canal water distribution combined with meteorological conditions and irrigation water demand forecasts has become possible, and the optimization goal has also evolved from minimizing the loss of canal water distribution to multi-objective modeling that takes into account the stability of canal water delivery.

[0004] In the research of irrigation canal optimization water distribution model, a variety of intelligent algorithms have emerged, such as differential evolution, multi-objective particle swarm and NSGA-II. These algorithms have improved the timeliness and refinement of irrigation canal water distribution problems. However, in the process of realizing the present invention, the inventors found that there are at least the following problems in the prior art: the simulation accuracy of the water delivery model is not high enough, which makes the subsequent optimization plan far from the actual situation.

[0005] In summary, the development of irrigation district canal network water supply and distribution optimization control technology not only needs to consider the rational allocation and utilization of water resources, but also needs to combine modern information technology and intelligent algorithms to achieve scientific management and efficient scheduling of irrigation areas. Summary of the invention

[0006] The purpose of the embodiments of the present application is to provide a method and device, electronic equipment, and medium for optimizing and controlling water supply and distribution in an irrigation canal network, so as to solve the technical problem that the simulation accuracy of the water supply model existing in the related art is not high enough.

[0007] According to a first aspect of an embodiment of the present application, a method for optimizing and controlling water supply and distribution in a canal network of an irrigation area is provided, comprising: S1: Collect irrigation data of irrigation areas recorded in historical texts and irrigation data of irrigation areas collected by sensors after informatization construction. The irrigation data of irrigation areas include meteorological characteristic data, crop data, soil moisture data of different soil layers in each irrigation area, and gate scheduling plans for corresponding time periods; S2: Construct a canal network hydrodynamic model; S3: calibrating the canal network hydrodynamic model using the irrigation data of the irrigation area, and generating a simulation data set using the calibrated canal network hydrodynamic model; S4: construct a Transformer model, and use the simulation data set to train the Transformer model; S5: Use the trained Transformer model and particle swarm algorithm to find the optimal gate scheduling solution in combination with the optimization goal; S6: Acquire actual irrigation data of the irrigation area to which the optimal gate scheduling scheme is applied, and use the actual irrigation data of the irrigation area as negative feedback to retrain the Transformer model trained in S4.

[0008] According to a second aspect of the embodiment of the present application, a device for optimizing and controlling water supply and distribution in a canal network of an irrigation area is provided, comprising: The data acquisition module is used to collect irrigation data of the irrigation area recorded in historical texts and irrigation data of the irrigation area collected by sensors after the informatization construction. The irrigation data of the irrigation area includes meteorological characteristic data, crop data, soil moisture data of different soil layers in each irrigation area, and gate scheduling plans for corresponding time periods; Model building module, used to build canal network hydrodynamic model; A calibration and data generation module, used to calibrate the canal network hydrodynamic model using the irrigation data of the irrigation area, and generate a simulation data set using the calibrated canal network hydrodynamic model; A model building and training module, used to build a Transformer model and train the Transformer model using the simulation data set; The optimization module is used to use the trained Transformer model and particle swarm algorithm to find the optimal gate scheduling solution in combination with the optimization goal; The negative feedback module is used to obtain the actual irrigation data of the irrigation area to which the optimal gate scheduling scheme is applied, and to use the actual irrigation data of the irrigation area as negative feedback to retrain the Transformer model trained by the model construction and training modules.

[0009] According to a third aspect of an embodiment of the present application, there is provided an electronic device, including: one or more processors; A memory for storing one or more programs; When the one or more programs are executed by the one or more processors, the one or more processors implement the method as described in the first aspect.

[0010] According to a fourth aspect of an embodiment of the present application, a computer-readable storage medium is provided, on which computer instructions are stored, and when the instructions are executed by a processor, the steps of the method described in the first aspect are implemented.

[0011] The technical solution provided by the embodiments of the present application may have the following beneficial effects: The method of first using the canal network hydrodynamic model to generate a simulation data set to roughly train the Transformer model, and then using the actual irrigation data after scheduling to iteratively train the Transformer model not only solves the problem of insufficient simulation accuracy of the water delivery model, but also reduces the difficulty of applying the water delivery model in irrigation areas with insufficient information construction. Compared with the irrigation area canal network water delivery and distribution optimization control method based on hydrodynamic simulation, the present invention can flexibly adjust the model complexity according to actual conditions and needs. At the very least, a simplified canal network hydrodynamic model can be constructed in the absence of high-precision three-dimensional vector data of the irrigation area and without solving the Saint-Venant equations, which reduces the threshold for use of the present invention.

[0012] Compared with the irrigation canal network water distribution optimization control method based on RNN, LSTM, GRU and SRU models, the Transformer model used in the present invention does not rely on the previous calculation results, has a faster calculation speed, and can better cooperate with the optimization algorithm to find the best. Secondly, by using the canal network hydrodynamic model to generate simulation data to train the Transformer model, it has stronger robustness.

[0013] In addition, the present invention takes into account the issue of subsequent maintenance of the model. By using a Transformer model with an attention mechanism, the model can continue to iterate the prediction accuracy after deployment, making it more versatile.

[0014] It should be understood that the foregoing general description and the following detailed description are exemplary and explanatory only and are not restrictive of the present application. BRIEF DESCRIPTION OF THE DRAWINGS

[0015] The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the present application and, together with the description, serve to explain the principles of the present application.

[0016] Figure 1 It is a flow chart of a method for optimizing water supply and distribution in an irrigation canal network according to an exemplary embodiment.

[0017] Figure 2 The figure is a generalized diagram of a canal network in an irrigation area according to an exemplary embodiment.

[0018] Figure 3 It is a block diagram of a device for optimizing and controlling water supply and distribution in a canal network of an irrigation area according to an exemplary embodiment.

[0019] Figure 4 The diagram is a schematic structural diagram of an electronic device according to an exemplary embodiment. DETAILED DESCRIPTION

[0020] Here, exemplary embodiments are described in detail, and examples thereof are shown in the accompanying drawings. When the following description refers to the drawings, unless otherwise indicated, the same numbers in different drawings represent the same or similar elements. The implementations described in the following exemplary embodiments do not represent all implementations consistent with the present application.

[0021] The terms used in this application are only for the purpose of describing specific embodiments and are not intended to limit this application. The singular forms of "a", "said" and "the" used in this application are also intended to include plural forms, unless the context clearly indicates other meanings. It should also be understood that the term "and / or" used in this article refers to and includes any or all possible combinations of one or more associated listed items.

[0022] It should be understood that although the terms first, second, third, etc. may be used in the present application to describe various information, these information should not be limited to these terms. These terms are only used to distinguish the same type of information from each other. For example, without departing from the scope of the present application, the first information may also be referred to as the second information, and similarly, the second information may also be referred to as the first information. Depending on the context, the word "if" as used herein may be interpreted as "at the time of" or "when" or "in response to determining".

[0023] Figure 1 is a flow chart of a method for optimizing water supply and distribution in an irrigation canal network according to an exemplary embodiment. Figure 1 As shown, the method comprises the following steps: S1. Collect irrigation data of irrigation areas recorded in historical texts and irrigation data of irrigation areas collected by sensors after informatization construction. The irrigation data of irrigation areas include meteorological characteristic data, crop data, soil moisture data of different soil layers in each irrigation area, and gate scheduling plans for corresponding time periods.

[0024] Specifically, the meteorological characteristic data includes light, rainfall, temperature and humidity, and the crop data includes planting type and growth period. The specific representation is as follows: Illumination I = [I1, I2, ... , I t ], length is t; RainfallP = [P1, P2, ... , P t ], length is t; Temperature T = [T1, T2, ... , T t], length is t; Humidity F = [F1, F2, ... , F t ], length is t; Planting type Cv = [Cv1, Cv2, ... , Cv t ], length is t; Growth period Ct = [Ct1, Ct2, ... , Ct t ], length is t; Soil moisture information M = [M1, M2, M3, ... , M n , ... , M c ], c represents the number of soil layers, where M n =[M n_1 , M n_2 , M n_3 , ... , M n_t ], with a length of c×t; Gate scheduling scheme O = [O1, O2, O3, ... , O n , ... , O p ], p represents the number of gates, where O n = [O n_1 , O n_2 , O n_3 , ... , O n_t ], with a length of p×t; In order to enhance model performance, reduce the risk of overfitting and ensure data consistency, the irrigation data of the irrigation area can also be cleaned and formatted first. Specifically, the data is aligned according to the time and combined into a two-dimensional matrix of size (6+c+p)×t. In the case of missing data, it is repaired according to contextual data, gate operation data and historical text records. Subsequently, the possible data anomalies in the data are preliminarily screened by using the 3σ rule or clustering method, and corrections are made based on the experience of irrigation area managers. The cleaned data is normalized, mapped to the [-1,1] interval, and integrated into a calibration data set for calibrating the simplified canal network hydrodynamic model. This operation facilitates improving the model training speed and model prediction accuracy.

[0025] S2. Constructing a canal network hydrodynamic model; this step may include the following sub-steps: S21: Based on the canal network conditions of the irrigation area, the upstream and downstream relationships of the water diversion gates, and the corresponding relationships between the water diversion gates and each irrigation area, a tree-like relationship network is established, and the tree-like relationship network will determine the calculation order of water flow in the canal network hydrodynamic model; Specifically, Figure 2It is a generalized diagram of an irrigation area canal network shown according to an exemplary embodiment. According to the upstream and downstream relationship of the water diversion gate in the generalized diagram of the irrigation area canal network, the flow direction of the water flow at the water diversion gate is determined; according to the corresponding relationship between the water diversion gate and each irrigation area in the generalized diagram of the irrigation area canal network, the irrigation area into which the water flow flows at each water diversion gate is determined; according to the area size of each irrigation area in the generalized diagram of the irrigation area canal network, the proportion of the water flow from each water diversion gate to the irrigation area is determined. According to the water flow direction, the irrigation area into which the water flow flows at each water diversion gate and the area of ​​each irrigation area, the calculation order of the water flow from the main canal through the water diversion gate and then through the branch canal to each irrigation area in the canal network hydrodynamic model is determined.

[0026] S22: Initializing the flow direction, water diversion and flow ratio parameters of the water flow after the diversion gate according to the tree-like relationship network and the design flow ratio of the main canal and branch canal, wherein the parameters will determine the diversion size and flow direction of the water flow in the canal network hydrodynamic model; Specifically, according to the design flow ratio of the branch canal and the main canal after each diversion gate, the diversion ratio of the water flow at the diversion gate is determined, and the flow direction, diversion situation and the flow ratio parameters of the water flow after the diversion gate are initialized. The parameters will determine the diversion size and flow direction of the water flow in the canal network hydrodynamic model, and determine the size ratio of the water flow flowing to the branch canal when calculating the water flow from the main canal through the diversion gate, and when calculating the size ratio of the water flow from the branch canal to each irrigation area.

[0027] S23: Initialize the water infiltration parameters and evaporation parameters in the canal network hydrodynamic model according to the relationship between the meteorological characteristic data and water evaporation at the irrigation area, and the relationship between the soil moisture and water infiltration at the irrigation area; Specifically, regression analysis is performed on the channel data and water infiltration data of the irrigation area, where the channel data includes the soil composition and structure of the channel bed, the channel cross-sectional form and hydraulic characteristics, the groundwater depth, the channel length and the channel lining conditions, to determine the influence weight of soil moisture. Regression analysis is performed on the meteorological characteristic data and water evaporation data of the irrigation area, where the meteorological characteristic data includes wind speed, temperature, water vapor pressure and relative humidity, to determine the influence weight of each meteorological characteristic on water evaporation in the main and branch canals. Based on the influence weight, the water infiltration parameters and evaporation parameters in the canal network hydrodynamic model are initialized.

[0028] S24: Construct a canal network hydrodynamic model using the tree relationship network, water flow direction, water diversion conditions, and water flow ratio parameters after the diversion gate, infiltration parameters, and evaporation parameters.

[0029] Specifically, a simplified canal network hydrodynamic model is constructed using the calculation order of water flow, water flow direction, water diversion conditions, water flow ratio after the diversion gate, infiltration parameters and evaporation parameters when water flows through the main and branch canals, and is encapsulated as a model interface to facilitate subsequent model debugging and calling.

[0030] S3, using the irrigation data of the irrigation area to calibrate the canal network hydrodynamic model, and using the calibrated canal network hydrodynamic model to generate a simulation data set; this step may include the following sub-steps: S31, sorting and formatting the meteorological characteristic data, crop data, soil moisture data and gate scheduling plan to form an irrigation data set for the irrigation area, including: Take the model input X at time t t = is: X t =[I t ,P t ,T t ,F t ,Cv t ,Ct t ,M 1_(t-1) ,M 2_(t-1) ,......,M c_(t-1) ,O 1_t ,O 2_t ,......,O p_t ], where I t represents the average light intensity at time t, P t represents the rainfall from time t-1 to time t, T t represents the average temperature at time t, F t represents the average humidity at time t, Cv t Indicates the crop planting type at time t, Ct t represents the crop growth period at time t, M 1_(t-1) To M c_(t-1) represents the soil moisture of the soil layers numbered 1 to c at time t-1, O 1_t to p_t Indicates the gate opening of gates numbered 1 to p at time t; Let the model expected output Y at time t be t for: Y t =[M 1_t ,M 2_t ,......,M c_t] , where t∈[t0,t n ], M 1_t To M c_t It represents the actual observed soil moisture of the soil layers numbered 1 to c at time t; S32, taking the total length of the irrigation data set of the irrigation area as n, setting the sliding window width as S, and obtaining n-(S-1) gate scheduling processes with a scheduling duration of S by means of a sliding window to form a calibration data set, wherein: The model input x is: x=[x0,x1,......,x n-S ], where xt =[X t ,X t+1 ,......,X t+(S-1) ]; The model expects the output y to be: y=[y0,y1,......,y n-S ], where y t =[Y t ,Y t+1 ,......,Y t+(S-1) ]; S33, using the canal network hydrodynamic model to traverse and calculate the calibration data set, and obtain the model calculation output y': y`=[y0`,y1`,......,y n-S `], where y t `=[Y t `,Y t+1 `,......,Y t+(S-1) `] The model input x t is a two-dimensional matrix of size (6+c+p)×t, and the model expects the output y t And the model calculates the output y t ` are all one-dimensional matrices of size 1×c. The size of S in this step can be adjusted according to the data length in the specific application scenario and the model size supported by the hardware. Choosing a larger L can better find the periodic law, but there are also marginal effects and the disadvantage of longer training and calculation time. Therefore, using L=72 is a more reasonable value.

[0031] S34, comparing the difference between the expected output y of the model and the calculated output y' of the model, and correcting the parameters of the canal network hydrodynamic model in S2 according to the difference, so that the difference is less than a set threshold; Specifically, the difference between the expected output y of the model and the calculated output y` of the model is calculated, that is, the error e=y−y`. Perform parameter sensitivity analysis to identify the parameters that have the greatest impact on the model output. According to the error analysis results and parameter sensitivity analysis, adjust the model parameters to reduce the error. The model parameters include the flow rate ratio after the diversion gate, the infiltration parameters and evaporation parameters when the water flows through the main and branch canals. After adjusting the parameters, run the model again to verify whether the parameter adjustment effectively reduces the error and ensure the consistency of the model output with the observed data. If the error is still greater than the set threshold, repeat the parameter adjustment and model verification steps until the error requirement is met. When the adjusted parameters make the difference between the model output y` and the expected output y less than or equal to the set threshold, update the model parameters and record the adjustment history.

[0032] The model runs on real data, making decisions more data-driven and reducing the risk of decisions that rely on experience or intuition. In addition, by comparing model outputs with actual observation data, model parameters can be regularly verified and updated to ensure that the model adapts over time and changes in the environment.

[0033] S35, generating meteorological characteristic data, crop information data, gate dispatching scheme and soil moisture data before dispatching, and using them as inputs of the canal network hydrodynamic model to calculate the soil moisture data after dispatching; Specifically, meteorological characteristic data, crop information data, gate scheduling scheme and soil moisture data before scheduling are generated. Meteorological characteristic data and soil moisture data: According to the existing irrigation area data collected by S1, the normal distribution parameters μ and σ of light, rainfall, temperature, humidity and soil moisture are calculated respectively, and the parameters are used to generate meteorological characteristic data and soil moisture data before scheduling. Crop information data: According to the proportion of crop types in the irrigation area, the probability weight is determined, and the crop type and growth cycle data are randomly generated. Gate scheduling scheme: Randomly generate the opening of each gate at each moment.

[0034] S36, based on the meteorological characteristic data, crop information data, gate scheduling plan, soil moisture data before scheduling, and soil moisture data after scheduling generated in S35, repeatedly execute S31 and S32 to form a simulation data set; Specifically, the meteorological characteristic data, crop information data, gate scheduling scheme, soil moisture data before scheduling, and soil moisture data after scheduling generated in S35 are formatted into simulation data sets of x and y. On the one hand, the formatting process facilitates data verification after the simulation data is visualized to ensure data accuracy and reliability. On the other hand, the formatting process is conducive to reducing the workload of data docking of subsequent models.

[0035] S4, constructing a Transformer model, and using the simulation data set to train the Transformer model; this step includes the following sub-steps: S41: performing data preprocessing on the simulation data set; Specifically, use min-max normalization, Z-score normalization, or logarithmic transformation methods to adjust the range or distribution of the data to the specified range. Perform data dimensionality reduction using the PCA method to reduce the dimension and scale of the data while retaining the most important information. Augment, confuse, or generate the original data to increase the diversity and scale of the data and improve the generalization ability of the model. Use the Pandas and NumPy libraries in Python to simplify the data preprocessing process and improve efficiency. Data preprocessing can not only reduce the computing resources and time required for model training through data reduction and dimensionality reduction, but also reduce the model's sensitivity to noisy data and avoid overfitting through feature selection and regularization.

[0036] S42: building a Transformer model, randomly initializing the weights of each layer, and sending the simulation data set to the Transformer model for training; Specifically, a Transformer model is constructed, and the weights of each layer are randomly initialized. In this embodiment, the Transformer model mainly consists of four parts: an input module, an encoding module, a decoding module, and an output module. t As input, it is first converted into a series of embedding vectors x through the input module (Input) t_1 , these vectors include word embeddings and positional encodings to preserve the position information of words in the sequence.

[0037] The encoder module (Encoder) consists of multiple encoder layers (Encoder Layer), each of which contains two sub-layers: the multi-head self-attention sub-layer and the feed-forward neural network sub-layer. t_1 After passing through the encoding module, it will be encoded into x t_2 .

[0038] The decoding module (Decoder) is also composed of multiple decoding layers (Dncoder Layer), each of which contains three sub-layers: Mask Multi-Head Self-Attention sub-layer, Multi-Head Self-Attention sub-layer and Feed-Forward Neural Network sub-layer. t_2 The encoded information will be decoded into x after passing through the decoding module. t_3 .

[0039] The output module (Output) consists of a fully connected layer (Linear Layer) and a Softmax layer. t_3 The various feature information is mapped from the high-dimensional space to the output result y t `, thereby realizing the complex nonlinear fitting capability of the model.

[0040] Compared with RNN, LSTM, GRU and SRU models, the Transformer model can calculate all subsequent results at once, without relying on the previous calculation results. Choosing the Transformer model makes the calculation faster and can better cooperate with the optimization algorithm to find the best result.

[0041] S43: During the training process, a back propagation algorithm is used to update the parameters of each layer in the Transformer model.

[0042] Specifically, during the training process, the back propagation algorithm is used to update the parameters of each layer in the model. After training, x is input into the Transformer model, and the predicted value y' of soil moisture is output. The loss function used for training the Transformer model is the root mean square error, that is, the root mean square sum of the actual monitoring value y and the predicted value y', and the optimization goal is to minimize the loss function value.

[0043] S5. Use the trained Transformer model and particle swarm algorithm to find the optimal gate scheduling solution in combination with the optimization goal. This step may include the following sub-steps: S51: Configuration optimization objectives: minimum canal system water loss, minimum main canal flow fluctuation, shortest irrigation time and meeting soil moisture requirements; Specifically, the optimization problem of the irrigation system is transformed into an objective function, which has multiple objectives: minimum canal water loss, minimum main canal flow fluctuation, shortest irrigation time and meeting soil moisture requirements. The goal of minimizing canal water loss is to reduce water loss caused by leakage and evaporation during water delivery by optimizing canal water distribution; the goal of minimizing main canal flow fluctuation is to maintain the stability of main canal flow and reduce uneven irrigation and water resource waste caused by flow fluctuation; the goal of minimizing irrigation time is to reduce the total time required for irrigation and improve irrigation efficiency; the goal of meeting soil moisture requirements is to ensure that the moisture in the soil meets the needs of crop growth and avoid the adverse effects of excessive or insufficient moisture on crop growth. By modifying the weight of each objective in the objective function and setting the importance of each objective, it is convenient for subsequent algorithm optimization.

[0044] S52: The trained Transformer model is responsible for calculating the soil moisture data after scheduling when the meteorological characteristic data, crop information data and soil moisture data before scheduling remain unchanged and different gate scheduling schemes are applied; Specifically, meteorological characteristic data, crop information data, soil moisture data before scheduling, and the gate scheduling plan provided by the particle swarm algorithm are used as data input, and the trained Transformer model is used to calculate the soil moisture data after scheduling. Multiple calculation requests in a short period of time will be merged into the same batch and sent to the Transformer model for parallel calculation, which can effectively speed up the calculation speed and facilitate the optimization of the particle swarm algorithm.

[0045] S53: The particle swarm algorithm is responsible for finding the optimal gate scheduling scheme to meet the optimization goal and obtain the optimal gate scheduling scheme for irrigation in the irrigation area.

[0046] Specifically, the parameters of the PSO algorithm are set, including the number of particles, number of iterations, learning factor, inertia weight, etc. A set of particles is randomly initialized in the search space, each particle represents a potential gate scheduling scheme, and its fitness value, that is, the value of the objective function, is calculated. The speed and position of the particles are continuously updated through the iterative process. The speed update of the particles is affected by the individual learning factor, social learning factor and inertia weight. In each iteration, the fitness value of each particle is evaluated, and the individual extreme value and global extreme value are updated according to the fitness value. According to the individual extreme value and the global extreme value, the speed and position of the particles are updated to find a better gate scheduling scheme. When the preset number of iterations is reached or other termination conditions are met, the algorithm stops and outputs the optimal solution currently found. The optimal solution output by the algorithm is analyzed to verify its feasibility and effect in the actual irrigation system.

[0047] S6. Acquire actual irrigation data of the irrigation area to which the optimal gate scheduling scheme is applied, and use the actual irrigation data of the irrigation area as negative feedback to retrain the Transformer model trained in S4.

[0048] Specifically, in the process of implementing the optimal gate scheduling scheme described in S53, the actual irrigation data of the irrigation area is collected and obtained. The actual irrigation data of the irrigation area includes the meteorological characteristic data, crop information data, gate scheduling scheme, soil moisture data before scheduling, and soil moisture data after scheduling. Using the process described in S36, the actual irrigation data of the irrigation area is processed into a data set in the format of x and y. The actual irrigation data of the irrigation area is used as negative feedback, and the Transformer model trained in S4 is retrained using the process described in S43.

[0049] It can be seen from the above embodiments that the present application adopts a method of first using the canal network hydrodynamic model to generate a simulation data set to perform rough training on the Transformer model, and then using the actual irrigation data after scheduling to iteratively train the Transformer model. This not only solves the problem of insufficient simulation accuracy of the water transfer model, but also reduces the difficulty of applying the water transfer model in irrigation areas with insufficient informatization construction.

[0050] Corresponding to the aforementioned embodiment of the method for optimizing the control of water supply and distribution in the canal network of an irrigation area, the present application also provides an embodiment of a device for optimizing the control of water supply and distribution in the canal network of an irrigation area.

[0051] Figure 3 The block diagram of an irrigation canal network water supply and distribution optimization control device is shown according to an exemplary embodiment. Figure 3 , the device comprises: Data acquisition module 1, used to collect irrigation data of irrigation areas recorded in historical texts and irrigation data of irrigation areas collected by sensors after informatization construction, wherein the irrigation data of irrigation areas include meteorological characteristic data, crop data, soil moisture data of different soil layers in each irrigation area, and gate scheduling schemes for corresponding time periods; Model building module 2, used to build a canal network hydrodynamic model; A calibration and data generation module 3, used to calibrate the canal network hydrodynamic model using the irrigation data of the irrigation area, and generate a simulation data set using the calibrated canal network hydrodynamic model; A model building and training module 4 is used to build a Transformer model and train the Transformer model using the simulation data set; Optimization module 5, used to use the trained Transformer model and particle swarm algorithm to find the optimal gate scheduling solution in combination with the optimization goal; The negative feedback module 6 is used to obtain the actual irrigation data of the irrigation area to which the optimal gate scheduling scheme is applied, and to use the actual irrigation data of the irrigation area as negative feedback to retrain the Transformer model trained by the model building and training modules.

[0052] Regarding the device in the above embodiment, the specific manner in which each module performs operations has been described in detail in the embodiment of the method, and will not be elaborated here.

[0053] For the device embodiment, since it basically corresponds to the method embodiment, the relevant parts can refer to the partial description of the method embodiment. The device embodiment described above is only schematic, wherein the units described as separate components may or may not be physically separated, and the components displayed as units may or may not be physical units, that is, they may be located in one place, or they may be distributed on multiple network units. Some or all of the modules may be selected according to actual needs to achieve the purpose of the present application scheme. A person of ordinary skill in the art can understand and implement it without paying any creative work.

[0054] Accordingly, the present application also provides an electronic device, including: one or more processors; a memory for storing one or more programs; when the one or more programs are executed by the one or more processors, the one or more processors implement the above-mentioned irrigation canal network water supply and distribution optimization control method. Figure 4 As shown in the figure, it is a hardware structure diagram of any device with data processing capability where an irrigation area canal network water supply and distribution optimization control device provided by an embodiment of the present invention is located, except Figure 4 In addition to the processor and memory shown, any device with data processing capability in which the apparatus in the embodiment is located may also include other hardware, generally based on the actual functions of the device with data processing capability, which will not be described in detail.

[0055] Accordingly, the present application also provides a computer-readable storage medium on which computer instructions are stored, and when the instructions are executed by the processor, the irrigation area canal network water supply and distribution optimization control method as described above is implemented. The computer-readable storage medium can be an internal storage unit of any device with data processing capabilities described in any of the aforementioned embodiments, such as a hard disk or a memory. The computer-readable storage medium can also be an external storage device of a wind turbine, such as a plug-in hard disk, a smart memory card (Smart Media Card, SMC), an SD card, a flash card (Flash Card), etc. equipped on the device. Furthermore, the computer-readable storage medium can also include both an internal storage unit and an external storage device of any device with data processing capabilities. The computer-readable storage medium is used to store the computer program and other programs and data required by any device with data processing capabilities, and can also be used to temporarily store data that has been output or is to be output.

[0056] Those skilled in the art will readily appreciate other embodiments of the present application after considering the specification and practicing the contents disclosed herein. The present application is intended to cover any variations, uses or adaptations of the present application, which follow the general principles of the present application and include common knowledge or customary technical means in the art that are not disclosed in the present application.

[0057] It should be understood that the present application is not limited to the exact construction that has been described above and shown in the drawings, and that various modifications and changes may be made without departing from the scope thereof.

Claims

1. A method for optimizing water supply and distribution in irrigation canal networks. It is characterized in that include: S1: Collect irrigation data of irrigation areas recorded in historical texts and irrigation data of irrigation areas collected by sensors after informatization construction. The irrigation data of irrigation areas include meteorological characteristic data, crop data, soil moisture data of different soil layers in each irrigation area, and gate scheduling plans for corresponding time periods; S2: Construct a canal network hydrodynamic model; S3: calibrating the canal network hydrodynamic model using the irrigation data of the irrigation area, and generating a simulation data set using the calibrated canal network hydrodynamic model; S4: construct a Transformer model, and use the simulation data set to train the Transformer model; S5: Use the trained Transformer model and particle swarm algorithm to find the optimal gate scheduling solution in combination with the optimization goal; S6: Acquire actual irrigation data of the irrigation area to which the optimal gate scheduling scheme is applied, and use the actual irrigation data of the irrigation area as negative feedback to retrain the Transformer model trained in S4.

2. The method according to claim 1, It is characterized in that After collecting the irrigation data of the irrigation area recorded in historical text and the irrigation data of the irrigation area collected by sensors after the informatization construction, it also includes: data cleaning and formatting processing of the irrigation data of the irrigation area.

3. The method according to claim 1, It is characterized in that The meteorological characteristic data include sunlight, rainfall, temperature and humidity, and the crop data include planting type and growth period.

4. The method according to claim 1, It is characterized in that Construct a canal network hydrodynamic model, including: S21: Based on the canal network conditions of the irrigation area, the upstream and downstream relationships of the water diversion gates, and the corresponding relationships between the water diversion gates and each irrigation area, a tree-like relationship network is established, and the tree-like relationship network will determine the calculation order of water flow in the canal network hydrodynamic model; S22: Initializing the flow direction, water diversion and flow ratio parameters of the water flow after the diversion gate according to the tree-like relationship network and the design flow ratio of the main canal and branch canal, wherein the parameters will determine the diversion size and flow direction of the water flow in the canal network hydrodynamic model; S23: Initialize the water infiltration parameters and evaporation parameters in the canal network hydrodynamic model according to the relationship between the meteorological characteristic data and water evaporation at the irrigation area, and the relationship between the soil moisture and water infiltration at the irrigation area; S24: Construct a canal network hydrodynamic model using the tree relationship network, water flow direction, water diversion conditions, and water flow ratio parameters after the diversion gate, infiltration parameters, and evaporation parameters.

5. The method according to claim 1, It is characterized in that The irrigation data of the irrigation area is used to calibrate the canal network hydrodynamic model, and the calibrated canal network hydrodynamic model is used to generate a simulation data set, including: S31: Arrange and format the meteorological characteristic data, crop data, soil moisture data and gate scheduling plan to form an irrigation data set for the irrigation area, including: Take the model input X at time t t for: X t =[I t ,P t ,T t ,F t ,Cv t ,Ct t ,M 1_(t-1) ,M 2_(t-1) ,......,M c_(t-1) ,O 1_t ,O 2_t ,......,O p_t ], where I t represents the average light intensity at time t, P t represents the rainfall from time t-1 to time t, T t represents the average temperature at time t, F t represents the average humidity at time t, Cv t Indicates the crop planting type at time t, Ct t represents the crop growth period at time t, M 1_(t-1) To M c_(t-1) represents the soil moisture of the soil layers numbered 1 to c at time t-1, O 1_t to p_t Indicates the gate opening of gates numbered 1 to p at time t; Take the model expected output Y at time t t for: Y t =[M 1_t ,M 2_t ,......,M c_t] , where t∈[t 0 , t n ],M 1_t To M c_t It represents the actual observed soil moisture of the soil layers numbered 1 to c at time t; S32: Take the total length of the irrigation data set of the irrigation area as n, set the sliding window width as S, and obtain n-(S-1) gate scheduling processes with a scheduling duration of S through a sliding window to form a calibration data set, where: The model input x is: x=[x 0 ,x 1 ,......,x n-S ], where x t =[X t ,X t+1 ,......,X t+(S-1) ]; The model expects the output y to be: y=[y 0 ,y 1 ,......,y n-S ], where y t =[Y t ,Y t+1 ,......,Y t+(S-1) ]; S33: Use the canal network hydrodynamic model to traverse and calculate the calibration data set to obtain the model calculation output y`: y`=[y 0 `,y 1 `,......,y n-S `], where y t `=[Y t `,Y t+1 `,......,Y t+(S-1) `] S34: comparing the difference between the expected output y of the model and the calculated output y' of the model, and correcting the parameters of the canal network hydrodynamic model according to the difference so that the difference is less than a set threshold; S35: generating meteorological characteristic data, crop information data, gate dispatching scheme and soil moisture data before dispatching, and using them as inputs of the canal network hydrodynamic model to calculate soil moisture data after dispatching; S36: Based on the meteorological characteristic data, crop information data, gate scheduling plan, soil moisture data before scheduling, and soil moisture data after scheduling generated in S35, S31 and S32 are repeatedly executed to form a simulation data set.

6. The method according to claim 1, It is characterized in that Constructing a Transformer model and using the simulation data set to train the Transformer model includes: S41: performing data preprocessing on the simulation data set; S42: building a Transformer model, randomly initializing the weights of each layer, and sending the simulation data set to the Transformer model for training; S43: During the training process, a back propagation algorithm is used to update the parameters of each layer in the Transformer model.

7. The method according to claim 1, It is characterized in that Use the trained Transformer model and particle swarm algorithm, combined with the optimization objectives, to find the optimal gate scheduling solution, including: S51: Configuration optimization objectives: minimum canal system water loss, minimum main canal flow fluctuation, shortest irrigation time and meeting soil moisture requirements; S52: The trained Transformer model is responsible for calculating the soil moisture data after scheduling when the meteorological characteristic data, crop information data and soil moisture data before scheduling remain unchanged and different gate scheduling schemes are applied; S53: The particle swarm algorithm is responsible for finding the optimal gate scheduling scheme to meet the optimization goal and obtain the optimal gate scheduling scheme for irrigation in the irrigation area.

8. An irrigation canal network water supply and distribution optimization control device, It is characterized in that include: The data acquisition module is used to collect irrigation data of the irrigation area recorded in historical texts and irrigation data of the irrigation area collected by sensors after the informatization construction. The irrigation data of the irrigation area includes meteorological characteristic data, crop data, soil moisture data of different soil layers in each irrigation area, and gate scheduling plans for corresponding time periods; Model building module, used to build canal network hydrodynamic model; A calibration and data generation module, used to calibrate the canal network hydrodynamic model using the irrigation data of the irrigation area, and generate a simulation data set using the calibrated canal network hydrodynamic model; A model building and training module, used to build a Transformer model and train the Transformer model using the simulation data set; The optimization module is used to use the trained Transformer model and particle swarm algorithm to find the optimal gate scheduling solution in combination with the optimization goal; The negative feedback module is used to obtain the actual irrigation data of the irrigation area to which the optimal gate scheduling scheme is applied, and to use the actual irrigation data of the irrigation area as negative feedback to retrain the Transformer model trained by the model construction and training modules.

9. An electronic device, It is characterized in that include: one or more processors; A memory for storing one or more programs; When the one or more programs are executed by the one or more processors, the one or more processors implement the method according to any one of claims 1 to 7.

10. A computer-readable storage medium having computer instructions stored thereon, It is characterized in that When the instruction is executed by a processor, the steps of the method according to any one of claims 1 to 7 are implemented.

Citation Information

Patent Citations

  • Soil moisture content prediction and irrigation decision-making method and device

    CN109978234A

  • Method for dispatching flood gate of transformer substation

    CN110565594A

  • Irrigation area whole canal system management and control system based on hydrodynamic model

    CN115146566A

  • Combined dispatching method and system for water transportation and distribution gate group in irrigation area

    CN115169803A

  • Optimized regulation and control method for water transportation and distribution of irrigation district canal network based on hydrodynamic simulation

    CN116415526A

Cited By

  • Automatic water resource optimization scheduling management method based on irrigation area demonstration area

    CN119417203A

  • Irrigation area measurement and control integrated gate intelligent control system and method thereof

    CN119861590A