Intelligent parallel cache system and optimization method for water conservancy project scheduling oriented to smart water conservancy

By combining the topological characteristics and constraints of water projects, and employing asynchronous hierarchical caching and cumulative hashing modules, the problems of poor hit rate and memory utilization in existing caching systems during water project scheduling optimization are solved, and efficient scheduling scheme optimization solutions are achieved.

CN121070820BActive Publication Date: 2026-02-10NANJING HYDRAULIC RES INST
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202511616261.0
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2025-11-06
Publication Date
2026-02-10
Estimated Expiration
2045-11-06

AI Technical Summary

Technical Problem

Existing caching systems fail to fully consider the topological relationships and constraints of water engineering systems in water engineering scheduling optimization, resulting in poor hit rate, memory utilization efficiency, and parallel acceleration effects, making it difficult to meet the stringent requirements of computing efficiency under the condition of limited domestic computing power resources.

Method used

By employing a constraint-driven asynchronous hierarchical caching module, a topology-sensitive cumulative hashing module, and a polymorphic hierarchical storage module, and combining the topological characteristics and constraints of water engineering, this paper achieves efficient caching and parallel optimization of the scheduling scheme through techniques such as thread-local buffering, global batch processing, generational sliding window and topology sorting, and exponential decay weighted hashing.

Benefits of technology

It significantly improves cache hit rate, memory utilization and parallel performance, supports efficient optimization of large-scale water project scheduling schemes, reduces ineffective computational overhead and improves overall system performance.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121070820B_ABST
    Figure CN121070820B_ABST
Patent Text Reader

Abstract

The application discloses a kind of water engineering scheduling intelligent parallel cache systems and optimization methods for wisdom water conservancy, including constraint-driven asynchronous layered cache module, topological sensitive cumulative hash module and polymorphic layered storage module;System adopts thread local buffer, global batch processing and three-level architecture of generation sliding window, performs boundary constraint pre-check on scheduling scheme;According to the topological relationship of upstream and downstream of water project, rearrange decision vector, upstream project decision priority participates in hash calculation and is given higher weight, weight decreases according to exponential function;Dynamically allocate target value array and store volume class, flow class, time sequence class constraint violation degree by layer;The application improves the identification accuracy and cache hit rate of similar scheme significantly through topological perception hash mechanism and adaptive cache strategy, effectively reduces the repeated call of hydraulic simulator, improves the calculation efficiency of water engineering scheduling optimization.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The application belongs to the technical field of water engineering scheduling optimization, and particularly relates to a water engineering scheduling intelligent parallel cache system and optimization method for smart water conservancy. BACKGROUND

[0002] With the deepening of the construction of smart water conservancy, water engineering scheduling decision-making is undergoing profound changes from experience-driven to data-driven, from single target to multi-target coordination, and from static pre-plan to dynamic optimization. The joint scheduling of complex water engineering systems such as basin water engineering group, cascade hydropower stations, and irrigation canal systems needs to comprehensively balance multi-dimensional targets such as flood control safety, water supply guarantee, power generation benefit, and ecological water demand, while strictly meeting a series of engineering constraints such as reservoir capacity, discharge capacity, hydraulic continuity, and gate operation. Under this background, evolutionary algorithms have become the mainstream technical route for solving such complex multi-objective optimization problems due to their strong global optimization ability and no specific requirements for the form of objective function and constraints.

[0003] The existing technology usually adopts an evolutionary algorithm framework when dealing with water engineering scheduling optimization problems, and evaluates each candidate scheduling scheme in the population by calling a fine hydraulic simulator to obtain its objective function value and constraint violation. To alleviate the computational pressure, the existing scheme generally introduces a general cache mechanism, which queries whether there is an identical or similar evaluated scheme in the cache before evaluating a new scheme, and if there is, the historical results are directly reused to avoid repeated calling of time-consuming hydraulic simulation calculation. Such cache technology usually adopts general replacement strategies such as LRU (Least Recently Used) and LFU (Least Frequently Used), and uses standard hash algorithms for fast comparison of decision vectors to support scheme retrieval.

[0004] However, the existing technology has a most obvious shortcoming: the general cache mechanism used does not fully consider the physical laws and optimization problem characteristics specific to the field of water engineering scheduling. Specifically, the general hash algorithm treats all dimensions of the decision vector equally, ignoring the inherent upstream and downstream topological relationship in the water engineering system and the critical influence of upstream decisions on downstream states. At the same time, the existing cache usually only stores the final objective function value, without subdividing and storing the constraint conditions for utilization, resulting in the need to recheck the feasibility of the scheme even if the cache hits. These defects make the existing cache system not achieve the ideal state in terms of hit rate, memory utilization efficiency, and parallel acceleration effect when dealing with problems in this specific field, making it difficult to effectively support the stringent requirements of large-scale evolutionary optimization for computational efficiency under the background of limited domestic computing resources. SUMMARY

[0005] Invention purposes: The purpose of the present application is to provide a water engineering scheduling intelligent parallel cache system and optimization method for smart water conservancy, which combines water engineering topological characteristics, hydraulic constraint characteristics and evolutionary computing mechanism, and considers hit rate, memory occupation and concurrent performance, and realizes efficient optimization and solution of water engineering scheduling scheme under the current domestic computing power constraints.

[0006] Technical scheme: The water engineering scheduling intelligent parallel cache system comprises:

[0007] The constraint-driven asynchronous hierarchical cache module is used for adopting a three-level architecture of thread local buffer, global batch processing and generation sliding window, supporting multi-thread parallel pre-checking of decision variable boundary constraints of the input scheduling scheme, and rejecting the scheme that does not meet the boundary requirements into the cache;

[0008] The topologically sensitive cumulative hash module is used for rearranging and grouping the decision vector according to the upstream and downstream spatial topological relationship of the water engineering, and the upstream engineering decision component is preferentially involved in the hash calculation and is given a higher weight, the weight decreases exponentially with the engineering position, and the segmented hash value is iteratively generated by performing bitwise XOR operation on the previous hash result and the current weighted sum and then taking the modulus of the prime number;

[0009] The multi-state hierarchical storage module is used for dynamically allocating a target number field and a target value array with a corresponding length for each cache item, optimizing the default allocation length according to the frequency of the target number, and storing the constraint violation degrees of volume, flow and time sequence and the total violation degree in a hierarchical manner, and based on the hash value, the cache bucket is located and multi-thread parallel execution of decision vector accurate matching in the bucket is supported, and when a hit is found, the target value and the constraint violation degrees of the cache are directly returned.

[0010] The constraint-driven asynchronous hierarchical cache module realizes fast pre-checking and parallel caching of scheduling scheme boundary constraints, effectively reducing invalid calculation overhead; the topologically sensitive cumulative hash module combines the spatial topological relationship of the water engineering and the evolutionary computing characteristics, and significantly improves the aggregation efficiency of similar schemes through the upstream priority weighted hash mechanism; the multi-state hierarchical storage module realizes classified storage based on constraint violation degrees and dynamic memory allocation strategy, which optimizes the memory usage efficiency while ensuring the query accuracy. Through the three-level cache architecture and the topologically sensitive hash algorithm, the system deeply integrates the hydraulic constraint characteristics and the parallel computing advantages, realizes the coordinated improvement of the water engineering scheduling scheme cache hit rate, memory utilization and multi-thread concurrent performance under the condition of limited domestic computing power resources, and provides key technical support for the fast optimization and solution of complex water resource systems.

[0011] Preferably, the constraint-driven asynchronous hierarchical cache module comprises:

[0012] Thread local buffer unit, allocate independent buffer for each parallel thread to store cache data, buffer content includes hash value, decision vector, target value array, three types of constraint violation degree and total violation degree, iteration identification and creation timestamp, use counter to record the amount of stored data, when the counter reaches the upper limit of the capacity, trigger batch refresh to global queue;

[0013] Boundary constraint pre-check unit, perform boundary check on the decision vector of the scheduling scheme to be cached, if there is a decision variable not in the allowed interval, reject the cache and return the boundary violation identifier;

[0014] Global batch processing unit, maintain concurrent safe pending queue to receive data batches refreshed by each thread, sequentially execute hash value grouping, identify duplicate records within the same group with decision vector distance less than the deduplication tolerance, and only keep the minimum total violation degree in the duplicate record, and batch insert the hash table after deduplication;

[0015] Iteration sliding window adaptive unit, maintain a recent hit rate circular queue, calculate the hit rate of the current iteration at the end of each iteration and update the queue, calculate the average hit rate, and adaptively adjust the iteration window width according to the relationship between the average hit rate and the threshold;

[0016] Batch asynchronous cleaning unit, update the current iteration identification when the iteration increases, calculate the invalid iteration threshold, perform parallel traversal on the hash table, and remove expired cache items with iteration identification less than or equal to the invalid threshold.

