Water consumption prediction and water saving optimization method based on water meter

CN122549965APending Publication Date: 2026-08-11江花集团有限公司
View PDF 0 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2026-05-14
Publication Date
2026-08-11

AI Technical Summary

Technical Problem

[0004]为了解决上述技术问题,本发明提供了一种基于水表用水预测与节水优化方法,可一定程度上解决由于现有技术无法充分利用多维度用水数据构建时空关联特征,难以准确识别不同户型的用水模式,导致用水行为预测精度不足,以及现有节水优化方法缺乏基于未来用水预测的风险评估与差异化优化策略,导致节水方案针对性和实际效果较差的问题

Benefits of technology

[0034] Compared with existing technologies, this invention achieves in-depth mining of multi-dimensional water use data and precise stratification of user water use patterns by introducing a spatiotemporal coupled feature matrix and an improved density peak clustering algorithm. Through a two-layer coupled prediction network, it significantly improves the accuracy and timeliness of water use behavior prediction. At the same time, based on the water use risk index calculation and water-saving priority ranking, it generates targeted and differentiated water-saving optimization schemes, which not only effectively improves the problem of poor generalization of traditional water-saving optimization schemes, but also improves the efficiency of water resource utilization, and achieves the goal of refined and intelligent water use management.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122549965A_ABST
    Figure CN122549965A_ABST
Patent Text Reader

Abstract

The application provides a water meter water consumption prediction and water saving optimization method, relates to the technical field of water consumption management, and obtains multi-dimensional water consumption data collected by a water meter, constructs a space-time coupling water consumption feature matrix based on a water consumption time window and a house type identifier, and carries out hierarchical clustering analysis by using an improved density peak clustering algorithm to obtain a house type water consumption mode spectrum. On this basis, the water consumption mode spectrum is subjected to multi-scale time series decomposition, periodic water consumption reference quantities and random water consumption fluctuation quantities are extracted, a double-layer coupling prediction network is constructed to generate a water consumption behavior prediction model. Water consumption data at the current time is input into the prediction model, future water consumption prediction values are calculated, and a water consumption risk index is generated based on the prediction values. The water saving priority is sorted according to the water consumption risk index, and a differentiated water saving optimization scheme is formulated. The water consumption prediction accuracy and the water saving scheme pertinence are improved, and the water resource utilization efficiency is improved, and the water consumption management is refined and intelligent.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of water management technology, and more specifically, to a method for water meter-based water usage prediction and water-saving optimization. Background Technology

[0002] With global water scarcity and increasing awareness of water conservation, the development of water management and optimization technologies has become a key research focus. Against this backdrop, technologies based on the Internet of Things (IoT), such as smart water meters, have been widely applied. By collecting user water usage data at high frequencies, they provide a rich data foundation for more efficient water usage monitoring and prediction. Currently, most mainstream technologies analyze water usage data based on statistical analysis and simple machine learning algorithms, including pattern recognition of regional water usage behavior and prediction of water usage trends. These technologies have improved water use efficiency and reduced water waste to some extent. However, in complex and ever-changing real-world water usage scenarios, these methods lack sufficient spatial and temporal correlation modeling capabilities, making it difficult to accurately characterize the water usage behavior of different users and household types. Furthermore, regarding water usage optimization, various technical methods mainly rely on historical average usage and single decision rules, making it difficult to achieve dynamic water-saving strategy optimization based on future water usage predictions.

[0003] Existing technologies have several shortcomings in the in-depth analysis of water use forecasting and the coordinated design of water-saving optimization. First, traditional pattern recognition methods based on simple water use statistics or shallow algorithms struggle to fully capture the heterogeneity and complex spatiotemporal relationships of user water use behavior. This leads to insufficient timeliness and accuracy in prediction results, especially when dealing with user behavior in households exhibiting significant uncertainty and temporal fluctuations. Second, for water-saving optimization, existing methods generally lack the ability to generate differentiated strategies based on water use risk prediction. Typically, optimization strategies based on average values ​​cannot be personalized to the characteristics of different users' water use patterns and lack the ability to respond to future water use fluctuations and emergencies. These problems not only limit the scientific rigor and decision-making efficiency of existing technologies in water-saving optimization practices but also hinder the further promotion of refined and intelligent water management. Summary of the Invention

[0004] To address the aforementioned technical problems, this invention provides a water meter-based water usage prediction and water-saving optimization method. This method can, to some extent, solve the problems that existing technologies cannot fully utilize multi-dimensional water usage data to construct spatiotemporal correlation features, making it difficult to accurately identify the water usage patterns of different household types, resulting in insufficient accuracy in water usage behavior prediction. Furthermore, existing water-saving optimization methods lack risk assessment and differentiated optimization strategies based on future water usage prediction, leading to poor targeting and actual effectiveness of water-saving solutions.

[0005] According to one aspect of the present invention, a method for water meter-based water usage prediction and water-saving optimization is provided, comprising:

[0006] Multi-dimensional water usage data collected from water meters is acquired, and a spatiotemporal coupled water usage feature matrix is ​​constructed based on water usage time windows and household type identifiers. An improved density peak clustering algorithm is used to perform hierarchical clustering analysis on the spatiotemporal coupled water usage feature matrix to obtain the household type water usage pattern spectrum.

[0007] The water usage pattern spectrum of the aforementioned household type is decomposed into a multi-scale time series, and the periodic water usage baseline and random water usage fluctuation are extracted to construct a two-layer coupled prediction network to generate a water usage behavior prediction model.

[0008] The current water usage data is input into the water usage behavior prediction model to obtain the future water usage prediction value, and the water usage risk index is calculated based on the future water usage prediction value.

[0009] Based on the water use risk index, water conservation priorities are ranked, and differentiated water conservation optimization schemes are generated.

[0010] Furthermore, the improved density peak clustering algorithm is used to perform hierarchical clustering analysis on the spatiotemporal coupled water use feature matrix according to the household type dimension, specifically including:

[0011] The Z-score transformation unifies the time-series water usage characteristics and household type attribute characteristics to the same numerical scale;

[0012] Based on standardized apartment layout features, the apartment layout similarity weight coefficient is calculated through Gaussian kernel function and normalization processing;

