Tap Water Loss Detection Method and Device Based on Internet of Things
Through multi-scale extraction of tap water loss and time-scale fusion processing, the problem of insufficient multi-scale analysis of IoT detection timing data is solved, and more accurate tap water loss detection is achieved.
Patent Information
- Application Number
- CN202510445853.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-04-10
- Publication Date
- 2025-07-25
- Estimated Expiration
- 2045-04-10
AI Technical Summary
When processing IoT detection timing data, the multi-scale analysis of IoT detection timing data is not in-depth enough, and the variation pattern of tap water loss under different time scales is not fully explored.
By performing multi-scale extraction of the IoT detection timing set of tap water loss in a known detection cycle, the tap water loss estimate network is used to infer each IoT detection timing subset, and time-scale fusion processing is performed on multiple inferred IoT detection timing subsets to obtain an inferred IoT detection timing set containing the target time scale.
The accuracy and accuracy of tap water loss detection are improved, and the tap water loss can more comprehensively reflect the situation of tap water loss during the test cycle to be tested.
Smart Images

Figure CN119939228B_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of data processing, and more particularly, to a method and device for detecting water loss in tap water based on the Internet of Things. Background Art
[0002] In the urban water supply system, accurately monitoring the water loss of tap water is crucial for reasonable water resource planning, reducing operating costs, and ensuring stable water supply. With the development of the Internet of Things technology, it has become possible to obtain water loss data of tap water through Internet of Things detection. However, how to effectively process and analyze these data to accurately grasp the water loss situation of tap water still faces many challenges.
[0003] In the field of water loss detection in tap water, when the existing technology processes the time-series data of Internet of Things detection, the multi-scale analysis of the time-series data of Internet of Things detection is not deep enough. Many methods only consider the data characteristics of a single time scale and fail to fully explore the variation law of the water loss of tap water at different time scales. Summary of the Invention
[0004] In view of this, this application provides a method and device for detecting water loss in tap water based on the Internet of Things to improve the above problems.
[0005] According to one aspect of the embodiments of this application, a method for detecting water loss in tap water based on the Internet of Things is provided. The method includes: performing multi-scale extraction processing on the Internet of Things detection time-series set of the water loss of tap water in a known detection period to obtain multiple Internet of Things detection time-series subsets with different time scales; the time scale and the Internet of Things detection time-series subset are in one-to-one correspondence, and the Internet of Things detection time-series set includes multiple loss detection results of the water loss of tap water in the known detection period; using a water loss prediction network of tap water to respectively perform inference on each of the Internet of Things detection time-series subsets to obtain multiple inferred Internet of Things detection time-series subsets of the water loss of tap water in a to-be-detected detection period; performing time-scale fusion processing on the multiple inferred Internet of Things detection time-series subsets to obtain an inferred Internet of Things detection time-series set including a target time scale, and the inferred Internet of Things detection time-series set includes the inferred loss detection results of the water loss of tap water in the to-be-detected detection period.
[0006] According to another aspect of the embodiments of the present application, a tap water loss detection device based on the Internet of Things is provided. The device includes: a multi-scale extraction module, configured to perform multi-scale extraction processing on the set of Internet of Things detection time series of the tap water loss amount in a known detection period to obtain multiple subsets of Internet of Things detection time series with different time scales; the time scale and the subsets of Internet of Things detection time series are in one-to-one correspondence, and the set of Internet of Things detection time series includes multiple loss detection results of the tap water loss amount in the known detection period; a subset inference module, configured to use a tap water loss amount prediction network to respectively perform inference on each subset of Internet of Things detection time series to obtain multiple subsets of inferred Internet of Things detection time series of the tap water loss amount in a to-be-detected detection period; a scale fusion module, configured to perform time scale fusion processing on the multiple subsets of inferred Internet of Things detection time series to obtain a set of inferred Internet of Things detection time series including a target time scale, and the set of inferred Internet of Things detection time series includes the inferred loss detection results of the tap water loss amount in the to-be-detected detection period.
[0007] The beneficial effects of the present application at least include: The present application performs multi-scale extraction processing on the set of Internet of Things detection time series of the tap water loss amount (including multiple loss detection results of the tap water loss amount in a known detection period) to obtain multiple subsets of Internet of Things detection time series with different time scales. The time scale and the subsets of Internet of Things detection time series are in one-to-one correspondence. A tap water loss amount prediction network is used to respectively perform inference on each subset of Internet of Things detection time series to obtain multiple subsets of inferred Internet of Things detection time series of the tap water loss amount in a to-be-detected detection period. Time scale fusion processing is performed on the multiple subsets of inferred Internet of Things detection time series to obtain a set of inferred Internet of Things detection time series including a target time scale (including the inferred loss detection results of the tap water loss amount in the to-be-detected detection period). Based on the above operations, the time scale of the set of Internet of Things detection time series for inference is not limited. Inference can be performed on sets of Internet of Things detection time series with multiple time scales, multiple time scale inferences can be performed on the same set of Internet of Things detection time series, and the inference results of different time scales can be fused to obtain the final inferred tap water loss amount, and the result is more accurate. Description of the Drawings
[0008] Figure 1 is a schematic diagram of the architecture of an application environment provided by the present application;
[0009] Figure 2 is a schematic flowchart of a method for detecting tap water loss based on the Internet of Things provided by the present application;
[0010] Figure 3 is a schematic structural diagram of a tap water loss detection device based on the Internet of Things provided by an embodiment of the present application. Detailed Embodiments
[0011] To facilitate a clearer understanding of this application, the application environment for implementing the Internet of Things-based tap water loss detection method of this application is first introduced. As Figure 1 shown, the application scenario of this application includes a computer system 10 and a terminal cluster. The terminal cluster may include one or more terminals, and the number of terminals will not be limited here. As Figure 1 shown, the terminal cluster may specifically include terminals 1, 2,..., n. It can be understood that terminals 1, 2, 3,..., n can all be network-connected to the computer system 10, so that each terminal can perform data interaction with the computer system 10 through the network connection.
[0012] It can be understood that the computer system 10 may refer to a device that executes the Internet of Things-based tap water loss detection method provided in this application. Among them, the computer system 10 may be an independent physical server, or a server cluster or distributed system composed of at least two physical servers. It may also be a cloud server that provides basic cloud computing services such as cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communications, middleware services, domain name services, security services, content delivery networks (CDNs), and big data and artificial intelligence platforms. The terminal may specifically refer to a flow sensor, but is not limited thereto.
[0013] Furthermore, please refer to Figure 2 , which is a schematic flowchart of an Internet of Things-based tap water loss detection method provided by an embodiment of this application. As Figure 2 shown, this method can be executed by the Figure 1 computer system 10 in it. Among them, the Internet of Things-based tap water loss detection method may include the following steps:
[0014] Step S100: Perform multi-scale extraction processing on the Internet of Things detection time series set of the tap water loss amount in a known detection period to obtain multiple Internet of Things detection time series subsets with different time scales; the time scale and the Internet of Things detection time series subset are in one-to-one correspondence, and the Internet of Things detection time series set includes multiple loss detection results of the tap water loss amount in a known detection period.
[0015] The Internet of Things (IoT) detection time series set is a collection of detection data on the water loss of tap water arranged in chronological order. The known detection period, that is, the historical detection period with known water loss, is the past time period. Multi-scale extraction processing is a frequency decomposition operation aimed at analyzing the data characteristics in the IoT detection time series set from different time scales. The computer system can use a variety of technical means to achieve this operation. For example, wavelet transform technology can be utilized. It is a signal analysis method that realizes multi-scale analysis by decomposing a signal into sub-signals of different frequencies. Its principle is to perform a convolution operation on the original signal with a series of wavelet functions of different scales to obtain coefficients at different scales, and these coefficients represent the signal characteristics at different time scales. The specific formula is: , where are wavelet transform coefficients, is the original signal (i.e., the data in the IoT detection time series set), is the wavelet function, a is the scale parameter, and b is the translation parameter. Different values of a correspond to different time scales. By adjusting a and b, the signal can be analyzed at different time scales and positions.
[0016] Let's take a simple example to illustrate the process of multi-scale extraction and processing. Assume that the IoT detection time series set is the tap water consumption data collected every 15 minutes in a community in a day, with a total of 96 data points. Through wavelet transform, the computer system can decompose these data into different time scales. For example, by setting different scale parameters a, IoT detection time series subsets at different time scales such as hourly scale and half-day scale can be obtained. At the hourly scale, every 4 15-minute data may be merged into one data point to form a new IoT detection time series subset in hours; at the half-day scale, every 24 15-minute data may be merged into one data point to form a IoT detection time series subset in half-day units. In addition to wavelet transform, the computer system can also use the empirical mode decomposition (EMD) method for multi-scale extraction and processing. The EMD method is an adaptive signal decomposition method that decomposes a complex signal into multiple intrinsic mode functions (IMFs) and a residual function. Each IMF represents the characteristics of the signal at different time scales. The basic steps are to first determine all local maxima and minima of the signal, then obtain the upper and lower envelopes through cubic spline interpolation, calculate the average of the upper and lower envelopes, subtract the average from the original signal to obtain a new signal, and repeat this process until the new signal meets the IMF conditions. In this way, the computer system can decompose the IoT detection time series set into components of different time scales, and then obtain IoT detection time series subsets of different time scales. Through multi-scale extraction processing, the computer system can mine information from the IoT detection time series set at different time scales. The IoT detection time series subsets of different time scales contain different levels of tap water loss change characteristics. For example, the subsets of shorter time scales may reflect the fluctuations in daily water use, while the subsets of longer time scales may reflect seasonal or periodic water use patterns. These IoT detection time series subsets of different time scales provide a rich data basis for the subsequent use of the tap water loss estimation network for reasoning, which helps to improve the accuracy and comprehensiveness of the reasoning results.
[0017] When the computer system executes step S100, it performs multi-scale extraction processing on the IoT detection time series set of tap water loss in a known detection cycle through appropriate technical means (such as wavelet transform, empirical mode decomposition, etc.), and obtains multiple IoT detection time series subsets with different time scales and one-to-one matching, which lays a solid foundation for the subsequent reasoning and analysis of the tap water loss in the detection cycle to be tested.
[0018] Step S200: using the tap water loss estimation network to infer each IoT detection time series subset respectively, and obtain multiple inferred IoT detection time series subsets of tap water loss in the detection cycle to be tested.
[0019] The tap water loss estimation network can be a complex model composed of multiple IoT detection time series subset reasoning networks. These IoT detection time series subset reasoning networks can be built based on a variety of technologies, such as artificial neural networks, recurrent neural networks (RNNs) and their variants such as long short-term memory networks (LSTMs), gated recurrent units (GRUs), etc. When the computer system uses the tap water loss estimation network for reasoning, it must perform corresponding operations for each IoT detection time series subset. Assume that in a medium-sized urban tap water monitoring project, after processing in step S100, IoT detection time series subsets with different time scales of hours, days, and weeks are obtained.
[0020] For the IoT detection time series subset with hourly time scale, the computer system will use the corresponding IoT detection time series subset reasoning network for reasoning. This reasoning process is based on the fact that the IoT detection time series subset reasoning network has been trained and can learn the characteristics and rules of the tap water loss data at this time scale. For example, the reasoning network may have learned the peak and trough patterns of water consumption in different time periods on weekdays and weekends, as well as the changing trends of hourly water consumption in different seasons. The computer system inputs this IoT detection time series subset with hourly scale into the corresponding IoT detection time series subset reasoning network. The network calculates according to its internal weights and algorithms, and outputs a temporary reasoning IoT detection time series subset. This temporary reasoning IoT detection time series subset contains the preliminary reasoning results of the reasoning network on the tap water loss in the test cycle to be tested with hourly scale. The test cycle to be tested is the time period for which the tap water loss prediction is required, that is, a time period in the future.
[0021] Similarly, for the IoT detection time series subset with a time scale of days, the computer system uses another IoT detection time series subset reasoning network specially trained for the day scale for reasoning. This network may capture the influence of certain special dates of each month (such as near the bill settlement date) and holidays on the daily tap water loss. After the IoT detection time series subset is input, it is calculated and processed within the network to output a temporary reasoning IoT detection time series subset with a time scale of days, which represents the reasoning of the reasoning network on the daily tap water loss in the test cycle to be tested.
[0022] The IoT detection time series subset with a weekly time scale will also go through a similar process. The corresponding IoT detection time series subset reasoning network will take into account the comprehensive water usage patterns of different working days and rest days in a week, as well as the impact of some periodic water usage events on the weekly tap water loss. After inputting the IoT detection time series subset, a temporary reasoning IoT detection time series subset with a weekly scale is obtained.
[0023] After obtaining these temporary reasoning IoT detection timing subsets, the computer system also needs to consider the reliability and importance of each temporary reasoning IoT detection timing subset, which involves obtaining the influence coefficient corresponding to each temporary reasoning IoT detection timing subset. For example, the neural network algorithm mentioned above can be used to predict the network influence coefficient of the IoT detection timing subset reasoning network. Taking the training of a classification fusion neural network as an example, it can determine which IoT detection timing subset reasoning network has the most reliable output under different circumstances by learning a large amount of historical data, thereby assigning the network influence coefficient of the network to 1, while the network influence coefficients of other IoT detection timing subset reasoning networks are 0. Another way is to train a regression fusion neural network and assign corresponding network influence coefficients to each IoT detection timing subset reasoning network according to its performance. Assume that the trained regression fusion neural network analysis finds that the IoT detection time series subset reasoning network based on hours is more accurate in predicting the recent tap water loss under certain specific circumstances, so it may be given a higher influence coefficient, such as 0.8; while the IoT detection time series subset reasoning network based on weeks has a slightly lower prediction accuracy under the same circumstances, so it may be given an influence coefficient of 0.3.
[0024] The computer system adjusts multiple temporary reasoning IoT detection time series subsets based on these acquired influence coefficients. For example, for temporary reasoning IoT detection time series subsets based on hours, multiply each data point by 0.8; for temporary reasoning IoT detection time series subsets based on weeks, multiply each data point by 0.3. Through this adjustment, the reliability and importance of the IoT detection time series subset reasoning network at different time scales are comprehensively considered, so that the adjusted results can more accurately reflect the actual situation. Finally, the computer system determines the adjusted results as the reasoning IoT detection time series subset of tap water loss in the test cycle to be tested.
[0025] Step S300: Perform time scale fusion processing on multiple inference IoT detection time series subsets to obtain an inference IoT detection time series set containing a target time scale, wherein the inference IoT detection time series set includes an inference loss detection result of tap water loss in a detection cycle to be tested.
[0026] After step S200, the computer system has obtained multiple inference IoT detection time series subsets at different time scales. For example, in a tap water monitoring system in a city, there may be an inference IoT detection time series subset with an hourly time scale, which reflects the hourly tap water loss inference situation; there is also an inference IoT detection time series subset with a daily time scale, presenting the daily loss inference data; and an inference IoT detection time series subset with a weekly time scale, showing the weekly loss inference results. These subsets at different time scales reflect the variation law of tap water loss from different perspectives, but a single subset cannot comprehensively and accurately present the overall situation.
[0027] Time scale fusion processing is the key operation in this step. Its purpose is to integrate the information at these different time scales to obtain a comprehensive result that better meets the actual needs and includes the target time scale. The computer system can use a variety of technical means to achieve this operation. For example, the weighted average method can be used for fusion. The principle of the weighted average method is to assign corresponding weights to different inference IoT detection time series subsets according to their importance or reliability, and then achieve fusion by calculating the weighted average value. The specific formula is: , where F is the fused result, is the weight of the i-th inference IoT detection time series subset, is the data value of the i-th inference IoT detection time series subset, and n is the number of inference IoT detection time series subsets.
[0028] To determine the weights of each inference IoT detection time series subset, the computer system first obtains the subset influence coefficients corresponding to each inference IoT detection time series subset. This process can be achieved based on various methods.
[0029] For example, through the analysis and comparison of historical data, evaluate the fitting degree of each inference IoT detection time series subset at each time scale to the actual tap water loss situation in the past. If the inference IoT detection time series subset with a daily time scale accurately reflected the actual daily loss situation many times in the past, then its subset influence coefficient (weight) can be set relatively high; conversely, if a subset at a certain time scale deviates greatly from the actual situation, its weight will be correspondingly reduced.
[0030] Suppose in the above urban tap water monitoring case, the computer system analyzes and obtains that the subset influence coefficient of the inference IoT detection time series subset on a daily time scale is 0.5, the subset influence coefficient on a weekly time scale is 0.3, and the subset influence coefficient on an hourly time scale is 0.2. When performing time scale fusion processing, for a specific time point (such as a certain day in the detection period to be measured), the computer system will calculate according to the formula of the weighted average method. If the inference loss detection result on an hourly scale for this day is s1, the result on a daily scale is s2, and the result on a weekly scale is s3, then the fused inference loss detection result F for this day = (0.2×s1 + 0.5×s2 + 0.3×s3) / (0.2 + 0.5 + 0.3).
[0031] In addition to the weighted average method, the computer system can also adopt a model-based fusion method. For example, construct a fusion model, which can be a neural network model. Take multiple inference IoT detection time series subsets as inputs, and after multiple layers of calculations and learning inside the model, output an inference IoT detection time series set containing the target time scale. This fusion model needs to be trained in advance using a large amount of historical data so that it can automatically learn the relationships and weight allocation methods between the inference IoT detection time series subsets of different time scales, thereby achieving more accurate fusion.
[0032] In actual operation, the computer system first obtains the subset influence coefficients corresponding to each inference IoT detection time series subset, which provides the basis and foundation for subsequent fusion. Then, based on these coefficients, appropriate fusion technical means (such as the weighted average method or the model-based fusion method) are used to adjust and integrate multiple inference IoT detection time series subsets. Finally, an inference IoT detection time series set containing the target time scale is obtained. The inference loss detection results in this set comprehensively integrate information from multiple time scales and more comprehensively and accurately reflect the situation of tap water loss in the detection period to be measured.
[0033] As an implementation method, in step S100, perform multi-scale extraction processing on the IoT detection time series set of the tap water loss amount in the known detection period to obtain multiple IoT detection time series subsets with different time scales, including:
[0034] Step S110: Perform null value diagnosis on the IoT detection time series set to obtain a diagnosis result;
[0035] Step S120: If the diagnosis result indicates that the IoT detection time series set has null values, then perform null value filling on the IoT detection time series set to obtain the target IoT detection time series set, and perform multi-scale extraction processing on the target IoT detection time series set to obtain multiple IoT detection time series subsets with different time scales;
[0036] Step S130: If the diagnosis result indicates that the IoT detection time series set does not have null values, perform multi-scale extraction processing on the IoT detection time series set to obtain multiple IoT detection time series subsets with different time scales.
[0037] In step S110, the computer system performs null value diagnosis on the IoT detection time series set to obtain a diagnosis result. The IoT detection time series set is a set of tap water loss detection data arranged in chronological order, and each loss detection result contains information such as the corresponding acquisition node. The computer system can implement null value diagnosis by analyzing the time series characteristics of the data in the IoT detection time series set. For example, use the autocorrelation function (ACF) and partial autocorrelation function (PACF) in time series analysis to observe the periodicity and correlation of the data. The formula for the autocorrelation function is: , where is the autocorrelation coefficient at lag k, is the autocovariance at lag k, is the variance. The partial autocorrelation function measures the direct correlation between two variables after removing the influence of intermediate variables. By calculating these functions, the computer system can initially determine whether there are abnormal time intervals or missing patterns in the data, and thus infer whether there are null values.
[0038] For example, assume that the IoT detection time series set contains tap water loss data collected every 15 minutes in a certain area for a week. The computer system first analyzes these data using the autocorrelation function and partial autocorrelation function. If the data shows a stable periodicity, such as an obvious peak and trough cycle of water use every 24 hours, and the autocorrelation coefficient decays rapidly after a certain lag order, and the partial autocorrelation coefficient truncates after a certain order, this indicates that the time series characteristics of the data are relatively normal. Conversely, if abnormal fluctuations are found in the autocorrelation coefficient or partial autocorrelation coefficient, or the periodicity is not obvious, it may imply the existence of null values.
[0039] In step S120, if the diagnosis result indicates that the IoT detection time series set has null values, the computer system will fill the null values in the set to obtain a target IoT detection time series set, and then perform multi-scale extraction processing on the target IoT detection time series set to obtain multiple IoT detection time series subsets with different time scales. There are various methods for filling null values. A feasible method is the mean filling method, that is, calculate the average value of the existing loss detection results in the IoT detection time series set, and then fill the null value positions with this average value. The formula is: , where is the average value, is the i-th non-null loss detection result, and n is the number of non-null data.
[0040] Continuing with the above case as an example, assume that after null value diagnosis, it is found that the data between 10:00 and 10:30 am on Tuesday is missing. The computer system uses the mean filling method to calculate the average of the tap water loss amounts collected every 15 minutes during other time periods within a week in this area. Assume the average value is 5 cubic meters (this is only an example assumption here). Then, at the two missing data positions (10:00 and 10:15), data of 5 cubic meters are filled, thus obtaining the target IoT detection time series set. After that, the computer system performs multi-scale extraction processing on this target IoT detection time series set. For example, using wavelet transform technology (the principle and formula have been introduced in detail above), the data is decomposed into different time scales to obtain IoT detection time series subsets with time scales such as hours and days.
[0041] In addition to the mean filling method, the computer system can also use linear interpolation method for null value filling. The linear interpolation method estimates the null value based on the linear relationship between two adjacent known data points. Assume that the times corresponding to two adjacent data points are , and the time corresponding to the null value to be filled is t. Then the calculation formula for the null value x is: . For example, if the data at 10:00 is 4 cubic meters and the data at 10:30 is 6 cubic meters, and the null value at 10:15 needs to be filled, calculated according to the linear interpolation method, = 5 cubic meters.
[0042] In step S130, if the diagnosis result indicates that the IoT detection time series set does not have null values, the computer system directly performs multi-scale extraction processing on this IoT detection time series set to obtain multiple IoT detection time series subsets with different time scales. In this case, due to the guarantee of data integrity, the multi-scale extraction processing can more accurately reflect the characteristics of the data at different time scales.
[0043] For example, in the tap water monitoring of another smaller area, the IoT detection time series set contains the tap water loss amount data collected at every whole hour every day within a month. After null value diagnosis, the computer system determines that there are no null values in this set. At this time, the computer system directly performs multi-scale extraction processing on this IoT detection time series set, and the empirical mode decomposition (EMD) method can be used. The EMD method decomposes the signal into multiple intrinsic mode functions (IMFs) and a residual function, and each IMF represents the characteristics of the signal at different time scales. The computer system decomposes this IoT detection time series set into components with different time scales through the EMD method, for example, obtaining IoT detection time series subsets with time scales such as several days and one week. These subsets can respectively reflect the change characteristics of tap water loss amounts at different levels such as short-term fluctuations and medium-term trends.
[0044] By properly using time series analysis methods, such as autocorrelation function and partial autocorrelation function, the computer system can more accurately determine whether there are null values in the IoT detection time series set. For the presence of null values, using appropriate null value filling methods, such as mean filling method, linear interpolation method, etc., can effectively fill in the missing data, so that the subsequent multi-scale extraction processing can proceed smoothly. For the absence of null values, directly performing multi-scale extraction processing can make full use of the complete data information and dig out the changing rules of tap water loss at different time scales.
[0045] As an implementation mode, each loss detection result included in the IoT detection time series set includes a corresponding acquisition node. Step S110, performing null value diagnosis on the IoT detection time series set to obtain a diagnosis result, includes:
[0046] Step S111: periodically identifying the IoT detection time series set, obtaining a target time interval, and determining a reference time difference between two acquisition nodes of the loss detection results in the IoT detection time series set according to the target time interval;
[0047] Step S112: for two random adjacent loss detection results in the IoT detection time series set, obtain the real time difference between the collection nodes of the two random adjacent loss detection results;
[0048] Step S113: if the target real time difference is greater than the reference time difference, a diagnosis result indicating that the IoT detection timing set has a null value is obtained;
[0049] Step S114: If there is no target real time difference greater than the reference time difference, a diagnosis result indicating that the IoT detection timing set does not have a null value is obtained.
[0050] In step S111, the computer system performs periodic identification on the IoT detection time series set, obtains the target time interval, and determines the reference time difference between the acquisition nodes of the two loss detection results in the IoT detection time series set based on the target time interval. Periodic identification is the process of analyzing whether there is a repetitive pattern with a fixed time interval in the time series data. The computer system can use a variety of technical means to achieve this operation, such as Fourier transform. The formula for Fourier transform is: ,in, is the frequency domain representation after Fourier transform, is the original time series (i.e., the data in the Internet of Things detection time series set), n is the index of the time series, N is the total number of data points, k is the frequency index, e is the natural constant, and i is the imaginary unit. Through Fourier transform, the computer system can transform the Internet of Things detection time series set in the time domain to the frequency domain, find the frequency corresponding to the peak in the frequency domain, and the reciprocal of this frequency is the possible period. For example, in the monitoring of the water loss of tap water in a community, the Internet of Things detection time series set records the loss data collected at regular intervals over a period of time. The computer system applies Fourier transform to process these data, obtains the frequency domain result through calculation, and finds an obvious peak at a specific frequency. Assuming this frequency is f, then the period T = 1 / f, and this T is the initially identified possible period.
[0051] In addition to Fourier transform, the computer system can also use autocorrelation analysis to determine periodicity. The autocorrelation function (ACF) is used to measure the correlation between a time series and itself at different time lags. Its formula is: , where, is the autocorrelation coefficient at lag k value, x t is the value of the time series at time t, is the mean value of the time series, and n is the total number of data points. The computer system calculates the autocorrelation coefficients at different lag k values. When the autocorrelation coefficients show obvious periodic fluctuations at certain specific k values, the time intervals corresponding to these k values may be the periods. For example, after calculation, it is found that the autocorrelation coefficient has an obvious peak at k = 24 (assuming the data collection interval is 1 hour, which means 24 hours here) and shows a periodic pattern, then it can be inferred that the Internet of Things detection time series set may have the characteristic of a 24-hour period.
[0052] After determining the target time interval, the computer system determines the reference time difference between the acquisition nodes of the two loss detection results in the Internet of Things detection time series set based on this target time interval. For example, if the target time interval is determined to be 24 hours through the above method and the data is collected at a fixed interval, assuming the data is collected every 1 hour, then the reference time difference between the acquisition nodes of the two loss detection results is 1 hour.
[0053] In step S112, for any two randomly selected adjacent loss detection results in the IoT detection time series set, the computer system obtains the true time difference between the acquisition nodes of these two adjacent loss detection results. During actual data acquisition, due to various factors such as device failures and network delays, there may be deviations in the acquisition times of adjacent loss detection results. The computer system calculates the actual time interval, i.e., the true time difference, between two adjacent acquisition nodes by reading the acquisition time information attached to each loss detection result. For example, in the IoT detection time series set, there are two adjacent loss detection results. The acquisition time of the first result is 10:00 am, and the acquisition time of the second result is 11:05 am. Then the true time difference between the acquisition nodes of these two adjacent loss detection results is 65 minutes.
[0054] In step S113, if there is a target true time difference greater than the reference time difference, the computer system obtains a diagnostic result indicating that the IoT detection time series set has null values. This is because in a system with a fixed acquisition period, if the time difference between adjacent acquisition nodes is significantly greater than the normal reference time difference, it is very likely that there is data missing during this relatively long time interval. For example, if the previously determined reference time difference is 1 hour, and when checking adjacent loss detection results, it is found that the true time difference between two adjacent results is 2 hours, this indicates that there may be at least one missing data point between these two acquisition nodes, that is, the IoT detection time series set has null values. The computer system determines that the IoT detection time series set has null values by comparing the true time differences of all adjacent loss detection results with the reference time difference. Once a situation where the true time difference is greater than the reference time difference is found, it is determined that the IoT detection time series set has null values.
[0055] In step S114, when there is no target true time difference greater than the reference time difference, the computer system obtains a diagnostic result indicating that the IoT detection time series set does not have null values. That is to say, when the computer system checks the true time differences between the acquisition nodes of all adjacent loss detection results in the IoT detection time series set and finds that all true time differences are within a reasonable range, that is, not greater than the reference time difference, then it can be considered that there are no null value situations in the IoT detection time series set. For example, after checking one by one, the true time differences between the acquisition nodes of all adjacent loss detection results are between 0.9 - 1.1 hours (due to possible time errors in actual situations), and the reference time difference is 1 hour. In this case, the computer system can determine that the IoT detection time series set does not have null values.
[0056] By determining the reference time difference through periodic identification, the computer system can establish a benchmark for judging the integrity of data. Then, by comparing the actual time difference with the reference time difference, possible null value situations in the data can be accurately detected. This not only helps with subsequent data processing and analysis to ensure the accuracy of the results, but also timely alerts the staff to check and maintain the data acquisition system to avoid incorrect judgments and decision-making mistakes caused by missing data.
[0057] As an implementation manner, the IoT detection time series set includes multiple loss detection result pairs, and each loss detection result pair includes two randomly adjacent loss detection results in the IoT detection time series set. Based on this, step S111 of performing periodic identification on the IoT detection time series set to obtain a target time interval includes:
[0058] Step S1111: For each loss detection result pair, determine the time difference between the acquisition nodes of the two adjacent loss detection results in the loss detection result pair;
[0059] Step S1112: If the time differences corresponding to multiple loss detection result pairs are the same, determine the target time interval according to the time difference;
[0060] Step S1113: If the time differences corresponding to multiple loss detection result pairs are different, determine the adjusted calculation result of the multiple time differences, and determine the target time interval according to the adjusted calculation result.
[0061] In step S1111, the computer system determines, for each loss detection result pair in the IoT detection time series set, the time difference between the acquisition nodes of the two adjacent loss detection results in each loss detection result pair. Each loss detection result pair is composed of two randomly adjacent loss detection results in the IoT detection time series set. To achieve this operation, the computer system first extracts all the loss detection result pairs from the IoT detection time series set. For example, in the scenario of monitoring the water loss of tap water in a small community, the IoT detection time series set records the water loss data of tap water collected every 15 minutes within a day, with a total of 96 data points, thus forming 95 loss detection result pairs.
[0062] The computer system accurately calculates the time difference between the acquisition nodes of the two adjacent loss detection results in each pair by reading the acquisition time information attached to each loss detection result. Specifically, if the acquisition time of the first loss detection result is 8:00 am and the acquisition time of the second loss detection result is 8:15 am, then the time difference between the acquisition nodes of these two adjacent loss detection results is 15 minutes. The computer system will perform this operation on all 95 loss detection result pairs in sequence to obtain a series of time difference data.
[0063] After calculating the time differences of all the loss detection result pairs, step S1112 is entered. In this step, the computer system analyzes the time differences corresponding to multiple loss detection result pairs. If the time differences corresponding to multiple loss detection result pairs are the same, this means that the IoT detection time series set exhibits obvious periodic characteristics, and the computer system then determines the target time interval based on this same time difference. Continuing with the above example of a small community, if the computer system calculates and finds that the time difference of all 95 loss detection result pairs is 15 minutes, then the target time interval can be determined to be 15 minutes. This indicates that the water loss data collection in this community is strictly periodic, and data is collected every 15 minutes.
[0064] If all the time differences are equal, then this equal time difference is the target time interval. This simple and direct method can quickly and effectively determine the target time interval when the data volume is small and the periodicity is obvious. However, the actual situation is often more complex. In many scenarios, the time differences corresponding to multiple loss detection result pairs may not be the same. At this time, step S1113 is entered. When faced with multiple different time differences, the computer system needs to determine the adjusted calculation result of these time differences, such as calculating their greatest common divisor. The greatest common divisor can be calculated using the Euclidean algorithm, and the formula is expressed as: for two positive integers a and , where gcd represents the greatest common divisor, and a mod b represents the remainder of a divided by b. By repeatedly applying this formula, the greatest common divisor of a and b can ultimately be obtained.
[0065] Through this adjusted calculation method, potential periodic patterns can be extracted from complex time difference data. Even if there are some irregularities in the data collection process, by calculating adjustment methods such as the greatest common divisor, a suitable time interval can still be found to reflect the periodic characteristics of the data. This target time interval is of great significance for subsequent determination of the reference time difference and judgment of whether there are null values in the IoT detection time series set.
[0066] In an actual water loss detection project, the accurate execution of steps S1111 - S1113 can help the computer system deeply analyze the periodic characteristics of the IoT detection time series set. By determining the target time interval, key basic information is provided for the entire data processing flow. If the target time interval is determined inaccurately, it may lead to incorrect judgment of the subsequent reference time difference, and further affect the judgment of whether there are null values in the IoT detection time series set.
[0067] As an implementation method, step S120, filling null values in the IoT detection time series set to obtain the target IoT detection time series set, includes:
[0068] Step S121: According to the reference time difference, fill in the missing target acquisition nodes between the two acquisition nodes corresponding to the target real time difference, and set the data corresponding to the target acquisition nodes as missing values;
[0069] Step S122: Determine the water loss data corresponding to the target acquisition nodes according to the null value filling strategy, and replace the missing values with the water loss data.
[0070] In step S121, the computer system fills in the missing target acquisition nodes between the two acquisition nodes corresponding to the target real time difference according to the reference time difference, and sets the data corresponding to the target acquisition nodes as missing values. The reference time difference is determined by the computer system through periodic identification and analysis of the IoT detection time series set in the previous step, and it represents the time interval between adjacent acquisition nodes under normal circumstances. The target real time difference is the actual time interval greater than the reference time difference found by the computer system when checking the acquisition nodes of adjacent loss detection results in the IoT detection time series set.
[0071] For example, in a water loss monitoring project in a small town, the computer system determines through preliminary analysis that the reference time difference is 1 hour. When checking the IoT detection time series set, it is found that the target real time difference between two adjacent acquisition nodes of loss detection results is 3 hours. This means that there is at least two hours of data missing between these two acquisition nodes. The computer system inserts two target acquisition nodes evenly between these two acquisition nodes according to the reference time difference. Assuming that the time of the previous acquisition node is 10 am and the time of the next acquisition node is 1 pm, then the computer system will insert two target acquisition nodes at 11 am and 12 noon. At the same time, set the data corresponding to these two newly inserted target acquisition nodes as missing values to mark that the data at these positions needs further processing.
[0072] The computer system can identify the positions of the target real time difference by traversing the IoT detection time series set. For each such position, calculate the number and positions of the target acquisition nodes to be inserted according to the reference time difference. For example, if the target real time difference is T real , and the reference time difference is T ref , then the number of target acquisition nodes to be inserted (assuming is an integer multiple of, if not, appropriate rounding is required). Then, insert these target acquisition nodes between the two acquisition nodes before and after at equal intervals, and set the corresponding data as a specific missing value identifier, such as "null" or other custom symbols representing missing.
[0073] After completing the insertion of the target acquisition node and setting the missing values, step S122 is entered. In this step, the computer system determines the tap water loss data corresponding to the target acquisition node according to the null value filling strategy, and replaces the missing values with this tap water loss data. There can be various ways of the null value filling strategy, such as the mean filling method, the linear interpolation method, the model-based prediction method, etc.
[0074] The mean filling method is a relatively simple and direct strategy. The computer system calculates the average value of the existing tap water loss data in the IoT detection time series set, and then uses this average value to fill all the missing values. The linear interpolation method estimates the missing values based on the linear relationship between two adjacent known data points. Suppose the times corresponding to two adjacent data points x1 and x2 are t1 and t2 respectively, and the time corresponding to the missing value to be filled is t, then the calculation formula for the missing value x is: 。
[0075] The model-based prediction method is relatively more complex and accurate. The computer system can use machine learning or deep learning models, such as linear regression models, decision tree models, recurrent neural networks (RNN), etc., to learn and train the existing data to establish a model that can predict the tap water loss. Then, this model is used to predict the missing values, and the prediction results are used as the filling values. Taking the linear regression model as an example, its basic formula is: , where y is the predicted tap water loss, are the coefficients of the model, are the input feature variables (such as related factors like time, date, weather, etc.), is the error term. The computer system first collects various feature data related to the tap water loss, and uses it together with the known tap water loss data as the training set to train the linear regression model to obtain the coefficients of the model. Then, for the inserted target acquisition node, according to its corresponding time and other feature information, it is input into the trained model for prediction to obtain the predicted tap water loss, and this is used as the filling value to replace the missing values. By executing steps S121 - S122, the null values in the IoT detection time series set can be effectively filled to obtain the target IoT detection time series set. This not only ensures the integrity of the data, provides a reliable data basis for subsequent multi-scale extraction processing and analysis, but also reduces the errors and inaccurate results caused by data missing.
[0076] As an implementation manner, each loss detection result included in the IoT detection time series set includes a corresponding acquisition node. The IoT detection time series set includes multiple loss detection result pairs. A loss detection result pair includes two randomly adjacent loss detection results in the IoT detection time series set. Based on this, in step S110, null value diagnosis is performed on the IoT detection time series set, and the obtained diagnosis result includes:
[0077] Step S1101: For each loss detection result pair, determine the time difference between the acquisition nodes of the two adjacent loss detection results in the loss detection result pair;
[0078] Step S1102: If the time differences corresponding to multiple loss detection result pairs are the same, obtain a diagnosis result indicating that the IoT detection time series set does not have null values;
[0079] Step S1103: If the time differences corresponding to multiple loss detection result pairs are different, obtain a diagnosis result indicating that the IoT detection time series set has null values.
[0080] In step S1101, the computer system determines the time difference between the acquisition nodes of two adjacent loss detection results in each loss detection result pair in the IoT detection time series set. A loss detection result pair is composed of two randomly adjacent loss detection results in the IoT detection time series set. To implement this operation, the computer system first traverses the entire IoT detection time series set and divides the data therein into loss detection result pairs according to the adjacent relationship.
[0081] For example, in a tap water loss monitoring system in a city, the IoT detection time series set records tap water loss data collected every 30 minutes within a week. The computer system processes these data in sequence and forms a pair of every two adjacent loss detection results. Suppose in the first pair, the acquisition time of the first loss detection result is 8:00 am on Monday, and the acquisition time of the second loss detection result is 8:30 am on Monday. Then the computer system will calculate the time difference between the acquisition nodes of the two adjacent loss detection results in this pair as 30 minutes. Then the computer system will continue to process the next pair, and so on until all loss detection result pairs are processed, thereby obtaining a series of time difference data.
[0082] After calculating the time differences of all the loss detection result pairs, in step S1102, the computer system analyzes the time differences corresponding to multiple loss detection result pairs. If the time differences corresponding to multiple loss detection result pairs are the same, this indicates that the IoT detection time series set has good periodicity, the data collection is carried out at fixed time intervals, and there is no abnormal time interval situation. Therefore, the computer system can obtain a diagnostic result indicating that the IoT detection time series set does not have null values.
[0083] Continuing with the above example of the urban tap water loss monitoring system, if the computer system calculates and finds that the time difference corresponding to all loss detection result pairs is 30 minutes, this indicates that the collection time interval of this IoT detection time series set is very regular, and there is no null value situation that may be caused by abnormal time intervals. This method of judgment based on the consistency of time differences can quickly and effectively determine the integrity of the IoT detection time series set when the data collection process is relatively stable and the equipment is operating normally. It provides a simple and direct way for the computer system to evaluate the quality of data, ensuring that subsequent data processing and analysis can be based on complete and reliable data. However, in actual tap water loss monitoring, due to various factors such as the failure of data collection equipment, network transmission problems, or external environmental interference, the time differences corresponding to multiple loss detection result pairs may not be the same. This leads to step S1103.
[0084] When the computer system finds that the time differences corresponding to multiple loss detection result pairs are not the same, it means that the collection time interval of the IoT detection time series set has become abnormal. This abnormality may be due to the omission or delay of data collection during certain time periods, resulting in inconsistent time intervals between adjacent data, which implies that there may be null values in the IoT detection time series set. Therefore, the computer system will obtain a diagnostic result indicating that the IoT detection time series set has null values.
[0085] By comparing and analyzing the time difference data one by one, the computer system can keenly capture this abnormal change in the time interval. Once different time differences are found, it can be determined that the IoT detection time series set has null values. This judgment is very crucial for subsequent data processing because the existence of null values may affect the accuracy and reliability of the entire data analysis.
[0086] If in the tap water loss monitoring of a large enterprise, the IoT detection time series set contains a large amount of data. By performing these three steps, the computer system can timely detect abnormal situations in the data collection process. If it is determined that the IoT detection time series set has null values, the enterprise can timely check the problems of data collection equipment and the network, and supplement or correct the missing data, so as to ensure the accuracy and reliability of subsequent analysis of the tap water loss situation.
[0087] The computer system executes steps S1101 - S1103, and by analyzing the acquisition node time differences of the loss detection result binary tuples in the IoT detection time series set, it provides an effective method for determining whether the IoT detection time series set has null values.
[0088] As another implementation, in step S100, a multi-scale extraction process is performed on the IoT detection time series set of the tap water loss amount in a known detection period to obtain multiple IoT detection time series subsets with different time scales, including:
[0089] Step S1001: Obtain the acquisition nodes of each loss detection result included in the IoT detection time series set, and obtain multiple different time intervals for the multi-scale extraction process, where the time intervals and time scales are in one-to-one correspondence;
[0090] Step S1002: For each time interval, integrate multiple loss detection results over the time interval according to the acquisition nodes to obtain an integration set corresponding to the time interval;
[0091] Step S1003: Determine the integration sets corresponding to multiple time intervals as multiple IoT detection time series subsets with different time scales.
[0092] In step S1001, the computer system obtains the acquisition nodes of each loss detection result included in the IoT detection time series set, and obtains multiple different time intervals for the multi-scale extraction process, and the time intervals and time scales are in one-to-one correspondence. The IoT detection time series set is a set of tap water loss amount detection data arranged in chronological order, and each loss detection result is associated with acquisition node information, and these acquisition nodes record the data acquisition time. The computer system can accurately extract the acquisition node information corresponding to each loss detection result by reading the data structure of the IoT detection time series set. For example, in a tap water loss monitoring project in a medium-sized city, the IoT detection time series set covers the tap water loss data collected every 15 minutes in multiple areas of the city within a week. The computer system can directly read each loss detection result record from the data storage structure (such as a database table or a file), and parse the corresponding acquisition node identifiers from it. These identifiers may be specific geographical location information (such as a certain water supply point in a certain street in a certain district) or the numbers of the acquisition devices, etc.
[0093] At the same time, the computer system also obtains multiple different time intervals for the multi-scale extraction process. These time intervals are preset according to the analysis requirements and data characteristics, and different time intervals correspond to different time scales.
[0094] In step S1002, for each time interval, the computer system integrates multiple loss detection results based on the acquisition nodes over that time interval to obtain an integration set corresponding to the time interval. The core of this step is to regroup and summarize the data in the IoT detection time series set according to different time intervals.
[0095] Still taking the above-mentioned urban tap water loss monitoring project as an example, for a 30-minute time interval, the computer system traverses all the loss detection results in the IoT detection time series set. Suppose a certain acquisition node has a loss detection result at 8:00 and another at 8:15. Since both results are within the 30-minute time interval from 8:00 to 8:30, the computer system will integrate these two loss detection results. The integration method can be simple summation, averaging, or other statistical operations.
[0096] For all acquisition nodes, the computer system will, in the same way, integrate their loss detection results within each 30-minute time interval. In this way, for all acquisition nodes in the whole city, an integration result set with a 30-minute time interval is obtained. For other time intervals, such as 1 hour, 3 hours, etc., the computer system will also perform similar operations. Taking a 1-hour time interval as an example, suppose a certain acquisition node has loss detection results at 8:00, 8:15, 8:30, and 8:45. The computer system will integrate these four results into a comprehensive result for this acquisition node within the 1-hour time interval from 8:00 to 9:00.
[0097] Finally, entering step S1003, the computer system determines the integration sets corresponding to multiple time intervals as multiple IoT detection time series subsets with different time scales. After step S1002, the computer system has generated corresponding integration sets for each preset time interval. These integration sets respectively reflect the change situation of the tap water loss amount from different time scales.
[0098] Continuing with the previous urban tap water loss monitoring project as an example, the integration set with a 30-minute time interval, the integration set with a 1-hour time interval, the integration set with a 3-hour time interval, etc. are respectively determined as IoT detection time series subsets with different time scales. These subsets have different time granularities. The subset with a 30-minute time scale can reflect the high-frequency fluctuation situation of the tap water loss amount in a short time and is suitable for analyzing short-term change rules such as daily water use; the subset with a 1-hour time scale smooths the data to a certain extent and can better reflect the overall loss trend per hour; while subsets with longer time scales such as 3 hours and 6 hours can be used to observe the loss patterns in a longer time period, such as different water use rules on weekdays and weekends.
[0099] In this way, the computer system divides the original IoT detection time series set into multiple scales according to different time intervals, and obtains multiple IoT detection time series subsets with different time scales. These subsets provide rich perspectives for subsequent data analysis and processing, and can meet analysis needs at different levels.
[0100] The computer system executes steps S1001-S1003, obtains collection nodes and multiple time intervals, integrates the IoT detection time series set by time interval, and finally determines it as multiple IoT detection time series subsets with different time scales, providing a comprehensive and rich data foundation for in-depth analysis and accurate prediction of tap water loss. This multi-scale extraction and processing method helps to mine the characteristics and laws of data in different time dimensions, improve the accuracy and effectiveness of tap water loss detection, and thus better support urban water supply management and decision-making.
[0101] As an implementation mode, the tap water loss estimation network includes multiple IoT detection time series subset reasoning networks; step S200, using the tap water loss estimation network, respectively reasoning each IoT detection time series subset, and obtaining multiple reasoning IoT detection time series subsets of tap water loss in the detection cycle to be tested, including:
[0102] For each IoT detection timing subset, complete the following steps:
[0103] Step S210: for each IoT detection timing subset inference network, use the IoT detection timing subset inference network to infer the IoT detection timing subset, and obtain a temporary inference IoT detection timing subset corresponding to the IoT detection timing subset;
[0104] Step S220: Obtaining the influence coefficient corresponding to each temporary reasoning IoT detection time series subset;
[0105] Step S230: According to the influence coefficient corresponding to each temporary reasoning IoT detection timing subset, multiple temporary reasoning IoT detection timing subsets are adjusted to obtain adjustment results, and the adjustment results are determined as the reasoning IoT detection timing subset of the tap water loss in the detection cycle to be tested.
[0106] In step S210, the computer system uses the IoT detection timing subset reasoning network to reason about each IoT detection timing subset, so as to obtain a temporary reasoning IoT detection timing subset corresponding to the IoT detection timing subset. The IoT detection timing subset reasoning network is a model specially designed for processing IoT detection timing subsets of a specific time scale. It can be constructed based on a variety of machine learning or deep learning algorithms, such as artificial neural networks, recurrent neural networks (RNNs) and their variants, long short-term memory networks (LSTMs), gated recurrent units (GRUs), etc.
[0107] For example, after the multi-scale extraction process in step S100, an IoT detection time series subset with an hourly time scale is obtained. The computer system uses an IoT detection time series subset inference network constructed based on LSTM to infer this subset. The LSTM network has the ability to handle long-term and short-term dependencies in time series data, and its core structure includes an input gate, a forget gate, an output gate, and a memory unit.
[0108] During the inference process, the computer system arranges the IoT detection time series subset with an hourly scale according to the input requirements of the LSTM network. Suppose this subset contains data on the hourly water loss of tap water in the past week. The computer system inputs this data into the LSTM network hour by hour. The LSTM network calculates the input data for each time step according to the weights and parameters it has learned internally. For specific details, reference can be made to the relevant introduction above, and it will not be elaborated here. Through such a calculation process, the LSTM network infers the entire IoT detection time series subset with an hourly scale and outputs a corresponding temporary inference IoT detection time series subset. This temporary subset contains the preliminary inference results of the LSTM network on the hourly water loss of tap water in the detection period to be measured.
[0109] For IoT detection time series subsets with other time scales, such as subsets with a daily time scale, the computer system will use another IoT detection time series subset inference network specifically trained for the daily scale to perform similar inference operations. This network may be constructed based on GRU. GRU simplifies the structure of LSTM and can also effectively process time series data. The computer system inputs the IoT detection time series subset with a daily scale into the GRU network. After internal calculation and processing by the network, it outputs a temporary inference IoT detection time series subset with a daily scale, which reflects the inference of the GRU network on the daily water loss of tap water in the detection period to be measured.
[0110] After completing the inference of each IoT detection time series subset and obtaining the corresponding temporary inference IoT detection time series subsets, step S220 is entered. In this step, the computer system needs to obtain the influence coefficients corresponding to each temporary inference IoT detection time series subset. These influence coefficients are used to measure the importance or reliability of each temporary inference IoT detection time series subset in the final result.
[0111] A computer system can obtain these influence coefficients in various ways. For example, by analyzing and comparing historical data, the prediction accuracy of each inference network for the Internet of Things detection time series subset in the past for the actual water loss of tap water is evaluated. If an inference network for the Internet of Things detection time series subset on an hourly scale accurately predicted the hourly water loss of tap water many times in the past, then the influence coefficient of its corresponding temporary inference Internet of Things detection time series subset can be set relatively high; conversely, if the prediction error of an inference network on a certain time scale is large, its influence coefficient will be correspondingly reduced.
[0112] Another way to obtain the influence coefficient is to use machine learning algorithms for prediction. For example, train a classification fusion neural network. The input of this network is the output results of multiple inference networks for the Internet of Things detection time series subsets and related feature information, and the output is the reliability evaluation of each inference network, that is, the influence coefficient. During the training process, the classification fusion neural network will learn the performance of different inference networks in different situations, so as to allocate appropriate influence coefficients for each temporary inference Internet of Things detection time series subset. Continuing with the previous example, by analyzing the water loss data of tap water in the past few months, it is found that the inference network for the Internet of Things detection time series subset on an hourly scale has a higher prediction accuracy on weekdays, while the inference network on a daily scale is more accurate in grasping the overall trend on weekends. Based on this analysis, the computer system may set the influence coefficient of the temporary inference Internet of Things detection time series subset on an hourly scale to 0.7 on weekdays and 0.4 on weekends; set the influence coefficient of the temporary inference Internet of Things detection time series subset on a daily scale to 0.3 on weekdays and 0.6 on weekends.
[0113] After obtaining the influence coefficients corresponding to each temporary inference Internet of Things detection time series subset, in step S230, the computer system adjusts multiple temporary inference Internet of Things detection time series subsets based on these influence coefficients to obtain an adjustment result, and determines this adjustment result as the inference Internet of Things detection time series subset of the water loss of tap water in the detection period to be measured. The adjustment process is a weighted fusion process. Multiply each data point in each temporary inference Internet of Things detection time series subset by its corresponding influence coefficient, and then perform operations such as summarization or averaging to obtain the final inference Internet of Things detection time series subset.
[0114] The computer system calculates in this way for all time points, so as to obtain the adjusted result, that is, the inference Internet of Things detection time series subset of the water loss of tap water in the detection period to be measured. This inference Internet of Things detection time series subset synthesizes the inference information of multiple time scales and is weighted and fused according to the reliability of the inference results of each time scale, so it can more accurately reflect the situation of the water loss of tap water in the detection period to be measured.
[0115] By performing steps S210 - S230, the computer system can fully utilize the advantages of the inference network of the IoT detection time - series subsets at different time scales, combine the reliability of each inference result, and obtain a more accurate inference IoT detection time - series subset of the water loss in the detection cycle to be measured through weighted fusion. This process not only considers the change characteristics of the water loss at different time scales but also reasonably integrates the inference results of each scale through influence coefficients, improving the accuracy and reliability of the inference.
[0116] As an implementation, step S220, obtaining the influence coefficients corresponding to each temporary inference IoT detection time - series subset, includes:
[0117] For each inference network of the IoT detection time - series subset, the following steps are respectively completed:
[0118] Step S221: Using a neural network algorithm, predict the network influence coefficient of the inference network of the IoT detection time - series subset to obtain the inference network influence coefficient of the inference network of the IoT detection time - series subset;
[0119] Step S222: Determine the inference network influence coefficient of the inference network of the IoT detection time - series subset as the influence coefficient corresponding to the temporary inference IoT detection time - series subset output by the inference network of the IoT detection time - series subset.
[0120] In step S221, the computer system uses a neural network algorithm to predict the network influence coefficient of the inference network of the IoT detection time - series subset to obtain the inference network influence coefficient of the inference network of the IoT detection time - series subset. The neural network algorithm is a powerful machine - learning tool composed of a large number of neurons. By learning a large amount of data, it can automatically extract features and patterns in the data. Feasible types of neural networks include feed - forward neural networks, convolutional neural networks (CNNs), recurrent neural networks (RNNs) and their variants, etc. Different types of neural networks are suitable for different types of data and tasks.
[0121] First, the computer system collects a large amount of historical data as the training set. This historical data includes not only the IoT detection time - series subsets at different time scales but also the corresponding actual water loss data and other relevant information that may affect the loss, such as weather data, holiday information, etc. For example, for the hourly - scale IoT detection time - series subset, the training set contains the records of the water loss per hour in the past few months, as well as information such as the weather conditions of the day (sunny, cloudy, rainy, etc.) and whether it is a working day.
[0122] The computer system preprocesses this data to make it meet the input requirements of the classification and fusion neural network. For example, different types of data are encoded and normalized. For weather data, one-hot encoding may be used to convert it into a numerical form that can be processed by a computer; for water loss data, normalization may be performed to make its value between 0 and 1 to improve the training effect of the neural network.
[0123] Next, the computer system constructs a classification and fusion neural network. This network usually includes an input layer, multiple hidden layers, and an output layer. The number of neurons in the input layer is determined according to the number of features of the input data. For example, if the input data includes an hourly-scale IoT detection time series subset, a daily-scale IoT detection time series subset, a weekly-scale IoT detection time series subset, as well as information such as weather and holidays, with a total of n features, then the input layer has n neurons.
[0124] The hidden layer is the key part of the neural network for learning data features. In the hidden layer, neurons receive inputs from the previous layer through weighted connections and perform non-linear transformations through activation functions. Feasible activation functions include the sigmoid function , the ReLU function ReLU(x) = max(0, x), etc. For example, in a certain hidden layer, neuron j receives the input xi from neuron i in the previous layer, with its weight being w ij , and the bias being b j , then the output y j of this neuron can be calculated by the formula (taking the sigmoid function as an example here).
[0125] The number of neurons in the output layer is the same as the number of IoT detection time series subset inference networks to be predicted. In this example, there are three IoT detection time series subset inference networks (corresponding to the hourly, daily, and weekly scales respectively), so the output layer has three neurons. The neurons in the output layer receive the outputs from the hidden layer through weighted connections and convert the outputs into a probability distribution form through an activation function (such as the softmax function). The formula for the softmax function is , where, is the input to the j-th neuron in the output layer, and K is the total number of neurons in the output layer. Through the softmax function, each neuron in the output layer outputs a value between 0 and 1, and the sum of these values is 1, which respectively represent the reliability probabilities of each inference network of the IoT detection time series subset, that is, the inference network influence coefficient. The computer system uses the training set to train the classification fusion neural network. During the training process, the network continuously adjusts the weights and biases to make the prediction results as close as possible to the actual reliability of the IoT detection time series subset inference network. The training process usually adopts the backpropagation algorithm, which propagates backward from the output layer to the input layer according to the error between the prediction result and the actual result, and gradually adjusts the weights and biases. For example, assuming the error between the prediction result and the actual result is E, according to the chain rule, the gradients of each weight and bias are calculated, and then the gradient descent algorithm (such as stochastic gradient descent, Adagrad, Adadelta, etc.) is used to update the weights and biases.
[0126] After multiple trainings, when the prediction error of the classification fusion neural network reaches a certain threshold (such as the mean squared error is less than a certain set value) or the training reaches a certain number of epochs, the training ends. At this time, the classification fusion neural network has learned the performance of different IoT detection time series subset inference networks under different circumstances and can accurately predict their network influence coefficients. For example, after training, for a specific set of input data (such as the IoT detection time series subset for a certain period of time and related weather, holiday, etc. information), the values of the three neurons output by the classification fusion neural network are 0.8, 0.1, and 0.1 respectively. This means that in this case, the inference network influence coefficient of the hourly-scale IoT detection time series subset inference network is 0.8, the daily-scale is 0.1, and the weekly-scale is 0.1. This indicates that in the current situation, the hourly-scale inference network is considered the most reliable, and its inference results should account for a larger proportion in the final integration.
[0127] After completing the prediction of the network influence coefficient of the IoT detection time series subset inference network, step S222 is entered. In this step, the computer system determines the inference network influence coefficient of the IoT detection time series subset inference network as the influence coefficient corresponding to the temporary inference IoT detection time series subset output by the IoT detection time series subset inference network.
[0128] Continuing with the above-mentioned urban tap water loss monitoring project as an example, the computer system determines the inference network influence coefficient of 0.8 of the hourly-scale IoT detection time series subset inference network predicted by the classification fusion neural network as the influence coefficient of the temporary inference IoT detection time series subset output by the inference network; determines the inference network influence coefficient of 0.1 of the day-scale inference network as the influence coefficient of its corresponding temporary inference IoT detection time series subset; and determines the inference network influence coefficient of 0.1 of the weekly-scale inference network as the influence coefficient of its corresponding temporary inference IoT detection time series subset.
[0129] In this way, the computer system assigns an influence coefficient reflecting its reliability to each temporary reasoning IoT detection time series subset. These influence coefficients will be used to adjust multiple temporary reasoning IoT detection time series subsets in subsequent steps, so that when integrating the reasoning results of different time scales, they can be reasonably weighted and fused according to the reliability of each subset, thereby improving the accuracy of the final reasoning result.
[0130] In practical applications, the implementation of steps S221-S222 enables the computer system to dynamically evaluate the reliability of the reasoning network of different IoT detection timing subsets, and assign appropriate influence coefficients to the temporary reasoning IoT detection timing subsets it outputs. This process makes full use of the powerful learning and prediction capabilities of the neural network algorithm and considers the impact of multiple factors on the reliability of the reasoning network. Through the training of a large amount of historical data, the classification fusion neural network can automatically learn the performance of each reasoning network under different circumstances, thereby providing a scientific basis for the determination of the influence coefficient.
[0131] As an implementation mode, step S300 performs time scale fusion processing on multiple inference IoT detection time series subsets to obtain an inference IoT detection time series set containing a target time scale, including:
[0132] Step S310: Obtaining the subset influence coefficient corresponding to each inference IoT detection time series subset;
[0133] Step S320: According to the subset influence coefficient corresponding to each inference IoT detection timing subset, multiple inference IoT detection timing subsets are adjusted to obtain an inference IoT detection timing set including a target time scale.
[0134] The computer system executes steps S310-S320 in the implementation method of step S300, with the purpose of obtaining the subset influence coefficient corresponding to each inference IoT detection timing subset, and adjusting multiple inference IoT detection timing subsets according to these coefficients, thereby obtaining an inference IoT detection timing set containing a target time scale, which can more accurately reflect the situation of tap water loss in the detection cycle to be tested.
[0135] In step S310, the computer system obtains the subset influence coefficients corresponding to each inference IoT detection time series subset. The inference IoT detection time series subset is the result inferred by the IoT detection time series subset inference network at different time scales after step S200. These subsets reflect the characteristics of the water loss of tap water from different time dimensions, but their importance in the overall analysis may vary. Therefore, it is necessary to determine their respective influence coefficients.
[0136] There are various ways for the computer system to determine the subset influence coefficients. A commonly used method is the accuracy evaluation based on historical data. The computer system will compare and analyze the past inference results of each inference IoT detection time series subset with the actual tap water loss data. For example, in a tap water loss monitoring project in a city, the inference IoT detection time series subsets at hourly, daily, and weekly time scales have been obtained. The computer system will collect the actual tap water loss data over a past period (such as the past three months) and the inference results of these three time-scale inference IoT detection time series subsets during the same period.
[0137] For the inference IoT detection time series subset at the hourly scale, the computer system calculates the error between each inference data point and the actual loss data point. The mean squared error (MSE) formula can be used to measure the error.
[0138] Similarly, for the inference IoT detection time series subsets at the daily scale and the weekly scale, their mean squared errors MSE 天 and MSE 周 are calculated respectively. Then, the subset influence coefficients are determined according to the magnitude of the error. The smaller the error, the closer the inference result of the inference IoT detection time series subset is to the actual situation, and the higher its influence coefficient. For example, the following formula can be used to calculate the subset influence coefficient: .
[0139] In this way, the computer system can assign corresponding subset influence coefficients to each inference IoT detection time series subset according to their performance in historical data. For example, the calculation results may show that the coefficient of the inference IoT detection time series subset at the hourly scale is 0.6, at the daily scale is 0.3, and at the weekly scale is 0.1. This indicates that in the past actual situation, the inference results at the hourly scale are relatively more accurate and have a greater impact on the overall analysis. In addition to the accuracy evaluation based on historical data, the computer system can also determine the subset influence coefficients through expert experience.
[0140] After obtaining the subset influence coefficients corresponding to each inference IoT detection time series subset, step S320 is entered. In this step, the computer system adjusts multiple inference IoT detection time series subsets based on the subset influence coefficients corresponding to each of them, and obtains an inference IoT detection time series set including the target time scale.
[0141] The adjustment process is a weighted fusion process. For each time point, the computer system multiplies the inference loss amount at this time point in each inference IoT detection time series subset by its corresponding subset influence coefficient, and then sums them up.
[0142] The computer system performs such calculations for each time point in the detection period to be measured, so as to obtain a new inference IoT detection time series set, which is the inference IoT detection time series set including the target time scale. For example, in the above urban tap water loss monitoring project, for a certain day in the detection period to be measured, after weighted fusion of the inference loss amounts for each hour according to the corresponding subset influence coefficients, the complete inference loss amount data for this day is obtained. These data integrate inference information of different time scales and more accurately reflect the tap water loss situation on this day.
[0143] By executing steps S310 - S320, the computer system can comprehensively consider the importance and accuracy of inference IoT detection time series subsets of different time scales, integrate them together in a weighted fusion manner, and obtain a more comprehensive and accurate inference IoT detection time series set. This process not only utilizes the advantages of data of different time scales, but also ensures that the contributions of each subset are properly reflected in the final result through reasonable coefficient allocation.
[0144] As an implementation manner, before step S200, when using a tap water loss amount prediction network to perform inferences on each IoT detection time series subset respectively, the method further includes:
[0145] For each IoT detection time series subset, the following steps are respectively completed:
[0146] Step S200A: Perform multi-scale extraction on the IoT detection time series subset to obtain a target seasonal component, a target abnormal situation component, and a target other component; among them, the abnormal situation corresponding to the target abnormal situation component has an impact on the loss detection result of the tap water loss amount in the trigger period of the abnormal situation.
[0147] Step S200, performing inferences on each IoT detection time series subset respectively, includes:
[0148] Step S201: Perform inferences on the target other components of each IoT detection time series subset respectively.
[0149] In step S200A, the computer system performs multi-scale extraction on the IoT detection time series subset to obtain the target seasonal component, the target abnormal condition component, and the target other component. The IoT detection time series subset is obtained through preprocessing and represents the water loss data sequence at a specific time scale. The purpose of multi-scale extraction is to deeply mine the information of the data at different time granularities and feature levels, so as to more carefully analyze and understand the laws and characteristics of water loss.
[0150] The computer system can implement multi-scale extraction in a variety of implementation ways. One commonly used method is the technology based on spectral analysis. For example, the Fourier transform (FT) is a mathematical tool that converts a time-domain signal into a frequency-domain representation, and its formula refers to the previous introduction. Through the Fourier transform, the computer system can transform the IoT detection time series subset from the time domain to the frequency domain. In the frequency domain, different frequency components correspond to changes at different time scales. Low-frequency components are usually related to trends at longer time scales, while high-frequency components reflect fluctuations in the short term. The computer system can identify the frequency components related to seasonal changes by analyzing the peaks and spectral distributions in the frequency domain, and then determine the target seasonal component. In addition to the Fourier transform, the computer system can also use the wavelet transform (WT) for multi-scale extraction. The wavelet transform can analyze signals at different resolutions, and it decomposes the signal into wavelet coefficients at different frequencies and positions. The formula for the continuous wavelet transform (CWT) please refer to the previous introduction and will not be elaborated here. In the example of this small town, using the wavelet transform, by selecting appropriate wavelet functions and scale parameters, it is possible to more precisely capture the seasonal changes and possible abnormal conditions in the water loss data. For example, at certain scales, it is found that some local wavelet coefficients increase abnormally, which may correspond to the abnormal condition component in the data.
[0151] Through these multi-scale extraction techniques, the target seasonal component, the target abnormal condition component, and the target other component can be separated from the IoT detection time series subset. The target seasonal component reflects the periodic law of the water loss volume over time. For example, the loss volume increases in summer due to the increase in residents' water use, and the relatively low seasonal change in winter. The target abnormal condition component represents the part of the data that does not conform to the normal pattern, such as abnormal fluctuations in the loss volume caused by sudden pipeline leaks, large water use equipment failures, etc. The target other component contains other information except for seasonality and abnormal conditions, which may be some random noise or short-term fluctuations that have not been clearly classified.
[0152] After completing step S200A, enter sub-step S201 of step S200. In this step, the computer system respectively infers the target other components of each IoT detection timing subset. Since the target other components do not contain the separated seasonal and abnormal situation information, inferring them can focus more on mining the potential and stable trends and patterns in the data.
[0153] The computer system can adopt various inference methods, such as regression models based on machine learning. In addition to linear regression models, the computer system can also use more complex machine learning models, such as decision trees, support vector machines (SVMs), or neural networks, etc. Taking neural networks as an example, it can automatically learn the complex non-linear relationships in the data. A simple feedforward neural network consists of an input layer, a hidden layer, and an output layer. The input layer receives the feature variables related to the target other components, the hidden layer transforms and extracts features from the input through non-linear activation functions (such as the ReLU function: ReLU(x) = max(0, x)), and the output layer gives the inference result. The computer system trains the neural network with a large amount of historical data, adjusts the weights and biases of the network, so that it can accurately infer the target other components.
[0154] In practical applications, the execution of steps S200A and S201 helps to improve the accuracy of tap water loss inference. Through multi-scale extraction of the IoT detection timing subset in step S200A, components with different features are separated, enabling the computer system to better understand the internal structure and laws of the data. And in step S201, inferring the target other components can exclude the interference of seasonal and abnormal situations, focus on mining the stable trends and potential patterns in the data, thus providing a more accurate and reliable basis for subsequent comprehensive inference.
[0155] For example, in a tap water loss monitoring project in a large city, the IoT detection timing subset contains a large amount of data. Through step S200A, the computer system can accurately identify seasonal components, such as the peak water consumption caused by high temperatures in summer and the relatively low water consumption in winter; and at the same time, discover some abnormal situation components, such as a sudden increase in loss volume in a certain area due to pipeline maintenance in the short term. In step S201, inferring the target other components can discover some long-existing but not obvious patterns, such as the differences in water usage patterns between weekdays and weekends. Combining these pieces of information can help the water supply management department more comprehensively and accurately understand the tap water loss situation, formulate more reasonable water supply plans, resource allocation strategies, and equipment maintenance plans, thereby improving the utilization efficiency of water resources and reducing unnecessary losses.
[0156] As an implementation mode, step S200A performs multi-scale extraction on the IoT detection time series subset to obtain target seasonal components, target abnormal situation components, and target other components, including:
[0157] Step S200A1: performing a first multi-scale extraction on the IoT detection time series subset to obtain a first target seasonal component, a first abnormal situation component, and a first other component;
[0158] Step S200A2: filtering out the first abnormal situation component in the IoT detection time series subset to obtain a first other IoT detection time series subset, and performing a second multi-scale extraction on the first other IoT detection time series subset to obtain a second target seasonal component and a second other component;
[0159] Step S200A3: filtering out the second target seasonal component in the IoT detection time series subset to obtain a second other IoT detection time series subset, and performing a third multi-scale extraction on the second other IoT detection time series subset to obtain a second abnormal situation component and a third other component;
[0160] Step S200A4: Determine the second target seasonal component as the target seasonal component, determine the second abnormal situation component as the target abnormal situation component, and determine the third other component as the target other component.
[0161] In step S200A1, the computer system performs a first multi-scale extraction on the IoT detection time series subset to obtain a first target seasonal component, a first abnormal situation component, and a first other component. Multi-scale extraction aims to analyze data from different time scales and frequency characteristics to mine various information components hidden in the data. The computer system can use the empirical mode decomposition (EMD) method to implement this operation. The EMD method is an adaptive signal decomposition technology that decomposes a complex signal into multiple intrinsic mode functions (IMFs) and a residual function. IMF is a component that meets certain conditions, and each IMF represents the characteristics of the signal at different time scales.
[0162] Taking the monitoring of tap water loss in a small community as an example, the IoT detection time series subset records the daily tap water loss in the community within a year. The computer system uses the EMD method to perform the first multi-scale extraction on the IoT detection time series subset. First, the computer system will determine all local maximum and minimum points in the data, obtain the upper and lower envelopes through cubic spline interpolation, calculate the average of the upper and lower envelopes, and subtract the average from the original signal to obtain a new signal. Repeat this process until the new signal meets the IMF conditions.
[0163] Suppose that after multiple decompositions, multiple IMFs and a residual function are obtained. Among them, some IMFs exhibit obvious periodic characteristics corresponding to seasonal changes during a year, and these IMFs constitute the first target seasonal component. For example, in summer, the temperature is high and the domestic water consumption increases. The corresponding IMF may show a higher amplitude of fluctuation during the summer period, reflecting the seasonal water consumption changes. Some sudden fluctuations that are significantly different from the overall pattern appear in some IMFs, and these may correspond to abnormal situations such as sudden pipeline leaks and failures of large water-using equipment, constituting the first abnormal situation component. The remaining components form the first other component, which may include some random noise or short-term fluctuations that have not been clearly classified.
[0164] In addition to the EMD method, the computer system can also use wavelet transform for the first multi-scale extraction.
[0165] After completing the first multi-scale extraction, in step S200A2, the computer system filters out the first abnormal situation component from the IoT detection time series subset to obtain the first other IoT detection time series subset, and then performs a second multi-scale extraction on the first other IoT detection time series subset to obtain the second target seasonal component and the second other component.
[0166] Continuing with the example of a small community, the computer system identifies the first abnormal situation component obtained from the first multi-scale extraction through certain algorithms and rules and removes it from the original IoT detection time series subset. This can be achieved by setting some thresholds. For example, if the amplitude of fluctuation of a certain IMF exceeds a certain standard deviation range, it is determined as the first abnormal situation component and filtered out.
[0167] After obtaining the first other IoT detection time series subset, the computer system performs multi-scale extraction again. This time, the computer system can adopt a different multi-scale extraction method from the first time, such as Fourier transform. Through Fourier transform, the computer system transforms the first other IoT detection time series subset into the frequency domain. In the frequency domain, the computer system analyzes the spectral distribution and finds the frequency components related to seasonal changes. The signal part corresponding to these frequency components is the second target seasonal component. For example, a frequency corresponding to a period of about 30 days is found in the frequency domain, which is related to the monthly periodic change. The signal corresponding to this frequency component forms the second target seasonal component after inverse Fourier transform. The remaining components form the second other component, and this part of the components may include some finer noises that have not been completely separated in the first stage or fluctuations related to other factors.
[0168] After completing the second multi-scale extraction, step S200A3 is entered. The computer system filters out the second target seasonal component from the IoT detection time series subset to obtain a second other IoT detection time series subset, and then performs a third multi-scale extraction on the second other IoT detection time series subset to obtain a second abnormal condition component and a third other component.
[0169] The computer system accurately identifies and removes the second target seasonal component from the IoT detection time series subset through specific algorithms and analyses. This may involve techniques such as correlation analysis and pattern matching of the data. For example, by comparing with known seasonal patterns, the data part that conforms to the seasonal characteristics is removed to obtain the second other IoT detection time series subset.
[0170] Then, the computer system performs a third multi-scale extraction on the second other IoT detection time series subset. This time, the computer system can use methods related to the autoregressive moving average (ARMA) model. The formula of the ARMA model is: , where is the value of the time series at time t, is the autoregressive coefficient, is the lag value of, is the moving average coefficient, is the white noise sequence, and p and q are the orders of autoregression and moving average respectively.
[0171] The computer system finds the abnormal fluctuation components in the data by performing an ARMA model analysis on the second other IoT detection time series subset. These abnormal fluctuation components may be caused by some sudden events that are difficult to explain by conventional seasonal or periodic patterns, and constitute the second abnormal condition component. For example, during the analysis, it is found that the data in a certain time period significantly deviates from the predicted value of the ARMA model, and this deviation does not conform to the normal fluctuation range, then the component corresponding to this part of the data is the second abnormal condition component. And the remaining components form the third other component, and this part of the components may be some more random noises or minor fluctuations that have not been fully analyzed.
[0172] Finally, in step S200A4, the computer system determines the second target seasonal component as the target seasonal component, the second abnormal condition component as the target abnormal condition component, and the third other component as the target other component.
[0173] In the case of monitoring the water loss of tap water in the above small community, through the multi-scale extraction and component separation in the previous three steps, the computer system finally identified the target seasonal component, the target abnormal condition component, and the target other components. After verification and confirmation, the second target seasonal component was determined to be the target seasonal component that can accurately reflect the seasonal changes in the tap water loss of the community. The water supply management department can formulate water supply plans and resource allocation strategies for different seasons based on this component. The second abnormal condition component was determined to be the target abnormal condition component, which helps to promptly detect sudden problems such as pipeline leaks and equipment failures, so as to take repair and handling measures in a timely manner. The third other component was determined to be the target other component. Although this part of the component is relatively complex and contains some fluctuations that are difficult to explain, it also has certain reference value for further in-depth analysis of the change trend and potential factors of the tap water loss volume.
[0174] By rigorously executing steps S200A1 - S200A4, the computer system can accurately obtain the target seasonal component, the target abnormal condition component, and the target other components from the IoT detection time series subset by using a variety of multi-scale extraction techniques and component separation methods, providing strong support for more accurate analysis of the tap water loss volume, thereby enhancing the scientificity and effectiveness of urban water supply management.
[0175] Please refer to Figure 3 , which is a schematic structural diagram of an IoT-based tap water loss detection device provided by an embodiment of the present application. The above IoT-based tap water loss detection device can be a computer program (including program code) running in a network device. For example, the IoT-based tap water loss detection device is an application software; this device can be used to execute the corresponding steps in the method provided by an embodiment of the present application. As Figure 3 shown, the IoT-based tap water loss detection device may include: a multi-scale extraction module 310, a subset reasoning module 320, and a scale fusion module 330.
[0176] Among them, the multi-scale extraction module 310 is used to perform multi-scale extraction processing on the IoT detection time series set of the tap water loss amount in a known detection period to obtain multiple IoT detection time series subsets with different time scales; the time scale and the IoT detection time series subset are in one-to-one correspondence, and the IoT detection time series set includes multiple loss detection results of the tap water loss amount in the known detection period; the subset inference module 320 is used to respectively perform inference on each of the IoT detection time series subsets by using a tap water loss amount prediction network to obtain multiple inferred IoT detection time series subsets of the tap water loss amount in the to-be-detected detection period; the scale fusion module 330 is used to perform time scale fusion processing on the multiple inferred IoT detection time series subsets to obtain an inferred IoT detection time series set including a target time scale, and the inferred IoT detection time series set includes the inferred loss detection results of the tap water loss amount in the to-be-detected detection period.
[0177] According to an embodiment of the present application, Figure 2 the steps involved in the IoT-based tap water loss detection method shown can be Figure 3 executed by each module in the IoT-based tap water loss detection device shown.
[0178] According to an embodiment of the present application, Figure 3 each module in the IoT-based tap water loss detection device shown can be separately or all combined into one or several units to form, or a certain one (or some) of the units can be further split into at least two sub-units with smaller functions, and the same operations can be achieved without affecting the realization of the technical effects of the embodiments of the present application. The above modules are divided based on logical functions. In actual applications, the function of one module can also be realized by at least two units, or the functions of at least two modules are realized by one unit. In other embodiments of the present application, the IoT-based tap water loss detection device may also include other units. In actual applications, these functions can also be assisted by other units and can be realized by the cooperation of at least two units.
Claims
1. A method for detecting water loss in tap water based on the Internet of Things, characterized in that, The method includes: Performing multi-scale extraction processing on the IoT detection time series set of the tap water loss amount in a known detection period to obtain multiple IoT detection time series subsets with different time scales; the time scale and the IoT detection time series subset are in one-to-one correspondence, and the IoT detection time series set includes multiple loss detection results of the tap water loss amount in the known detection period; Using a tap water loss amount prediction network to respectively perform inference on each of the IoT detection time series subsets to obtain multiple inferred IoT detection time series subsets of the tap water loss amount in a to-be-detected detection period; Performing time scale fusion processing on the multiple inferred IoT detection time series subsets to obtain an inferred IoT detection time series set including a target time scale, and the inferred IoT detection time series set includes inferred loss detection results of the tap water loss amount in the to-be-detected detection period; Among them, performing multi-scale extraction processing on the IoT detection time series set of the tap water loss amount in a known detection period to obtain multiple IoT detection time series subsets with different time scales includes: Performing null value diagnosis on the IoT detection time series set to obtain a diagnosis result; If the diagnosis result indicates that the IoT detection time series set has null values, filling the null values in the IoT detection time series set to obtain a target IoT detection time series set, and performing multi-scale extraction processing on the target IoT detection time series set to obtain multiple IoT detection time series subsets with different time scales; If the diagnosis result indicates that the IoT detection time series set does not have null values, performing multi-scale extraction processing on the IoT detection time series set to obtain multiple IoT detection time series subsets with different time scales; Each loss detection result included in the IoT detection time series set contains a corresponding acquisition node, and performing null value diagnosis on the IoT detection time series set to obtain a diagnosis result includes: Performing periodic identification on the IoT detection time series set to obtain a target time interval, and determining a reference time difference between acquisition nodes of two adjacent loss detection results in the IoT detection time series set according to the target time interval; For any two adjacent loss detection results in the IoT detection time series set, obtaining a real time difference between the acquisition nodes of the two adjacent loss detection results; If there is a target real time difference greater than the reference time difference, obtaining a diagnosis result indicating that the IoT detection time series set has null values; If there is no target real time difference greater than the reference time difference, obtaining a diagnosis result indicating that the IoT detection time series set does not have null values; The IoT detection time series set includes multiple loss detection result pairs, and the loss detection result pair includes any two adjacent loss detection results in the IoT detection time series set; performing periodic identification on the IoT detection time series set to obtain a target time interval includes: For each of the loss detection result pairs, determining a time difference between the acquisition nodes of the two adjacent loss detection results in the loss detection result pair; If the time differences corresponding to the plurality of loss detection result tuples are the same, determining the target time interval according to the time differences; If the time differences corresponding to the plurality of loss detection result tuples are different, determining the adjustment calculation results of the plurality of time differences, and determining the target time interval according to the adjustment calculation results; The step of filling the IoT detection timing set with null values to obtain a target IoT detection timing set includes: According to the reference time difference, fill in the missing target acquisition node between the two acquisition nodes before and after the target real time difference, and set the data corresponding to the target acquisition node to a missing value; According to the null value filling strategy, the tap water loss data corresponding to the target collection node is determined, and the missing value is replaced with the tap water loss data.
2. The method according to claim 1, wherein Each loss detection result included in the IoT detection time series set includes a corresponding acquisition node, the IoT detection time series set includes a plurality of loss detection result tuples, and the loss detection result tuple includes two random adjacent loss detection results in the IoT detection time series set; The performing null value diagnosis on the IoT detection time series set to obtain a diagnosis result includes: For each of the loss detection result tuples, determining a time difference between collection nodes of two adjacent loss detection results in the loss detection result tuple; If the time differences corresponding to the plurality of loss detection result tuples are the same, obtaining a diagnosis result indicating that the IoT detection timing set does not have a null value; If the time differences corresponding to the plurality of loss detection result tuples are different, a diagnostic result indicating that the IoT detection timing set has a null value is obtained.
3. The method according to claim 1, wherein The multi-scale extraction process is performed on the IoT detection time series set of the tap water loss in a known detection cycle to obtain multiple IoT detection time series subsets with different time scales, including: Acquire the collection nodes of the loss detection results included in the IoT detection time series set, and acquire a plurality of different time intervals for the multi-scale extraction process, wherein the time intervals and the time scales are matched one by one; For each of the time intervals, integrating the multiple loss detection results at the time interval according to the collection node to obtain an integrated set corresponding to the time interval; Determine the integrated sets corresponding to the multiple time intervals as the multiple IoT detection time series subsets with different time scales; The tap water loss estimation network includes multiple IoT detection time series subset reasoning networks; the tap water loss estimation network is used to reason each of the IoT detection time series subsets, respectively, to obtain multiple reasoning IoT detection time series subsets of the tap water loss in the detection cycle to be tested, including: For each of the IoT detection timing subsets, complete the following steps respectively: For each of the IoT detection timing subset inference networks, use the IoT detection timing subset inference network to infer the IoT detection timing subset to obtain a temporary inference IoT detection timing subset corresponding to the IoT detection timing subset; Obtaining the influence coefficient corresponding to each of the temporary reasoning IoT detection time series subsets; Adjust multiple temporary inference IoT detection time series subsets according to the influence coefficients corresponding to each temporary inference IoT detection time series subset to obtain an adjustment result, and determine the adjustment result as the inference IoT detection time series subset of the water loss in the to-be-detected detection period.
4. The method according to claim 3, characterized in that The obtaining of the influence coefficients corresponding to each temporary inference IoT detection time series subset includes: For each IoT detection time series subset inference network, the following steps are respectively completed: Adopt a neural network algorithm to predict the network influence coefficient of the IoT detection time series subset inference network, and obtain the inference network influence coefficient of the IoT detection time series subset inference network; Determine the inference network influence coefficient of the IoT detection time series subset inference network as the influence coefficient corresponding to the temporary inference IoT detection time series subset output by the IoT detection time series subset inference network.
5. The method according to claim 1, wherein The performing of time scale fusion processing on multiple inference IoT detection time series subsets to obtain an inference IoT detection time series set including a target time scale includes: Obtain the subset influence coefficients corresponding to each inference IoT detection time series subset; Adjust multiple inference IoT detection time series subsets according to the subset influence coefficients corresponding to each inference IoT detection time series subset to obtain an inference IoT detection time series set including the target time scale; Before respectively performing inference on each IoT detection time series subset by using the water loss estimation network, the method further includes: For each IoT detection time series subset, the following steps are respectively completed: Perform multi-scale extraction on the IoT detection time series subset to obtain a target seasonal component, a target abnormal condition component, and a target other component; wherein, the abnormal condition corresponding to the target abnormal condition component has an impact on the loss detection result of the water loss in the triggering period of the abnormal condition. The respectively performing inference on each IoT detection time series subset includes: Respectively perform inference on the target other components of each IoT detection time series subset.
6. The method according to claim 5, wherein The performing of multi-scale extraction on the IoT detection time series subset to obtain a target seasonal component, a target abnormal condition component, and a target other component includes: Perform first multi-scale extraction on the IoT detection time series subset to obtain a first target seasonal component, a first abnormal condition component, and a first other component; Filter out the first abnormal condition component in the IoT detection time series subset to obtain a first other IoT detection time series subset, and perform second multi-scale extraction on the first other IoT detection time series subset to obtain a second target seasonal component and a second other component; Filter out the second target seasonal component in the IoT detection time series subset to obtain a second other IoT detection time series subset, and perform third multi-scale extraction on the second other IoT detection time series subset to obtain a second abnormal condition component and a third other component; Determine the second target seasonal component as the target seasonal component, determine the second abnormal condition component as the target abnormal condition component, and determine the third other component as the target other component.
7. An Internet of Things-based tap water loss detection device, characterized in that, The device includes: A multi-scale extraction module for performing multi-scale extraction processing on the Internet of Things detection time series set of the water loss of tap water in a known detection period to obtain multiple Internet of Things detection time series subsets with different time scales; the time scale and the Internet of Things detection time series subset are in one-to-one correspondence, and the Internet of Things detection time series set includes multiple loss detection results of the water loss of tap water in the known detection period; A subset inference module for using a water loss prediction network of tap water to respectively infer each of the Internet of Things detection time series subsets to obtain multiple inferred Internet of Things detection time series subsets of the water loss of tap water in a to-be-detected detection period; A scale fusion module for performing time scale fusion processing on multiple inferred Internet of Things detection time series subsets to obtain an inferred Internet of Things detection time series set including a target time scale, and the inferred Internet of Things detection time series set includes inferred loss detection results of the water loss of tap water in the to-be-detected detection period; Wherein, the performing multi-scale extraction processing on the Internet of Things detection time series set of the water loss of tap water in a known detection period to obtain multiple Internet of Things detection time series subsets with different time scales includes: Performing null value diagnosis on the Internet of Things detection time series set to obtain a diagnosis result; If the diagnosis result indicates that the Internet of Things detection time series set has null values, filling the null values in the Internet of Things detection time series set to obtain a target Internet of Things detection time series set, and performing multi-scale extraction processing on the target Internet of Things detection time series set to obtain multiple Internet of Things detection time series subsets with different time scales; If the diagnosis result indicates that the Internet of Things detection time series set does not have null values, performing multi-scale extraction processing on the Internet of Things detection time series set to obtain multiple Internet of Things detection time series subsets with different time scales; Each loss detection result included in the Internet of Things detection time series set contains a corresponding acquisition node, and the performing null value diagnosis on the Internet of Things detection time series set to obtain a diagnosis result includes: Performing periodicity identification on the Internet of Things detection time series set to obtain a target time interval, and determining a reference time difference between the acquisition nodes of two adjacent loss detection results in the Internet of Things detection time series set according to the target time interval; For any two adjacent loss detection results in the Internet of Things detection time series set, obtaining a real time difference between the acquisition nodes of the two adjacent loss detection results; If there is a target real time difference greater than the reference time difference, obtaining a diagnosis result indicating that the Internet of Things detection time series set has null values; If there is no target real time difference greater than the reference time difference, obtaining a diagnosis result indicating that the Internet of Things detection time series set does not have null values; The Internet of Things detection time series set includes multiple loss detection result pairs, and the loss detection result pair includes any two adjacent loss detection results in the Internet of Things detection time series set; the performing periodicity identification on the Internet of Things detection time series set to obtain a target time interval includes: For each loss detection result pair, determining a time difference between the acquisition nodes of the two adjacent loss detection results in the loss detection result pair; If the time differences corresponding to multiple said loss detection result pairs are the same, determine the target time interval according to the time difference; If the time differences corresponding to multiple said loss detection result pairs are different, determine the adjusted calculation result of multiple said time differences, and determine the target time interval according to the adjusted calculation result; The null value filling of the IoT detection time series set to obtain the target IoT detection time series set includes: According to the reference time difference, fill in the missing target acquisition nodes between the two acquisition nodes before and after the target true time difference, and set the data corresponding to the target acquisition nodes to missing values; According to the null value filling strategy, determine the tap water loss amount data corresponding to the target acquisition nodes, and replace the missing values with the tap water loss amount data.
Citation Information
Patent Citations
Distributed running water pipe network loss monitoring system and method
CN109932009A
Aviation compressor fault prediction method and system
CN119004226A