[0017] Through the thread local buffer unit, the multi-thread concurrent conflict is effectively reduced, combined with the boundary constraint pre-check unit to filter invalid schemes from the source; the global batch processing unit improves the quality of cache data through the three-level processing mechanism of grouping, deduplication and optimization; the iteration sliding window adaptive unit dynamically adjusts the cache retention strategy according to the historical hit rate, balances the memory occupation and reuse efficiency; the batch asynchronous cleaning unit realizes parallel cleaning of expired data. The whole mechanism guarantees data consistency while significantly improving the concurrent throughput and memory usage efficiency of the cache system, providing efficient cache support for large-scale parallel optimization of evolutionary algorithms on domestic computing platforms.

[0018] Preferably, the generational sliding window adaptive unit maintains a recent hit rate circular queue of length L, where L is the number of hit rate data that the queue can store. At the end of each generation, the hit rate of the current generation is calculated and the queue is updated. The average hit rate r_avg is calculated. When r_avg exceeds the high threshold r_high, the generational window width is expanded by w_new = min(⌈w_old × α_expand⌉, w_max). When r_avg is lower than the low threshold r_low, the generational window width is reduced by w_new = max(⌊w_old × β_shrink⌋, w_min), where w_old is the current window width, w_new is the adjusted window width, α_expand > 1 is the expansion factor, β_shrink ∈ (0,1) is the reduction factor, w_max and w_min are the upper and lower limits of the window width, respectively, ⌈·⌉ represents rounding up, and ⌊·⌋ represents rounding down.

[0019] This generation of sliding window adaptive unit dynamically monitors recent hit rates and automatically adjusts the cache window width. When the hit rate is high, it appropriately expands the window to improve scheme reuse efficiency, and when the hit rate is low, it promptly shrinks the window to release memory resources. Thus, it autonomously achieves a balance between cache capacity and hit performance during the evolutionary computation process, effectively improving the overall resource utilization efficiency of the system.

[0020] Preferably, the topology-sensitive cumulative hash module includes:

[0021] The topology sorting unit parses the topology matrix of the water project to obtain the upstream and downstream relationships between projects, uses the topology sorting algorithm to generate a project sequence with priority given to upstream projects, and rearranges the original decision vector based on the sequence to generate a rearranged vector.

[0022] The exponentially decaying weighted hash unit divides the rearranged decision vector into multiple data blocks with a fixed block length, assigns a weight to each block that decreases exponentially, calculates the weighted absolute value sum of the decision variable components in each block, and uses an iterative hash formula to accumulate and calculate the hash value block by block. Finally, the hash value is mapped to the hash bucket.

[0023] The load monitoring and rebalancing unit periodically counts the number of cached items in each hash bucket in parallel, calculates the load mean, standard deviation and imbalance. When the imbalance exceeds the threshold, the earliest created cached item is selected from the overloaded bucket and migrated to the bucket with the lowest load.

[0024] The concurrency control unit configures an independent read-write lock mechanism for each hash bucket, supporting concurrent reads and mutually exclusive writes by multiple threads to the same bucket. When performing cross-bucket operations, locks are acquired sequentially in ascending order of bucket index.

[0025] This topology-sensitive cumulative hashing module deeply integrates the spatial relationships of water conservancy projects into the hash calculation process through topology sorting and exponential decay weighting mechanisms, effectively improving the hash aggregation degree of similar scheduling schemes. Combined with the dynamic adjustment capabilities of load monitoring and rebalancing units, it significantly reduces the risk of hash collisions and ensures the balance of data distribution. With the help of fine-grained concurrency control strategies, it ensures the consistency of data operations while supporting high-concurrency access, thereby achieving overall synergistic optimization of cache query efficiency and system throughput.

[0026] Preferably, the exponentially decaying weighted hash unit divides the rearranged decision vector X' = (x'_1, x'_2, ..., x'_{n_var}) into K data blocks of fixed block length B, where x'_i is the decision variable component, n_var is the total number of decision variables, B is the number of decision variables in each block, and K is the total number of blocks. A weight w_k = w_base × exp(-λ(k-1) / (K-1)) is assigned to the k-th block, where w_base is the base weight, λ is the decay coefficient, and k is the block index from 1 to K. When K=1, w_1 = w_base. A weighted absolute sum s_k = Σ(w_k × |x'_i|) is calculated for all decision variable components within the k-th block, where the summation iterates through all decision variable components x'_i in the k-th block using the iterative hash formula h_k = ((h_{k-1} ⊕⌊α_scale × s_k⌋) × p) modulo 1 / 2. 2^W is accumulated block by block, where h_0 is the preset initial value, h_{k-1} is the hash value of the previous block, ⊕ is the bitwise XOR operation, ⌊·⌋ is the floor function, α_scale is the scaling factor, p is a prime number, W is the hash bit width, mod represents the modulo operation, and the final hash value h_final = h_K mod M is mapped to M hash buckets, where M is the number of hash table buckets.

[0027] This exponentially decaying weighted hash unit strengthens the hash contribution of key engineering decision components in the topology through an upstream-first exponentially decaying weight allocation strategy. Combined with iterative weighted hash calculation and prime number modulo mapping, it effectively improves the clustering of similar scheduling schemes in the hash space, significantly enhancing the cache query hit efficiency and overall system performance.

[0028] Preferably, the multi-state hierarchical storage module includes:

[0029] The variable-length allocation unit stores a number of scheduling targets and a corresponding array of target values ​​in each cache entry. The system records the frequency of occurrence of different target numbers by statistically analyzing historical data, sets the most frequently occurring target number as the default allocation length, pre-allocates array space of the default length when creating a new cache entry, and dynamically expands or shrinks the array when the actual number of targets differs from the default length.

[0030] The constraint decomposition storage unit transforms all constraints into a standard form. The total violation is defined as the sum of the violation scores of three types of constraints: volume, flow, and time. The violation score of each type is calculated as the sum of the products of the constraint weights and the violation parts in the constraint index set of that type. The cache item stores the three types of sub-violation scores and the total violation score simultaneously.

[0031] The precise query unit takes the rearranged decision vector as input, calculates the hash value to locate the target cache bucket, supports multi-threaded parallel traversal of cache items within the bucket and calculation of distances, and determines a hit if there is a cache item whose distance is less than the query matching tolerance. Among all hit items, the one with the lowest total violation is selected and the target value and the violation of each constraint are returned.

[0032] This polymorphic hierarchical storage module effectively improves storage efficiency by dynamically optimizing memory allocation based on the number of targets using variable-length allocation units. The constraint decomposition storage unit decomposes the total violation degree according to constraint type, preserving detailed constraint violation information while supporting rapid evaluation. The precise query unit combines hash positioning and parallel matching mechanisms to significantly improve concurrent retrieval performance while ensuring query accuracy. The overall design achieves coordinated optimization of memory usage, query speed, and evaluation accuracy, providing efficient caching and retrieval support for water project scheduling optimization.

[0033] Preferably, the constraint decomposition storage unit uniformly transforms each constraint into the standard form g_j ≤ 0, where g_j is the j-th constraint function value. When g_j > 0, it indicates a constraint violation, and when g_j ≤ 0, it indicates a constraint satisfaction. The total violation degree V_total = V_cap + V_flow + V_temp is defined, where V_cap is the violation degree of volume constraints, V_flow is the violation degree of flow constraints, and V_temp is the violation degree of time-series constraints. The violation degree of each type is calculated as V_type = Σ_{j∈C_type}(w_j × max{g_j, 0}), where C_type is the set of constraints indexes for that type, w_j is the weight coefficient of the j-th constraint, and max{g_j, 0} ensures that only the violated part, i.e., constraints where g_j > 0, is accumulated.

[0034] This constraint decomposition storage unit decomposes the total violation into three categories based on constraint type: volumetric, flow-based, and temporal. It then uses a weighted summation method to quantify the degree of violation for each type of constraint. This not only fully preserves the structured information of constraint violations but also enables a multi-dimensional and refined evaluation of the feasibility of the solution. This provides an efficient quantitative basis for the evolutionary algorithm to quickly screen and compare candidate solutions.

[0035] The water project scheduling optimization method of the present invention includes the following steps:

[0036] Initialization Phase: Input the description of the water engineering scheduling problem, including the number of decision variables, the number of objective functions, and the water engineering topology matrix T. Generate the upstream priority engineering permutation sequence π based on the topology matrix T. Configure the hash table size M, thread buffer capacity C_buf, and initial generation window width w_0. Set hash parameters, window adjustment parameters, decision variable boundaries, tolerance, monitoring parameters, and termination conditions. Initialize the generation counter g_current = 0 and the hit evaluation statistics counter. The hash parameters include the base weight w_base, decay coefficient λ, block length B, bit width W, prime number p, initial value h_0, and scale coefficient α_scale. The window adjustment parameters include the expansion factor α_expand, the shrinkage factor β_shrink, window upper and lower limits w_max and w_min, hit rate thresholds r_high and r_low, and queue length L. The decision variable boundaries are [x_j^{min}, x_j^{max}]; the tolerance includes deduplication tolerance ε_dup and query tolerance ε_match; the monitoring parameters include imbalance threshold δ_max and monitoring period N_monitor; the termination condition includes maximum generation G_max and convergence tolerance ε_conv.