[0013] The apartment type similarity weight coefficient is used as a modulation factor, and the local density value considering apartment type similarity is calculated by weighted kernel density estimation.

[0014] Based on the improved local density value, the softmax normalization mechanism is used to calculate the probability of each data point belonging to each cluster center, and the deterministic cluster label is output through the maximum a posteriori probability criterion.

[0015] Furthermore, the formula for calculating the apartment type similarity weight coefficient is as follows:

[0016]

[0017] in, For data points and Normalized similarity weights between apartment layouts This is the weighting factor for apartment type. For data points and Euclidean distance in the standardized apartment type attribute space This is the bandwidth parameter of the apartment layout similarity kernel function. Numerical stability parameters This represents the total number of data points.

[0018] Furthermore, the multi-scale time series decomposition includes hierarchical decomposition operations according to four time scales: hourly, daily, weekly, and monthly. Water consumption change patterns with recurrence characteristics at fixed time intervals are extracted as periodic components at each time scale. The random water consumption fluctuation is obtained by subtracting the comprehensive periodic water consumption benchmark from the original water consumption time series data.

[0019] Furthermore, the two-layer coupled prediction network includes a periodic feature processing layer and a random feature processing layer.

[0020] The periodic feature processing layer uses a recurrent neural network structure to process periodic water consumption benchmark data;

[0021] The randomness feature processing layer uses a convolutional neural network structure to process random water usage fluctuation data.

[0022] Furthermore, based on the aforementioned two-layer coupled prediction network, a complete water use behavior prediction model is constructed by fusing periodic and random features through a cross-attention mechanism, as expressed in the formula:

[0023]

[0024]

[0025] in, To predict water consumption for the next moment, This is a periodic water consumption baseline sequence for the current moment. This is a sequence of random water usage fluctuations at the current moment. For time-coded vectors, For periodic eigenvectors, For random eigenvectors, For adaptive attention weights, For residual connectivity coefficients, For gradient constraint weights, This is the gradient of the loss function from the previous time step.

[0026] Furthermore, the calculation of the water use risk index includes:

[0027] The difference between the predicted future water consumption and the historical peak water consumption is calculated, and the relative deviation percentage is used as the degree of deviation.

[0028] A water use baseline for each household is established based on the water use pattern spectrum of the household type. The degree of deviation is compared with the water use baseline for each household type, and a water use risk index is calculated based on the magnitude of the deviation.

[0029] According to another aspect of the present invention, a water meter-based water usage prediction and water-saving optimization system is provided, comprising:

[0030] The data acquisition module is used to acquire multi-dimensional water usage data collected by water meters. Based on the water usage time window and household type identification, a spatiotemporal coupled water usage feature matrix is ​​constructed. An improved density peak clustering algorithm is used to perform hierarchical clustering analysis on the spatiotemporal coupled water usage feature matrix to obtain the household type water usage pattern spectrum.

[0031] The water usage prediction module is used to perform multi-scale time-series decomposition of the water usage pattern spectrum of the household type, extract the periodic water usage baseline and random water usage fluctuation, and construct a two-layer coupled prediction network to generate a water usage behavior prediction model.

[0032] The risk calculation module is used to input the current water usage data into the water usage behavior prediction model to obtain the future water usage prediction value, and calculate the water usage risk index based on the future water usage prediction value;

[0033] The scheme optimization module is used to prioritize water conservation based on the water use risk index and generate differentiated water conservation optimization schemes.

[0034] Compared with existing technologies, this invention achieves in-depth mining of multi-dimensional water use data and precise stratification of user water use patterns by introducing a spatiotemporal coupled feature matrix and an improved density peak clustering algorithm. Through a two-layer coupled prediction network, it significantly improves the accuracy and timeliness of water use behavior prediction. At the same time, based on the water use risk index calculation and water-saving priority ranking, it generates targeted and differentiated water-saving optimization schemes, which not only effectively improves the problem of poor generalization of traditional water-saving optimization schemes, but also improves the efficiency of water resource utilization, and achieves the goal of refined and intelligent water use management. Attached Figure Description

[0035] To more clearly illustrate the technical solutions in the embodiments of the present invention or the prior art, the drawings used in the description of the 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 based on these drawings without creative effort. In the drawings:

[0036] Figure 1 This is a flowchart of a water meter-based water usage prediction and water-saving optimization method according to an embodiment of the present invention;

[0037] Figure 2This is a diagram showing the effect of the traditional K-means clustering algorithm in water use pattern recognition.

[0038] Figure 3 This is a diagram showing the effect of the improved density peak clustering algorithm for different apartment types in an embodiment of the present invention. Detailed Implementation

[0039] Hereinafter, exemplary embodiments according to the present invention will be described in detail with reference to the accompanying drawings. Obviously, the described embodiments are merely some embodiments of the present invention, and not all embodiments of the present invention. It should be understood that the present invention is not limited to the exemplary embodiments described herein.

[0040] As mentioned in the background section, existing technologies have two main problems: First, due to the failure to fully utilize the multi-dimensional water usage data collected by smart water meters, existing technologies struggle to accurately identify the water usage patterns of different users and household types, resulting in insufficient timeliness and accuracy in water usage behavior prediction. Second, most existing water-saving optimization solutions are based on coarse-grained historical water usage data and single decision rules, lacking the dynamic optimization capability based on future water usage prediction, making it difficult to meet the differentiated and precise needs of complex water usage scenarios.

[0041] Figure 1 This is a system block diagram of a water meter-based water usage prediction and water-saving optimization method according to an embodiment of the present invention. Figure 1 As shown, the water usage prediction and water-saving optimization method based on water meters includes:

[0042] S1: Obtain multi-dimensional water usage data collected by water meters, construct a spatiotemporal coupled water usage feature matrix based on water usage time windows and household type identifiers, and perform hierarchical clustering analysis on the spatiotemporal coupled water usage feature matrix using an improved density peak clustering algorithm to obtain the household type water usage pattern spectrum.

[0043] Multi-dimensional water usage data is obtained by deploying smart water meter devices in various apartment buildings, including basic measurement data such as instantaneous flow rate data, cumulative water consumption data, water usage period identifiers, water pressure values, and water temperature parameters.

