A water supply plant water supply amount prediction model training method and device

By constructing a dual-channel structure of the main channel and shadow twin dataset and verifying the global offset index, combined with feature selection and XGBoost model training, the error problem caused by multi-sensor linkage offset in water supply prediction of waterworks was solved, and the reliability and accuracy of water supply prediction were achieved.

CN121233940BActive Publication Date: 2026-04-21SHANGHAI CHENGTOU WATER (GRP) CO LTD WATER PROD BRANCH
View PDF 2 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
SHANGHAI CHENGTOU WATER (GRP) CO LTD WATER PROD BRANCH
Filing Date
2025-09-15
Publication Date
2026-04-21

AI Technical Summary

Technical Problem

The existing digital twin system for waterworks cannot identify and correct overall errors when multiple sensors are linked and deviate in extreme environments, causing water supply predictions to continuously deviate from the actual situation, posing a serious operational risk.

Method used

A dual-channel structure of the main channel dataset and the shadow twin dataset is constructed. Combining global offset exponent verification and recursive feature removal mechanism, features are screened through Pearson correlation and cosine similarity to reduce the weight of suspicious features. The XGBoost model is then used for training to generate a water supply prediction model.

Benefits of technology

It enables timely identification and correction of overall errors when multiple sensors are linked and offset, ensuring the reliability and accuracy of water supply prediction and guaranteeing the stable operation of the system in extreme environments.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121233940B_ABST
    Figure CN121233940B_ABST
Patent Text Reader

Abstract

The application discloses a water supply plant water supply amount prediction model training method and device, and particularly relates to the field of water supply amount prediction, and comprises constructing a main channel data set, wherein the main channel data set comprises time characteristics, meteorological characteristics, working condition characteristics, hydraulic internal characteristics and hydraulic external characteristics; a shadow twin data set is synchronously constructed, the shadow twin data set is generated according to a hydraulics balance equation and historical stable data, and is aligned with the main channel data on the same time axis; correlation screening is performed on the main channel data, and features with a correlation coefficient lower than a preset threshold value are deleted. Through the construction of the double-channel structure of the main channel data set and the shadow twin data set in the training process, and the combination of the global offset index checking and the cyclic mechanism of the recursive feature elimination, the identification and correction of the overall error caused by the multi-sensor linkage offset are realized.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of water supply prediction technology, and more specifically, to a method and apparatus for training a water supply prediction model for a waterworks. Background Technology

[0002] The current digital twin system of waterworks mainly relies on sensors to collect data such as pipeline pressure, water level and flow in real time and map them to a virtual model for water supply prediction. However, under extreme environmental conditions, if multiple key sensors simultaneously deviate in the same direction, this overall error will not trigger the single-point anomaly detection mechanism, but will consistently transmit the error information to the twin model, causing the prediction to continuously deviate from the real state and solidify the deviation as a "normal" result in subsequent operations.

[0003] Existing technologies lack a global consistency verification mechanism that simultaneously references physical constraints and virtual twin states, making it difficult to identify and correct overall errors caused by sensor linkage offsets. This systematic distortion can easily mislead water supply forecasts and generate serious operational risks.

[0004] Therefore, the core problem with existing technologies is that digital twin architectures fail to identify and correct global coupling errors caused by multi-sensor linkage offsets. Summary of the Invention

[0005] To overcome the aforementioned deficiencies in the prior art, embodiments of the present invention provide a training method and apparatus for a water supply prediction model for waterworks. By constructing a dual-channel structure of a main channel dataset and a shadow twin dataset during the training process, and combining a cyclic mechanism of global offset exponent verification and recursive feature removal, the method identifies and corrects the overall error caused by multi-sensor linkage offset, thereby solving the problems mentioned in the background art.

[0006] To achieve the above objectives, the present invention provides the following technical solution: a method for training a water supply volume prediction model for a waterworks, comprising:

[0007] S1: Construct the main channel dataset, which includes time features, meteorological features, operating condition features, hydraulic internal features, and hydraulic external features; simultaneously construct the shadow twin dataset, which is generated based on the hydraulic balance equation and historical stable data, and is aligned with the main channel data on the same time axis;

[0008] S2: Perform correlation filtering on the main channel data and delete features with correlation coefficients lower than the preset threshold; perform similarity removal on the remaining features and calculate the residual between the main channel data and the shadow twin in the same time window after each removal. When the residual exceeds the preset upper limit, restore the feature to the retention state in the current feature set and mark the feature as a suspicious feature.