[0037] Parallel Evaluation Phase: After the optimization algorithm generates candidate scheduling schemes, each thread processes them in parallel: First, it checks the boundary constraints of the decision variables. If x_j ∉ [x_j^{min}, x_j^{max}] exists, it returns the maximum penalty target value to the optimization algorithm and skips the candidate scheduling scheme. Schemes that pass the boundary check are rearranged into X' according to the sequence π and the hash value h is calculated to locate the cache bucket. Each thread searches the cache bucket in parallel for cache entries with a distance d = ||X'{cache} - X'||∞ < ε_match. If a match is found, the target value and each violation degree are returned directly. If no match is found, the hydraulic simulator is called to evaluate and obtain the target value and constraint function value {g_j}, and the three types of violations V_cap, V_flow, V_temp and the total violation V_total = V_cap + V_flow + V_temp writes the result, along with the hash value, decision vector, generation identifier, and creation timestamp, to the thread-local buffer. The creation timestamp is recorded as the system time when the cached item was created. When the thread buffer count reaches C_buf, it is batch-flushed to the global queue.

[0038] Batch update phase: The global batch processing unit retrieves data from the queue and performs three-level deduplication in batches: First, it groups the data by hash value h. Then, within the same group, it identifies duplicate records with a distance of ||X'_i - X'_j||_∞ < ε_dup, where X'_i and X'_j are the decision vectors after rearrangement, ||_∞ is the infinity norm, and ε_dup is the deduplication tolerance. Finally, it retains only the record with the smallest V_total in the duplicate set, and inserts it into the hash table in batches after deduplication.

[0039] Generation Advancement Phase: After all solutions for the current generation have been evaluated, increment the generation counter g_current, calculate the failure generation threshold g_expire = g_current - w - 1, and start asynchronous cleanup to remove expired cache entries g_record ≤ g_expire; calculate the current generation hit rate r_current and update the hit rate circular queue of length L, calculate the average hit rate r_avg, and adaptively adjust the window width w according to the relationship between r_avg and the thresholds r_high and r_low;

[0040] Performance monitoring phase: Every N_monitor generation, the load L_i of each cache bucket is statistically analyzed in parallel, the load mean μ_L and standard deviation σ_L are calculated, and the imbalance degree δ = σ_L / max{μ_L, 1} is calculated. When δ > δ_max, the earliest accessed cache item is selected from the overloaded buckets with loads exceeding μ_L + 2σ_L and migrated to the bucket with the lowest load. The historical frequency of the target number is updated periodically and the default allocation length n_default is recalculated.

[0041] Termination of output phase: After reaching the maximum generation G_max or the convergence condition, refresh all thread buffers and complete the last batch update. Output the optimal scheduling scheme X_opt and its target value, the degree of violation of each constraint, the flow process of key sections, and output performance statistics including cache hit rate, the number of hydraulic simulator calls saved, and the total number of evaluations, and release system computing resources.

[0042] This invention lays the foundation for efficient caching through upstream-priority topology sorting and parameter configuration in the initialization phase; in the parallel evaluation phase, boundary pre-verification and hashing accelerate queries, significantly reducing invalid computations and simulator calls; the three-level deduplication mechanism in the batch update phase effectively improves cached data quality; adaptive window adjustment and asynchronous cleanup in the generational advancement phase achieve dynamic optimization of cache capacity; and load balancing and frequency statistics in the performance monitoring phase further ensure system stability and memory efficiency. The entire method deeply integrates the topological characteristics and evolutionary computational laws of water engineering, achieving a synergistic improvement in cache hit rate, parallel efficiency, and memory utilization on a domestic computing platform, providing an efficient and reliable solution to complex water engineering scheduling optimization problems.

[0043] Preferably, the hydraulic simulator is based on the basic principles of hydrology, hydraulics and water resources, and conducts scheduling simulation for complex water engineering systems such as reservoir groups, dam groups, pumping station groups and water conveyance canal systems. It includes hydraulic calculation processes for water engineering regulation, river flow evolution and canal flow propagation, and evaluates target values ​​and constraint function values ​​for scheduling objectives and constraints after the calculation.

[0044] Based on the principles of hydrology and hydrodynamics, this hydraulic simulator accurately simulates the regulation process and water flow evolution of complex water engineering systems such as reservoirs, dams, pumping stations, and canal systems. It provides reliable target values ​​and constraint satisfaction assessments for scheduling schemes, and provides a solid physical foundation and quantitative basis for optimization algorithms.

[0045] Preferably, in the generational advancement stage, the specific method for adaptively adjusting the window width w is as follows: when r_avg exceeds the high threshold r_high, the window width is expanded by w_new = min(⌈w_old × α_expand⌉, w_max); when r_avg is lower than the low threshold r_low, the window width is reduced by w_new = max(⌊w_old × β_shrink⌋, w_min); and when r_avg is neither higher than r_high nor lower than r_low, w remains unchanged.

[0046] This adaptive window adjustment mechanism dynamically responds to changes in historical hit rates. When the hit rate is high, it automatically expands the window to improve the efficiency of solution reuse, and when the hit rate is low, it shrinks the window in time to release system resources. In this way, it autonomously achieves the best balance between cache retention strategy and solution efficiency during the evolution and optimization process, effectively improving the overall system performance and resource utilization.

[0047] Beneficial Effects: Compared with existing technologies, this invention has the following significant advantages: 1. Parallel pre-verification and deduplication are achieved through constraint-driven asynchronous hierarchical caching, collisions are reduced through topology-sensitive cumulative hashing, and fast and accurate queries are achieved through polymorphic hierarchical storage. The three modules work together to effectively balance high hit rate, low memory consumption, and high concurrency performance under the constraints of domestic computing power, supporting the efficient optimization and solution of water engineering scheduling schemes; 2. A cumulative hashing mechanism based on water engineering topology is adopted, which prioritizes upstream rearrangement of decision vectors and assigns exponential decay weights, effectively reducing hash collisions, improving cache query efficiency, and thus improving the overall hit rate; 3. By decomposing constraint violations into volume, flow, and time series classes and storing them hierarchically, the target value and various violation degrees can be directly returned after a query hit, avoiding repeated calls to the hydraulic simulator and reducing computational overhead; 4. Combining a generational sliding window mechanism and an asynchronous architecture with thread-local buffering, the window width is dynamically adjusted according to the hit rate, expired caches are cleaned up in parallel, memory utilization is optimized, and multi-threaded concurrency performance is improved. Attached Figure Description

[0048] Figure 1 This is a schematic diagram of the system structure of the present invention;

[0049] Figure 2 This is a schematic diagram of the method flow of the present invention;

[0050] Figure 3 The graph shows the hit rate of different caching schemes of the present invention as a function of generation. Detailed Implementation

[0051] The technical solution of the present invention will be further described below with reference to the accompanying drawings.

[0052] This embodiment provides an intelligent parallel caching system and optimization method for water project scheduling in smart water conservancy, such as... Figure 1 As shown, the system consists of three parts: a constraint-driven asynchronous hierarchical cache module, a topology-sensitive cumulative hash module, and a polymorphic hierarchical storage module.

[0053] The technical solution of the present invention is as follows:

[0054] (a) Constraint-driven asynchronous hierarchical caching module

[0055] This module adopts a three-level architecture of thread-local buffer, global batch processing, and generational sliding window. It drives cache admission through constraint pre-verification and completes data updates asynchronously in batches.

[0056] 1. Thread-local buffer unit

[0057] Allocate a fixed-capacity buffer of size C_buf to each parallel thread to store cached data. C_buf is the maximum number of data entries that the buffer can store. This parameter needs to be balanced between refresh frequency and visibility latency. A value that is too small will lead to frequent refreshes, increasing queue operation overhead; a value that is too large will prolong the time it takes for data to be visible to other threads, affecting query performance. In practical applications, C_buf is typically set between 100 and 500 entries.

[0058] The buffer contains hash values, decision vectors, target value arrays, violation rates of the three types of constraints and total violation rate, generation identifiers, and creation timestamps. The creation timestamp records the system time when the cached item was written and remains constant throughout the cached item's lifetime. A counter tracks the amount of data stored; when the counter reaches C_buf, a batch flush to the global queue is triggered. Threads operate autonomously within independent buffers, only briefly accessing the shared queue during flushes, significantly reducing lock contention.

[0059] 2. Boundary constraint pre-verification unit