[0044] These data are continuously collected at a preset sampling frequency, and the corresponding timestamp information and user apartment type identification code are recorded at the same time to form an original dataset containing time dimension, spatial dimension and water use behavior dimension.

[0045] Based on predefined water usage time window parameters and household type identification information, multi-dimensional water usage data is sliced ​​according to time series. In this process, statistical features such as peak water usage, mean, variance, water usage frequency, and water usage duration are extracted within each time window. At the same time, combined with the spatial attribute information of household type identification, a spatiotemporal coupled water usage feature matrix that integrates time and spatial features is constructed.

[0046] Furthermore, the spatiotemporal coupled water use feature matrix is ​​constructed as follows: First, the multi-dimensional water use data is segmented temporally according to a predefined water use time window. If the current processing time window contains complete water use cycle data, the temporal dimension feature parameters within that time window are extracted, including the peak water use time, water use frequency distribution pattern, continuous water use duration statistics, and water use interval length, etc., as temporal behavioral features. Spatial dimension feature parameters are then constructed by combining apartment type identification information. Specifically, apartment type identification is converted into a spatial attribute vector, which includes spatial structural features such as building area level, number of rooms level, resident population level, and building type code. After the temporal and spatial feature vectors are constructed, a feature fusion strategy is used to couple and combine the two types of features. By weighting and fusing the temporal and spatial feature parameters according to preset feature weights, a composite feature vector containing both spatiotemporal attributes is generated. These vectors are arranged in rows to form a spatiotemporal coupling water use feature matrix. Each row of the matrix represents the spatiotemporal coupling feature of a time window sample, and each column represents a specific spatiotemporal coupling feature dimension. The matrix element values ​​reflect the intensity of water use behavior features under the corresponding spatiotemporal conditions, thereby realizing the organic integration of water use patterns in the time dimension and household type attributes in the spatial dimension.

[0047] For the spatiotemporally coupled water usage characteristic matrix, an improved density peak clustering algorithm is used to perform hierarchical clustering analysis at the unit type level. Specifically:

[0048] First, the original time-series water usage characteristics and apartment type attribute characteristics are unified to the same numerical scale using Z-score transformation, as expressed by the formula:

[0049]

[0050] in, For data points The A standardized time series feature, For data point i, the first One original time series feature, For the first The mean of a time-series feature across all data points For the first The standard deviation of a time-series feature across all data points For data points The A standardized apartment type attribute, For data points The Original apartment layout attributes, For the first The mean of each apartment type attribute across all data points. For the first The standard deviation of each apartment type attribute across all data points Numerical stability parameters.

[0051] Based on the standardized apartment layout features calculated by computation, the similarity between data points based on apartment layout attributes is quantified through Gaussian kernel function and normalization processing. The apartment layout similarity weight is calculated, and the formula is expressed as:

[0052]

[0053] in, For data points and Normalized similarity weights between apartment layouts This is the weighting factor for apartment type. For data points and Euclidean distance in the standardized apartment type attribute space This is the bandwidth parameter of the apartment layout similarity kernel function. This represents the total number of data points.

[0054] The calculated apartment type weight coefficients are used as modulation factors. These are then combined with standardized time-series and apartment type features. A weighted kernel density estimation method is used to calculate the local density value that considers apartment type similarity. The formula is as follows:

[0055]

[0056] in, For data points Improved local density value, As a weight for the similarity of apartment layouts, For spatiotemporal feature fusion parameters, For data points and Euclidean distance in the standardized temporal feature space This is the bandwidth parameter of the hybrid distance kernel function.

[0057] Furthermore, based on the calculated improved density values, and combined with the principle of "high density and far apart from each other" the data points were selected. Using 10 data points as cluster centers, the probability of each data point belonging to each cluster center is calculated using the softmax normalization mechanism, as expressed by the formula:

[0058]

[0059] in, For data points Belonging to the cluster center The probability, For the balance parameter between density and distance, Cluster center Improved local density value, For data points With cluster center Distance in the standardized mixed feature space For the first The feature vectors of each cluster center in the standardized mixed feature space. This is the preset number of clusters.

[0060] Furthermore, based on the calculated probability distribution, the maximum a posteriori probability criterion is used to output deterministic clustering labels, completing the mapping from the probability space to the discrete label space. The formula is expressed as:

[0061]

[0062] in, For data points The final cluster label, Indicates that returning makes Cluster center number with the maximum value .