[0009] S3: Perform difference calculation on the corresponding feature groups of the main channel data and the shadow twin, and calculate the global offset index; when the global offset index exceeds the preset upper limit, reduce the weight of the features marked as suspicious in the current feature set, and generate corrected channel data with the shadow twin estimate; after the correction is completed, return to S2, and repeat the correlation screening and similarity removal until the global offset index is within the target range.

[0010] S4: During the iterative process of recursive feature removal, the XGBoost model is used as the base model, and the modified channel dataset is input for training. The importance of each feature is calculated based on the training results. After removing low-weight features in each recursive iteration, the global offset index is calculated and compared with a preset threshold. When the global offset index exceeds the preset threshold, the removal is canceled and at least one representative feature is retained in the feature group. The recursive iteration continues until the target number of features is reached.

[0011] In a preferred embodiment, the execution of S1 includes:

[0012] S1-1: Collect time characteristics, meteorological characteristics, operating condition characteristics, internal hydraulic characteristics, and external hydraulic characteristics to form the main channel dataset;

[0013] S1-2: Within each time period of the main channel dataset, calculate the theoretical water supply of the water supply system based on the hydraulic balance equation. The construction of the hydraulic balance equation includes S1-a, S1-b, and S1-c:

[0014] S1-a: Multiply the difference in liquid level in the clear water tank at two adjacent moments by the conversion factor of the effective volume of the clear water tank to solve for the change in tank capacity during that period.

[0015] S1-b: The flow difference is formed by subtracting the integral value of the outflow from the integral value of the inflow recorded during this period;

[0016] S1-c: The weighted balance between the change in reservoir capacity of S1-a and the difference in flow rate of S1-b is made so that the balance result is zero, thereby solving for the theoretical water supply during this period.

[0017] S1-3: Statistically analyze the operation data of the waterworks during the operation phase. The historical stable data includes meteorological observations under stable meteorological conditions, daily average water consumption distribution curves, clear water tank level curves, and pump start-up and shutdown records. The stable meteorological conditions include daily temperature variation below the preset upper limit, precipitation not exceeding the set threshold, wind speed fluctuation below the set threshold, and changes in air pressure and humidity within the preset upper and lower limits.

[0018] S1-4: Compare the theoretical water supply obtained from S1-2 with the historical stable data obtained from S1-3, calculate the difference or ratio between the two, and use the difference or ratio as a correction coefficient.

[0019] S1-5: The theoretical water supply is weighted and combined with the correction coefficient to generate a shadow twin dataset;

[0020] S1-6: Align the shadow twin dataset with the main channel dataset on a unified time axis to form a corresponding feature group structure.

[0021] In a preferred embodiment, S2 includes:

[0022] S2-1: Perform Pearson correlation calculation on each feature in the main channel dataset and the target water supply to obtain the correlation coefficient, and delete features whose absolute value of the correlation coefficient is lower than the preset threshold to form the first residual feature set.

[0023] S2-2: Perform cosine similarity calculation on any two features in the first remaining feature set. When the cosine similarity result exceeds a preset threshold, retain the features whose absolute value of the correlation coefficient is higher than the preset threshold and delete the features whose absolute value of the correlation coefficient is lower than the preset threshold to form a second remaining feature set.

[0024] S2-3: After each feature deletion, calculate the difference between the water supply values ​​of the main channel dataset and the shadow twin dataset in the same time window, and calculate the mean square residual of the difference; compare the mean square residual with the preset upper limit of residual. When the mean square residual exceeds the preset upper limit, cancel the deletion operation, restore the feature to the second remaining feature set, and mark the feature as a suspicious feature.

[0025] In a preferred embodiment, S3 includes:

[0026] S3-1: Calculate the time-by-time difference between the main channel dataset and the shadow twin dataset within the corresponding feature groups, and statistically analyze the results of each difference into a global offset index;

[0027] S3-2: Compare the global offset index with a preset upper limit. When the global offset index exceeds the preset upper limit, reduce the weight of features already marked as suspicious in the current feature set.

[0028] S3-3: Based on the weighted feature set, generate corrected channel data using the estimated values ​​from the shadow twin dataset;

