Drinking water quality data interpolation method and device based on PID (Proportion Integration Differentiation) control tensor decomposition
Through the tensor decomposition method based on PID control, the target loss function is optimized by a nonlinear PID controller, and the hidden feature matrix is quickly extracted, which solves the problem of slow convergence speed in tensor hidden feature representation learning, and realizes efficient interpolation of water quality data, which is suitable for large-scale monitoring networks.
Patent Information
- Application Number
- CN202510327554.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-03-19
- Publication Date
- 2025-07-29
AI Technical Summary
The existing representation learning method based on tensor hidden features has the problem of slow convergence of gradient descent algorithms in water quality monitoring, especially when large-scale monitoring of data, resulting in low accuracy in water quality data prediction.
The tensor decomposition method based on PID control is adopted to construct water quality data tensors, and the target loss function is optimized using a nonlinear PID controller, combined with the stochastic gradient descent algorithm to quickly extract the hidden feature matrix to achieve interpolation of missing data.
It realizes fast and accurate filling of missing water quality data, provides high-rootability data support, is suitable for the intelligent needs of large-scale monitoring networks, and improves data processing efficiency and accuracy.
Smart Images

Figure CN120386987A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of data processing, and particularly to a method and device for interpolating drinking water quality data based on PID control tensor decomposition. Background Art
[0002] With the rapid development of sensor technology, automatic water quality monitoring stations have been widely used in the field of water quality monitoring, and can detect and record a variety of water quality indicators in real time, such as pH value, dissolved oxygen, temperature, etc. These data provide important support for scientific decision-making in fields such as pollution reduction, water resource management, and urban planning. However, due to reasons such as equipment failure, transmission interruption, or environmental interference, there are often a large number of missing values in water quality monitoring data. If such incomplete data is directly used for statistical analysis, it may lead to result deviation, thereby affecting the accuracy and certainty of the decision-making support provided for various fields.
[0003] In response to the above problems, existing research has proposed a variety of interpolation methods for missing data. Among them, the representation learning method based on tensor hidden features provides a feasible solution for achieving accurate interpolation of monitoring missing data. The representation learning model based on tensor hidden features models the spatio-temporal data of water quality monitoring as a high-dimensional incomplete tensor, and based on the known values in the tensor, mines the potential structures and rules in the data to effectively capture the complex spatio-temporal correlation features in the data, thereby achieving accurate prediction of the missing data in water quality monitoring. Specifically, this method constructs multiple rank-one tensors using the hidden feature matrix, and through continuous training, makes the sum of the rank-one tensors as close as possible to the high-order incomplete tensor constructed from historical water quality monitoring data.
[0004] Although the representation learning method based on tensor hidden features can effectively handle the problem of water quality data interpolation, it still has certain limitations. The representation learning method of tensor hidden features realizes the approximation of known values by training the hidden feature matrix. This process often relies on the gradient descent algorithm to optimize the hidden feature matrix, and the gradient descent algorithm has the problem of slow convergence speed in practical applications, which to a certain extent limits the efficiency of the model. Especially when facing large-scale water quality monitoring data, these problems are particularly prominent. Therefore, how to more quickly and accurately implement the interpolation of incomplete water quality data has become a key problem that needs to be solved urgently. Summary of the Invention
[0005] Aiming at the problem of low accuracy of water quality data prediction in the prior art, the present invention proposes a method and device for interpolating drinking water quality data based on PID control tensor decomposition.
[0006] To achieve the above object, the present invention provides the following technical solutions:
[0007] A method for interpolating drinking water quality data based on PID control tensor decomposition specifically includes the following steps:
[0008] S1: Obtain historical water quality data from the server and store it.
[0009] S2: Construct a water quality data tensor based on the historical water quality data.
[0010] S3: Construct an objective loss function based on the water quality data tensor and perform iterative training to extract the latent feature matrix.
[0011] S4: Calculate the missing water quality prediction data values based on the extracted latent feature matrix and perform interpolation.
[0012] Preferably, in S1, the received historical water quality data is stored in a five-tuple X = (s, m, d, h, v), where s represents the site, m represents the type of monitoring index, d represents the number of days of monitoring time, h represents the number of hours of monitoring time, and v represents the observed value of the m-type monitoring target measured by the sensor at site s at the h-th hour on the d-th day at site s.
[0013] Preferably, in S2, the water quality data tensor is Y I×J×K×L , where I represents the number of sites collecting this index, J is the number of types of sensor monitoring indexes at all sites, K represents the number of days covered by the monitoring data, and H represents the number of hours covered by the monitoring data.
[0014] Preferably, S3 includes:
[0015] S3-1: Construct an objective loss function based on the water quality data tensor Y.
[0016] S3-2: Minimize and optimize the objective loss function according to the stochastic gradient descent algorithm.
[0017] S3-3: Determine whether the objective loss function reaches the termination condition. If not, continue the training iteration; if so, stop the training iteration and output four latent feature tensors.
[0018] Preferably, in S3-1, the objective loss function is:
[0019]
[0020] In formula (1), ε represents the objective loss function; S represents the latent feature matrix of water quality monitoring sites; M represents the latent feature matrix of monitoring index types; D represents the latent feature matrix of monitoring days; H represents the latent feature matrix of monitoring hours; y ijkh ∈Λ represents the known entity in the water quality data tensor Y, that is, the observed value of the observed index j at the i-th observation site on the k-th day and the l-th hour; R represents the latent feature space dimension; sir represents the value of the \(i\)-th row and \(r\)-th column in the hidden feature matrix \(S\) of the monitoring site; \(m\) jr represents the value of the \(j\)-th row and \(r\)-th column in the hidden feature matrix \(M\) of the monitoring index type; \(d\) kr represents the value of the \(k\)-th row and \(r\)-th column in the hidden feature matrix \(D\) of the monitoring days; \(h\) lr represents the value of the \(l\)-th row and \(r\)-th column in the hidden feature matrix \(H\) of time; \(\lambda\) represents the regularization parameter.
[0021] Preferably, in the above \(S3 - 2\), the optimization objective loss function is:[[]]
[0022]
[0023] In formula (2), \(n\) represents the number of iteration rounds, represents the value of the \(i\)-th row and \(r\)-th column in the hidden feature matrix \(S\) at the \((n + 1)\)-th iteration; represents the value of the \(i\)-th row and \(r\)-th column in the hidden feature matrix \(S\) at the \(n\)-th iteration; \(\eta\) represents the learning rate; represents the value of the \(j\)-th row and \(r\)-th column in the hidden feature matrix \(M\) at the \(n\)-th iteration; represents the value of the \(k\)-th row and \(r\)-th column in the hidden feature matrix \(D\) of the monitoring days at the \(n\)-th iteration; represents the value of the \(l\)-th row and \(r\)-th column in the hidden feature matrix \(H\) of time at the \(n\)-th iteration; represents the value of the \(j\)-th row and \(r\)-th column in the hidden feature matrix \(M\) at the \((n + 1)\)-th iteration; represents the value of the \(k\)-th row and \(r\)-th column in the hidden feature matrix \(D\) of the monitoring days at the \((n + 1)\)-th iteration; represents the value of the \(l\)-th row and \(r\)-th column in the hidden feature matrix \(H\) of time at the \((n + 1)\)-th iteration;
[0024] wherein, represents the difference between the observed value and the current system prediction value of the monitoring index type \(j\) of the water quality monitoring site \(i\) at the \(k\)-th day and \(h\)-th hour at the \(n\)-th iteration:
[0025]
[0026] In formula (3), \(K\) p , \(K\) I , \(K\) D respectively represent the hyperparameters of the non - linear PID controller; is composed of terms: represents the proportional term, which plays a role similar to the learning rate; represents the integral term, which is the accumulation of past errors considering the past error situation, \(\alpha\) i , \(\beta\) i are the hyperparameters of the non - linear function for the integral term; is the differential term, which uses the difference between two iterations to consider the trend of the error, α d , β d are hyperparameters of the non - linear function for the differential term; y ijkl represents the known entity in the water quality data tensor Y, that is, the observed value of the observed index j at the i - th observation site on the k - th day and the l - th hour; R represents the dimension of the latent feature space;
[0027]
[0028] In formula (4), f represents the non - linear function, which is a combination of the power function and the sign function sign; α, β represent hyperparameters.
[0029] Preferably, in the S3 - 3, there are two cases where the target loss function reaches the termination condition: the total number of iterations reaches the set maximum value N, or the difference between the value of the target loss function ε calculated in the current round and the value of the target loss function ε in the previous round is less than the threshold δ for five consecutive rounds.
[0030] Preferably, in the S4, the calculation method of the water quality prediction data value is as follows:
[0031]
[0032] In formula (5), represents the known entity in the water quality data tensor Y, that is, the water quality prediction data value of the observed index j at the i - th observation site on the k - th day and the l - th hour; R represents the dimension of the latent feature space; s ir represents the value of the r - th column in the i - th row of the latent feature matrix S of the monitoring site; m jr represents the value of the r - th column in the j - th row of the latent feature matrix M of the monitoring index type; d kr represents the value of the r - th column in the k - th row of the latent feature matrix D of the monitoring days; h lr represents the value of the r - th column in the l - th row of the time latent feature matrix H.
[0033] The present invention also provides a drinking water quality data imputation device based on PID - controlled tensor decomposition, including a data acquisition module, a storage module, a tensor construction module, a latent feature extraction module, and an output module;
[0034] The data acquisition module is used to obtain historical water quality data from the server and store it;
[0035] The storage module is used to store the received historical water quality data and the missing water quality prediction data values;
[0036] The tensor construction module is used to construct a water quality data tensor according to the stored historical water quality data;
[0037] The hidden feature extraction module is used to construct an objective loss function based on the water quality data tensor and historical water quality data, and extract hidden features;
[0038] The output module is used to output the missing water quality prediction data values according to the extracted hidden features.
[0039] Preferably, the hidden feature extraction module includes an initialization unit, an objective loss function construction unit, a PID control unit, and a training unit;
[0040] The initialization unit is used to initialize the process parameters involved in the extraction process of the water quality data tensor;
[0041] The objective loss function construction unit is used to construct an objective loss function according to the water quality data tensor, historical water quality data, and process parameters;
[0042] The PID control unit is used to calculate the error of the water quality data passing through the PID controller;
[0043] The training unit is used to train and optimize the objective loss function and extract hidden features.
[0044] In summary, due to the adoption of the above technical solutions, compared with the prior art, the present invention has at least the following beneficial effects:
[0045] The present invention provides a water quality monitoring data interpolation method and device based on nonlinear PID and tensor hidden feature decomposition. By constructing the water quality data of the monitoring site into a tensor model to capture multi-dimensional correlation features, using tensor hidden feature decomposition to extract the potential laws of the data, and combining nonlinear PID to dynamically optimize the interpolation process, missing or abnormal values can be filled quickly and accurately, providing high-robustness data support for intelligent environmental protection and watershed management, with the advantages of efficient calculation and multi-dimensional adaptability, and being suitable for the intelligent needs of large-scale monitoring networks. BRIEF DESCRIPTION OF THE DRAWINGS
[0046] Figure 1 Schematic diagram of a drinking water quality data interpolation method based on PID control tensor decomposition according to an exemplary embodiment of the present invention.
[0047] Figure 2 Schematic diagram of a drinking water quality data interpolation device based on PID control tensor decomposition according to an exemplary embodiment of the present invention.
[0048] Figure 3 Schematic diagram of a storage module according to an exemplary embodiment of the present invention.
[0049] Figure 4 Schematic diagram of a hidden feature extraction module according to an exemplary embodiment of the present invention. DETAILED DESCRIPTION OF THE EMBODIMENTS
[0050] The present invention will be further described in detail below in conjunction with embodiments and specific implementation manners. However, this should not be construed as limiting the scope of the above-mentioned subject matter of the present invention to the following embodiments. Any technology implemented based on the content of the present invention belongs to the scope of the present invention.
[0051] In the description of the present invention, it should be understood that the orientation or positional relationships indicated by the terms "longitudinal", "transverse", "upper", "lower", "front", "rear", "left", "right", "vertical", "horizontal", "top", "bottom", "inner", "outer", etc. are based on the orientation or positional relationships shown in the drawings, and are only for the convenience of describing the present invention and simplifying the description, rather than indicating or implying that the device or element referred to must have a specific orientation, be constructed and operated in a specific orientation, and thus should not be construed as limiting the present invention.
[0052] As Figure 1 shown, the present invention provides a drinking water quality data imputation method based on PID control tensor decomposition, which specifically includes the following steps:
[0053] S1: Receive the instruction for water quality data imputation sent by the server, and obtain and store the historical drinking water quality data from the server.
[0054] The way for the server to send the instruction can be: regularly, or according to the notification of the device, or according to the notification of a certain server, send the instruction for predicting the learning diagnosis of students to the data receiving module.
[0055] In this embodiment, the received historical water quality data is stored in a five-tuple X = (s, m, d, h, v), where s represents the site, m represents the type of monitoring index, d represents the number of days of monitoring time, h represents the number of hours of monitoring time, and v represents the observed value of the m-type monitoring target measured by the sensor at the site s at the h-th hour on the d-th day at the site s.
[0056] S2: Construct a water quality data tensor Y according to the historical drinking water quality data.
[0057] In this embodiment, all five-tuples X = (s, m, d, h, v) are constructed into a water quality data tensor Y I×J×K×L , where I represents the number of sites for collecting this index, J is the number of types of sensor monitoring indexes at all sites, K represents the number of days covered by the monitoring data, and H represents the number of hours covered by the monitoring data.
[0058] Specifically, the element y in the tensor ijkhDenote the observed value of the monitoring index type j at the h-th hour on the k-th day at the water quality monitoring site i. Among them, 1 ≤ i ≤ I, 1 ≤ j ≤ J, 1 ≤ k ≤ K, 1 ≤ l ≤ L. Due to reasons such as equipment failure, transmission interruption, or environmental interference, there must be a certain number of missing values in the water quality data tensor Y. Let Λ represent the set of known observed values included in the water quality data tensor Y. At the same time, for the outliers generated during part of the observations, such as data outside the sensor observation range (e.g., <0.01, >1000), the numerical values are respectively set to 0 and the upper limit value of the sensor.
[0059] S3: Construct the target loss function according to the water quality data tensor and perform iterative training to extract the hidden feature matrix.
[0060] S3-1: Construct the target loss function ε according to the known data set Λ of the water quality data tensor Y, which is represented by the following formula:
[0061]
[0062] In formula (1), ε represents the target loss function; S represents the hidden feature matrix of the water quality monitoring site; M represents the hidden feature matrix of the monitoring index type; D represents the hidden feature matrix of the monitoring days; H represents the hidden feature matrix of the monitoring hours; y ijkh ∈Λ represents the known entity in the water quality data tensor Y, that is, the observed value of the observed index j at the i-th observation site on the k-th day and the l-th hour; R represents the dimension of the hidden feature space; s ir represents the value of the i-th row and the r-th column in the hidden feature matrix S of the monitoring site; m jr represents the value of the j-th row and the r-th column in the hidden feature matrix M of the monitoring index type; d kr represents the value of the k-th row and the r-th column in the hidden feature matrix D of the monitoring days; h lr represents the value of the l-th row and the r-th column in the time hidden feature matrix H; λ represents the regularization parameter.
[0063] In this embodiment, the F norm is used as the optimization objective; L2 regularization is used, and λ is the regularization factor to constrain the optimization process to prevent overfitting problems during the optimization process.
[0064] S3-2: To minimize the optimization objective loss function ε, according to the principle of the stochastic gradient descent algorithm, the training iteration formula of this model is as follows:
[0065]
[0066] In formula (2), n represents the number of iteration rounds, represents the value of the i-th row and the r-th column in the hidden feature matrix S at the (n + 1)-th iteration; represents the value of the i-th row and the r-th column in the hidden feature matrix S at the n-th iteration; η represents the learning rate; represents the value at the \(j\)-th row and \(r\)-th column of the hidden feature matrix \(M\) at the \(n\)-th iteration; represents the value at the \(k\)-th row and \(r\)-th column of the hidden feature matrix \(D\) of the monitoring days at the \(n\)-th iteration; represents the value at the \(l\)-th row and \(r\)-th column of the time hidden feature matrix \(H\) at the \(n\)-th iteration; represents the value at the \(j\)-th row and \(r\)-th column of the hidden feature matrix \(M\) at the \((n + 1)\)-th iteration; represents the value at the \(k\)-th row and \(r\)-th column of the hidden feature matrix \(D\) of the monitoring days at the \((n + 1)\)-th iteration; represents the value at the \(l\)-th row and \(r\)-th column of the time hidden feature matrix \(H\) at the \((n + 1)\)-th iteration;
[0067] where, represents the difference between the observed value and the current system predicted value of the monitoring index type \(j\) at the \(k\)-th day and \(h\)-th hour of the water quality monitoring site \(i\) at the \(n\)-th iteration, which is redefined by the non-linear PID controller, and the iteration speed is dynamically controlled by the PID controller to accelerate the model convergence:
[0068]
[0069]
[0070] In formula (3), \(K\) p , \(K\) I , \(K\) D respectively represent the hyperparameters of the non-linear PID controller; is composed of terms: represents the proportional term, which plays a role similar to the learning rate; represents the integral term, which is the accumulation of past errors , considering the past error situation, \(\alpha\) i , \(\beta\) i are the hyperparameters of the non-linear function for the integral term; is the differential term, which uses the difference between two iterations to consider the trend of the error, \(\alpha\) d , \(\beta\) d are the hyperparameters of the non-linear function for the differential term; \(y\) ijkl represents the known entity in the water quality data tensor \(Y\), that is, the observed value of the observed index \(j\) at the \(i\)-th observation site on the \(k\)-th day and \(l\)-th hour; \(R\) represents the dimension of the hidden feature space;
[0071]
[0072] In formula (4), f represents a non-linear function, which is a combination of a power function and the sign function sign; α and β represent hyperparameters; the smaller the error, the higher the magnification factor of the non-linear function mapping. That is, for the integral term and the differential term, as the number of iteration rounds increases, the integral term increases, enhancing the ability of the PID controller to eliminate the steady-state error. At the same time, the differential term also continuously increases to prevent excessive overshoot caused by the increase in the integral term.
[0073] S3-3: Determine whether the training iteration process of the target loss function ε on the known data set Λ reaches the termination condition. If not, continue the training iteration; if so, stop the training iteration and output the four hidden feature tensors S, M, D, and H.
[0074] In this step, there are two cases where the training iteration process of the target loss function ε on the known data set Λ reaches the termination condition: the total number of iteration rounds reaches the set maximum value N, or the difference between the value of the target loss function ε calculated in the current round and the value of the target loss function ε in the previous round is less than the threshold δ for five consecutive rounds.
[0075] S4: Calculate the missing water quality based on the extracted hidden feature matrix, and store the imputed data:
[0076]
[0077] In formula (5), represents the entity in the complete water quality data tensor after interpolation, that is, the predicted data value of the observation index j at the i-th observation site on the k-th day and the l-th hour. Λ represents the set of known entities in the historical water quality data tensor; R represents the dimension of the hidden feature space; s ir represents the value of the r-th column in the i-th row of the hidden feature matrix S of the monitoring site; m jr represents the value of the r-th column in the j-th row of the hidden feature matrix M of the monitoring index type; d kr represents the value of the r-th column in the k-th row of the hidden feature matrix D of the monitoring days; h lr represents the value of the r-th column in the l-th row of the time hidden feature matrix H.
[0078] The present invention can not only quickly and accurately fill in the missing data, but also be widely applied to fields such as water quality monitoring and ecological protection, providing strong technical support for water resource management and environmental protection.
[0079] Based on the above-mentioned drinking water quality data imputation method based on PID control tensor decomposition, as Figure 2 shown, the present invention also provides a drinking water quality data imputation device based on PID control tensor decomposition, including a data acquisition module 1, a storage module 2, a tensor construction module 3, a hidden feature extraction module 4, and an output module 5.
[0080] The output end of the data acquisition module 1 is connected to the first input end of the storage module 2. The output end of the storage module 2 is respectively connected to the input end of the tensor construction module 3. The output end of the tensor construction module 3 is connected to the input end of the hidden feature extraction module 4. The output end of the hidden feature extraction module 4 is connected to the input end of the output module 5. The output end of the output module 5 is connected to the second input end of the storage module 2.
[0081] Among them, the data acquisition module 1 is used to obtain historical water quality data from the server and store it.
[0082] The storage module 2 is used to store the received historical water quality data and the missing water quality prediction data values.
[0083] In this embodiment, as Figure 3 shown, the storage module 2 includes a first storage unit 21 and a second storage unit 22;
[0084] The first storage unit 21 is used to store the received historical water quality data, which is stored in the form of a five-tuple X = (s, m, d, h, v), where s represents the site, m represents the type of monitoring index, d represents the number of days of monitoring time, h represents the number of hours of monitoring time, and v represents the observed value of the m-type monitoring target measured by the sensor at the site s at the hth hour on the dth day at the site s.
[0085] The second storage unit 22 is used to store the missing water quality prediction data values output by the output module.
[0086] In this embodiment, the tensor construction module 3 is used to construct a water quality data tensor according to the stored historical water quality data: Y I×J×K×L , where I represents the number of sites for collecting this index, J is the number of types of sensor monitoring indexes at all sites, K represents the number of days covered by the monitoring data, and H represents the number of hours covered by the monitoring data.
[0087] The hidden feature extraction module 4 is used to construct an objective loss function according to the water quality data tensor and the historical water quality data, and extract hidden features.
[0088] As Figure 4 shown, the hidden feature extraction module 4 includes an initialization unit 41, an objective loss function construction unit 42, a PID control unit 43, and a training unit 44. The output end of the initialization unit 41 is connected to the input end of the objective loss function construction unit 42. The output end of the objective loss function construction unit 42 is connected to the first input end of the training unit 44. The output end of the PID control unit 43 is connected to the second input end of the training unit 44. The output end of the training unit 44 is connected to the output module 5.
[0089] The initialization unit 41 is used to initialize the process parameters involved in the process of extracting the water quality data tensor;
[0090] A target loss function construction unit 42 for constructing a target loss function according to the water quality data tensor, historical water quality data, and process parameters;
[0091] A PID control unit 43 for calculating the error of the water quality data passing through the PID controller;
[0092] A training unit 44 for training and optimizing the target loss function to extract hidden features.
[0093] An output module 5 for outputting the missing water quality prediction data values according to the extracted hidden features.
[0094] The present invention also provides an electronic device, which includes a processor for running a computer program stored in a memory, so that the electronic device implements the steps of the drinking water quality data interpolation method based on PID control tensor decomposition in the above embodiments.
[0095] The present invention also provides a computer-readable storage medium storing a computer program, and when the computer program runs on a processor, it implements the steps of the drinking water quality data interpolation method based on PID control tensor decomposition in the above embodiments.
[0096] The computer program includes computer program code, which can be in the form of source code, object code, executable file, or some intermediate form, etc. The computer-readable medium can at least include: any entity or device capable of carrying the computer program code to the electronic device, recording medium, computer memory, read-only memory (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory), electrical carrier signal, telecommunication signal, and software distribution medium. For example, a USB flash drive, a mobile hard disk, a magnetic disk, or an optical disc, etc. In some jurisdictions, according to legislation and patent practice, the computer-readable medium cannot be an electrical carrier signal and a telecommunication signal.
[0097] Those of ordinary skill in the art can understand that the above embodiments are specific embodiments for implementing the present invention, and in practical applications, various changes can be made in form and details without departing from the spirit and scope of the present invention.
Claims
1. A drinking water quality data imputation method based on PID control tensor decomposition, characterized in that Specifically, it includes the following steps: S1: Obtain historical water quality data from the server and store it; S2: Construct a water quality data tensor based on the historical water quality data; S3: Construct an objective loss function based on the water quality data tensor and perform iterative training to extract a hidden feature matrix; S4: Calculate the missing water quality prediction data values based on the extracted hidden feature matrix and perform interpolation.
2. The imputation method for drinking water quality data based on PID control tensor decomposition according to claim 1, wherein In S1, the received historical water quality data is stored in a five-tuple X = (s, m, d, h, v), where s represents the site, m represents the type of monitoring index, d represents the number of days of monitoring time, h represents the number of hours of monitoring time, and v represents the observed value of the m-type monitoring target measured by the sensor at site s at the h-th hour on the d-th day at site s.
3. The method for interpolating drinking water quality data based on PID control tensor decomposition according to claim 1, wherein In the above S2, the water quality data tensor is Y I×J×K×L , where I represents the number of sites where the indicator is collected, J is the number of types of sensor monitoring indicators for all sites, K represents the number of days covered by the monitoring data, and H represents the number of hours covered by the monitoring data.
4. The interpolation method for drinking water quality data based on PID control tensor decomposition according to claim 1, characterized in that S3 includes: S3-1: Construct an objective loss function based on the water quality data tensor Y; S3-2: Minimize and optimize the objective loss function according to the stochastic gradient descent algorithm; S3-3: Determine whether the objective loss function reaches the termination condition. If not, continue the training iteration. If so, stop the training iteration and output four hidden feature tensors.
5. The method for interpolating drinking water quality data based on PID control tensor decomposition according to claim 4, wherein In S3-1, the objective loss function is: In formula (1), ε represents the target loss function; S represents the hidden feature matrix of water quality monitoring stations; M represents the hidden feature matrix of monitoring index types; D represents the hidden feature matrix of monitoring days; H represents the hidden feature matrix of monitoring hours; y ijkh ∈Λ represents the known entity in the water quality data tensor Y, that is, the observed value of the j-th observation index at the i-th observation station on the k-th day and the l-th hour; R represents the dimension of the hidden feature space; s ir represents the value of the element in the \(i\)-th row and \(r\)-th column of the latent feature matrix \(S\) of the monitoring site; \(m\) jr represents the value of the element in the \(j\)-th row and \(r\)-th column of the latent feature matrix \(M\) of the monitoring index type; \(d\) kr represents the value of the element in the \(k\)-th row and \(r\)-th column of the latent feature matrix \(D\) of the monitoring days; \(h\) lr represents the value of the element in the \(l\)-th row and \(r\)-th column of the time latent feature matrix \(H\); \(\lambda\) represents the regularization parameter.
6. The method for interpolating drinking water quality data based on PID control tensor decomposition according to claim 4, wherein In S3-2, the optimized objective loss function is: In formula (2), n represents the number of iteration rounds. represents the value at the r-th column and the i-th row of the latent feature matrix S in the (n + 1)-th iteration; represents the value at the r-th column and the i-th row of the latent feature matrix S in the n-th iteration; η represents the learning rate; represents the value of the r-th column and j-th row in the latent feature matrix M at the n-th iteration; represents the value of the r-th column and k-th row in the latent feature matrix D of the monitoring days at the n-th iteration; represents the value of the r-th column and l-th row in the time latent feature matrix H at the n-th iteration; represents the value of the r-th column and j-th row in the latent feature matrix M at the (n + 1)-th iteration; represents the value of the r-th column and k-th row in the latent feature matrix D of the monitoring days at the (n + 1)-th iteration; represents the value of the r-th column and l-th row in the time latent feature matrix H at the (n + 1)-th iteration; Among them, represents the difference between the observed value and the current system prediction value of the monitoring index type j of the water quality monitoring station i at the hth hour on the kth day during the nth iteration: In formula (3), K p , K I , and K D respectively represent the hyperparameters of the non - linear PID controller; is composed of terms: represents the proportional term, which plays a role similar to the learning rate; represents the integral term, which is the accumulation of past errors , considering the past error situation, α i , β i are the hyperparameters of the non - linear function for the integral term; is the derivative term, which uses the difference between two iterations to consider the trend of the error, α d , β d are the hyperparameters of the non - linear function for the derivative term; y ijkl represents the known entity in the water quality data tensor Y, that is, the observed value of the j - th observed index at the i - th observation site on the k - th day and the l - th hour; R represents the dimension of the latent feature space; f(x, α, β) = β · |xα · sign(x) (0 < α < 1) In formula (4), f represents a non-linear function, which is a combination of a power function and the sign function sign; α and β represent hyperparameters.
7. The method for interpolating drinking water quality data based on PID control tensor decomposition according to claim 4, wherein In S3-3, there are two cases where the objective loss function reaches the termination condition: the total number of iterations reaches the set maximum value N, or the difference between the value ε of the objective loss function calculated in the current round and the value ε of the objective loss function in the previous round is less than the threshold δ for five consecutive rounds.
8. The method for interpolating drinking water quality data based on PID control tensor decomposition according to claim 1, wherein In S4, the calculation method of the water quality prediction data value is: In formula (5), represents the known entity in the water quality data tensor Y, that is, the water quality prediction data value of the observation index j at the i-th observation site at the k-th day and the l-th hour; R represents the dimension of the latent feature space; s ir represents the value at the $i$-th row and $r$-th column in the hidden feature matrix $S$ of the monitoring site; $m$ jr represents the value at the $j$-th row and $r$-th column in the hidden feature matrix $M$ of the monitoring index type; $d$ kr represents the value at the $k$-th row and $r$-th column in the hidden feature matrix $D$ of the monitoring days; $h$ lr represents the value at the $l$-th row and $r$-th column in the hidden feature matrix $H$ of time.
9. A drinking water quality data imputation device based on PID control tensor decomposition for the method according to any one of claims 1-8, characterized in that It includes a data acquisition module, a storage module, a tensor construction module, a hidden feature extraction module, and an output module; The data acquisition module is used to obtain historical water quality data from the server and store it; The storage module is used to store the received historical water quality data and the missing water quality prediction data values; The tensor construction module is used to construct a water quality data tensor based on the stored historical water quality data; The hidden feature extraction module is used to construct an objective loss function according to the water quality data tensor and the historical water quality data, and extract hidden features; The output module is used to output the missing water quality prediction data values according to the extracted hidden features.
10. The drinking water quality data imputation device based on PID control tensor decomposition according to claim 9, wherein, The hidden feature extraction module includes an initialization unit, an objective loss function construction unit, a PID control unit, and a training unit; The initialization unit is used to initialize the process parameters involved in the extraction process of the water quality data tensor; The objective loss function construction unit is used to construct an objective loss function according to the water quality data tensor, the historical water quality data, and the process parameters; The PID control unit is used to calculate the error of the water quality data passing through the PID controller; The training unit is used to train and optimize the objective loss function and extract hidden features.
Citation Information
Cited By
Economical crop monitoring data interpolation method and device based on second-order optimization hidden features
CN120448372A