An intelligent water conservancy algorithm development system and method based on artificial intelligence
By constructing a cross-reservoir federated learning network, combining spatiotemporal convolutional networks and differential privacy protection algorithms, and dynamically adjusting gradient masks and multi-objective optimization weights, the problem of low gradient aggregation efficiency in cross-reservoir federated learning is solved, and efficient collaborative scheduling of reservoir groups and safe and economical scheduling decisions are achieved.
Patent Information
- Application Number
- CN202510705776.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-05-29
- Publication Date
- 2025-10-21
- Estimated Expiration
- 2045-05-29
AI Technical Summary
In the existing smart water conservancy system, cross-reservoir federated learning ignores the spatiotemporal correlation of flood events, resulting in low gradient aggregation efficiency, and the multi-objective optimization weights are fixed and cannot be dynamically adjusted, causing delayed response of the reservoir group or unbalanced resource allocation.
A cross-reservoir federated learning network is constructed. Flood events are identified through a spatiotemporal convolutional network to generate dynamic gradient masks. Local model parameters are sparsified and a federated aggregation algorithm with differential privacy protection is used to perform weighted fusion of the sparsified gradients. Multi-objective optimization weights are generated by combining the Pareto hypernetwork. This drives the NSGA-II algorithm to solve the Pareto optimal solution set under the hydraulic coupling constraints of the reservoir group and generate a dynamic scheduling strategy.
It improves the accuracy and generalization performance of flood prediction, enhances the response capability to sudden flood events, and realizes the safety and economy of coordinated scheduling of reservoir groups.
Smart Images