[0029] S3-4: Return the corrected channel data to S2 and repeat the correlation filtering and similarity removal until the global offset index is within the target range.

[0030] In a preferred embodiment, S4 includes:

[0031] S4-1: Select all features to be processed in the corrected channel dataset as input, train the XGBoost model as the base model, and calculate and output the importance score of each feature based on the training results.

[0032] S4-2: In the iterative process of recursive feature removal, identify features whose importance scores are lower than a preset threshold, and remove these features from the current feature set to obtain a new feature set;

[0033] S4-3: After each removal operation, calculate the difference between the water supply values ​​of the corrected channel dataset and the shadow twin dataset within the same time window, and then sum the squares of the difference and take the average to obtain the global offset index.

[0034] In a preferred embodiment, S4 further includes:

[0035] S4-4: Compare the global offset index with a preset threshold. When the global offset index exceeds the preset threshold, cancel the elimination operation and retain at least one representative feature in the feature group to ensure that the global offset index is within the allowable range.

[0036] S4-5: Use the adjusted feature set as the input for the next round, and repeat the iterative process from S4-1 to S4-4 until the number of feature sets reaches the preset target.

[0037] In a preferred embodiment, the method further includes S5: using the feature set obtained in S4 through feature elimination iteration and combined with global offset index verification, the feature set and the corrected channel data formed in S3 are input into the XGBoost model for training to generate a water supply prediction model; and establishing a protection verification process in the training, verification and online operation phases of the water supply prediction model.

[0038] The safeguard verification process includes comparing the output of the water supply prediction model with the calculation results of the shadow twin dataset hourly. When the comparison deviation exceeds the upper limit of the preset threshold, it triggers a return to S4 to re-execute the feature removal iteration or a return to S3 to re-execute the global correction until the water supply prediction model meets the target requirements.

[0039] The technical effects and advantages of this invention are as follows:

[0040] This invention introduces a global offset index verification mechanism during the training process of the twin model, which can promptly identify and correct overall errors when multiple sensors experience simultaneous linkage offsets, thereby preventing the water supply prediction from continuously deviating from the true state and ensuring the reliability of the system under extreme environments.

[0041] This invention effectively removes low-relevance and highly redundant features by combining Pearson correlation and cosine similarity in the feature selection process. After removal, residual calculation and threshold comparison are performed to achieve dynamic backtracking and correction of the feature set, ensuring the robustness of feature selection.

[0042] This invention introduces a weight reduction mechanism during the global consistency control phase, which gradually reduces the weight of labeled suspicious features when the global offset index exceeds the limit, and generates corrected channel data by combining the shadow twin dataset, thus ensuring the long-term consistency between features and physical constraints.

[0043] This invention uses XGBoost as the base model during the model training phase, combined with recursive feature removal and global offset exponent verification, to achieve dual constraints of feature importance ranking and global consistency control, thereby effectively controlling feature redundancy while ensuring prediction accuracy.

[0044] This invention establishes a safeguard verification process in all three stages of training, verification, and online operation, enabling the prediction results to be compared with the shadow twin estimation values ​​hourly. It also achieves adaptive correction and long-term stable operation of the prediction model throughout its entire lifecycle by triggering a return mechanism through a residual threshold. Attached Figure Description

[0045] Figure 1 This is a flowchart of the method steps of the present invention. Detailed Implementation

[0046] The technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.

[0047] Refer to the instruction manual appendix Figure 1 An embodiment of the present invention provides a method for training a water supply volume prediction model for a waterworks, comprising:

[0048] S1: Construct the main channel dataset, which includes time features, meteorological features, operating condition features, hydraulic internal features, and hydraulic external features; simultaneously construct the shadow twin dataset, which is generated based on the hydraulic balance equation and historical stable data, and is aligned with the main channel data on the same time axis;

[0049] S2: Perform correlation filtering on the main channel data and delete features with correlation coefficients lower than the preset threshold; perform similarity removal on the remaining features and calculate the residual between the main channel data and the shadow twin in the same time window after each removal. When the residual exceeds the preset upper limit, restore the feature to the retention state in the current feature set and mark the feature as a suspicious feature.

[0050] S3: Perform difference calculation on the corresponding feature groups of the main channel data and the shadow twin, and calculate the global offset index; when the global offset index exceeds the preset upper limit, reduce the weight of the features marked as suspicious in the current feature set, and generate corrected channel data with the shadow twin estimate; after the correction is completed, return to S2, and repeat the correlation screening and similarity removal until the global offset index is within the target range.

