A water supply water volume prediction method based on BP neural network and multivariate nonlinear regression model
Patent Information
- Application Number
- CN202611308531.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2026-08-27
- Publication Date
- 2026-10-30
AI Technical Summary
供水系统具有明显的近期依赖和周期特征,固定或被动学习的权重无法动态响应突发工况;动态权重法采用类似指数平滑的方法,赋予近期数据更高权重,但该方法忽略了供水数据的波动特性,在早晚高峰、寒潮来临等的用水量剧烈波动时期,较早的历史数据往往比平稳期的近期数据更具参考价值
[0041]本实施例通过引入残差学习机制,将回归模型输出的主体趋势作为先验输入,迫使神经网络专注于拟合复杂的非线性残差,显著降低了模型收敛难度并提升了训练效率。同时,将滞后阶数敏感度因子向量作为独立输入特征,赋予了网络显式的注意力引导,使其能够快速锁定关键历史时刻,解决了传统方法权重调整滞后的问题。特别地,本实施例设计了包含峰值惩罚项的复合损失函数,在训练过程中动态加大对高峰时段预测偏差的惩罚力度,有效克服了供水预测中常见的高峰低估问题。本步骤在增强模型对突变工况响应灵敏度的同时,显著抑制了过拟合风险,使最终预测曲线在平峰期更平滑、在高峰期更贴合实际,全面提升了模型的工程实用价值。
Smart Images

