A method for water supply demand forecasting and resource allocation
By using multi-dimensional data fusion and adaptive weighted multi-scale timing convolutional network model in the water supply system to predict water supply demand, combined with dynamic resource allocation strategies, the problem that traditional water supply systems cannot effectively respond to demand fluctuations and emergencies is solved, and high-precision prediction and resource optimization allocation are achieved.
Patent Information
- Application Number
- CN202411783809.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-06
- Publication Date
- 2025-05-06
- Estimated Expiration
- 2044-12-06
AI Technical Summary
Traditional water supply systems are unable to effectively respond to demand fluctuations and emergencies, resulting in waste of resources or insufficient water supply, and the existing prediction methods are insufficient in response capabilities, low prediction accuracy, and lack of optimization of resource allocation.
The adaptive weighted multi-scale timing convolution network model based on multi-dimensional data fusion is used to predict water supply demand, and combined with dynamic resource allocation strategy, the water supply allocation in each region is optimized through the objective function.
The prediction accuracy and response capabilities of the water supply system are improved, the supply and demand deviations are minimized and resource allocation balance is achieved, and the problems of waste of resources and insufficient water supply are avoided.
Smart Images

Figure FDA0005246461730000011 
Figure FDA0005246461730000012 
Figure FDA0005246461730000013
Abstract
Description
Technical Field
[0001] The invention belongs to the field of demand forecasting, and in particular relates to a water supply demand forecasting and resource allocation method. Background Art
[0002] In modern urban management, the water supply system is a key infrastructure. The efficiency of its resource management and water supply allocation is directly related to the quality of life of urban residents and the sustainable development of the city. Traditional water supply systems usually rely on historical data and fixed water supply rules, and cannot effectively respond to demand fluctuations and emergencies, resulting in widespread waste of resources or insufficient water supply. In the prior art, although some methods use simple statistical models or machine learning techniques to predict water supply demand, these methods often have the following shortcomings: Insufficient responsiveness: In the case of sudden increase in demand or resource shortage, traditional models are difficult to quickly adjust water supply allocation, resulting in uneven or inefficient water supply. Low prediction accuracy: Most methods are based only on a single data source or fixed model, lack multi-dimensional data fusion and adaptive prediction capabilities, and are difficult to accurately reflect actual water supply needs. Lack of optimization in resource allocation: Traditional resource allocation methods are usually based on fixed rules or simple allocation ratios, and cannot dynamically adjust the water supply in each region, resulting in low resource utilization. Summary of the invention
[0003] In view of the technical problems existing in the above-mentioned background technology, the present invention proposes a water supply demand forecasting method based on multidimensional data fusion and with adaptive forecasting capability, and combines an optimized dynamic resource allocation strategy to improve the accuracy and responsiveness of the water supply system.
[0004] In order to achieve the above object, the technical solution adopted by the present invention is: comprising the following steps:
[0005] S1. First, obtain the influencing factor data from external data sources including meteorological data, historical water use data, holiday data, and population density data, and perform dynamic multi-stage standardization on the data to form an input data set D in a unified format. cleaned ;
[0006] S2, then build an adaptive weighted multi-scale temporal convolutional network model based on the standardized data set to predict water supply demand, where demand prediction includes building a demand prediction model and inputting the cleaning data set D in the current cycle. cleaned Make predictions to obtain the predicted water supply demand, where the model has adaptive characteristics and can automatically adjust the model parameters when new data is updated;
[0007] S3, then calculate and allocate the optimal water supply to each area based on the predicted water supply demand and current water resource reserves, and the objective function is: Where Qactual,i , Q pred,i They represent the actual water supply and predicted demand in the region, R current represents the total amount of current water resources reserves, α and β are the weights of the two items;
[0008] S4. Finally, the actual water consumption data of each area is obtained regularly, the deviation between the actual demand and the predicted demand is calculated, and the parameters of the adaptive prediction model are adjusted through feedback to achieve continuous optimization of the prediction model, specifically including calculating the prediction deviation ΔQ(t) = Q actual (t)-Q pred (t), where t is the forecast time period, and the deviation ΔQ(t) is used to update the model parameters;
[0009] The establishment of the adaptive weighted multi-scale temporal convolutional network model and the realization of the adaptive characteristics in step S2 are as follows:
[0010] S21. First, we construct a multi-scale convolution module. Each module uses a different convolution kernel size and expansion rate. The l-th layer multi-scale convolution outputs h (l) The formula is: (l) =[Conv1D(h (l-1) ,k1,d1),Conv1D(h (l-1) ,k2,d2)...,Conv1D(h (l-1) ,k m ,d m )], where Conv1D(h (l-1) ,k i ,d i ) indicates that the kernel size is k i , the expansion rate is d i One-dimensional convolution operation, different convolution kernel sizes and expansion rates can achieve multi-scale feature extraction;
[0011] S22. After the multi-scale convolution output of each layer, an adaptive weighting mechanism is added to assign weights to each time scale feature. The weights are dynamically generated by the attention module to ensure that the model pays attention to the key time scales at different times. The adaptive weighting calculation is: in is the adaptive weight of the i-th time scale of the l-th layer;
[0012] S23. After the adaptive weighted output of each layer, add residual connection and layer normalization, and add the formula as follows: Among them, LayerNorm is the layer normalization operation;
[0013] S24. Finally, the output of the last layer is converted into the prediction result of the final water supply demand through the adaptive prediction layer.
[0014] Preferably, the steps for implementing the dynamic multi-stage standardization process are:
[0015] S11. First, the data is nonlinearly normalized by combining logarithmic and power changes to adapt it to different growth and change trends: Where X i is the original data, δ is the threshold of logarithmic transformation, α is the scaling factor, and β is the nonlinear exponential factor;
[0016] S12. Then, in the data fusion stage, a dynamic weight normalization process is designed to enhance the model's sensitivity to important features: where X′ max , X′ min is the minimum and maximum value in the data set after processing in the previous stage, ω i is the dynamic weight of the i-th feature;
[0017] S13. Finally, before the data is integrated and output, the data is scaled to maintain distribution to ensure that the distribution characteristics of the data are consistent with the original data: where μ X″ , σ X″ is the mean and standard deviation of the data set after processing in the previous stages, μ X , σ X are the mean and standard deviation of the original data set.
[0018] Preferably, the weight setting formula in step S12 is based on the importance score of the feature, and the formula is: where FeatureImportance(i) is the original importance score of the i-th feature, C i is the correlation adjustment coefficient of the i-th feature, ξ is the adjustment factor of the correlation adjustment coefficient, and the larger ξ is, the greater the influence of the independence of the feature on the weight.
[0019] Preferably, in step S22 Generated by the following formula: in is the attention score function, which is used to calculate the weight of each time scale.
[0020] Preferably, in step S3, for (Q actual,i -Q pred,i ) 2 represents the square deviation between the actual water supply and the predicted demand in each area, represents the uneven distribution term, which ensures that the proportion of water supply actually allocated to each region is consistent with its predicted demand proportion;
[0021] When solving the objective function, the following constraints need to be met: First, the total water source limit meets Ensure that the total actual water supply in each region does not exceed the current water resource reserve, and the non-negativity constraint satisfies Make sure the actual water supply for each area must be non-negative.
[0022] Compared with the prior art, the advantages and positive effects of the present invention are that, through multi-source data fusion and multi-stage preprocessing, the problems of single data source and uneven quality in traditional methods are solved. The multi-scale temporal convolutional network combined with the adaptive weighting mechanism can accurately capture the periodicity and sudden fluctuations of water supply demand; the dynamic allocation objective function is introduced to minimize the deviation between supply and demand and balance resource allocation, avoiding the waste of resources or unreasonable allocation problems in traditional methods. DETAILED DESCRIPTION
[0023] In order to more clearly understand the above-mentioned purpose, features and advantages of the present invention, the present invention is further described below in conjunction with embodiments. It should be noted that the embodiments of the present application and the features in the embodiments can be combined with each other without conflict.
[0024] In the following description, many specific details are set forth to facilitate a full understanding of the present invention. However, the present invention may also be implemented in other ways than those described herein. Therefore, the present invention is not limited to the specific embodiments of the following disclosure.
[0025] Embodiment, the existing water supply demand prediction method and resource allocation technology are mainly based on historical data or simple statistical models, and have problems such as slow response speed, low accuracy, lack of real-time adaptive ability, etc., which are difficult to meet the complex and changeable water supply needs of modern cities. In order to effectively solve this problem, the present invention proposes a water supply demand prediction and resource allocation method based on an adaptive prediction model and a dynamic resource allocation strategy, which realizes accurate prediction of water supply demand in multiple regions and efficient and dynamic allocation of resources.
[0026] First, in order to solve the problems of diverse data sources, data noise and inconsistent formats, the present invention uses real-time acquisition of key data affecting water supply demand from multiple external data sources. After data collection is completed, data cleaning and multi-stage standardization preprocessing are performed. First, the data is nonlinearly normalized by combining logarithmic and power changes to adapt it to different growth and change trends: Where X i is the original data, δ is the threshold of logarithmic transformation, α is the scaling factor, and β is the nonlinear exponential factor; then in the data fusion stage, a dynamic weight normalization process is designed to enhance the model's sensitivity to important features: where X′ max , X′ minis the minimum and maximum value in the data set after processing in the previous stage, ω i is the dynamic weight of the i-th feature. The weight setting formula is based on the importance score of the feature. The formula is: where FeatureImportance(i) is the original importance score of the i-th feature, C i is the correlation adjustment coefficient of the i-th feature, ξ is the adjustment factor of the correlation adjustment coefficient, and the larger the ξ, the greater the influence of the independence of the feature on the weight; finally, before the data is integrated and output, the data is scaled to maintain distribution to ensure that the distribution characteristics of the data are consistent with the original data: where μ X″ , σ X″ is the mean and standard deviation of the data set after processing in the previous stages, μ X , σ X is the mean and standard deviation of the original data set. This data processing effectively solves the problem of complex data sources and uneven quality, greatly improves the accuracy and uniformity of model input data, and lays a solid data foundation for subsequent prediction and allocation.
[0027] In order to achieve high-precision water supply demand forecasting, especially real-time forecasting under demand fluctuations or sudden increases, the present invention constructs a forecasting model based on a multi-scale temporal convolutional network combined with an adaptive weighting mechanism. First, a multi-scale convolution module is constructed, each module uses a different convolution kernel size and expansion rate, and the l-th layer multi-scale convolution outputs h (l) The formula is: (l) =[Conv1D(h (l-1) ,k1,d1),Conv1D(h (l-1) ,k2,d2)...,Conv1D(h (l-1) ,k m ,d m )], where Conv1D(h (l-1) ,k i ,d i ) indicates that the kernel size is k i , the expansion rate is d i One-dimensional convolution operation, different convolution kernel sizes and expansion rates are used to extract multi-scale features. After the multi-scale convolution output of each layer, an adaptive weighting mechanism is added to assign weights to each time scale feature. The weights are dynamically generated by the attention module to ensure that the model pays attention to the key time scale at different times. The adaptive weighting calculation is: in is the adaptive weight of the i-th time scale of the l-th layer, Generated by the following formula: in is the attention score function, which is used to calculate the weight of each time scale; after the adaptive weighted output of each layer, residual connection and layer normalization are added, and the added formula is: LayerNorm is a layer normalization operation; finally, the output of the last layer is converted into the prediction result of the final water supply demand through the adaptive prediction layer. The short-term and long-term time series features are extracted through a multi-scale convolutional network, and the weights of the features of different time scales are dynamically adjusted using an adaptive weighting mechanism, so that the model can maintain a high prediction accuracy when dealing with periodic and temporary fluctuations in water supply demand. This solution effectively solves the problem of low prediction accuracy and slow response of traditional static models when demand fluctuates greatly, realizes accurate prediction of complex water supply demand, and ensures the real-time and accuracy of the prediction results.
[0028] In order to reasonably and efficiently allocate water resources to meet the different needs of various regions under the condition of limited water supply resources, the present invention adopts a dynamic allocation objective function scheme in the resource allocation stage. Specifically, by designing a dual optimization objective function of minimizing the supply-demand deviation and balancing the allocation ratio, combined with the constraint of the total resource reserve, it ensures that the allocation scheme maximizes the utilization of water resources while meeting the needs of various regions. The objective function is: Where Q actual,i , Q pred,i Represent the actual water supply and predicted demand in the region, R current represents the total amount of current water resources reserves, α and β are the weights of the two items. actual,i -Q pred,i ) 2 represents the square deviation between the actual water supply and the predicted demand in each area, represents the distribution imbalance term, which ensures that the proportion of water supply actually allocated to each region is consistent with its predicted demand proportion; when solving this objective function, the following constraints need to be met: first, the total water source limit satisfies Ensure that the total actual water supply in each region does not exceed the current water resource reserve, and the non-negativity constraint satisfies Ensure that the actual water supply in each area must be non-negative. This solution effectively solves the problem of resource waste or insufficient allocation in the traditional static allocation method, realizes dynamic optimization and reasonable allocation of resources, and greatly improves the overall efficiency of the water supply system.
[0029] Finally, in order to maintain the prediction accuracy and allocation stability of the model in long-term operation, the present invention introduces a feedback and continuous optimization mechanism to regularly obtain actual water consumption data and calculate the deviation from the predicted value. Regularly obtain the actual water consumption data of each area, calculate the deviation between the actual demand and the predicted demand, and adjust the parameters of the adaptive prediction model through feedback to achieve continuous optimization of the prediction model, specifically including calculating the prediction deviation ΔQ(t) = Q actual (t)-Q pred (t), where t is the prediction time period, and the deviation ΔQ(t) is used to update the model parameters; this feedback and continuous optimization solves the problem of prediction error accumulation during long-term use of the model, and enables the model to have adaptive adjustment capabilities. The water supply demand prediction and resource allocation method of the present invention solves the deficiencies of the prior art in data accuracy, prediction accuracy, resource allocation and system adaptability by introducing targeted technical solutions at each stage of data collection, water supply demand prediction, resource allocation and feedback optimization, and achieves the effect of comprehensively improving the water supply management system.
[0030] The above description is only a preferred embodiment of the present invention and does not limit the present invention in other forms. Any technician familiar with the profession may use the technical content disclosed above to change or modify it into an equivalent embodiment with equivalent changes and apply it to other fields. However, any simple modification, equivalent change and modification made to the above embodiment based on the technical essence of the present invention without departing from the content of the technical solution of the present invention still falls within the protection scope of the technical solution of the present invention.
Claims
1. A method for water supply demand forecasting and resource allocation, characterized in that: The following steps are involved: S1. First, obtain the influencing factor data from external data sources including meteorological data, historical water use data, holiday data, and population density data, and perform dynamic multi-stage standardization on the data to form an input data set D in a unified format. cleaned ; S2, then build an adaptive weighted multi-scale temporal convolutional network model based on the standardized data set to predict water supply demand, where demand prediction includes building a demand prediction model and inputting the cleaning data set D in the current cycle. cleaned Make predictions to obtain the predicted water supply demand, where the model has adaptive characteristics and can automatically adjust the model parameters when new data is updated; S3, then calculate and allocate the optimal water supply to each area based on the predicted water supply demand and current water resource reserves, and the objective function is: Where Q actual,i , Q pred,i They represent the actual water supply and predicted demand in the region, R current represents the total amount of current water resources reserves, α and β are the weights of the two items; In step S3, for (Q actual,i -Q pred,i ) 2 represents the square deviation between the actual water supply and the predicted demand in each area, represents the uneven distribution term, which ensures that the proportion of water supply actually allocated to each region is consistent with its predicted demand proportion; When solving the objective function, the following constraints need to be met: First, the total water source limit meets Ensure that the total actual water supply in each region does not exceed the current water resource reserve, and the non-negativity constraint satisfies Ensure that the actual water supply of each area must be non-negative; S4. Finally, the actual water consumption data of each area is obtained regularly, the deviation between the actual demand and the predicted demand is calculated, and the parameters of the adaptive prediction model are adjusted through feedback to achieve continuous optimization of the prediction model, specifically including calculating the prediction deviation ΔQ(t) = Q actual (t)-Q pred (t), where t is the forecast time period, and the deviation ΔQ(t) is used to update the model parameters; The establishment of the adaptive weighted multi-scale temporal convolutional network model and the realization of the adaptive characteristics in step S2 are as follows: S21. First, we construct a multi-scale convolution module. Each module uses a different convolution kernel size and expansion rate. The l-th layer multi-scale convolution outputs h (l) The formula is: (l) =[Conv1D(h (l-1) ,k1,d1),Conv1D(h (l-1) ,k2,d2)...,Conv1D(h (l -1) ,k m ,d m )], where Conv1D(h (l-1) ,k i ,d i ) indicates that the kernel size is k i , the expansion rate is d i One-dimensional convolution operation, different convolution kernel sizes and expansion rates can achieve multi-scale feature extraction; S22. After the multi-scale convolution output of each layer, an adaptive weighting mechanism is added to assign weights to each time scale feature. The weights are dynamically generated by the attention module to ensure that the model pays attention to the key time scales at different times. The adaptive weighting calculation is: in is the adaptive weight of the i-th time scale of the l-th layer; S23. After the adaptive weighted output of each layer, add residual connection and layer normalization, and add the formula as follows: Among them, LayerNorm is the layer normalization operation; S24. Finally, the output of the last layer is converted into the prediction result of the final water supply demand through the adaptive prediction layer.
2. A method for water supply demand forecasting and resource allocation according to claim 1, characterized in that: The implementation steps of the dynamic multi-stage standardization process are: S11. First, the data is nonlinearly normalized by combining logarithmic and power changes to adapt it to different growth and change trends: Where X i is the original data, δ is the threshold of logarithmic transformation, α is the scaling factor, and β is the nonlinear exponential factor; S12. Then, in the data fusion stage, a dynamic weight normalization process is designed to enhance the model's sensitivity to important features: where X′ max , X′ min is the minimum and maximum value in the data set after processing in the previous stage, ω i is the dynamic weight of the i-th feature; S13. Finally, before the data is integrated and output, the data is scaled to maintain distribution to ensure that the distribution characteristics of the data are consistent with the original data: where μ X″ , σ X″ is the mean and standard deviation of the data set after processing in the previous stages, μ X , σ X are the mean and standard deviation of the original data set.
3. A method for water supply demand forecasting and resource allocation according to claim 2, characterized in that: The weight setting formula in step S12 is based on the importance score of the feature, and the formula is: where FeatureImportance(i) is the original importance score of the i-th feature, C i is the correlation adjustment coefficient of the i-th feature, ξ is the adjustment factor of the correlation adjustment coefficient, and the larger ξ is, the greater the influence of the independence of the feature on the weight.
4. A method for water supply demand forecasting and resource allocation according to claim 1, characterized in that: In step S22 Generated by the following formula: in is the attention score function, which is used to calculate the weight of each time scale.
Citation Information
Patent Citations
Short-term Load Forecasting Method Based on TCN and IPSO-LSSVM Combined Model
AU2020104000A4
Thrust distribution method and system considering propeller performance
CN118466228A