Figure CN120471486B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of smart water conservancy technology, and in particular to a smart water conservancy algorithm development system and method based on artificial intelligence. Background Art
[0002] Currently, smart water conservancy systems are gradually achieving coordinated scheduling of reservoir clusters by integrating the Internet of Things, federated learning, and spatiotemporal prediction models. Existing flood prediction methods based on centralized deep learning, while capable of processing time-series hydrological data, suffer from data silos, and their generalizability is limited by the data size of a single reservoir. Traditional federated learning frameworks, when training across reservoirs, ignore the spatiotemporal correlations of flood events, resulting in inefficient gradient aggregation and an inability to dynamically balance multi-objective optimization objectives: safety, economy, and ecology.
[0003] Specifically, the static gradient aggregation strategy in federated learning does not take into account the spatial heterogeneity (such as the local nature of heavy rain) and temporal suddenness (such as red alerts) of hydrological events, resulting in insufficient model learning of sensitive parameters of flood events; at the same time, the multi-objective optimization weights are fixed, and the scheduling strategy priority cannot be dynamically adjusted according to real-time meteorological warnings, resulting in delayed response of the reservoir group or unbalanced resource allocation. Summary of the Invention
[0004] In view of the above existing problems, the present invention is proposed.
[0005] Therefore, the present invention provides an artificial intelligence-based smart water conservancy algorithm development method to solve the problems of low gradient aggregation efficiency and multi-objective dynamic optimization lag caused by the lack of spatiotemporal correlation in cross-reservoir federated learning.
[0006] In order to solve the above technical problems, the present invention provides the following technical solutions:
[0007] In the first aspect, the present invention provides a method for developing a smart water conservancy algorithm based on artificial intelligence, which includes building a cross-reservoir federated learning network, initializing the local model parameters of each node and establishing a communication connection between the edge layer and the cloud, and receiving hydrological sensor data and meteorological warning information in real time; identifying flood events through a spatiotemporal convolutional network, generating a dynamic gradient mask to sparsely process the local model parameters, and retaining gradient parameters with event correlation higher than the dynamic gradient mask threshold; using a federated aggregation algorithm with differential privacy protection to weightedly fuse the sparse gradients, generate global model parameters and input them into a Pareto supernetwork, and generate multi-objective optimization weights based on a preset policy vector; driving the NSGA-II algorithm to solve the Pareto optimal solution set under the hydraulic coupling constraints of the reservoir group, verifying the comprehensive benefits of each solution set through digital twin simulation, and screening the non-dominated solution with the highest comprehensive score; converting the non-dominated solution into a dynamic scheduling strategy to generate real-time operation instructions for flood discharge, generator control and irrigation water distribution.
[0008] As a preferred solution of the artificial intelligence-based smart water conservancy algorithm development method described in the present invention, the construction of a cross-reservoir federated learning network includes configuring dual communication links for each reservoir edge node, implementing node authentication based on X.509 certificates, and distributing the spatiotemporal convolutional network benchmark model through an encryption protocol.
[0009] As a preferred solution of the method for developing an intelligent water conservancy algorithm based on artificial intelligence described in the present invention, the specific steps of identifying flood events through a spatiotemporal convolutional network and generating a dynamic gradient mask include constructing a spatiotemporal data cube of hydrological sensor data and meteorological data, dividing the watershed grid and generating a spatial constraint mask;
[0010] The hydrological sensor data includes water level and flow data;
[0011] Load the spatiotemporal convolutional network to standardize the water level and flow data, and calculate the importance score of the trainable weight parameters of each layer of the spatiotemporal convolutional network through the spatiotemporal attention weight;
[0012] The gradient mask threshold is dynamically calculated based on the probability of flood events, and a binary mask matrix is generated to perform gradient sparsification.
[0013] As a preferred solution of the artificial intelligence-based smart water conservancy algorithm development method described in the present invention, the communication connection between the edge node and the cloud refers to the use of the MQTT protocol to achieve heartbeat monitoring and data compression transmission.
[0014] As a preferred solution of the method for developing an intelligent water conservancy algorithm based on artificial intelligence described in the present invention, the federated aggregation algorithm for differential privacy protection includes:
[0015] Noise is injected into the gradient according to the mask sparsity rate, and the sparse gradients are weighted averaged and fused according to the ratio of the local dataset size of each edge node to the global dataset size.
[0016] The global model parameters after weighted average fusion are input into the Pareto hypernetwork, and the multi-objective optimization weights are dynamically generated in combination with the policy vector. The forced correction of water level exceeding the standard and the attenuation control of meteorological warning are also applied.
[0017] The global model parameters are obtained by updating the fused gradients to the spatiotemporal convolutional network baseline model.
[0018] As an optimal solution of the artificial intelligence-based smart water conservancy algorithm development method described in the present invention, the driving NSGA-II algorithm to solve the Pareto optimal solution set under the hydraulic coupling constraints of the reservoir group includes defining decision variables and encoding them, and verifying the solution set benefits through digital twin simulation.
[0019] As a preferred solution of the artificial intelligence-based smart water conservancy algorithm development method described in the present invention, the dynamic scheduling strategy includes flood discharge gradient instructions, unit control instructions and water distribution ratio signals, and an execution deviation recalculation mechanism is set.
[0020] In the second aspect, the present invention provides an artificial intelligence-based smart water conservancy algorithm development system, including a network construction module, an event recognition module, a parameter aggregation module, an optimization solution module and an instruction generation module; the network construction module is used to build a federated learning network across reservoirs, initialize the local model parameters of each node and establish a communication connection between the edge layer and the cloud, and receive hydrological sensor data and meteorological warning information in real time; the event recognition module is used to identify flood events through a spatiotemporal convolutional network, generate a dynamic gradient mask to perform sparse processing on the local model parameters, and retain events with a correlation degree higher than the dynamic gradient mask threshold. Gradient parameters; the parameter aggregation module is used to perform weighted fusion on the sparse gradients using a federated aggregation algorithm with differential privacy protection, generate global model parameters and input them into the Pareto hypernetwork, and generate multi-objective optimization weights based on the preset policy vector; the optimization solution module is used to drive the NSGA-II algorithm to solve the Pareto optimal solution set under the hydraulic coupling constraints of the reservoir group, verify the comprehensive benefits of each solution set through digital twin simulation, and screen the non-dominated solution with the highest comprehensive score; the instruction generation module is used to convert the non-dominated solution into a dynamic scheduling strategy and generate real-time operation instructions for flood discharge, generator set control and irrigation water distribution.
[0021] In a third aspect, the present invention provides a computer device comprising a memory and a processor, wherein the memory stores a computer program, wherein: when the computer program is executed by the processor, any step of the method for developing an intelligent water conservancy algorithm based on artificial intelligence as described in the first aspect of the present invention is implemented.
[0022] In a fourth aspect, the present invention provides a computer-readable storage medium having a computer program stored thereon, wherein: when the computer program is executed by a processor, it implements any step of the method for developing an intelligent water conservancy algorithm based on artificial intelligence as described in the first aspect of the present invention.
[0023] The beneficial effects of the present invention are as follows: By combining federated learning with a spatiotemporal attention mechanism, the present invention more accurately identifies the spatiotemporal correlation characteristics of cross-basin hydrological data, thereby improving the accuracy of flood forecasting. In addition, by constructing a dynamic gradient masking mechanism, the parameter aggregation weights are dynamically adjusted according to the probability of flood events, from which the characteristic parameters with the most predictive value are screened, thereby enhancing the response capability to sudden flood events and improving generalization performance. Finally, by introducing a dynamic multi-objective optimization strategy based on hydrological physics laws into the federated learning framework, basin scheduling experience knowledge is combined with intelligent algorithms to enhance the physical rationality and explainability of scheduling decisions, making the reservoir group collaborative scheduling scheme both safe and economical. BRIEF DESCRIPTION OF THE DRAWINGS
[0024] In order to more clearly illustrate the technical solutions of the embodiments of the present invention, the following briefly introduces the drawings required for use in the description of the embodiments. 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 any creative work.
[0025] Figure 1 Flowchart of the method for developing AI-based smart water conservancy algorithms.
[0026] Figure 2 This is a flow chart of data preprocessing in Example 1.
[0027] Figure 3 This is a flowchart of model training and optimization in Example 1.
[0028] Figure 4 This is a flow chart of dynamic deployment and feedback optimization in Example 1. DETAILED DESCRIPTION
[0029] In order to make the above-mentioned objects, features and advantages of the present invention more obvious and easy to understand, the specific embodiments of the present invention are described in detail below with reference to the accompanying drawings.
[0030] In the following description, many specific details are set forth to facilitate a full understanding of the present invention. However, the present invention may also be implemented in other ways different from those described herein. Those skilled in the art may make similar generalizations without violating the connotation of the present invention. Therefore, the present invention is not limited to the specific embodiments disclosed below.
[0031] Secondly, the term "one embodiment" or "embodiment" herein refers to a specific feature, structure, or characteristic that may be included in at least one implementation of the present invention. The phrase "in one embodiment" appearing in various places throughout this specification does not necessarily refer to the same embodiment, nor does it refer to a separate or selective embodiment that is mutually exclusive of other embodiments.
[0032] Example 1, reference Figures 1 to 4 This embodiment provides a method for developing a smart water conservancy algorithm based on artificial intelligence, comprising the following steps:
[0033] S1: Build a federated learning network across reservoirs, initialize the local model parameters of each node, and establish a communication connection between the edge layer and the cloud to receive hydrological sensor data and meteorological warning information in real time.
[0034] Specifically, the following steps are included:
[0035] S1.1: Configure an edge server with GPU acceleration in each reservoir control center and generate a unique identifier for each edge server based on an X.509 certificate.
[0036] Among them, the X.509 certificate contains the reservoir number, reservoir geographical coordinates and network access rights.
[0037] A star topology is adopted, with the provincial cloud serving as the central node and each reservoir edge node accessed via dual communication links.
[0038] Among them, the main link uses APN dedicated line, and the backup link enables VPN tunnel.
[0039] For example: Edge server hardware configuration: Intel Xeon Silver 4210R processor, NVIDIA T4 graphics card, 32GB memory; Certificate field requirements: include reservoir number (such as RES_2153), latitude and longitude coordinates, and IP address whitelist.
[0040] S1.2: Download the pre-trained spatiotemporal convolutional network baseline model from the cloud.
[0041] Among them, the spatiotemporal convolutional network benchmark model contains 3 layers of ConvLSTM and 2 layers of spatiotemporal attention layers. The file format of the spatiotemporal convolutional network benchmark model is SavedModel.
[0042] The spatiotemporal convolutional network benchmark parameters are distributed to each edge node through the HTTPS protocol and transmitted using AES-256 encryption.
[0043] After receiving the data, the edge node calculates the SHA-256 checksum and compares it with the checksum published by the cloud. If it fails, it will automatically retry three times.
[0044] S1.3: Configure the MQTT protocol on the edge node.
[0045] Specifically, during the MQTT protocol configuration process, an X.509 client certificate file containing the reservoir number and IP whitelist is generated, the APN / VPN link information is written to the MQTT client configuration to establish a cloud connection, a 5-second heartbeat monitoring interval is set and the Zstandard compression algorithm is activated to achieve real-time data compression. The heartbeat monitoring results trigger the dual-link switching mechanism to execute backup channel switching, and a red warning message priority processing strategy is configured based on a 200-millisecond delay to complete the construction of a communication link for identity authentication, link management, and business priority control.
[0046] Among them, a heartbeat packet is sent every 5 seconds, and three consecutive timeouts trigger link switching. The Zstandard algorithm is used to compress the transmitted data in real time.
[0047] S1.4: Read hydrological sensor data via Modbus TCP, poll the water level and flow registers once per second, and filter outliers.
[0048] The register addresses for water level are 40001-40002 (IEEE 754 floating point); the register addresses for flow are 40005-40006 (unsigned integer).
[0049] It should be noted that the water level data corresponds to the reading value of the "water level register", and the flow data corresponds to the reading value of the "flow register";
[0050] Connect to the meteorological data service interface, receive real-time push of heavy rain red / orange warning messages, parse XML format data and extract the warning area code, expected rainfall and effective period fields.
[0051] Specifically, the warning area code (using GB / T 2260 administrative division code); expected rainfall (mm / hour); and effective period (UTC time).
[0052] Furthermore, the validity period (UTC time) includes the flow domain mapping and priority tag.
[0053] Watershed mapping involves matching warning areas to a list of affected reservoir numbers through GIS spatial analysis.
[0054] Priority marking means that red alert messages will be queued for processing with a delay of no more than 200 milliseconds.
[0055] S2: Identify flood events through spatiotemporal convolutional networks, generate dynamic gradient masks to perform sparse processing on local model parameters, and retain gradient parameters whose event correlation is higher than the dynamic gradient mask threshold.
[0056] Specifically, the following steps are included:
[0057] S2.1: Align hydrological sensor data with meteorological warning information according to time windows and construct a spatiotemporal data cube.
[0058] Among them, the spatiotemporal data cube includes time dimension, space dimension and channel dimension.
[0059] Specifically, the time dimension is 60 minutes of continuous data with a sliding step of 5 minutes (corresponding to S1.4 polling data every second). The spatial dimension is the watershed grid covered by each reservoir (1km×1km resolution). The channel dimension is the water level (m), flow (m 3 / s), rainfall (mm / h) and warning level (0-3).
[0060] For example, the data cube dimensions are 12 (time steps) × 50 × 50 (spatial grids) × 4 (channels).
[0061] Based on the geographic coordinates of the reservoirs, the watershed grids under the jurisdiction of each reservoir are divided through the Voronoi diagram to generate a binary spatial mask matrix.
[0062] Standardize the hydrological data in the spatiotemporal data cube.
[0063] Specifically, the water level is z-score standardized, and the mean value comes from the historical water level benchmark value (Modbus TCP register historical data); the flow rate is min-max normalized to [0,1], and the maximum value is the designed maximum flood discharge of the reservoir.
[0064] S2.2: Load the spatiotemporal convolutional network baseline model (containing 3 ConvLSTM layers and 2 spatiotemporal attention layers).
[0065] Specifically, ConvLSTM layer 1: convolution kernel 3×3, output channels 32, time step 1.
[0066] Spatiotemporal Attention Layer 1: Calculate the spatial attention weight matrix A s and the temporal attention weight vector A t .
[0067] Spatial attention weight matrix A s , expressed as:
[0068]
[0069] Where W c shows the learnable convolution kernel weight matrix in the spatiotemporal convolutional network benchmark model, which is used to extract spatial features from X, where X represents the normalized spatiotemporal data cube, ReLU represents the rectified linear unit activation function, Represents the transpose operation of the spatial dimension weight matrix, T is the transpose operation symbol, s represents the spatial dimension, and c represents the convolution kernel weight matrix for spatial feature extraction;
[0070] Temporal attention weight vector A t , expressed as:
[0071]
[0072] Where AvgPool(X) is the global average pooling operation, which means compressing the spatial dimension of input X. Represents the transpose operation of the time dimension weight matrix, t is the time dimension;
[0073] The output of the spatiotemporal attention layer is concatenated with the original input data in the channel dimension and input into the ConvLSTM layer 2 (convolution kernel 5×5, output channels 64);
[0074] Output flood event probability P∈[0,1], calculated as:
[0075] P=σ(W f (ConvLSTM layer 3 output) + b f );
[0076] Where W f represents the weight matrix of the fully connected layer f, b f Represents the bias term of the fully connected layer f, the dimension is scalar, and σ represents the Softmax function;
[0077] S2.3: Parameters w of operators at each level in the spatiotemporal convolutional network benchmark model i , calculate the product of its gradient absolute value and the corresponding spatiotemporal attention weight, expressed as:
[0078]
[0079] Where, Represents the loss function L (binary cross entropy) on the parameter w i The gradient of S i represents w i The importance score of represents w i The mean of the spatial attention weights of the layer, the dimension is scalar, represents w i The mean of the time attention weight of the layer, the dimension is scalar, i represents the index identifier of the operator parameter at each level;
[0080] Calculate the dynamic gradient mask threshold τ according to the current flood event probability P:
[0081] τ=α·Quantile(S,0.9)+β·P flood ;
[0082] Where Quantile(S,0.9) represents the 90% quantile of the importance score S of all operator parameters at each level in the current batch, which is used to capture the high quantile distribution characteristics of the importance score of operator parameters at each level. α represents the quantile weight coefficient, which is 0.7. β represents the flood probability weight coefficient, which is 0.3.
[0083] According to the adjusted dynamic gradient mask threshold τ, a binary mask matrix is generated and the gradient is sparsified. The expression is:
[0084] g′i=g i ×M i ;
[0085]
[0086] Where g′ i represents the gradient after sparsification g i Represents the original gradient Its dimension is the same as w i Consistent, M i represents a binary mask, is the indicator function;
[0087] For example, when P = 0, assuming that the current batch Quantile(S, 0.9) = 1.2, then:
[0088] τ=0.7×1.2+0.3×0.8=1.08,retain S i Gradient ≥1.08.
[0089] S2.4: Statistical mask sparsity rate R, expressed as:
[0090]
[0091] Where N total Represents the total number of operator parameters at each level in the spatiotemporal convolutional network, ∑M i Represents the total number of non-zero elements in the mask matrix, corresponding to the number of retained gradient terms;
[0092] Verify the performance of the model after sparsification.
[0093] Specifically, the local model is updated using sparse gradients, and the accuracy drop ΔAcc is calculated in the validation set (historical data from non-flood periods). If ΔAcc is greater than 5%, the β value is automatically reduced to 0.2 and the mask is regenerated.
[0094] Record event associated parameters: Mark Mi = 1 parameter index, used for noise scaling during differential privacy aggregation.
[0095] S3: A federated aggregation algorithm with differential privacy protection is used to perform weighted fusion on the sparsified gradients to generate global model parameters and input them into the Pareto hypernetwork to generate multi-objective optimization weights based on the preset policy vector.
[0096] Specifically, the following steps are included:
[0097] S3.1: Based on the recorded mask sparsity rate and event correlation parameter index, noise injection is performed on the sparsified gradients of each round of federated aggregation.
[0098] Specifically, truncated Gaussian noise is used, and the noise distribution range is aligned with the statistical distribution of the dynamic gradient mask threshold τ;
[0099] Dynamically adjust the noise intensity based on the red warning message priority configured in the MQTT protocol.
[0100] For example, when the watershed GIS mapping detected that the red alert covered more than 30% of the reservoir nodes, the noise standard deviation was reduced to 50% of the baseline value.
[0101] The privacy budget ε of each round of federated aggregation is allocated in proportion to the inverse square root of the number of reservoir nodes. When the privacy budget is exhausted, the federated learning training is terminated and the scheduling strategy is frozen.
[0102] For example, when R = 32% and the current privacy budget ε = 0.8, the noise standard σ = 1.2 * (1-R) / sqrt(ε).
[0103] S3.2: Based on the reservoir number identified by the X.509 certificate, count the size of the local dataset of each node.
[0104] Specifically, the sparsified gradients are matched layer by layer with the parameter structure of the spatiotemporal convolutional network benchmark model, and the missing parameter positions are filled with zero values;
[0105] It should be noted that the X.509 certificate is a digital identity certificate issued by an authoritative CA (certificate authority), which contains the unique identifier of the reservoir node (such as reservoir number, geographic coordinates), public key information and APN / VPN network access rights, and is used to achieve two-way authentication and communication link encryption of edge nodes (such as the dual communication link secure access described in Example S1.1).
[0106] The gradients are weighted according to the ratio of the local dataset size to the global dataset size. The offline node weights are automatically set to zero. Noise is superimposed on the weighted gradients, and the noise is only injected into the position corresponding to the event-related parameter index.
[0107] For example, if nk of reservoir node RES-2153 is 1200 and the total data volume Σn_k is 8500, then its weight is 1200 / 8500≈0.141; where nk represents the local dataset size of the k-th reservoir node (such as RES_2153), and k represents the unique identification index of the reservoir node.
[0108] S3.3: Input the output global model parameters into the Pareto hypernetwork corresponding to the pre-trained spatiotemporal convolutional network benchmark model.
[0109] Specifically, the output feature vector of ConvLSTM layer 3 in the spatiotemporal convolutional network benchmark model is extracted and concatenated with the flood event probability P to form a mixed input vector;
[0110] The preset policy vectors are grouped and coded according to the GB / T 2260 administrative division codes parsed from the meteorological warning information to generate a policy vector matrix with unified dimensions.
[0111] It should be noted that the generation of the preset policy vector first loads the regional basic policy template (including initial coefficients of safety, economy, ecology, etc.) based on the administrative division code. Then, the weight of the corresponding dimension is automatically increased according to the real-time meteorological warning level (such as red / orange warning), and the safety factor is further dynamically adjusted in combination with regional historical disaster data. After that, the latest flood control scheduling strategy is used to specifically optimize the ecological or economic coefficient. The normalization process is used to ensure that the sum of the weights of each dimension is 1. Finally, the preset policy vector (such as [0.7, 0.4, 0.3]) that meets the current regional flood control needs is output. This preset policy vector is directly used as the input of the Pareto hypernetwork to participate in the calculation of the multi-objective optimization weights.
[0112] It should be noted that the Pareto hypernetwork consists of a two-layer fully connected structure. The first layer uses the tanh activation function to implement nonlinear transformation of the policy vector, and the second layer uses the softmax function to output multi-objective optimization weights. The constraint that the sum of the weights is 1 is automatically satisfied by the softmax function.
[0113] For example: if the input policy vector is [safety factor 0.7, economic coefficient 0.4, ecological coefficient 0.3], the output weights may be [0.55, 0.25, 0.20].
[0114] S3.4: Post-process the Pareto hypernetwork output weights based on the real-time status of the constructed spatiotemporal data cube.
[0115] Specifically, if the normalized water level exceeds the 3σ range of the historical benchmark value, the safety dimension weight is forcibly increased to the minimum value of 0.5;
[0116] Apply exponential decay to the coefficients of each dimension of the policy vector, and the decay rate is inversely proportional to the remaining duration of the effective period of the meteorological warning;
[0117] For example: When the remaining effective period of the red rainstorm warning is 2 hours, the safety dimension attenuation rate is reduced to 30% of the baseline value.
[0118] S3.5: Before distributing the global model parameters to each reservoir node, perform gradient norm detection and weight validity verification.
[0119] For gradient norm detection: the global gradient L2 norm must be within the range of the sparse gradient norm distribution. Anything outside the range is considered an abnormal result.
[0120] For weight validity verification: check whether the output weight of the Pareto hypernetwork meets the dynamic correction constraint conditions. If not, fall back to the valid weight of the previous round;
[0121] Metadata is appended to the global model parameter version, including the weather warning message ID, mask sparsity rate R, and privacy budget ε consumption.
[0122] S4: Drive the NSGA-II algorithm to solve the Pareto optimal solution set under the hydraulic coupling constraints of the reservoir group, verify the comprehensive benefits of each solution set through digital twin simulation, and select the non-dominated solution with the highest comprehensive score.
[0123] Specifically, the following steps are included:
[0124] S4.1: Based on the multi-objective optimization weights output by the Pareto hypernetwork, define the three-objective function and hydraulic coupling constraints for the coordinated operation of the reservoir group.
[0125] The three-objective function of reservoir group coordinated scheduling includes flood risk target, power generation loss target and agricultural water shortage target.
[0126] Specifically, the predicted downstream inundation area is used as a quantitative indicator, and the probability of flood events is weighted and calculated using the output of a spatiotemporal convolutional network benchmark model. Turbine efficiency is calculated using the percentage of total power generation deviation from rated value, combined with real-time flow data. The water supply gap of the irrigation canal system is used as an indicator, and is extrapolated based on historical flow baseline values in the spatiotemporal data cube.
[0127] Hydraulic coupling constraints include reservoir capacity balance constraints, flood discharge constraints and power generation constraints.
[0128] Specifically, the change in storage capacity between adjacent periods of time at each reservoir must satisfy the difference between the real-time inflow and outflow. The total daily flood discharge must not exceed the upper limit of the reservoir's maximum flood discharge. The unit output must be within the safe operating range supported by the edge server hardware.
[0129] S4.2: Define the decision variable encoding and population generation rules, and initialize the NSGA-II population.
[0130] Specifically, the floodgate opening of each reservoir is encoded as a binary integer, with a step size that meets the computing power limitations of the edge server hardware. The output of each unit is encoded with floating-point precision, matching the computing power supported by the NVIDIA T4 graphics card. The water distribution ratio between the main and branch canals is encoded as a fixed-point decimal, with the number of bits aligned with the Modbus TCP register width.
[0131] Furthermore, some individuals in the initial population are sampled from the characteristics of the historical optimal solution, and the remaining individuals are randomly generated within the constraint boundary and are forced to meet the storage capacity balance constraint.
[0132] For example, the initial value of the flood discharge gate opening of reservoir RES_2153 is sampled from the most recent operation record, and the power generation is generated based on the historical average.
[0133] S4.3: Calculate the objective function value of each individual, generate a temporary fitness value according to the corrected multi-objective weights, and perform fast non-dominated sorting to divide the Pareto front level;
[0134] Calculate the crowding distance of individuals in the target space and prioritize individuals in sparsely distributed areas to maintain population diversity;
[0135] For individuals that violate the flood discharge capacity constraint, the flood gate opening is forced to be corrected to determine the preset proportion of the maximum flood discharge capacity.
[0136] For example, the flood discharge volume is monitored in real time through an online hydrodynamic model. When the real-time monitored flood discharge volume approaches the preset engineering safety control boundary of the reservoir, the safe flood discharge ratio is automatically calculated based on the current operating conditions, the gate opening is limited to the allowable range of the maximum flood discharge capacity, and a gradual adjustment instruction is issued through the Modbus TCP protocol.
[0137] S4.4: Input the solution set into a 1D hydrodynamic simulation model to simulate the evolution of basin floods in the future period and extract the peak arrival time and maximum inundation depth.
[0138] Specifically, total power generation is calculated based on flood discharge and power generation, and economic benefits are converted using real-time electricity price data. Based on irrigation water allocation ratios and flow data, crop water shortages are calculated and converted into yield reduction ratios.
[0139] The normalized target values are weighted and summed according to the Pareto supernetwork weights to screen the non-dominated solutions with the best historical solution quantile and the highest Pareto front rank.
[0140] For example, the normalized values of flood risk, power generation loss, and agricultural water shortage for a certain solution set are 0.1, 0.3, and 0.2, respectively, and the weighted score may reach 0.85.
[0141] S5. Convert the non-dominated solution into a dynamic scheduling strategy to generate real-time operation instructions for flood discharge, generator control, and irrigation water distribution.
[0142] Specifically, the following steps are included:
[0143] The floodgate opening value is converted into a Modbus TCP protocol instruction and written into the register address of the reservoir PLC controller. If the opening changes by more than a preset range, a gradual transition instruction is inserted to avoid the water hammer effect.
[0144] For example, when the flood discharge gate is adjusted from 30% to 45%, multiple instructions with gradual step changes are generated and sent at intervals.
[0145] Publish set point instructions in JSON format to the turbine speed governor via the MQTT protocol to verify whether the set value is within the unit's safe operating range.
[0146] For example: a command contains fields for device name, target power, and deadline.
[0147] The water diversion ratio is converted into gate opening and written into the controller register via Modbus TCP. When the ratio change exceeds the critical judgment value of the water diversion ratio change, the spatiotemporal data cube is updated.
[0148] Detect water usage conflicts between flood discharge and power generation instructions, and forcibly reduce power generation according to safety weights.
[0149] The execution sequence of instructions is arranged according to the effective period of the meteorological warning. Red warning instructions are issued first and a timestamp is added to each instruction.
[0150] The MQTT protocol is used to collect PLC controller status feedback, including actual floodgate opening and generator output.
[0151] The dynamic deviation between the actual execution parameters and the predicted values is monitored in real time. When the deviation exceeds the adaptive error tolerance range, the gradient mask recalculation and federated aggregation are triggered immediately.
[0152] It should be noted that the "parameters" in the execution parameters specifically refer to the following two types of core data: scheduling instruction parameters: including the actual opening of the flood discharge gate (value written to the Modbus TCP register), the real-time output of the generator set (turbine speed governor set point instruction), the irrigation water distribution ratio (gate control signal), and other physical operation instructions executed by the PLC controller; model update parameters: the actual gradient update value of the operator parameters at each level in the federated learning global model (ConvLSTM convolution kernel weights, spatiotemporal attention projection matrix, and fully connected layer parameters).
[0153] For example: When the actual opening of the flood discharge gate deviates from the set value by more than 15%, it is judged as a major deviation.
[0154] This embodiment also provides an artificial intelligence-based smart water conservancy algorithm development system, including: a network construction module, an event recognition module, a parameter aggregation module, an optimization solution module, and an instruction generation module; the network construction module is used to build a federated learning network across reservoirs, initialize the local model parameters of each node, establish a communication connection between the edge layer and the cloud, and receive hydrological sensor data and meteorological warning information in real time; the event recognition module is used to identify flood events through a spatiotemporal convolutional network, generate a dynamic gradient mask to perform sparse processing on the local model parameters, and retain gradients with event correlations higher than the dynamic gradient mask threshold. degree parameter; a parameter aggregation module, which uses a federated aggregation algorithm with differential privacy protection to perform weighted fusion on the sparse gradients, generate global model parameters and input them into the Pareto hypernetwork, and generate multi-objective optimization weights based on the preset policy vector; an optimization solution module, which drives the NSGA-II algorithm to solve the Pareto optimal solution set under the hydraulic coupling constraints of the reservoir group, verifies the comprehensive benefits of each solution set through digital twin simulation, and selects the non-dominated solution with the highest comprehensive score; an instruction generation module, which converts the non-dominated solution into a dynamic scheduling strategy and generates real-time operation instructions for flood discharge, generator control, and irrigation water distribution.
[0155] This embodiment also provides a computer device, which is suitable for the case of a smart water conservancy algorithm development method based on artificial intelligence, including: a memory and a processor; the memory is used to store computer-executable instructions, and the processor is used to execute computer-executable instructions to implement the smart water conservancy algorithm development method based on artificial intelligence proposed in the above embodiment.
[0156] The computer device may be a terminal, comprising a processor, a memory, a communication interface, a display screen and an input device connected via a system bus. The processor of the computer device is used to provide computing and control capabilities. The memory of the computer device comprises a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system and a computer program. The internal memory provides an environment for the operation of the operating system and the computer program in the non-volatile storage medium. The communication interface of the computer device is used to communicate with an external terminal in a wired or wireless manner, and the wireless manner may be achieved through WIFI, an operator network, NFC (near field communication) or other technologies. The display screen of the computer device may be a liquid crystal display or an electronic ink display screen, and the input device of the computer device may be a touch layer covering the display screen, or a button, trackball or touchpad provided on the housing of the computer device, or an external keyboard, touchpad or mouse, etc.
[0157] This embodiment also provides a storage medium having a computer program stored thereon, which, when executed by a processor, implements the method for developing a smart water conservancy algorithm based on artificial intelligence proposed in the above embodiment; the storage medium can be implemented by any type of volatile or non-volatile storage device or a combination thereof, such as static random access memory (SRAM), electrically erasable programmable read-only memory (EEPROM), erasable programmable read-only memory (EPROM), programmable read-only memory (PROM), read-only memory (ROM), magnetic memory, flash memory, disk or optical disk.
[0158] In summary, the present invention combines federated learning with a spatiotemporal attention mechanism to more accurately identify the spatiotemporal correlation characteristics of cross-basin hydrological data, thereby improving the accuracy of flood forecasting. In addition, by constructing a dynamic gradient masking mechanism, the parameter aggregation weights are dynamically adjusted according to the probability of flood events, from which the characteristic parameters with the most predictive value are screened, thereby enhancing the response capability to sudden flood events and improving generalization performance. Finally, by introducing a dynamic multi-objective optimization strategy based on hydrological physics laws into the federated learning framework, basin scheduling experience knowledge is combined with intelligent algorithms to enhance the physical rationality and explainability of scheduling decisions, making the reservoir group collaborative scheduling scheme both safe and economical.
[0159] It should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention and are not intended to limit the present invention. Although the present invention has been described in detail with reference to the preferred embodiments, those skilled in the art should understand that the technical solutions of the present invention may be modified or replaced by equivalents without departing from the spirit and scope of the technical solutions of the present invention, which should all be included in the scope of the claims of the present invention.
Claims
1. A method for developing a smart water conservancy algorithm based on artificial intelligence, characterized by: include, Build a cross-reservoir federated learning network, initialize local model parameters for each node, establish a communication connection between the edge layer and the cloud, and receive hydrological sensor data and meteorological warning information in real time; Flood events are identified through a spatiotemporal convolutional network, and a dynamic gradient mask is generated to perform sparse processing on local model parameters, retaining gradient parameters with event correlation higher than the dynamic gradient mask threshold. The specific steps of identifying flood events and generating dynamic gradient masks by using a spatiotemporal convolutional network include constructing a spatiotemporal data cube of hydrological sensor data and meteorological data, dividing the watershed grid and generating a spatial constraint mask; The hydrological sensor data includes water level and flow data; Load the spatiotemporal convolutional network to standardize the water level and flow data, and calculate the importance score of the trainable weight parameters of each layer of the spatiotemporal convolutional network through the spatiotemporal attention weight; The gradient mask threshold is dynamically calculated based on the probability of flood events, and a binary mask matrix is generated to perform gradient sparsification. A federated aggregation algorithm with differential privacy protection is used to perform weighted fusion of sparse gradients to generate global model parameters and input them into the Pareto hypernetwork. Multi-objective optimization weights are generated based on the preset policy vector. The differential privacy-preserving federated aggregation algorithm includes: Noise is injected into the gradient according to the mask sparsity rate, and the sparse gradients are weighted averaged and fused according to the ratio of the local dataset size of each edge node to the global dataset size. The global model parameters after weighted average fusion are input into the Pareto hypernetwork, and the multi-objective optimization weights are dynamically generated in combination with the policy vector. The forced correction of water level exceeding the standard and the attenuation control of meteorological warning are also applied. The global model parameters are obtained by updating the fused gradients to the spatiotemporal convolutional network benchmark model; Drive the NSGA-II algorithm to solve the Pareto optimal solution set under the hydraulic coupling constraints of the reservoir group, verify the comprehensive benefits of each solution set through digital twin simulation, and select the non-dominated solution with the highest comprehensive score; The non-dominated solution is converted into a dynamic scheduling strategy to generate real-time operation instructions for flood discharge, generator set control and irrigation water distribution.
2. The method for developing an intelligent water conservancy algorithm based on artificial intelligence according to claim 1, wherein: The construction of a cross-reservoir federated learning network includes configuring dual communication links for edge nodes of each reservoir, implementing node authentication based on X.509 certificates, and distributing a spatiotemporal convolutional network benchmark model through an encrypted protocol.
3. The method for developing an intelligent water conservancy algorithm based on artificial intelligence according to claim 2, wherein: The communication connection between the edge node and the cloud refers to the use of the MQTT protocol to achieve heartbeat monitoring and data compression transmission.
4. The method for developing an intelligent water conservancy algorithm based on artificial intelligence according to claim 1, wherein: The method of driving the NSGA-II algorithm to solve the Pareto optimal solution set under the hydraulic coupling constraints of a reservoir group includes defining and encoding decision variables, and verifying the benefits of the solution set through digital twin simulation.
5. The method for developing an intelligent water conservancy algorithm based on artificial intelligence according to claim 1, wherein: The dynamic scheduling strategy includes flood discharge gradient instructions, unit control instructions and water distribution ratio signals, and is set to execute a deviation recalculation mechanism.
6. An artificial intelligence-based smart water conservancy algorithm development system, based on the artificial intelligence-based smart water conservancy algorithm development method according to any one of claims 1 to 5, characterized in that: Including network construction module, event recognition module, parameter aggregation module, optimization solution module and instruction generation module; The network construction module is used to build a federated learning network across reservoirs, initialize local model parameters of each node, establish a communication connection between the edge layer and the cloud, and receive hydrological sensor data and meteorological warning information in real time; The event recognition module is used to identify flood events through a spatiotemporal convolutional network, generate a dynamic gradient mask to perform sparse processing on local model parameters, and retain gradient parameters with event correlation higher than the dynamic gradient mask threshold; The parameter aggregation module is used to perform weighted fusion of sparse gradients using a federated aggregation algorithm with differential privacy protection, generate global model parameters and input them into the Pareto hypernetwork, and generate multi-objective optimization weights based on a preset policy vector; The optimization solution module is used to drive the NSGA-II algorithm to solve the Pareto optimal solution set under the hydraulic coupling constraints of the reservoir group, verify the comprehensive benefits of each solution set through digital twin simulation, and select the non-dominated solution with the highest comprehensive score; The instruction generation module is used to convert the non-dominated solution into a dynamic scheduling strategy to generate real-time operation instructions for flood discharge, generator set control and irrigation water distribution.
7. A computer device comprising a memory and a processor, wherein the memory stores a computer program, wherein: When the processor executes the computer program, the steps of the method for developing an intelligent water conservancy algorithm based on artificial intelligence according to any one of claims 1 to 5 are implemented.
8. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the steps of the method for developing an intelligent water conservancy algorithm based on artificial intelligence according to any one of claims 1 to 5 are implemented.
Citation Information
Patent Citations
Flood forecasting method based on time sequence attention mechanism
CN112785043A
Dam safety early warning and alarm eliminating method and system based on digital twinning
CN114707227A