Urban water consumption data analysis method
By combining VMD and FFT technology with optimized K values, the problem of unclear frequency resolution and poor decomposition effect in urban water consumption distribution analysis is solved, and more accurate capture of periodic patterns of water consumption and frequency component analysis are achieved, improving the The accuracy and speed of data analysis provide scientific basis for urban water resources management.
Patent Information
- Application Number
- CN202410950655.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-07-16
- Publication Date
- 2024-10-29
- Estimated Expiration
- 2044-07-16
AI Technical Summary
In the existing technology, VAM has unclear frequency resolution and poor decomposition effect due to the adjustable k value and large impact, and lacks accurate analysis and prediction of urban water distribution.
Using a combination of variational mode decomposition (VMD) technology optimized based on the K value and fast Fourier transform (FFT), through data smoothing, segmentation model training and testing, a water consumption distribution prediction model is constructed to identify and quantify water consumption. model, especially in low-frequency fluctuations, shows significant advantages.
It achieves more accurate capture of periodic patterns of urban water consumption and analysis of frequency components, improves the accuracy and speed of data analysis, and provides a scientific basis for urban water resources management.
Smart Images

Figure CN118485186B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of urban water consumption data, and more particularly to an urban water consumption data analysis method. Background Art
[0002] In response to the needs of urban water consumption distribution analysis, a water consumption law analysis method based on variational mode decomposition after K value optimization is constructed, and the periodic, daily and weekly water use patterns are compared with the analysis method of fast Fourier transform; VMD technology decomposes the original signal to obtain multiple intrinsic mode functions, identify and quantify the main water use patterns; perform FFT and return to the time domain through inverse transformation, aiming to analyze and reconstruct the different frequency components of the signal; the results show that both methods can identify the main frequencies of water consumption, with periods of 0.5 days and 1 day; the VMD model can quickly and accurately capture the laws of urban water use according to the water volume data, especially showing significant advantages in identifying low-frequency fluctuations; this method prepares for in-depth exploration and prediction of urban water use patterns, and is of great significance for predicting urban water consumption.
[0003] For example, the invention patent with announcement number: CN116451874A announces a method, device and equipment for predicting urban water consumption, including obtaining real-time time characteristic data, weather characteristic data and autoregressive characteristic data of the city; inputting the time characteristic data, weather characteristic data and autoregressive characteristic data into a determined urban water consumption prediction model for processing to obtain urban water consumption prediction data; the urban water consumption prediction model is determined based on a related network model; the scheme of the present invention can take into account the impact of factors such as weather, climate, holidays, etc. on water consumption, is applicable to various regions and times, has accurate predictions, and has strong universality.
[0004] For example, the invention patent with announcement number: CN113723708B announces a method for predicting urban daily water consumption based on machine learning, which includes the following steps: first, obtain local data such as daily rainfall, temperature, daily water consumption in previous years, normalize the above data, and then use the processed data as data input for the least squares support vector machine model. When training the least squares support vector machine model, the Gaussian particle swarm perturbation optimization algorithm is used to perform parameter optimization, which can prevent the parameter optimization results from falling into the local optimal solution to a certain extent; after the training process is completed, the predicted daily rainfall, temperature and the average daily water consumption one month before the prediction day are normalized and sent to the trained least squares support vector machine model to output the daily water consumption of the predicted day; the present invention uses the least squares support vector machine model to perform calculations, which can run at a faster speed and with higher accuracy, and has higher practical application value.
[0005] The above disclosed technical solutions have at least the following technical problems:
[0006] VAM has problems because the k value is adjustable and has a large impact, resulting in unclear frequency resolution, or poor decomposition due to the selection of k value, which leads to problems in the final analysis results. In addition, existing technologies do not have a clear and accurate analysis and prediction of water use distribution.
[0007] In view of the above problems, the present invention proposes a solution. Summary of the invention
[0008] In order to overcome the above defects of the prior art, an embodiment of the present invention provides a method for analyzing urban water consumption data, which solves the problems raised in the above background technology through urban water consumption data analysis.
[0009] To achieve the above object, the present invention provides the following technical solutions:
[0010] A method for analyzing urban water consumption data, the specific steps of which are as follows: obtaining an urban water consumption data set, and performing a data smoothing operation on the urban water consumption data set; dividing the urban water consumption data set after the data smoothing operation into a training set and a test set; constructing a distribution data segmentation model based on the optimized intrinsic mode analysis training set; analyzing the urban water consumption data set based on a fast Fourier transform to obtain a first water consumption distribution law; using the test set combined with the first water consumption distribution law to train and test the distribution data segmentation model to obtain a water consumption distribution prediction model; inputting the actual urban water consumption data to be analyzed into the water consumption distribution prediction model, and outputting the corresponding urban water consumption distribution.
[0011] In a preferred embodiment, the data smoothing operation is performed on the urban water consumption data set, specifically: the urban water consumption data set 1 is randomly scaled by 0.5 to 1 times, and the standard deviation of the urban water consumption data set is used as the Laida constant, and the urban water consumption data whose average value and the difference between the urban water consumption data are greater than three times the Laida constant are eliminated to obtain the urban water consumption data set after the data smoothing operation.
[0012] In a preferred embodiment, the urban water consumption data set after the data smoothing operation is divided into a training set and a test set, specifically: 80% of the urban water consumption data set after the data smoothing operation is used as a training set and 20% is used as a test set; the urban water consumption data in the training set is time-series processed and labeled.
[0013] In a preferred embodiment, the distributed data segmentation model is constructed based on the optimized intrinsic mode analysis training set, specifically: using the training set, changing the number of decompositions of the intrinsic mode decomposition method, and performing eigenmode decomposition of urban water consumption data based on multiple training sets to obtain corresponding decomposition data sets; obtaining the optimized number of decompositions based on the energy coupling difference analysis between the decomposition data in the decomposition data set and the urban water consumption data; performing eigenmode decomposition of the urban water consumption data based on the optimized decomposition number to obtain the distributed data segmentation model.
[0014] In a preferred embodiment, the fast Fourier transform-based analysis of the urban water consumption data set to obtain the first water consumption distribution law is specifically as follows: signal characteristic data of the urban water consumption data set is obtained, and the covariance matrix of the signal characteristic data is calculated; the covariance matrix is converted to the frequency domain based on the Fourier transform; significant frequency components in the frequency domain are identified, and the first water consumption distribution law is obtained according to different analysis ranges corresponding to different frequencies; the signal characteristic data includes the frequency of each sinusoidal wave component, the amplitude of each sinusoidal wave component and the phase of each sinusoidal wave component.
[0015] In a preferred embodiment, the test set is used in combination with the first water consumption distribution law to train and test the distribution data segmentation model to obtain a water consumption distribution prediction model, specifically: based on wavelet transform, the time-frequency characteristics of the urban water consumption data components are analyzed to extract the distribution characteristics of the urban water consumption data components: the urban water consumption data are segmented according to the distribution data segmentation model to obtain a corresponding number of urban water consumption data components; according to the frequencies of different urban water consumption data components, different actual ranges are reflected, and the second water consumption distribution law is analyzed in combination with the distribution characteristics and the actual range; based on the second water consumption distribution law, the difference between the second water consumption distribution law and the first water consumption distribution law is compared and the difference is marked; the test set is used to optimize the data and adjust the structure of the corresponding marked positions of the distribution data segmentation model to obtain a water consumption distribution prediction model.
[0016] In a preferred embodiment, the actual urban water consumption data to be analyzed is input into the water consumption distribution prediction model, and the corresponding urban water consumption distribution is output. Specifically, the urban water consumption data to be analyzed is input into the water consumption distribution prediction model to obtain prediction components of different frequencies; according to the frequency corresponding distribution range, the water consumption size of the corresponding distribution characteristics is judged according to the size of the prediction component.
[0017] In a preferred embodiment, a specific method for obtaining the optimized decomposition number is as follows: inputting the training set in the form of a time series; preprocessing the training set to remove trends and seasonality; setting multiple decomposition groups, each decomposition group is set with a different decomposition number, and performing eigenmode decomposition to obtain urban water consumption data components of corresponding decomposition numbers; calculating the coupling difference between the urban water consumption data components in each decomposition group and the data in the training set before decomposition; establishing a change curve according to the value of the coupling difference of each group; and selecting the optimized decomposition number according to the change curve.
[0018] In a preferred embodiment, the optimized decomposition number is selected according to the change curve, specifically: when the difference between the point with the smallest coupling difference in the change curve and the adjacent point is less than a preset change threshold, the decomposition number corresponding to the point with the smallest coupling difference in the curve is used as the optimized decomposition number; otherwise, the point with the smallest coupling difference in the change curve is eliminated until the difference between the point with the smallest coupling difference in the change curve and the adjacent point is less than the preset change threshold.
[0019] Technical effects and advantages of the urban water consumption data analysis method of the present invention:
[0020] 1. The present invention has significant technical means and advantages by using variational mode decomposition (VMD) technology based on K value optimization to analyze urban water consumption; VMD technology effectively identifies and quantifies water use patterns of different frequencies, including daily and weekly periodic changes, by decomposing urban water consumption data into multiple intrinsic mode functions (IMFs). Compared with the traditional fast Fourier transform (FFT), this method is more outstanding in its ability to handle long periods and complex fluctuations, and can more accurately capture the periodic laws of urban water use, providing scientific data support and decision-making basis for urban water resources management.
[0021] 2. This invention can efficiently extract the frequency components and variation patterns of urban water consumption by analyzing the urban water consumption data set using fast Fourier transform (FFT). By calculating the covariance matrix of the signal feature data and converting it to the frequency domain, we can identify and analyze the significant frequency components in the frequency domain, reflecting the important fluctuation patterns of urban water consumption at different time scales. This method not only improves the speed and accuracy of data analysis, but also provides a scientific basis for optimizing water resource management strategies and formulating water-saving policies, demonstrating its wide application potential and practical effects in urban water resource management. BRIEF DESCRIPTION OF THE DRAWINGS
[0022] Figure 1 It is a structural schematic diagram of the urban water consumption data analysis method of the present invention. DETAILED DESCRIPTION
[0023] The following will be combined with the drawings in the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.
[0024] Embodiment 1, Figure 1 The present invention provides a method for analyzing urban water consumption data, comprising the following steps:
[0025] S1, obtaining a city water consumption data set and performing a data smoothing operation on the city water consumption data set;
[0026] S2, divide the urban water consumption dataset after data smoothing into a training set and a test set;
[0027] S3, constructing a distributed data segmentation model based on the optimized intrinsic mode analysis training set;
[0028] S4, analyzing the urban water consumption data set based on fast Fourier transform to obtain the first water consumption distribution law;
[0029] S5, using the test set combined with the first water consumption distribution law to train and test the distribution data segmentation model to obtain a water consumption distribution prediction model;
[0030] S6, inputting the actual urban water consumption data to be analyzed into the water consumption distribution prediction model, and outputting the corresponding urban water consumption distribution.
[0031] In response to the needs of urban water consumption distribution analysis, a water consumption law analysis method based on variational mode decomposition after K value optimization is constructed, and the periodic, daily and weekly water consumption patterns are compared with the analysis method of fast Fourier transform; VMD technology decomposes the original signal to obtain multiple intrinsic mode functions, identify and quantify the main water consumption patterns; perform FFT and return to the time domain through inverse transformation, aiming to analyze and reconstruct the different frequency components of the signal; the results show that both methods can identify the main frequencies of water consumption, with periods of 0.5 days and 1 day; the VMD model can quickly and accurately capture the laws of urban water use according to the water volume data, especially showing significant advantages in identifying low-frequency fluctuations; this method prepares for in-depth exploration and prediction of urban water use patterns, and is of great significance for predicting urban water consumption; however, VAM does have the problem that the k value is adjustable and has a large impact, resulting in unclear frequency resolution, or poor decomposition effect due to the selection of k value, which leads to problems in the final analysis results.
[0032] Compared with VMD technology, fast Fourier transform, as a classic frequency domain analysis method, has the following advantages in urban water consumption analysis:
[0033] High frequency resolution: FFT can accurately analyze the frequency components of a signal, especially when determining frequency patterns (such as daily and weekly cycles). It can accurately measure and analyze signal components with clear periodicity;
[0034] High computational efficiency: FFT is an efficient algorithm that can quickly perform spectral analysis on large amounts of data; this enables it to quickly generate results when processing large-scale urban water consumption data, which is beneficial for real-time or near-real-time data processing and analysis needs;
[0035] Solid foundation based on mathematical theory: FFT is based on the mathematical theory of Fourier transform, which has been widely verified and applied in the field of signal processing; its spectrum analysis results are generally considered to be accurate and reliable, and are suitable for many periodic signal analysis tasks;
[0036] Wide range of applications: As a general frequency domain analysis tool, FFT can be used not only for periodic analysis of urban water consumption, but also for processing various types of periodic and non-periodic signals. This makes it widely used in multiple fields and application scenarios;
[0037] Easy to understand and implement: The basic principles and implementation of FFT are relatively intuitive and simple, allowing many engineers and researchers to quickly master and apply this technology for spectrum analysis and signal reconstruction.
[0038] Therefore, by optimizing the decomposition quantity and correcting the VAM by fast Fourier transform, a more accurate water consumption distribution prediction model can be obtained.
[0039] In this embodiment, a data smoothing operation is performed on the urban water consumption data set, specifically:
[0040] The urban water consumption data set 1 is randomly scaled from 0.5 to 1 times, and the standard deviation of the urban water consumption data set is used as the Raida constant. The urban water consumption data whose difference between the mean value of urban water consumption data and the urban water consumption data is greater than three times the Raida constant are eliminated to obtain the urban water consumption data set after data smoothing operation.
[0041] It should be noted that the urban water consumption dataset (referred to as dataset 1) is randomly scaled from 0.5 to 1; this means that for each data point in the dataset, it is multiplied by a randomly selected scaling factor, which ranges from 0.5 to 1; this operation can help adjust the amplitude range of the data, making subsequent data processing more uniform or appropriate;
[0042] The standard deviation of the urban water consumption data set is used to calculate the Lyapunov constant. The standard deviation is a statistic that measures the degree of dispersion of values in a data set, and the Lyapunov constant is based on the concept of the standard deviation and is usually used to measure the stability of nonlinear dynamic systems.
[0043] Eliminate data points in the urban water consumption data whose difference from the average value of the data set is greater than three times the Raida constant; this step is to remove outliers or outliers that deviate far from the overall data distribution to ensure that the data is more stable and reliable in subsequent analysis or modeling;
[0044] The urban water consumption dataset after random scaling and outlier removal is regarded as the result of data smoothing operation; this means that through the above steps, the original data has been adjusted and cleaned to obtain a dataset that is more suitable for subsequent analysis or model building.
[0045] In this embodiment, the urban water consumption data set after the data smoothing operation is divided into a training set and a test set, specifically:
[0046] 80% of the urban water consumption data set after data smoothing operation was used as the training set and 20% as the training set;
[0047] The urban water consumption data in the training set is processed and labeled in time series.
[0048] It should be noted that randomness: when dividing the training set and the test set, it should be ensured that they are randomly selected; this can be achieved by randomly disrupting the order of the data set to avoid some potential time correlation or periodicity in the data that affects the training and evaluation results of the model; data distribution: ensure that the data in the training set and the test set are statistically consistent, and try to avoid significant deviations of certain categories or features in a certain set after division; repeatability: in order to verify the robustness of the model, it may be necessary to randomly divide the training set and the test set multiple times and average or compare the results.
[0049] It should be noted that labeling refers to assigning a label or target value to the data at each time point or time period for supervised learning of the model; in the case of urban water consumption, labeling can be predicting the water consumption at the next time point, or identifying specific water consumption patterns (such as daily or weekly periodic patterns).
[0050] It should be noted that the processing of time series data: time series processing should ensure the correct time order of the data to avoid introducing model learning bias; the choice of annotations: the rationality and accuracy of annotations are crucial to the model prediction performance, and it is necessary to ensure that the annotations are consistent with the requirements of the prediction task; data preprocessing: before time series processing and annotation, further data preprocessing steps may be required, such as normalization, missing value processing, etc., to ensure the quality and reliability of the data.
[0051] In this embodiment, a distribution data segmentation model is constructed based on the optimized intrinsic mode analysis training set, specifically:
[0052] Using the training set, the number of decompositions of the eigenmode decomposition method is changed, and multiple sets of training sets are used to decompose the urban water consumption data based on the eigenmode to obtain the corresponding decomposition data sets;
[0053] The optimized decomposition quantity is obtained based on the energy coupling difference analysis between the decomposition data in the decomposition data set and the urban water consumption data;
[0054] The urban water consumption data is decomposed into intrinsic modes according to the optimized decomposition number to obtain the distribution data segmentation model.
[0055] It should be noted that the VMD algorithm is an adaptive, completely non-recursive signal decomposition algorithm. Compared with the CEEMDAN algorithm, the VMD algorithm can specify the number of IMFs obtained by decomposition, and effectively separate the changing laws of the original time series at different times; the core principle of VMD is based on the variational algorithm, which decomposes the original signal by minimizing a predefined cost function; the cost function mainly considers two aspects: one is the bandwidth of each IMF, and the other is the fidelity between the reconstructed signal and the original signal; this process is achieved through iterative optimization until the convergence condition is reached; ultimately, each IMF generated by VMD has a relatively narrow frequency band and can represent the specific frequency components of the original signal;
[0056] The core of variational mode decomposition is to solve constrained variational problems;
[0057] The specific calculation formula of the constrained variation is as follows:
[0058] In the formula, It means the solution that minimizes A when condition B is satisfied; is the Dirichlet function; For The one-sided spectrum obtained by performing Hilbert transform; represents the set of modal components and their corresponding center frequencies, and the decomposition scale is K, which is the number of components obtained by decomposition; represents convolution; represents the sum of all modal components; represents the square norm of the gradient, is the imaginary part, is the number of data, is the data component.
[0059] The energy difference is calculated as follows:
[0060]
[0061] In this implementation, the coupling value and calculation formula are as follows:
[0062]
[0063] In the formula, is the coupling value, H is the total number of tests, is the number of sampling points, is the i-th element in the signal, is the sum of the energies of all K modal components obtained under the current total number of modal components K, is the energy difference, Using urban water use distribution data, t is the time variable, is the modal component function, is the number of modal components
[0064] By applying VMD, we can more accurately capture the cyclical changes in urban water consumption and provide a scientific basis for urban water resources management and planning. In recent years, with the widespread application of VMD methods in the field of signal processing, its potential in urban water consumption analysis has been increasingly recognized, providing us with a powerful tool to analyze the complex dynamics behind urban water consumption.
[0065] In the analysis of urban water consumption data, the application of VMD mainly includes the following steps:
[0066] (1) Decompose the original water consumption time series data into multiple IMFs; each IMF represents a major frequency component in the original signal, which may correspond to daily water consumption fluctuations, seasonal changes, or other periodic patterns;
[0067] (2) Identify the water use pattern of urban water consumption by analyzing the characteristics of each IMF, such as amplitude, frequency, and morphology;
[0068] (3) The IMF decomposed by VMD is used for trend analysis to predict the changing trend of water consumption in the future.
[0069] This embodiment has significant technical means and advantages by using the variational mode decomposition (VMD) technology based on K value optimization to analyze urban water consumption; VMD technology effectively identifies and quantifies water use patterns of different frequencies, including daily and weekly periodic changes, by decomposing urban water consumption data into multiple intrinsic mode functions (IMFs). Compared with the traditional fast Fourier transform (FFT), this method is more outstanding in its ability to handle long periods and complex fluctuations, and can more accurately capture the periodic laws of urban water use, providing scientific data support and decision-making basis for urban water resources management.
[0070] Example 2: In this example, the urban water consumption data set is analyzed based on fast Fourier transform to obtain the first water consumption distribution law, which is specifically:
[0071] Obtain signal characteristic data of the urban water consumption data set and calculate the covariance matrix of the signal characteristic data;
[0072] Convert the covariance matrix to the frequency domain based on Fourier transform;
[0073] Identify the significant frequency components in the frequency domain, and obtain the first water use distribution law according to different frequencies corresponding to different analysis ranges;
[0074] The signal characteristic data includes the frequency of each sinusoidal wave component, the amplitude of each sinusoidal wave component and the phase of each sinusoidal wave component.
[0075] It should be noted that in the field of digital signal processing, Fourier transform plays a core role. Its function is to decompose a complex digital signal into a series of simpler components, so that we can identify and extract valuable signal parts. Based on the Fourier principle, we know that any continuously recorded time series or signal can be represented by a combination of countless sine waves of different frequencies. The Fourier transform algorithm is based on this principle. It uses the original signal to calculate the frequency, amplitude and phase of each sine wave component.
[0076] This method first calculates the covariance matrix of the regionalized variables, then uses FFT to convert the covariance matrix to the frequency domain for processing, and finally transforms the covariance function back to the time domain through the inverse fast Fourier transform (IFFT); by performing FFT processing on urban domestic water consumption data, key frequency components can be extracted from the data, representing the change pattern of water consumption over time; the identification of these frequency components is crucial for predicting water demand, optimizing water resource management strategies, and formulating effective water-saving policies; FFT is actually an efficient calculation method of discrete Fourier transform (DFT); by using DFT and its efficient algorithm FFT, we can efficiently process and analyze digitized water consumption data, capturing water consumption fluctuation patterns from short-term intraday cycles to long-term cross-seasonal cycles.
[0077] The specific calculation formula for converting the covariance matrix to the frequency domain based on Fourier transform is:
[0078] Where M and N are the number of rows and columns of the covariance matrix, respectively. , M is the water use time series, and N pairs are water distribution characteristics; is the spectrum value of the mth row and nth column in the frequency domain, For the Row, No. The conversion factor for the column.
[0079] The steps for using FFT are relatively simple and can be divided into the following steps:
[0080] (1) Collect time series data on water consumption;
[0081] (2) Perform FFT: Convert the water usage data in the time domain to the frequency domain through FFT;
[0082] (3) Spectral analysis: Identify significant frequency components in the spectrum to reflect water consumption patterns;
[0083] (4) Application of results: Optimize water resources management and predict water use trends based on identified patterns.
[0084] In this embodiment, the distribution data segmentation model is trained and tested using the test set combined with the first water consumption distribution law to obtain a water consumption distribution prediction model, specifically:
[0085] Based on wavelet transform, the time-frequency characteristics of urban water consumption data components are analyzed and the distribution characteristics of urban water consumption data components are extracted:
[0086] Segment the urban water consumption data according to the distribution data segmentation model to obtain a corresponding number of urban water consumption data components;
[0087] According to the frequency of different urban water consumption data components, different actual ranges are reflected, and the second water consumption distribution law is analyzed by combining the distribution characteristics and actual ranges;
[0088] Based on the second water use distribution law, the difference between the second water use distribution law and the first water use distribution law is compared and the difference is marked;
[0089] The test set is used to optimize data and adjust the structure of the corresponding annotation positions of the distribution data segmentation model to obtain a water consumption distribution prediction model.
[0090] It should be noted that wavelet transform is a signal analysis tool that can provide both time domain and frequency domain information. When analyzing urban water consumption data, wavelet transform can help capture the characteristics of water consumption fluctuations at different time scales, such as the changing trends of short-term and long-term fluctuations; through wavelet transform, the time-frequency characteristics of urban water consumption data can be extracted, and then its distribution characteristics can be analyzed, including periodicity, trend and seasonal changes.
[0091] The urban water consumption data is segmented according to the distribution data segmentation model to obtain the corresponding number of urban water consumption data components: the distribution data segmentation model has learned the patterns and rules of urban water consumption data through the previous training and testing process; using this model, the overall urban water consumption data can be decomposed into multiple data components, each component reflects specific frequency and amplitude information; these components represent the changing characteristics of urban water consumption on different time scales.
[0092] According to the frequency of different urban water consumption data components, different actual ranges are reflected. Combining the distribution characteristics and actual ranges, the second water consumption distribution law is analyzed: Based on the urban water consumption data components with different frequencies obtained by analysis, the second water consumption distribution law can be further explored; the second water consumption distribution law here may refer to the distribution pattern and change trend of urban water consumption at different times or locations. By combining the distribution characteristics of actual water consumption data with the actual situation, the change law of the second water consumption under periodicity, seasonality or specific events can be deeply analyzed.
[0093] Based on the second water consumption distribution law, the difference between the second water consumption distribution law and the first water consumption distribution law is compared and the differences are marked: By comparing the second water consumption distribution law with the first water consumption distribution law, the differences and similarities between them can be found; these differences may include changes in frequency components, differences in amplitude or changes in periodic characteristics, etc.; by marking and analyzing the differences, the water consumption distribution prediction model can be further optimized and adjusted.
[0094] The test set is used to optimize the data and adjust the structure of the corresponding annotation positions of the distribution data segmentation model to obtain the water consumption distribution prediction model:
[0095] Finally, the distribution data segmentation model is optimized and structurally adjusted using the labeled difference data and the validation data in the test set. This process includes adjusting the model parameters and optimizing the algorithm to ensure that the model can accurately predict the second water use distribution law, thereby providing a more reliable tool and basis for the prediction and management of urban water use in the future.
[0096] The specific process of the wavelet transform is:
[0097] Assume that the urban water consumption data is x(t), where t represents time. Use wavelet transform to decompose the signal x(t) into wavelet coefficients W(s,τ) of different scales s and positions; common wavelet transforms include continuous wavelet transform and discrete wavelet transform. Select the appropriate transform method according to the specific situation.
[0098] The output of wavelet transform reflects the energy distribution of signal x(t) at different frequencies s and times; time-frequency analysis can reveal the characteristics of the signal at different frequencies and time scales by calculating the modulus or energy of the wavelet coefficients.
[0099] The energy of the wavelet coefficients can be calculated by the following formula:
[0100]
[0101] Where Re(W(j,k)) and Im(W(j,k)) represent the real and imaginary parts of the wavelet coefficients W(j,k), respectively.
[0102] In this embodiment, the specific method for obtaining the optimized decomposition quantity is as follows:
[0103] Input the training set in the form of time series;
[0104] Preprocess the training set to remove trends and seasonality;
[0105] Set multiple decomposition groups, set different decomposition numbers for each decomposition group, and perform eigenmode decomposition to obtain urban water consumption data components with corresponding decomposition numbers;
[0106] Calculate the coupling difference between the urban water consumption data component in each decomposition group and the data in the training set before decomposition;
[0107] Establish a variation curve according to the value of each group of coupling differences;
[0108] Select the optimal number of decompositions according to the change curve.
[0109] It should be noted that in the process of optimizing the number of intrinsic mode decompositions, several key points need to be noted; first, proper preprocessing of the training set is crucial, especially when removing trends and seasonality, to ensure that unnecessary data distortion is not introduced; second, when setting multiple groups of decomposition numbers, a wide range should be covered to fully capture the important frequency components in urban water consumption data; calculating the coupling difference under each group of decomposition numbers is a key step in evaluating model performance, ensuring that the method is accurate and can provide meaningful analysis results; finally, when establishing and analyzing the change curve, the shape and trend of the curve should be comprehensively considered, and the optimal decomposition number should be selected in a scientific and intuitive way to support accurate prediction and analysis of water consumption data.
[0110] The optimized decomposition quantity is selected according to the change curve, specifically:
[0111] When the difference between the point with the smallest coupling difference in the change curve and the adjacent point is less than the preset change threshold, the decomposition number corresponding to the point with the smallest coupling difference in the curve is used as the optimized decomposition number;
[0112] Otherwise, the point with the smallest coupling difference in the change curve is eliminated until the difference between the point with the smallest coupling difference in the change curve and the adjacent point is less than the preset change threshold.
[0113] It should be noted that the automatic selection method automatically analyzes the change curve and selects the optimal number of decompositions according to the change trend of the coupling difference, which reduces the need for human subjective intervention and improves the objectivity and repeatability of the method.
[0114] Fine-tuning: By setting a preset change threshold, the selection process of the decomposition quantity can be fine-tuned; when the difference between the point with the minimum coupling difference and the adjacent point is less than the threshold, it ensures that the selected decomposition quantity has a clear advantage in the change curve, avoiding unnecessary changes caused by small fluctuations;
[0115] Robustness and reliability: The process of eliminating the points with the smallest coupling difference in the variation curve until the preset threshold is met ensures the stability and reliability of the final selected number of decompositions in multiple experiments. This helps to avoid overfitting or unstable decomposition results;
[0116] Time efficiency: Since this method is based on curve analysis and preset thresholds, the amount of calculation is relatively small, which is suitable for fast analysis needs in large-scale data and real-time application scenarios.
[0117] In this implementation, by using fast Fourier transform (FFT) to analyze the urban water consumption data set, the frequency components and change patterns of urban water consumption can be efficiently extracted. By calculating the covariance matrix of the signal feature data and converting it to the frequency domain, we can identify and analyze the significant frequency components in the frequency domain, reflecting the important fluctuation patterns of urban water consumption at different time scales. This method not only improves the speed and accuracy of data analysis, but also provides a scientific basis for optimizing water resources management strategies and formulating water-saving policies, demonstrating its wide application potential and practical effects in urban water resources management.
[0118] The above formulas are all dimensionless and numerical calculations. The formula is a formula for the most recent real situation obtained by collecting a large amount of data and performing software simulation. The preset parameters in the formula are set by technicians in this field according to actual conditions.
[0119] The above embodiments may be implemented in whole or in part by software, hardware, firmware or any other combination. When implemented by software, the above embodiments may be implemented in whole or in part in the form of a computer program product.
[0120] Those of ordinary skill in the art will appreciate that the modules and algorithm steps of each example described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, or a combination of computer software and electronic hardware. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. Professional and technical personnel can use different methods to implement the described functions for each specific application, but such implementation should not be considered to be beyond the scope of this application.
[0121] In addition, each functional module in each embodiment of the present application may be integrated into one processing module, or each module may exist physically separately, or two or more modules may be integrated into one module.
[0122] The above is only a specific implementation of the present application, but the protection scope of the present application is not limited thereto. Any person skilled in the art who is familiar with the present technical field can easily think of changes or substitutions within the technical scope disclosed in the present application, which should be included in the protection scope of the present application. Therefore, the protection scope of the present application should be based on the protection scope of the claims.
[0123] Finally: The above description is only a preferred embodiment of the present invention and is not intended to limit the present invention. Any modifications, equivalent substitutions, improvements, etc. made within the spirit and principles of the present invention should be included in the protection scope of the present invention.
Claims
1. A method for analyzing urban water consumption data, characterized in that: The specific steps are as follows: Obtain a data set of urban water consumption, and perform data smoothing operations on the data set of urban water consumption; The urban water consumption dataset after data smoothing is divided into a training set and a test set; Construct a distributed data segmentation model based on the optimized intrinsic mode analysis training set; Based on the fast Fourier transform analysis of the urban water consumption data set, the first water consumption distribution law is obtained; The distribution data segmentation model is trained and tested by using the test set combined with the first water consumption distribution law to obtain a water consumption distribution prediction model; The test set is combined with the first water consumption distribution law to train and test the distribution data segmentation model to obtain a water consumption distribution prediction model, which is specifically: Based on wavelet transform, the time-frequency characteristics of urban water consumption data components are analyzed and the distribution characteristics of urban water consumption data components are extracted: Segment the urban water consumption data according to the distribution data segmentation model to obtain a corresponding number of urban water consumption data components; According to the frequency of different urban water consumption data components, combined with distribution characteristics and actual range, the second water consumption distribution law is analyzed; Based on the second water use distribution law, the difference between the second water use distribution law and the first water use distribution law is compared and the difference is marked; The test set is used to optimize the data and adjust the structure of the corresponding annotation positions of the distribution data segmentation model to obtain the water consumption distribution prediction model; The actual urban water consumption data to be analyzed is input into the water consumption distribution prediction model, and the corresponding urban water consumption distribution is output.
2. The urban water consumption data analysis method according to claim 1, characterized in that: The data smoothing operation on the urban water consumption data set is specifically as follows: The urban water consumption data set is randomly scaled, and the standard deviation of the urban water consumption data set is used as the Raida constant. The urban water consumption data whose difference between the mean value of urban water consumption data and the urban water consumption data is greater than three times the Raida constant are eliminated to obtain the urban water consumption data set after data smoothing operation.
3. The urban water consumption data analysis method according to claim 2, characterized in that: The urban water consumption data set after the data smoothing operation is divided into a training set and a test set, specifically: 80% of the urban water consumption data set after data smoothing is used as the training set and 20% as the test set; The urban water consumption data in the training set is processed and labeled in time series.
4. The urban water consumption data analysis method according to claim 3 is characterized in that: The distributed data segmentation model is constructed based on the optimized intrinsic mode analysis training set, specifically: Using the training set, the number of decompositions of the eigenmode decomposition method is changed, and multiple sets of training sets are used to decompose the urban water consumption data based on the eigenmode to obtain the corresponding decomposition data sets; The optimized decomposition quantity is obtained based on the energy coupling difference analysis between the decomposition data in the decomposition data set and the urban water consumption data; The urban water consumption data is decomposed into intrinsic modes according to the optimized decomposition number to obtain the distribution data segmentation model.
5. The urban water consumption data analysis method according to claim 4, characterized in that: The first water consumption distribution law is obtained by analyzing the urban water consumption data set based on fast Fourier transform, which is specifically: Obtain signal characteristic data of the urban water consumption data set and calculate the covariance matrix of the signal characteristic data; Convert the covariance matrix to the frequency domain based on Fourier transform; Identify the significant frequency components in the frequency domain, and obtain the first water use distribution law according to different frequencies corresponding to different analysis ranges; The signal characteristic data includes the frequency of each sinusoidal wave component, the amplitude of each sinusoidal wave component and the phase of each sinusoidal wave component.
6. The urban water consumption data analysis method according to claim 5, characterized in that: The actual urban water consumption data to be analyzed is input into the water consumption distribution prediction model, and the corresponding urban water consumption distribution is output, specifically: Input the water consumption data of the city to be analyzed into the water consumption distribution prediction model to obtain prediction components of different frequencies; According to the frequency corresponding distribution range, the water consumption of the corresponding distribution characteristics is determined according to the size of the predicted component.
7. The urban water consumption data analysis method according to claim 6, characterized in that: The specific method for obtaining the optimized decomposition quantity is as follows: Input the training set in the form of time series; Preprocess the training set to remove trends and seasonality; Set multiple decomposition groups, set different decomposition numbers for each decomposition group, and perform eigenmode decomposition to obtain urban water consumption data components with corresponding decomposition numbers; Calculate the coupling difference between the urban water consumption data component in each decomposition group and the data in the training set before decomposition; Establish a variation curve according to the value of each group of coupling differences; Select the optimal number of decompositions according to the change curve.
8. The urban water consumption data analysis method according to claim 7, characterized in that: The optimized decomposition quantity is selected according to the change curve, specifically: When the difference between the point with the smallest coupling difference in the change curve and the adjacent point is less than the preset change threshold, the decomposition number corresponding to the point with the smallest coupling difference in the curve is used as the optimized decomposition number; Otherwise, the point with the smallest coupling difference in the change curve is eliminated until the difference between the point with the smallest coupling difference in the change curve and the adjacent point is less than the preset change threshold.
9. The urban water consumption data analysis method according to claim 8, characterized in that: The specific calculation formula for converting the covariance matrix to the frequency domain based on Fourier transform is: , where M and N are the number of rows and columns of the covariance matrix, M is the water use time series, and N is the water distribution characteristics. is the spectrum value of the mth row and nth column in the frequency domain, For the Row, No. The conversion factor for the column.
Citation Information
Patent Citations
A Machine Learning-Based Method for Predicting Daily Urban Water Consumption
CN113723708B
Urban water consumption prediction method, device and equipment
CN116451874A
Subway passenger flow prediction method and system based on CEEMDAN-LSTM
CN115358491A
Method and device for forecasting electric load, and electronic device
US20240113519A1
