A cross-pump station water demand collaborative prediction method based on federated learning
By using federated learning technology to track, collect, and correct the operating status of pump stations, the problem of insufficient accuracy in water demand forecasting in water supply systems has been solved, achieving higher accuracy in future water demand forecasting.
Patent Information
- Application Number
- CN202611339578.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2026-09-01
- Publication Date
- 2026-11-20
AI Technical Summary
In a water supply system, the water supply status and capacity of each pumping station are constrained by equipment parameters and operating conditions, which leads to a decrease in the accuracy of water demand forecasting during peak water usage and abnormal operating conditions.
A collaborative water demand forecasting method based on federated learning across pumping stations is adopted. By tracking and collecting the set of operating statuses of pumping stations, a confidence coefficient is determined, and the original set of statuses is corrected based on this coefficient. Then, a forecasting model is used to predict future water demand.
It improves the accuracy and real-time performance of water demand forecasting, enhances the effectiveness of forecasting models, and enables more accurate prediction of future water demand.
Smart Images

Figure CN123140339A_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of water demand forecasting technology for water supply pumping stations, specifically to, but not limited to, a collaborative water demand forecasting method across pumping stations based on federated learning. Background Technology
[0002] In water supply systems, multiple booster pump stations typically serve different areas. By collecting data on the status of each booster pump station, including total outlet flow, water pressure, operating frequency, and start / stop status, and by tracking and predicting the status of the pump stations, it is possible to flexibly predict the water demand of each area in the future.
[0003] However, in practical applications, the water supply status and capacity of each pumping station are constrained by the equipment parameters and operating status of the pumping station. Therefore, the pumping station status obtained by the above methods cannot accurately reflect the actual status of the pumping station under peak water use and abnormal operating conditions, which leads to a decrease in the accuracy of water demand prediction. Summary of the Invention
[0004] Based on the above technical problems, this application provides a collaborative prediction method for water demand across pumping stations based on federated learning, which can improve the accuracy of water demand prediction.
[0005] The technical solution provided in this application is as follows: This application provides a method for collaborative prediction of water demand across pumping stations based on federated learning, including: Track and collect the original state set; wherein, the original state set includes the set of operating states of the pump station set set by the edge node within at least one time period; the original state set includes at least the set of actual operating frequencies and the set of available states of the pump stations in the pump station set; Based on the actual operating frequency set and the available state set, determine the credibility coefficient of the original state set; The original state set is corrected based on the credibility coefficient to obtain the target state set; The prediction model performs a prediction operation based on the target state set to obtain future water demand; wherein, the future water demand includes the demand for the total outlet flow of the pump station set in at least one future time period; the prediction model is obtained by the server node and the edge node through federated learning based on the sample data set.
[0006] The cross-pump station water demand collaborative prediction method based on federated learning provided in this application has at least the following beneficial effects: The federated learning-based collaborative prediction method for cross-pump station water demand provided in this application's embodiments tracks and collects an original state set. This original state set includes the set of operating states of the pump station set at the edge nodes within at least one time period. The original state set includes at least the set of actual operating frequencies and the set of available states of the pump stations within the pump station set. This enables comprehensive tracking and collection of the operating states of the pump station set at the edge nodes. Furthermore, based on the set of actual operating frequencies and the set of available states, a reliability coefficient for the original state set is determined, establishing a correlation between the reliability coefficient and the set of actual operating frequencies and available states, thereby improving the accuracy and real-time performance of the reliability coefficient. Simultaneously, through… The credibility coefficient enables an intuitive assessment of the credibility of the original state set. On the other hand, by modifying the original state set based on the credibility coefficient to obtain the target state set, targeted modifications to the original state set can be achieved, thereby improving the effectiveness of the target state set. Based on this, the prediction model performs prediction operations based on the target state set to obtain future water demand. Future water demand includes the demand for the total outlet flow of the pump station set within at least one future time period. The prediction model is obtained by server nodes and edge nodes through federated learning based on a sample data set. Thus, by leveraging the advantages of federated learning, the accuracy of the prediction model can be improved, thereby improving the accuracy of future water demand prediction. Attached Figure Description
[0007] Figure 1 A flowchart illustrating the collaborative prediction method for cross-pump station water demand based on federated learning provided in this application embodiment; Figure 2A A comparative diagram showing the root mean square error (RMSE) of the prediction results of various training schemes provided in the embodiments of this application over the entire time period; Figure 2B A comparative diagram showing the mean absolute percentage error (MAPE) of the prediction results of various training schemes provided in the embodiments of this application over the entire time period; Figure 3A A schematic diagram showing the comparison of RMSE of prediction results for various training schemes provided in the embodiments of this application during peak periods; Figure 3B A schematic diagram showing the comparison of MAPE prediction results of various training schemes provided in the embodiments of this application during peak periods. Detailed Implementation
[0008] The technical solutions in the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings.
[0009] It should be understood that the specific embodiments described herein are merely illustrative of this application and are not intended to limit this application.
[0010] In water supply systems, multiple booster pump stations typically serve different areas. By collecting data on the total outlet flow, water pressure, operating frequency, and start / stop status of each booster pump station, and by tracking and predicting the status of the pump stations, it is possible to flexibly predict the water demand of each area in the future.
[0011] However, in practical applications, the water supply status and capacity of each pumping station are constrained by the equipment parameters and operating status of the pumping station. Therefore, the pumping station status obtained by the above methods cannot accurately reflect the actual status of the pumping station under peak water use and abnormal operating conditions, which leads to a decrease in the accuracy of water demand prediction.
[0012] Based on the above technical problems, this application provides a collaborative prediction method for water demand across pumping stations based on federated learning. Figure 1 A flowchart illustrating the collaborative water demand forecasting method across pumping stations based on federated learning provided in this application embodiment is shown below. Figure 1 As shown, the process may include the following steps: Step 101: Track and collect the original state set.
[0013] The original state set includes the set of operating states of the pump station set set by the edge node within at least one time period; the original state set includes at least the set of actual operating frequencies of the pump stations in the pump station set and the set of available states.
[0014] In some embodiments, the actual operating frequency set may include the actual operating frequency of the pumping station; for example, the outlet flow rate pumped out by the pumping station may increase as its actual operating frequency increases.
[0015] In some embodiments, the available states in the available state set can characterize whether the corresponding pumping station is in an available state. For example, if the pumping station is in an available state, it can characterize that the pumping station is currently in a normally functioning idle state and can be switched to the operating state at any time to pump water.
[0016] In some embodiments, the original state set may further include the actual operating state of the pumping station; for example, the actual operating state may characterize whether the corresponding pumping station is in operation during at least one time period.
[0017] In some embodiments, the original state set can be tracked and collected in the following manner: According to the specified collection cycle, the operating status of the pump station set is continuously collected within the collection period to obtain an initial data set. Preprocessing operations are then performed on the initial data set to obtain the original state set. The collection cycle and collection period can be predetermined, and the preprocessing operations can include missing value imputation, outlier removal, and data standardization.
[0018] In some embodiments, an edge node may include at least one node located in the water usage area; exemplarily, an edge node may include physical nodes and / or virtual nodes, and the edge node may control the operating status of each pump station in the pump station set, and may also track and collect data related to the operating status of each pump station in the pump station set; exemplarily, the data related to the operating status may include an original set of states.
[0019] Step 102: Determine the credibility coefficient of the original state set based on the actual operating frequency set and the available state set.
[0020] In some embodiments, the confidence coefficient can characterize the degree of consistency between the original state set and the actual operating state of the pump station set, that is, the confidence coefficient can characterize the confidence of the original state set; or, the confidence coefficient can also characterize the degree of matching between the original state set and the water demand corresponding to the collection period; for example, the degree of consistency or matching can increase with the increase of the confidence coefficient.
[0021] In some embodiments, the credibility coefficient can be determined in the following ways: If the number of unavailable pump stations in the available state set is greater than or equal to a quantity threshold, and the operating frequency of the pump stations in the actual operating frequency set is its peak frequency, then the confidence coefficient can be set as the first coefficient. If the number of unavailable pump stations in the available state set is less than a quantity threshold, and the operating frequency of the pump stations in the actual operating frequency set is its peak frequency, then the confidence coefficient can be set as the second coefficient. If the number of unavailable pump stations in the available state set is less than a quantity threshold, and the operating frequency of the pump stations in the actual operating frequency set is less than its peak frequency, then the confidence coefficient can be set as the third coefficient. The first coefficient can be less than the second coefficient, and the second coefficient can be less than the third coefficient.
[0022] Step 103: Correct the original state set based on the credibility coefficient to obtain the target state set.
[0023] In some embodiments, there may be at least some differences between the target state set and the original state set.
[0024] In some embodiments, the target state set can be obtained in the following way: The data to be corrected is obtained from the original state set, corresponding to the confidence coefficients that are less than or equal to the confidence threshold. Then, the data to be corrected is corrected based on the confidence coefficients to obtain the correction result. Finally, the correction result and the data in the original state set excluding the data to be corrected are determined as the target state set.
[0025] For example, magnitude correction of the data to be corrected based on the confidence coefficient can be achieved in the following way: The original state of the pump station corresponding to the credibility coefficient is continuously analyzed in the time dimension to determine its changing trend. Then, a correction strategy is determined based on the credibility coefficient and the changing trend. The magnitude of the data to be corrected is then corrected based on the correction strategy. For example, if the changing trend is non-linear, the correction strategy may include a non-linear strategy related to the credibility coefficient.
[0026] Step 104: Execute a prediction operation based on the target state set using the prediction model to obtain future water demand.
[0027] The future water demand includes the demand for the total outlet flow of the pump station set in at least one future time period; the prediction model is obtained by the server node and the edge node through federated learning based on the sample data set.
[0028] In some embodiments, the prediction model may include a neural network with time series prediction capabilities; for example, the neural network may include a long short-term memory network, a gated recurrent unit, and a temporal convolutional network, etc.
[0029] In some embodiments, future water demand can be obtained in the following ways: The target state set is input into the prediction model, which then uses the correlation between the actual original state of the pumping station and the outlet flow rate captured by federated learning to predict the future water demand.
[0030] For example, the predictive model can be set up at edge nodes, which can be used to control a collection of pump stations.
[0031] For example, after determining the future water demand, the operating status of the pumps in the pump station set can be adjusted according to the future water demand so that the total outlet flow of the pump station set can match the future water demand; for example, if the future water demand is greater than the sum of the outlet flow output by all pumps in the pump station set at the rated operating frequency, an adjustment instruction to add pumps to the pump station set can be output.
[0032] In some embodiments, the sample data set may include the original state set of a set of pump stations set up by multiple edge nodes in multiple historical time periods; for example, the process of obtaining the sample data set may be the same as the process of obtaining the original state set, and will not be described again here.
[0033] In some embodiments, the server node may be located in the cloud or on the server side, and a communication connection may be established between the server node and the edge node; the process of the server node and the edge node performing collaborative training based on the sample data set through federated learning will be described in detail below.
[0034] As can be seen from the above, in the federated learning-based cross-pump station water demand collaborative prediction method provided in this application embodiment, the original state set is tracked and collected. This original state set includes the set of operating states of the pump station set set by the edge nodes within at least one time period. The original state set includes at least the set of actual operating frequencies and the set of available states of the pump stations within the pump station set. This enables comprehensive tracking and collection of the operating states of the pump station set set by the edge nodes. Furthermore, based on the set of actual operating frequencies and the set of available states, the reliability coefficient of the original state set is determined, realizing the correlation between the reliability coefficient and the set of actual operating frequencies and the set of available states, thereby improving the accuracy and real-time performance of the reliability coefficient. In addition, In this context, the credibility coefficient allows for an intuitive assessment of the credibility of the original state set. Furthermore, by modifying the original state set based on the credibility coefficient to obtain the target state set, targeted modifications to the original state set are achieved, thereby improving the effectiveness of the target state set. On this basis, a prediction model performs prediction operations based on the target state set to obtain future water demand. Future water demand includes the demand for the total outlet flow of the pump station set within at least one future time period. The prediction model is collaboratively trained by server nodes and edge nodes using federated learning based on a sample data set. Thus, leveraging the advantages of federated learning, the accuracy of the prediction model can be improved, thereby enhancing the accuracy of future water demand forecasts.
[0035] Based on the foregoing embodiments, the method for collaborative prediction of water demand across pumping stations based on federated learning provided in this application, which determines the reliability coefficient of the original state set based on the actual operating frequency set and the available state set, can be achieved through the following steps: Step A1: If at least some of the data in the original state set meets the target conditions, set a full load flag for the target data corresponding to the target time period.
[0036] The target conditions include a first condition and a second condition; the first condition includes the available state set in at least a portion of the data, indicating that there are no operational pump stations in the pump station set; the second condition includes the actual operating frequency set, indicating that the actual operating frequency of the pump stations in the pump station set is the rated operating frequency; the full load indicator is used to indicate that the pump stations corresponding to at least a portion of the data are operating at their rated operating power; the target data includes at least a portion of the data; the target time period includes the time period corresponding to at least a portion of the data.
[0037] Accordingly, if at least some of the data in the original state set does not meet the target conditions, then the operation of setting the full load flag for the target data corresponding to the target time period can be omitted.
[0038] In some embodiments, the first condition may include any of the following: Both the main pump station and the standby pump station in the pump station cluster are in operation. Apart from the faulty pump station, all remaining main pump stations and standby pump stations in the pump station set are in operation; wherein, the faulty pump station may include at least one of the main pump station and / or standby pump station that is in a faulty state.
[0039] In some embodiments, the second condition may include: all pumping stations in the pumping station set that are in operation are performing pumping operations at their rated operating power; wherein, the rated operating power may include the maximum operating power of the pumping station.
[0040] In some embodiments, the full load flag can be an additional flag for the target data; for example, the full load flag can be represented in the form of a Boolean variable. For instance, if at least some of the data in the original state set meets the target condition, a full load flag with a value of 1 can be set for at least some of the data, while if at least some of the data in the original state set does not meet the target condition, a full load flag with a value of 0 can be set for at least some of the data.
[0041] In some embodiments, the target time period may include the time period corresponding to a continuous set of original states that are set with a full load flag of value 1.
[0042] Step A2: Perform sliding window statistics on the original state set based on the full load indicator using a sliding time window to obtain the window distortion.
[0043] In some embodiments, window distortion can characterize the degree of distortion of the portion of data in the original state set corresponding to the sliding time window.
[0044] In some embodiments, window distortion can be obtained in the following way: The original state set is divided by a sliding time window to obtain window state data corresponding to the sliding time window. Then, the full load indicator of the window state data is statistically averaged to obtain the window distortion.
[0045] For example, as the sliding time window continues to slide, multiple window distortions can be obtained. At this time, the set of multiple window distortions can be determined as a window distortion sequence.
[0046] Step A3: Determine the confidence coefficient based on window distortion.
[0047] In some embodiments, the credibility coefficient can be determined in the following ways: Determine the distortion weights and perform weighted processing on the window distortion based on the distortion weights to obtain the distortion weighted result. Then, determine the confidence coefficient corresponding to the sliding time window based on the distortion weighted result. Next, perform the above processing on all window distortions in the window distortion sequence to obtain the confidence coefficient corresponding to each sliding time window. Then, perform a statistical average on the confidence coefficients corresponding to each sliding time window to obtain the confidence coefficient corresponding to the original state set. For example, the confidence coefficient corresponding to the sliding time window can be calculated by equation (1): (1) in, The confidence coefficient corresponding to the sliding time window. As the distortion weight, This refers to window distortion.
[0048] As can be seen from the above, in the cross-pump station water demand collaborative prediction method based on federated learning provided in this application embodiment, if at least some data in the original state set meets the target conditions, a full load flag is set for the target data corresponding to the target time period. The target conditions include a first condition and a second condition. The first condition includes the available state set in the at least some data, indicating that there are no usable pumps in the pump station set. The second condition includes the actual operating frequency set, indicating that the actual operating frequency of the pumps in the pump station set is the rated operating frequency. The full load flag is used to indicate that the pumps corresponding to at least some data are in the operating state of rated operating power. The target data includes at least some data, and the target time period includes the time period corresponding to at least some data. In this way, precise and strict control is achieved over the operation of setting the full load flag, thereby improving the effectiveness of the target data, target time period, and full load flag. Furthermore, by performing sliding window statistics on the original state set based on the full load flag through a sliding time window, the window distortion degree is obtained. Thus, the window distortion degree enables fine-grained quantification of the distortion degree of the data corresponding to the sliding time window in the original state set. On this basis, the confidence coefficient is determined based on the window distortion degree, which can improve the comprehensiveness and accuracy of the confidence coefficient.
[0049] Based on the foregoing embodiments, the federated learning-based collaborative prediction method for cross-pump station water demand provided in this application embodiment obtains the window distortion by performing sliding window statistics on the original state set based on the full load indicator through a sliding time window. This can be achieved through the following steps: Step B1: Divide the original state set into segments using a sliding time window to obtain window state data corresponding to the sliding time window.
[0050] For example, as the sliding time window moves, the original set of states can be segmented by the sliding time window to obtain a sequence of window state data containing multiple window state data.
[0051] Step B2: Process the actual operating frequency and rated operating frequency in the window state data to obtain the frequency saturation coefficient corresponding to the window state data.
[0052] In some embodiments, the frequency saturation coefficient corresponding to the window state data may include: the ratio between the actual operating frequency of the pump station set and the rated operating frequency of the pump station set within the time period corresponding to the window state data; specifically, the frequency saturation coefficient corresponding to the window state data can be obtained in the following way: The actual operating frequencies of the pump stations in operation at time t within the time period corresponding to the window state data are summed to obtain the first frequency sum. Then, the rated operating frequencies of the pump stations in operation at time t within the time period corresponding to the window state data are summed to obtain the second frequency sum. The ratio between the first frequency sum and the second frequency sum is determined as the frequency saturation coefficient at time t within the time period corresponding to the window state data. Next, the frequency saturation coefficients at each time within the time period corresponding to the window state data can be statistically averaged to obtain the frequency saturation coefficient corresponding to the window state data. For example, the frequency saturation coefficient at time t within the time period corresponding to the window state data can be specifically shown in equation (2). (2) in, This refers to the frequency saturation coefficient at time t within the time period corresponding to the window state data. The sum of the first frequencies, The sum of the second frequency. This represents the actual operating frequency at time t within the time period corresponding to the window state data. This is the identifier for the operating status table. When its value is 1, it indicates that the k-th pump station in the pump station set at time t above is in an operating state. is the rated operating frequency of the k-th pump station in the pump station set.
[0053] Step B3: Process the frequency saturation coefficient and full load indicator corresponding to the window state data to obtain the window distortion.
[0054] In some embodiments, window distortion can be obtained in the following way: Obtain the frequency saturation coefficient and the full load indicator at time t within the time period corresponding to the window state data. Based on the full load indicator at time t, correct the frequency saturation coefficient at time t to obtain the distortion coefficient at time t. Then, perform statistical averaging on the distortion coefficients corresponding to each time point within the time period corresponding to the window state data to obtain the window distortion degree. Specifically, the distortion coefficient at time t can be calculated using equation (3): (3) in, Let t be the distortion coefficient. This is the full load indicator at time t.
[0055] Specifically, when hour, At this point, the data in the window state data corresponding to time t can be considered reliable data; when and At time t, it can be determined that all pumps in the pump station set that are in operation are at their rated operating frequency. This can characterize the highest risk of deviation between the data corresponding to time t in the window state data and the water demand at that time; when and At this time, it indicates that the data in the window state data corresponding to time t above represents that the outlet water volume of the pump station set still has a regulating margin. ,and The bigger, The larger the value, the higher the risk that the observed flow rate will be limited by the equipment's capabilities.
[0056] For example, the window distortion can be calculated using equation (4): (4) in, This represents the number of times within the corresponding time period for the window state data.
[0057] As can be seen from the above, in the federated learning-based collaborative prediction method for cross-pump station water demand provided in this application embodiment, the original state set is segmented by a sliding time window to obtain window state data corresponding to the sliding time window. The actual operating frequency and rated operating frequency in the window state data are processed to obtain the frequency saturation coefficient corresponding to the window state data. This realizes the fine-grained determination of the frequency saturation coefficient of the data corresponding to each sliding time window in the original state set, with the window state data as the unit. Furthermore, the frequency saturation coefficient and full load indicator corresponding to the window state data are processed to obtain the window distortion, which can improve the comprehensiveness and accuracy of the window distortion.
[0058] Based on the foregoing embodiments, the federated learning-based collaborative water demand forecasting method across pumping stations provided in this application can also perform the following operations: The target time period is defined as the time period between the first number of historical moments before the full load time and the second number of future moments after the full load time indicator.
[0059] The full load time includes the moment when the full load indicator is first set within a specified time period.
[0060] In some embodiments, the first quantity and the second quantity can be predetermined or flexibly adjusted, and the first quantity and the second quantity can be the same or different.
[0061] For example, the first quantity and the second quantity can be determined based on the equipment characteristics of the pumping station related to the setting of the full load time. For instance, the first quantity and the second quantity can be determined based on the number of time steps corresponding to the response time parameter in the equipment characteristics.
[0062] For example, when the equipment characteristics cannot be obtained, the first quantity and the second quantity can be the same, and the first quantity and the second quantity can be determined according to the time steps corresponding to the response time parameters of pump stations of the same model in the pump station set.
[0063] In some embodiments, the specified time period can be preset; for example, the specified time period can be determined based on historical water supply data of the pump station set; for example, the historical water supply data can include the switching frequency or switching cycle of the operating status of the pump stations in the pump station set; wherein, the switching frequency can include the average frequency at which the pump stations in the pump station set switch from a non-full-load operating state to a full-load operating state, the switching cycle can include the average duration of the pump station switching from a non-full-load operating state to a full-load operating state, and the full-load operating state can include the state in which the pump station operates at the rated operating frequency, and the non-full-load operating state can include the state in which the pump station operates at less than the rated operating power.
[0064] In some embodiments, the specified time period may be less than or equal to the switching period, but may be greater than the number of time steps corresponding to the response time parameter.
[0065] In some embodiments, the moment when the full load flag is first set within a specified time period may include: the moment when the original state set is first detected to meet the target condition within the specified time period, and may also include the moment when the full load flag is first set to a value of 1 within the specified time period.
[0066] As can be seen from the above, the cross-pump station water demand collaborative prediction method based on federated learning provided in this application determines the target time period as follows: the time period between a first number of historical times before the full load time and a second number of future times after the full load flag, where the full load time includes the moment when the full load flag is first set within the specified time period. This establishes a correlation between the determination of the target time period and the setting of the full load flag, thereby improving the effectiveness of the target time period.
[0067] Based on the foregoing embodiments, the cross-pump station water demand collaborative prediction method based on federated learning provided in this application embodiment, which corrects the original state set based on the confidence coefficient to obtain the target state set, can be achieved through the following steps: Step C1: If the confidence coefficient is less than or equal to the coefficient threshold, determine the state change gradient based on the original state set in the historical period before the full load time.
[0068] The full load time includes the moment when the full load indicator is first set within a specified time period.
[0069] Correspondingly, if the confidence coefficient is greater than the coefficient threshold, the gradient of the state change can be left uncertain.
[0070] In some embodiments, the length of the historical period can be predetermined or adjusted according to the length of the target period; for example, the historical period can be P times the target period, where P can be an integer greater than 1.
[0071] In some embodiments, the state change gradient may include the historical rate of change of the values of the original set of states over a historical period, or it may include a prediction result of the historical rate of change over a target period.
[0072] In some embodiments, the state change gradient can be a fixed gradient or a dynamic gradient that changes or fluctuates over time.
[0073] In some embodiments, the state change gradient can be determined in the following way: The process of changing the original set of states over time within a historical period is analyzed to determine the historical gradient. Then, based on the changing pattern of the historical gradient, the historical gradient is extended in the time dimension to obtain the state change gradient corresponding to the target period.
[0074] Step C2: Correct the target data based at least on the state change gradient to obtain the target state set.
[0075] In some embodiments, the target data can be corrected in the following ways: Based on the distortion coefficients of the state data at each time point within the target time period, and the state change gradients at each time point, the correction magnitude is determined. Then, the magnitude of the target data is corrected based on the correction magnitude to obtain the corrected data. Specifically, it can be shown in Equation (5): (5) in, The corrected data is for time t within the target time period. The state data at time t within the target time period. Let be the value of the state change gradient at time t within the target time period. t represents the time length between time t and the start time of the target time period.
[0076] For example, the state data corresponding to each moment within the target time period may include a set of data from the original state set corresponding to each moment within the target time period.
[0077] In some embodiments, the target state data can be obtained in the following ways: The target state data is obtained by concatenating the uncorrected data and corrected data in the time dimension; the uncorrected data can include the set of data in the original state set excluding the target data.
[0078] As can be seen from the above, in the federated learning-based collaborative prediction method for cross-pump station water demand provided in this application embodiment, if the confidence coefficient is less than or equal to the coefficient threshold, the state change gradient is determined based on the original state set in the historical period before the full load time. The full load time includes the time when the full load indicator is first set within the specified period. In this way, the continuity and effectiveness of the state change gradient can be improved, and the accuracy of the state change gradient can be improved. Furthermore, the target data is corrected based at least on the state change gradient to obtain the target state set. In this way, the target data can be specifically corrected, thereby improving the matching degree between the target state set and the actual water demand of the area where the pump station set is located, and improving the effectiveness of the target state set.
[0079] Based on the foregoing embodiments, the collaborative prediction method for cross-pump station water demand based on federated learning provided in this application includes a set of original states from multiple historical moments in the sample data set. Accordingly, the above method may further perform the following steps: Step D1: During the r-th round of training of the initial prediction model at the edge nodes, determine the sample confidence coefficient corresponding to the state of the training sample.
[0080] The training sample states include the set of original states in the first time period of the sample data set; r is an integer greater than or equal to 1.
[0081] In some embodiments, the sample confidence coefficient may correspond to the confidence coefficient in the foregoing embodiments; correspondingly, the process of determining the sample confidence coefficient may be the same as the process of determining the confidence coefficient in the foregoing embodiments.
[0082] Step D2: Process the prediction results and observation results based on the sample confidence coefficient to obtain the r-th training loss.
[0083] The prediction results are obtained by processing the training sample states using the initial prediction model after the (r-1)th parameter adjustment; the observation results include the set of original states in the second time period in the sample data set; the second time period is later than the first time period; the (r-1)th parameter set corresponding to the initial prediction model after the (r-1)th parameter adjustment is sent from the server node to the edge node.
[0084] In some embodiments, when r is 1, the initial prediction model after the (r-1)th parameter adjustment can be the initial prediction model.
[0085] In some embodiments, the second time period can be a future time period of the first time period, and the second time period can be later than the first time period.
[0086] In some embodiments, the r-th training loss can be obtained in the following way: The prediction error between the observed and predicted results is determined. Then, the prediction error is statistically averaged based on the sample confidence coefficient to obtain the r-th training loss. Specifically, this can be achieved through equations (6) to (7): (6) (7) in, To compare the data of the e-th sample in the training sample state at the th... The prediction results of the time step To compare with the r-th sample data at the th... The observation results at each time step, where F is the number of time steps corresponding to the prediction result. The number of time steps within the sample sliding time window The window average prediction error obtained when e takes values from 1 to F is... In this case, The set of these can constitute the set of sample credibility coefficients. The amount of data in the sample dataset.
[0087] For example, the sample sliding time window can be used to perform sliding window statistics on the training sample states with full load indicators to obtain the sample confidence coefficient; wherein, the process of setting the full load indicator for the training sample states can be the same as the process of setting the full load indicator for the original state set in the previous embodiment, and the sample confidence coefficient can correspond to the confidence coefficient in the previous embodiment, and the process of determining the sample confidence coefficient can be the same as the process of determining the confidence coefficient of the original state set in the previous embodiment.
[0088] Step D3: Adjust the (r-1)th parameter set based on the r-th training loss to obtain the r-th parameter set.
[0089] The r-th parameter set includes the set of parameters of the initial prediction model obtained by adjusting the r-1-th parameter set.
[0090] In some embodiments, adjusting the (r-1)th parameter set can be achieved in the following way: Based on the r-th training loss, perform reverse gradient update on the (r-1)-th parameter set to obtain the r-th parameter set.
[0091] It should be noted that since a sample confidence coefficient is added to the r-th training loss, the process of adjusting the r-1 parameter set through the r-th training loss can achieve targeted updates of the r-1 parameter set based on the sample confidence coefficient. For example, a stronger gradient update can be applied to samples with higher confidence coefficients, while a weaker gradient update can be applied to samples with lower confidence coefficients, thereby guiding the r-th parameter set to converge towards the actual water demand pattern.
[0092] For example, the Adam optimizer can be used to perform the backward gradient update operation, and the training hyperparameters of the edge nodes can include a batch size of 32 and a learning rate. .
[0093] Step D4: Determine the credibility of the r-th peak sample corresponding to the set of peak times.
[0094] The peak time set includes the set of times corresponding to the outflow rates that are greater than or equal to the flow rate threshold in the training sample state.
[0095] In some embodiments, the traffic threshold can be preset; for example, the traffic threshold can be determined in the following ways: Obtain the original state set within a preset time period, and perform statistics on the outflow of the original state set within the preset time period. Then, determine the 75th percentile of the outflow within the preset time period as the flow threshold.
[0096] It should be noted that the preset time period can be longer than the first and second time periods. For example, the first and second time periods can be 15 minutes, while the preset time period can be 30 days.
[0097] For example, if the original state data within the preset time period cannot be obtained, the above method can be used to statistically analyze the outlet flow of pump stations of the same model as the pump station set within the preset time period, and the 75th percentile of the outlet flow of pump stations of the same model as the pump station set within the preset time period can be determined as the flow threshold.
[0098] In some embodiments, the confidence level of the r-th peak sample may include statistical results of the undistortedness of samples at each time point corresponding to the peak time point set; specifically, the confidence level of the r-th peak sample can be obtained in the following way: Obtain the r-th distortion coefficient corresponding to the credibility coefficient of the r-th sample, and then perform statistical averaging on the data in the r-th distortion coefficient based on the r-th peak set to obtain the credibility of the r-th peak sample; specifically as shown in equation (8): (8) in, To determine the confidence level of the r-th peak sample, the value of j iterates from 1 to... hour, The set of can constitute the r-th distortion coefficient. denoted as the number of peaks contained in the set of peak times, where j is an integer greater than 1.
[0099] Specifically, , The closer the value is to 1, the better the pump station still has a good response margin during the peak period of the outlet flow corresponding to the peak time set, indicating higher data quality for the sample state; while The closer the value is to 0, the lower the data quality of the training sample state is, indicating that the pump station is operating at full capacity during peak hours.
[0100] Step D5: Send the r-th data set to the server node to trigger the server node to process the parameters of the initial prediction model sent by multiple service nodes based on the r-th data set, obtain the (r+1)-th parameter set, and send the (r+1)-th parameter set to the edge node.
[0101] The r-th data set includes the r-th parameter set and the confidence level of the r-th peak sample; the (r+1)-th parameter set consists of the initial parameters of the initial prediction model when the edge node performs the (r+1)-th training process.
[0102] In some embodiments, after receiving the r-th data set, the server node can perform the following operations: First, determine the basic aggregation weights; specifically, the initial aggregation weights can be calculated based on the number of training sample states on which each edge node depends when determining the r-th parameter set and the credibility of the r-th peak sample. Then, normalize the initial aggregation weights to obtain the basic aggregation weights, as shown in Equation (9): (9) Where Z is an integer greater than 1 and is used to represent the number of edge nodes. Let m be the number of training sample states that the m-th edge node depends on when determining the r-th parameter set. Let be the initial aggregation weight associated with the i-th edge node. The credibility of the r-th peak sample sent to the i-th edge node. The number of samples sent by the i-th edge node, where i can be an integer greater than or equal to 1 and less than or equal to N.
[0103] Specifically, the initial aggregation weights can be normalized to obtain the basic aggregation weights. For example, the larger the value of the basic aggregation weight, the greater the basic contribution that edge node makes to the global aggregation during its training process.
[0104] Secondly, the pump station similarity is calculated. For example, the pump station similarity can characterize the degree of similarity in response capability or controllability between sets of pump stations associated with different edge nodes. For example, the pump station similarity can be calculated based on the credibility of the r-th peak sample sent by each edge node. Specifically, the pump station similarity between the set of pump stations associated with the i-th edge node and the set of pump stations associated with the m-th edge node can be calculated as shown in Equation (10): (10) in, The credibility of the r-th peak sample sent to the i-th edge node. The credibility of the r-th peak sample sent by the m-th edge node. Let be the pump station similarity between the set of pump stations associated with the i-th edge node and the set of pump stations associated with the m-th edge node. The standard deviation of the confidence level of the peak samples sent to all edge nodes.
[0105] For example, when When this is the case, it indicates that the difference in the confidence level of the peak samples of the pump station sets associated with each edge node is extremely small. At this time, it is possible to set... This is to reduce the unreasonable amplification caused by minor differences.
[0106] Next, the aggregation result is constructed. For example, after determining the basic aggregation weights and pump station similarities, the (r+1)th parameter set sent by each edge node can absorb parameters from the pump station set with higher similarity, based on the basic aggregation weights and pump station similarities. Specifically, the aggregation result associated with the i-th edge node... It can be constructed using equation (11): (11) Where m is the index of the sum of the number of edge nodes traversed. This represents the set of r-th parameters sent by the m-th edge node; This represents the basic aggregation weight associated with the m-th edge node.
[0107] Next, the (r+1)th parameter set is generated. For example, the aggregation result can be processed based on the basic aggregation weights to generate the (r+1)th parameter set. Specifically, it can be shown in equation (12): (12) For example, after the server generates the (r+1)th parameter set, it can be converged. If the (r+1)th parameter set has converged, the (r+1)th parameter set can be sent to the edge node, and the edge node can be controlled to use the (r+1)th parameter set as the final parameter set of the prediction model. The initial prediction model can be configured based on the final parameter set to obtain the prediction model, and then the prediction operation provided in the aforementioned embodiment can be executed through the prediction model.
[0108] Specifically, determining whether the (r+1)th parameter set is convergent can be achieved by: calculating the relative change of the (r+1)th parameter set relative to the rth parameter set, and determining whether the (r+1)th parameter set is convergent based on the relative change; specifically, the relative change... It can be adopted The norm is defined as shown in equation (13): (13) in, Let r represent the set of parameters.
[0109] For example, if the relative change Training stops when the change threshold is reached or the maximum training epoch is reached, and the parameter set at this point is determined as the final parameter set. If the relative change is greater than or equal to the change threshold or the maximum training epoch is not reached, the (r+1)th parameter set can be sent to each edge node, so that each edge node can use the (r+1)th parameter set as the initial parameters of the initial prediction model and repeatedly execute the aforementioned operation until the relative change threshold is met. The threshold for the amount of change or the condition for the current training round to reach the maximum number of training rounds.
[0110] To verify the technical effectiveness of the federated training method provided in this solution, this application embodiment also provides comparative data on the training effect of the comparative training scheme and the training effect of the federated training method provided in this solution; and the training process of the comparative training scheme and the training process of this solution are both based on the same sample data set; for example, the sample data set can be divided into a training set, a validation set and a test set in a ratio of 8:1:1. During the training process, the number of time steps corresponding to the state of the training sample can be set to 8, and the number of time steps corresponding to the second time period can be set to 4.
[0111] Specifically, the comparative training schemes may include centralized training methods (denoted as Centralized), standard federated learning methods (denoted as FedAvg), training schemes that retain only the confidence coefficients of certain samples in the scheme provided in this application (denoted as Ours-S), and the complete training scheme provided in this scheme (denoted as Ours).
[0112] Specifically, the root mean square error (RMSE) and mean absolute percentage error (MAPE) can be used to statistically analyze the prediction results of each training scheme in the all periods and peak periods, respectively.
[0113] Figure 2A This diagram illustrates the comparison of the RMSE (Real-Time Sequence) of the prediction results for various training schemes provided in the embodiments of this application over the entire time period. Figure 2A In the coordinate system shown, the horizontal axis is used to display the comparison training schemes (Centralized, FedAvg, and Ours-S) and the present scheme (Ours), and the vertical axis is used to display the RMSE values of the prediction results of the comparison training schemes and the present scheme, in units of 1. .
[0114] Figure 2B This is a schematic diagram showing the comparison of MAPE (MAPE) results of the various training schemes provided in the embodiments of this application over the entire time period. Figure 2B The meaning of the x-coordinate in the coordinate system shown is the same as... Figure 2A The x-coordinates in the coordinate systems shown have the same meaning. Figure 2B The ordinate of the coordinate system shown includes the MAPE value, and its unit is .
[0115] from Figures 2A to 2B It can be seen that, compared with standard federated learning (FedAvg), the training scheme (Ours-S) that only retains the confidence coefficients of the determined samples in the scheme provided in this application and the scheme (Ours) have significantly improved prediction accuracy over the entire time period and can approach the prediction accuracy of centralized training. At the same time, compared with the scheme (Ours), the prediction accuracy of the scheme Ours-S is relatively reduced because it only retains the confidence coefficients of the determined samples in the scheme provided in this application.
[0116] Figure 3A A schematic diagram showing the comparison of RMSE of prediction results for various training schemes provided in the embodiments of this application during peak periods; Figure 3B A schematic diagram showing the comparison of MAPE prediction results of various training schemes provided in the embodiments of this application during peak periods.
[0117] from Figures 3A to 3BIt can be seen that the prediction error (height of the bar chart) of standard federated learning (FedAvg) increases during peak periods, while the prediction error of this scheme is close to that of centralized training. Furthermore, compared with our scheme, since only the confidence coefficient of the deterministic samples in the scheme provided in this application is retained, the prediction error of ours-S scheme is relatively higher.
[0118] In summary, compared with standard federated learning (FedAvg), this scheme significantly improves both prediction accuracy and stability, and can approach the prediction performance of centralized training in all time periods and during peak periods. Furthermore, a comparison with the Ours-S scheme shows that the process provided by this scheme, from determining the basic aggregation weights to generating a new parameter set, can improve the prediction accuracy of the prediction model trained by this scheme and reduce its prediction error.
[0119] As can be seen from the above, in the federated learning-based collaborative prediction method for cross-pump station water demand provided in this application embodiment, during the r-th round of training of the initial prediction model at the edge nodes, the sample confidence coefficient corresponding to the training sample state is determined. Based on the sample confidence coefficient, the prediction results and observation results are processed to obtain the r-th training loss. In this way, the correlation between the sample confidence coefficient and the r-th training loss is realized, thereby improving the accuracy of the r-th training loss. Furthermore, after adjusting the (r-1)-th parameter set based on the r-th training loss to obtain the r-th parameter set, the r-th parameter corresponding to the peak time set is determined. The peak sample credibility is determined, and the r-th data set is sent to the server node to trigger the server node to process the parameters of the initial prediction model sent by multiple server nodes based on the r-th data set, obtaining the (r+1)-th parameter set, which is then sent to the edge node. In this way, a collaborative closed loop of federated learning between the server node and the edge node is realized. This enables targeted training of the initial prediction model while reducing the amount of data transmission between the server node and the edge node and ensuring the security of the sample data set of the edge node, thereby improving the prediction accuracy of the initial prediction model.
[0120] The description of the various embodiments above tends to emphasize the differences between the various embodiments. The similarities or similarities between them can be referred to, and for the sake of brevity, they will not be repeated here.
[0121] The methods disclosed in the various method embodiments provided in this application can be arbitrarily combined without conflict to obtain new method embodiments.
[0122] The features disclosed in the various product embodiments provided in this application can be arbitrarily combined without conflict to obtain new product embodiments.
[0123] The features disclosed in the various method or device embodiments provided in this application can be arbitrarily combined without conflict to obtain new method or device embodiments.
[0124] It should be noted that the aforementioned computer-readable storage media can be read-only memory (ROM), programmable read-only memory (PROM), erasable programmable read-only memory (EPROM), electrically erasable programmable read-only memory (EEPROM), magnetic random access memory (FRAM), flash memory, magnetic surface memory, optical disc, or compact disc read-only memory (CD-ROM), etc.; or it can be various electronic devices that include one or any combination of the above-mentioned memories, such as mobile phones, computers, tablet devices, personal digital assistants, etc.
[0125] It should be noted that, in this document, the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such a process, method, article, or apparatus. Unless otherwise specified, an element defined by the phrase "comprising one..." does not exclude the presence of other identical elements in the process, method, article, or apparatus that includes that element.
[0126] The sequence numbers of the embodiments in this application are for descriptive purposes only and do not represent the superiority or inferiority of the embodiments.
[0127] Through the above description of the embodiments, those skilled in the art can clearly understand that the methods of the above embodiments can be implemented by means of software plus necessary general-purpose hardware nodes. Of course, they can also be implemented by hardware, but in many cases the former is a better implementation method. Based on this understanding, the technical solution of this application, in essence, or the part that contributes to the prior art, can be embodied in the form of a software product. This computer software product is stored in a storage medium (such as ROM / RAM, magnetic disk, optical disk) and includes several instructions to cause a terminal device (which may be a mobile phone, computer, server, air conditioner, or network device, etc.) to execute the methods described in the various embodiments of this application.
[0128] This application is described with reference to flowchart illustrations and / or block diagrams of methods, apparatus (systems), and computer program products according to embodiments of this application. It will be understood that each block of the flowchart illustrations and / or block diagrams, and combinations of blocks in the flowchart illustrations and / or block diagrams, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, special-purpose computer, embedded processor, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, generate instructions for implementing the flowchart... Figure 1 One or more processes and / or boxes Figure 1 A device that provides the functions specified in one or more boxes.
[0129] These computer program instructions may also be stored in a computer-readable storage medium that can direct a computer or other programmable data processing device to function in a particular manner, such that the instructions stored in the computer-readable storage medium produce an article of manufacture including instruction means, which are implemented in a process Figure 1 One or more processes and / or boxes Figure 1 The function specified in one or more boxes.
[0130] These computer program instructions may also be loaded onto a computer or other programmable data processing equipment to cause a series of operational steps to be performed on the computer or other programmable equipment to produce a computer-implemented process, thereby providing instructions that execute on the computer or other programmable equipment for implementing the process. Figure 1 One or more processes and / or boxes Figure 1 The steps of the function specified in one or more boxes.
[0131] The above are merely preferred embodiments of this application and do not limit the patent scope of this application. Any equivalent structural or procedural transformations made using the content of this application's specification and drawings, or direct or indirect applications in other related technical fields, are similarly included within the patent protection scope of this application.
Claims
1. A collaborative water demand forecasting method across pumping stations based on federated learning, characterized in that, The method includes: Track and collect the original state set; wherein, the original state set includes the set of operating states of the pump station set set by the edge node within at least one time period; the original state set includes at least the set of actual operating frequencies and the set of available states of the pump stations in the pump station set; Based on the actual operating frequency set and the available state set, determine the credibility coefficient of the original state set; The original state set is corrected based on the credibility coefficient to obtain the target state set; The prediction model performs a prediction operation based on the target state set to obtain future water demand; wherein, the future water demand includes the demand for the total outlet flow of the pump station set in at least one future time period; the prediction model is obtained by the server node and the edge node through federated learning based on the sample data set.
2. The method according to claim 1, characterized in that, The process of determining the reliability coefficient of the original state set based on the actual operating frequency set and the available state set includes: If at least a portion of the data in the original state set satisfies the target conditions, a full-load flag is set for the target data corresponding to the target time period; wherein, the target conditions include a first condition and a second condition; the first condition includes the available state set in the at least a portion of the data indicating that there are no usable pumps in the pump station set; the second condition includes the actual operating frequency set indicating that the actual operating frequency of the pumps in the pump station set is the rated operating frequency; the full-load flag is used to indicate that the pumps corresponding to the at least a portion of the data are operating at their rated operating power; the target data includes at least the at least a portion of the data; the target time period includes the time period corresponding to the at least a portion of the data; The window distortion is obtained by performing sliding window statistics on the original state set based on the full load indicator using a sliding time window; wherein, the window distortion includes the degree of distortion of the original state set corresponding to the sliding time window in the target state set; The credibility coefficient is determined based on the window distortion.
3. The method according to claim 2, characterized in that, The step of performing sliding window statistics on the original state set based on the full load indicator using a sliding time window to obtain window distortion includes: The original state set is segmented by the sliding time window to obtain window state data corresponding to the sliding time window; The actual operating frequency and the rated operating frequency in the window state data are processed to obtain the frequency saturation coefficient corresponding to the window state data; The frequency saturation coefficient corresponding to the window state data and the full load indicator are processed to obtain the window distortion.
4. The method according to claim 2, characterized in that, The method further includes: The target time period is defined as the time period between a first number of historical times before the full load time and a second number of future times after the full load indicator; wherein the full load time includes the time when the full load indicator is first set within the specified time period.
5. The method according to claim 2, characterized in that, The step of modifying the original state set based on the credibility coefficient to obtain the target state set includes: If the confidence coefficient is less than or equal to the coefficient threshold, the state change gradient is determined based on the original state set in the historical period before the full load moment; wherein, the full load moment includes the moment when the full load flag is first set within the specified period; The target data is corrected based at least on the state change gradient to obtain the target state set.
6. The method according to claim 1, characterized in that, The sample data set includes a collection of original states at multiple historical moments; the method further includes: During the r-th round of training of the initial prediction model at the edge node, the sample confidence coefficient corresponding to the training sample state is determined; wherein, the training sample state includes the set of original states in the first time period in the sample data set; r is an integer greater than or equal to 1; The prediction results and the r-th observation results are processed based on the sample confidence coefficient to obtain the r-th training loss; wherein, the prediction results are obtained by processing the training sample states through the initial prediction model after the (r-1)-th parameter adjustment; the observation results include the set of original states in the second time period in the sample data set; the second time period is later than the first time period; the (r-1)-th parameter set corresponding to the initial prediction model after the (r-1)-th parameter adjustment is sent from the server node to the edge node; The r-1 parameter set is adjusted based on the r-th training loss to obtain the r-th parameter set; Determine the credibility of the r-th peak sample corresponding to the set of peak times; wherein, the set of peak times includes the set of times corresponding to the outflow traffic that is greater than or equal to the traffic threshold in the training sample state; The r-th data set is sent to the server node to trigger the server node to process the parameters of the initial prediction model sent by multiple service nodes based on the r-th data set, to obtain the (r+1)-th parameter set, and then send the (r+1)-th parameter set to the edge node; wherein, the r-th data set includes the r-th parameter set and the confidence level of the r-th peak sample; the (r+1)-th parameter set is the initial parameter of the initial prediction model when the edge node performs the (r+1)-th round of training.