[0051] S4: During the iterative process of recursive feature removal, the XGBoost model is used as the base model, and the modified channel dataset is input for training. The importance of each feature is calculated based on the training results. After removing low-weight features in each recursive iteration, the global offset index is calculated and compared with a preset threshold. When the global offset index exceeds the preset threshold, the removal is canceled and at least one representative feature is retained in the feature group. The recursive iteration continues until the target number of features is reached.

[0052] The execution of S1 includes:

[0053] S1-1: Collect time characteristics, meteorological characteristics, operating condition characteristics, internal hydraulic characteristics, and external hydraulic characteristics to form the main channel dataset;

[0054] S1-2: Within each time period of the main channel dataset, calculate the theoretical water supply of the water supply system based on the hydraulic balance equation. The construction of the hydraulic balance equation includes S1-a, S1-b, and S1-c:

[0055] S1-a: Multiply the difference in liquid level between two adjacent moments in the clear water tank by the effective volume conversion factor of the clear water tank to solve for the change in tank capacity during that period. The effective volume conversion factor of the clear water tank is the proportional coefficient used to convert the change in liquid level in the clear water tank into the corresponding water volume. This coefficient is determined based on the geometric structure and effective volume curve of the clear water tank and is used to directly convert the difference in liquid level height into the actual change in tank capacity.

[0056] S1-b: The flow difference is formed by subtracting the integral value of the outflow from the integral value of the inflow recorded during this period;

[0057] S1-c: The weighted balance between the change in reservoir capacity of S1-a and the difference in flow rate of S1-b is made so that the balance result is zero, thereby solving for the theoretical water supply during this period.

[0058] S1-3: Statistically analyze the operation data of the waterworks during the stable operation phase. The historical stable data includes meteorological observations under stable meteorological conditions, daily average water consumption distribution curves, clear water tank level curves, and pump start-up and shutdown records. The stable meteorological conditions include daily temperature variation below the preset upper limit, precipitation not exceeding the set threshold, wind speed fluctuation below the set threshold, and changes in air pressure and humidity within the preset upper and lower limits.

[0059] S1-4: Compare the theoretical water supply obtained from S1-2 with the historical stable data obtained from S1-3, calculate the difference or ratio between the two, and use the difference or ratio as a correction coefficient to adjust the theoretical water supply.

[0060] S1-5: The theoretical water supply is weighted and combined with the correction coefficient to generate a shadow twin dataset;

[0061] S1-6: Align the shadow twin dataset with the main channel dataset on a unified time axis to form a corresponding feature group structure.

[0062] S2 includes:

[0063] S2-1: Perform Pearson correlation calculation on each feature in the main channel dataset and the target water supply to obtain the correlation coefficient, and delete features whose absolute value of the correlation coefficient is lower than a preset threshold to form the first residual feature set; the Pearson correlation calculation process includes: for each feature in the main channel dataset and the target water supply, take the corresponding numerical pair on a unified time series, first calculate the mean of the feature sequence and the target water supply sequence respectively, then calculate the sum of the products of the deviations of the two sequences relative to the mean at each time point, and divide by the square root of the sum of the squares of the deviations of the two sequences to obtain the correlation coefficient between -1 and 1. The correlation coefficient is used to characterize the degree of linear correlation between the feature and the target water supply;

[0064] S2-2: Perform cosine similarity calculation on any two features in the first remaining feature set. When the cosine similarity result exceeds a preset threshold, retain the features whose absolute correlation coefficient is higher than the preset threshold and delete the features whose absolute correlation coefficient is lower than the preset threshold to form a second remaining feature set. The cosine similarity calculation process includes: for any two feature sequences in the main channel dataset, form a vector with their respective values ​​in the same time window, first calculate the sum of the product of the corresponding elements of the two vectors as the inner product, then calculate the square root of the sum of the squares of the elements of the two vectors as the vector magnitude, and finally divide the inner product by the product of the two magnitudes to obtain a similarity value between 0 and 1, which is used to characterize the similarity between the two feature sequences in the direction.

