Water quality prediction optimization method based on variational multimodal
Through the variational multimodal method, the urban water use law is predicted and water quality warning is carried out, which solves the problems of underdecomposition and overdecomposition in the selection of modal number K in the water consumption time series prediction model in the prior art, and effectively prevents and early warnings of water quality.
Patent Information
- Application Number
- CN202411876415.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-19
- Publication Date
- 2025-03-14
- Estimated Expiration
- 2044-12-19
AI Technical Summary
The urban water use time series has the characteristics of nonstable and nonlinearity. The existing water use time series prediction model based on VMD-PSO-LSTM has a great impact on the signal decomposition effect, resulting in the problems of underdecomposition and overdecomposition. In ensuring water resource optimization, there is a lack of prevention of water quality.
A water quality prediction optimization method based on variational multimodal state is proposed, which predicts water usage laws through variational multimodal state, and provides water quality warnings based on water usage laws. The specific steps include obtaining the water consumption anomaly analysis request, performing variational modal decomposition of the number of random modal components P times, calculating the coupling energy difference and signal residual between the modal component and the water consumption anomaly analysis request, determining the optimal modal component number, optimizing the modal decomposition, analyzing the water usage rules and comparing them with the preset water quality threshold, and performing water quality prevention.
Through variational modal decomposition, the time-frequency characteristics of the signal are extracted, the modal decomposition process is optimized, the analysis accuracy and abnormal detection capabilities of complex water use time series are improved, and effective prevention and early warning of water quality is achieved.
Smart Images

