A step-by-step reservoir multi-objective optimization scheduling method based on GPU parallel acceleration
Patent Information
- Application Number
- CN202611030852.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2026-07-13
- Publication Date
- 2026-09-11
AI Technical Summary
其不足在于:并行粒度较细,将不同水库或时段分配给不同线程,因梯级水库严格的时空耦合约束,导致大量跨线程同步开销,甚至无法保证物理一致性,且细粒度并行会引发GPU线程分支发散,执行效率下降;同时未针对GPU内存合并访问特性优化数据布局,带宽利用率
1、显著提升高维梯级水库多目标优化调度的求解效率。本发明将适应度评价环节整体迁移至GPU执行,采用一个线程独立完成一个完整调度个体全部计算的个体级并行策略,充分利用GPU大规模并行计算能力。在6库720时段、种群规模3000、决策变量维度4320的条件下,相比传统CPU串行NSGA-II实现约43倍的加速比,将原本需要数小时甚至数十小时的优化计算缩短至分钟级,有效解决了大规模种群条件下适应度评价的计算瓶颈问题。
Smart Images

Figure CN122733477A_ABST
Abstract
Description
Technical Field
[0001] This invention patent relates to the field of cascade reservoir optimization scheduling technology, specifically to a multi-objective optimization scheduling method for cascade reservoirs based on GPU parallel acceleration. Background Technology
[0002] Joint optimization scheduling of cascade reservoir groups is a key technical means to achieve efficient utilization of water resources in river basins and ensure regional energy and ecological security. Cascade reservoir groups typically undertake multiple tasks, including flood control, power generation, water supply, ecological protection, and navigation. With the comprehensive completion of large-scale hydropower bases in my country, the upper reaches of the Yangtze River, the Jinsha River, and the Yalong River basins have formed ultra-large-scale cascade reservoir systems with massive reservoir groups and close hydraulic connections. The storage and release processes of upstream reservoirs directly affect the inflow conditions, power generation benefits, and ecological flow satisfaction of downstream reservoirs. In medium- and long-term scheduling, the scheduling cycle is long, involving many reservoirs and a large number of time periods. When the water level or flow of each reservoir at each time period is used as the decision variable, the problem often contains thousands or even tens of thousands of variables. At the same time, there are obvious conflicts between power generation and ecological objectives, making the optimal scheduling of cascade reservoirs essentially a complex optimization problem with high dimensions, multiple constraints, strong coupling, and multiple objectives. Traditional serial computing models can no longer meet the urgent need for solution efficiency.
[0003] A search revealed that the closest existing technology to this invention is Chinese invention patent application CN115545303A, entitled "Multi-objective Scheduling Method for Reservoir Groups Based on Heterogeneous Parallel Multi-objective Differential Evolutionary Algorithm." This scheme employs a CPU-GPU heterogeneous architecture, computing the objective function components of each reservoir at each time period in parallel on the GPU. Its shortcomings include: fine-grained parallelism, assigning different reservoirs or time periods to different threads; due to the strict spatiotemporal coupling constraints of cascaded reservoirs, this leads to significant cross-thread synchronization overhead, potentially compromising physical consistency; and fine-grained parallelism can cause GPU thread branch divergence, reducing execution efficiency. Furthermore, it fails to optimize data layout for GPU memory merging access characteristics, resulting in low bandwidth utilization.
[0004] Furthermore, from a broader perspective of existing technologies, while multi-objective evolutionary algorithms, represented by NSGA-II, are widely used in this field, their CPU-based serial computation method generally suffers from the following shortcomings: First, fitness evaluation is computationally intensive and is the main time bottleneck, requiring computation on a database-by-database and time-period basis for each solution, leading to a sharp increase in computation time as the problem size increases. Second, it is difficult to adapt to the needs of large-scale population optimization; as the population size increases, the solution efficiency decreases significantly. Third, it is difficult to balance solution accuracy and computational efficiency; small populations result in insufficient search, while large populations lead to excessively high computational costs. Fourth, existing research focuses primarily on improving the algorithm itself, lacking targeted parallel acceleration designs for the most time-consuming fitness evaluation stage. In fact, the fitness evaluations of different individuals are independent and naturally suitable for parallel processing, but traditional methods have failed to utilize this characteristic.
[0005] Therefore, there is an urgent need in this field for a multi-objective optimization scheduling method for cascade reservoirs that can fundamentally avoid cross-thread synchronization, maximize GPU memory bandwidth utilization, and achieve efficient collaboration between CPU and GPU. This method would break through the computational efficiency bottleneck of fitness evaluation under high-dimensional decision variables and large-scale population conditions, and provide a practical technical solution for the optimization scheduling of ultra-large-scale cascade reservoir groups.
[0006] Invention Patent Content (a) The problem to be solved by this invention patent This invention aims to solve the technical problems in the existing technology of multi-objective optimization scheduling method for cascade reservoirs based on CPU serial computing. When facing high-dimensional decision variables, large-scale populations, long scheduling cycles, and joint scheduling of multiple reservoirs, the fitness evaluation stage is too time-consuming and the solution efficiency is low. On the other hand, the existing GPU parallel solution suffers from high cross-thread synchronization overhead, low memory bandwidth utilization, and inability to effectively guarantee computational physical consistency due to improper selection of parallel granularity.
[0007] (II) Technical Solution To address the aforementioned technical problems, this invention provides a multi-objective optimization scheduling method for cascade reservoirs based on GPU parallel acceleration, comprising the following steps: Step S1: Construct a multi-objective optimization scheduling model for cascade reservoirs A multi-objective optimization scheduling model for cascade reservoirs is established, with the optimization objectives of maximizing power generation and minimizing ecological impact, and constraints including water balance, discharge flow, water level, power output, and navigation flow. The objective of maximizing power generation is represented by the sum of power generation from each reservoir in the cascade at each time period. in, M Indicates the number of cascade reservoirs. Indicates the reservoir serial number. Indicates the scheduling period. Indicates the time period number. Indicates the first Reservoir No. Average output over a period of time This represents the duration of the time period.
[0008] The target for minimizing ecological alteration is based on the upper and lower limits of downstream ecological flow thresholds, and is quantified in segments according to the degree to which the outflow exceeds the ecologically suitable range: Among them, among them, T Indicates the scheduling period; D t Indicates the first t Ecological change over time, % tThe time period number is represented by the following formula: when Q t >Q tmax hour, D t =|Q tmax -Q t | / (Q t +Q tmax ) ; when Q tmin <= Q t <=Q tmax hour, D t =0 ; when Q t <Q tmin hour, D t =|Q tmin –Q t | / (Q tmin +Q t ) ; Q t For the first t Downstream flow during the period, m 3 / s; Q tmax For the first t Downstream ecological flow limit for the time period, m 3 / s; Q tmin For the first t Lower limit of downstream ecological flow during the period, m 3 / s.
[0009] The constraints include: water balance constraints, discharge flow constraints, water level constraints, power output constraints, and navigation flow constraints.
[0010] Step S2: Construct the scheduling population and design a GPU-friendly data storage structure A real-number encoding method is adopted, with the operating water level of each reservoir at each time period as the decision variable. A complete scheduling scheme constitutes an individual, and all individuals form a population. Specifically, the operating water level of the m-th reservoir at time period t is represented as the decision variable. An individual X is represented as a string of length X. vector: in M The total number of reservoirs, T This represents the total number of scheduling periods. The population consists of... P Composed of individual entities, denoted as .
[0011] In the GPU's global memory, the decision variables of each individual are stored continuously in a two-dimensional "reservoir-time period" matrix, that is, the water level values of all time periods of the reservoir are arranged sequentially according to the reservoir order. This storage layout allows a single GPU thread to initiate continuous global memory access requests when reading all the decision variables of its corresponding individual, which are then merged into wide data reads by the GPU hardware, maximizing memory bandwidth utilization.
[0012] Step S3: GPU Individual-Level Parallel Fitness Evaluation Copy the population data to the GPU's global memory and start the CUDA kernel function for fitness evaluation. The kernel function's thread grid is configured such that each thread block contains several threads, and the thread grid contains a sufficient number of thread blocks so that the total number of threads is greater than or equal to the population size. .
[0013] The kernel function employs an individual-level parallelism strategy: each thread in the GPU processes only one complete scheduled instance independently, without performing thread-level parallel splitting of reservoirs or time periods within the thread. Specifically, the thread ID is... Each thread is responsible for only one individual in the population. .
[0014] For threads i The corresponding individual Internally, the following processes are executed sequentially: S31: Based on thread ID Calculate the base address offset of the individual decision variable in the GPU global memory. Then, initiate a continuous read operation to read all of the individual's data at once or in batches. Water level decision variables.
[0015] S32: Based on the preset water level-reservoir capacity relationship curve, the water level values of each reservoir at each time period can be converted into corresponding reservoir capacity values by storing them in GPU constant memory or shared memory in the form of a lookup table or piecewise linear interpolation function. S33: Perform serial recursive calculation for each reservoir in order from upstream to downstream, i.e., from upstream to downstream: For the current reservoir... mPerform the following operations in the order of scheduling periods from period 1 to period T: Obtain the initial storage capacity for the current period. V(m,t) The initial reservoir capacity for the first time period is a known initial capacity, and the initial reservoir capacity for the remaining time periods is equal to the final reservoir capacity of the previous time period. The inflow rate for the current time period is obtained; for the first-level reservoir, the inflow is known, and for each downstream reservoir, the inflow is the sum of the outflow from the upstream reservoir and the inflow within the same reservoir interval. The final reservoir capacity for the current time period is calculated based on the water balance equation. V(m,t+1) The calculation involves calculating the discharge flow and using the calculated final storage capacity as the initial storage capacity for the next time period, continuing the recursive calculation. This recursive calculation is completed continuously within a single thread, without involving any cross-thread synchronization or communication operations.
[0016] S34: Calculate the power generation output for each time period based on the recursive calculation of the discharge flow and head of each reservoir at each time period (derived from the discharge flow-water level relationship). N(m,t) The total power generation target value for that individual is obtained by summing the results according to the formula for maximizing power generation. .
[0017] S35: Based on the relationship between downstream flow and the upper and lower limits of ecological flow in each time period, calculate the ecological change degree in each time period in segments, and calculate the average to obtain the multi-year average ecological change degree target value; based on the downstream flow in each time period calculated recursively... With the preset ecological flow limit Lower limit Ecological change is calculated in segments according to the ecological change calculation formula, and the ecological change is calculated for each time period. The average value is calculated to obtain the multi-year average ecological change target value for that individual. .
[0018] S36: The calculated result and The fitness value of this individual is written to the corresponding location in the output buffer of the GPU's global memory.
[0019] Step S4: Asynchronous Co-evolution of CPU and GPU After the GPU completes the fitness evaluation of the current population, it transfers the fitness value from the GPU's global memory back to the CPU's memory via asynchronous memory copy. Upon receiving the fitness value, the CPU executes NSGA-II evolutionary operations, including: fast non-dominated sorting, crowding distance calculation, tournament selection, simulated binary crossover, and polynomial mutation, to generate the next generation of the population.
[0020] Asynchronous co-evolution between CPU and GPU is achieved using CUDA streams. Specifically, two or more CUDA streams are created and interleaved for fitness evaluation and data transfer across different generations of the population. When the CPU receives the fitness value of the k-th generation population, it immediately initiates the evolutionary operation for the k-th generation to generate the (k+1)-th generation population. After the CPU evolutionary operation ends, the fitness evaluation kernel function is started for the generated next-generation individuals.
[0021] Step S5: Determining the optimal population size Multiple preset population sizes were set, such as 100, 200, 500, 1000, 1500, 2000, and 3000. For each population size, a complete GPU-parallel accelerated multi-objective optimization process was executed, and the total runtime was recorded. Simultaneously, the Hypervolume metric of the final Pareto front was obtained as a quantitative measure of the solution set quality.
[0022] The rule for determining the optimal population size is as follows: taking into account both computational efficiency and solution quality, the optimal population size is determined by plotting the HV change curves over time under different population sizes.
[0023] Step S6: Output the final scheduling scheme Using the optimal population size determined in step S5, the optimization process from steps S2 to S4 is repeated to obtain the Pareto optimal solution set. Based on the trade-off between power generation benefits and ecological objectives, a recommended scheduling scheme is selected from the Pareto front, and the operating water level process of each reservoir at each time period, as well as the corresponding power generation and ecological change indicators, are output.
[0024] (III) Beneficial Effects Compared with the prior art, the present invention has the following significant advantages: 1. Significantly improves the solution efficiency of multi-objective optimization scheduling for high-dimensional cascade reservoirs. This invention migrates the entire fitness evaluation process to GPU execution, employing an individual-level parallel strategy where each thread independently completes all computations for a single scheduling individual, fully utilizing the massively parallel computing capabilities of GPUs. Under conditions of 6 databases, 720 time periods, a population size of 3000, and 4320 decision variable dimensions, it achieves approximately 43 times the speedup compared to traditional CPU serial NSGA-II, reducing the optimization computation that originally required hours or even tens of hours to minutes, effectively solving the computational bottleneck problem of fitness evaluation under large-scale population conditions.
[0025] 2. This invention fundamentally avoids the synchronization overhead and physical consistency risks associated with fine-grained parallelism. It employs a parallel granularity design of "individual-level parallelism, intra-thread serial processing," serially completing all water balance recursive calculations within a single GPU thread, following the upstream-downstream order of the reservoir and the sequence of time periods. This design naturally aligns with the spatiotemporal coupling characteristics of cascade reservoir scheduling, where "upstream discharge determines downstream inflow, and the reservoir capacity at the end of the previous period determines the initial capacity of the next period." It eliminates the need for any cross-thread synchronization operations, fundamentally ensuring the physical consistency of the calculation results and avoiding GPU performance degradation due to branch divergence.
[0026] 3. Maximize GPU memory bandwidth utilization. This invention designs a real number encoding scheme and a two-dimensional matrix data storage structure for GPU global memory merging access. This allows a single thread to generate continuous global memory accesses when reading all individual decision variables, which are then merged into wide data read operations by the GPU hardware. This greatly improves memory bandwidth utilization and further enhances parallel computing efficiency.
[0027] 4. Achieve efficient asynchronous collaboration between CPU and GPU. This invention utilizes CUDA streaming and asynchronous memory copy technology to asynchronously and collaboratively execute evolutionary operations on the CPU and fitness evaluation on the GPU. This effectively masks CPU-GPU communication latency and the time consumption of CPU serial evolutionary operations, maximizing the throughput of the entire heterogeneous system.
[0028] 5. This invention provides a method for determining the optimal population size that balances computational efficiency and solution quality. By systematically testing the runtime and Pareto front quality index under different population sizes, this invention provides a reproducible basis for selecting the optimal population size in practical engineering applications. This avoids the waste of computational resources or insufficient solution quality caused by blindly setting the population size, and has significant practical engineering value. Attached Figure Description
[0029] To more clearly illustrate the specific embodiments of this invention or the technical solutions in the prior art, the drawings used in the description of the specific embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are some embodiments of this invention. For those skilled in the art, other drawings can be obtained from these drawings without creative effort.
[0030] Figure 1 This is a schematic diagram of the process of the present invention; Figure 2 This is a schematic diagram of the CUDA thread hierarchy and the individual-thread mapping relationship of this invention; Figure 3 Comparison of running time and speedup ratio of the method of the present invention under different population sizes; Figure 4 Curves showing the change of Hypervolume index over runtime at different population sizes; Figure 5 Pareto optimal solution set and TOPSIS optimal solution distribution diagram; Figure 6 Comparison chart of results between the method of this invention and other model methods; Figure 7 The interannual variation diagram of cascade power generation and ecological change under the preferred scheduling scheme of this invention. Detailed Implementation
[0031] The technical solution of this invention will be clearly and completely described below with reference to the embodiments. Obviously, the described embodiments are only some embodiments of this invention, not all embodiments. Based on the embodiments of this invention, all other embodiments obtained by those skilled in the art without inventive effort are within the scope of protection of this invention.
[0032] This embodiment takes the cascade reservoirs in the middle and lower reaches of the Lancang River as the research object. The cascade includes 7 reservoirs (the last reservoir is a runoff reservoir and does not participate in the optimization and regulation calculation, so it is referred to as M=6). The scheduling period is from June 1960 to May 2020, a total of 720 months (hereinafter referred to as T=720). The solution is obtained by using the multi-objective optimization scheduling method for cascade reservoirs based on GPU parallel acceleration described in this invention.
[0033] This embodiment constructs a multi-objective optimization scheduling model for cascade reservoirs with the optimization objectives of maximizing power generation and minimizing the degree of ecological change (DEC).
[0034] (a) Objective Function (1) Maximum power generation target: expressed as maximizing the sum of power generation of each reservoir in each time period, calculated by the following formula: in, M M represents the total number of reservoirs, which is 6 in this embodiment; T represents the total number of scheduling periods, which is 720 in this embodiment. N m,t For the first m The first reservoir t The average output over the time period is in ten thousand kW, and Δt is the duration of the time period, which is one month in this embodiment.
[0035] (2) Minimum ecological alteration target: Based on the upper and lower limits of downstream ecological flow, the discharge flow is segmented and quantified according to the degree to which it exceeds the ecologically suitable range. The calculation formula is as follows: Among them, among them, T Indicates the scheduling period; D t Indicates the first t Ecological change over time, % t The time period number is represented by the following formula: when Q t >Q tmax hour, D t =|Q tmax -Q t | / (Q t +Q tmax ) ; when Q tmin <= Q t <=Q tmax hour, D t =0 ; when Q t <Q tmin hour, D t =|Q tmin –Q t | / (Q tmin +Q t ) ; Q t For the first t Downstream flow during the period, m 3 / s; Q tmax For the first t Downstream ecological flow limit for the time period, m 3 / s; Q tmin For the first t Lower limit of downstream ecological flow during the period, m 3 / s.
[0036] (ii) Constraints The constraints include water balance constraints, discharge flow constraints, water level constraints, and power output constraints. The shipping flow constraints are shown below: (1) Water balance constraint in, V ( m , t ) indicates the first m reservoir t Initial storage capacity for the time period, m 3 ; V ( m , t+ 1) indicates the first m reservoir t The final storage capacity of the time period, m 3 ; Q I ( m , t ) indicates the first m reservoir t Inbound flow rate during a given time period, m 3 / s; Q O ( m , t ) indicates the first m reservoir t The outflow rate during the time period, m 3 / s; Q local ( m , t ) indicates the first m reservoir t Interval inflow during a time period, m 3 / s.
[0037] (2) Downflow constraint in, Q smin ( m ) indicates the first m Minimum discharge limit of reservoir, m 3 / s; Q smax ( m ) indicates the first m Maximum outflow limit of reservoir, m 3 / s.
[0038] (3) Water level constraints in, Z ( m , t ) indicates the first m Reservoir No. t Water level over a given time period is the decision variable, m; Zmax ( m ) indicates the first m The upper limit of reservoir water level is the normal storage level during non-flood seasons and the flood control limit level during flood season, in meters (m). Z min ( m ) indicates the first m The lower limit of the reservoir water level is the dead water level, in meters.
[0039] (4) Output constraint in, N min ( m ) indicates the first m The minimum output of the reservoir, W; N max ( m ) indicates the first m The maximum power output of the reservoir, W.
[0040] (5) Navigation flow constraints in: Indicates minimum air traffic flow, m 3 / s.
[0041] This embodiment uses real-number encoding, with the operating water level of each reservoir at each time period as the decision variable. A complete scheduling scheme constitutes an individual, and all individuals form a population.
[0042] Specifically, the operating water level of the m-th reservoir during time period t is represented as the decision variable x(m,t), and an individual X is represented as a vector of length M×T: in M The total number of reservoirs, M=6 , T The total number of scheduling periods. T=720 Since the last reservoir is a runoff reservoir, the final decision variable has a dimension of M×T = 6×720 = 4320. The population consists of... P Composed of individual entities, P=200 , recorded as .
[0043] In this embodiment, the GPU global memory adopts a two-level contiguous storage layout: Level 1, Continuous storage between individuals: All decision variables of each complete scheduling scheme are stored sequentially from 0 to P-1 according to the individual index.
[0044] Second level, continuous storage within decision variables: inside each individual, water level values are arranged strictly in the linear order of "reservoir index from 0 to M-1, period index from 0 to T-1".
[0045] This storage layout enables that after the CUDA kernel function is started, when consecutively numbered threads in the same warp (32 threads) simultaneously read the first decision variable of their respective responsible individuals, the addresses of these variables in the global memory are exactly consecutive, which can be automatically merged by the GPU hardware into one wide data read transaction, maximizing the utilization of the global memory bandwidth.
[0046] Copy the population data from the CPU memory to the GPU global memory, and start the fitness evaluation CUDA kernel function. The kernel function adopts an individual-level parallel strategy: each thread in the GPU independently processes and only processes one complete scheduling individual, and no thread-level parallel splitting for reservoirs or periods is performed inside the thread.
[0047] In this embodiment, the population size P=200 , the CUDA kernel function is configured as a one-dimensional grid and a one-dimensional thread block. Each thread block contains 256 threads, a total of N thread blocks are allocated, 200 threads are actually activated, and each thread corresponds to one individual.
[0048] For a thread with a global thread index of globalIndex (0 ≤ globalIndex < P), its corresponding individual is X globalIndex , and the following procedures are executed serially inside it: (1) Data reading: read all decision variables of the individual according to the thread ID. As shown in Figure 2 , the present invention adopts a one-dimensional thread mapping model, which maps the i-th individual in the population to a GPU thread with a global thread index of i. For the one-dimensional thread model, the calculation formula of the global thread index is: where blockIdx.x is the thread block index, blockDim.x is the thread block size, and threadIdx.x is the local index of the thread within the block. In this embodiment, blockIdx.x=0, blockDim.x =256, and the value range of threadIdx.x is 0 to 199, therefore globalIndex = threadIdx.x, which corresponds one-to-one with the individual serial number.
[0049] (2) Water level-storage capacity conversion: convert the water levels of each reservoir in each period into storage capacity according to the water level-storage capacity relation curve. The water level-storage capacity relation curve is stored in the form of discrete points in the GPU constant memory, and the thread calculates and obtains the corresponding storage capacity value through linear interpolation.
[0050] (III) Serial Recursive Calculation of Water Balance: The calculation is performed reservoir by reservoir in ascending order from upstream to downstream. For the current reservoir, the final storage capacity is calculated using the water balance equation based on the initial storage capacity, inflow, and outflow of the current time period, from time period 1 to time period T, and this final capacity is used as the initial storage capacity for the next time period. The inflow of the first-level reservoir is based on known inflow runoff data; the inflow of each downstream reservoir is the sum of the outflow from its upstream reservoir and the inflow within its own reservoir interval. This recursive process is completed continuously within a single thread, requiring no cross-thread synchronization or communication.
[0051] (iv) Power output calculation and power generation accumulation: The power output is calculated based on the outflow and head of each reservoir at each time period, and the total power generation target value is obtained by accumulation. The formula for calculating output is: in, η m For the first m The overall output coefficient of the reservoir, Q m,t For the first m The first reservoir t Power generation flow rate (m³ / s) during the time period. H m,t For the first m The first reservoir t Average hydropower head (m) over the period.
[0052] (v) Calculation of ecological change degree: Based on the relationship between downstream flow and the upper and lower limits of ecological flow in each time period, the ecological change degree D of each time period is calculated in segments. t The annual average value is used to obtain the multi-year average ecological change target value f2.
[0053] (vi) Write the results: Write the two target values f1' and f2' as the fitness values of the individual into the GPU output buffer at the position corresponding to the thread.
[0054] After all threads have finished executing in parallel, the GPU completes the fitness evaluation of all P individuals in the current population.
[0055] After the GPU completes the fitness evaluation of the current population, it returns the fitness value from the GPU global memory to the CPU memory via asynchronous memory copy (cudaMemcpyAsync). After receiving the fitness value of the k-th generation population, the CPU executes NSGA-II evolutionary operations: fast non-dominated sorting, crowding distance calculation, tournament selection, simulated binary crossover (SBX), and polynomial mutation to generate the (k+1)-th generation population.
[0056] This embodiment utilizes CUDA streams (cudaStream_t) to achieve asynchronous collaborative evolution between the CPU and GPU. Specifically: (1) Create two CUDA streams (stream0 and stream1) using a double-buffering mechanism. In stream0, the k-th generation population data is asynchronously copied from CPU memory to GPU global memory (cudaMemcpyAsync), and then the k-th generation fitness evaluation kernel function (kernel_fitness<<<grid, block, 0, stream0> >>), and finally, the fitness evaluation results are asynchronously copied from GPU global memory back to CPU memory (cudaMemcpyAsync).
[0057] (2) After receiving the fitness value of the kth generation, the CPU immediately starts the selection, crossover and mutation operations of the kth generation to generate the (k+1)th generation population. At the same time, in stream1, the GPU does not need to wait for the evolution operation of the CPU to be completely finished before it can start the fitness evaluation kernel function for the generated (k+1)th generation population.
[0058] (3) Pre-copy mechanism for offspring data transmission: The CPU generates the next generation of individuals X. k+1 During the process, after each individual or batch of individuals is generated, the decision variables of the offspring are pre-copied to the spare buffer in the GPU global memory through the asynchronous transfer operation (cudaMemcpyAsync) in the CUDA stream.
[0059] (4) Through CUDA events (cudaEvent) t To perform inter-stream synchronization, ensure that the kernel function in stream1 can only start after the previous generation of data transmission and computation in stream0 is completed, and at the same time ensure that the corresponding asynchronous memory copy has been completed when the CPU reads the fitness value.
[0060] Through the aforementioned three-stage pipeline mechanism of "computation-transmission-computation," the serial evolution operation on the CPU side and the overhead of offspring data transmission are completely masked. In this embodiment, the above process is repeated for each generation until the maximum number of iterations is reached.
[0061] This embodiment determines the optimal population size that balances computational efficiency and solution quality through systematic testing. Population sizes were set to 100, 200, 500, 1000, 1500, 2000, and 3000. For each population size, the GPU parallel acceleration method of this invention was used to complete the entire multi-objective evolutionary process (setting different iteration numbers from 10,000 to 100,000 generations), recording the total running time and obtaining the HV index of the final Pareto front.
[0062] The experimental platform was configured as follows: CPU: AMD Ryzen 5 7500F 6-Core Processor 3.70 GHz; GPU: NVIDIA GeForce RTX 4060 Ti; development environment: Python 3.12.7 and CUDA 12.6. The above platform parameters are merely one specific test environment for this invention and are not intended to limit the scope of application or protection of this invention.
[0063] The running time and speedup data for different population sizes are shown in Table 1.
[0064] Table 1. Runtime and speedup ratio at different population sizes From Table 1 and Figure 4 It is evident that the GPU significantly accelerates the most time-consuming step of fitness evaluation, drastically reducing the evaluation time from tens of seconds to tens of minutes in a CPU-based process to approximately 0.04 to 0.05 seconds. The speedup reaches a maximum of 53,310 times when the population size is 3,000. The overall speedup of NSGA-II increases with population size; when the population size increases from 100 to 3,000, the overall speedup increases from 18.69 times to 44.53 times.
[0065] Further analysis of the solution set quality, through experimental comparison, revealed that when the population size was 100 and 200, the Hypervolume index increased fastest in the early stages of iteration (the first 50 generations). However, with a population size of 100, it took 300 iterations to converge to HV=217, while with a population size of 200, only 100 generations were needed to achieve the same HV value. For Pop≥500, although the final HV value improved slightly (not exceeding 3%), the computation time increased by more than 400%. Figure 4 As shown, all curves exhibit rapid HV growth in the initial stages of operation. However, as the running time increases, the growth rate gradually slows down and stabilizes, indicating that the solution set quality improves rapidly in the early stages of the algorithm's operation, and then gradually converges in the later stages. It is worth noting that a smaller population size requires less running time to achieve the same HV target. By comprehensively comparing the increment of Hypervolume per unit time and the convergence and uniformity of the Pareto front, this embodiment determines a population size of P=200 as the optimal population size that balances solution set quality and computational efficiency.
[0066] Using a population size of P=200, the optimization process from step three to step five is repeated, with the iteration time set to 20,000 s (approximately 150,000 iterations) to obtain the Pareto optimal solution set.
[0067] The TOPSIS (Technique for Order Preference by Similarity to IdealSolution) method is used to select recommended scheduling schemes from the Pareto solution set: the relative similarity between each solution and the ideal solution (maximum power generation, minimum DEC) and the non-ideal solution (minimum power generation, maximum DEC) is calculated, and the solution with the largest relative similarity is determined as the optimal solution.
[0068] The TOPSIS optimal scheduling scheme obtained in this embodiment is: an average annual power generation of 71.07 billion kWh and a degree of ecological change (DEC) of 8.7%.
[0069] Depend on Figure 5 As can be seen, the Pareto front exhibits a typical convex distribution, reflecting the trade-off between power generation and ecological degradation. With increasing power generation, ecological degradation shows a non-linear upward trend. Within the range of power generation below 72 billion kWh, the slope of the front curve is relatively gentle, indicating that a moderate increase in power generation will not significantly worsen the ecological situation. However, when power generation exceeds 72 billion kWh, the curve becomes sharply steep, indicating that pursuing higher power generation efficiency will come at the expense of the ecological environment. The optimal solution of TOPSIS is located in the upper-middle part of the Pareto front, in the transition region where the curve slope changes. To verify the superiority of the method of this invention, the results of this embodiment are compared with the traditional CPU serial NSGA-II method and the single-objective power generation maximization model: (1) Compared with the CPU serial NSGA-II method: Under the premise that the power generation is basically the same (71.07 billion kWh and 71 billion kWh), the method of the present invention reduces DEC from 13.6% to 8.7%, and the ecological improvement reaches 36% (see Figure 6 This indicates that GPU parallel computing, by fully utilizing the massive parallel computing capabilities, enables the algorithm to complete a more thorough search within the same time frame, thereby finding a better Pareto front region.
[0070] (2) Compared with the single-objective power generation maximization model: the method of this invention achieves a 60.7% ecological improvement (DEC decreases from 22.11% to 8.7%) with a power generation loss of 4.49% (3.34 billion kWh), thus achieving a better balance between power generation benefits and ecological protection (see Figure 6 ).
[0071] The output results include: the operating water level process of each reservoir at each time period (4320 water level values), and the corresponding total cascade power generation of 71.07 billion kWh and ecological change of 8.7% (see...). Figure 7 ).
Claims
1. A multi-objective optimization scheduling method for cascade reservoirs based on GPU parallel acceleration, characterized in that, Includes the following steps: S1: Construct a multi-objective optimization scheduling model for cascade reservoirs with the objectives of maximizing power generation and minimizing ecological change, and determine the constraints of water balance, outflow, water level, power output, and navigation flow. S2: Using real number encoding, the operating water level of each reservoir at each time period is used as the decision variable, and a complete scheduling scheme is organized into a single individual, with all individuals forming a population; among them, the decision variables of each individual are stored continuously in the GPU global memory in the form of a two-dimensional matrix of "reservoir-time period" to support the memory merging access of GPU threads; S3: Copy the population data to the GPU global memory, start the fitness evaluation kernel function, and adopt an individual-level parallel strategy: each thread in the GPU independently processes a complete scheduled individual. Within a single thread, water balance calculation, reservoir capacity-water level conversion, power output calculation, and ecological change calculation are executed serially according to the reservoir order and time period order. The power generation target and ecological change target corresponding to the individual are accumulated, and the calculation results are written to the GPU output buffer. S4: After the GPU completes the fitness evaluation of the current population, it returns the fitness value to the CPU through asynchronous memory copy; the CPU performs NSGA-II fast non-dominated sorting, crowding distance calculation, tournament selection, simulated binary crossover and polynomial mutation based on the returned fitness value to generate the next generation population; among them, the evolutionary operations on the CPU and the fitness evaluation of the next generation individuals on the GPU are asynchronously coordinated through CUDA streams. S5: Under multiple preset population sizes, the total running time, Pareto front distribution and Hypervolume index are statistically analyzed to determine the optimal population size based on a balance between computational efficiency and solution quality. S6: Re-execute steps S2 to S4 using the optimal population size to obtain the Pareto optimal solution set. Based on the trade-off between power generation benefits and ecological objectives, select a recommended scheduling scheme from the set and output the operating water level process of each reservoir at each time period, as well as the corresponding power generation and ecological change indicators.
2. The multi-objective optimization scheduling method for cascade reservoirs based on GPU parallel acceleration according to claim 1, characterized in that, In S2, the real number encoding method is specifically as follows: The first m The first reservoir t The operating water level during a given period is represented as a decision variable. x ( m,t ), an individual X Represented as a length of M×T vector: in M The total number of reservoirs, T This represents the total number of scheduling periods; population P This group consists of individuals, denoted as... {X 1 , X 2 , …, X p } ; In the GPU global memory, the decision variables are... P An independent M OK T The two-dimensional matrix format allows a single thread to generate continuous global memory access requests when reading all the decision variables of its corresponding individual.
3. The multi-objective optimization scheduling method for cascade reservoirs based on GPU parallel acceleration according to claim 1, characterized in that, The process of serial execution within a single thread as described in S3 further includes: S31: Read all decision variables of the corresponding individual based on the thread ID, namely the water level values of all reservoirs and all time periods; S32: Based on the water level-storage capacity relationship curve, convert the water level of each reservoir at each time period into the storage capacity; S33: For the first-level reservoir, the reservoir capacity is updated and the outflow is calculated based on the inflow and outflow according to the water balance equation; for downstream reservoirs of all levels, the outflow and reservoir capacity are calculated sequentially and recursively according to the water balance equation, based on the upstream outflow, the inflow between the sections and the outflow of the reservoir itself, and the outflow of the reservoir itself. S34: Calculate the power generation output based on the outflow and head of each reservoir at each time period, and sum them up to obtain the total power generation f1; S35: Based on the relationship between the downstream flow and the upper and lower limits of the ecological flow in each time period, calculate the ecological change degree Dt in each time period, and calculate the average value to obtain the multi-year average ecological change degree f2. S36: Write f1 and f2 as the fitness values of this individual to the output buffer.
4. The multi-objective optimization scheduling method for cascade reservoirs based on GPU parallel acceleration according to claim 1, characterized in that, The asynchronous collaboration described in S4 specifically refers to: After receiving the fitness value of the k-th generation population, the CPU immediately initiates the selection, crossover, and mutation operations of the k-th generation to generate the (k+1)-th generation population. On the GPU side, using CUDA streams, after the fitness evaluation kernel function of the kth generation is completed, the evolutionary operation on the CPU side ends, and the fitness evaluation kernel function is started on the generated k+1th generation population.
5. The multi-objective optimization scheduling method for cascade reservoirs based on GPU parallel acceleration according to claim 1, characterized in that, The process of determining the optimal population size in step S5 is as follows: Different population sizes were set: 100, 200, 500, 1000, 1500, 2000, 3000; For each population size, record the total runtime of completing the entire multi-objective evolutionary process using the GPU parallel acceleration method described above; Plot the Hypervolume (HV) change curves over time for different population sizes to determine the optimal population size.
6. The multi-objective optimization scheduling method for cascade reservoirs based on GPU parallel acceleration according to claim 1, characterized in that, The formula for calculating the minimum ecological alteration target mentioned in step S1 is: , in, T Indicates the scheduling period; D t Indicates the first t Ecological change over time, % t The time period number is represented by the following formula: when Q t >Q tmax hour, D t =|Q tmax -Q t | / (Q t +Q tmax ) ; when Q tmin <= Q t <=Q tmax hour, D t =0 ; when Q t <Q tmin hour, D t =|Q tmin –Q t | / (Q tmin +Q t ) ; Q t For the first t Downstream flow during the period, m 3 / s; Q tmax For the first t Downstream ecological flow limit for the time period, m 3 / s; Q tmin For the first t Lower limit of downstream ecological flow during the period, m 3 / s.
7. A multi-objective optimization scheduling method for cascade reservoirs based on GPU parallel acceleration according to any one of claims 1 to 6, characterized in that, The number of cascade reservoirs is M≥6, the number of scheduling periods is T≥720, the population size is P≥3000, and the decision variable dimension is M×T.
8. The multi-objective optimization scheduling method for cascade reservoirs based on GPU parallel acceleration according to claim 1, characterized in that, In step S3, when each thread independently processes a complete scheduling individual, the reservoirs or time periods within the individual are not split into thread-level parallel segments, so that the hydrological and water conservancy calculations of all cascade reservoirs corresponding to the individual are completed within a single thread, avoiding synchronization and communication overhead between threads.
Citation Information
Patent Citations
Electric vehicle charging station load prediction method considering multi-source information and decision correction
CN115545303A