[0065] S2-3: After each feature deletion, calculate the difference in water supply values ​​between the main channel dataset and the shadow twin dataset within the same time window, and calculate the mean squared residual of this difference. Compare the mean squared residual with a preset upper limit for residuals. If the mean squared residual exceeds the preset upper limit, cancel the deletion operation, restore the feature to the second remaining feature set, and mark the feature as a suspicious feature for subsequent global correction. The mean squared residual refers to the average of the sum of the squared differences between the main channel data and the shadow twin data at corresponding time points, which is used to measure the degree of deviation between the two overall.

[0066] S3 includes:

[0067] S3-1: Calculate the time-by-time difference between the main channel dataset and the shadow twin dataset within the corresponding feature groups, and statistically analyze the results of each difference into a global offset index;

[0068] S3-2: Compare the global offset index with a preset upper limit. When the global offset index exceeds the preset upper limit, reduce the weight of the features marked as suspicious in the current feature set. When reducing the weight of the features marked as suspicious in the current feature set, a graded reduction method is used. The importance weight value of the feature is reduced to 70% of the original weight in the first adjustment. If the global offset index still exceeds the preset upper limit, its weight value is further reduced to 50% of the original weight in subsequent iterations, and so on in a graded manner, until the global offset index is within the target range.

[0069] S3-3: Based on the weighted feature set, corrected channel data is generated using the estimated values ​​from the shadow twin dataset. The calculation of the estimated values ​​from the shadow twin dataset includes: integrating the inflow rate and the outflow rate within a given time window to obtain the difference between the inflow and outflow rates; multiplying the difference between the initial and final liquid levels of the time window by the conversion factor for the effective volume of the clear water tank to solve for the change in storage capacity; weighting and balancing the flow rate difference and the change in storage capacity to make the result equal to zero, thus solving for the theoretical water supply of the time window; statistically analyzing the average daily water supply and pump start-stop cycle during historical stable periods, calculating the ratio of theoretical water supply to average daily water supply, and correcting this ratio according to the pump start-stop cycle to obtain a correction coefficient; finally, applying the correction coefficient to the theoretical water supply to generate a corrected water supply value, which serves as the estimated value from the shadow twin.

[0070] S3-4: Return the corrected channel data to S2 and repeat the correlation filtering and similarity removal until the global offset index is within the target range.

[0071] S4 includes:

[0072] S4-1: Select all features to be processed in the corrected channel dataset as input, train the XGBoost model as the base model, and calculate and output the importance score of each feature based on the training results.

[0073] S4-2: In the iterative process of recursive feature removal, identify features whose importance scores are lower than a preset threshold, and remove these features from the current feature set to obtain a new feature set;

[0074] S4-3: After each removal operation, calculate the difference between the water supply values ​​of the corrected channel dataset and the shadow twin dataset within the same time window, and then sum the squares of the difference and take the average to obtain the global offset index.

[0075] S4 further includes:

[0076] S4-4: Compare the global offset index with a preset threshold. When the global offset index exceeds the preset threshold, cancel the elimination operation and retain at least one representative feature in the feature group to ensure that the global offset index is within the allowable range.

[0077] S4-5: Use the adjusted feature set as the input for the next round, and repeat the iterative process from S4-1 to S4-4 until the number of features in the feature set reaches the preset target. The preset target refers to the target number of features to be achieved in the recursive feature elimination iteration. This target is usually set according to the model performance evaluation index, including reducing the feature set to a predetermined upper or lower limit of the number of features to form the optimal feature set, while ensuring that the global offset index is within the allowable range.

[0078] For S4, further explanation is needed. When training with the XGBoost model as the base model, the corrected channel dataset is first used as input. Each row corresponds to a set of feature values ​​within a time window, and each column corresponds to a specific feature. The target value is the water supply within that time window. Then, a weak predictor is initialized, and a loss function is established. This loss function consists of the squared error between the predicted and target water supply, and a regularization term to constrain tree complexity. In each iteration, the residual between the current model's predicted value and the target water supply is calculated, and the first and second gradients of this residual are obtained. This gradient information is used as the new fitting target. Based on this gradient information, a new regression tree is constructed. During the partitioning process at each node, the regression tree traverses all candidate features and their split points, calculates the change in the objective function before and after the split, and selects the feature and its split point that maximizes the decrease in the objective function as the node partitioning basis, thus generating a new tree structure. The output of this regression tree is weighted and added to the prediction results of the existing model to update the overall model's prediction value. This iterative process is repeated until a preset number of iterations is reached or the loss function decreases insufficient to meet the threshold condition.