[0060] Boundary checks are performed on the decision vector (denoted as X, representing the values ​​of a set of scheduling decision variables) X = (x_1, x_2, ..., x_{n_var}) of the cache scheduling scheme, where n_var is the total number of decision variables and x_j is the j-th decision variable.

[0061] The decision variables for water project scheduling have clear physical meanings and value ranges. The outflow from the reservoir during a given period is constrained by the capacity of the flood discharge facilities, with the minimum ecological flow and the full-opening gate discharge capacity forming its upper and lower limits. The water storage capacity of the water project is controlled by its characteristic reservoir capacity. The water distribution through channels is constrained by the water conveyance cross-section and hydraulic conditions.

[0062] Each x_j is checked to see if it falls within its allowed range [x_j^{min}, x_j^{max}]. If any x_j is outside the allowed range, the scheduling scheme is considered physically infeasible and has no cache value; therefore, it is rejected from cache and a boundary violation flag is returned. Boundary pre-checking drives the cache admission control mechanism, ensuring that cache space is used to store valuable feasible or near-feasible solutions.

[0063] 3. Global Batch Processing Unit

[0064] Maintain a concurrent and safe queue to receive data batches refreshed by each thread, and execute a three-level deduplication process sequentially.

[0065] The first level groups the data by hash value. Schemes with the same hash value are grouped together, and the initial screening is completed by using the fact that equal hash values ​​are a necessary condition for duplication.

[0066] The second level identifies duplicate records within the same group whose decision vector distance is less than the deduplication tolerance ε_dup. ε_dup is the distance threshold for determining the similarity of two decision vectors, calculated using the infinity norm, which is the maximum absolute value of the differences between the components. The dimensions and numerical ranges of scheduling decision variables vary considerably, with flow rates measured in m³ / s, water levels in meters, and reservoir capacity in millions of m³, typically ranging from 0.001 to 100. An excessively small ε_dup leads to similar schemes being cached multiple times, while an excessively large ε_dup results in misclassifying differing schemes as duplicates.

[0067] The third level retains only the record with the smallest total violation V_total among duplicate records. Solutions with lower constraint violation rates are closer to the feasible region and have higher reference value in optimization iterations. The deduplication strategy ensures the quality of solutions within the cache.

[0068] After deduplication, the data is inserted into the hash table in batches. Batch operations reduce the number of lock acquisitions and releases, thus improving concurrency efficiency.

[0069] 4. Adaptive sliding window unit

[0070] Maintain a circular queue of recent hit rates of length L, where L is the number of hit rate data items the queue can store. At the end of each generation, calculate the hit rate of that generation and update the queue, and calculate the average hit rate r_avg.

[0071] When r_avg exceeds the high threshold r_high, the population search has converged to a local region, increasing the probability of historical solutions being repeatedly queried. Therefore, the window should be expanded to retain more generational data. The generational window width is expanded by w_new = min(⌈w_old × α_expand⌉, w_max). Here, w_old is the current window width, w_new is the adjusted window width, α_expand > 1 is the expansion factor, w_max is the upper limit of the window width, and ⌈·⌉ indicates rounding up. α_expand is between 1.2 and 1.5, and rounding up ensures the window increases by at least one generation. w_max is determined based on available memory capacity and typically does not exceed 20% to 30% of the total generations.

[0072] When r_avg is below the low threshold r_low, the population is exploring new regions, reducing the reuse of old schemes, and the window should be reduced to free up memory space. The generational window width is reduced by w_new = max(⌊w_old × β_shrink⌋, w_min). Here, β_shrink ∈ (0,1) is the reduction factor, w_min is the lower limit of the window width, and ⌊·⌋ represents rounding down. β_shrink is between 0.7 and 0.9, rounding down while ensuring the window is not smaller than w_min. w_min is typically set to 3 to 5 generations to retain the most recent data.

[0073] Maintain a reasonable interval between the thresholds r_high and r_low (e.g., a span of 0.4 to 0.7) to avoid frequent fluctuations in the window width. The queue length L should be between 5 and 20; too small a value will result in an overly sensitive response, while too large a value will lead to slow adaptation.

[0074] 5. Batch Asynchronous Cleanup Unit

[0075] When the generation increments, update the current generation identifier g_current, and calculate the expiration generation threshold g_expire = g_current - w - 1, where w is the current window width. Perform a parallel traversal of the hash table, removing all expired cached entries with generation identifier g_record ≤ g_expire.

[0076] The cleanup operation is performed asynchronously in a separate thread, without blocking the ongoing algorithm evaluation thread, thus ensuring the continuity of the optimization algorithm flow. Asynchronous mechanisms are a key technique for achieving high concurrency in a three-tier architecture. While the cleanup process still requires acquiring write locks when accessing the hash bucket, the impact on parallel performance is limited due to batch deletion and its separation from the evaluation thread's timing.

[0077] (ii) Topology-sensitive cumulative hash module

[0078] This module rearranges and groups decision vectors based on the spatial topological relationship between upstream and downstream water projects, reflecting the upstream-dominant physical characteristics in hash calculation.

[0079] 1. Topological sorting unit

[0080] The upstream and downstream relationships between water conservancy projects are obtained by analyzing the topology matrix T, where T is a matrix describing the upstream and downstream connections between various water conservancy projects. The matrix depicts the flow transmission path between the projects. Cascade water conservancy projects have a series topology, and irrigation canal systems may include parallel branching and confluence.

[0081] A topological sorting algorithm is used to generate an engineering sequence π that prioritizes upstream projects. For topologies containing loops, such as loops formed by branching and then rejoining in a canal system, strongly connected components are first identified and arranged in ascending order by unique identifiers within each component to form subsequences. Then, a topological sort is performed between the components, ultimately expanding into a complete engineering sequence π.

[0082] The original decision vector X is rearranged based on the sequence π to generate a rearranged vector X'. The rearranged decision vector is organized according to the spatial order of water flow from upstream to downstream, providing a basis for subsequent segmented weighted hash calculations.

[0083] 2. Exponentially Decaying Weighted Hash Unit

[0084] The rearranged decision vector X' = (x'_1, x'2, ..., x'{n_var}) is divided into K data blocks of fixed block length B, where B is the number of decision variables in each block and K is the total number of blocks. The block length B needs to balance hash precision and computational cost; in practice, B is taken from 5 to 20. When the total number of decision variables is small, resulting in K=1, all variables are grouped into a single data block. In this case, w_1 = w_base, and the hash calculation degenerates into a weighted average method.

[0085] Assign a weight to the k-th block: w_k = w_base × exp(-λ(k-1) / (K-1)), where w_base is the base weight, λ is the decay coefficient, and k is the block index from 1 to K. When K=1, let w_1 = w_base. The base weight w_base is usually set to 1.0. The decay coefficient λ controls the rate of weight reduction, ranging from 2 to 4. If λ is too large, it will lead to insufficient weight in downstream engineering decisions, affecting hash quality.

[0086] The exponentially decaying weight design reflects the upstream-dominant nature of water project scheduling. Upstream water project discharge decisions are transmitted downstream through river confluence, affecting downstream inflow conditions and scheduling space. Upstream premature reservoir emptying increases downstream flood control pressure, while increased upstream water storage reduces downstream inflow. Downstream scheduling typically has no reverse effect on upstream. Therefore, when assessing the similarity of scheduling schemes, upstream decision variables should have a higher weight.

