Water meter water quantity monitoring method and system based on Internet of Things
Through IoT technology, the water consumption and number of people on campus are obtained and analyzed, and the water consumption threshold is established based on building type and weather factors, which solves the problem of low accuracy of traditional water consumption monitoring methods and achieves more accurate water use management and Early warning.
Patent Information
- Application Number
- CN202410771843.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-06-15
- Publication Date
- 2024-11-12
AI Technical Summary
Traditional water consumption monitoring methods cannot comprehensively consider multiple factors, resulting in low accuracy of water consumption monitoring on campus.
The Internet of Things-based water meter water volume monitoring method is adopted to obtain historical water consumption and average number of people, determine building types, establish water consumption thresholds, and correct them in combination with weather data, and monitor and early warning in real time.
It improves the accuracy and prediction accuracy of water consumption monitoring, ensures the scientificity and reliability of water use management, promptly detects abnormal water use situations, and achieves more accurate water consumption assessment and early warning.
Smart Images

Figure CN118941407A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the technical field of Internet of Things, and in particular to a water meter water volume monitoring method and system based on Internet of Things. Background Art
[0002] In modern campus management, efficient water management is an important part of ensuring the normal operation of the campus and saving resources. With the continuous expansion of the scale of university campuses and the increase in the number of buildings, the water consumption management of each building on campus has become more and more complicated. Traditional water consumption monitoring methods often rely only on real-time water meter monitoring data. However, water consumption on campus is often affected by multiple factors, and traditional methods cannot comprehensively consider these factors, resulting in low accuracy of water consumption monitoring.
[0003] Therefore, how to improve the accuracy of water consumption monitoring has become a technical problem that needs to be solved urgently. Summary of the invention
[0004] The present application provides a water meter water volume monitoring method and system based on the Internet of Things, which can improve the accuracy of water volume monitoring.
[0005] In the first aspect, the present application provides a water meter water volume monitoring method based on the Internet of Things, the method comprising: obtaining the historical water consumption of each campus building within the campus scope within a historical preset time period, and obtaining the historical average number of people of each campus building within the historical preset time period; determining the building type corresponding to each campus building; obtaining the water consumption threshold corresponding to each campus building based on each historical water consumption, each building type and each historical average number of people; obtaining the current water consumption of each campus building within a current preset time period, and obtaining the current average number of people of each campus building within the current preset time period; determining the current weather data corresponding to the current preset time period and the historical weather data corresponding to the historical preset time period; based on the current weather data, the historical weather data, each current average number of people and each historical average number of people, correcting the current water consumption to obtain the corrected water consumption corresponding to each campus building; when the corrected water consumption corresponding to the current campus building is greater than the water consumption threshold corresponding to the current campus building, performing water use monitoring and early warning on the current campus building.
[0006] By adopting the above technical solution, by obtaining the historical water consumption of each campus building within the campus range within the historical preset time period, and obtaining the historical average number of people in each campus building within the historical preset time period, it is possible to collect the water consumption and personnel flow data of each building in different time periods, providing a data basis for subsequent analysis. By determining the building type corresponding to each campus building, the water demand of different types of buildings can be refined, and the accuracy and pertinence of data analysis can be further improved. Based on each historical water consumption, each building type and each historical average number of people, the water consumption threshold corresponding to each campus building is obtained, so that the water consumption benchmark of different buildings under normal use can be established, providing a standard for abnormal water use monitoring. By obtaining the current water consumption of each campus building within the current preset time period, and obtaining the current average number of people in each campus building within the current preset time period, the water consumption of each building can be monitored in real time, and compared and analyzed with historical data. By determining the current weather data corresponding to the current preset time period and the historical weather data corresponding to the historical preset time period, the influence of weather factors on water consumption can be considered, and the accuracy of water consumption prediction can be improved. Based on the current weather data, historical weather data, the current average number of people, and the historical average number of people, the current water consumption is corrected to obtain the corrected water consumption corresponding to each campus building, so that the real-time monitoring data can be reasonably adjusted to eliminate the impact of abnormal weather or personnel changes, and provide a more accurate water consumption assessment. When the corrected water consumption corresponding to the current campus building is greater than the water consumption threshold corresponding to the current campus building, the current campus building is accurately monitored and warned.
[0007] Optionally, the water consumption threshold corresponding to each campus building is obtained based on each of the historical water consumption, each of the building types and each of the historical average number of people, specifically including: preprocessing multiple historical water consumption to obtain multiple preprocessed historical water consumption, and preprocessing multiple historical average number of people to obtain multiple preprocessed historical average number of people; extracting building type characteristics corresponding to each of the building types, and extracting time type characteristics corresponding to each of the historical preset time periods; using multiple preprocessed historical water consumption as target variables, and using multiple preprocessed historical average number of people, multiple building type characteristics and multiple time type characteristics as input variables to train a regression model; inputting each of the building type characteristics and each of the time type characteristics into the trained regression model to obtain the predicted water consumption corresponding to each of the campus buildings in each of the historical preset time periods; obtaining the water consumption threshold corresponding to each of the campus buildings based on each of the predicted water consumption and each of the historical water consumption.
[0008] By adopting the above technical solution, multiple historical water consumptions are preprocessed to obtain multiple preprocessed historical water consumptions, and multiple historical average numbers of people are preprocessed to obtain multiple preprocessed historical average numbers of people, so that data can be standardized and cleaned, noise and outliers can be eliminated, and a more accurate data basis can be provided for subsequent analysis. By extracting the building type characteristics corresponding to each building type, and extracting the time type characteristics corresponding to each historical preset time period, the characteristics of different building types and time periods can be refined, providing rich input variables for model training, and improving the prediction accuracy of the model. By taking multiple preprocessed historical water consumptions as target variables, and taking multiple preprocessed historical average numbers of people, multiple building type characteristics, and multiple time type characteristics as input variables, the regression model is trained, so that machine learning technology can be used for data analysis, and a mathematical model can be established to predict future water consumption, thereby improving the scientificity and accuracy of the prediction. By inputting each building type characteristic and each time type characteristic into the trained regression model, the predicted water consumption corresponding to each campus building in each historical preset time period is obtained, so that the water use situation in the historical time period can be accurately predicted according to different building types and time characteristics, providing a basis for setting the water consumption threshold. By obtaining the water consumption threshold corresponding to each campus building based on each predicted water consumption and each historical water consumption, it is possible to comprehensively consider the predicted results and actual historical data and set a reasonable water consumption threshold.
[0009] Optionally, the building type characteristics include: building use characteristics, building scale characteristics, building facility configuration characteristics and building use intensity characteristics.
[0010] Optionally, the water consumption threshold corresponding to each campus building is obtained based on each predicted water consumption and each historical water consumption, specifically including: subtracting each predicted water consumption from each historical water consumption to obtain a water consumption residual corresponding to each campus building; based on each water consumption residual, calculating the standard deviation of the water consumption residual corresponding to each campus building; based on each water consumption residual standard deviation and each predicted water consumption, calculating the water consumption threshold corresponding to each campus building.
[0011] By adopting the above technical solution, by subtracting each predicted water consumption from each historical water consumption, the water consumption residual corresponding to each campus building is obtained, so that the difference between actual water consumption and predicted water consumption can be quantified, and abnormalities in historical data can be identified, providing a basis for subsequent statistical analysis. By calculating the standard deviation of the water consumption residual corresponding to each campus building based on each water consumption residual, the fluctuation of the water consumption residual can be measured, and the discrete degree information of the data can be provided, providing a reference for determining a reasonable water consumption threshold. By calculating the water consumption threshold corresponding to each campus building based on the standard deviation of each water consumption residual and each predicted water consumption, a more accurate water consumption threshold can be set on the basis of considering the residual fluctuation and predicted water consumption, thereby improving the accuracy and reliability of water consumption monitoring and early warning.
[0012] Optionally, the calculating of the standard deviation of the residual of water consumption corresponding to each campus building based on each of the residual of water consumption specifically includes: calculating the standard deviation of each of the residual of water consumption by the following formula: Among them, σ r is the standard deviation of the water consumption residual, n is the number corresponding to the water consumption residual, r i is the i-th water consumption residual; based on each water consumption residual standard deviation and each predicted water consumption, calculating the water consumption threshold corresponding to each campus building, specifically including: calculating each water consumption threshold by the following formula: Y = X + 3σ r ; Where Y is the water consumption threshold, X is the residual standard deviation of the water consumption, σ r is the standard deviation of the water consumption residual.
[0013] Optionally, the current weather data includes the current average temperature and the current average humidity, and the historical weather data includes the historical average temperature and the historical average humidity; the current water consumption is corrected based on the current weather data, the historical weather data, the current average number of people and the historical average number of people to obtain the corrected water consumption corresponding to each campus building, specifically including: obtaining the temperature change rate based on the current average temperature and the historical average temperature; obtaining the humidity change rate based on the current average humidity and the historical average humidity; obtaining the number of people change rate corresponding to each campus building based on the current average number of people and the historical average number of people; the current water consumption is corrected based on the temperature change rate, the humidity change rate and the number of people change rate to obtain the corrected water consumption corresponding to each campus building.
[0014] By adopting the above technical solution, the temperature change rate is obtained based on the current average temperature and the historical average temperature, so that the degree of change between the current and historical temperatures can be quantified, reflecting the impact of temperature on water consumption, and providing a basis for data correction. By obtaining the humidity change rate based on the current average humidity and the historical average humidity, the degree of change between the current and historical humidity can be quantified, reflecting the impact of humidity on water consumption, and further improving the basis for data correction. By obtaining the population change rate corresponding to each campus building based on each current average number of people and each historical average number of people, the change in the number of people can be quantified, reflecting the impact of personnel flow on water consumption, and providing key parameters for water consumption correction. By correcting the current water consumption based on the temperature change rate, humidity change rate and each number of people change rate, the corrected water consumption corresponding to each campus building is obtained, so that the impact of multiple factors on water consumption can be comprehensively considered, and more accurate water consumption correction can be made, the accuracy of the prediction can be improved, and the effectiveness of water use monitoring and early warning can be ensured.
[0015] Optionally, based on the temperature change rate, the humidity change rate and each of the population change rates, the current water consumption is corrected to obtain the corrected water consumption corresponding to each of the campus buildings, specifically including: calculating the corrected water consumption corresponding to each of the campus buildings by the following formula: SU m =CU m ×(1+αΔT+βΔH+γΔP m );where SU i is the modified water consumption corresponding to the mth campus building, CU i is the current water consumption corresponding to the mth campus building, ΔT is the temperature change rate, ΔH is the humidity change rate, ΔP i is the population change rate corresponding to the mth campus building, α is the first correction coefficient, β is the second correction coefficient, and γ is the third correction coefficient.
[0016] In a second aspect of the present application, a water meter water volume monitoring system based on the Internet of Things is provided, the system comprising an acquisition module, a processing module and a water use monitoring and early warning module; the acquisition module is used to obtain the historical water consumption of each campus building within the campus range within a historical preset time period, and obtain the historical average number of people of each campus building within the historical preset time period; the processing module is used to determine the building type corresponding to each campus building; the processing module is also used to obtain the water consumption threshold corresponding to each campus building based on each historical water consumption, each building type and each historical average number of people; the acquisition module is also used to obtain the water consumption threshold corresponding to each campus building at the current preset time. The processing module is further used to determine the current weather data corresponding to the current preset time period and the historical weather data corresponding to the historical preset time period; the processing module is further used to correct the current water consumption based on the current weather data, the historical weather data, the current average number of people and the historical average number of people to obtain the corrected water consumption corresponding to each campus building; the water use monitoring and early warning module is used to monitor and warn the current campus building when the corrected water use corresponding to the current campus building is greater than the water use threshold corresponding to the current campus building.
[0017] In the third aspect of the present application, an electronic device is provided, including a processor, a memory, a user interface and a network interface, the memory is used to store instructions, the user interface and the network interface are used to communicate with other devices, and the processor is used to execute the instructions stored in the memory so that the electronic device executes any method as described in the first aspect of the present application.
[0018] In a fourth aspect of the present application, a computer-readable storage medium is provided, wherein the computer-readable storage medium stores a computer program that can be loaded by a processor and execute the method as described in any one of the first aspects of the present application.
[0019] In summary, one or more technical solutions provided in the embodiments of the present application have at least the following technical effects or advantages: By obtaining the historical water consumption of each campus building within the campus range within the historical preset time period, and obtaining the historical average number of people in each campus building within the historical preset time period, the water consumption and personnel flow data of each building in different time periods can be collected to provide a data basis for subsequent analysis. By determining the building type corresponding to each campus building, the water demand of different types of buildings can be refined, and the accuracy and pertinence of data analysis can be further improved. Based on each historical water consumption, each building type and each historical average number of people, the water consumption threshold corresponding to each campus building is obtained, so that the water consumption benchmark of different buildings under normal use can be established, providing a standard for abnormal water use monitoring. By obtaining the current water consumption of each campus building within the current preset time period, and obtaining the current average number of people in each campus building within the current preset time period, the water consumption of each building can be monitored in real time, and compared and analyzed with historical data. By determining the current weather data corresponding to the current preset time period and the historical weather data corresponding to the historical preset time period, the impact of weather factors on water consumption can be considered, and the accuracy of water consumption prediction can be improved. Based on the current weather data, historical weather data, the current average number of people, and the historical average number of people, the current water consumption is corrected to obtain the corrected water consumption corresponding to each campus building, so that the real-time monitoring data can be reasonably adjusted to eliminate the impact of abnormal weather or personnel changes, and provide a more accurate water consumption assessment. When the corrected water consumption corresponding to the current campus building is greater than the water consumption threshold corresponding to the current campus building, the current campus building is accurately monitored and warned. BRIEF DESCRIPTION OF THE DRAWINGS
[0020] Figure 1 This is one of the flow charts of a water meter water volume monitoring method based on the Internet of Things provided in an embodiment of the present application; Figure 2 This is a second flow chart of a water meter water volume monitoring method based on the Internet of Things provided in an embodiment of the present application; Figure 3 This is a flow chart of a water meter water volume monitoring method based on the Internet of Things provided in an embodiment of the present application; Figure 4 This is a fourth flow chart of a water meter water volume monitoring method based on the Internet of Things provided in an embodiment of the present application; Figure 5 It is a structural schematic diagram of a water meter water volume monitoring system based on the Internet of Things provided in an embodiment of the present application; Figure 6 It is a structural schematic diagram of an electronic device disclosed in an embodiment of the present application.
[0021] Explanation of the reference numerals: 1. Acquisition module; 2. Processing module; 3. Water use monitoring and warning module; 600. Electronic device; 601. Processor; 602. Communication bus; 603. User interface; 604. Network interface; 605. Memory. DETAILED DESCRIPTION
[0022] In order to enable those skilled in the art to better understand the technical solutions in this specification, the technical solutions in the embodiments of this specification will be clearly and completely described below in conjunction with the drawings in the embodiments of this specification. Obviously, the described embodiments are only part of the embodiments of this application, not all of the embodiments.
[0023] In the description of the embodiments of the present application, words such as "for example" or "for example" are used to indicate examples, illustrations or explanations. Any embodiment or design described as "for example" or "for example" in the embodiments of the present application should not be interpreted as being more preferred or more advantageous than other embodiments or designs. Specifically, the use of words such as "for example" or "for example" is intended to present related concepts in a specific way.
[0024] In the description of the embodiments of the present application, the meaning of the term "multiple" refers to two or more. For example, multiple systems refer to two or more systems, and multiple screen terminals refer to two or more screen terminals. In addition, the terms "first" and "second" are only used for descriptive purposes and cannot be understood as indicating or implying relative importance or implicitly indicating the indicated technical features. Thus, the features defined as "first" and "second" can explicitly or implicitly include one or more of the features. The terms "include", "comprise", "have" and their variations all mean "including but not limited to", unless otherwise specifically emphasized.
[0025] This application provides a water meter water volume monitoring method based on the Internet of Things, referring to Figure 1 , which shows one of the flow diagrams of a water meter water volume monitoring method based on the Internet of Things provided in an embodiment of the present application. The method includes steps S1-S7, which are as follows: Step S1: Obtain the historical water consumption of each campus building within the campus range within a historical preset time period, and obtain the historical average number of people in each campus building within the historical preset time period.
[0026] Specifically, the purpose of implementing step S1 is to obtain the historical water consumption and historical average number of people data of each building within the campus within a historical preset time period. These data are the basis for subsequent steps and can provide necessary reference for analyzing the water use patterns of buildings, predicting future water consumption, and determining water consumption thresholds.
[0027] First, historical data is obtained through the water meter system and the crowd monitoring system on campus. Within a preset time period, such as every day, every week or every month in the past year, the water consumption data and average number of people in each campus building are extracted. The water consumption data can be recorded through the water meter readings in the building, and the system stores the daily water consumption data in the database. The historical average number of people data can be counted through the access control system, attendance system, etc., and the total number of people entering and leaving the building every day is divided by the actual number of days to get the average number of people.
[0028] Step S2: Determine the building type corresponding to each campus building.
[0029] Specifically, it is necessary to conduct a comprehensive survey and classification of all buildings on campus, and obtain the building type corresponding to each building through the campus's building management system or building archives.
[0030] Step S3: Based on each historical water consumption, each building type and each historical average number of people, a water consumption threshold corresponding to each campus building is obtained.
[0031] Specifically, the purpose of implementing step S3 is to obtain the water consumption threshold corresponding to each campus building based on the historical water consumption, building type and historical average number of people of each building. Determining the water consumption threshold is crucial for monitoring and managing the water consumption of campus buildings, which helps to identify abnormal water consumption and take timely response measures.
[0032] In one possible implementation, refer to Figure 2 , which shows the second flow chart of a water meter water volume monitoring method based on the Internet of Things provided in an embodiment of the present application. Step S3 specifically includes steps S31-S35: Step S31: pre-processing a plurality of historical water consumptions to obtain a plurality of pre-processed historical water consumptions, and pre-processing a plurality of historical average number of people to obtain a plurality of pre-processed historical average number of people.
[0033] Specifically, first, conduct a preliminary check on the collected data to identify and handle missing values. In the historical water consumption and historical average number of people data, there may be missing values due to equipment failure or data transmission problems. Use appropriate methods to fill these missing values, such as interpolating data from previous and subsequent time periods, or using historical data from similar buildings.
[0034] Secondly, deal with outliers in the data. Outliers are usually caused by recording errors or equipment failures, and these data points need to be identified and processed. Use statistical analysis methods, such as boxplots or Z-score methods, to identify outliers that are outside the normal range. For identified outliers, data smoothing techniques can be used or outliers can be removed to ensure the authenticity and reliability of the data.
[0035] Next, format and standardize the data. Since historical water consumption and average number of people data may come from different systems or formats, they need to be uniformly converted into a structured data format for subsequent processing. For example, convert all data into a unified time format (day, week, month), and ensure that the data units are consistent (such as water consumption is unified as cubic meters and the number of people is person-times).
[0036] Based on data formatting, the data is standardized. Standardization helps eliminate differences between different dimensions and improve the effect of model training. Commonly used standardization methods include Min-Max Normalization and Z-score normalization. Through standardization, all data will be converted to the same dimension range, which is convenient for model processing and comparison.
[0037] After data preprocessing is completed, the preprocessed historical water consumption and historical average population data are stored in the database to prepare for the subsequent steps. These preprocessed data will be used as input variables for model training to ensure data quality and consistency and improve the prediction accuracy of the model.
[0038] Step S32: extracting the building type features corresponding to each building type, and extracting the time type features corresponding to each historical preset time period, including building use features, building scale features, building facility configuration features, and building use intensity features.
[0039] Specifically, first, extract the characteristics of each building type. Building type characteristics include building use characteristics, building scale characteristics, building facility configuration characteristics and building use intensity characteristics, that is, when determining the water use of different buildings, it can be determined by building use characteristics, building scale characteristics, building facility configuration characteristics and building use intensity characteristics.
[0040] The characteristics of building use can be determined by the functional classification of the building, such as teaching building, dormitory, canteen, laboratory, etc.
[0041] Building scale characteristics may include parameters such as building area, number of floors, number of rooms, etc., thereby determining the water consumption of different buildings through parameters such as building area, number of floors, number of rooms, etc.
[0042] The building facility configuration characteristics cover the facilities and equipment inside the building, such as the number of toilets, bathing facility configuration, etc., so as to determine the water use situation of different buildings through the water facilities inside the building.
[0043] The building usage intensity characteristics are obtained through surveys and statistics on building usage, such as the number of days per week used, daily usage duration, etc., so that the water usage of different buildings can be determined by the length of time the buildings are used.
[0044] In order to accurately extract these features, it is necessary to combine the data in the campus building management system with the results of field surveys. By accessing the building management system, you can obtain basic information about the building and the configuration of facilities. Conduct a detailed survey of each building, record its actual purpose and usage, and ensure the accuracy and comprehensiveness of the data.
[0045] Next, extract the time type features of each historical preset time period. Time type features include season features, holiday features, semester features, etc. Seasonal features can be determined by the four seasons of each year (spring, summer, autumn, and winter), and different seasons have different effects on water consumption. Holiday features can be marked by national statutory holidays and campus holiday arrangements. Different holiday arrangements will significantly affect water use patterns. Semester features can be divided according to the campus teaching arrangements, such as spring semester, autumn semester, etc., to reflect the impact of the intensity of teaching activities on water consumption.
[0046] In order to accurately extract the time type characteristics, each historical time period needs to be divided and labeled in detail. Combined with the school calendar and the national statutory holidays, each time period is accurately classified and recorded. By analyzing these characteristics, the influence of time factors on water consumption can be identified, providing effective input data for the model.
[0047] After feature extraction is completed, the building type features and time type features are combined with the historical water consumption and average number of people data preprocessed in step S31 to form a complete training data set. This data set will be used to train the regression model in order to accurately predict the water consumption of each campus building in different time periods.
[0048] Step S33: using multiple pre-processed historical water consumption as target variables, and using multiple pre-processed historical average number of people, multiple building type characteristics, and multiple time type characteristics as input variables to train a regression model.
[0049] Specifically, first, the historical water consumption data preprocessed in step S31 is used as the target variable. These data have been cleaned and standardized and can accurately reflect the actual water consumption in each time period. The selection of the target variable directly affects the prediction effect of the model, so the selection of preprocessed water consumption data is the basis for ensuring the accuracy of the model.
[0050] Next, the historical average number of people data preprocessed in step S31, the building type characteristics and time type characteristics extracted in step S32 are used as input variables. The historical average number of people data can reflect the use intensity of the building. The building type characteristics include building use characteristics, building scale characteristics, building facility configuration characteristics and building use intensity characteristics, while the time type characteristics include seasonal characteristics, holiday characteristics and semester characteristics. These input variables together describe the main factors affecting water consumption.
[0051] In order to train the regression model, the target variable and input variable need to be constructed into a training data set. The training data set is trained using the regression algorithm in machine learning. Common regression algorithms include linear regression, random forest regression, and support vector regression. The specific regression algorithm can be selected based on the characteristics of the data and actual needs. During the model training process, the cross-validation method can be used to evaluate the performance of the model, and the prediction effect of the model can be optimized by adjusting the parameters.
[0052] After the model training is completed, the model needs to be evaluated and verified. A part of the data is used as a test set. By inputting the test set data into the trained model, the difference between the model's prediction results and the actual water consumption is compared, and the model's performance indicators, such as mean square error (MSE) and mean absolute error (MAE), are calculated. The prediction accuracy and reliability of the model can be judged through the evaluation results. If necessary, the model parameters can be further adjusted or a different regression algorithm can be selected for retraining.
[0053] Step S34: Input each building type feature and each time type feature into the trained regression model to obtain the predicted water consumption of each campus building in each historical preset time period.
[0054] Specifically, first, the building type features and time type features extracted in step S32, as well as the historical average number of people data preprocessed in step S31, are organized into the input data format required by the model. These features include building use features, building scale features, building facility configuration features, building use intensity features, seasonal features, holiday features, and semester features. Ensure that all feature data are standardized so that the model can process and give accurate prediction results.
[0055] Next, the sorted input data is input into the regression model trained in step S33. The model has been trained with a large amount of historical data and has learned the relationship between input features and water consumption. After inputting the feature data, the model will output the predicted water consumption based on the learned rules. This process requires predictions for each time period of each building to ensure the comprehensiveness and accuracy of the prediction results.
[0056] After obtaining the predicted water consumption, the prediction results need to be verified and analyzed. Compare some of the prediction results with the actual historical water consumption to evaluate the prediction accuracy of the model. If there is a large difference between the prediction results and the actual data, further analysis is needed, and the model may need to be adjusted or retrained to improve the prediction accuracy.
[0057] Step S35: Based on each predicted water consumption and each historical water consumption, a water consumption threshold corresponding to each campus building is obtained.
[0058] Specifically, the purpose of implementing step S35 is to obtain the water consumption threshold corresponding to each campus building based on each predicted water consumption and each historical water consumption. The water consumption threshold is an important indicator of the monitoring and early warning system. When the actual water consumption exceeds the threshold, it indicates that there may be an abnormal situation and corresponding measures need to be taken.
[0059] In one possible implementation, refer to Figure 3 , which shows the third flow chart of a water meter water volume monitoring method based on the Internet of Things provided in an embodiment of the present application. Step S35 specifically includes steps S351-S353: Step S351: Subtract each predicted water consumption from each historical water consumption to obtain the water consumption residual corresponding to each campus building.
[0060] Specifically, in order to ensure the accuracy of the calculation of water consumption residuals, the water consumption data for each time period needs to be aligned and matched. Databases or data processing software (such as the Pandas library in Python) can be used to merge actual water consumption and predicted water consumption according to timestamps, and calculate water consumption residuals row by row. This process can be automated by writing scripts to improve efficiency and accuracy.
[0061] Step S352: Based on each water consumption residual, calculate the standard deviation of the water consumption residual corresponding to each campus building.
[0062] In a possible implementation, in step S352, the standard deviation of each water consumption residual is calculated by the following formula: Among them, σ r is the standard deviation of water consumption residual, n is the number corresponding to the water consumption residual, r i is the i-th water consumption residual.
[0063] Specifically, the variance of the water consumption residuals is calculated based on the water consumption residuals and the mean of the water consumption residuals. The variance reflects the dispersion of the water consumption residuals and is a measure of the volatility of the residuals. The mean of the water consumption residuals reflects the offset of the overall prediction error. If the mean is close to zero, it means that the prediction model has no systematic deviation. In the process of calculating the standard deviation, the difference between each water consumption residual and the mean of the water consumption residuals is squared and summed, reflecting the overall dispersion of the data.
[0064] Step S353: Calculate the water consumption threshold corresponding to each campus building based on the residual standard deviation of each water consumption and each predicted water consumption.
[0065] In a possible implementation, in step S353, each water consumption threshold is calculated by the following formula: Y = X + 3σ r ; where Y is the water consumption threshold, X is the residual standard deviation of water consumption, σ r is the residual standard deviation of water consumption.
[0066] Specifically, the 3σ in the formula r It reflects a sufficiently wide safety margin outside the normal fluctuation range of water consumption to ensure that an early warning is triggered only in the event of a significant abnormality.
[0067] Step S4: Obtain the current water consumption of each campus building in the current preset time period, and obtain the current average number of people in each campus building in the current preset time period.
[0068] Specifically, first, the water usage of each building is monitored in real time through the water meter system on campus. The water consumption data of each building is regularly collected and recorded within the current preset time period (such as one day, one week or one month). These data are transmitted to the central database in real time through the automated water meter system to ensure the accuracy and real-time nature of the data. At the same time, the average number of people in each building during the current preset time period is collected through the campus access control system or other number monitoring equipment. The access control system can record the number of people entering and leaving each building. By counting these data, the average number of users per day can be calculated.
[0069] In order to ensure the completeness and accuracy of the data, the collected data on current water consumption and average number of people need to be initially checked and preprocessed. First, check the completeness of the data to ensure that there are no missing records. For missing data points, interpolation or prediction methods based on historical data can be used to fill them. Second, check the data for outliers, such as sudden surges or drops in water consumption, which may be caused by equipment failure or entry errors. Reasonable processing of outliers ensures the authenticity of the data.
[0070] After data collection and preprocessing, the current water consumption and average number of people data are organized and stored in the database. These data will serve as the basic data for correcting the current water consumption in the subsequent steps. Through real-time monitoring and data preprocessing, the high quality and reliability of the data can be ensured.
[0071] Step S5: Determine the current weather data corresponding to the current preset time period and the historical weather data corresponding to the historical preset time period.
[0072] Specifically, first, obtain the current weather data for the current preset time period through the campus weather station or the public weather service platform. The current weather data includes the current average temperature and the current average humidity. The weather station can provide real-time temperature and humidity data, while the public weather service platform can obtain this data through the API interface. Collect and record these weather data regularly within a preset time period (such as one day, one week, or one month) to ensure the real-time and accuracy of the data.
[0073] Next, obtain the historical weather data corresponding to the current time period through the historical data archive or meteorological data platform. Historical weather data includes historical average temperature and historical average humidity. Historical data can be obtained by accessing the database of the campus meteorological station or the historical data interface of the public meteorological platform. Select historical data of the same season or date as the current time period to ensure the rationality of the comparison.
[0074] In order to ensure the accuracy and completeness of the data, the collected weather data needs to be preprocessed. First, check the integrity of the data to ensure that there are no missing records. For missing data points, interpolation or data based on adjacent time periods can be used to fill them. Second, check the data for outliers, such as sudden temperature or humidity changes, which may be caused by equipment failure or recording errors. Reasonable processing of outliers ensures the authenticity of the data.
[0075] After data collection and preprocessing, the current weather data and historical weather data are organized and stored in the database. These data will serve as important input variables for correcting current water consumption in subsequent steps. With accurate weather data, we can better understand the impact of weather factors on water consumption, thereby improving accuracy in water consumption prediction and correction.
[0076] Step S6: Based on the current weather data, historical weather data, each current average number of people and each historical average number of people, the current water consumption is corrected to obtain the corrected water consumption corresponding to each campus building.
[0077] Specifically, the purpose of implementing step S6 is to correct the current water consumption based on the current weather data, historical weather data, each current average number of people, and each historical average number of people, and obtain the corrected water consumption corresponding to each campus building. The calculation of the corrected water consumption can more accurately reflect the actual situation, thereby improving the accuracy and reliability of water management.
[0078] In one possible implementation, refer to Figure 4 , which shows a fourth flow chart of a water meter water volume monitoring method based on the Internet of Things provided in an embodiment of the present application. Step S6 specifically includes steps S61-S64: Step S61: Based on the current average temperature and the historical average temperature, obtain the temperature change rate.
[0079] Specifically, the temperature change rate is calculated in the following manner: temperature change rate = (current average temperature - historical average temperature) / historical average temperature.
[0080] Step S62: Based on the current average humidity and the historical average humidity, obtain the humidity change rate.
[0081] Specifically, the humidity change rate is calculated in the following manner: humidity change rate = (current average humidity - historical average humidity) / historical average humidity.
[0082] Step S63: Based on each current average number of people and each historical average number of people, obtain the population change rate corresponding to each campus building.
[0083] Specifically, the rate of change of the number of people is calculated in the following way: rate of change of the number of people = (current average number of people - historical average number of people) / historical average number of people.
[0084] Step S64: Based on the temperature change rate, humidity change rate and the change rate of each number of people, the current water consumption is corrected to obtain the corrected water consumption corresponding to each campus building.
[0085] Specifically, In a possible implementation, step S64 specifically includes the following steps: The corrected water consumption for each campus building is calculated using the following formula: SU m =CU m ×(1+aΔT+βΔH+γΔP m ); Among them, SU i is the corrected water consumption corresponding to the mth campus building, CU i is the current water consumption corresponding to the mth campus building, ΔT is the temperature change rate, ΔH is the humidity change rate, ΔP iis the population change rate corresponding to the mth campus building, α is the first correction coefficient, β is the second correction coefficient, and γ is the third correction coefficient.
[0086] Specifically, the first correction coefficient, the second correction coefficient and the third correction coefficient. These correction coefficients can be determined by fitting historical data or empirical values, reflecting the degree of influence of various factors on water consumption. Through the above formula, the influencing factors of weather changes and population changes can be effectively introduced into the correction of current water consumption, so that the corrected water consumption can more accurately reflect the actual water use situation and avoid errors caused by relying solely on historical data or current data. By comprehensively considering changes in temperature, humidity and population, the accuracy of water consumption prediction and management is improved.
[0087] Step S7: When the corrected water consumption corresponding to the current campus building is greater than the water consumption threshold corresponding to the current campus building, water consumption monitoring and early warning are performed on the current campus building.
[0088] Specifically, for each campus building, read its corrected water consumption and water consumption threshold. If the corrected water consumption is greater than the water consumption threshold, the abnormal situation is recorded and the early warning system is triggered. The early warning system can notify in a variety of ways, including email, SMS reminders, and alarm prompts on the real-time monitoring platform. The early warning information should include detailed information such as the specific building name, time period, corrected water consumption and water consumption threshold, and the magnitude of the threshold exceeded, so that managers can quickly locate the problem and take corresponding measures.
[0089] Reference Figure 5, which shows a schematic diagram of the structure of a water meter water volume monitoring system based on the Internet of Things provided by an embodiment of the present application, the system includes an acquisition module 1, a processing module 2 and a water use monitoring and early warning module 3; the acquisition module 1 is used to obtain the historical water use of each campus building within the campus range within a historical preset time period, and obtain the historical average number of people in each campus building within the historical preset time period; the processing module 2 is used to determine the building type corresponding to each campus building; the processing module 2 is also used to obtain the water use threshold corresponding to each campus building based on each historical water use, each building type and each historical average number of people; the acquisition module 1 is also used to obtain the current water use of each campus building within the current preset time period, and obtain the current average number of people in each campus building within the current preset time period; the processing module 2 is also used to determine the current weather data corresponding to the current preset time period and the historical weather data corresponding to the historical preset time period; the processing module 2 is also used to correct the current water use based on the current weather data, the historical weather data, each current average number of people and each historical average number of people, and obtain the corrected water use corresponding to each campus building; the water use monitoring and early warning module 3 is used to monitor and early warning the current campus building when the corrected water use corresponding to the current campus building is greater than the water use threshold corresponding to the current campus building.
[0090] In a possible implementation, the processing module 2 is further used to preprocess multiple historical water consumption to obtain multiple preprocessed historical water consumption, and to preprocess multiple historical average number of people to obtain multiple preprocessed historical average number of people; the processing module 2 is further used to extract building type characteristics corresponding to each building type, and to extract time type characteristics corresponding to each historical preset time period; the processing module 2 is further used to use multiple preprocessed historical water consumption as target variables, and use multiple preprocessed historical average number of people, multiple building type characteristics, and multiple time type characteristics as input variables to train a regression model; the processing module 2 is further used to input each building type characteristic and each time type characteristic into the trained regression model to obtain the predicted water consumption corresponding to each campus building in each historical preset time period; the processing module 2 is further used to obtain the water consumption threshold corresponding to each campus building based on each predicted water consumption and each historical water consumption.
[0091] In a possible implementation, processing module 2 is also used to subtract each predicted water consumption from each historical water consumption to obtain the water consumption residual corresponding to each campus building; processing module 2 is also used to calculate the water consumption residual standard deviation corresponding to each campus building based on each water consumption residual; processing module 2 is also used to calculate the water consumption threshold corresponding to each campus building based on each water consumption residual standard deviation and each predicted water consumption.
[0092] In a possible implementation, the processing module 2 is further used to calculate the standard deviation of each water consumption residual using the following formula: Among them, σ r is the standard deviation of water consumption residual, n is the number corresponding to the water consumption residual, r i is the i-th water consumption residual; processing module 2 is also used to calculate each water consumption threshold through the following formula: Y = X + 3σ r ; where Y is the water consumption threshold, X is the residual standard deviation of water consumption, σ r is the residual standard deviation of water consumption.
[0093] In a possible implementation, processing module 2 is further used to obtain the temperature change rate based on the current average temperature and the historical average temperature; processing module 2 is further used to obtain the humidity change rate based on the current average humidity and the historical average humidity; processing module 2 is further used to obtain the population change rate corresponding to each campus building based on each current average number of people and each historical average number of people; processing module 2 is further used to correct the current water consumption based on the temperature change rate, the humidity change rate and the various population change rates to obtain the corrected water consumption corresponding to each campus building.
[0094] In a possible implementation manner, the processing module 2 is further used to calculate the corrected water consumption corresponding to each campus building through the following formula: SU m =CU m ×(1+αΔT+βΔH+γΔP m );where SU i is the corrected water consumption corresponding to the mth campus building, CU i is the current water consumption corresponding to the mth campus building, ΔT is the temperature change rate, ΔH is the humidity change rate, ΔP i is the population change rate corresponding to the mth campus building, α is the first correction coefficient, β is the second correction coefficient, and γ is the third correction coefficient.
[0095] It should be noted that: when the device provided in the above embodiment realizes its function, only the division of the above functional modules is used as an example. In actual application, the above functions can be assigned to different functional modules as needed, that is, the internal structure of the device is divided into different functional modules to complete all or part of the functions described above. In addition, the device and method embodiments provided in the above embodiment belong to the same concept, and the specific implementation process is detailed in the method embodiment, which will not be repeated here.
[0096] The present application also discloses an electronic device. Figure 6 , Figure 6The electronic device 600 may include: at least one processor 601 , at least one network interface 604 , a user interface 603 , a memory 605 , and at least one communication bus 602 .
[0097] The communication bus 602 is used to realize the connection and communication between these components.
[0098] The user interface 603 may include a display screen (Display) and a camera (Camera), and the optional user interface 603 may also include a standard wired interface and a wireless interface.
[0099] The network interface 604 may optionally include a standard wired interface or a wireless interface (such as a WI-FI interface).
[0100] Among them, the processor 601 may include one or more processing cores. The processor 601 uses various interfaces and lines to connect various parts in the entire server, and executes various functions of the server and processes data by running or executing instructions, programs, code sets or instruction sets stored in the memory 605, and calling data stored in the memory 605. Optionally, the processor 601 can be implemented in at least one hardware form of digital signal processing (Digital Signal Processing, DSP), field programmable gate array (Field-Programmable Gate Array, FPGA), and programmable logic array (Programmable Logic Array, PLA). The processor 601 can integrate one or more combinations of a central processing unit (Central Processing Unit, CPU), a graphics processor (Graphics Processing Unit, GPU) and a modem. Among them, the CPU mainly processes the operating system, user interface and application programs; the GPU is responsible for rendering and drawing the content to be displayed on the display screen; the modem is used to process wireless communications. It can be understood that the above-mentioned modem may not be integrated into the processor 601, and it can be implemented by a single chip.
[0101] Among them, the memory 605 may include a random access memory (Random Access Memory, RAM) and may also include a read-only memory (Read-Only Memory). Optionally, the memory 605 includes a non-transitory computer-readable storage medium. The memory 605 can be used to store instructions, programs, codes, code sets or instruction sets. The memory 605 may include a program storage area and a data storage area, wherein the program storage area may store instructions for implementing an operating system, instructions for at least one function (such as a touch function, a sound playback function, an image playback function, etc.), instructions for implementing the above-mentioned method embodiments, etc.; the data storage area may store data involved in the above-mentioned method embodiments, etc. The memory 605 may optionally be at least one storage device located away from the aforementioned processor 601. Refer to Figure 6 , the memory 605 as a computer-readable storage medium may include an operating system, a network communication module, a user interface module and an application program.
[0102] exist Figure 6 In the electronic device 600 shown, the user interface 603 is mainly used to provide an input interface for the user and obtain the data input by the user; and the processor 601 can be used to call an application stored in the memory 605, and when executed by one or more processors 601, the electronic device 600 executes one or more methods in the above-mentioned embodiments. It should be noted that for the aforementioned method embodiments, for the sake of simple description, they are all expressed as a series of action combinations, but those skilled in the art should know that the present application is not limited by the described order of actions, because according to the present application, certain steps can be performed in other orders or simultaneously. Secondly, those skilled in the art should also know that the embodiments described in the specification are all preferred embodiments, and the actions and modules involved are not necessarily required for the present application.
[0103] In the above embodiments, the description of each embodiment has its own emphasis. For parts that are not described in detail in a certain embodiment, reference can be made to the relevant descriptions of other embodiments.
[0104] In the several embodiments provided in this application, it should be understood that the disclosed devices can be implemented in other ways. For example, the device embodiments described above are only schematic, such as the division of units, which is only a logical function division. There may be other division methods in actual implementation, such as multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some service interfaces, and the indirect coupling or communication connection of devices or units can be electrical or other forms.
[0105] The units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed on multiple network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of this embodiment.
[0106] In addition, each functional unit in each embodiment of the present application may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit. The above-mentioned integrated unit may be implemented in the form of hardware or in the form of software functional units.
[0107] If the integrated unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable memory. Based on this understanding, the technical solution of the present application, or the part that contributes to the prior art, or all or part of the technical solution can be embodied in the form of a software product, which is stored in a memory and includes several instructions for a computer device (which can be a personal computer, server or network device, etc.) to perform all or part of the steps of the various embodiments of the present application. The aforementioned memory includes: various media that can store program codes, such as USB flash drives, mobile hard drives, magnetic disks or optical disks.
[0108] The above are only exemplary embodiments of the present disclosure and cannot be used to limit the scope of the present disclosure. That is, any equivalent changes and modifications made according to the teachings of the present disclosure are still within the scope of the present disclosure. After considering the disclosure of the specification and the truth of practice, those skilled in the art will easily think of other embodiments of the present disclosure.
[0109] This application is intended to cover any variation, use or adaptation of the present disclosure, which follows the general principles of the present disclosure and includes common knowledge or customary technical means in the art not described in the present disclosure. The description and examples are to be regarded as exemplary only, and the scope and spirit of the present disclosure are defined by the claims.
Claims
1. A water meter water volume monitoring method based on the Internet of Things, It is characterized in that The method comprises: Obtain the historical water consumption of each campus building within the campus area within a historical preset time period, and obtain the historical average number of people in each campus building within the historical preset time period; Determine the building type corresponding to each of the campus buildings; Based on each of the historical water consumption, each of the building types and each of the historical average number of people, obtain a water consumption threshold corresponding to each of the campus buildings; Obtaining the current water consumption of each campus building in the current preset time period, and obtaining the current average number of people in each campus building in the current preset time period; Determine the current weather data corresponding to the current preset time period and the historical weather data corresponding to the historical preset time period; based on the current weather data, the historical weather data, each of the current average number of people and each of the historical average number of people, correct the current water consumption to obtain the corrected water consumption corresponding to each of the campus buildings; When the corrected water consumption corresponding to the current campus building is greater than the water consumption threshold corresponding to the current campus building, water consumption monitoring and early warning are performed on the current campus building.
2. The method according to claim 1, It is characterized in that The obtaining of the water consumption threshold corresponding to each campus building based on each of the historical water consumption, each of the building types and each of the historical average number of people specifically includes: Preprocessing the plurality of historical water consumptions to obtain a plurality of preprocessed historical water consumptions, and preprocessing the plurality of historical average number of people to obtain a plurality of preprocessed historical average number of people; Extracting building type features corresponding to each of the building types, and extracting time type features corresponding to each of the historical preset time periods; Training a regression model by using the plurality of pre-processed historical water consumption as target variables, and the plurality of pre-processed historical average number of people, the plurality of building type characteristics, and the plurality of time type characteristics as input variables; Input each of the building type characteristics and each of the time type characteristics into the trained regression model to obtain the predicted water consumption of each of the campus buildings in each of the historical preset time periods; Based on each of the predicted water consumption and each of the historical water consumption, a water consumption threshold corresponding to each of the campus buildings is obtained.
3. The method according to claim 2, It is characterized in that The building type characteristics include: building use characteristics, building scale characteristics, building facility configuration characteristics and building use intensity characteristics.
4. The method according to claim 2, It is characterized in that The step of obtaining the water consumption threshold corresponding to each campus building based on each predicted water consumption and each historical water consumption specifically includes: Subtract each predicted water consumption from each historical water consumption to obtain the water consumption residual corresponding to each campus building; based on each water consumption residual, calculate the standard deviation of the water consumption residual corresponding to each campus building; based on each water consumption residual standard deviation and each predicted water consumption, calculate the water consumption threshold corresponding to each campus building.
5. The method according to claim 4, It is characterized in that The method of calculating the standard deviation of the water consumption residual corresponding to each campus building based on each of the water consumption residuals specifically includes: The standard deviation of each water consumption residual is calculated by the following formula: Among them, σ r is the standard deviation of the water consumption residual, n is the number corresponding to the water consumption residual, r i is the i-th water consumption residual; The calculating the water consumption threshold corresponding to each campus building based on each water consumption residual standard deviation and each predicted water consumption specifically includes: Each water consumption threshold is calculated by the following formula: Y = X + 3σ r ; Among them, Y is the water consumption threshold, X is the residual standard deviation of the water consumption, σ r is the standard deviation of the water consumption residual.
6. The method according to claim 1, It is characterized in that The current weather data includes the current average temperature and the current average humidity, and the historical weather data includes the historical average temperature and the historical average humidity; based on the current weather data, the historical weather data, the current average number of people, and the historical average number of people, the current water consumption is corrected to obtain the corrected water consumption corresponding to each campus building, specifically including: Based on the current average temperature and the historical average temperature, obtaining a temperature change rate; Based on the current average humidity and the historical average humidity, obtaining a humidity change rate; Based on each of the current average number of people and each of the historical average number of people, obtain a population change rate corresponding to each of the campus buildings; Based on the temperature change rate, the humidity change rate and each of the population change rates, the current water consumption is corrected to obtain a corrected water consumption corresponding to each of the campus buildings.
7. The method according to claim 6, It is characterized in that The current water consumption is corrected based on the temperature change rate, the humidity change rate and each of the population change rates to obtain the corrected water consumption corresponding to each of the campus buildings, specifically including: The corrected water consumption corresponding to each campus building is calculated by the following formula: SU m =CU m ×(1+aΔT+βΔH+γΔP m ); Among them, SU i is the modified water consumption corresponding to the mth campus building, CU i is the current water consumption corresponding to the mth campus building, ΔT is the temperature change rate, ΔH is the humidity change rate, ΔP i is the population change rate corresponding to the mth campus building, α is the first correction coefficient, β is the second correction coefficient, and γ is the third correction coefficient.
8. A water meter water volume monitoring system based on the Internet of Things, It is characterized in that The system includes an acquisition module, a processing module and a water use monitoring and early warning module; The acquisition module is used to acquire the historical water consumption of each campus building within the campus range within a historical preset time period, and acquire the historical average number of people in each campus building within the historical preset time period; The processing module is used to determine the building type corresponding to each of the campus buildings; The processing module is further used to obtain a water consumption threshold corresponding to each campus building based on each of the historical water consumption, each of the building types and each of the historical average number of people; The acquisition module is further used to acquire the current water consumption of each campus building in the current preset time period, and acquire the current average number of people in each campus building in the current preset time period; The processing module is further used to determine the current weather data corresponding to the current preset time period and the historical weather data corresponding to the historical preset time period; The processing module is further used to correct the current water consumption based on the current weather data, the historical weather data, each current average number of people and each historical average number of people, to obtain a corrected water consumption corresponding to each campus building; The water use monitoring and early warning module is used to monitor and early warning the water use of the current campus building when the corrected water use corresponding to the current campus building is greater than the water use threshold corresponding to the current campus building.
9. An electronic device, It is characterized in that The electronic device (600) comprises a processor (601), a memory (605), a user interface (603) and a network interface (604), wherein the memory (605) is used to store instructions, the user interface (603) and the network interface (604) are used to communicate with other devices, and the processor (601) is used to execute the instructions stored in the memory (605) so that the electronic device (600) executes the method according to any one of claims 1 to 7.
10. A computer-readable storage medium, It is characterized in that The computer-readable storage medium stores instructions, and when the instructions are executed, the method according to any one of claims 1 to 7 is executed.
Citation Information
Cited By
Intelligent water consumption monitoring and early warning method based on Internet of Things
CN119761661A
An intelligent water use monitoring and early warning method based on the Internet of Things
CN119761661B
Energy consumption detection system based on smart campus
CN120975370A
