Remote water meter abnormity early warning method and system based on historical water volume
Through the remote water meter abnormality warning method based on historical water volume, differentiated detection strategies are adopted for different types of users, which solves the problem of insufficient water use data analysis in the existing technology, and achieves efficient and intelligent early warning and management of abnormal water use.
Patent Information
- Application Number
- CN202411510047.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-10-28
- Publication Date
- 2025-03-18
AI Technical Summary
The existing intelligent water meter and water use information collection system have shortcomings in the analysis and utilization of massive water use data, and cannot effectively explore the water use rules and values, and cannot support refined water use management.
A remote water meter abnormality warning method based on historical water volume is proposed. By obtaining user data, users are divided into categories A, B, and C, and different abnormality detection strategies are adopted for users of different categories. For Class A users, a water use prediction model is established; for Class B users, a reference water table is found using the K-means clustering algorithm; for Class C users, a cumulative water use monitoring rules are used.
Differentiated abnormality detection is realized for different types of users, improving the effectiveness and real-timeness of detection, and the dynamic warning level mechanism makes the warning more intelligent, and the system's adaptability and sustainability have also been improved.
Smart Images

Figure CN119647936A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of abnormal early warning of remote water meters, and more specifically, to a method and system for abnormal early warning of remote water meters based on historical water volume. Background Art
[0002] With the rapid development of social economy and the continuous advancement of urbanization, the urban population is growing and the demand for water is increasing, which has brought tremendous pressure to the urban water supply system. In order to achieve sustainable utilization and optimal allocation of water resources, smart water services have become an important direction for the transformation and upgrading of the water industry. Among them, how to achieve real-time monitoring, accurate prediction and intelligent management of urban residents' water use behavior is a key technical problem that needs to be solved urgently.
[0003] At present, urban residents’ water consumption monitoring mainly adopts traditional mechanical water meters and manual meter reading, which has many limitations. First, the traditional mechanical water meter has a single function and can only record the cumulative water consumption. It cannot realize the real-time collection and transmission of water consumption data, resulting in the water department’s inability to grasp the dynamics of residents’ water consumption in a timely manner, and it is difficult to quickly respond to and deal with water use anomalies. Secondly, manual meter reading is inefficient and has a long meter reading cycle, which cannot meet the requirements of smart water services for real-time and dynamic water use information. In addition, manual meter reading is easily affected by human factors, and the accuracy and reliability of data are difficult to guarantee. It is also unable to adapt to the growing scale and complexity of water use data.
[0004] In response to this problem, a variety of smart water meters and water use information collection systems have emerged in recent years, using technologies such as the Internet of Things and communications to achieve automatic collection and remote transmission of water use data. This has to some extent solved the shortcomings of traditional meter reading methods and improved the efficiency and real-time nature of data collection. However, these systems still have some common problems in practical applications, which restricts the further development of smart water services.
[0005] Smart water meters and water use information collection systems are deficient in the analysis and utilization of massive water use data. As water use data has the characteristics of long time series, large fluctuations, and multiple influencing factors, traditional data analysis methods are difficult to effectively explore the laws and values contained therein, and cannot provide strong support for refined water use management.
[0006] Specifically, the existing water use data analysis methods have the following main limitations: First, there is a lack of in-depth exploration and characterization of the water use behavior characteristics of different user groups, and it is impossible to achieve user profiling and classification; second, the water consumption prediction model is not accurate enough, and it is difficult to meet the needs of precise scheduling and early warning; third, the judgment rules for water use anomalies are relatively simple, which is prone to false alarms or omissions; fourth, the breadth and depth of data utilization are insufficient, and there is a lack of data-driven business application scenarios.
[0007] To this end, this application proposes a remote water meter abnormal warning method and system based on historical water volume Summary of the invention
[0008] In order to overcome the above-mentioned defects of the prior art, the present invention provides a remote water meter abnormality early warning method based on historical water volume.
[0009] To achieve the above object, the present invention provides the following technical solutions:
[0010] A remote water meter abnormality early warning method based on historical water volume, comprising:
[0011] S10, obtaining user data, wherein the user data includes the user water meter installation time and the user usage data;
[0012] S20. According to the installation time of the user's water meter, the water meter installed for more than 2 years is represented as a Class A meter, the water meter installed for more than 3 months but less than 2 years is represented as a Class B meter, and the water meter installed for less than 3 months is represented as a Class C meter;
[0013] S30. For Class A meters, a water consumption prediction model is established based on historical user consumption data, including daily water consumption in the previous two years and daily water consumption in the previous 30 days. For Class B meters, a K-means clustering algorithm is used to find the reference water meter in the Class A table that is most similar to the water consumption pattern of each Class B meter.
[0014] S40, setting a threshold value of abnormal duration of cumulative water consumption and a deviation threshold value T from historical data and a reference water meter;
[0015] S50, obtaining real-time user usage data, and performing abnormality judgment respectively:
[0016] For table A, calculate the deviation E between the data of the current day and the data of the same period of the previous two years. 1 and the deviation from the mean of the previous 30 days E 2 , if E 1 >T and E 2 >T triggers abnormal warning;
[0017] For table B, calculate the deviation E between the data of the current day and the data of the same day in the previous 60 days 3 , Deviation from the mean of the previous 21 days E 4 and the deviation E from the reference table data of the same period 5 , if E 3 >T and E 4 >T, but E 5 ≤T triggers abnormal warning;
[0018] For Class C meters, determine whether the cumulative water consumption is exactly the same for N consecutive days after installation. If so, an abnormal warning is triggered.
[0019] S60. For abnormal warnings detected, the warning level is dynamically adjusted according to the number of days the abnormality lasts: 1-3 days is a level 1 warning, 4-7 days is a level 2 warning, 8-14 days is a level 3 warning, and more than 14 days is a level 4 warning;
[0020] S70. For the water meter that has triggered the warning, if the subsequent meter reading data returns to normal, cancel the warning and clear the abnormal days, and return to step S50 for continuous monitoring.
[0021] Preferably, the method for establishing a water consumption prediction model including daily water consumption in the previous two years and daily water consumption in the previous 30 days based on the user's historical consumption data for the Class A table is as follows:
[0022] S31. For each Class A table, extract the following data from the user's historical usage data:
[0023] The water consumption data for each day in the first three years is recorded as D y-1 (d),D y-2 (d),D y-3 (d), where D y-1 (d),D y-2 (d),D y-3 (d) represents the water consumption data on the dth day in the previous year, the previous two years, and the previous three years, where d represents the day of the year. The daily water consumption data for the previous 60 days is recorded as D 1 ,D 2 ,...,D 60 ;
[0024] S32, pre-processing the extracted historical user water consumption data,
[0025] S33, constructing characteristic variables based on the pre-processed historical water consumption data of users;
[0026] S34, using the characteristic variables and the corresponding actual daily water consumption, and using a support vector regression model to train a water consumption prediction model;
[0027] S35. For each Class A table, when predicting water consumption on the d day, extract the historical water consumption data of the table on and before d-1 day, construct a feature vector F(d), substitute it into the trained SVR model, and obtain the predicted water consumption Q(d) on the d day.
[0028] Preferably, the preprocessing of the extracted historical water consumption data of the user includes:
[0029] If there are missing historical water consumption data, linear interpolation is used to estimate and fill in;
[0030] Outlier processing: Calculate the median M and interquartile range IQR of the user water consumption data for the previous 60 days. If the water consumption on a certain day D i If it is outside the interval [M-2IQR,M+2IQR], it is considered an outlier and replaced by the median M.
[0031] Preferably, the following characteristic variables are constructed based on the pre-processed historical user water consumption data:
[0032] The weighted average of daily water consumption in the previous three years 1 (d):
[0033] F 1 (d) = 0.5·D y-1 (d)+0.3·D y-2 (d)+0.2·D y-3 (d)
[0034] The exponentially weighted moving average of daily water consumption in the previous 60 days F 2 (i)
[0035]
[0036] The exponentially weighted moving standard deviation of daily water consumption in the previous 60 days F 3 (i)
[0037]
[0038] Where α = 0.1;
[0039] The coefficient of variation of daily water consumption in the first 60 days F 4 (i)
[0040] F 4 (i) = F 3 (i) / F 2 (i);
[0041] The peak value F of daily water consumption in the first 60 days 5 (i), a measure of the sharpness or flatness of the distribution of water use:
[0042] in,
[0043] Preferably, the above-mentioned characteristic variables and the corresponding actual daily water consumption are used to train a water consumption prediction model using a support vector regression model:
[0044]
[0045] Where Q(d) represents the predicted water consumption on day d,
[0046] F(d)=[F 1 (d),F 2 (60),F 3 (60),F 4 (60),F 5 (60)] is the feature vector of the dth day, F(d i ), i=1,2,...,N is the feature vector in the training set, a i , is the Lagrange multiplier of the SVR model, is the Lagrange multiplier associated with the i-th training data point, and is used to represent the weight of the point in the objective function. K(·,·) is the kernel function, which is a Gaussian kernel function, and b is the bias term of the SVR model.
[0047] When training the SVR model, the objective function to be optimized is:
[0048]
[0049] In the above formula, N is the number of samples in the training set, the parameter in the Gaussian kernel function controls the width of the kernel function and determines the strength of the nonlinear mapping of the feature space, ε: represents the error tolerance of the SVR model, controls the sensitivity of the model to the prediction error, and a j , is the Lagrange multiplier of the SVR model and is the Lagrange multiplier associated with the jth training data point.
[0050] The constraints are:
[0051]
[0052] in,
[0053] Preferably, the step of using the K-means clustering algorithm to find the reference water meter in the class A table that is most similar to the water usage pattern of each class B table is as follows:
[0054] Extract the following water use pattern characteristics for each table of all Class A tables:
[0055] Average daily water consumption in the past 30 days:
[0056] Standard deviation of water consumption in the past 30 days:
[0057] Coefficient of variation of water consumption in the past 30 days: U 3 =U 2 / U 1 ;
[0058] Ratio of average water consumption on working days to non-working days:
[0059] Ratio of average water consumption during the day and at night:
[0060] Then, for each A-type table, the eigenvector U = [U 1 ,U 2 ,U 3 ,U 4 ,U 5 Perform normalization:
[0061]
[0062] Use K-means clustering algorithm to cluster the normalized feature vectors and set the number of clusters. Where N A is the number of class A tables, let C 1 ,C 2 ,...,C K represents K cluster centers. Initially, K feature vectors of class A table can be randomly selected as initial cluster centers;
[0063] The following steps are iterated until convergence:
[0064] For each A-class table, the Euclidean distance between the extracted water use pattern feature vector and each cluster center is calculated, and then the A-class table is assigned to the cluster with the closest distance.
[0065] For each cluster, update its cluster center. The new cluster center is equal to the arithmetic mean of the water use pattern feature vectors of all Class A tables belonging to the cluster. By continuously updating the cluster center, the clustering results can be made more accurate and stable.
[0066] A reference table is matched for each Class B table. For each Class B table, its water consumption data for the past 30 days is extracted, and the water consumption pattern feature vector of the Class B table is calculated in the same way as the Class A table.
[0067] Calculate the Euclidean distance between the normalized feature vector of the B-class table and the cluster center of each A-class table, and find the cluster with the closest distance.
[0068] In the cluster with the closest distance, further find the class A table that is closest to the normalized feature vector of the class B table, and use it as the reference water table of the class B table.
[0069] For each Class B meter, when judging the abnormal daily water consumption, first obtain the water consumption of the reference meter on that day and the actual water consumption of the Class B meter itself on that day, and then calculate the relative deviation between the actual water consumption of the Class B meter on that day and the water consumption of the reference meter on that day.
[0070] If the calculated relative deviation is greater than the preset abnormal threshold, it is determined that the water consumption of the Class B meter on that day is abnormal.
[0071] On the other hand, the present application also proposes a water supply network zone leakage warning system based on large user water volume, including:
[0072] A data acquisition module, used to acquire user data, wherein the user data includes the user water meter installation time and the user's historical usage data;
[0073] The user screening module is used to classify users' water meters according to their installation time, and classify users' water meters installed for more than 2 years as Class A meters, users' water meters installed for more than 3 months but less than 2 years as Class B meters, and users' water meters installed for less than 3 months as Class C meters;
[0074] The model building module is used to build a water consumption prediction model for Class A meters based on the user's historical consumption data, including the daily water consumption in the previous two years and the daily water consumption in the previous 30 days; for Class B meters, the K-means clustering algorithm is used to find the reference water meter in the Class A table that is most similar to the water consumption pattern of each Class B meter;
[0075] A threshold setting module is used to set the abnormal duration threshold of the cumulative water consumption and the deviation threshold T from the historical data and the reference water meter;
[0076] The judgment module is used to obtain real-time user usage data and make abnormal judgments:
[0077] For table A, calculate the deviation E between the data of the current day and the data of the same period of the previous two years. 1 and the deviation from the mean of the previous 30 days E 2 , if E 1 >T and E 2 >T triggers abnormal warning;
[0078] For table B, calculate the deviation E between the data of the current day and the data of the same day in the previous 60 days 3 , Deviation from the mean of the previous 21 days E 4 and the deviation E from the reference table data of the same period 5 , if E 3 >T and E 4 >T, but E 5 ≤T triggers abnormal warning;
[0079] For Class C meters, determine whether the cumulative water consumption is exactly the same for N consecutive days after installation. If so, trigger an abnormal warning;
[0080] The warning level module is used to warn of detected anomalies and dynamically adjust the warning level according to the number of days the anomaly lasts: 1-3 days is a level 1 warning, 4-7 days is a level 2 warning, 8-14 days is a level 3 warning, and more than 14 days is a level 4 warning;
[0081] The warning classification module is used to warn of detected anomalies and dynamically adjust the warning level according to the number of days the anomaly lasts: 1-3 days is a level 1 warning, 4-7 days is a level 2 warning, 8-14 days is a level 3 warning, and more than 14 days is a level 4 warning.
[0082] The correction module is used for canceling the warning and clearing the abnormal days for the water meter that has triggered the warning if the subsequent meter reading data returns to normal, and returning to step S50 for continuous monitoring.
[0083] On the other hand, the present application also proposes an electronic device, including a memory, a central processing unit, and a computer program stored in the memory and executable on the central processing unit, wherein the central processing unit implements the remote water meter abnormality warning method based on historical water volume when executing the computer program.
[0084] On the other hand, the present application further proposes a computer-readable storage medium, on which a computer program is stored, and when the computer program is executed, the remote water meter abnormality warning method based on historical water volume is implemented.
[0085] Beneficial Effects
[0086] The abnormal warning method proposed in this application adopts differentiated detection strategies for different types of users, which takes into account the effectiveness and real-time performance of the detection. Among them, the prediction model for Class A users makes full use of the user's own historical data, characterizes the user's water usage pattern through a variety of features, and uses advanced machine learning algorithms for modeling, so the prediction effect is guaranteed. The cluster matching method for Class B users solves the problem of insufficient user historical data. By comparing with similar Class A users, it can also achieve more accurate abnormal judgment. Although the cumulative monitoring rules for Class C users are relatively simple, they are easy to implement and highly interpretable, and can quickly respond to newly connected water meters. The dynamic warning level mechanism further improves the flexibility of the system and makes the warning more intelligent. In addition, designs such as automatic cancellation of abnormal states and resetting of abnormal days also improve the system's adaptability and sustainability. BRIEF DESCRIPTION OF THE DRAWINGS
[0087] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.
[0088] Figure 1 A time sequence diagram of a remote water meter abnormal warning method based on historical water volume in the present invention;
[0089] Figure 2 This is a flow chart of a remote water meter abnormal warning method based on historical water volume in the present invention.
[0090] Figure 3 It is a schematic diagram of the water supply network zoning leakage warning system based on large user water volume of the present invention;
[0091] Figure 4 A schematic diagram of an electronic device provided by the present invention;
[0092] Figure 5 A computer-readable storage medium is provided for the present invention. DETAILED DESCRIPTION
[0093] The following will be combined with the drawings in the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.
[0094] Example 1
[0095] See also Figure 1-Figure 2 As shown, this embodiment provides a remote water meter abnormality warning method based on historical water volume, including:
[0096] A remote water meter abnormality early warning method based on historical water volume, comprising:
[0097] S10. Obtain user data, which includes the user water meter installation time and the user's historical usage data; by obtaining user data, provide necessary historical data support for subsequent water consumption prediction and anomaly detection. By extracting the daily water consumption data of each Class A meter in the first three years and the daily water consumption data in the first 60 days, the user's water use rules and patterns can be fully characterized. The complete long-term (annual scale) and short-term (within 60 days) water consumption time series data of Class A meters are obtained, which lays a data foundation for subsequent feature engineering, model training and prediction. At the same time, extracting data at different time scales helps to capture the multi-scale characteristics of user water use behavior.
[0098] S20. According to the installation time of the user's water meter, the water meter installed for more than 2 years is represented as a Class A meter, the water meter installed for more than 3 months but less than 2 years is represented as a Class B meter, and the water meter installed for less than 3 months is represented as a Class C meter;
[0099] S30. For Class A meters, a water consumption prediction model is established based on the user's historical consumption data, including the daily water consumption in the previous two years and the daily water consumption in the previous 30 days. For Class B meters, a K-means clustering algorithm is used to find the reference water meter in the Class A table that is most similar to the water consumption pattern of each Class B meter.
[0100] For the Class A table, the method for establishing a water consumption prediction model based on the user's historical consumption data, including the daily water consumption in the previous two years and the daily water consumption in the previous 30 days, is as follows:
[0101] S31. For each Class A table, extract the following data from the user's historical usage data:
[0102] The water consumption data for each day in the first three years is recorded as D y-1 (d),D y-2 (d),D y-3 (d) D y-1 (d),D y-2 (d),D y-3 (d) represents the water consumption data on the dth day in the previous year, the previous two years, or the previous three years, where d represents the day of the year (range 1-365). The daily water consumption data for the previous 60 days is recorded as D 1 ,D 2 ,...,D 60 ;
[0103] S32, pre-processing the extracted historical water consumption data of users,
[0104] The preprocessing of the extracted historical water consumption data of the user includes:
[0105] Missing value processing: If the water consumption data for some days are missing, linear interpolation is used to estimate and fill in the missing values, that is, Where D i represents the water consumption data for the i-th day, where i can be any day from 1 to 60;
[0106] The water consumption data in the actual data may contain missing values. If not processed, it will affect the accuracy of subsequent analysis. Using linear interpolation to estimate and fill missing values can obtain a relatively complete and continuous data sequence. This makes up for the problem of missing data and avoids information loss or analysis bias caused by missing values. At the same time, linear interpolation is simple and easy to implement, and can give reasonable estimates when there are not many missing values.
[0107] Outlier processing: Calculate the median M and interquartile range IQR (i.e., the difference between the 75th percentile and the 25th percentile) of the user water consumption data for the previous 60 days. If the water consumption D on a certain day is i If it is outside the interval [M-2IQR,M+2IQR], it is considered an outlier and replaced by the median M.
[0108] There may be some outliers in the water consumption data, such as abnormally high or low water consumption. These outliers may be caused by factors such as equipment failure and data errors, which will interfere with subsequent statistical analysis and modeling. The box plot method (median ± 2 times the interquartile range) is used to identify outliers and replace them with the median, which can effectively suppress the impact of outliers. The removal of abnormal noise points in the water consumption series makes the data cleaner and more reliable, providing a robust input for subsequent analysis. At the same time, the box plot method relies on the median and quartiles of the data, is insensitive to outliers, and can better adapt to different data distributions.
[0109] S33. Based on the pre-processed historical water consumption data of users, the following characteristic variables are constructed;
[0110] Based on the pre-processed historical water consumption data of users, the following characteristic variables are constructed:
[0111] The weighted average of daily water consumption in the same period of the previous three years F 1 (d):
[0112] F 1 (d) = 0.5·D y-1 (d)+0.3·D y-2 (d)+0.2·D y-3 (d)
[0113] The exponentially weighted moving average of daily water consumption in the previous 60 days F 2 (i)
[0114]
[0115] The exponentially weighted moving standard deviation of daily water consumption in the previous 60 days F 3 (i
[0116]
[0117] Where α = 0.1;
[0118] The coefficient of variation of daily water consumption in the first 60 days F 4 (i)
[0119] F 4 (i) = F 3 (i) / F 2 (i);
[0120] The peak value F of daily water consumption in the first 60 days 5 (i), a measure of the sharpness or flatness of the distribution of water use:
[0121] in,
[0122] Based on the original daily water consumption data, a series of statistical features that can characterize the user's water consumption behavior and pattern are constructed to provide richer and more effective information for subsequent water consumption modeling and prediction. Here, multiple characteristic variables that reflect the user's long-term water consumption pattern (weighted average of daily water consumption in the same period of the previous three years), short-term water consumption trend (exponentially weighted moving average), water consumption volatility (exponentially weighted moving standard deviation, coefficient of variation) and extreme water consumption (kurtosis) are comprehensively constructed to characterize the user's water consumption pattern from different aspects and provide a more comprehensive input for the prediction model. Through feature engineering, the original daily water consumption data is converted into a set of indicators with statistical significance and predictive power. These indicators can capture the different characteristics of user water consumption behavior and provide richer and more differentiated information for subsequent modeling and prediction. At the same time, feature engineering can play a role in data dimensionality reduction and noise filtering, making modeling simpler and more robust.
[0123] S34, using the above-mentioned characteristic variables and the corresponding actual daily water consumption, using a support vector regression (SVR) model to train a water consumption prediction model;
[0124] Using the above feature variables and the corresponding actual daily water consumption, a water consumption prediction model is trained using the support vector regression (SVR) model:
[0125]
[0126] Where Q(d) represents the predicted water consumption on day d,
[0127] F(d)=[F 1 (d),F 2 (60),F 3 (60),F 4 (60),F 5 (60)] is the feature vector of the dth day, F(d i ), i=1,2,...,N is the feature vector in the training set, a i , is the Lagrange multiplier of the SVR model, which is the Lagrange multiplier associated with the i-th training data point. They are the coefficients obtained during the model optimization process and determine the contribution of the training data point to the result in the final prediction. Each data point is associated with a pair of Lagrange multipliers a i and The weight K(·,·) used to represent the point in the objective function is a kernel function, which is a Gaussian kernel function, and b is a bias term of the SVR model.
[0128] When training the SVR model, the objective function to be optimized is:
[0129]
[0130] In the above formula, N is the number of samples in the training set, the parameter in the Gaussian kernel function controls the width of the kernel function and determines the strength of the nonlinear mapping of the feature space, ε: represents the error tolerance of the SVR model, controls the sensitivity of the model to the prediction error, and a j , are the Lagrange multipliers of the SVR model and are the Lagrange multipliers associated with the jth training data point. They are the coefficients obtained during the model optimization process and determine the contribution of the training data point to the final prediction result.
[0131] The constraints are:
[0132]
[0133] in,
[0134] Using the constructed feature variables and the corresponding actual daily water consumption, a machine learning model that can accurately predict future water consumption is trained. Support vector regression (SVR) is selected as the prediction model here. SVR is a complex nonlinear model based on statistical learning theory. It realizes regression prediction by finding the optimal decision hyperplane in the high-dimensional feature space, and has strong nonlinear fitting and generalization capabilities. At the same time, the kernel function (Gaussian kernel) is introduced to map the original features to the high-dimensional space, so that the model can capture the complex nonlinear relationship in the water consumption data. During the training process, the model parameters are optimized by minimizing the objective function (including regularization terms) to balance the model's fitting ability and generalization ability. Through SVR model training, a complex nonlinear model that can predict future water consumption based on historical water use characteristics is obtained. The model comprehensively considers multiple factors such as users' long-term water use patterns, short-term trends, and volatility, and can better fit users' real water use patterns. At the same time, the SVR model has strong nonlinear modeling capabilities and noise resistance, and can cope with the complexity and uncertainty of water consumption data. Through hyperparameter optimization, the prediction performance and robustness of the model can be further improved.
[0135] The trained SVR water consumption prediction model is used to predict the water consumption of each Class A meter on a daily basis. Specifically, when the water consumption needs to be predicted on the dth day, the historical water consumption data of the meter on and before the d-1th day is first extracted, and the feature vector of the dth day is constructed based on this. The feature vector is then input into the trained SVR model to obtain the predicted water consumption on the dth day. Through rolling daily predictions, the real-time water consumption of users can be dynamically tracked.
[0136] Effect: Based on the trained SVR model, accurate, timely and continuous water consumption forecasts can be made for Class A meters, providing a basis for water companies to grasp user water demand in advance, rationally allocate water resources and optimize operation management. At the same time, daily forecasts can timely detect abnormal changes in user water use patterns, providing support for timely diagnosis and handling of problems.
[0137] S35. For each Class A table, when predicting water consumption on the d day, extract the historical water consumption data of the table on and before d-1 day, construct the feature vector F(d), and substitute it into the trained SVR model to obtain the predicted water consumption Q(d) on the d day.
[0138] The steps of using the K-means clustering algorithm to find the reference water meter in the class A table that is most similar to the water use pattern of each class B table for the class B table are as follows:
[0139] For all Class A tables, extract the following water use pattern characteristics for each table:
[0140] Average daily water consumption in the past 30 days:
[0141] Standard deviation of water consumption in the past 30 days:
[0142] Coefficient of variation of water consumption in the past 30 days: U 3 =U 2 / U 1 ;
[0143] Ratio of average water consumption on working days to non-working days:
[0144] Ratio of average water consumption during daytime (8:00-18:00) and nighttime:
[0145] Then, for each A-type table, the eigenvector U = [U 1 ,U 2 ,U 3 ,U 4 ,U 5 Perform normalization:
[0146]
[0147] Use K-means clustering algorithm to cluster the normalized feature vectors. Set the number of clusters Where N A is the number of class A tables. Let C 1 ,C 2 ,...,C K represents K cluster centers. Initially, K feature vectors of class A table can be randomly selected as initial cluster centers;
[0148] The following steps are iterated until convergence:
[0149] (1) For each A-table, calculate the Euclidean distance between the extracted water use pattern feature vector and each cluster center. Euclidean distance refers to the straight-line distance between two points in multidimensional space. Then, assign the A-table to the cluster with the closest distance. In other words, find the cluster with the most similar water use pattern characteristics to the A-table and assign it to that cluster.
[0150] (2) For each cluster, update its cluster center. The new cluster center is equal to the arithmetic mean of the water use pattern feature vectors of all Class A tables belonging to the cluster. The arithmetic mean here means adding the elements of the corresponding positions of all vectors and then dividing by the number of vectors. By continuously updating the cluster center, the clustering results can be made more accurate and stable.
[0151] Next, match the reference table for each Class B table. For each Class B table, extract its water consumption data for the past 30 days (if the historical data is less than 30 days, use all available historical data). Then, calculate the water consumption pattern feature vector of the Class B table in the same way as the Class A table. Normalize the feature vector so that the value range of each component is scaled to the interval [0,1].
[0152] Then, the Euclidean distance between the normalized feature vector of the B-class table and the cluster center of each A-class table is calculated to find the cluster with the closest distance.
[0153] In the nearest cluster found in the previous step, further find the class A table that is closest to the normalized feature vector of the class B table and use it as the reference water meter of the class B table. The water consumption pattern of this reference water meter is most similar to that of the class B table and can be used as a reference object for abnormal judgment.
[0154] Finally, for each Class B meter, when making a daily water consumption abnormality judgment, first obtain the water consumption of its reference meter on that day and the actual water consumption of the Class B meter itself on that day. Then, calculate the relative deviation between the actual water consumption of the Class B meter on that day and the water consumption of the reference meter on that day. The relative deviation is equal to the absolute value of the difference between the two values divided by the water consumption of the reference meter.
[0155] If the calculated relative deviation is greater than a preset abnormal threshold (e.g., 20%), it is determined that the water consumption of the Class B meter on that day is abnormal. This abnormal threshold can be adjusted according to actual conditions to balance the sensitivity and false alarm rate of abnormal detection.
[0156] All Class A tables are clustered and grouped according to their water use patterns. First, a series of statistical features reflecting the water use pattern of each Class A table (average water use in the past 30 days, standard deviation, coefficient of variation, ratio of water use on working days to non-working days, ratio of water use on daytime to nighttime) are extracted and normalized. Then, the K-means clustering algorithm is used to cluster these feature vectors, and Class A tables with similar water use patterns are divided into the same cluster through iterative optimization. Class A tables in different clusters have significant differences in water use patterns. The number of clusters K is adaptively determined according to the number of Class A tables.
[0157] Effect: Through cluster analysis, the Class A table can be automatically divided into several clusters (groups) with significantly different water use patterns. The Class A tables within each cluster have similar water use behavior characteristics. This clustering result can help water companies better understand the water use patterns and needs of different user groups, and provide a reference for formulating differentiated management and service strategies. At the same time, the clustering process can effectively reduce the dimension and complexity of water use data, making subsequent analysis and modeling more efficient and explainable.
[0158] S40, setting a threshold value of abnormal duration of cumulative water consumption and a deviation threshold value T from historical data and a reference water meter;
[0159] S50, obtaining the user's real-time usage data, and making abnormal judgments respectively:
[0160] For table A, calculate the deviation E between the data of the current day and the data of the same period of the previous two years. 1 and the deviation from the mean of the previous 30 days E 2 , if E 1 >T and E 2 >T triggers abnormal warning;
[0161] For table B, calculate the deviation E between the data of the current day and the data of the same day in the previous 60 days 3 , Deviation from the mean of the previous 21 days E 4 and the deviation E from the reference table data of the same period 5 , if E 3 >T and E 4 >T, but E 5 ≤T triggers abnormal warning;
[0162] For Class C meters, determine whether the cumulative water consumption is exactly the same for N consecutive days after installation. If so, an abnormal warning is triggered.
[0163] S60. For abnormal warnings detected, the warning level is dynamically adjusted according to the number of days the abnormality lasts: 1-3 days is a level 1 warning, 4-7 days is a level 2 warning, 8-14 days is a level 3 warning, and more than 14 days is a level 4 warning;
[0164] S70. For the water meter that has triggered the warning, if the subsequent meter reading data returns to normal, cancel the warning and clear the abnormal days, and return to step S50 for continuous monitoring.
[0165] This application proposes a remote water meter abnormality early warning method based on historical water volume data. The method first divides users into three categories: A, B, and C according to the installation time of the water meter, and then adopts different abnormality detection strategies for different categories of users.
[0166] For Class A users (installation time greater than or equal to 2 years), this method establishes a water consumption prediction model based on the user's historical consumption data, including the daily water consumption in the previous two years and the daily water consumption in the previous 30 days. Specifically, the daily water consumption in the previous three years and the daily water consumption in the previous 60 days are first extracted from the user's historical data, and then these data are preprocessed by missing value filling and outlier processing. Then, a series of characteristic variables reflecting the user's water consumption pattern are constructed, including the weighted average of the daily water consumption in the previous three years, the exponentially weighted moving average and standard deviation, coefficient of variation, and kurtosis of the daily water consumption in the previous 60 days. Finally, these characteristic variables and the corresponding actual daily water consumption are used to train a water consumption prediction model based on support vector regression (SVR). When performing anomaly detection, this method calculates the deviation of the actual water consumption on the day from the water consumption in the previous two years and the deviation from the mean of the previous 30 days. If the deviation exceeds the preset threshold, it is considered to be an anomaly.
[0167] For Class B users (installed between 3 months and 2 years), this method uses the K-means clustering algorithm to find the reference water meter that is most similar to the water consumption pattern of each Class B user among Class A users. First, the water consumption pattern characteristics of each Class A user (such as average daily water consumption, standard deviation, coefficient of variation, ratio of water consumption on working days to non-working days, ratio of water consumption during the day to that at night, etc.) are extracted and normalized. Then, the K-means algorithm is used to cluster these feature vectors to find the Class A user group with similar water consumption patterns. Next, for each Class B user, the distance between its water consumption pattern feature vector and the center of each Class A cluster is calculated to find the most similar cluster, and the Class A user with the closest distance is selected from the cluster as the reference water meter. When detecting anomalies, this method calculates the deviation of the Class B user's water consumption on the same day from the reference meter's water consumption on the same day, the deviation from its own water consumption on the same day in the previous 60 days, and the deviation from the mean of the previous 21 days. If multiple deviations exceed the threshold at the same time but not all exceed the threshold, it is judged as an anomaly.
[0168] For Class C users (installation time is less than 3 months), due to the lack of sufficient historical data, this method adopts a simple rule: if the cumulative water consumption for N consecutive days is exactly the same, it is considered that an abnormal situation has occurred.
[0169] Based on anomaly detection, the method also designs a mechanism to dynamically adjust the warning level according to the duration of the anomaly. When the abnormal state lasts for 1-3 days, a first-level warning is issued; when it lasts for 4-7 days, a second-level warning is issued; when it lasts for 8-14 days, a third-level warning is issued; and when it exceeds 14 days, a fourth-level warning is issued. At the same time, once the subsequent meter reading data returns to normal, the warning will be automatically canceled and the corresponding number of abnormal days will be reset to zero.
[0170] The abnormal warning method proposed in this application adopts differentiated detection strategies for different types of users, which takes into account the effectiveness and real-time performance of the detection. Among them, the prediction model for Class A users makes full use of the user's own historical data, and characterizes the user's water usage pattern through a variety of features, so the prediction effect is guaranteed. The cluster matching method for Class B users solves the problem of insufficient user historical data. By comparing with similar Class A users, it can also achieve more accurate abnormal judgment. Although the cumulative monitoring rules for Class C users are relatively simple, they are easy to implement and highly interpretable, and can quickly respond to newly connected water meters. The dynamic warning level mechanism further improves the flexibility of the system and makes the warning more intelligent. In addition, designs such as automatic cancellation of abnormal states and resetting of abnormal days also improve the system's adaptability and sustainability.
[0171] Example 2
[0172] This embodiment provides a leakage warning system based on the night water volume after denoising on the basis of embodiment 1, such as Figure 2 As shown, including:
[0173] A data acquisition module, used to acquire user data, wherein the user data includes the user water meter installation time and the user's historical usage data;
[0174] The user screening module is used to classify users' water meters according to their installation time, and classify users' water meters installed for more than 2 years as Class A meters, users' water meters installed for more than 3 months but less than 2 years as Class B meters, and users' water meters installed for less than 3 months as Class C meters;
[0175] The model building module is used to build a water consumption prediction model for Class A meters based on the user's historical consumption data, including the daily water consumption in the previous two years and the daily water consumption in the previous 30 days; for Class B meters, the K-means clustering algorithm is used to find the reference water meter in the Class A table that is most similar to the water consumption pattern of each Class B meter;
[0176] A threshold setting module is used to set the abnormal duration threshold of the cumulative water consumption and the deviation threshold T from the historical data and the reference water meter;
[0177] The judgment module is used to obtain real-time user usage data and make abnormal judgments:
[0178] For table A, calculate the deviation E between the data of the current day and the data of the same period of the previous two years. 1 and the deviation from the mean of the previous 30 days E 2 , if E 1 >T and E 2 >T triggers abnormal warning;
[0179] For table B, calculate the deviation E between the data of the current day and the data of the same day in the previous 60 days 3 , Deviation from the mean of the previous 21 days E 4 and the deviation E from the reference table data of the same period 5 , if E 3 >T and E 4 >T, but E 5 ≤T triggers abnormal warning;
[0180] For Class C meters, determine whether the cumulative water consumption is exactly the same for N consecutive days after installation. If so, trigger an abnormal warning;
[0181] The warning level module is used to warn of detected anomalies and dynamically adjust the warning level according to the number of days the anomaly lasts: 1-3 days is a level 1 warning, 4-7 days is a level 2 warning, 8-14 days is a level 3 warning, and more than 14 days is a level 4 warning;
[0182] The warning classification module is used to warn of detected anomalies and dynamically adjust the warning level according to the number of days the anomaly lasts: 1-3 days is a level 1 warning, 4-7 days is a level 2 warning, 8-14 days is a level 3 warning, and more than 14 days is a level 4 warning.
[0183] The correction module is used for canceling the warning and clearing the abnormal days for the water meter that has triggered the warning if the subsequent meter reading data returns to normal, and returning to step S50 for continuous monitoring.
[0184] Example 3
[0185] like Figure 4 As shown, according to another aspect of the present application, an electronic device 500 is also provided. The electronic device 500 may include one or more processors and one or more memories. The memories store computer readable codes, and when the computer readable codes are executed by one or more processors, the remote water meter abnormality warning method based on historical water volume as described above may be executed.
[0186] The method or system according to the embodiment of the present application can also be used by Figure 4 The electronic device architecture shown in FIG. Figure 4As shown, the electronic device 500 may include a bus 501, one or more CPUs 502, a read-only memory (ROM) 503, a random access memory (RAM) 504, a communication port 505 connected to a network, an input / output component 506, a hard disk 507, etc. The storage device in the electronic device 500, such as the ROM 503 or the hard disk 507, may store the S10 provided by the present application, obtaining user data, wherein the user data includes the user water meter installation time and the user usage data; S20, according to the user water meter installation time, the user water meter installation time greater than or equal to 2 years is represented as a Class A table, the installation time greater than or equal to 3 months but less than 2 years is represented as a Class B table, and the installation time less than 3 months is represented as a Class C table; S30, for the Class A table, based on the historical user usage data, establish a water consumption prediction model including the daily water consumption of the previous two years and the daily water consumption of the previous 30 days; for the Class B table, use the K-means clustering algorithm to find the reference water meter in the Class A table that is most similar to the water consumption pattern of each Class B table. S40, set the threshold of abnormal continuous days of cumulative water consumption and the deviation threshold T from historical data and reference water meters; S50, obtain real-time user consumption data and make abnormal judgments respectively: for Class A meters, calculate the deviation of the data of the day with the data of the same period of the previous two years and the deviation with the average of the previous 30 days. If and , then trigger an abnormal warning; for Class B meters, calculate the deviation of the data of the day with the data of the same day of the previous 60 days, the deviation with the average of the previous 21 days and the deviation with the data of the same period of the reference table. If and , but , then trigger an abnormal warning; for Class C meters, determine whether there is a situation where the cumulative water consumption is completely equal for N consecutive days after installation. If so, trigger an abnormal warning. For the monitored abnormal warning, dynamically adjust the warning level according to the number of days the abnormality lasts: 1-3 days is a first-level warning, 4-7 days is a second-level warning, 8-14 days is a third-level warning, and more than 14 days is a fourth-level warning; for the water meter that has triggered the warning, if the subsequent meter reading data returns to normal, cancel the warning and clear the number of abnormal days, and return to step S50 for continuous monitoring. Furthermore, the electronic device 500 may also include a user interface 508. Figure 4 The architecture shown is only exemplary and can be omitted according to actual needs when implementing different devices. Figure 4 One or more components of an electronic device are shown.
[0187] Example 4
[0188] Figure 5 Schematic diagram of a computer-readable storage medium structure provided by an embodiment of the present application. Figure 5As shown, a computer-readable storage medium 600 according to an embodiment of the present application is shown. Computer-readable instructions are stored on the computer-readable storage medium 600. When the computer-readable instructions are executed by the processor, a remote water meter abnormality warning method based on historical water volume according to an embodiment of the present application described with reference to the above figures can be executed. The storage medium 600 includes, but is not limited to, for example, volatile memory and / or non-volatile memory. Volatile memory may include, for example, random access memory (RAM) and cache memory (cache), etc. Non-volatile memory may include, for example, read-only memory (ROM), hard disk, flash memory, etc.
[0189] In addition, according to the implementation mode of the present application, the process described in the above reference flowchart can be implemented as a computer software program. For example, the present application provides a non-temporary machine-readable storage medium, the non-temporary machine-readable storage medium stores machine-readable instructions, the machine-readable instructions can be executed by a processor to execute instructions corresponding to the method steps provided in the present application, for example: S10, obtain user data, the user data includes the user water meter installation time and user usage data; S20, according to the user water meter installation time, the user water meter installation time greater than or equal to 2 years is represented as a Class A table, the installation time greater than or equal to 3 months but less than 2 years is represented as a Class B table, and the installation time less than 3 months is represented as a Class C table; S30, for the Class A table, based on the historical user usage data, establish a water consumption prediction model including the daily water consumption in the previous two years and the daily water consumption in the previous 30 days; for the Class B table, use the K-means clustering algorithm to find the reference water meter in the Class A table that is most similar to the water consumption pattern of each Class B table. S40, set the threshold of abnormal continuous days of cumulative water consumption and the deviation threshold T from historical data and reference water meters; S50, obtain real-time user consumption data and make abnormal judgments respectively: for Class A meters, calculate the deviation of the data of the day with the data of the same period of the previous two years and the deviation with the average of the previous 30 days. If and , then trigger an abnormal warning; for Class B meters, calculate the deviation of the data of the day with the data of the same day of the previous 60 days, the deviation with the average of the previous 21 days and the deviation with the data of the same period of the reference table. If and , but , then trigger an abnormal warning; for Class C meters, determine whether there is a situation where the cumulative water consumption is completely equal for N consecutive days after installation. If so, trigger an abnormal warning. For the monitored abnormal warning, dynamically adjust the warning level according to the number of days the abnormality lasts: 1-3 days is a first-level warning, 4-7 days is a second-level warning, 8-14 days is a third-level warning, and more than 14 days is a fourth-level warning; for the water meter that has triggered the warning, if the subsequent meter reading data returns to normal, cancel the warning and clear the number of abnormal days, and return to step S50 for continuous monitoring. When the computer program is executed by a central processing unit (CPU), the above functions defined in the method of the present application are performed.
[0190] The methods, apparatuses, and devices of the present application may be implemented in many ways. For example, the methods, apparatuses, and devices of the present application may be implemented by software, hardware, firmware, or any combination of software, hardware, and firmware. The above order of steps for the method is for illustration only, and the steps of the method of the present application are not limited to the order specifically described above unless otherwise specified. In addition, in some embodiments, the present application may also be implemented as programs recorded in a recording medium, which include machine-readable instructions for implementing the method according to the present application. Therefore, the present application also covers recording media storing programs for executing the method according to the present application.
[0191] In addition, the parts of the above-mentioned technical solutions provided in the embodiments of the present application that are consistent with the implementation principles of the corresponding technical solutions in the prior art are not described in detail to avoid excessive redundancy.
[0192] The specific implementation modes described above further describe the purpose, technical solutions and beneficial effects of the present invention in detail. It should be understood that the above description is only a specific implementation mode of the present invention and is not intended to limit the present invention. Any modifications, equivalent substitutions, improvements, etc. made within the spirit and principles of the present invention should be included in the protection scope of the present invention.
Claims
1. A remote water meter abnormal warning method based on historical water volume, characterized in that: include: S10, obtaining user data, wherein the user data includes the user water meter installation time and the user usage data; S20. According to the installation time of the user's water meter, the water meter installed for more than 2 years is represented as a Class A meter, the water meter installed for more than 3 months but less than 2 years is represented as a Class B meter, and the water meter installed for less than 3 months is represented as a Class C meter; S30. For Class A meters, a water consumption prediction model including daily water consumption in the previous two years and daily water consumption in the previous 30 days is established based on historical user consumption data; for Class B meters, a reference water meter with the most similar water consumption pattern to each Class B meter is found in the Class A table using the K-means clustering algorithm; S40, setting a threshold value of abnormal duration of cumulative water consumption and a deviation threshold value T from historical data and a reference water meter; S50, obtaining real-time user usage data, and performing abnormality judgment respectively: For table A, calculate the deviation E1 between the data of the current day and the data of the same period of the previous two years and the deviation E2 from the average of the previous 30 days. If E1>T and E2>T, an abnormal warning is triggered; For Class B tables, calculate the deviation E3 between the data on the current day and the data on the same day of the previous 60 days, the deviation E4 from the average of the previous 21 days, and the deviation E5 from the data of the same period of the reference table. If E3>T and E4>T, but E5≤T, an abnormal warning is triggered; For Class C meters, determine whether the cumulative water consumption is exactly the same for N consecutive days after installation. If so, trigger an abnormal warning; S60. For abnormal warnings detected, the warning level is dynamically adjusted according to the number of days the abnormality lasts: 1-3 days is a level 1 warning, 4-7 days is a level 2 warning, 8-14 days is a level 3 warning, and more than 14 days is a level 4 warning; S70. For the water meter that has triggered the warning, if the subsequent meter reading data returns to normal, cancel the warning and clear the abnormal days, and return to step S50 for continuous monitoring.
2. The method for remote water meter abnormality early warning based on historical water volume according to claim 1 is characterized in that: For the Class A table, the method for establishing a water consumption prediction model based on the user's historical consumption data, including the daily water consumption in the previous two years and the daily water consumption in the previous 30 days, is as follows: S31. For each Class A table, extract the following data from the user's historical usage data: The water consumption data for each day in the first three years is recorded as D y-1 (d),D y-2 (d),D y-3 (d), where D y-1 (d),D y-2 (d),D y-3 (d) represents the water consumption data on the dth day in the previous year, the previous two years, and the previous three years, where d represents the day of the year. The daily water consumption data for the previous 60 days are recorded as D1, D2, ..., D 60 ; S32, pre-processing the extracted historical user water consumption data, S33, constructing characteristic variables based on the pre-processed historical water consumption data of users; S34, using the characteristic variables and the corresponding actual daily water consumption, and using a support vector regression model to train a water consumption prediction model; S35. For each Class A table, when predicting water consumption on the d day, extract the historical water consumption data of the table on and before d-1 day, construct a feature vector F(d), substitute it into the trained SVR model, and obtain the predicted water consumption Q(d) on the d day.
3. The method for remote water meter abnormality early warning based on historical water volume according to claim 2 is characterized in that: The preprocessing of the extracted historical water consumption data of the user includes: If there are missing historical water consumption data, linear interpolation is used to estimate and fill in; Outlier processing: Calculate the median M and interquartile range IQR of the user water consumption data for the previous 60 days. If the water consumption on a certain day D i If it is outside the interval [M-2IQR,M+2IQR], it is considered an outlier and replaced by the median M.
4. The method for remote water meter abnormality early warning based on historical water volume according to claim 3 is characterized in that: Based on the pre-processed historical user water consumption data, the following characteristic variables are constructed: The weighted average of daily water consumption in the same period of the previous three years F1(d): F1(d)=0.5·D y-1 (d)+0.3·D y-2 (d)+0.2·D y-3 (d), The exponentially weighted moving average of daily water consumption in the previous 60 days F2(i): The exponentially weighted moving standard deviation of daily water consumption in the previous 60 days is F3(i Where α = 0.1; The coefficient of variation of daily water consumption in the first 60 days is F4(i): F4(i)=F3(i) / F29i); The kurtosis of daily water consumption in the first 60 days (F59i) is used to measure the sharpness or flatness of the water consumption distribution: in, 5. The method for remote water meter abnormality early warning based on historical water volume according to claim 2 is characterized in that: Using the above characteristic variables and the corresponding actual daily water consumption, the water consumption prediction model is trained using the support vector regression model: Where Q(d) represents the predicted water consumption on day d, F(d) = [F1(d), F2960), F3(60), F4(60), F5(60)] is the eigenvector of the dth day, F(d i ), i=1,2,...,N is the feature vector in the training set, a i , is the Lagrange multiplier of the SVR model, is the Lagrange multiplier associated with the i-th training data point, and is used to represent the weight of the point in the objective function. K(·,·) is the kernel function, which is a Gaussian kernel function. b is the bias term of the SVR model. When training the SVR model, the objective function to be optimized is: In the above formula, N is the number of samples in the training set, the parameter in the Gaussian kernel function controls the width of the kernel function and determines the strength of the nonlinear mapping of the feature space, ε: represents the error tolerance of the SVR model, controls the sensitivity of the model to the prediction error, and a j , is the Lagrange multiplier of the SVR model and is the Lagrange multiplier associated with the jth training data point; The constraints are: in, 6. The method for remote water meter abnormality early warning based on historical water volume according to claim 1 is characterized in that: The steps of using the K-means clustering algorithm to find the reference water meter in the class A table that is most similar to the water use pattern of each class B table for the class B table are as follows: Extract the following water use pattern characteristics for each table of all Class A tables: Average daily water consumption in the past 30 days: Standard deviation of water consumption in the past 30 days: Coefficient of variation of water consumption in the past 30 days: U3 = U2 / U1; Ratio of average water consumption on working days to non-working days: Ratio of average water consumption during the day and at night: Then, the feature vector U = [U1, U2, U3, U4, U5] of each class A table is normalized: Use K-means clustering algorithm to cluster the normalized feature vectors and set the number of clusters. Where N A is the number of class A tables, let C1,C2,...,C K represents K cluster centers. Initially, K feature vectors of class A table can be randomly selected as initial cluster centers; The following steps are iterated until convergence: For each A-class table, the Euclidean distance between the extracted water use pattern feature vector and each cluster center is calculated, and then the A-class table is assigned to the cluster with the closest distance. For each cluster, update its cluster center. The new cluster center is equal to the arithmetic mean of the water use pattern feature vectors of all Class A tables belonging to the cluster. By continuously updating the cluster center, the clustering results can be made more accurate and stable. Match each Class B table with a reference table. For each Class B table, extract its water consumption data for the past 30 days and calculate the water consumption pattern feature vector of the Class B table in the same way as the Class A table. Calculate the Euclidean distance between the normalized feature vector of the B-class table and the cluster center of each A-class table, and find the cluster with the closest distance; In the cluster with the closest distance, further find the class A table that is closest to the normalized feature vector of the class B table, and use it as the reference water table of the class B table. For each Class B meter, when judging the abnormal daily water consumption, first obtain the water consumption of the reference meter on that day and the actual water consumption of the Class B meter itself on that day, and then calculate the relative deviation between the actual water consumption of the Class B meter on that day and the water consumption of the reference meter on that day. If the calculated relative deviation is greater than the preset abnormal threshold, it is determined that the water consumption of the Class B meter on that day is abnormal.
7. A water supply network zoning leakage warning system based on large user water volume, characterized in that: include: A data acquisition module, used to acquire user data, wherein the user data includes the user water meter installation time and the user's historical usage data; The user screening module is used to classify users' water meters according to their installation time, and classify users' water meters installed for more than 2 years as Class A meters, users' water meters installed for more than 3 months but less than 2 years as Class B meters, and users' water meters installed for less than 3 months as Class C meters; The model building module is used to build a water consumption prediction model for Class A meters based on the user's historical consumption data, including the daily water consumption in the previous two years and the daily water consumption in the previous 30 days; for Class B meters, the K-means clustering algorithm is used to find the reference water meter in the Class A table that is most similar to the water consumption pattern of each Class B meter; A threshold setting module is used to set the abnormal duration threshold of the cumulative water consumption and the deviation threshold T from the historical data and the reference water meter; The judgment module is used to obtain real-time user usage data and make abnormal judgments: For table A, calculate the deviation E1 between the data of the current day and the data of the same period of the previous two years and the deviation E2 from the average of the previous 30 days. If E1>T and E2>T, an abnormal warning is triggered; For Class B tables, calculate the deviation E3 between the data on the current day and the data on the same day of the previous 60 days, the deviation E4 from the average of the previous 21 days, and the deviation E5 from the data of the same period of the reference table. If E3>T and E4>T, but E5≤T, an abnormal warning is triggered; For Class C meters, determine whether the cumulative water consumption is exactly the same for N consecutive days after installation. If so, trigger an abnormal warning; The warning level module is used to warn of detected anomalies and dynamically adjust the warning level according to the number of days the anomaly lasts: 1-3 days is a level 1 warning, 4-7 days is a level 2 warning, 8-14 days is a level 3 warning, and more than 14 days is a level 4 warning; The warning classification module is used to warn of detected anomalies and dynamically adjust the warning level according to the number of days the anomaly lasts: 1-3 days is a level 1 warning, 4-7 days is a level 2 warning, 8-14 days is a level 3 warning, and more than 14 days is a level 4 warning. The correction module is used for canceling the warning and clearing the abnormal days for the water meter that has triggered the warning if the subsequent meter reading data returns to normal, and returning to step S50 for continuous monitoring.
8. An electronic device comprising a memory, a central processing unit, and a computer program stored in the memory and executable on the central processing unit, characterized in that: When the central processor executes the computer program, a remote water meter abnormality warning method based on historical water volume described in any one of claims 1-6 is implemented.
9. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a computer program, and when the computer program is executed, the remote water meter abnormality warning method based on historical water volume according to any one of claims 1 to 6 is implemented.
Citation Information
Cited By
Intelligent water meter control system and method based on Internet of Things
CN119961329A
Intelligent flow sensor test analysis method and system
CN120445371A
Urban resident water consumption behavior classification method based on intelligent water meter
CN120654078A
Multi-dimensional alarm analysis method and system based on alarm platform
CN120740726A