[0087] Calculate the weighted absolute sum s_k = Σ(w_k × |x'_i|) for all decision variable components within the k-th block, where the summation iterates through all decision variable components x'_i contained in the k-th block.

[0088] The iterative hash formula h_k = ((h_{k-1} ⊕ ⌊α_scale × s_k⌋) × p) mod 2^W is used to accumulate hashes block by block, where h_0 is the preset initial value, h_{k-1} is the hash value of the previous block, ⊕ is the bitwise XOR operation, ⌊·⌋ is the floor function, α_scale is the scaling factor, p is a prime number, W is the hash bit width, and mod represents the modulo operation.

[0089] The iterative formula accumulates the sum through the following steps: First, the weighted sum s_k is multiplied by the scaling factor α_scale and rounded down to an integer. α_scale is set according to the range of variable values ​​to ensure the scaled value falls within an appropriate order of magnitude. Then, a bitwise XOR operation is performed with the previous hash value h_{k-1}. This XOR operation fully mixes the values ​​at the bit level, introducing non-linear diffusion. Next, it is multiplied by a prime number p for further diffusion. Prime numbers are typically 31, 37, or larger prime numbers such as 10007. Finally, the result is modulo 2^W to limit it to a W-bit integer range, where W is 32 or 64 bits. The initial value h_0 can be a prime number such as 7919.

[0090] After K iterations, h_K is obtained. The final hash value h_final = h_K mod M is mapped to M hash buckets, where M is the number of hash table buckets. M is usually a power of 2, such as 65536 or 262144, to facilitate optimization of the modulo operation through bitwise operations.

[0091] 3. Load monitoring and rebalancing unit

[0092] Periodically count the number of cached items L_i in each hash bucket in parallel, where L_i is the number of cached items contained in the i-th bucket. Calculate the load mean μ_L and standard deviation σ_L, and define the imbalance δ = σ_L / max{μ_L, 1}. Take max{μ_L, 1} as the denominator to avoid δ tending to infinity when μ_L is close to 0.

[0093] When δ exceeds the threshold δ_max, it is considered that the load distribution is uneven and needs to be rebalanced. Sort the overloaded buckets with load exceeding μ_L + 2σ_L in ascending order of the creation timestamp, select the part of the cache entries that are the earliest created, i.e., the first created ones, recalculate the hash values and migrate them to the bucket with the lowest load. The reason for choosing the earliest accessed items is that such items have low activity, and the impact on query performance after migration is small. The migration operation involves locking the source bucket and the target bucket, and a parallel method is used to process multiple overloaded buckets simultaneously to improve the rebalancing efficiency.

[0094] 4. Concurrency Control Unit

[0095] Configure an independent read-write lock mechanism for each hash bucket, which supports concurrent reading and mutually exclusive writing of the same bucket by multiple threads. The read-write lock allows multiple threads to obtain the read lock simultaneously to execute query operations, but write operations (insertion, deletion, update) must obtain the write lock and be executed mutually exclusively.

[0096] When performing cross-bucket operations, obtain locks in ascending order of the bucket index to avoid deadlocks. Suppose a thread needs to access bucket i and bucket j simultaneously and i < j, and uniformly lock bucket i first and then bucket j. All threads following the same locking order can avoid the deadlock problem caused by circular waiting.

[0097] (III) Polymorphic Hierarchical Storage Module

[0098] This module designs the storage structure according to the characteristics of variable number of multi-objective optimization targets and diverse constraint types.

[0099] 1. Variable-Length Allocation Unit<element>[ / >]

[0100]

[0100] Each cache entry stores the field n_obj representing the number of scheduling targets and the corresponding target value array, where n_obj represents the number of objective functions of this scheduling scheme. The system records the occurrence frequencies of different target numbers by counting historical data, and sets the most frequently occurring target number as the default allocation length n_default.

[0101] When creating a new cache entry, pre-allocate an array space with a length of n_default. When the actual number of targets n_obj is different from n_default, dynamically expand or shrink the array. If n_obj = n_default, the array size is just right and no adjustment is needed; if n_obj < n_default, although there is waste of extra space, no action is required; if n_obj > n_default, the array is dynamically expanded and the existing data is copied. The number of targets of most optimization tasks concentrates on several typical values, and this strategy can avoid the expansion overhead in most cases.

[0102] 2. Constraint Decomposition Storage Unit

[0103] All constraints are uniformly transformed into the standard form g_j ≤ 0, where g_j is the value of the j-th constraint function. When g_j > 0, it indicates a constraint violation; when g_j ≤ 0, it indicates a constraint satisfaction. The sign of the constraint function value directly reflects the degree of violation.

[0104] Define the total violation rate as V_total = V_cap + V_flow + V_temp, where V_cap is the violation rate of volumetric constraints, V_flow is the violation rate of flow constraints, and V_temp is the violation rate of time-series constraints.

[0105] Volume constraints require that the reservoir capacity of water projects remain within a reasonable range at all times. Below dead storage capacity, normal water intake and supply are impossible; exceeding the reservoir capacity corresponding to the design check flood level increases flood control risk and may even threaten dam safety. Flow constraints include outflow not exceeding the flood discharge facility capacity (maximum discharge capacity under fully open gate conditions), downstream control section flow meeting the safe discharge corresponding to flood control standards, headworks water intake meeting flow capacity and irrigation district water distribution plans, etc. Temporal constraints involve operational rules, such as limiting the number of times gates are opened and closed per day to reduce equipment wear, controlling water level fluctuations between adjacent periods to prevent bank instability, and constraining the power output variation rate of hydropower stations to maintain grid stability, etc.

[0106] The violation degree for each type is calculated as V_type = Σ_{j∈C_type}(w_j × max{g_j, 0}), where C_type is the set of constraints for that type, w_j is the weight coefficient of the j-th constraint, and max{g_j, 0} ensures that only the violations of constraints (i.e., g_j > 0) are accumulated. The weight coefficient reflects the importance level of the constraint; flood control safety constraints typically have a higher weight than beneficial load constraints.

[0107] The cached entries simultaneously store the violation scores for all three categories and the total violation score for fast lookup. Upon a successful cache hit, not only can the objective function value be obtained, but the satisfaction status of various constraints can also be directly retrieved without needing to re-invoke the constraint evaluation module.

[0108] 3. Precise Query Unit

[0109] The query input is the rearranged decision vector X'query. The hash value h_query is calculated to locate the target cache bucket. Multi-threaded parallel traversal of cached items within the bucket and calculation of distance d = ||X'{cache} - X'query||_∞, where ||·||_∞ represents the infinity norm, i.e., the maximum absolute value of the differences between the vector components.

[0110] If a cached entry exists where d < ε_match, it is considered a hit. Here, ε_match is the query matching tolerance and satisfies ε_match ≤ ε_dup to ensure that the query strictness is not lower than the deduplication strictness. This constraint ensures that the query phase will not misclassify schemes that were determined to be different during deduplication as the same, maintaining the consistency of the caching logic.

[0111] Select the item with the smallest V_total from all hits and return its target value and the degree of constraint violation. Solutions with lower constraint violation degrees are closer to the feasible region and have higher optimization reference value. If no item in the bucket meets the conditions, return a "missed" flag.

[0112] (iv) System-based optimization methods

[0113] like Figure 2 As shown, the water project scheduling optimization method based on the above-mentioned caching system includes the following steps.

[0114] S1: Initialization Phase

[0115] The input description of the water project scheduling problem includes the number of decision variables, the number of objective functions, and the water project topology matrix T. The number of decision variables corresponds to the degrees of freedom of the scheduling scheme, such as the total number of variables for the joint scheduling of water projects in the water project group at each time period, and the water level at the end of each time period.

[0116] Generate an upstream-first project permutation sequence π based on the topology matrix T. Configure the hash table size M, thread buffer capacity C_buf, and initial generation window width w_0.

[0117] Set the hash parameters (base weight w_base, decay coefficient λ, block length B, bit width W, prime number p, initial value h_0, scaling factor α_scale). The base weight w_base is usually 1.0, the decay coefficient λ is 2 to 4, the block length B is 5 to 20, the hash bit width W is 32 or 64, the prime number p is 31, 37 or 10007, etc., the initial value h_0 is a prime number such as 7919, and the scaling factor α_scale is set according to the magnitude of the decision variables.

[0118] Set the window adjustment parameters (expansion factor α_expand, shrinkage factor β_shrink, upper and lower window limits w_max and w_min, hit rate thresholds r_high and r_low, queue length L). The expansion factor α_expand is set to 1.2 to 1.5, the shrinkage factor β_shrink to 0.7 to 0.9, the upper window limit w_max not exceeding 20% ​​to 30% of the total generations, the lower window limit w_min to 3 to 5, the high threshold r_high to 0.6 to 0.8, the low threshold r_low to 0.2 to 0.4, and the queue length L to 5 to 20.

[0119] Define the decision variable boundaries [x_j^{min}, x_j^{max}], tolerances (dup tolerance for deduplication ε_dup, query tolerance ε_match), monitoring parameters (imbalance threshold δ_max, monitoring period N_monitor), and termination conditions (maximum generation G_max, convergence tolerance ε_conv).

[0120] Initialize the generation counter g_current = 0 and the hit evaluation statistics counter.

[0121] S2: Parallel Evaluation Phase

[0122] After the optimization algorithm generates candidate scheduling schemes, each thread processes them in parallel.

[0123] First, check the boundary constraints of the decision variables. If x_j ∉ [x_j^{min}, x_j^{max}] exists, then return the maximum penalty objective value to the optimization algorithm and skip that solution. The maximum penalty objective value is a value much larger than the normal objective value to guide the optimization algorithm to avoid this region. The maximum penalty value is usually taken as 10^3 to 10^6 times the normal objective value to ensure that the optimization algorithm eliminates solutions outside the boundary during the selection operation.

[0124] The scheme, which uses boundary checks, rearranges the sequence π into X' and calculates the hash value h to locate the cache bucket. Each thread queries the cache bucket in parallel for entries with a distance d = ||X'{cache} - X'||_∞ < ε_match. During parallel queries, multiple threads can simultaneously acquire read locks on the same bucket to perform matching calculations, fully utilizing multi-core computing power.

[0125] If a hit occurs, the cached target value and each violation degree are returned directly. If a miss occurs, the hydraulic simulator is called to evaluate and obtain the target value and constraint function value {g_j}. The three types of violations, V_cap, V_flow, and V_temp, and the total violation degree V_total = V_cap + V_flow + V_temp, are calculated. The results, along with the hash value, decision vector, generation identifier g_current, and creation timestamp, are written to the thread-local buffer, where the creation timestamp records the system time when the cache entry was created. When the thread buffer count reaches C_buf, it is batch-flushed to the global queue.

[0126] The hydraulic simulator, based on the fundamental principles of hydrology, hydraulics, and water resources, conducts scheduling simulations for complex water engineering systems such as reservoir groups, dam groups, pumping station groups, and water conveyance canal systems. This includes a series of hydraulic calculations: water engineering regulation calculations (calculating scheduling indicators such as inflow / outflow, storage capacity, water supply, ecological discharge, and power generation based on water engineering scheduling rules and inflow or water level processes); river flow evolution (calculating flow evolution based on river cross-sectional morphology and roughness); and canal system flow propagation (calculating flow distribution at canal system nodes based on canal topology, water conveyance capacity, and water intake / exit processes). After the calculations, the simulator evaluates the target values ​​and constraint function values ​​based on the scheduling objectives and constraints.

[0127] S3: Batch Update Phase

[0128] The global batch processing unit retrieves data from the queue and performs three-level deduplication in batches. First, it groups the data by hash value h. Then, within each group, it identifies duplicate records whose distance from ||X'_i - X'j||_∞ < ε_dup. Finally, it retains only the record with the smallest V_total from the duplicate set. After deduplication, the data is batch-inserted into the hash table.

[0129] S4: Generation Advancement Phase

[0130] After all solutions for the current generation have been evaluated, increment the generation counter g_current. Calculate the expiration generation threshold g_expire = g_current - w - 1 and initiate asynchronous cleanup to remove expired cache entries where g_record ≤ g_expire.

[0131] The current hit rate r_current is calculated and a circular hit rate queue of length L is updated. The average hit rate r_avg is then calculated. Based on the relationship between r_avg and the thresholds r_high and r_low, the window width w is adaptively adjusted using the formula w_new = min(⌈w_old × α_expand⌉, w_max) or w_new = max(⌊w_old × β_shrink⌋, w_min). w remains unchanged when r_avg is neither greater than r_high nor less than r_low.

[0132] S5: Performance Monitoring Phase

[0133] Every N_monitor generations, the load L_i of each cache bucket is statistically analyzed in parallel. The mean load μ_L and standard deviation σ_L are calculated, and the imbalance degree δ = σ_L / max{μ_L, 1} is calculated. When δ > δ_max, the earliest accessed cache item is selected from the overloaded buckets with a load exceeding μ_L + 2σ_L and migrated to the bucket with the lowest load.

[0134] The system periodically updates the historical frequency of the number of targets and recalculates the default allocation length n_default. It adjusts n_default based on the distribution of the number of targets in optimization tasks over a recent period to adapt it to the current application scenario.

[0135] S6: Termination of Output Phase

[0136] Once the maximum number of generations G_max is reached or the convergence condition is met, all thread buffers are flushed and the final batch update is completed. The convergence condition can be that the improvement in the target value is less than the tolerance ε_conv for several consecutive generations, or that the population diversity index drops below a threshold.

[0137] Output the optimal scheduling scheme X_opt and its objective value, constraint violation degree, and critical section flow process. The output scheme includes the specific scheduling decisions for each water project at each time period. The objective value reflects the comprehensive benefits of the scheme, the constraint violation degree indicates the scheme's satisfaction of various constraints, and the critical section flow process is used to determine the hydraulic response characteristics of the scheme.

[0138] The output performance statistics include cache hit rate, saved hydraulic simulator calls, and total evaluation count. Cache hit rate = number of hits / number of queries; saved simulator calls = number of hits; total evaluation count includes the sum of actual simulator calls and cache hits. These performance statistics are used to evaluate the acceleration effect of the caching system.

[0139] Release system computing resources. This includes releasing memory space occupied by hash tables, thread buffers, pending queues, circular queues, and other data structures.

[0140] The following example illustrates the solution.

[0141] 1. Project Background

[0142] This embodiment uses a cascade reservoir system on a tributary of the Yangtze River as an example to verify the application of the buffer system of the present invention in the optimization of flood control scheduling during the flood season. The cascade is located on a tributary in the middle reaches of the Yangtze River, controlling a drainage area of ​​approximately 4800 km², and consists of the upstream GS reservoir and the downstream HK reservoir connected in series.

[0143] The GS Reservoir controls a catchment area of ​​2950 km² upstream of the dam site, with a normal water level of 208.0 m, a flood control limit of 204.0 m, a total storage capacity of 150 million m³, a flood control capacity of 48 million m³, and an installed capacity of 75 MW. The HK Reservoir is located approximately 38 km downstream of the GS Reservoir, controlling a catchment area of ​​3900 km², with a normal water level of 165.0 m, a flood control limit of 162.0 m, a total storage capacity of 72 million m³, a flood control capacity of 25 million m³, and an installed capacity of 42 MW. The flood propagation time in the river channel between the two reservoirs is approximately 5 hours, and the catchment area between them is approximately 950 km².

[0144] The scheduling task is to respond to a typical historical flood during a flood control drill. Based on hydrological calculations, the typical historical flood lasts 60 hours, with a peak inflow of 4600 m³ / s into the GS Reservoir and a flood volume of approximately 420 million m³. The scheduling period is divided into 20 3-hour periods, with 40 decision variables: the outflow from each reservoir during each period. The optimization objectives include minimizing the highest flood control level of each reservoir and maximizing the total power generation of the cascade system. Key constraints include: reservoir capacity constraints—water levels in each period must not exceed the design flood level or fall below the dead water level; flow constraints—the maximum discharge capacity of the GS Reservoir is 7200 m³ / s, the HK Reservoir is 4500 m³ / s, and the flow at the downstream urban flood control section of the HK Reservoir must not exceed 5500 m³ / s; and time constraints—water level fluctuations between adjacent periods must not exceed 0.5 m, and the outflow rate must not exceed 30%.

[0145] The optimization calculation employs the NSGA-II multi-objective evolutionary algorithm, with a population size of 350 individuals and 180 generations. A maximum of 63,000 scheduling schemes need to be evaluated, and the maximum computation time is expected to be substantial. The computing platform is a domestically produced server configured with a 16-core processor and 64GB of memory, using 16 threads for parallel evaluation. The evaluation of a single scheduling scheme includes steps such as reservoir water balance calculation, Muskinguistic flood evolution, gate discharge capacity verification, power generation output calculation, and power generation statistics. The average time for serial computation is approximately 0.15 seconds.

[0146] 2. System Configuration

[0147] According to the technical solution of the present invention, the following configuration is made for the characteristics of this ladder.

[0148] (1) Topology-Sensitive Hash Module. A 2×2 topology matrix T is constructed, and the engineering sequence π = [GS, HK] is obtained by topological sorting. The decision vector is rearranged according to this sequence. Hash parameter settings: base weight w_base = 1.0, decay coefficient λ = 2.25, block length B = 10. The 40-dimensional decision vector is divided into 4 data blocks. The weight of each block is calculated according to the exponential decay formula. The upstream GS reservoir corresponds to the first 2 blocks with higher weights, and the downstream HK reservoir corresponds to the last 2 blocks with lower weights. This setting mainly considers the leading role of the upstream reservoir in the cascade scheduling scheme. Hash bit width W = 32 bits, prime number p = 10007, initial value h_0 = 7919, scale coefficient α_scale = 100, number of hash table buckets M = 32768, which is determined based on the estimated cache size and memory capacity.

[0149] (2) Constraint-driven caching module. Window adjustment parameters: initial window width w_0 = 5, expansion factor α_expand = 1.3, shrinkage factor β_shrink = 0.8, upper window limit w_max = 36 (approximately 20% of total generations), lower window limit w_min = 3, high threshold r_high = 0.68, low threshold r_low = 0.32, hit rate queue length L = 10, thread local buffer capacity C_buf = 150. The decision variable boundaries are set according to the flood discharge capacity of each database. The outflow range of the GS database is 800 ~ 7200 m³ / s, and that of the HK database is 500 ~ 4500 m³ / s. Deduplication tolerance ε_dup = 1, query tolerance ε_match = 0.5.

[0150] (3) Polymorphic storage module. The number of objective functions in this problem is 3, and the system sets the default allocation length n_default to 3. Monitoring parameters: load imbalance threshold δ_max = 0.75, monitoring period N_monitor = 20 generations. The constraint weight coefficients are set according to the actual importance of the project. The weight of reservoir capacity constraint and control section flow constraint is 1.0, and the weight of time-series constraints such as water level fluctuation and flow rate change is 0.5.

[0151] 3. Calculation process and results

[0152] The optimization calculation is performed according to the six stages of the method of this invention. In the initial population of 350 schemes in the first generation, boundary pre-verification identified 21 schemes with outflow exceeding the limit (exceeding the gate's maximum discharge capacity or falling below the minimum discharge flow). For these schemes, a maximum penalty target value (set to 1×10) is directly returned. 6 The 329 pre-validated schemes were evaluated using a hydraulic simulator. The evaluation results were written to a thread-local buffer, and after a batch update, the cache system stored 329 records. Since there was no existing cache available for the first generation, the hit rate was 0.

[0153] Starting with generation 2, caching gradually takes effect. Of the 350 candidate solutions in generation 2, 18 were rejected by boundary pre-checking, while the remaining 332 solutions entered the precise query process. Each thread queried in parallel within its corresponding hash bucket, hitting 48 solutions. For the 284 solutions that missed, the hydraulic simulator was used for evaluation to obtain target values ​​and constraint function values. The hit rate for this generation was r_current = 48 / 332 = 14.5%. The global batch processing unit performed three-level deduplication on the 284 newly evaluated solutions: first, grouping by hash value; then, identifying 19 pairs of approximately duplicate solutions within each group whose distance was less than the deduplication tolerance ε_dup; and retaining the record with the smaller total violation V_total in each pair of duplicate solutions. After deduplication, 265 new records were actually inserted. During the generation advancement phase, the average hit rate was calculated to be r_avg = 14.5%, without triggering the window adjustment threshold, and the window width remained unchanged at w = 5.

[0154] From generation 3 to generation 179, the scheduling scheme was iteratively optimized following a similar process to generation 2. During this process, the cache hit rate remained high, exhibiting a fluctuating trend. Generation 180 reached the preset termination condition, ending the optimization calculation. Statistical data for the entire process: a total of 63,000 candidate schemes were identified, 3,312 were rejected during boundary pre-validation (approximately 5.5%), 59,688 schemes entered the query process, 30,542 were cache hits, and the actual simulator evaluation was performed 29,146 times, resulting in an overall hit rate of 51.2%. Without the caching system, the hydraulic simulator would have required 59,688 calls; the caching system significantly reduced the number of simulator calls, correspondingly saving computation time.

[0155] 3. Performance Analysis

[0156] To evaluate the performance of the caching system of this invention, two control schemes were set up for comparative experiments: Control 1 adopted the classic LRU (Least Recently Used) caching strategy, in which old records are evicted based on access timestamps, and the cache capacity is the same as that of this invention; Control 2 adopted the classic hash caching strategy, without considering the topological relationship to equally weight each decision variable. The three schemes were run on the same hardware platform, with the same optimization algorithm and parameter settings. A comparison of cache hit rates is shown below. Figure 3 The hit rate curve of this invention significantly surpasses other control schemes after the 25th generation, and remains at a high level during the convergence phase of the algorithm from the 70th to the 120th generation. It is speculated that the hit rate decreases slightly after the 120th generation when exploring new search regions, but it is still slightly better than the control schemes. Overall, on average, the hit rate of this invention is 14.4 percentage points higher than the classic LRU scheme and 5.9 percentage points higher than the classic hash scheme.

[0157] The LRU scheme, due to its timestamp-based elimination strategy, cannot effectively identify topological similarity in the solution space, resulting in a relatively low hit rate. While classical hashing employs a hashing mechanism, it does not consider upstream and downstream relationships in water engineering projects, making it less effective than the topology-sensitive hashing method of this invention in similarity identification.

[0158] 4. Scheduling Result Analysis

[0159] Optimization calculations yielded 46 Pareto front non-dominated solutions, providing decision-makers with a variety of scheduling options. From the overall distribution of the Pareto fronts of the optimized scheduling schemes, all schemes are feasible and satisfy all constraints. Specifically, the highest flood level of the GS reservoir ranges from 204.1 to 206.5 m, the highest flood level of the HK reservoir ranges from 162.8 to 165.2 m, and the total power generation of the cascade ranges from 6.58 million to 6.99 million kWh. The front solutions are relatively evenly distributed, but there are significant differences between the schemes.

[0160] It should be noted that the actual application effect of the caching system is affected by various factors, including the scale and complexity of the scheduling problem, the convergence characteristics of the optimization algorithm, the time consumption of a single hydraulic simulation evaluation, and the rationality of the caching system parameter configuration. For different water engineering scheduling problems, parameter configuration needs to be adjusted according to specific circumstances. Overall, this invention provides a feasible technical means to offer certain technical support for business applications with high timeliness requirements, such as flood season emergency scheduling, under the current conditions of limited computing power on domestic platforms.

Claims

1. A smart parallel caching system for water project scheduling in smart water conservancy, characterized in that, include: The constraint-driven asynchronous hierarchical caching module is used to adopt a three-level architecture of thread-local buffering, global batch processing and generational sliding window. It supports multi-threaded parallel execution of decision variable boundary constraints on input scheduling schemes and rejects schemes that do not meet the boundary requirements from entering the cache. The topology-sensitive cumulative hash module is used to rearrange and group decision vectors according to the spatial topology relationship between upstream and downstream water projects. Upstream project decision components participate in hash calculation first and are given higher weights. The weights decrease exponentially with the project location. The segmented hash values ​​are iteratively generated by XORing the weighted sum of the previous segment hash result and the current segment bitwise and then multiplying by a prime number and taking the modulo. The polymorphic hierarchical storage module is used to dynamically allocate target number segments and target value arrays of corresponding lengths for each cache item. The default allocation length is optimized based on the frequency of occurrence of the target number. It stores the constraint violation scores and total violation scores of three categories: volume, flow, and time series. During the query, the cache bucket is located based on the hash value and multi-threaded parallel execution of decision vector precise matching within the bucket is supported. When a match is found, the cached target value and each constraint violation score are returned directly. The constraint-driven asynchronous hierarchical caching module includes: The thread-local buffer unit allocates a fixed-capacity independent buffer to each parallel thread to store cached data. The buffer content includes hash value, decision vector, target value array, three types of constraint violation degree and total violation degree, generation identifier and creation timestamp. A counter is used to record the amount of data stored. When the counter reaches the capacity limit, a batch refresh to the global queue is triggered. The boundary constraint pre-verification unit performs boundary checks on the decision vector of the cache scheduling scheme. If any decision variable is outside the allowed range, the cache is rejected and a boundary violation flag is returned. The global batch processing unit maintains a concurrent and safe queue to receive data batches refreshed by each thread. It sequentially executes a three-level deduplication process: grouping by hash value, identifying duplicate records within the same group whose decision vector distance is less than the deduplication tolerance, and retaining only the duplicate records with the lowest total violation. After deduplication, the data is batch-inserted into the hash table. The generational sliding window adaptive unit maintains a recent hit rate circular queue. At the end of each generation, it calculates the hit rate of the current generation and updates the queue. It also calculates the average hit rate and adaptively adjusts the generational window width based on the relationship between the average hit rate and the threshold. The batch asynchronous cleanup unit updates the current generation identifier as the generation increments, calculates the invalidation generation threshold, performs parallel traversal of the hash table, and removes expired cache items whose generation identifier is less than or equal to the invalidation threshold.

2. The system according to claim 1, characterized in that, The generational sliding window adaptive unit maintains a recent hit rate circular queue of length L, where L is the number of hit rate data that the queue can store. At the end of each generation, the hit rate of the current generation is calculated and the queue is updated. The average hit rate r_avg is calculated. When r_avg exceeds the high threshold r_high, the generational window width is expanded by w_new = min(⌈w_old× α_expand⌉, w_max). When r_avg is lower than the low threshold r_low, the generational window width is reduced by w_new = max(⌊w_old × β_shrink⌋, w_min), where w_old is the current window width, w_new is the adjusted window width, α_expand > 1 is the expansion factor, β_shrink ∈ (0,1) is the reduction factor, w_max and w_min are the upper and lower limits of the window width, respectively, ⌈·⌉ indicates rounding up, and ⌊·⌋ indicates rounding down.

3. The system according to claim 1, characterized in that, The topology-sensitive cumulative hash module includes: The topology sorting unit parses the topology matrix of the water project to obtain the upstream and downstream relationships between projects, uses the topology sorting algorithm to generate a project sequence with priority given to upstream projects, and rearranges the original decision vector based on the sequence to generate a rearranged vector. The exponentially decaying weighted hash unit divides the rearranged decision vector into multiple data blocks with a fixed block length, assigns a weight to each block that decreases exponentially, calculates the weighted absolute value sum of the decision variable components in each block, and uses an iterative hash formula to accumulate and calculate the hash value block by block. Finally, the hash value is mapped to the hash bucket. The load monitoring and rebalancing unit periodically counts the number of cached items in each hash bucket in parallel, calculates the load mean, standard deviation and imbalance. When the imbalance exceeds the threshold, the earliest created cached item is selected from the overloaded bucket and migrated to the bucket with the lowest load. The concurrency control unit configures an independent read-write lock mechanism for each hash bucket, supporting concurrent reads and mutually exclusive writes by multiple threads to the same bucket. When performing cross-bucket operations, locks are acquired sequentially in ascending order of bucket index.

4. The system according to claim 3, characterized in that, The exponentially decaying weighted hash unit divides the rearranged decision vector X' = (x'_1, x'_2, ..., x'_{n_var}) into K data blocks of fixed block length B, where x'_i is the decision variable component, n_var is the total number of decision variables, B is the number of decision variables in each block, and K is the total number of blocks. A weight w_k = w_base × exp(-λ(k-1) / (K-1)) is assigned to the k-th block, where w_base is the base weight, λ is the decay coefficient, and k is the block index from 1 to K. When K=1, w_1 = w_base. A weighted absolute sum s_k = Σ(w_k × |x'_i|) is calculated for all decision variable components within the k-th block, where the summation iterates through all decision variable components x'_i in the k-th block using the iterative hash formula h_k = ((h_{k-1} ⊕ ⌊α_scale × s_k⌋) × p) modulo 1 / 2. 2^W is accumulated block by block, where h_0 is the preset initial value, h_{k-1} is the hash value of the previous block, ⊕ is the bitwise XOR operation, ⌊·⌋ is the floor function, α_scale is the scaling factor, p is a prime number, W is the hash bit width, mod represents the modulo operation, and the final hash value h_final = h_K mod M is mapped to M hash buckets, where M is the number of hash table buckets.

