Method and system for detecting abnormal water consumption of water meter of Internet of Things
The IoT water meter system analyzes daily water flow data to detect anomalies by categorizing and comparing user habits, enhancing precision and timeliness in identifying unusual water usage.
Patent Information
- Application Number
- CN202510236835.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-02-28
- Publication Date
- 2025-07-15
AI Technical Summary
When judging abnormal water usage of users, existing IoT water meters cannot conduct fine inspection based on users' water usage habits, resulting in inaccurate detection.
By collecting water flow data, classification and curve fitting, identifying dense intersection areas and overlapping areas of line segments, calculating the characteristic similarity, and using the theoretical water consumption difference to judge abnormal water use.
It realizes fine and accurate abnormal water use detection based on user water use characteristics, generates abnormal alarm information and notifies management personnel.
Smart Images

Figure CN120316656A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to, in particular to, a method and system for detecting water use anomaly in an Internet of Things water meter. Background Art
[0002] At present, people's lives have long been inseparable from tap water. Water supply companies mainly rely on water meters to measure users' water consumption. Early mechanical water meters mainly rely on manual meter reading. This method mainly relies on regular manual meter reading and regular inspections, which is not only time-consuming but also unable to monitor in real time, making it difficult to detect and handle abnormal situations in a timely manner.
[0003] With the development of technology, IoT water meters have gradually replaced traditional mechanical water meters. IoT water meters can collect users' water consumption data at a certain frequency every day and report the collected water consumption data to the cloud platform. IoT water meters save the trouble of manual meter reading and improve the timeliness of water consumption collection and reporting. In order to detect abnormal water consumption of users, water supply companies generally set water consumption thresholds. For example, when a user's water consumption in a month far exceeds the normal water consumption, the user is considered to have abnormal water consumption. This judgment method is too simple and cannot judge abnormal consumption based on the user's water use habits. The detection is not precise enough and needs to be improved. Summary of the invention
[0004] Based on the above description, the present invention provides a method and system for detecting abnormal water usage of an IoT water meter. The method can assist in judging abnormal tap water usage based on the user's water usage habits, thereby achieving a more refined and accurate detection effect.
[0005] The technical solution of the present invention to solve the above technical problems is as follows:
[0006] An abnormal water usage detection method for an Internet of Things water meter, with one day as a cycle, collecting the water flow of the water meter at a first frequency, and judging whether the user is using water by analyzing the water flow data; when it is detected that the user is using water, collecting the water flow of the water meter at a second frequency, that is, obtaining valid data, where the value of the second frequency is greater than the value of the first frequency; by setting a flow threshold, comparing the values of each group of valid data with the flow threshold, and dividing the valid data into a front-section data group, a middle-section data group, and a back-section data group according to the comparison results; after each water usage sampling, fitting the data of the front-section data group to obtain a front-section curve, fitting the data of the middle-section data group to obtain a middle-section curve, and fitting the data of the back-section data group to obtain a back-section curve; at the end of one day, superimposing all the obtained front-section curves to obtain a front-section feature map, superimposing all the obtained middle-section curves to obtain a middle-section feature map, and superimposing all the obtained back-section curves to obtain a back-section feature map; respectively identifying and extracting the dense areas and overlapping areas of the intersection points in the front-section feature map, middle-section feature map, and back-section feature map to obtain front-section usage features, middle-section usage features, and back-section usage features; respectively calculating the similarity between the front-section usage features of the current day and the front-section usage features of the previous day, calculating the similarity between the middle-section usage features of the current day and the middle-section usage features of the previous day, and calculating the similarity between the back-section usage features of the current day and the back-section usage features of the previous day to obtain the comprehensive similarity between the two days before and after; pre-calibrating the theoretical water consumption difference according to different comprehensive similarity intervals; obtaining the water consumption of the previous day and the water consumption of the current day, calculating the actual water consumption difference between the two days before and after, and retrieving the corresponding theoretical water consumption difference according to the obtained comprehensive similarity value; calculating the relative percentage of the actual water consumption difference and the theoretical water consumption difference, and if the comparison percentage is greater than the preset value, it is considered that the user has abnormal water usage, and at this time, an abnormal alarm message is generated and notified to the management personnel.
[0007] As a preferred solution: when identifying the dense area of the intersection points in the figure, first divide the superimposed figure into a grid array, and then identify and count the line intersection points in each grid unit. When the number of intersection points in the grid unit is greater than the preset value, mark the grid unit as the dense area of the intersection points.
[0008] As a preferred solution: when identifying the overlapping area, identify the line segment and line thickness in each grid unit. If the line thickness of the line segment is greater than the preset value, it is considered as an overlapping line segment. After identifying the overlapping line segment, mark the grid unit corresponding to the overlapping line segment as the overlapping area.
[0009] As a preferred solution: coloring the dense area and the overlapping area with different colors to obtain the usage feature information.
[0010] As a preferred solution: when calculating the similarity of usage features, the dense areas in the superimposed graphs of the previous and the next day are compared and matched, and the overlapping areas are also compared and matched; the grid matching rate of the dense areas and the grid matching rate of the overlapping areas are obtained, and the similarity is calculated based on the grid matching rate of the dense areas and the grid matching rate of the overlapping areas.
[0011] As a preferred solution: the similarity calculation formula is D = a×P1 + b×P2, where P1 is the grid matching rate of the dense area, P2 is the grid matching rate of the overlapping area, and a and b are preset calculation coefficients.
[0012] An abnormal water usage detection system for an Internet of Things water meter, comprising: a data acquisition module, a data processing module, a data storage module, an image processing module, a calculation and analysis module, and an alarm module; wherein the data acquisition module takes one day as a cycle, collects the water flow of the water meter at a first frequency and uploads the collected data, and the calculation and analysis module determines whether the user is using water by analyzing the water flow data; when it is detected that the user is using water, the data acquisition module collects the water flow of the water meter at a second frequency, that is, valid data is obtained, where the value of the second frequency is greater than the value of the first frequency; the calculation and analysis module sets a flow threshold, compares the values of each group of valid data with the flow threshold, and divides the valid data into a front-segment data group, a middle-segment data group, and a rear-segment data group according to the comparison results; after each water usage sampling, the data processing module performs curve fitting on the data of the front-segment data group to obtain a front-segment curve, performs curve fitting on the data of the middle-segment data group to obtain a middle-segment curve, and performs curve fitting on the data of the rear-segment data group to obtain a rear-segment curve; at the end of one day, the image processing module superimposes all the obtained front-segment curves to obtain a front-segment feature map, superimposes all the obtained middle-segment curves to obtain a middle-segment feature map, and superimposes all the obtained rear-segment curves to obtain a rear-segment feature map; the image processing module respectively identifies and extracts the dense areas and overlapping areas of the intersection points in the front-segment feature map, the middle-segment feature map, and the rear-segment feature map to obtain front-segment usage features, middle-segment usage features, and rear-segment usage features; the calculation and analysis module respectively calculates the similarity between the front-segment usage features of the current day and the front-segment usage features of the previous day, calculates the similarity between the middle-segment usage features of the current day and the middle-segment usage features of the previous day, and calculates the similarity between the rear-segment usage features of the current day and the rear-segment usage features of the previous day to obtain the comprehensive similarity of the previous and the current day; the theoretical water usage difference is calibrated in advance according to different comprehensive similarity intervals; the calculation and analysis unit obtains the water usage of the previous day and the water usage of the current day, calculates the actual water usage difference between the previous and the current day, and retrieves the corresponding theoretical water usage difference according to the obtained comprehensive similarity value; the calculation and analysis module calculates the relative percentage of the actual water usage difference and the theoretical water usage difference, and if the comparison percentage is greater than the preset value, it is considered that the user has abnormal water usage, and at this time the alarm module generates an abnormal alarm message and notifies the management personnel.
[0013] Compared with the prior art, the technical solution of the present application has the following beneficial technical effects: By collecting the daily water flow data of the user, classifying and preprocessing the water flow data, and then fitting the processed data to obtain a fitting curve; by superimposing the fitting curves of one day and identifying and extracting the dense intersection area and the overlapping line segment area in the superimposed graph, the usage characteristics of the user on the current day are obtained, calculating and analyzing the similarity between the usage characteristics of the user on the current day and the usage characteristics of the previous day, and accordingly retrieving the corresponding theoretical water consumption difference; finally, comparing the actual water consumption difference between the two days with the theoretical water consumption difference, and when the difference between the two is too large, it is considered that the user has abnormal water usage. Through this method, it is possible to assist in judging abnormal water usage based on the user's water usage characteristics, achieving a more refined and accurate detection effect. BRIEF DESCRIPTION OF THE DRAWINGS
[0014] Figure 1 It is a schematic diagram of the system in Embodiment 2. DETAILED DESCRIPTION OF THE EMBODIMENTS
[0015] Embodiment 1:
[0016] An abnormal water usage detection method for an Internet of Things water meter, specifically: taking one day (24 hours) as a cycle, collecting the water flow of the water meter at the first frequency, and judging whether the user is using water by analyzing the water flow data. In this embodiment, when the collected water flow is zero, it is considered that the user is not using water, and when the collected water flow is greater than zero, it is considered that the user is using water.
[0017] When it is detected that the user is using water, collect the water flow of the water meter at the second frequency, that is, obtain valid data, where the value of the second frequency is greater than the value of the first frequency. For example, the first frequency can be 10 times per minute, and the second frequency can be 60 times per minute. By setting different data collection frequencies, it is possible to ensure the timeliness and accuracy of data collection as much as possible, and also reduce the power consumption of the Internet of Things water meter and extend the service life of the battery.
[0018] By setting a flow threshold, compare the values of each group of valid data with the flow threshold, and divide the valid data into a front-segment data group, a middle-segment data group, and a rear-segment data group according to the comparison results. Specifically, by setting an appropriate flow threshold, it is defined whether the user is gradually opening the faucet, the faucet is steadily opened, or the faucet is gradually closed.
[0019] In the stage of opening the faucet, the collected water flow is continuously increasing; after the faucet maintains a stable opening, the collected water flow is relatively stable; in the stage of closing the faucet, the collected water flow is continuously decreasing. Therefore, it is possible to judge whether the faucet is in the stage of gradually opening, the stage of stable opening, or the stage of gradually closing by setting a flow threshold and comparing the collected water flow with the set flow threshold.
[0020] Define the water flow data collected during the gradually opening stage as the front - segment data group, the water flow data collected during the stage with stable opening as the middle - segment data group, and the data collected during the gradually closing stage as the rear - segment data group.
[0021] For different users, the speed of each family member's action of turning on and off the faucet and the stable water flow rate when turning on the faucet are different, and it is considered that the habits of each member's switching actions and water flow rate magnitudes will not change.
[0022] After each water - use sampling, perform curve fitting on the data of the front - segment data group to obtain the front - segment curve, perform curve fitting on the data of the middle - segment data group to obtain the middle - segment curve, and perform curve fitting on the data of the rear - segment data group to obtain the rear - segment curve; at the end of a day, stack all the obtained front - segment curves to obtain the front - segment feature map, stack all the obtained middle - segment curves to obtain the middle - segment feature map, and stack all the obtained rear - segment curves to obtain the rear - segment feature map.
[0023] It should be noted that: since the lengths of the fitting curves are different, in this embodiment, when stacking the fitting curves, align the starting points of each fitting curve.
[0024] Combining the front - end feature map, the middle - segment feature map, and the rear - segment feature map can reflect the user's water - use characteristics within a day, and the change in water - use characteristics can, to a certain extent, reflect the change in water consumption. Therefore, it is possible to predict the change in water consumption for the two consecutive days by comparing and analyzing the water - use characteristics of the two consecutive days.
[0025] In this embodiment, identify and extract the dense regions and overlapping regions of the intersection points in the front - segment feature map, the middle - segment feature map, and the rear - segment feature map respectively to obtain the front - segment use characteristics, the middle - segment use characteristics, and the rear - segment use characteristics.
[0026] Specifically: when identifying the dense regions of the intersection points in the feature map, first divide the stacked map into a grid array, then identify and count the line intersection points in each grid cell. When the number of intersection points in the grid cell is greater than the preset value, mark this grid cell as the dense region of the intersection points.
[0027] On this basis, when identifying the overlapping regions, identify the line segments and line widths in each grid cell. If the line width of a line segment is greater than the preset value, consider it as an overlapping line segment. After identifying the overlapping line segments, mark the grid cells corresponding to the overlapping line segments as the overlapping regions.
[0028] For the sake of easy distinction, it is also necessary to color the dense regions and the overlapping regions with different colors.
[0029] After summarizing the grid cells corresponding to the dense areas and the grid cells corresponding to the overlapping areas in this embodiment, the positions, quantities, and types (colors) of the summarized grid cells are the usage features.
[0030] Through the above method, the usage features of the first segment of the day, the usage features of the middle segment of the day, and the usage features of the last segment of the day can be obtained.
[0031] Calculate the similarity between the usage features of the first segment of the day and the usage features of the first segment of the previous day, calculate the similarity between the usage features of the middle segment of the day and the usage features of the middle segment of the previous day, and calculate the similarity between the usage features of the last segment of the day and the usage features of the last segment of the previous day to obtain the comprehensive similarity between the two days.
[0032] In this embodiment, when calculating the similarity, the calculation formula D = a×P1 + b×P2 is used, where D is the similarity value, P1 is the grid matching rate of the dense area, P2 is the grid matching rate of the overlapping area, and a and b are preset calculation coefficients.
[0033] The process of obtaining the grid matching rate is as follows:
[0034] Taking the usage features of the first segment as an example, obtain the usage features of the first segment of the day and the previous day. Scan the number of grid cells in the dense area of the usage feature information of the first segment of the day and the position coordinates of each grid cell, and then scan the number of grid cells in the dense area of the usage feature information of the first segment of the previous day and the position coordinates of each grid cell. Compare and match the grid cells one by one according to the coordinates and count the number of successfully matched grid cell pairs. Divide the number of successfully matched grid cell pairs by the total number of grid cells (select the larger number of grid cells between the two days as the total number of grid cells) to obtain P1.
[0035] Scan the grid cells in the overlapping area of the usage feature information of the middle segment of the day and the previous day, and compare and match them to obtain P2.
[0036] Then, using the above calculation formula, the similarity D1 between the usage features of the first segment of the day and the usage features of the first segment of the previous day can be calculated.
[0037] Similarly, through the above steps, the similarity D2 between the usage features of the middle segment of the day and the usage features of the middle segment of the previous day, and the similarity D3 between the usage features of the last segment of the day and the usage features of the last segment of the previous day can be calculated.
[0038] In this embodiment, the comprehensive similarity is defined as the average of D1, D2, and D3.
[0039] In this embodiment, it is also necessary to pre-calibrate the theoretical water consumption difference according to different comprehensive similarity intervals.
[0040] Obtain the water consumption of the previous day and the water consumption of the current day, calculate the difference in actual water consumption between the two days before and after, and retrieve the corresponding theoretical water consumption difference according to the obtained comprehensive similarity value; calculate the relative percentage of the actual water consumption difference to the theoretical water consumption difference. If the compared percentage is greater than the preset value, it is considered that the user has abnormal water consumption. At this time, an abnormal alarm message is generated and the management staff is notified.
[0041] Embodiment 2:
[0042] Refer to Figure 1 , an abnormal water consumption detection system for an Internet of Things water meter. This system is used to execute the method in Embodiment 1. The system includes: a data acquisition module, a data processing module, a data storage module, an image processing module, a calculation and analysis module, and an alarm module; among them, the data acquisition module takes one day as a cycle and acquires the water flow of the water meter at the first frequency and uploads the acquired data. The calculation and analysis module determines whether the user is using water by analyzing the water flow data; when it is detected that the user is using water, the data acquisition module acquires the water flow of the water meter at the second frequency, that is, valid data is obtained, where the value of the second frequency is greater than the value of the first frequency; the calculation and analysis module sets a flow threshold, compares the values of each group of valid data with the flow threshold, and divides the valid data into a front-segment data group, a middle-segment data group, and a rear-segment data group according to the comparison results; after each water consumption sampling, the data processing module performs curve fitting on the data of the front-segment data group to obtain a front-segment curve, performs curve fitting on the data of the middle-segment data group to obtain a middle-segment curve, and performs curve fitting on the data of the rear-segment data group to obtain a rear-segment curve; at the end of a day, the image processing module superimposes all the obtained front-segment curves to obtain a front-segment feature map, superimposes all the obtained middle-segment curves to obtain a middle-segment feature map, and superimposes all the obtained rear-segment curves to obtain a rear-segment feature map; the image processing module respectively identifies and extracts the dense areas and overlapping areas of the intersection points in the front-segment feature map, the middle-segment feature map, and the rear-segment feature map to obtain front-segment usage features, middle-segment usage features, and rear-segment usage features; the calculation and analysis module respectively calculates the similarity between the front-segment usage features of the current day and the front-segment usage features of the previous day, calculates the similarity between the middle-segment usage features of the current day and the middle-segment usage features of the previous day, and calculates the similarity between the rear-segment usage features of the current day and the rear-segment usage features of the previous day to obtain the comprehensive similarity between the two days before and after; the theoretical water consumption difference is calibrated in advance according to different comprehensive similarity intervals; the calculation and analysis unit obtains the water consumption of the previous day and the water consumption of the current day, calculates the difference in actual water consumption between the two days before and after, and retrieves the corresponding theoretical water consumption difference according to the obtained comprehensive similarity value; the calculation and analysis module calculates the relative percentage of the actual water consumption difference to the theoretical water consumption difference. If the compared percentage is greater than the preset value, it is considered that the user has abnormal water consumption. At this time, the alarm module generates an abnormal alarm message and notifies the management staff.
[0043] The above are only the preferred embodiments of the present invention, and are not intended to limit the present invention. Any modifications, equivalent substitutions, improvements, etc. made within the spirit and principle of the present invention shall be included within the protection scope of the present invention.
Claims
1. An abnormal water use detection method for an Internet of Things water meter, characterized in that: Taking one day as a cycle, the water flow of the water meter is collected at the first frequency. By analyzing the water flow data, it is judged whether the user is using water. When it is detected that the user is using water, the water flow of the water meter is collected at the second frequency, that is, valid data is obtained, where the value of the second frequency is greater than the value of the first frequency. By setting a flow threshold, the values of each group of valid data are compared with the flow threshold, and according to the comparison results, the valid data is divided into a front-segment data group, a middle-segment data group, and a rear-segment data group. After each water use sampling, the data of the front-segment data group is curve-fitted to obtain a front-segment curve, the data of the middle-segment data group is curve-fitted to obtain a middle-segment curve, and the data of the rear-segment data group is curve-fitted to obtain a rear-segment curve. After one day ends, all the obtained front-segment curves are superimposed to obtain a front-segment feature map, all the obtained middle-segment curves are superimposed to obtain a middle-segment feature map, and all the obtained rear-segment curves are superimposed to obtain a rear-segment feature map. The dense areas and overlapping areas of the intersection points in the front-segment feature map, middle-segment feature map, and rear-segment feature map are respectively identified and extracted to obtain front-segment usage features, middle-segment usage features, and rear-segment usage features. The similarity between the front-segment usage features of the current day and the front-segment usage features of the previous day, the similarity between the middle-segment usage features of the current day and the middle-segment usage features of the previous day, and the similarity between the rear-segment usage features of the current day and the rear-segment usage features of the previous day are respectively calculated to obtain the comprehensive similarity between the two days before and after. The theoretical water consumption difference is calibrated in advance according to different comprehensive similarity intervals. The water consumption of the previous day and the water consumption of the current day are obtained, the actual water consumption difference between the two days before and after is calculated, and the corresponding theoretical water consumption difference is retrieved according to the obtained comprehensive similarity value. Calculate the relative percentage of the actual water consumption difference and the theoretical water consumption difference. If the comparison percentage is greater than the preset value, it is considered that the user has abnormal water use, and at this time, an abnormal alarm message is generated and notified to the management personnel.
2. The abnormal water consumption detection method for the Internet of Things water meter according to claim 1, characterized in that: When identifying the dense area of the intersection points in the figure, first divide the superimposed figure into a grid array, and then identify and count the line intersection points in each grid unit. When the number of intersection points in the grid unit is greater than the preset value, mark the grid unit as the dense area of the intersection points.
3. The abnormal water consumption detection method for the Internet of Things water meter according to claim 2, characterized in that: When identifying the overlapping area, the line segment and line thickness in each grid unit are identified. If the line thickness of the line segment is greater than the preset value, it is considered as an overlapping line segment. After identifying the overlapping line segment, mark the grid unit corresponding to the overlapping line segment as the overlapping area.
4. The method for detecting abnormal water use of the Internet of Things water meter according to claim 3, characterized in that: Color the dense area and the overlapping area with different colors to obtain the usage feature information.
5. The abnormal water usage detection method for the Internet of Things water meter according to claim 4, characterized in that: When calculating the similarity of the usage features, the dense areas in the superimposed figures of the two days before and after are compared and matched, and the overlapping areas are compared and matched; the grid matching rate of the dense area and the grid matching rate of the overlapping area are obtained, and the similarity is calculated based on the grid matching rate of the dense area and the grid matching rate of the overlapping area.
6. The abnormal water usage detection method for the Internet of Things water meter according to claim 5, characterized in that: The similarity calculation formula is D = a×P1 + b×P2, where P1 is the grid matching rate of the dense area, P2 is the grid matching rate of the overlapping area, and a and b are preset calculation coefficients.
7. An abnormal water usage detection system for an Internet of Things water meter, characterized in that, Including: Data acquisition module, data processing module, data storage module, image processing module, calculation and analysis module, and alarm module; Among them, the data acquisition module takes one day as a cycle, collects the water flow of the water meter at the first frequency and uploads the collected data. The calculation and analysis module judges whether the user is using water by analyzing the water flow data; When it is detected that the user is using water, the data acquisition module collects the water flow of the water meter at the second frequency, that is, valid data is obtained, where the value of the second frequency is greater than the value of the first frequency; the calculation and analysis module sets a flow threshold, compares the values of each group of valid data with the flow threshold, and divides the valid data into a front-segment data group, a middle-segment data group, and a rear-segment data group according to the comparison results; after each water use sampling, the data processing module performs curve fitting on the data of the front-segment data group to obtain a front-segment curve, performs curve fitting on the data of the middle-segment data group to obtain a middle-segment curve, and performs curve fitting on the data of the rear-segment data group to obtain a rear-segment curve; at the end of the day, the image processing module superimposes all the obtained front-segment curves to obtain a front-segment feature map, superimposes all the obtained middle-segment curves to obtain a middle-segment feature map, and superimposes all the obtained rear-segment curves to obtain a rear-segment feature map; the image processing module respectively identifies and extracts the dense areas and overlapping areas of the intersection points in the front-segment feature map, middle-segment feature map, and rear-segment feature map to obtain front-segment usage features, middle-segment usage features, and rear-segment usage features; the calculation and analysis module respectively calculates the similarity between the front-segment usage features of the current day and the front-segment usage features of the previous day, calculates the similarity between the middle-segment usage features of the current day and the middle-segment usage features of the previous day, and calculates the similarity between the rear-segment usage features of the current day and the rear-segment usage features of the previous day to obtain the comprehensive similarity between the two days before and after; the theoretical water consumption difference is calibrated in advance according to different comprehensive similarity intervals; The calculation and analysis unit obtains the water consumption of the previous day and the water consumption of the current day, calculates the actual water consumption difference between the two days before and after, and retrieves the corresponding theoretical water consumption difference according to the obtained comprehensive similarity value; the calculation and analysis module calculates the relative percentage of the actual water consumption difference and the theoretical water consumption difference. If the comparison percentage is greater than the preset value, it is considered that the user has abnormal water use. At this time, the alarm module generates an abnormal alarm message and notifies the management personnel.
Citation Information
Cited By
Urban resident water consumption behavior classification method based on intelligent water meter
CN120654078A
Intelligent water meter operation monitoring method and system based on Internet of Things
CN120812107A