Figure CN123014331A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of water supply volume prediction technology, and in particular to a water supply volume prediction method based on BP neural network and multivariate nonlinear regression model. Background Technology
[0002] Existing water supply prediction methods using BP neural networks and multivariate nonlinear regression models typically obtain predicted water supply from the two models separately and then fuse them using weighting coefficients. However, in existing combined prediction models, BP neural networks usually only use raw meteorological data, date characteristics, and historical water volume directly as input. This method fails to effectively utilize the residual information generated by the regression model, causing the neural network to need to relearn the main trend already fitted by the regression model, resulting in wasted computational resources and slow convergence.
[0003] Meanwhile, existing water supply forecasting technologies typically employ fixed-weight or dynamic-weight methods to process historical water supply sequences. However, the fixed-weight method directly inputs historical water volume as an independent feature into the model, implicitly assuming that each lag order has the same weight influencing the current forecast, or passively learns weights through model training. Water supply systems exhibit significant short-term dependence and cyclical characteristics, making fixed or passively learned weights unable to dynamically respond to sudden operational situations. The dynamic-weight method uses a method similar to exponential smoothing, assigning higher weights to recent data. However, this method ignores the volatile nature of water supply data; during periods of drastic water consumption fluctuations, such as morning and evening peak hours or cold waves, earlier historical data is often more valuable than recent data from stable periods. Summary of the Invention
[0004] To address the aforementioned technical problems, this invention provides a water supply volume prediction method based on a BP neural network and a multivariate nonlinear regression model, which solves the problems existing in the prior art.
[0005] This invention provides a method for predicting water supply volume based on a BP neural network and a multivariate nonlinear regression model. The method includes the following steps:
[0006] S1: Obtain historical data for N consecutive days for the target water supply area and construct the original dataset;
[0007] S2: Perform data preprocessing operations on the original dataset to obtain a preprocessed dataset;
[0008] S3: Construct a lag order sensitivity factor based on the preprocessed dataset;
[0009] S4: Construct a modified multivariate nonlinear regression model with a dynamically weighted history term based on the lag order sensitivity factor;
[0010] S5: Construct a BP neural network model that integrates regression results, predict the residual prediction value of the modified multivariate nonlinear regression model, and calculate the final predicted water supply at time t based on this.
[0011] Preferably, S3 specifically comprises:
[0012] S3.1: Define the historical water volume lag vector;
[0013] S3.2: Calculate the fluctuation intensity within the sliding window of each lag term in the historical water volume lag vector;
[0014] S3.3: Construct a lag order sensitivity factor based on the fluctuation intensity within the sliding window of each lag term.
[0015] Preferably, in step S3.1, historical water supply sequence data is extracted from the preprocessed dataset, a maximum lag order p is set, and a historical water supply lag vector Q for the current time t is constructed. L (t), the expression is:
[0016] ;
[0017] In the formula, The lag term is the value of the sampled points k points backward from time t in the normalized historical water supply sequence data, where k is the lag order index, k∈{1,2,…,p}, and p is the maximum lag order.
[0018] Preferably, step S3.2 specifically involves: setting the sliding window length to w, and calculating the fluctuation intensity σ of the k-th lag term within the window. k The expression is:
[0019] ;
[0020] In the formula, σ k Let be the fluctuation intensity of the k-th lag term within the window, w be the sliding window length, and i be the time index within the sliding window. Let k be the lag term at time i within the window. For all within the window The arithmetic mean.
[0021] Preferably, in step S3.3, the formula for calculating the hysteresis order sensitivity factor is:
[0022] ;
[0023] In the formula, Let σ be the sensitivity factor for the k-th lag term, e be the natural constant, α be the sensitivity adjustment coefficient, and σ be the sensitivity factor. kLet σ be the fluctuation intensity of the k-th lag term within the window. j Let be the fluctuation intensity of the j-th lag term, where j represents all lag orders from 1 to p.
[0024] Preferably, in step S4, the modified multivariate nonlinear regression model with dynamically weighted historical terms is constructed, and its expression is:
[0025] ;
[0026] In the formula, To correct the predicted water supply at time t output by the multivariate nonlinear regression model, β0 is the intercept term of the corrected multivariate nonlinear regression model, β k Let be the regression coefficient of the k-th lag water supply term. Let be the sensitivity factor for the k-th lag term, and ⊙ be the Hadamard product. The lag term represents the value of the normalized historical water supply sequence data, k sampling points prior to time t. p is the maximum lag order, and M is the total number of input variables other than historical water volume. Let be the regression coefficient of the m-th non-historical variable. Let m be the nonlinear basis function of the m-th non-historical variable. Let ε be the normalized value of the m-th non-historical variable at time t, and let ε be the model residual term.
[0027] Preferably, in step S5, the input feature vector I(t) of the BP neural network model is:
[0028] ;
[0029] In the formula, Let M be the m-th normalized meteorological and date-related variable, where M is the total number of input variables excluding historical water volume. To correct the predicted water supply at time t output by the multivariate nonlinear regression model, Λ is the lag order sensitivity factor vector. This is a characteristic of lagged residuals.
[0030] Preferably, the BP neural network model adopts a three-layer feedforward neural network architecture, including an input layer, a hidden layer, and an output layer; the input layer has N nodes. in The dimension of the input feature vector I(t) is equal to the number of nodes N in the hidden layer. hid Based on Kolmogorov's theorem and empirical formulas, N is determined to be... hid =2N in+1, the activation function is the hyperbolic tangent function tanh, because its output mean is 0, which is beneficial to speed up convergence; in the output layer, the number of nodes is 1, and the output is the residual prediction value of the modified multivariate nonlinear regression model at time t, and the activation function is the linear function Purelin.
[0031] Preferably, the final water supply prediction value at time t is:
[0032] ;
[0033] In the formula, The final predicted water supply at time t, To correct the predicted water supply at time t output by the multivariate nonlinear regression model, The residual correction value is obtained from the prediction of the BP neural network model at time t;
[0034] The loss function L is defined as a combination of mean squared error and peak penalty term, expressed as:
[0035] ;
[0036] In the formula, N is the total number of training samples. The normalized water supply actually observed at time t. The peak penalty weighting coefficient is used. This is the peak penalty item.
[0037] Preferably, the expression for the peak penalty term is:
[0038] ;
[0039] In the formula, For the set peak threshold, This is the largest water volume in history.
[0040] The embodiments of the present invention have the following technical effects:
[0041] This embodiment introduces a residual learning mechanism, using the main trend output by the regression model as prior input. This forces the neural network to focus on fitting complex nonlinear residuals, significantly reducing the model's convergence difficulty and improving training efficiency. Simultaneously, by using the lag order sensitivity factor vector as an independent input feature, the network receives explicit attention guidance, enabling it to quickly pinpoint key historical moments and solving the problem of lag in weight adjustment in traditional methods. Specifically, this embodiment designs a composite loss function including a peak penalty term, dynamically increasing the penalty for prediction bias during peak periods during training, effectively overcoming the common problem of peak underestimation in water supply forecasting. This step enhances the model's sensitivity to sudden changes in operating conditions while significantly suppressing overfitting risk, resulting in a smoother prediction curve during off-peak periods and a more realistic prediction curve during peak periods, comprehensively improving the model's engineering practical value.
[0042] This embodiment introduces a lag order sensitivity factor, assigning weights based on the fluctuation intensity of historical data. This allows the model to automatically focus on highly sensitive historical moments during periods of drastic water consumption changes, significantly improving the model's response speed to peak water volumes and sudden events. Simultaneously, it effectively suppresses the interference of random noise during stable periods, preventing model overfitting. This embodiment also introduces an adjustment coefficient α to adapt to the water consumption characteristics of different regions, greatly enhancing the model's interpretability. This allows dispatchers to intuitively understand the differences in the contribution of historical data to the prediction results, thereby achieving better prediction accuracy under complex conditions such as cold waves and holidays. Attached Figure Description
[0043] To more clearly illustrate the specific embodiments of the present invention or the technical solutions in the prior art, the drawings used in the description of the specific embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are some embodiments of the present invention. For those skilled in the art, other drawings can be obtained from these drawings without creative effort.
[0044] Figure 1 This is a flowchart of a water supply volume prediction method based on a BP neural network and a multivariate nonlinear regression model provided in an embodiment of the present invention;
[0045] Figure 2 This is a flowchart of constructing a lag order sensitivity factor based on the preprocessed dataset provided in an embodiment of the present invention;
[0046] Figure 3 This is a comparison and enlarged view of water supply prediction curves under sudden cold wave conditions provided in the embodiments of the present invention;
[0047] Figure 4 This is a comparative bar chart of the prediction residuals of each model provided in the embodiments of the present invention. Detailed Implementation
[0048] To make the objectives, technical solutions, and advantages of this invention clearer, the technical solutions of this invention will be clearly and completely described below. Obviously, the described embodiments are only a part of the embodiments of this invention, and not all of them. Based on the embodiments of this invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of this invention.
[0049] Example 1, Figure 1 A flowchart of a water supply volume prediction method based on a BP neural network and a multivariate nonlinear regression model is shown, as follows: Figure 1 As shown, a method for predicting water supply volume based on a BP neural network and a multivariate nonlinear regression model includes the following steps:
[0050] S1: Obtain historical data for N consecutive days for the target water supply area and construct the original dataset;
[0051] The historical data includes: historical water supply sequence Q(t), meteorological data, date type identifier data, and population activity intensity index P(t); the meteorological data includes the temperature T of the target water supply area. a The date type is defined as weekday / weekend / holiday, denoted as D_type(t), where H(t) represents humidity, R(t) represents rainfall, and H(t) represents humidity.
[0052] The historical data was sampled at an interval of 1 hour, and the acquired historical data was used to construct the original dataset.
[0053] S2: Perform data preprocessing operations on the original dataset to obtain a preprocessed dataset;
[0054] The data preprocessing operations include data cleaning and data normalization. Specifically, the data cleaning operation involves: for any variable in the original dataset, outlier identification is performed using the 3σ criterion; data points identified as outliers are not directly deleted but removed from the original dataset, and a missing data flag is set at the corresponding position in the original dataset. Then, missing data imputation is performed, using a two-way weighted average method.
[0055] The normalization process specifically involves using the Min-Max linear transformation method to map the variable data in the original dataset after data cleaning to the closed interval [0,1] to obtain the preprocessed dataset.
[0056] S3: Construct a lag order sensitivity factor based on the preprocessed dataset;
[0057] In existing water supply forecasting technologies, when integrating BP neural networks with multivariate nonlinear regression models, the processing of historical water supply sequences typically employs either a fixed-weight method or a dynamic-weight method. However, the fixed-weight method directly inputs historical water volume as an independent feature into the model, implicitly assuming that the weights of each lag order have the same impact on the current forecast, or passively learns weights through model training. Water supply systems exhibit significant short-term dependence and cyclical characteristics, making fixed or passively learned weights unable to dynamically respond to sudden operational conditions. The dynamic-weight method uses a method similar to exponential smoothing, assigning higher weights to recent data. However, this method ignores the volatile characteristics of water supply data. During periods of drastic water consumption fluctuations, such as morning and evening peak hours or the arrival of cold waves, earlier historical data is often more valuable than recent data from stable periods.
[0058] Based on this, this embodiment constructs a lag order sensitivity factor to assess the importance of historical data, thereby improving prediction sensitivity.
[0059] Specifically, such as Figure 2 As shown, S3 specifically includes:
[0060] S3.1: Define the historical water volume lag vector;
[0061] In this step, historical water supply sequence data is extracted from the preprocessed dataset, the maximum lag order p is set, and the historical water supply lag vector Q at the current time t is constructed. L (t), the expression is:
[0062] ;
[0063] In the formula, The lag term represents the value of k sampling points prior to time t in the normalized historical water supply sequence data. k is the lag order index, k∈{1,2,…,p}, and p is the maximum lag order, set according to the water supply periodicity. In this embodiment, the sampling interval is 1 hour, and p=24 is chosen to cover the past 24 hours and capture daily periodic characteristics.
[0064] S3.2: Calculate the fluctuation intensity within the sliding window of each lag term in the historical water volume lag vector;
[0065] To measure the intensity of fluctuations in different lag orders over historical periods, the sample standard deviation from statistics is introduced as a measure of fluctuation intensity. Specifically, S3.2 involves setting the sliding window length to w and calculating the fluctuation intensity σ of the k-th lag term within the window. k The expression is:
[0066] ;
[0067] In the formula, σk Let represent the fluctuation intensity of the k-th lag term within the window, w be the sliding window length in units of sampling points (in this embodiment, w = 168, representing 7 consecutive days of data to capture periodic characteristics), and i be the time index within the sliding window, ranging from [t−w, t−1]. Let k be the lag term at time i within the window. For all within the window The arithmetic mean.
[0068] The larger the fluctuation intensity value, the more drastic the changes in the historical data corresponding to that lag order over a period of time. For example, if the fluctuation intensity corresponding to k=24 is large, it means that the water consumption at that moment varies greatly from day to day, and the historical data at that moment has high reference value and sensitivity for predicting the current value.
[0069] S3.3: Construct a lag order sensitivity factor based on the fluctuation intensity within the sliding window of each lag term;
[0070] To convert fluctuation intensity into a usable weighting factor for the model and eliminate the influence of different dimensions, the Softmax function is used to normalize the fluctuation intensity within the sliding window of each lag term. Simultaneously, an adjustment coefficient α is introduced to enhance expressive power. The formula for calculating the lag order sensitivity factor is as follows:
[0071] ;
[0072] In the formula, Let be the sensitivity factor for the k-th lag term, with a range of (0,1), and for all orders... The sum is 1, e is the natural constant, approximately equal to 2.71828, α is the sensitivity adjustment coefficient, α>0. In this embodiment, α=1.5, σ k Let σ be the fluctuation intensity of the k-th lag term within the window. j Let be the fluctuation intensity of the j-th lag term, where j represents all lag orders from 1 to p.
[0073] α is used to adjust the differences between varying fluctuation intensities. Increasing α amplifies the advantages of high-fluctuation terms, making the weight distribution more acute; decreasing α makes the weights more evenly distributed. Optimizing the α value through grid search allows the model to better adapt to the water usage characteristics of a specific region.
[0074] This step introduces a lag order sensitivity factor, assigning weights based on the intensity of fluctuations in historical data. This allows the model to automatically focus on highly sensitive historical moments during periods of drastic water consumption changes, significantly improving the model's response speed to peak water volumes and sudden events. Simultaneously, it effectively suppresses the interference of random noise during stable periods, preventing model overfitting. This step also introduces an adjustment coefficient α to adapt to the water consumption characteristics of different regions, greatly enhancing the model's interpretability. This allows dispatchers to intuitively understand the differences in the contribution of historical data to the prediction results, thereby achieving better prediction accuracy under complex conditions such as cold waves and holidays.
[0075] S4: Construct a modified multivariate nonlinear regression model with a dynamically weighted history term based on the lag order sensitivity factor;
[0076] The modified multiple nonlinear regression model with dynamically weighted historical terms is constructed to describe the relationship between water supply and various influencing factors. The expression is as follows:
[0077] ;
[0078] In the formula, To correct the predicted water supply at time t in the output of the multivariate nonlinear regression model, β0 is the intercept term of the modified multivariate nonlinear regression model, used to correct for system bias. k Let be the regression coefficient of the k-th lag water supply term, representing the basic contribution of this lag order in the model. This coefficient is obtained through least squares training. Let be the sensitivity factor for the k-th lag term, ⊙ be the Hadamard product, Q(t−k) be the lag term, be the value of the normalized historical water supply sequence data at k sampling points prior to time t, p be the maximum lag order, and M be the total number of input variables other than historical water volume. The regression coefficient for the m-th non-historical variable is obtained through training and optimization. This is the nonlinear basis function for the m-th non-historical variable, used to capture the nonlinear effects of factors such as weather. In this embodiment, a square function is used for temperature variables, a logarithmic function for humidity, and a step function for date types. Let be the normalized value of the m-th non-historical variable at time t, and ε be the model residual term, which follows a normal distribution with a mean of 0 and represents the system noise not explained by the model.
[0079] In this step, the maximum likelihood estimation method with regularization terms is used to solve for the model parameters. The gradient descent algorithm is used to minimize the loss function J(Θ), and the parameters are iteratively updated until convergence, thus obtaining the trained modified regression model.
[0080] S5: Construct a BP neural network model that integrates regression results, predict the residual prediction value of the modified multivariate nonlinear regression model, and calculate the final predicted water supply at time t based on this.
[0081] In existing combined prediction models, BP neural networks typically use only raw meteorological data, date characteristics, and historical water volume as input. This method fails to effectively utilize the residual information generated by the regression model, causing the neural network to need to relearn the main trend already fitted by the regression model, resulting in wasted computational resources and slow convergence. To address this, this invention constructs a BP neural network training scheme that deeply integrates regression results.
[0082] Unlike traditional methods, this embodiment constructs a high-information-density input vector I(t), which integrates the original features, regression predictions, and lag order sensitivity factors. Therefore, the input feature vector I(t) of the BP neural network model is:
[0083] ;
[0084] In the formula, Let M be the m-th normalized meteorological and date-related variable, where M is the total number of input variables excluding historical water volume. To correct the predicted water supply at time t output by the multivariate nonlinear regression model, this value is introduced to input the main trend captured by the regression model as prior knowledge into the neural network, guiding the BP neural network to focus on fitting the nonlinear residuals; Λ is the lag order sensitivity factor vector, expressed as: This explicitly tells the neural network which historical data points in the current input sequence have higher weights, accelerating the network's convergence to key features. The lag residual feature represents the actual prediction bias of the regression model at the previous time step. This feature is used to simulate the dynamic propagation process of the error and helps the BP neural network perceive the systematic shift of the regression model.
[0085] The BP neural network model adopts a three-layer feedforward neural network architecture, including an input layer, a hidden layer, and an output layer; the input layer has N nodes. in The dimension of the input feature vector I(t) is equal to the number of nodes N in the hidden layer. hid Based on Kolmogorov's theorem and empirical formulas, N is determined to be... hid =2N in +1, the activation function is the hyperbolic tangent function tanh, because its output mean is 0, which is beneficial to speed up convergence; in the output layer, the number of nodes is 1, and the output is the residual prediction value of the modified multivariate nonlinear regression model at time t. The activation function is the linear function Purelin, so as to ensure that the range of the output value is not limited, which is convenient for subsequent superposition with the regression prediction value.
[0086] It is worth emphasizing that the output of this model is the residual prediction value of the modified multiple nonlinear regression model at time t. In other words, this embodiment uses a residual learning strategy, predicting the residuals rather than the final water volume directly. Therefore, the final water supply prediction value at time t is:
[0087] ;
[0088] In the formula, The final predicted water supply at time t, To correct the predicted water supply at time t output by the multivariate nonlinear regression model, The residual correction value is obtained from the prediction of the BP neural network model at time t.
[0089] The loss function L is defined as a combination of mean squared error and peak penalty term, expressed as:
[0090] ;
[0091] In the formula, N is the total number of training samples. The normalized water supply actually observed at time t. ξ is the peak penalty weighting coefficient, which is set to 0.3 in this embodiment to increase the penalty for prediction deviation during peak periods. This is the peak penalty item.
[0092] Furthermore, the expression for the peak penalty term is:
[0093] ;
[0094] In the formula, The set peak threshold, in this embodiment, is 1.2 times the average daily water volume. This is the largest water volume in history.
[0095] The BP neural network model is trained using the Levenberg-Marquardt (LM) algorithm combined with Dropout technology. The dataset is divided into a training set (70%), a validation set (15%), and a test set (15%) in chronological order. Dropout is applied to the hidden layers with a random deactivation ratio of 0.2, meaning that 20% of the hidden layer neuron connections are randomly ignored in each iteration to prevent the model from over-relying on specific features and enhance generalization ability. The initial learning rate is set to 0.01. If the loss on the validation set does not decrease for 5 consecutive iterations, the learning rate is multiplied by a decay factor of 0.5. The validation set loss is monitored. When the validation set loss no longer decreases for 10 consecutive iterations, training is terminated, and the model parameters with the minimum validation set loss are rolled back to prevent overfitting. The gradient of the loss function with respect to each weight is calculated using the backpropagation algorithm, and the weight matrix and bias vector are updated using the LM algorithm.
[0096] Figure 3 This image shows a comparison and magnified view of the water supply prediction curves under the condition of a sudden cold wave. The black solid line represents the actual water supply, which shows a significant and steep increase at t=36 due to the cold wave. The red dashed line represents the prediction result of the traditional BP neural network, which exhibits severe lag at the abrupt change and an overly smooth overall curve. The orange dotted line is the output of the modified regression model in this embodiment. Although it effectively captures the main trend, the peak prediction is still insufficient. The green solid line output by this embodiment closely matches the actual value curve, which can be clearly seen, especially in the magnified view of the abrupt change window in the lower right corner. With the guidance of the residual learning mechanism and the sensitivity factor, it achieves rapid response and accurate tracking of sudden conditions, significantly overcoming the prediction bias of traditional methods during peak and abrupt change periods.
[0097] Figure 4 The bar chart comparing the prediction residuals of each model intuitively reflects the pointwise error distribution between the predicted and actual values. In the chart, the error bars of the traditional BP neural network have large amplitudes and fluctuate wildly. Although the error of the regression model has been reduced, there is still a significant systematic bias. In contrast, the green error bars corresponding to this embodiment have extremely small amplitudes and the narrowest fluctuation range. This fully demonstrates that after introducing the dynamic weighted history term and the peak penalty loss function, the residual learning strategy successfully suppressed the complex nonlinear error, greatly improved the overall fitting accuracy of the model and its ability to correct extreme data, and ensured the high reliability of the prediction results.
[0098] This embodiment introduces a residual learning mechanism, using the main trend output by the regression model as prior input. This forces the neural network to focus on fitting complex nonlinear residuals, significantly reducing the model's convergence difficulty and improving training efficiency. Simultaneously, by using the lag order sensitivity factor vector as an independent input feature, the network receives explicit attention guidance, enabling it to quickly pinpoint key historical moments and solving the problem of lag in weight adjustment in traditional methods. Specifically, this embodiment designs a composite loss function including a peak penalty term, dynamically increasing the penalty for prediction bias during peak periods during training, effectively overcoming the common problem of peak underestimation in water supply forecasting. This step enhances the model's sensitivity to sudden changes in operating conditions while significantly suppressing overfitting risk, resulting in a smoother prediction curve during off-peak periods and a more realistic prediction curve during peak periods, comprehensively improving the model's engineering practical value.
[0099] Example 2: The present invention also provides an electronic device, including one or more processors and a memory.
[0100] A processor can be a central processing unit (CPU) or other form of processing unit with data processing and / or instruction execution capabilities, and can control other components in an electronic device to perform desired functions.
[0101] The memory may include one or more computer program products, which may include various forms of computer-readable storage media, such as volatile memory and / or non-volatile memory. The volatile memory may include, for example, random access memory (RAM) and / or cache memory. The non-volatile memory may include, for example, read-only memory (ROM), hard disk, flash memory, etc. One or more computer program instructions may be stored on the computer-readable storage medium, and the processor may execute the program instructions to implement the water supply prediction method based on a BP neural network and a multivariate nonlinear regression model described above in any embodiment of this application, and / or other desired functions. Various contents such as initial extrinsic parameters and thresholds may also be stored in the computer-readable storage medium.
[0102] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention, and not to limit them; although the present invention has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that modifications can still be made to the technical solutions described in the foregoing embodiments, or equivalent substitutions can be made to some or all of the technical features; and these modifications or substitutions do not cause the essence of the corresponding technical solutions to deviate from the technical solutions of the embodiments of the present invention.
Claims
1. A method for predicting water supply volume based on a BP neural network and a multivariate nonlinear regression model, characterized in that, The method includes the following steps: S1: Obtain historical data for N consecutive days for the target water supply area and construct the original dataset; S2: Perform data preprocessing operations on the original dataset to obtain a preprocessed dataset; S3: Construct a lag order sensitivity factor based on the preprocessed dataset; S4: Construct a modified multivariate nonlinear regression model with a dynamically weighted history term based on the lag order sensitivity factor; S5: Construct a BP neural network model that integrates regression results, predict the residual prediction value of the modified multivariate nonlinear regression model, and calculate the final predicted water supply at time t based on this.
2. The water supply volume prediction method based on BP neural network and multivariate nonlinear regression model according to claim 1, characterized in that, Specifically, S3 is: S3.1: Define the historical water volume lag vector; S3.2: Calculate the fluctuation intensity within the sliding window of each lag term in the historical water volume lag vector; S3.3: Construct a lag order sensitivity factor based on the fluctuation intensity within the sliding window of each lag term.
3. The water supply prediction method based on BP neural network and multivariate nonlinear regression model according to claim 2, characterized in that, In step S3.1, historical water supply sequence data is extracted from the preprocessed dataset, a maximum lag order p is set, and a historical water supply lag vector Q is constructed for the current time t. L (t), the expression is: ; In the formula, The lag term is the value of the sampled points k points backward from time t in the normalized historical water supply sequence data, where k is the lag order index, k∈{1,2,…,p}, and p is the maximum lag order.
4. The water supply volume prediction method based on BP neural network and multivariate nonlinear regression model according to claim 3, characterized in that, Specifically, S3.2 involves setting the sliding window length to w and calculating the fluctuation intensity σ of the k-th lag term within the window. k The expression is: ; In the formula, σ k Let be the fluctuation intensity of the k-th lag term within the window, w be the sliding window length, and i be the time index within the sliding window. Let k be the lag term at time i within the window. For all within the window The arithmetic mean.
5. The water supply volume prediction method based on BP neural network and multivariate nonlinear regression model according to claim 4, characterized in that, In S3.3, the formula for calculating the hysteresis order sensitivity factor is as follows: ; In the formula, Let σ be the sensitivity factor for the k-th lag term, e be the natural constant, α be the sensitivity adjustment coefficient, and σ be the sensitivity factor. k Let σ be the fluctuation intensity of the k-th lag term within the window. j Let be the fluctuation intensity of the j-th lag term, where j represents all lag orders from 1 to p.
6. The water supply volume prediction method based on BP neural network and multivariate nonlinear regression model according to claim 1, characterized in that, In step S4, the modified multivariate nonlinear regression model with dynamically weighted historical terms is constructed, and its expression is: ; In the formula, To correct the predicted water supply at time t output by the multivariate nonlinear regression model, β0 is the intercept term of the corrected multivariate nonlinear regression model, β k Let be the regression coefficient of the k-th lag water supply term. Let be the sensitivity factor for the k-th lag term, ⊙ be the Hadamard product, Q(t−k) be the lag term, be the value of the normalized historical water supply sequence data at k sampling points prior to time t, p be the maximum lag order, and M be the total number of input variables other than historical water volume. Let be the regression coefficient of the m-th non-historical variable. Let m be the nonlinear basis function of the m-th non-historical variable. Let ε be the normalized value of the m-th non-historical variable at time t, and let ε be the model residual term.
7. The water supply volume prediction method based on BP neural network and multivariate nonlinear regression model according to claim 1, characterized in that, In step S5, the input feature vector I(t) of the BP neural network model is: ; In the formula, Let M be the m-th normalized meteorological and date-related variable, where M is the total number of input variables excluding historical water volume. To correct the predicted water supply at time t output by the multivariate nonlinear regression model, Λ is the lag order sensitivity factor vector. This is a characteristic of lagged residuals.
8. The water supply volume prediction method based on BP neural network and multivariate nonlinear regression model according to claim 7, characterized in that, The BP neural network model adopts a three-layer feedforward neural network architecture, including an input layer, a hidden layer, and an output layer; the input layer has N nodes. in The dimension of the input feature vector I(t) is equal to the number of nodes N in the hidden layer. hid Based on Kolmogorov's theorem and empirical formulas, N is determined to be... hid =2N in +1, the activation function is the hyperbolic tangent function tanh, because its output mean is 0, which is beneficial to speed up convergence; in the output layer, the number of nodes is 1, and the output is the residual prediction value of the modified multivariate nonlinear regression model at time t, and the activation function is the linear function Purelin.
9. The water supply volume prediction method based on BP neural network and multivariate nonlinear regression model according to claim 8, characterized in that, The final predicted water supply value at time t is: ; In the formula, The final predicted water supply at time t, To correct the predicted water supply at time t output by the multivariate nonlinear regression model, The residual correction value is obtained from the prediction of the BP neural network model at time t; The loss function L is defined as a combination of mean squared error and peak penalty term, expressed as: ; In the formula, N is the total number of training samples. The normalized water supply actually observed at time t. The peak penalty weighting coefficient is... This is the peak penalty item.
10. The water supply volume prediction method based on BP neural network and multivariate nonlinear regression model according to claim 9, characterized in that, The expression for the peak penalty term is: ; In the formula, For the set peak threshold, This is the largest water volume in history.