5. The system according to claim 1, characterized in that, The multi-state hierarchical storage module includes: The variable-length allocation unit stores a number of scheduling targets and a corresponding array of target values ​​in each cache entry. The system records the frequency of occurrence of different target numbers by statistically analyzing historical data, sets the most frequently occurring target number as the default allocation length, pre-allocates array space of the default length when creating a new cache entry, and dynamically expands or shrinks the array when the actual number of targets differs from the default length. The constraint decomposition storage unit transforms all constraints into a standard form. The total violation is defined as the sum of the violation scores of three types of constraints: volume, flow, and time. The violation score of each type is calculated as the sum of the products of the constraint weights and the violation parts in the constraint index set of that type. The cache item stores the three types of sub-violation scores and the total violation score simultaneously. The precise query unit takes the rearranged decision vector as input, calculates the hash value to locate the target cache bucket, supports multi-threaded parallel traversal of cache items within the bucket and calculation of distances, and determines a hit if there is a cache item whose distance is less than the query matching tolerance. Among all hit items, the one with the lowest total violation is selected and the target value and the violation of each constraint are returned.

6. The system according to claim 5, characterized in that, The constraint decomposition storage unit transforms each constraint into the standard form g_j ≤ 0, where g_j is the j-th constraint function value. When g_j > 0, it indicates a constraint violation, and when g_j ≤ 0, it indicates a constraint satisfaction. The total violation score V_total = V_cap + V_flow + V_temp is defined, where V_cap is the violation score of volumetric constraints, V_flow is the violation score of flow constraints, and V_temp is the violation score of temporal constraints. The violation score for each type is calculated as V_type = Σ_{j∈C_type}(w_j × max{g_j, 0}), where C_type is the set of constraints for that type, w_j is the weight coefficient of the j-th constraint, and max{g_j, 0} ensures that only the violated portion, i.e., constraints where g_j > 0, is accumulated.