[0079] When calculating and outputting the importance scores of each feature based on the training results, statistics are performed on each node of each regression tree, recording the number of times each feature is selected as a splitting condition, and calculating the decrease in the objective function brought by the feature at each split. The number of splits for the feature in all regression trees is summed to serve as the weight index for the feature. The decrease in the objective function brought by the feature in all regression trees is summed and divided by the number of splits to serve as the gain index for the feature. The number of samples covered by the feature participating in the splits in all regression trees is summed to serve as the coverage index for the feature. The above statistical results are normalized to obtain feature importance scores between 0 and 1, and the features are sorted according to their numerical values. The output is used as the basis for subsequent recursive feature removal.

[0080] It also includes S5: using the feature set obtained in S4 through feature elimination iteration and combined with global offset index verification, this feature set and the corrected channel data formed in S3 are input into the XGBoost model for training to generate a water supply prediction model; a protection verification process is established in the training, verification and online operation phases of the water supply prediction model.

[0081] The safeguard verification process includes comparing the output of the water supply prediction model with the calculation results of the shadow twin dataset hourly. When the comparison deviation exceeds the upper limit of the preset threshold, it triggers the return to S4 to re-execute the feature removal iteration or the return to S3 to re-execute the global correction until the water supply prediction model meets the target requirements.

[0082] Regarding S5, the following needs to be explained:

[0083] In the generation of the water supply prediction model in S5: First, the feature set retained in S4 through recursive feature elimination iteration and combined with global offset index verification is used as the input feature dimension; at the same time, the corrected channel dataset formed in S3 is used as the training sample input under a unified time window, where each row represents all feature value combinations of a time window, each column corresponds to the numerical sequence of a specific feature, and the target output value is the actual water supply under that time window; then, an XGBoost model is constructed as the base model. The base model uses the squared loss function and regularization term as optimization objectives. The squared loss function is used to calculate the sum of squared errors between the predicted water supply value and the target water supply value, and the regularization term is used to constrain the split depth and the number of leaf nodes of the decision tree to avoid model overfitting.

[0084] During training, the residual between the current model prediction and the target water supply is first calculated, and the first and second gradients of the residual are solved. The gradient information is used as the input for the next round of fitting. Then, in the candidate feature set, each feature and its possible split points are traversed, and the change in the objective function before and after each split is calculated. The feature and split point that makes the objective function decrease the most are selected as the basis for splitting the node, thereby generating a new regression tree. The output of the regression tree is then weighted and superimposed with the prediction results of the existing model to update the overall prediction value.

[0085] Finally, repeat the above iterative steps until the preset number of iterations is reached, or the decrease in the objective function is less than the threshold condition. Finally, a water supply prediction model is formed by weighted combination of multiple regression trees.

[0086] Establishment of the Guardian Verification Process in S5: Guardian verification processes need to be established during the training, verification, and online operation phases of the water supply prediction model. These processes are used to continuously compare the model output with the estimation results of the shadow twin dataset to ensure the stability and reliability of the model at different stages.

[0087] During the training phase, the model predicts the water supply for the corrected channel dataset and outputs the predicted water supply for each time window. At the same time, it calls the estimated water supply for the shadow twin dataset under the same time window, calculates the difference between the predicted water supply and the estimated water supply for the shadow twin, and averages the squared difference point by point to form the protection residual index. The protection residual index is then compared with a preset threshold upper limit. When the protection residual index exceeds the threshold upper limit, it triggers a return to step S4 to re-execute the feature removal iteration until the protection residual index returns to the allowable range.

[0088] During the validation phase, independent sample data that was not used in training is used as input, and the above prediction and comparison process is repeated. When the residual index exceeds the threshold, step S3 is triggered to re-execute the global correction to adjust the correction channel dataset so that the model's prediction results on the validation data are consistent with the shadow twin estimation results.

[0089] During the online operation phase, real-time operational data from the waterworks is collected as input to provide the model with real-time predicted water supply for each time window. Simultaneously, the estimated water supply generated in real-time from the shadow twin dataset is called to calculate the time-by-time difference and form a protection residual index. When the protection residual index exceeds the preset threshold in real-time comparison, the protection verification mechanism is automatically triggered. Depending on the source of the difference, it can either return to S4 to re-execute the feature removal iteration or return to S3 to re-execute the global correction to ensure that the water supply prediction model continuously meets the accuracy and stability requirements throughout its entire life cycle.