[0063] The range is {1,2,..., Each value represents a specific cluster. For example, when... , representing data points They were assigned to the third cluster, which contains all data points with similar house type characteristics and water usage patterns.

[0064] By employing an improved density peak clustering algorithm and dynamically adjusting the cluster centers by introducing a similarity coefficient for apartment types, the algorithm can automatically identify cluster regions with irregular shapes. Each region precisely corresponds to the water usage pattern characteristics of a particular apartment type, and the cluster boundaries closely match the natural distribution shape of the data points, thus achieving accurate classification of apartment type differences.

[0065] like Figure 2 As shown, when performing clustering analysis on the same water usage dataset, the traditional K-means clustering algorithm can only identify three pre-defined circular cluster regions. The cluster boundaries are too regular and fail to reflect the actual distribution characteristics of water usage behavior patterns, leading to the incorrect merging of water usage data from different apartment types and an inability to accurately distinguish the differences in water usage habits between different apartment types, such as studio apartments and three-bedroom families. In contrast, as... Figure 3As shown, the improved density peak clustering algorithm used in this invention can automatically identify four cluster regions with irregular shapes, corresponding to single-apartment type, two-bedroom type, three-bedroom family type and duplex villa type respectively. Each region accurately corresponds to the water usage pattern characteristics of a type of housing, and the cluster boundary closely fits the natural distribution shape of the data points, achieving a precise classification effect of housing type differentiation.

[0066] Based on the calculated clustering results, each cluster is accessed one by one, and the original feature values ​​of all data points in the cluster are read. For the time feature dimension, the time node data such as the first water use time in the morning, the peak water use time in the morning, the peak water use time in the afternoon, and the last water use time in the evening for each data point are extracted. Then, the median of the distribution of these time nodes in the cluster is calculated. If the median of the first water use time in the morning in a cluster is a specific time period, then the time period is recorded as the morning water use feature identifier of the cluster.

[0067] Furthermore, after the median of the time feature is calculated, the water intensity feature dimension is further processed. The median of intensity indicators such as the average daily water consumption, the maximum water consumption per hour, the longest continuous water consumption duration, and the shortest water consumption interval are calculated for all data points in the cluster. If the median of the average daily water consumption falls within a certain water consumption range, then that range is marked as the water intensity feature identifier of the cluster.

[0068] Furthermore, after determining the median of each feature dimension, the apartment type identifier code corresponding to each data point in the cluster is read, and the occurrence frequency of various apartment type identifiers such as single apartments, two-bedroom apartments, three-bedroom apartments, four-bedroom apartments, and villas in the cluster is counted. The proportion of each apartment type identifier is calculated. If the proportion of the three-bedroom apartment type identifier in a certain cluster reaches the highest value, then the cluster is assigned to the three-bedroom apartment type category, and the median of all features of the cluster is combined to form a water use behavior pattern unit for the three-bedroom apartment type.

[0069] Furthermore, after the apartment type affiliation of all clusters is determined, a grouping index is established according to the apartment type category. Multiple clusters belonging to the same apartment type are grouped under that apartment type group. If a three-bedroom apartment type group contains multiple clusters, then a secondary classification is performed based on the difference in the time of the first water use in the morning among these clusters. Clusters with the earlier first water use in the morning are classified as early-rising water use patterns, and clusters with the later first water use in the morning are classified as late-rising water use patterns. At the same time, based on the difference in the average daily water consumption, they are further subdivided into water-saving, standard, and water-consuming subcategories.

[0070] Furthermore, after classifying the water usage patterns within each apartment type, a pattern spectrum structure containing multiple water usage pattern units is constructed for each apartment type. This structure is sorted according to the combination of water usage time patterns and water usage intensity levels, with the early-morning water-saving pattern at the top and the late-morning water-consuming pattern at the bottom, and other pattern combinations arranged in order. Each water usage pattern unit records its corresponding time characteristic identifier, intensity characteristic identifier, and sample proportion in that apartment type, ultimately forming an apartment water usage pattern spectrum that can comprehensively describe the range and distribution patterns of water usage behavior changes in that apartment type.

[0071] The household water use pattern spectrum not only retains the typical water use timing characteristics of each household type, but also reflects the differences in water use behavior between different household types, providing accurate basic data support for subsequent water use prediction and water conservation optimization.

[0072] S2: Perform multi-scale time-series decomposition on the water usage pattern spectrum of the aforementioned household type, extract the periodic water usage baseline and the random water usage fluctuation, and construct a two-layer coupled prediction network to generate a water usage behavior prediction model.

[0073] First, the system performs multi-scale time-series decomposition on the household water usage pattern spectrum. This decomposition process uses multiple analysis windows at different time scales to deconstruct the time-series data in the water usage pattern spectrum layer by layer. Specifically: First, the system reads the water usage time-series data corresponding to each household type in the household water usage pattern spectrum, and then performs hierarchical decomposition on four time scales: hourly, daily, weekly, and monthly. If processing the hourly scale, the system extracts the baseline trend of water usage within each hour. By identifying recurring peak and off-peak water usage periods, water usage change patterns with fixed time interval recurrence characteristics are marked as hourly periodic components.

[0074] Furthermore, when processing at the daily scale, by comparing the water consumption distribution patterns of the same household type on different days, the stable baseline value of the total daily water consumption and the recurring patterns of intraday water consumption distribution are identified, and these water consumption characteristics that show regular recurrence within the daily time range are classified as daily periodic components.

[0075] Furthermore, when processing at the weekly scale, by comparing the differences in water consumption between weekdays and rest days, as well as the similarity in water consumption on the same days of the week, periodic components with weekly recurrence patterns, such as the baseline patterns of water consumption on weekdays and rest days, are extracted.

[0076] Furthermore, when processing at the monthly scale, by analyzing the trend of water consumption changes between different months, seasonal water consumption increase and decrease patterns and annual water consumption periodic change patterns are identified, and these long-term recurring water consumption characteristics are marked as monthly periodic components.

[0077] Once all periodic components at all time scales have been extracted, the periodic components at each scale are superimposed and combined to form the comprehensive periodic water consumption baseline for this type of household. At the same time, the comprehensive periodic water consumption baseline is subtracted from the original water consumption time series data to obtain the random water consumption fluctuation after removing all periodic patterns.

[0078] Through a multi-scale decomposition process, water consumption baseline components with clear periodic patterns are extracted from the household water consumption pattern spectrum. These periodic water consumption baselines include parameters such as the baseline value of water consumption at each time scale, the amplitude of periodic fluctuations, and the phase of periodic fluctuations. Meanwhile, random water consumption fluctuations reflect the random variations in user water consumption behavior that do not follow fixed periodic patterns, including unpredictable water consumption characteristics such as sudden large-scale water consumption, unexpected water interruptions, and temporary changes in water demand.

[0079] A two-layer coupled prediction network architecture is constructed based on the extracted periodic water usage baseline and random water usage fluctuation data. This architecture includes two parallel feature processing branches: a periodic feature processing layer and a random feature processing layer. The periodic feature processing layer is specifically responsible for processing the periodic water usage baseline data, employing a recurrent neural network structure to capture the temporal dependencies and periodic recurrence patterns of periodic water usage. The random feature processing layer specifically processes the random water usage fluctuation data, employing a convolutional neural network structure to extract local feature patterns and abrupt change detection capabilities from the random fluctuations.

[0080] By fusing periodic and random features through a cross-attention mechanism, a two-layer coupled prediction network is constructed into a complete water use behavior prediction model, expressed by the formula:

[0081]

[0082]

[0083]

[0084]

[0085] in, To predict water consumption for the next moment, This is a periodic water consumption baseline sequence for the current moment. This is a sequence of random water usage fluctuations at the current moment. For time-coded vectors, For periodic eigenvectors, For random eigenvectors, For adaptive attention weights, For the first Scale convolution kernel weight matrix, For the corresponding bias vector For residual connectivity coefficients, For gradient constraint weights, This is the gradient of the loss function from the previous time step.

[0086] The calculation process involves inputting a periodic water usage baseline sequence. and time-coded vector The data is fed into a time-aware LSTM network, and periodic feature vectors are calculated through the LSTM's gating mechanism. This vector encodes the long-term periodic dependence of water use behavior.

[0087] At the same time, the random water fluctuation sequence is used in parallel. Input to a multi-scale convolutional network, through The calculation formula yields the randomness eigenvector. This vector captures local mutation patterns and aperiodic fluctuations in water use behavior.

[0088] After the feature vectors of both branches have been calculated, the crucial coupling and fusion stage begins, which involves attention weights. The calculation formula dynamically determines the relative importance of periodic and random features in the final prediction. This formula not only considers the inherent correlation between the two features at the current moment but also introduces gradient information from the previous moment as a feedback mechanism for historical learning experience. Ultimately, The prediction formula will calculate the attention weights. It is applied to the weighted fusion process of two feature vectors, and a residual connection term is added to enhance the network's expressive power. Through the nonlinear transformation of the multilayer perceptron, the final output is the predicted water consumption value for the next time step, ensuring the effective integration of periodic patterns and random fluctuations.

[0089] In this embodiment, the training process of the two-layer coupled prediction network employs an adaptive learning rate adjustment strategy and gradient pruning technique. Specifically, the periodic feature processing layer uses a Long Short-Term Memory (LSTM) network structure with a hidden layer dimension of 128 and an initial learning rate of 0.001; the stochastic feature processing layer uses a one-dimensional convolutional neural network structure with a kernel size of 3 and 64 channels. During model training, the network parameters are updated using the backpropagation algorithm, and the loss function is a weighted combination of mean squared error and regularization term, with a weight decay coefficient of 0.0001. When the validation set loss does not decrease for 5 consecutive epochs, the learning rate is adjusted by a decay factor of 0.5. The attention weights in the cross-attention mechanism are normalized using the softmax function to ensure that the sum of the fusion weights of periodic and stochastic features is 1.

[0090] Furthermore, during the model training phase, adaptive attention weights... The calculation is performed using the complete formula that includes the gradient constraint term, where the gradient constraint term... The loss function gradient is calculated based on the relationship between the true label and the predicted value at the previous time step. During the model prediction and inference phase, since the true label is missing, the loss function gradient cannot be calculated; therefore, a gradient constraint term is used. Set to zero, adaptive attention weights The calculation is performed in a simplified form, and the formula is expressed as:

[0091]

[0092] The main function of gradient constraint terms is to provide gradient stability adjustment and convergence optimization during the training phase, and during the prediction and inference phase... The network has fully learned the periodic feature vectors through the parameter weights obtained during training. randomness eigenvectors and time-coded vector The nonlinear mapping relationship between them enables independent dynamic calculation of attention weights. Setting the gradient constraint term to zero ensures the effective operation of the cross-attention mechanism in prediction scenarios while avoiding dependence on the gradient of the loss function.

[0093] By decomposing water use behavior into periodic baseline water use and random water use fluctuations and processing them separately, the inherent patterns of water use behavior can be captured more accurately. The periodic feature processing branch specifically learns regular water use patterns in daily life, while the random feature processing branch specifically identifies sudden water use events and abnormal water use behaviors. This specialized processing avoids the problem of mutual interference between periodic and random features in traditional single-network systems. Simultaneously, a cross-attention mechanism dynamically adjusts the weight contributions of the two types of features based on the feature intensity of real-time water use data. This allows the water use behavior prediction model to obtain stable predictions based on periodic features during regular water use periods and to quickly respond to changes in random features when encountering abnormal water use situations, thus achieving adaptive prediction capabilities for different water use scenarios. Furthermore, multi-scale temporal decomposition based on housing type differences ensures that the water use characteristics of different housing types can be accurately identified and modeled. This allows the water use behavior prediction model to provide personalized prediction results for different housing types, such as studio apartments, multi-room houses, and villas, providing more reliable data support for subsequent water-saving optimization decisions.

[0094] S3: Input the current water usage data into the water usage behavior prediction model to obtain the future water usage prediction value, and calculate the water usage risk index based on the future water usage prediction value.

[0095] The system reads water usage data at the current hour from smart water meters deployed in each apartment building. This includes specific measurements such as cumulative water consumption within the current hour, maximum instantaneous flow rate, number of water usage starts and stops, and longest continuous water usage duration. Following a pre-defined data preprocessing workflow, the cumulative water consumption data is converted into average water consumption per minute, the instantaneous flow rate data is normalized to a standard flow range, the number of water usage starts and stops is converted into water usage frequency density, and the continuous water usage duration is converted into a water usage sustainability index. The processed data is organized into a feature vector containing four numerical elements: the first element represents the average water consumption per minute, the second element represents the normalized instantaneous flow rate, the third element represents the water usage frequency density, and the fourth element represents the water usage sustainability index.

[0096] The four-element feature vector is input into the input layer node of the water use behavior prediction model. The periodic feature processing branch within the model extracts the first and fourth elements of the feature vector for time-series analysis. This branch uses a long short-term memory network unit and a built-in memory gating mechanism to calculate the changing trends of the average minute water consumption and water use sustainability index within the next hour, outputting the expected average minute water consumption and expected water use sustainability index for the next hour. The stochastic feature processing branch within the model processes the second and third elements of the feature vector. This branch uses a one-dimensional convolutional neural network and multiple convolutional kernels of different sizes to identify abrupt changes in normalized instantaneous flow rate and water use frequency density, outputting the possible magnitudes of flow rate and frequency changes within the next hour. The cross-attention mechanism within the water use behavior prediction model calculates the weight coefficients of the periodic feature processing branch and the random feature processing branch based on the feature intensity of the current input data. If the current water use data shows obvious periodic characteristics, the weight of the periodic feature processing branch is set to a higher value, and the weight of the random feature processing branch is reduced accordingly. If the current water use data shows abnormal fluctuations, the weight of the random feature processing branch is increased, and the weight of the periodic feature processing branch is decreased.

[0097] Based on the apartment type identification code carried in the input data, the output of the water use behavior prediction model is assigned to the corresponding apartment type category. If the input data identification code is for a studio apartment, the expected water consumption for the next hour is labeled as the predicted water consumption value for a studio apartment; if the identification code is for a three-bedroom apartment, the output is labeled as the predicted water consumption value for a three-bedroom apartment. An independent prediction result record is maintained for each apartment type category to ensure that each apartment type's water use pattern spectrum receives its own specific prediction value. The predicted water consumption value for each apartment type includes two specific values: the predicted total water consumption for the next hour and the predicted maximum water use intensity for the next hour.

[0098] Furthermore, the peak water consumption records for each apartment type over the past three months are retrieved from the historical database, including the highest historical daily water consumption, highest historical hourly water consumption, and highest historical instantaneous water intensity. The difference between the predicted total water consumption for the next hour and the highest historical hourly water consumption for that apartment type is calculated. A positive difference indicates that the predicted water consumption exceeds the historical peak, and the magnitude of the difference reflects the degree of exceedance. A negative difference indicates that the predicted water consumption is lower than the historical peak. The ratio of this difference to the historical peak is then calculated to obtain the relative deviation percentage, which is the quantitative representation of the degree of deviation.

[0099] Furthermore, water usage baseline parameters for each apartment type are retrieved from the apartment type baseline database, including the standard daily water consumption, the upper limit of normal water usage fluctuations, and the threshold for abnormal water usage. The degree of deviation is compared with the abnormal water usage threshold in the apartment type's water usage baseline. If the deviation exceeds the threshold, the deviation value is multiplied by a risk amplification factor to obtain a higher risk index; if the deviation does not exceed the threshold but exceeds the upper limit of normal fluctuations, the deviation value is multiplied by a standard risk coefficient to obtain a medium risk index; if the deviation is within the normal fluctuation range, the deviation value is multiplied by a basic risk coefficient to obtain a lower risk index. The calculated risk index value ranges from zero to one hundred, with higher values ​​indicating greater water usage risk. This value serves as the final water usage risk index output.

[0100] It is important to note that the calculation of the three risk coefficients involves the following steps: First, extract the daily water consumption records for each household type over the past six months from the historical water consumption database. Calculate the arithmetic mean of the daily water consumption for each household type as the baseline for water consumption average. Then, calculate the absolute deviation of the daily water consumption from this baseline. The arithmetic mean of all deviations is used as the average deviation index for that household type. If the average deviation index for that household type is less than one-tenth of the baseline water consumption average, then the average deviation index for that household type is directly used as the basic risk weight coefficient. If the average deviation index is between one-tenth and one-fifth of the baseline water consumption average, then the system multiplies the average deviation index for that household type by two as the basic risk weight coefficient. If the average deviation index is greater than one-fifth of the baseline water consumption average, then the system multiplies the average deviation index for that household type by three as the basic risk weight coefficient.

[0101] Once the basic risk weighting coefficient is determined, the number of minor and moderate anomalies for each apartment type in the past year is retrieved from the abnormal event record database. The number of minor anomalies is added to the number of moderate anomalies and multiplied by two to obtain the total number of abnormal events for that apartment type. If the total number of abnormal events for a certain apartment type is less than five, the total number of abnormal events is divided by ten to obtain the medium risk weighting coefficient; if the total number of abnormal events is between five and fifteen, the total number of abnormal events is divided by five to obtain the medium risk weighting coefficient; if the total number of abnormal events is greater than fifteen, the total number of abnormal events is divided by three to obtain the medium risk weighting coefficient. After setting the medium-risk weighting coefficient, the number of historical serious failures for each apartment type is retrieved from the equipment maintenance record database. The number of serious failures is multiplied by 10 to obtain the failure severity index for that apartment type. If the failure severity index is less than 10, it is divided by 100 to obtain the high-risk weighting coefficient. If the failure severity index is between 10 and 30, it is divided by 50 to obtain the high-risk weighting coefficient. If the failure severity index is greater than 30, it is divided by 20 to obtain the high-risk weighting coefficient. Thus, the three risk weighting coefficients are determined.

[0102] S4: Prioritize water conservation based on the water use risk index and generate differentiated water conservation optimization schemes.

[0103] Read the water risk index values ​​for all apartment types from the database, and store these values ​​in an array for sorting.

[0104] The risk index in the array is sorted in descending order using the quicksort algorithm. After sorting, each apartment type is assigned a serial number. The apartment type with serial number one corresponds to the highest risk index value, the apartment type with serial number two corresponds to the second highest risk index value, and so on until the apartment type with the largest serial number corresponds to the lowest risk index value.

[0105] If a unit's water use risk index is greater than 80, it is classified as a Category 1 risk unit, requiring an early warning strategy. If the water use risk index is between 30 and 80, it is classified as a Category 2 risk unit, requiring a monitoring and recommendation strategy. If the water use risk index is less than 30, it is classified as a Category 3 risk unit, requiring an incentive-based water-saving strategy. Based on the ranking results and classification labels, a priority processing queue is established, with Category 1 risk units at the front of the queue for priority processing, Category 2 risk units in the middle of the queue, and Category 3 risk units at the back of the queue.

[0106] For the first category of high-risk apartment types, an early warning strategy is generated. The highest historical hourly water consumption is read from the apartment's historical peak water usage data. This value is multiplied by 0.8 to obtain the warning threshold. When the real-time water flow of this apartment reaches the warning threshold, the smart water meter display automatically shows a yellow warning message, and a text message reminding the user that the water consumption is approaching the historical peak is sent to their mobile phone. If the real-time water flow of this apartment exceeds the highest historical hourly water consumption, the smart water meter display shows a red warning message, and a text message warning the user of potential water usage anomalies is sent to their mobile phone, suggesting that the user check whether the pipeline equipment is functioning properly. If the water consumption of this apartment exceeds the standard daily water consumption baseline for three consecutive days, a special water consumption analysis report is generated, detailing the specific time periods of excessive water consumption, possible causes, and suggested improvement measures, and is sent to the user. Simultaneously, a water consumption habit comparison function is established to compare the current water consumption pattern of this apartment with the average water consumption level of similar apartments, generating a personalized water consumption improvement suggestion report.

[0107] For the second category of high-risk apartment types, a monitoring and suggestion strategy is generated. A monitoring and reminder threshold is set for these apartments. The daily water consumption baseline is calculated by multiplying the standard daily water consumption by 1.3. When the cumulative daily water consumption exceeds this threshold, a text message reminding the user of high water consumption is sent to their mobile phone, advising them to pay attention to their daily water usage. A weekly water consumption report is generated for these apartments, including daily water consumption statistics for the week, a comparison with the same period last week, and a comparison with the average water consumption of similar apartments, and sent to the user. If the average daily water consumption for a particular apartment type in a given week is more than 20% higher than the average of the previous four weeks, it is automatically marked as an abnormal water consumption trend, and a water consumption trend warning is sent to the user, reminding them to check for leaks in equipment or changes in water usage habits. A monthly water-saving suggestion service is also provided for these apartments. Based on the analysis of their water usage patterns, three to five personalized water-saving tips are sent each month, including suggestions for optimizing shower time, improving kitchen water efficiency, and adjusting appliance water usage patterns. If the water consumption of this apartment type shows an upward trend for two consecutive months, a water consumption optimization suggestion report will be generated to analyze the possible reasons for the increase in water consumption and provide corresponding improvement measures.

[0108] For the third category of high-risk housing units, an incentive-based water-saving strategy is implemented. This involves calculating the difference between the actual monthly water consumption and the standard monthly water consumption baseline for that unit. If the actual consumption is lower than the standard monthly consumption, the water saved is divided by the standard monthly consumption to obtain the water-saving percentage. A tiered reward mechanism is then implemented based on this percentage. For example, if the water-saving percentage is greater than 0.1%, the unit receives a 10% reduction in the total monthly water bill; if it is greater than 0.2%, a 20% reduction; and if it is greater than 0.3%, a 30% reduction, and so on. A points-based reward mechanism can also be provided for these units. Ten points are awarded for every cubic meter of water saved. These points can be redeemed for water-saving equipment or additional water bill discounts. One hundred points can be redeemed for water-saving appliances, and two hundred points can be redeemed for smart water meter upgrades, etc.

[0109] Furthermore, based on the specific unit type identifiers of each unit's water usage pattern spectrum, corresponding differentiated water-saving suggestion plans are generated. If the unit type is identified as a studio apartment, the focus is on analyzing the water usage characteristics of bathing and kitchens. For example, it is recommended that users install water-saving showerheads with a flow limit of six liters per minute and keep shower time under ten minutes. If the unit type is identified as a three-bedroom family unit, the water usage characteristics of multiple members are analyzed. For example, it is recommended to adopt staggered water usage arrangements during the two peak water usage periods of 6:00-8:00 AM and 7:00-9:00 PM, and provide personalized water usage time suggestions for each family member. If the unit type is identified as a duplex villa, considering the multi-floor and large-area water usage characteristics, it is recommended to install layered water usage monitoring equipment to provide independent statistics and analysis of water usage on each floor. For example, it is recommended to install a hot water circulation system to reduce hot water waiting time, optimize the irrigation method for courtyard greenery, and use drip irrigation or timed sprinkler systems instead of manual watering. Each differentiated suggestion plan for each unit type includes detailed implementation guidance and expected results, allowing users to selectively adopt relevant suggestions based on their own circumstances.

[0110] Finally, the early warning strategy, monitoring and suggestion strategy, incentive water-saving strategy, and differentiated water-saving suggestions are integrated to form a complete water-saving optimization solution. The output document adopts a three-layer structure. The first layer contains basic information about the household type and risk level classification. The second layer contains the corresponding water-saving strategy types and suggested measures. The third layer contains specific equipment recommendations, usage instructions, and expected effects. If the household type is classified as a Class I risk household, the output document includes early warning threshold settings, prompt information content, water use analysis report templates, and a list of recommended monitoring equipment. If the household type is classified as a Class II risk household, the output document includes monitoring threshold settings, weekly and monthly report content templates, a water-saving suggestion push plan, and a user guide for water use trend analysis tools. If the household type is classified as a Class III risk household, the output document includes an explanation of the reward mechanism, an introduction to the points rules, a personalized suggestion list, and a user guide for related water-saving applications.

[0111] Simultaneously, a user feedback collection mechanism is established to regularly understand the acceptance level and implementation effect of water-saving suggestions for each apartment type through questionnaires and user interviews. Feedback information is stored in a user experience database for strategy optimization. If the acceptance rate of water-saving suggestions for a particular apartment type is low, the water usage habits and preferences of that apartment type are analyzed, and the content and delivery method of relevant suggestions are adjusted to provide more personalized water-saving solutions that better meet user needs. A water-saving effect tracking and evaluation mechanism is also established to monthly statistically analyze the actual water consumption changes after each apartment type adopts water-saving suggestions, calculate water-saving effect and user satisfaction indicators, and provide data support for subsequent water-saving strategy optimization, ensuring that differentiated water-saving optimization solutions achieve effective water-saving goals while respecting users' right to choose.

[0112] Here, those skilled in the art will understand that the specific operations of each step in the above-described method for predicting water usage and optimizing water conservation have been referenced above. Figures 1 to 3 The method for predicting water usage and optimizing water conservation based on water meters has been described in detail, and therefore, its repeated description will be omitted.

[0113] According to another aspect of the present invention, a water meter-based water usage prediction and water-saving optimization system is provided, comprising:

[0114] The data acquisition module is used to acquire multi-dimensional water usage data collected by water meters. Based on the water usage time window and household type identification, a spatiotemporal coupled water usage feature matrix is ​​constructed. An improved density peak clustering algorithm is used to perform hierarchical clustering analysis on the spatiotemporal coupled water usage feature matrix to obtain the household type water usage pattern spectrum.

[0115] The water usage prediction module is used to perform multi-scale time-series decomposition of the water usage pattern spectrum of the household type, extract the periodic water usage baseline and random water usage fluctuation, and construct a two-layer coupled prediction network to generate a water usage behavior prediction model.

[0116] The risk calculation module is used to input the current water usage data into the water usage behavior prediction model to obtain the future water usage prediction value, and calculate the water usage risk index based on the future water usage prediction value;

[0117] The scheme optimization module is used to prioritize water conservation based on the water use risk index and generate differentiated water conservation optimization schemes.

[0118] In summary, the water meter-based water usage prediction and water-saving optimization method based on the embodiments of the present invention has been clarified. By introducing a spatiotemporally coupled feature matrix and an improved density peak clustering algorithm, it achieves in-depth mining of multi-dimensional water usage data and accurate stratification of user water usage patterns. Through a two-layer coupled prediction network, it significantly improves the accuracy and timeliness of water usage behavior prediction. At the same time, based on the water-saving priority ranking calculated by the water usage risk index, it generates highly targeted and differentiated water-saving optimization schemes, which not only effectively improves the problem of poor generalization of traditional water-saving optimization schemes, but also improves the efficiency of water resource utilization, and achieves the goal of refined and intelligent water management.

Claims

1. A water consumption prediction and water saving optimization method based on a water meter, characterized by, include: Multi-dimensional water usage data collected from water meters is acquired, and a spatiotemporal coupled water usage feature matrix is ​​constructed based on water usage time windows and household type identifiers. An improved density peak clustering algorithm is used to perform hierarchical clustering analysis on the spatiotemporal coupled water usage feature matrix to obtain the household type water usage pattern spectrum. The water usage pattern spectrum of the aforementioned household type is decomposed into a multi-scale time series, and the periodic water usage baseline and random water usage fluctuation are extracted to construct a two-layer coupled prediction network to generate a water usage behavior prediction model. The current water usage data is input into the water usage behavior prediction model to obtain the future water usage prediction value, and the water usage risk index is calculated based on the future water usage prediction value. Based on the water use risk index, water conservation priorities are ranked, and differentiated water conservation optimization schemes are generated.

2. The water consumption prediction and water saving optimization method based on a water meter according to claim 1, characterized by, The improved density peak clustering algorithm is used to perform hierarchical clustering analysis on the spatiotemporal coupled water use feature matrix according to the household type dimension, specifically including: The Z-score transformation unifies the time-series water usage characteristics and household type attribute characteristics to the same numerical scale; Based on standardized apartment layout features, the apartment layout similarity weight coefficient is calculated through Gaussian kernel function and normalization processing; The apartment type similarity weight coefficient is used as a modulation factor, and the local density value considering apartment type similarity is calculated by weighted kernel density estimation. Based on the improved local density value, the softmax normalization mechanism is used to calculate the probability of each data point belonging to each cluster center, and the deterministic cluster label is output through the maximum a posteriori probability criterion.

3. The method for water consumption prediction and water-saving optimization based on water meters according to claim 2, characterized in that, The formula for calculating the apartment type similarity weighting coefficient is as follows: in, For data points and Normalized similarity weights between apartment layouts This is the weighting factor for apartment type. For data points and Euclidean distance in the standardized apartment type attribute space This is the bandwidth parameter of the apartment layout similarity kernel function. Numerical stability parameters This represents the total number of data points.

4. The method for water consumption prediction and water-saving optimization based on water meters according to claim 3, characterized in that, The multi-scale time series decomposition includes hierarchical decomposition operations according to four time scales: hourly, daily, weekly, and monthly. Water consumption change patterns with recurrence characteristics at fixed time intervals are extracted as periodic components at each time scale. The random water consumption fluctuation is obtained by subtracting the comprehensive periodic water consumption benchmark from the original water consumption time series data.

5. The water consumption prediction and water saving optimization method based on water meter according to claim 4, characterized in that, The two-layer coupled prediction network includes a periodic feature processing layer and a random feature processing layer. The periodic feature processing layer uses a recurrent neural network structure to process periodic water consumption benchmark data; The randomness feature processing layer uses a convolutional neural network structure to process random water usage fluctuation data.

6. The water consumption prediction and water saving optimization method based on a water meter according to claim 5, characterized by, Based on the aforementioned two-layer coupled prediction network, a complete water use behavior prediction model is constructed by fusing periodic and random features through a cross-attention mechanism, as expressed in the formula: in, To predict water consumption for the next moment, This is a periodic water consumption baseline sequence for the current moment. This is a sequence of random water usage fluctuations at the current moment. For time-coded vectors, For periodic eigenvectors, For random eigenvectors, For adaptive attention weights, For residual connectivity coefficients, For gradient constraint weights, This is the gradient of the loss function from the previous time step.

7. The water consumption prediction and water saving optimization method based on a water meter according to claim 6, characterized by, The calculation of the water use risk index includes: The difference between the predicted future water consumption and the historical peak water consumption is calculated, and the relative deviation percentage is used as the degree of deviation. A water use baseline for each household is established based on the water use pattern spectrum of the household type. The degree of deviation is compared with the water use baseline for each household type, and a water use risk index is calculated based on the magnitude of the deviation.

8. A water consumption prediction and water saving optimization system based on a water meter, characterized by, include: The data acquisition module is used to acquire multi-dimensional water usage data collected by water meters. Based on the water usage time window and household type identification, a spatiotemporal coupled water usage feature matrix is ​​constructed. An improved density peak clustering algorithm is used to perform hierarchical clustering analysis on the spatiotemporal coupled water usage feature matrix to obtain the household type water usage pattern spectrum. The water usage prediction module is used to perform multi-scale time-series decomposition of the water usage pattern spectrum of the household type, extract the periodic water usage baseline and random water usage fluctuation, and construct a two-layer coupled prediction network to generate a water usage behavior prediction model. The risk calculation module is used to input the current water usage data into the water usage behavior prediction model to obtain the future water usage prediction value, and calculate the water usage risk index based on the future water usage prediction value; The scheme optimization module is used to prioritize water conservation based on the water use risk index and generate differentiated water conservation optimization schemes. 9.A computer device, comprising a memory and a processor, wherein the memory stores a computer program, and the computer device is configured to perform the method according to any one of claims 1-8 when the computer program is executed by the processor. When the processor executes the computer program, it implements the steps of the water meter-based water usage prediction and water-saving optimization method as described in any one of claims 1 to 7.

10. A computer-readable storage medium having stored thereon a computer program, characterized in that, When the computer program is executed by the processor, it implements the steps of the water meter-based water usage prediction and water-saving optimization method as described in any one of claims 1 to 7.