7. A water engineering scheduling optimization method based on the system described in any one of claims 1 to 6, characterized in that, Includes the following steps: Initialization Phase: Input the description of the water engineering scheduling problem, including the number of decision variables, the number of objective functions, and the water engineering topology matrix T. Generate the upstream priority engineering permutation sequence π based on the topology matrix T. Configure the hash table size M, thread buffer capacity C_buf, and initial generation window width w_0. Set hash parameters, window adjustment parameters, decision variable boundaries, tolerance, monitoring parameters, and termination conditions. Initialize the generation counter g_current = 0 and the hit evaluation statistics counter. The hash parameters include the base weight w_base, decay coefficient λ, block length B, bit width W, prime number p, initial value h_0, and scale coefficient α_scale. The window adjustment parameters include the expansion factor α_expand, the shrinkage factor β_shrink, window upper and lower limits w_max and w_min, hit rate thresholds r_high and r_low, and queue length L. The decision variable boundaries are [x_j^{min}, x_j^{max}]; the tolerance includes deduplication tolerance ε_dup and query tolerance ε_match; the monitoring parameters include imbalance threshold δ_max and monitoring period N_monitor; the termination condition includes maximum generation G_max and convergence tolerance ε_conv; Parallel Evaluation Phase: After the optimization algorithm generates candidate scheduling schemes, each thread processes them in parallel: First, it checks the boundary constraints of the decision variables. If x_j ∉ [x_j^{min}, x_j^{max}] exists, it returns the maximum penalty target value to the optimization algorithm and skips the candidate scheduling scheme. Schemes that pass the boundary check are rearranged into X' according to the sequence π and the hash value h is calculated to locate the cache bucket. Each thread searches the cache bucket in parallel for cache entries with a distance d = ||X'{cache} - X'||∞ < ε_match. If a match is found, the target value and each violation degree are returned directly. If no match is found, the hydraulic simulator is called to evaluate and obtain the target value and constraint function value {g_j}, and the three types of violations V_cap, V_flow, V_temp and the total violation V_total = V_cap + V_flow are calculated. +V_temp writes the result, along with the hash value, decision vector, generation identifier, and creation timestamp, to the thread-local buffer. The creation timestamp is recorded as the system time when the cached item was created. When the thread buffer count reaches C_buf, it is batch-flushed to the global queue. Batch update phase: The global batch processing unit retrieves data from the queue and performs three-level deduplication in batches: First, it groups the data by hash value h. Then, within the same group, it identifies duplicate records with a distance of ||X'_i - X'_j||_∞ < ε_dup, where X'_i and X'_j are the decision vectors after rearrangement, ||_∞ is the infinity norm, and ε_dup is the deduplication tolerance. Finally, it retains only the record with the smallest V_total in the duplicate set, and inserts it into the hash table in batches after deduplication. Generation Advancement Phase: After all solutions for the current generation have been evaluated, increment the generation counter g_current, calculate the failure generation threshold g_expire = g_current - w - 1, and start asynchronous cleanup to remove expired cache entries g_record ≤ g_expire; calculate the current generation hit rate r_current and update the hit rate circular queue of length L, calculate the average hit rate r_avg, and adaptively adjust the window width w according to the relationship between r_avg and the thresholds r_high and r_low; Performance monitoring phase: Every N_monitor generation, the load L_i of each cache bucket is statistically analyzed in parallel, the load mean μ_L and standard deviation σ_L are calculated, and the imbalance degree δ = σ_L / max{μ_L, 1} is calculated. When δ > δ_max, the earliest accessed cache item is selected from the overloaded buckets with loads exceeding μ_L + 2σ_L and migrated to the bucket with the lowest load. The historical frequency of the target number is updated periodically and the default allocation length n_default is recalculated. Termination of output phase: After reaching the maximum generation G_max or the convergence condition, refresh all thread buffers and complete the last batch update. Output the optimal scheduling scheme X_opt and its target value, the degree of violation of each constraint, the flow process of key sections, and output performance statistics including cache hit rate, the number of hydraulic simulator calls saved, and the total number of evaluations, and release system computing resources.

8. The method according to claim 7, characterized in that, The hydraulic simulator is based on the basic principles of hydrology, hydraulics and water resources. It is used to conduct scheduling simulations for complex water engineering systems such as reservoir groups, dam groups, pumping station groups and water conveyance canal systems. The simulations include hydraulic calculations of water engineering regulation, river flow evolution and canal flow propagation. After the calculations, the simulator evaluates the target value and constraint function value for scheduling objectives and constraints.

9. The method according to claim 7, characterized in that, In the aforementioned generational advancement stage, the specific method for adaptively adjusting the window width w is as follows: when r_avg exceeds the high threshold r_high, the window width is expanded by w_new = min(⌈w_old × α_expand⌉, w_max); when r_avg is lower than the low threshold r_low, the window width is reduced by w_new = max(⌊w_old × β_shrink⌋, w_min); and when r_avg is neither higher than r_high nor lower than r_low, w remains unchanged.

Citation Information

Patent Citations

  • Reservoir group multi-target intelligent optimization scheduling method based on multi-constraint coupling

    CN118798588A

  • Cascade reservoir group optimization scheduling parallel variable parameter simulated annealing optimization method

    CN119005581A