Figure CN119322999B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of variational multimodal technology, and more specifically, to a water quality prediction optimization method based on variational multimodal technology. Background Art
[0002] The VMD signal processing method can decompose complex time series into a given number of intrinsic mode functions, and the decomposed components have all the characteristics of the original data on the corresponding time scale. The purpose of VMD decomposition is to find the mode function with the smallest sum of K estimated bandwidths. The overall law and local vibration mode of the signal can be understood in more detail through the mode functions of different frequencies. The original signal is obtained by adding the mode functions.
[0003] For example, the water consumption anomaly detection method and database service announced by the invention patent with announcement number: CN108595687B; by obtaining a current water meter reading set, the current water meter reading set includes multiple current water meter readings reported by the water meter within a first set time period; generating a current water meter reading difference set based on multiple current water meter readings, the current water meter reading difference set includes multiple current water meter reading differences, and the current water meter reading difference is the difference between the current water meter reading and the previous current water meter reading; judging whether there are a set number of consecutive current water meter reading differences greater than 0 in the current water meter reading difference set; if it is judged that there are at least a set number of consecutive current water meter reading differences greater than 0 in the current water meter reading difference set, it is judged that the user's water consumption monitored by the water meter is abnormal; the invention realizes accurate judgment of whether the user's water consumption is abnormal, avoiding the troubles caused by misjudgment and false alarm to all parties.
[0004] For example, the invention patent announcement numbered CN116561393B has a water consumption factor of 10,000 yuan.
[0005] The GDP water consumption visualization system and method include a collection unit, an analysis unit, a model unit, a verification unit, a calculation unit, a visualization unit, a display unit and a maintenance unit. The collection unit is used to collect influencing factors of water consumption and send the collection results to the analysis unit. The analysis unit converts the influencing factors collected by the collection unit into two principal component indicators. The model unit receives the principal component indicators and the collected data and establishes a principal component 10,000 yuan GDP water consumption model and a regression analysis 10,000 yuan GDP water consumption model. The present invention is provided with a principal component 10,000 yuan GDP water consumption model, so as to collect water consumption influencing factors in various aspects, thereby improving the accuracy of subsequent processing. The principal component 10,000 yuan GDP water consumption model is more in line with reality, so as to accurately judge the 10,000 yuan GDP water consumption.
[0006] The above disclosed technical solutions have at least the following technical problems:
[0007] Urban water consumption time series has the characteristics of instability and nonlinearity. The existing water consumption time series prediction model based on VMD-PSO-LSTM performs variational mode decomposition on water consumption data to obtain a stable series with a relatively concentrated distribution frequency. However, the mode number K in the VMD method has a great influence on the decomposition effect of the signal. Using the empirical K value for decomposition often leads to problems of under-decomposition and over-decomposition, and lacks prevention for ensuring water quality when ensuring water resource optimization.
[0008] In view of the above problems, the present invention proposes a solution. Summary of the invention
[0009] In order to overcome the above-mentioned defects of the prior art, an embodiment of the present invention provides a water quality prediction and optimization method based on variational multimodality, which predicts water use patterns through variational multimodality and performs water quality warning according to the water use patterns, so as to solve the problems of under-decomposition and over-decomposition of the VMD method proposed in the above-mentioned background technology, and lack of prevention for ensuring water quality when ensuring water resources optimization.
[0010] To achieve the above object, the present invention provides the following technical solutions:
[0011] The invention discloses a water quality prediction optimization method based on variational multimodality, comprising the following steps: obtaining a water consumption abnormality analysis request, performing variational modal decomposition of the number of random modal components P times according to the water consumption abnormality analysis request, obtaining P groups of modal components of different frequencies and representing water consumption situations at different time scales, wherein the water consumption abnormality analysis request comprises a water consumption time series signal; calculating the coupling energy difference and signal residual between the P groups of modal components and the water consumption abnormality analysis request, establishing a signal residual change curve for the P groups based on the number of modal components, and taking the number of modal components corresponding to the group at the most prominent change as the optimal number of modal components; taking the optimal number of modal components as the number of modal components during variational modal decomposition, and performing variational modal decomposition on the water consumption abnormality analysis request to obtain optimized modal components; drawing a modal component waveform diagram for each optimized modal component, performing data analysis on the modal component waveform diagram, obtaining a water use pattern, and comparing the water use pattern with a preset water quality threshold, obtaining comparison data within a preset time period, performing data analysis, and carrying out water quality prevention.
[0012] In a preferred embodiment, the variational modal decomposition of P random modal components is performed according to the water consumption abnormality analysis request to obtain P groups of modal components with different frequencies and representing water consumption conditions at different time scales, and also includes an initial modal decomposition. The initial modal decomposition is used to perform variational modal decomposition on the water consumption time series signal to obtain several modal components with the smallest sum of estimated bandwidths.
[0013] In a preferred embodiment, the water use time series signal is subjected to variational modal decomposition to obtain several modal components with the minimum sum of estimated bandwidths, specifically: the water use time series signal is subjected to Hilbert transform and is randomly decomposed into K modal components; a variational problem is constructed with the preset discrimination accuracy of the modal components as a constraint condition to minimize the sum of the bandwidths of all modal components, and a constrained variational model is obtained; the constrained variational model is solved based on the alternating direction multiplier method and the modal components of the iterative constrained variational model are obtained. K modal components.
[0014] In a preferred embodiment, the variational problem is constructed based on Hilbert transform to obtain a constrained variational model, specifically: the water time series signal is based on Hilbert transform to calculate the analytical signal and one-sided spectrum of each modal component; a preset frequency modulation index term is introduced to adjust the center frequency of each modal component; the one-sided spectrum of each modal component is modulated to the baseband corresponding to each mode; the baseband of each modal component is matched with the corresponding center frequency, and the minimum bandwidth is calculated according to the square norm of the demodulated signal gradient; the minimum bandwidth and the analytical signal are analyzed to obtain the constrained variational model.
[0015] In a preferred embodiment, the constrained variational model is solved and iterated to obtain K modal components, specifically: Lagrange multipliers and penalty factors are introduced to transform the constrained variational model into an unconstrained variational model; the modal components and center frequencies are updated based on the alternating direction multiplier method, the saddle point of the unconstrained variational model is searched, and the iterative update is continuously performed until the saddle point meets the preset discrimination accuracy, the iteration is terminated, and K modal components are obtained.
[0016] In a preferred embodiment, the optimal number of modal components is determined based on the analysis of the coupling energy difference and signal residual between each modal component and the water use time series signal, specifically: the signal energy of the water use time series signal is calculated according to a preset signal energy calculation formula; different numbers of modal components are taken to perform variational modal decomposition on the water use time series signal, and the signal energy of each modal component under each number of modal components is calculated respectively; according to the sum of the signal energies of each modal component under each number of modal components, the energy difference between the sums of energies under each number of modal components is calculated; the residual sum of squares is calculated according to the energy difference under each number of modal components and the signal energy of the water use time series signal; and the modal component number corresponding to the smallest residual sum of squares among the residual sums of squares is selected as the optimal number of modal components.
[0017] In a preferred embodiment, the variational modal decomposition of the water consumption time series signal with the optimal number of modal components is performed to obtain modes of different frequencies, specifically: the water consumption time series signal is decomposed into modal components with the optimal number of modal components based on the variational modal decomposition; outliers are removed from the modal components, and the water consumption change curve of the corresponding frequency is plotted.
[0018] In a preferred embodiment, the water use pattern is analyzed according to the modal components of different frequencies, specifically: the frequency spectrum characteristics of the water consumption change curve of the modal components of different frequencies are analyzed to obtain the periodic characteristics at different frequencies; and the water use pattern is determined according to the periodic characteristics at different frequencies.
[0019] In a preferred embodiment, the water use pattern is compared with a preset water quality threshold, comparison data within a preset time period is obtained, and data analysis is performed to carry out water quality prevention, specifically: the water consumption at a certain time scale in the water use pattern is compared with the corresponding water quality threshold within the preset time period; when the total difference is greater than the preset warning threshold, it is judged that there is a risk of deterioration in the water quality of the time scale, an early warning is issued, and prevention is carried out in advance.
[0020] The technical effects and advantages of the variational multimodal water consumption anomaly detection method of the present invention are as follows:
[0021] 1. The present invention effectively decomposes complex signals into intrinsic mode components with limited bandwidth through variational mode decomposition, thereby extracting the time-frequency characteristics of the signal; the variational mode decomposition method solves the problem through a mathematical model, realizes the accurate decomposition of the signal, and is widely used in the fields of communication, electricity, biomedicine, etc.; its main advantages include high efficiency, accuracy and strong adaptability, and can retain the important characteristics of the original signal on different time scales, and the processing process of the signal data does not involve recursive operations, so that the processing efficiency is higher and the stability is stronger.
[0022] 2. The present invention determines the optimal number of modal decompositions by coupling energy difference and signal residual, obtains modes of different frequencies by optimal variational modal decomposition, and judges whether the water consumption is abnormal based on the modal analysis results; this method combines signal processing and statistical analysis, can effectively optimize the modal decomposition process, improve the analysis accuracy and anomaly detection capability of complex water consumption time series, and has practical application value and broad application prospects. BRIEF DESCRIPTION OF THE DRAWINGS
[0023] Figure 1 It is a structural schematic diagram of the water consumption anomaly detection method based on variational multimodality of the present invention. DETAILED DESCRIPTION
[0024] 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.
[0025] Embodiment 1, Figure 1 The present invention provides a method for detecting abnormal water consumption based on variational multimodality. The method for water quality prediction and optimization based on variational multimodality includes the following steps:
[0026] Step 1: Submit a water consumption anomaly analysis request: The user submits a big data water consumption anomaly analysis request, and the big data water consumption anomaly analysis request at least includes a water consumption time series signal;
[0027] Step 2: Perform initial modal decomposition: Perform variational modal decomposition on the water consumption time series signal to obtain multiple modal components with the smallest sum of estimated bandwidths;
[0028] Step 3: Determine the optimal number of modal components: Determine the optimal number of modal components by analyzing the coupling energy difference and signal residual between each modal component and the water use time series signal;
[0029] Step 4: Perform optimized modal decomposition: Perform variational modal decomposition with the optimal number of modal components on the water use time series signal to obtain modes of different frequencies;
[0030] Step 5: Determine if water consumption is abnormal: Analyze water consumption patterns based on modal analysis of different frequencies, and determine if water consumption is abnormal based on the patterns.
[0031] Aiming at the special signal of urban water use time series with characteristics of instability, nonlinearity and oscillation, this paper proposes a variational mode decomposition method based on K value optimization. Based on the principle of energy conservation between the original signal and the decomposed signal and the existence of signal residual after decomposition, a parameter optimization method of coupling energy difference and signal residual is established to determine the optimal k value. Under the optimal mode number k, the daily water intake data of a city water plant is subjected to variational mode decomposition with multi-year, year and month as the time scales, and the changing laws of different frequency components are extracted. The periodicity of water use laws at different time scales is obtained, which serves the detection of water consumption anomalies.
[0032] Variational modal decomposition is performed according to the anomaly detection requirements. The optimal number of modal components is determined according to the coupling energy difference and signal residual between each mode and the anomaly detection requirement. The variational modal decomposition process is optimized according to the optimal number of modal components. The water usage rules are determined according to each decomposed mode to make abnormal judgments on water consumption.
[0033] Variational mode decomposition is an adaptive, non-recursive time-frequency signal processing method. This method assumes that any signal can be decomposed into a linear combination of a series of intrinsic mode components with limited bandwidth. The signal processing problem is converted into a variational model solution problem, thereby achieving signal decomposition. At present, variational mode decomposition has been widely used in communications, electricity, biomedicine and other fields, but few studies have used it to analyze urban water use patterns. The mode number K in the variational mode decomposition method has a great influence on the decomposition effect of the signal. Using empirical K values for decomposition often leads to under-decomposition and over-decomposition problems. Based on this, this paper proposes a variational mode decomposition method with optimized K value to analyze the urban domestic water use pattern.
[0034] Step 1: Submit a water consumption anomaly analysis request: The user submits a big data water consumption anomaly analysis request, and the big data water consumption anomaly analysis request at least includes a water consumption time series signal;
[0035] Step 2: Perform initial modal decomposition: Perform variational modal decomposition on the water use time series signal to obtain multiple modal components with the smallest sum of estimated bandwidths.
[0036] The principle of variational modal decomposition is as follows: the variational modal signal processing method can decompose complex time series into a given number of intrinsic modal components, and the decomposed components have all the characteristics of the original data on the corresponding time scale; the purpose of variational modal decomposition is to find the modal components with the smallest sum of K estimated bandwidths. The modal components of different frequencies can be used to understand the overall laws and local vibration modes of the signal in more detail, and the original signal is obtained by adding the modal components.
[0037] In this embodiment, the original input signal is , t is the time variable. In this paper, the original input signal is a water use time series signal with time as the dependent variable and water consumption as the independent variable. In this embodiment, the modal component is , k=1,2,…,K, K is the total number of modal components.
[0038] In this embodiment, the water use time series signal is subjected to variational modal decomposition to obtain multiple modal components with the smallest sum of estimated bandwidths, specifically:
[0039] Based on Hilbert transform, a variational problem is constructed to obtain a constrained variational model;
[0040] The constrained variational model is solved and iterated multiple times to obtain K modal components.
[0041] In this embodiment, the variational problem is constructed based on Hilbert transform to obtain a constrained variational model, which is specifically:
[0042] Based on Hilbert transform, the analytical signal and one-sided spectrum of each modal component are calculated;
[0043] Exponential terms are introduced to adjust the center frequency of each modal component;
[0044] Modulate the single-sided spectrum of each modal component to the baseband corresponding to each mode;
[0045] The baseband of each modal component is matched to the corresponding center frequency, and the minimum bandwidth is calculated based on the square norm of the demodulated signal gradient;
[0046] The constrained variational model is obtained based on the minimum bandwidth and analytical signal analysis.
[0047] In this embodiment, the variational model is solved and iterated multiple times to obtain K modal components, specifically:
[0048] The Lagrange multiplier and penalty factor are introduced to transform the constrained variational model into an unconstrained variational model;
[0049] Based on the alternating direction multiplier method, the modes and center frequencies are updated to find the saddle point of the unconstrained variational model. The iteration is continued until the saddle point meets the preset discrimination accuracy. The iteration ends and K modal components are obtained.
[0050] In this embodiment, the specific calculation formula of the constrained variational model is:
[0051] In the formula, To find the partial derivative of the function with respect to time t, is the Dirac distribution, is an imaginary unit, Calculate the convolution The superscript and subscript in are the square and norm, respectively. is the modal component to be solved, is the modal component, t is the time variable, k=1,2,…,K, K is the total number of modal components.
[0052] In this embodiment, the specific calculation formula of the unconstrained variational model is:
[0053]
[0054] In the formula, is an unconstrained variational model, is the Lagrange multiplier, is the penalty factor, is the original input signal.
[0055] In this embodiment, the discrimination accuracy is expressed as follows:
[0056]
[0057] In the formula, yes The Fourier transform of is the update mode, and n is the number of iterations.
[0058] In this embodiment, Lagrange multipliers are a mathematical method for solving constrained optimization problems. By introducing Lagrange multipliers, the original constrained problem is transformed into an unconstrained problem, thereby making the solution process more feasible. Specifically, by incorporating constraints into the objective function, a Lagrange function is formed, i.e., the unconstrained variational model of this article, and applying optimization theory on this basis, the saddle point of the objective function can be effectively found, i.e., the point where the original problem reaches the optimal solution.
[0059] In this embodiment, the penalty factor is a method commonly used in mathematical optimization problems, and is used to deal with constrained optimization problems. It directly integrates the constraints into the objective function by adding a penalty term to the objective function, thereby converting the original constrained problem into an unconstrained problem. The key to this method is to select a suitable penalty factor, which needs to be large enough to ensure that the constraints are met, but not too large to avoid adverse effects on the optimization process. In this way, the penalty factor can effectively simplify the solution process of the original problem and obtain the optimal solution under the constraints.
[0060] In this embodiment, Hilbert transform refers to a tool widely used in signal processing and mathematical analysis, which can convert real functions into complex functions and enrich the analysis content of the signal by retaining the amplitude and phase information of the original signal; specifically, for a real function, Hilbert transform generates a complex function, called an analytical signal, whose imaginary part is the Hilbert transform of the original signal; this transform plays an important role in analyzing the frequency characteristics, phase information and time domain characteristics of the signal. In the frequency domain, it makes the spectrum of the signal symmetrical, thereby making it easier to perform frequency analysis and filtering processing.
[0061] In this embodiment, the analytical signal of each modal component refers to the analytical signal of each modal component obtained by Hilbert transform in the signal processing method; the analytical signal is a complex signal, which contains complete information of the original signal in the time and frequency domains, including amplitude and phase; specifically, for each modal component in VMD, we can obtain its analytical signal by applying Hilbert transform to its real part, and the imaginary part of the analytical signal is the Hilbert transform of the original signal in the frequency mode; this processing method enables VMD to effectively decompose complex signals and retain all characteristic information of the signal in different frequency modes, making further spectrum analysis and time characteristic analysis more convenient and accurate.
[0062] In this embodiment, the single-sided spectrum refers to symmetrically processing the spectrum of the complex signal on the frequency axis, merging its negative frequency part and the positive frequency part into a single spectrum graph; this processing is often used in the spectrum analysis of real signals, and by retaining the positive frequency information and discarding the negative frequency information, the spectrum analysis is more concise and effective.
[0063] In this embodiment, a saddle point refers to a special point of a multivariate function, where the function is a maximum in some directions and a minimum in other directions, and may be flat in other directions; in other words, a saddle point is a position where the gradient of the function is zero but is not a local extreme point; this characteristic makes saddle points important in optimization algorithms, especially for solving non-convex problems and finding suitable optimization paths and convergence conditions.
[0064] In this embodiment, the center frequency of each modal component refers to the main frequency component assigned to each modal component during the signal decomposition process; these frequency components reflect the oscillation characteristics and frequency distribution of the modal component in the time domain; in methods such as VMD, by adjusting the center frequency of the modal component, each modal component can be better adapted to the local vibration mode and overall frequency characteristics of the signal, thereby effectively decomposing complex signals and extracting important feature information at different time scales.
[0065] In this embodiment, the square norm of the demodulated signal gradient refers to an important indicator used in signal processing to measure signal changes during the demodulation process; it is usually used to evaluate the difference between the demodulated signal and the original signal or the effect of the demodulation process; calculating the square norm of the demodulated signal gradient can help determine possible errors in the demodulation process or optimize the efficiency of the demodulation algorithm. The smaller the value, the closer the demodulated signal is to the original signal, otherwise there may be greater distortion or error.
[0066] In this embodiment, the Dirac distribution is a generalized function (or distribution) in mathematics, which is also called the delta function or unit impulse function in physics and engineering. It is mathematically defined as a distribution that takes infinity at the origin and is zero elsewhere. Its properties are often used to simulate point-like or concentrated mass or energy at a certain location during integration. The Dirac distribution has a wide range of applications in fields such as function analysis, signal processing, and quantum mechanics, and plays an important role in describing pulse signals, detector responses, and the mathematical basis of generalized functions.
[0067] In this embodiment, the alternating direction multiplier method refers to an iterative algorithm for solving constrained optimization problems; it transforms the original constrained optimization problem into an unconstrained problem by introducing Lagrange multipliers and penalty factors, and gradually approaches the optimal solution by alternatingly updating variables and multipliers; it is particularly effective in dealing with large-scale problems and distributed optimization, because it can decompose the problem into multiple sub-problems and perform parallel calculations on each sub-problem, thereby accelerating convergence and reducing computational costs.
[0068] This embodiment uses variational mode decomposition to be an adaptive, non-recursive time-frequency signal processing method, which can effectively decompose complex signals into intrinsic mode components with limited bandwidth, thereby extracting the time-frequency characteristics of the signal; the VMD method solves the problem through a mathematical model, realizes the accurate decomposition of the signal, and is widely used in communications, electricity, biomedicine and other fields; its main advantages include high efficiency, accuracy and strong adaptability, and can retain the important features of the original signal on different time scales, and the processing process of the signal data does not involve recursive operations, so that the processing efficiency is higher and the stability is stronger.
[0069] Embodiment 2, step 3: determining the optimal number of modal components: determining the optimal number of modal components by analyzing the coupling energy difference and signal residual between each modal component and the water use time series signal;
[0070] Step 4: Perform optimized modal decomposition: Perform variational modal decomposition with the optimal number of modal components on the water use time series signal to obtain modes of different frequencies;
[0071] Step 5: Draw a modal component waveform for each optimized modal component, perform data analysis on the modal component waveform to obtain water use patterns, and compare the water use patterns with the preset water quality thresholds to obtain comparison data within a preset time period, perform data analysis, and conduct water quality prevention.
[0072] The optimization principle of K value is as follows: As we know from the previous text, the total number of modal components K has a great influence on the decomposition effect of the signal; if the modal number K value is too small, it will lead to under-decomposition, that is, some intrinsic modes contained in the signal are not completely decomposed; if the modal number K is set too large, the signal will be over-decomposed, and a large base K value of the original component will lead to over-decomposition, that is, false modes that are not contained in the signal are generated; on the one hand, the modal decomposition process follows the principle of energy conservation, and the sum of the energies of the decomposed signals should be equal to the energy of the original signal; on the other hand, from a statistical point of view, modal decomposition requires that the sum of the decomposed modes is equal to the original signal, but when solving, only an approximate solution close to the true solution can be obtained, so there is a residual between the original signal and the sum of the modes after VMD decomposition; for the special variable of urban water consumption, a method of coupling energy difference and signal residual is proposed to determine the optimal modal number K.
[0073] The optimal number of modal components is determined by analyzing the coupling energy difference and signal residual between each modal component and the water use time series signal, specifically:
[0074] Take different numbers of modal components to perform variational modal decomposition on the water use time series signal, and calculate the signal energy of each modal component under each number of modal components;
[0075] Calculate the sum of the signal energies of each modal component under each modal component quantity, and calculate the energy difference between the sums of the energies under each modal component quantity;
[0076] Calculate the signal energy of the water use time series signal;
[0077] The residual sum of squares between the energy difference under each modal component number and the signal energy of the water use time series signal is calculated, and the modal component number corresponding to the smallest residual sum of squares among the residual sums of squares is selected as the optimal modal component number.
[0078] In this embodiment, the specific calculation formula of the signal energy is as follows:
[0079]
[0080] In the formula, is the signal energy, is the number of sampling points, is the i-th element in the signal.
[0081] In this embodiment, the calculation formula of the energy difference is as follows:
[0082]
[0083] In the formula, 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.
[0084] In this implementation, the residual sum of squares is calculated as follows:
[0085]
[0086] In the formula, is the residual sum of squares, and H is the total number of trials.
[0087] It should be noted that the size of the energy difference is positively correlated with the degree of decomposition. The larger the energy difference, the more prominent the over-decomposition phenomenon of the variational mode decomposition. The smaller the energy difference, the signal may be under-decomposed. For a non-stationary complex signal, it will fluctuate around a small value when under-decomposed or decomposed appropriately. With the increase of parameter K, over-decomposition will occur, and the value of K at the turning point can be used as the effective modal value of the variational mode decomposition.
[0088] It should be noted that different K values are used to perform variational mode decomposition on the signal, and other parameters take the standard variational mode default values. After decomposition, the corresponding residual sum of squares are calculated respectively. The smaller the residual sum of squares, the better the variational mode decomposition effect; the optimal number of modal components can be obtained by combining the energy difference and the residual calculation.
[0089] In this embodiment, the residual refers to the difference or error between the observed value and the theoretical value (or predicted value). In statistics, the residual refers to the difference between the actual observed data and the fitted model, which is a key indicator for evaluating the degree of model fit and the size of the error. The residual can be used to detect whether the model fits the data, evaluate the accuracy of the model, and is often used to adjust model parameters or improve prediction accuracy in regression analysis and optimization problems.
[0090] In this embodiment, the variational modal decomposition of the water use time series signal to optimize the number of optimal modal components is performed to obtain modes of different frequencies, specifically:
[0091] Decomposing the water consumption time series signal into modal components with the optimal number of modal components based on variational modes;
[0092] The modal components are outliers removed, and the water consumption change curve of the corresponding frequency is drawn.
[0093] In this embodiment, the variational modal decomposition of the water use time series signal to optimize the number of optimal modal components is performed to obtain modes of different frequencies, specifically:
[0094] Analyze the frequency spectrum characteristics of the water consumption change curve of the modal components of different frequencies to obtain the periodic characteristics at different frequencies;
[0095] Determine the water usage pattern based on the periodic characteristics at different frequencies.
[0096] In this embodiment, the water use pattern is compared with a preset water quality threshold, the comparison data within a preset time period is obtained, and data analysis is performed to prevent water quality, specifically:
[0097] The water consumption at a certain time scale in the water use pattern is compared with the corresponding water quality threshold within a preset time period. When the total difference is greater than the preset warning threshold, it is judged that there is a risk of deterioration in the water quality at that time scale, and an early warning is issued to prevent it in advance.
[0098] This embodiment determines the optimal number of modal decompositions by coupling energy difference and signal residual, obtains modes of different frequencies by optimal variational modal decomposition, and judges whether the water consumption is abnormal based on the modal analysis results; this method combines signal processing and statistical analysis, can effectively optimize the modal decomposition process, improve the analysis accuracy and anomaly detection capability of complex water use time series, and has practical application value and broad application prospects.
[0099] 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.
[0100] 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.
[0101] 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.
[0102] 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.
[0103] 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.
[0104] 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 water quality prediction optimization method based on variational multimodality, characterized in that: The steps include: Obtaining a water consumption abnormality analysis request, performing a variational modal decomposition of P random modal components on the water consumption abnormality analysis request to obtain P groups of modal components, wherein the water consumption abnormality analysis request includes a water consumption time series signal; The signal energy of the water consumption time series signal is obtained, and the variational modal decomposition of the water consumption time series signal is performed through different numbers of modal components, and the signal energy of each modal component under each number of modal components is calculated respectively, and the energy difference between the sums of the energies under each number of modal components is calculated according to the sum of the signal energies of each modal component under each number of modal components; The residual sum of squares is calculated according to the energy difference under each modal component number and the signal energy of the water use time series signal, and the modal component number corresponding to the smallest residual sum of squares among the residual sums of squares is selected as the optimal modal component number; Perform variational modal decomposition of the optimal number of modal components on the water consumption anomaly analysis request to obtain the optimized modal components of the optimal number of modal components; A modal component waveform graph is plotted for each optimized modal component, and data analysis is performed on the modal component waveform graph to obtain water use patterns. The water use patterns are compared with preset water quality thresholds to obtain comparative data within a preset time period, and data analysis is performed to carry out water quality prevention.
2. The water quality prediction optimization method based on variational multimodality according to claim 1 is characterized in that: The P groups of modal components include modal components with the smallest sum of bandwidths of the P groups, and the number of modal components in each group is the same as the number of modal components corresponding to the variational modal decomposition.
3. The water quality prediction optimization method based on variational multimodality according to claim 2 is characterized in that: The variational modal decomposition of the number of random modal components of the water consumption abnormality analysis request is performed as follows: The water consumption time series signal of the water consumption anomaly analysis request is randomly decomposed into K modal components based on Hilbert transform; The preset discrimination accuracy of the modal component is taken as a constraint condition, and a variational problem is constructed with the goal of minimizing the sum of the bandwidths of all modal components to obtain a constrained variational model. The constrained variational model is solved and iterated by the alternating direction multiplier method to obtain K modal components.
4. The water quality prediction optimization method based on variational multimodality according to claim 3 is characterized in that: The preset discrimination accuracy of the modal component is used as a constraint condition, and a variational problem is constructed with the goal of minimizing the sum of the bandwidths of all modal components to obtain a constrained variational model, which is specifically: Calculate the analytical signal and one-sided spectrum of each modal component based on Hilbert transform; A preset frequency modulation index term is introduced to adjust the center frequency of each modal component; Modulate the single-sided spectrum of each modal component to the baseband corresponding to each modal component; The baseband of each modal component is matched to the corresponding center frequency, and the minimum bandwidth is calculated based on the square norm of the demodulated signal gradient; Combine the minimum bandwidth, analytical signal into a constrained variational model.
5. The water quality prediction optimization method based on variational multimodality according to claim 3 is characterized in that: The constrained variational model is solved by the alternating direction multiplier method and the modal components of the constrained variational model are iterated to obtain K modal components, which are specifically: Based on Lagrange multipliers and penalty factors, the constrained variational model is transformed into an unconstrained variational model; Update the modal components and center frequencies based on the alternating direction multiplier method to find the saddle point of the unconstrained variational model; The iteration is continued until the saddle point meets the preset discrimination accuracy, and the iteration ends to obtain K modal components.
6. The water quality prediction optimization method based on variational multimodality according to claim 3 is characterized in that: The variational modal decomposition of the optimal number of modal components is performed on the water consumption abnormality analysis request to obtain the optimized modal components of the optimal number of modal components, specifically: Decomposing the water consumption time series signal into modal components with the optimal number of modal components based on variational modes; The modal components are outliers removed, and the water consumption change curve of the corresponding frequency is drawn.
7. The water quality prediction optimization method based on variational multimodality according to claim 3 is characterized in that: The data analysis of the modal component waveform diagram is performed to obtain the water use pattern, which is specifically: Analyze the frequency spectrum characteristics of the water consumption change curve of the modal components of different frequencies to obtain the periodic characteristics at different frequencies; According to the periodic characteristics at different frequencies, the water use patterns at different time scales are determined.
8. The water quality prediction optimization method based on variational multimodality according to claim 3 is characterized in that: The water use pattern is compared with the preset water quality threshold, the comparison data within the preset time period is obtained, and the data is analyzed to prevent water quality, specifically: Compare the water consumption at a certain time scale in the water use pattern with the corresponding water quality threshold within a preset time period; When the total difference is greater than the preset warning threshold, it is judged that there is a risk of deterioration in the water quality on that time scale, and an early warning is issued to take precautions in advance.
9. The water quality prediction optimization method based on variational multimodality according to claim 3 is characterized in that: The specific calculation formula of the signal energy is as follows: In this embodiment, the calculation formula of the energy difference is as follows: In this implementation, the residual sum of squares is calculated as follows: In the formula, is the residual sum of squares, H is the total number of trials, is the signal energy, 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, is the water use time series signal, t is the time variable, is the modal component, k=1,2,…,K, K is the number of modal components.
Citation Information
Patent Citations
Water consumption anomaly detection method and database server
CN108595687B
Water consumption visualization system and method based on water consumption factors per ten thousand yuan of GDP
CN116561393B
Optimization algorithm for automatically determining variational mode decomposition parameters based on bearing vibration signals
CN114742097A