[0090] In practical applications, this solution introduces a dual-channel construction mechanism of main channel dataset and shadow twin dataset in the process of predicting water supply in waterworks, ensuring that the real operating data and the ideal reference sequence of physical equilibrium constraints are synchronously aligned, forming a comparable feature basis.

[0091] In the feature processing stage, features with a correlation coefficient with water supply below the threshold are first deleted using Pearson correlation. Then, redundant features with high similarity are removed using cosine similarity. After removal, the residual between the main channel and the shadow twin in the same time window is calculated. The backtracking and marking of suspicious features are achieved by comparing the mean square residual with the preset upper limit.

[0092] In the global consistency control phase, the feature difference between the main channel and the shadow twin is compared, the global offset index is calculated, and the weight of the labeled features is reduced in stages when it exceeds the limit. At the same time, the corrected channel data is generated using the shadow twin estimate and returned to the feature selection stage in a loop until the global offset index stabilizes within the target range. In the model training phase, the corrected channel dataset is used as input, and XGBoost is used as the base model to perform recursive feature removal. The model is trained and the feature importance score is calculated one after another. After removing low-weight features, the global offset index is calculated simultaneously. When it exceeds the limit, the removal is canceled and the representative features are retained. The iteration continues until the preset feature number target is reached.

[0093] In the final modeling stage, the feature set obtained from the above process and the corrected channel data are jointly input into XGBoost for training to generate a water supply prediction model. The protection verification process is continuously run in the three stages of training, verification and online deployment. The predicted value is compared with the shadow twin estimate hourly to form the protection residual index. The return feature removal or global correction is triggered by threshold comparison to ensure the accuracy and stability of the water supply prediction model throughout its entire life cycle.

[0094] The above description is merely a preferred embodiment of the present invention and is not intended to limit the present invention. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of the present invention should be included within the protection scope of the present invention.

Claims

1. A method for training a water supply volume prediction model for a waterworks, characterized in that, Comprise: S1: build a main channel dataset, the main channel dataset includes time characteristics, weather characteristics, working condition characteristics, hydraulic internal characteristics and hydraulic external characteristics; Synchronously build a shadow twin dataset, the shadow twin dataset is generated according to the hydraulics balance equation and historical stable data, and is aligned with the main channel data on the same time axis; The execution of the S1 comprises: S1-1: collect time characteristics, weather characteristics, working condition characteristics, hydraulic internal characteristics and hydraulic external characteristics to form a main channel dataset; S1-2: in each time period of the main channel dataset, calculate the theoretical water supply of the water supply system according to the hydraulics balance equation, the construction of the hydraulics balance equation comprises S1-a, S1-b and S1-c: S1-a: multiply the liquid level difference of the clear water pool at the adjacent two time points by the effective volume conversion coefficient of the clear water pool to solve the storage capacity change in the period; S1-b: subtract the outflow integral value from the inflow integral value recorded in the period to form a flow difference value; S1-c: weight and balance the storage capacity change of S1-a and the flow difference value of S1-b, so that the balance result is zero, thereby solving the theoretical water supply in the period; S1-3: statistics of the running data of the waterworks in the running stage, the historical stable data includes the weather observation value under the stable weather condition, the daily average water distribution curve, the clear water pool liquid level curve and the pump group start-stop record; The stable weather condition includes that the daily temperature change amplitude is lower than the preset upper limit, the precipitation is not more than the set threshold, the wind speed fluctuation amplitude is lower than the set threshold, and the change amount of air pressure and humidity is within the preset upper and lower limit range; S1-4: compare the theoretical water supply solved by S1-2 with the historical stable data obtained by S1-3, calculate the difference or ratio value, and take the difference or ratio value as a correction coefficient; S1-5: weight and combine the theoretical water supply and the correction coefficient to generate a shadow twin dataset; S1-6: align the shadow twin dataset with the main channel dataset on the unified time axis to form the corresponding feature group structure; S2: correlation screening is performed on the main channel data, and features with a correlation coefficient lower than a preset threshold are deleted; similarity elimination is performed on the remaining features, and the residual error of the main channel data and the shadow twin in the same time window is calculated after each elimination, when the residual error exceeds a preset upper limit, the feature in the current feature set is restored to a reserved state, and is marked as a suspicious feature; S3: difference calculation is performed on the corresponding feature groups of the main channel data and the shadow twin, and the global offset index is counted; when the global offset index exceeds a preset upper limit, the weight of the feature marked as suspicious in the current feature set is reduced, and the corrected channel data is generated by the shadow twin estimated value; after correction, return to S2, repeat the correlation screening and similarity elimination until the global offset index is within the target range; The S3 comprises: S3-1: perform hour-by-hour difference calculation on the main channel dataset and the shadow twin dataset in the corresponding feature group, and count each difference result as the global offset index; S3-2: comparing the global offset index with a preset upper limit, when the global offset index exceeds the preset upper limit, reducing the weight of the feature marked as suspicious in the current feature set; S3-3: generating corrected channel data based on the feature set adjusted by the weight, with the estimated value of the shadow twin data set; S3-4: returning the corrected channel data to S2, repeating the correlation screening and similarity elimination until the global offset index is within the target range; S4: in the iterative process of recursive feature elimination, taking the XGBoost model as the base model, inputting the corrected channel data set for training, and calculating the importance of each feature based on the training results; after each recursive iteration to eliminate low-weight features, the global offset index is calculated and compared with the preset threshold value, when the global offset index exceeds the preset threshold value, the elimination is cancelled and at least one representative feature is retained in the feature group, then the recursive iteration continues until the target number of features is reached.

2. The water supply prediction model training method of claim 1, wherein: S2 comprises: S2-1: performing Pearson correlation calculation on each feature in the main channel data set and the target water supply to obtain a correlation coefficient, and deleting features with an absolute value of the correlation coefficient below a preset threshold to form a first remaining feature set; S2-2: performing cosine similarity calculation on any two features in the first remaining feature set, when the cosine similarity result exceeds the preset threshold, retaining features with an absolute value of the correlation coefficient higher than the preset threshold, and deleting features with an absolute value of the correlation coefficient lower than the preset threshold to form a second remaining feature set; S2-3: after each deletion, calculating the difference between the water supply values of the main channel data set and the shadow twin data set in the same time window, and calculating the mean square residual of the difference; comparing the mean square residual with a preset residual upper limit, when the mean square residual exceeds the preset upper limit, cancelling the deletion operation, restoring the feature to the second remaining feature set, and marking the feature as suspicious.

3. The water supply prediction model training method of claim 2, wherein: S4 comprises: S4-1: selecting all features to be processed in the corrected channel data set as input, training the XGBoost model as the base model, and calculating and outputting the importance score of each feature based on the training results; S4-2: in the iterative process of recursive feature elimination, identifying features with importance scores below a preset threshold, and removing the features from the current feature set to obtain a new feature set; S4-3: after each removal operation, calculating the difference between the water supply values of the corrected channel data set and the shadow twin data set in the same time window, and taking the square sum of the difference to obtain the global offset index.

4. The water supply prediction model training method of claim 3, wherein: S4 further comprises: S4-4: comparing the global offset index with a preset threshold value, when the global offset index exceeds the preset threshold value, canceling the rejection operation, and retaining at least one representative feature in the feature group to ensure that the global offset index is within the allowable range; S4-5: taking the adjusted feature set as the next round of input, repeating the iteration process of S4-1 to S4-4 until the number of feature sets reaches the preset target.

5. The water supply prediction model training method of claim 4, further comprising: S5: inputting the feature set obtained by the feature rejection iteration and combined with the global offset index check in S4 and the modified channel data formed in S3 into the XGBoost model for training to generate a water supply prediction model; and establishing a guardian check process during the training, verification and online operation of the water supply prediction model. The guardian check process includes comparing the output results of the water supply prediction model with the calculation results of the shadow twin data set hour by hour, and when the deviation exceeds the upper limit of the preset threshold value, triggering the iteration of returning to S4 to re-perform feature rejection or returning to S3 to re-perform global correction until the water supply prediction model meets the target requirements. ​

Citation Information

Patent Citations

  • Digital twinborn visual modeling method and system based on neural network

    CN120196672A

  • Water conservancy reservoir group joint dispatching optimization system based on digital twinning

    CN120542619A