Soft sensor modeling method and device based on real-time learning of overall optimization

By introducing the data self-representation algorithm into the instant learning algorithm, improving the sample weight calculation, and integrating it into the collaborative representation model as a regularization term, the problem of poor prediction accuracy caused by similar sample selection and local model independence in the existing technology is solved. , improving the optimization efficiency and accuracy of the model.

CN114528764BActive Publication Date: 2024-09-10TSINGHUA UNIVERSITY +1
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202210151538.7
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-02-18
Publication Date
2024-09-10
Estimated Expiration
2042-02-18

AI Technical Summary

Technical Problem

Existing on-the-fly learning algorithms are independent in selecting similar samples and building local models, resulting in poor prediction accuracy, and lack of theoretical guidance in parameter selection, which affects model performance.

Method used

Using an instant learning method based on overall optimization, by calculating sample weights and integrating them as regular terms into the collaborative representation model, similar sample selection and local model establishment are uniformly optimized to improve the prediction accuracy of the model.

Benefits of technology

It improves the rationality and reliability of sample weights, enhances model optimization efficiency and prediction accuracy, and solves the problem of poor prediction accuracy in traditional algorithms.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN114528764B
    Figure CN114528764B
Patent Text Reader

Abstract

The present application discloses a soft sensor modeling method, device, electronic device and storage medium based on overall optimization and instant learning. The method obtains the weight matrix of historical samples through a collaborative representation algorithm, and establishes a weighted ridge regression model through a weighted ridge regression algorithm, and fuses the two algorithms to form a unified instant learning optimization target, and finally solves it through alternating iterations. Thereby, the nonlinearity, time-varying and multicollinearity problems of industrial processes are well handled, and the selection of similar samples and the construction of local models are also integrated into an optimization function, so as to realize the use of information from local models to guide the selection of similar samples, improve the reliability of similar samples and the prediction accuracy of local models. Thus, the problems of poor prediction accuracy of the prior art are solved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the technical field of industrial process detection, and in particular to a soft measurement modeling method, device, electronic device and storage medium based on overall optimization and instant learning. Background Art

[0002] In modern industrial production processes, many important quality variables (such as oil viscosity, components, etc.) are difficult to measure in real time, which has a great impact on chemical process control and optimization. Because the chemical production process has problems such as difficulty in on-site sampling, high cost of analytical instruments, and delayed analysis time, in the actual production process, it is often difficult to use online analytical instruments and offline testing to measure quality variables in real time, and it is impossible to form a closed-loop control of quality variables. Therefore, how to obtain quality variables in real time becomes the first problem to be solved in process control. As a result, soft measurement has entered the research field of process industrial control.

[0003] Commonly used data-driven soft sensor modeling methods include principal component regression (PCR), partial least squares regression (PLSR) and artificial neural network (ANN). The models established by the above soft sensor algorithms are offline models. After the model is established, it will not be adaptively adjusted with the changes in the generation process, and it cannot track the changes in production status, resulting in a gradual decrease in prediction accuracy. Therefore, the automatic maintenance of soft sensor models has become the focus of algorithm research and improvement. Therefore, in order to adapt to the multimodal characteristics and time-varying characteristics of modern chemical production processes, various online modeling algorithms have been widely used in production process monitoring and quality variable prediction.

[0004] At present, the mainstream online soft sensor modeling algorithms include: sliding window algorithm, recursive algorithm, time difference algorithm and real-time learning algorithm. Among them, the first three are to update the model based on time correlation, which are time adaptive algorithms; the real-time learning algorithm is based on spatial correlation to update and maintain the model, which is a spatial adaptive algorithm. Compared with other algorithms, the advantage of the real-time learning algorithm is that it can better adapt to the mutation phenomenon in the production process, and because the algorithm establishes a local model for each sample, it can also well describe the nonlinear relationship between process variables.

[0005] The selection of similar samples or the calculation of sample weights is the core step of the just-in-time learning algorithm, which will greatly affect the prediction accuracy of the algorithm. For traditional just-in-time learning algorithms, on the one hand, the selection of some adjustable parameters in the algorithm is often a very difficult task, such as the kernel width parameter in the LWPLS algorithm and the number of similar samples in the LWLS algorithm. The selection of these parameters has no clear theoretical experience and will have a great impact on the performance of the model; on the other hand, the two core steps of the algorithm: selecting similar samples and establishing local models are independent of each other, which may cause the selected similar samples to be suboptimal for the local model. That is, the selected similar samples are used to establish the local model, but the information obtained by establishing the local model is not used to guide the selection of similar samples. From the above, it can be seen that the model established by the traditional just-in-time learning algorithm has the problem of poor prediction accuracy, which needs to be solved urgently. Summary of the invention

[0006] The present application provides a soft measurement modeling method, device, electronic device and storage medium based on overall optimization and instant learning to solve the problems of poor prediction accuracy in the prior art.

[0007] The first aspect of the present application provides a soft measurement modeling method based on overall optimization and instant learning, including the following steps: calculating the weighted Euclidean distance between the collected query data and all samples in the preset auxiliary variable data set according to the preset input variable weight matrix; integrating the weighted Euclidean distance into the collaborative representation regularization term to obtain a target collaborative representation model, and using the target collaborative representation model to calculate the weight matrix of each historical sample in the preset auxiliary variable data set; establishing a weighted ridge regression model according to the target training data set and the weight matrix of each historical sample, integrating the optimization objectives of the target collaborative representation model and the weighted ridge regression model, and calculating the weighted ridge regression model coefficients of the preset auxiliary variable data set and the query data; and using the weighted ridge regression model coefficients to calculate the predicted value of the query data.

[0008] Optionally, in one embodiment of the present application, before establishing the weighted ridge regression model based on the target training data set and the weight matrix of each historical sample, it also includes: constructing the preset auxiliary variable data set for storing the industrial process; analyzing the preset auxiliary variable data set to obtain the true quality variable value corresponding to each sample in the auxiliary variable data set; constructing an initial training data set based on the auxiliary variable data and the true quality variable value, and standardizing the training data set to obtain the target training data set.

[0009] Optionally, in one embodiment of the present application, the standardization process is:

[0010]

[0011] in, For a data set that needs to be standardized, the function mean(·) means calculating the mean of each row of the matrix, and the function std(·) means calculating the standard deviation of each row of the matrix.

[0012] Optionally, in one embodiment of the present application, before calculating the weighted Euclidean distance between the collected query data and all samples in the preset auxiliary variable data set according to the preset input variable weight matrix, the method further includes:

[0013] An offline ridge regression model is established based on the target training data set, and the optimization objective is:

[0014]

[0015] in, is the ridge regression coefficient of the offline ridge regression model, λ0 is the regular term coefficient of the offline ridge regression model, X L is the standardized auxiliary variable data, is the true quality variable value after standardization;

[0016] Solve the optimization target of the offline ridge regression model and obtain the ridge regression coefficient W0 of the offline ridge regression model:

[0017] W0=(X L X L T +λ0×I) -1 X L Y L

[0018] Among them, X L T For data X L The transpose of , I is the identity matrix;

[0019] The weight matrix of each input variable is calculated according to the ridge regression coefficient to obtain the preset input variable weight matrix:

[0020]

[0021] Among them, W0(1) is the first element of the ridge regression coefficient W0, and W0(m) is the mth element of the ridge regression coefficient W0.

[0022] Optionally, in one embodiment of the present application, the weighted Euclidean distance between the collected query data and all samples in the preset auxiliary variable data set is calculated according to the preset input variable weight matrix, the weighted Euclidean distance is integrated into the collaborative representation regularization term to obtain a target collaborative representation model, and the weight matrix of each historical sample in the preset auxiliary variable data set is calculated using the target collaborative representation model, including:

[0023] The weighted Euclidean distance between the query data and all samples in the standardized preset auxiliary variable data set is calculated according to the preset input variable weight matrix:

[0024] Dx q =W var (x q ×1-X L )

[0025]

[0026] Among them, x q To query data, is a diagonal matrix And all elements are 1, the symbol It means multiplying the corresponding elements of two matrices, and the function sum(·) means adding the rows of the matrices;

[0027] A collaborative representation model of the query data and the target training data set is established, and the preset input variable weight matrix and the weighted Euclidean distance are integrated. The optimization goal is:

[0028]

[0029] Among them, b is the synergistic representation coefficient, λ1 is the regularization term coefficient, is the two-norm operation;

[0030] Calculate the synergistic representation coefficient b between the standardized preset auxiliary variable data set and the query data:

[0031] b=(X L T W var X L +λ1D) -1 X L T W var x q

[0032] The weight matrix of each historical sample in the target training data set is obtained using the collaborative representation coefficient:

[0033]

[0034] Among them, b1 is the first element of vector b, b n is the nth element of vector b.

[0035] Optionally, in one embodiment of the present application, the weighted ridge regression model is established according to the target training data set and the weight matrix of each historical sample, the target collaborative representation model and the optimization target of the weighted ridge regression model are integrated, the weighted ridge regression model coefficients of the preset auxiliary variable data set and the query data are calculated, and the prediction value of the query data is calculated using the weighted ridge regression model coefficients, including:

[0036] The weighted ridge regression model is established according to the weight matrix of the target training data set and the historical samples, and the optimization goal is:

[0037]

[0038] in, is the weighted ridge regression model coefficient, λ2 is the ridge regression regularization term coefficient;

[0039] The optimization objectives of the target collaborative representation model and the weighted ridge regression model are integrated to obtain a unified optimization objective:

[0040]

[0041] Among them, a is the weight coefficient of the optimization objectives of the two algorithms, b is the synergistic representation coefficient, λ1 is the synergistic representation regularization term coefficient, is the weighted ridge regression model coefficient, λ2 is the ridge regression regularization term coefficient;

[0042] Calculate the weighted ridge regression model coefficients w:

[0043]

[0044] in,

[0045] Calculate the predicted value of the query data using the weighted ridge regression model coefficients

[0046]

[0047] in, To query data x q The transpose of .

[0048] Optionally, in one embodiment of the present application, the actual value of the query data is calculated, and the actual value and the query data are added to the target training data set.

[0049] The second aspect of the present application provides a soft measurement modeling device based on overall optimization and instant learning, including: a calculation module, which is used to calculate the weighted Euclidean distance between the collected query data and all samples in the preset auxiliary variable data set according to the preset input variable weight matrix, and fuse the weighted Euclidean distance into the collaborative representation regularization term to obtain a target collaborative representation model, and use the target collaborative representation model to calculate the weight matrix of each historical sample in the preset auxiliary variable data set; a prediction module, which is used to establish a weighted ridge regression model according to the target training data set and the weight matrix of each historical sample, fuse the optimization objectives of the target collaborative representation model and the weighted ridge regression model, and calculate the weighted ridge regression model coefficients of the preset auxiliary variable data set and the query data; and use the weighted ridge regression model coefficients to calculate the prediction value of the query data.

[0050] Optionally, in one embodiment of the present application, it also includes: a construction module, used to construct and store the preset auxiliary variable data set in the industrial process; an analysis module, used to analyze the preset auxiliary variable data set to obtain the true quality variable value corresponding to each sample in the auxiliary variable data set; a preprocessing module, used to construct an initial training data set based on the auxiliary variable data and the true quality variable value, and standardize the training data set to obtain the target training data set.

[0051] Optionally, in one embodiment of the present application, the standardization process is:

[0052]

[0053] in, For a data set that needs to be standardized, the function mean(·) means calculating the mean of each row of the matrix, and the function std(·) means calculating the standard deviation of each row of the matrix.

[0054] Optionally, in one embodiment of the present application, it further includes:

[0055] The modeling module is used to establish an offline ridge regression model according to the target training data set before calculating the weighted Euclidean distance between the collected query data and all samples in the preset auxiliary variable data set according to the preset input variable weight matrix, and the optimization goal is:

[0056]

[0057] in, is the ridge regression coefficient of the offline ridge regression model, λ0 is the regular term coefficient of the offline ridge regression model, X L is the standardized auxiliary variable data, is the true quality variable value after standardization;

[0058] A solution module is used to solve the optimization target of the offline ridge regression model and obtain the ridge regression coefficient W0 of the offline ridge regression model:

[0059] W0=(X L X L T +λ0×I) -1 X L Y L

[0060] Among them, X L T For data X L The transpose of , I is the identity matrix;

[0061] The weight calculation module is used to calculate the weight matrix of each input variable according to the ridge regression coefficient to obtain the preset input variable weight matrix:

[0062]

[0063] Among them, W0(1) is the first element of the ridge regression coefficient W0, and W0(m) is the mth element of the ridge regression coefficient W0.

[0064] Optionally, in one embodiment of the present application, the calculation module is specifically used to:

[0065] The weighted Euclidean distance between the query data and all samples in the standardized preset auxiliary variable data set is calculated according to the preset input variable weight matrix:

[0066] Dx q =W var (x q ×1-X L )

[0067]

[0068] Among them, x q To query data, is a diagonal matrix And all elements are 1, the symbol It means multiplying the corresponding elements of two matrices, and the function sum(·) means adding the rows of the matrices;

[0069] A collaborative representation model of the query data and the target training data set is established, and the preset input variable weight matrix and the weighted Euclidean distance are integrated. The optimization goal is:

[0070]

[0071] Among them, b is the synergistic representation coefficient, λ1 is the regularization term coefficient, is the two-norm operation;

[0072] Calculate the synergistic representation coefficient b between the standardized preset auxiliary variable data set and the query data:

[0073] b=(X L T W var X L +λ1D) -1 X L T W var x q

[0074] The weight matrix of each historical sample in the target training data set is obtained using the collaborative representation coefficient:

[0075]

[0076] Among them, b1 is the first element of vector b, b n is the nth element of vector b.

[0077] Optionally, in one embodiment of the present application, the prediction module is specifically used to:

[0078] The weighted ridge regression model is established according to the weight matrix of the target training data set and the historical samples, and the optimization goal is:

[0079]

[0080] in, is the weighted ridge regression model coefficient, λ2 is the ridge regression regularization term coefficient;

[0081] The optimization objectives of the target collaborative representation model and the weighted ridge regression model are integrated to obtain a unified optimization objective:

[0082]

[0083] Among them, a is the weight coefficient of the optimization objectives of the two algorithms, b is the synergistic representation coefficient, λ1 is the synergistic representation regularization term coefficient, is the weighted ridge regression model coefficient, λ2 is the ridge regression regularization term coefficient;

[0084] Calculate the weighted ridge regression model coefficients w:

[0085]

[0086] in,

[0087] The predicted value of the query data is calculated using the weighted ridge regression model coefficients:

[0088]

[0089] in, To query data x q The transpose of .

[0090] Optionally, in one embodiment of the present application, it further includes: an expansion module, used to calculate the actual value of the query data, and add the actual value and the query data to the target training data set.

[0091] The third aspect of the present application provides an electronic device, comprising: a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor executes the program to perform the soft measurement modeling method based on overall optimization and instant learning as described in the above embodiment.

[0092] The fourth aspect of the present application provides a computer-readable storage medium having a computer program stored thereon, which is executed by a processor to perform the soft measurement modeling method based on overall optimization and instant learning as described in the above embodiments.

[0093] Therefore, this application has at least the following beneficial effects:

[0094] This application introduces the data self-representation algorithm into just-in-time learning, and improves the self-representation algorithm for the application background of just-in-time learning. Specifically, on the one hand, the weight of the input variable is taken into account while calculating the sample weight through the self-representation algorithm; on the other hand, the local spatial distance information of the data is integrated by calculating the weighted Euclidean distance between the query sample and the historical sample and using it as the regularization term of the algorithm. Compared with other existing algorithms, this application transforms the selection of similar samples or the calculation of sample weights into an optimization problem, thereby improving the rationality and reliability of sample weights. In addition, compared with the traditional algorithm in which the selection of similar samples and the establishment of local models are independent of each other, this application achieves the selection of similar samples and the establishment of local models at the same time through a unified optimization goal, thereby improving the model optimization efficiency and prediction accuracy. Thus, problems such as poor prediction accuracy of the prior art are solved.

[0095] Additional aspects and advantages of the present application will be given in part in the description below, and in part will become apparent from the description below, or will be learned through the practice of the present application. BRIEF DESCRIPTION OF THE DRAWINGS

[0096] The above and / or additional aspects and advantages of the present application will become apparent and easily understood from the following description of the embodiments in conjunction with the accompanying drawings, in which:

[0097] Figure 1 A flowchart of a soft sensor modeling method based on instant learning of overall optimization provided according to an embodiment of the present application;

[0098] Figure 2 A process schematic diagram of a debutanizer (DCP) provided according to one embodiment of the present application;

[0099] Figure 3 A real output curve diagram of debutanizer process data provided according to one embodiment of the present application;

[0100] Figure 4 A schematic diagram of prediction deviation of debutanizer data by a soft sensor modeling method based on instant learning based on overall optimization provided in one embodiment of the present application;

[0101] Figure 5 A schematic diagram of the prediction deviation of debutanizer data using an existing local weighted partial least squares algorithm provided according to an embodiment of the present application;

[0102] Figure 6 This is an example diagram of a soft sensor modeling device based on instant learning of overall optimization according to an embodiment of the present application;

[0103] Figure 7 A schematic diagram of the structure of an electronic device provided for an application embodiment.

[0104] Description of the reference numerals: computing module 100 , prediction module 200 , memory 701 , processor 702 , communication interface 703 . DETAILED DESCRIPTION

[0105] Embodiments of the present application are described in detail below, and examples of the embodiments are shown in the accompanying drawings, wherein the same or similar reference numerals throughout represent the same or similar elements or elements having the same or similar functions. The embodiments described below with reference to the accompanying drawings are exemplary and are intended to be used to explain the present application, and should not be construed as limiting the present application.

[0106] The following is a description of a soft sensor modeling method, device, electronic device and storage medium based on overall optimization of instant learning of an embodiment of the present application with reference to the accompanying drawings. In view of the time-varying and multimodal characteristics in the industrial process mentioned in the above background technology, as well as the problems of multicollinearity that are prevalent in industrial data, the present application provides a soft sensor modeling method based on overall optimization of instant learning, in which a soft sensor model is established by an instant learning algorithm to overcome the time-varying and multimodal problems; a local model (i.e., an offline ridge regression model and a weighted ridge regression model) is established by a ridge regression algorithm to solve the multicollinearity problem of process data, and has high computational efficiency. In addition, in the present application, the selection of similar samples is converted into an optimization problem, and is integrated with the optimization target of the local model, the modeling process is optimized, and the reliability of the sample weight and the prediction accuracy of the soft sensor model are improved. Thus, the problems of poor prediction accuracy of the prior art are solved.

[0107] Specifically, Figure 1 The present invention is a flowchart of a soft sensor modeling method based on overall optimization and instant learning according to an embodiment of the present application.

[0108] like Figure 1 As shown, the soft sensor modeling method based on global optimization and instant learning includes the following steps:

[0109] In step S101, the weighted Euclidean distance between the collected query data and all samples in the preset auxiliary variable data set is calculated according to the preset input variable weight matrix.

[0110] It should be noted that the above preset auxiliary variable data set is obtained by standardizing the target training data set, and the specific process is described as follows.

[0111] Optionally, in one embodiment of the present application, constructing a target training data set includes: constructing a preset auxiliary variable data set in an industrial process; analyzing the preset auxiliary variable data set to obtain a true quality variable value corresponding to each sample in the auxiliary variable data set; constructing an initial training data set according to the auxiliary variable data and the true quality variable value, and performing standardization processing on the training data set, wherein the standardization processing is:

[0112]

[0113] Among them, the function mean(·) represents the calculation of the mean of each row of the matrix, and the function std(·) represents the calculation of the standard deviation of each row of the matrix. Thus, the target training data set is obtained.

[0114] Specifically, in the embodiment of the present application, data X=[x1, x2, ... x n] T ,X=[x1,x2,…x n ] T , n is the number of samples, m is the dimension of the sample; the collected data is analyzed by laboratory testing to obtain the true quality variable value corresponding to each sample The collected data is used as the initial training data set For the initial training data set According to formula (1), the training data set is standardized to make its mean 0 and variance 1. X L is the data obtained after data X is standardized. The variable value is obtained after the variable value is standardized.

[0115] Optionally, in one embodiment of the present application, before calculating the weighted Euclidean distance between the collected query data and all samples in the preset auxiliary variable data set according to the preset input variable weight matrix, the method further includes:

[0116] Using the training dataset An offline ridge regression model is established, and the weight matrix of each input variable is calculated by the regression coefficient of the model. The specific steps are:

[0117] Using the training dataset An offline ridge regression model is established, and the optimization objective is:

[0118]

[0119] in, is the ridge regression coefficient of the offline ridge regression model, λ0 is the regular term coefficient of the offline ridge regression model; solving the optimization objective, the analytical expression of the ridge regression coefficient W0 of the offline ridge regression model is obtained as follows:

[0120] W0=(X L X L T +λ0×I) -1 X L Y L (3)

[0121] Among them, X L T For data X L The transpose of , I is the identity matrix;

[0122] According to the ridge regression coefficient W0 of the offline ridge regression model, the weight matrix of each input variable is calculated by formula (4), which is expressed as:

[0123]

[0124] Among them, W0(1) is the first element of the ridge regression coefficient W0, and W0(m) is the mth element of the ridge regression coefficient W0.

[0125] Optionally, in one embodiment of the present application, for the newly collected query data According to formula (1), the normalization process is performed according to the weight matrix W var Calculate the query data x by using equations (5) and (6) q With data X L The weighted Euclidean distance d of all samples in; the expressions of formula (5) and formula (6) are:

[0126] Dx q =W var (x q ×1-X L ) (5)

[0127]

[0128] In the formula, is a diagonal matrix And all elements are 1, the symbol It means multiplying the corresponding elements of two matrices, and the function sum(·) means adding the rows of the matrices.

[0129] In step S102, the weighted Euclidean distance is integrated into the collaborative representation regularization term to obtain a target collaborative representation model, and the target collaborative representation model is used to calculate the weight matrix of each historical sample in the preset auxiliary variable data set.

[0130] Optionally, in one embodiment of the present application, the query data x is established q With training data set The collaborative representation model is constructed by integrating the weight matrix and weighted Euclidean distance, and the optimization objective is:

[0131]

[0132] in, is the synergistic representation coefficient, and λ1 is the regularization term coefficient.

[0133] Calculate the data X by formula (8) L and query data x q The synergy representation coefficient of is expressed as follows:

[0134] b=(X L T W var X L +λ1D) -1 X L T Wvar x q (8)

[0135] Using the synergistic representation coefficient, the training data set is obtained through formula (9): The weight matrix of each historical sample in Formula (9) is expressed as:

[0136]

[0137] Among them, b1 is the first element of vector b, b n is the nth element of vector b.

[0138] In step S103, a weighted ridge regression model is established based on the target training data set and the weight matrix of each historical sample, and the optimization target of the collaborative representation algorithm is integrated with the optimization target of the weighted ridge regression algorithm to calculate the data X L and query data x q The synergistic representation coefficient and the local model coefficient.

[0139] Specifically, in the embodiment of the present application, the specific steps of solving the collaborative representation coefficient and the local model coefficient through a unified optimization objective are as follows:

[0140] According to the training set With the weight matrix W sample A weighted ridge regression model is established, and the optimization objective is:

[0141]

[0142] in, is the weighted ridge regression model coefficient, and λ2 is the ridge regression regularization term coefficient.

[0143] By weighting the improved collaborative representation optimization objective and the weighted ridge regression optimization objective, namely, equations (7) and (10), a unified instant learning optimization objective can be obtained, as shown in equation (11):

[0144]

[0145] Among them, a is the weight coefficient of the improved collaborative representation algorithm and the weighted ridge regression algorithm.

[0146] First, by fixing the local model coefficient w, the synergistic representation coefficient b is solved. Equation (11) can be rewritten as Equation (12):

[0147]

[0148] in, cst(b) represents the term that is independent of b. The improved synergy representation coefficient b is calculated by formula (13), which is expressed as:

[0149]

[0150] Then, the local model coefficient w is solved by fixing the synergistic representation coefficient b. Equation (11) can be rewritten as Equation (14):

[0151]

[0152] in, cst(w) represents the term that is independent of w.

[0153] The coefficient w of the local model is calculated by formula (15), which is expressed as:

[0154]

[0155] Optionally, in one embodiment of the present application, the actual value of the query data is calculated, and the actual value and the query data are added to the target training data set.

[0156] Specifically, in the embodiment of the present application, the weighted ridge regression model coefficient w is used to calculate the query data x through formula (16): q Output value Formula (16) is expressed as:

[0157]

[0158] When the true output value y is obtained through laboratory analysis q When the sample [x q ,y q ] added to the training data set To expand the training data set Otherwise, maintain the training data set The space contained in remains unchanged.

[0159] The following will describe the soft sensor modeling method based on overall optimization and real-time learning by taking the process data of a debutanizer as an example in conjunction with the accompanying drawings.

[0160] The debutanizer (DCP) is part of a desulfurization and naphtha splitting plant. Its task is to reduce the concentration of butane at the bottom of the tower as much as possible. Figure 2As shown. Usually, the butane concentration at the bottom of the tower is measured online by a gas chromatograph installed on the top of the tower. Since it takes a certain amount of time for the butane vapor at the bottom of the tower to reach the top of the tower, the analysis process of the gas chromatograph also takes a certain amount of time. Therefore, there is a large lag in the online measurement of the butane concentration at the bottom of the tower. Therefore, it is necessary to establish a soft measurement model to estimate the butane concentration at the bottom of the tower online in real time. When establishing the soft measurement model of butane concentration at the bottom of the tower, seven variables installed in the debutanizer are selected (see Figure 2 ) as auxiliary variables, and the explanation of these seven auxiliary variables is given in Table 1. The data set comes from the actual industrial production process, with a sample size of 2382, arranged by sampling time. The actual output curve is as follows Figure 3 shown.

[0161] Table 1 Description of auxiliary variables

[0162]

[0163]

[0164] Next, the specific steps of this application are described in conjunction with the debutanizer production process:

[0165] 1. Use the collected data as a training data set and preprocess it.

[0166] First, all samples are preprocessed and abnormal samples are deleted. Then, considering the dynamic characteristics of the process, all samples are dimensionally expanded according to the following formula, and the dimension of the expanded samples is 30. Finally, the final training data set is obtained by standardization. but:

[0167]

[0168] in, represents the predicted value of the butane concentration at the bottom of the tower by the soft sensor model, f DCP (·) represents the potential relationship between butane concentration and X1~X7.

[0169] Then we get:

[0170]

[0171] 2. Use the training data set to establish an offline ridge regression model and calculate the weight matrix of each input variable.

[0172] According to the training data set Establish an offline ridge regression model, and according to the ridge regression coefficient of the model Calculate the weight matrix of each input variable

[0173] 3. Collect new data and standardize it.

[0174] For newly collected query data Normalize the data in the same way as the training data set.

[0175] 4. Calculate the sample collaborative representation coefficient simultaneously based on the unified optimization goal and the weighted ridge regression model coefficients

[0176] First, calculate the collected query data x q The weighted Euclidean distance to the training samples Then, d is integrated into the regularization term of the collaborative representation, and the collaborative representation is integrated with the weighted ridge regression algorithm to obtain a unified instant learning optimization goal; finally, the sample collaborative representation coefficient is calculated by alternating iterative optimization. And the local model coefficients

[0177] 5. Predict the output value of the query data based on the weighted ridge regression model coefficients.

[0178] Calculate the query data x based on the weighted ridge regression coefficient w q The predicted output value of When the true value of the output variable y is obtained q When the sample [x q ;y q ]Add to the training dataset

[0179] The prediction deviation values ​​of the method described in this application (UniJITL) and the traditional local weighted partial least squares (LWPLS) algorithm for the output variables of the debutanizer data are as follows: Figure 4 , Figure 5 As shown. Figure 4 , Figure 5 It can be seen that the method described in this application has higher prediction accuracy than the traditional method.

[0180] According to a soft sensor modeling method based on instant learning of overall optimization proposed in the example of this application, the weight matrix of historical samples is obtained through the collaborative representation algorithm, and the weighted ridge regression model is established through the weighted ridge regression algorithm, and the two algorithms are integrated to form a unified optimization target. For the collected query data, the weighted Euclidean distance between the query data and the training sample is first calculated, and the weighted Euclidean distance is integrated into the regularization term of the collaborative representation. Through a unified optimization target, the selection of similar samples and the establishment of local models are achieved at the same time. The method described in the embodiment of this application can not only handle the nonlinearity, time-varying and multicollinearity problems of industrial processes well, but also integrate the selection of similar samples and the construction of local models into an optimization function, so as to realize the use of the information of the local model to guide the selection of similar samples, improve the reliability of similar samples and the prediction accuracy of the local model.

[0181] Next, a soft sensor modeling device based on real-time learning of overall optimization proposed in accordance with an embodiment of the present application is described with reference to the accompanying drawings.

[0182] Figure 6 It is a block diagram of a soft sensor modeling device based on global optimization and instant learning according to an embodiment of the present application.

[0183] like Figure 6 As shown, the soft sensor modeling device 10 based on overall optimization and instant learning includes: a calculation module 100 and a prediction module 200 .

[0184] Among them, the calculation module 100 is used to calculate the weighted Euclidean distance between the collected query data and all samples in the preset auxiliary variable data set according to the preset input variable weight matrix, fuse the weighted Euclidean distance into the collaborative representation regular term, obtain the target collaborative representation model, and use the target collaborative representation model to calculate the weight matrix of each historical sample in the preset auxiliary variable data set; the prediction module 200 is used to establish a weighted ridge regression model according to the target training data set and the weight matrix of each historical sample, fuse the optimization objectives of the target collaborative representation model and the weighted ridge regression model, calculate the weighted ridge regression model coefficients of the preset auxiliary variable data set and the query data; and use the weighted ridge regression model coefficients to calculate the prediction value of the query data.

[0185] Optionally, in one embodiment of the present application, it also includes: a construction module for constructing and storing a preset auxiliary variable data set in an industrial process; an analysis module for analyzing the preset auxiliary variable data set to obtain the true quality variable value corresponding to each sample in the auxiliary variable data set; a preprocessing module for constructing an initial training data set based on the auxiliary variable data and the true quality variable value, and standardizing the training data set to obtain a target training data set.

[0186] Optionally, in one embodiment of the present application, the standardization process is:

[0187]

[0188] in, For a data set that needs to be standardized, the function mean(·) means calculating the mean of each row of the matrix, and the function std(·) means calculating the standard deviation of each row of the matrix.

[0189] Optionally, in one embodiment of the present application, it further includes:

[0190] The modeling module is used to establish an offline ridge regression model according to the target training data set before calculating the weighted Euclidean distance between the collected query data and all samples in the preset auxiliary variable data set according to the preset input variable weight matrix, and the optimization goal is:

[0191]

[0192] in, is the ridge regression coefficient of the offline ridge regression model, λ0 is the regular term coefficient of the offline ridge regression model, X L is the standardized auxiliary variable data, is the true quality variable value after standardization;

[0193] The solution module is used to solve the optimization target of the offline ridge regression model and obtain the ridge regression coefficient W0 of the offline ridge regression model:

[0194] W0=(X L X L T +λ0×I) -1 X L Y L

[0195] Among them, X L T For data X L The transpose of , I is the identity matrix;

[0196] The weight calculation module is used to calculate the weight matrix of each input variable according to the ridge regression coefficient to obtain the preset input variable weight matrix:

[0197]

[0198] Among them, W0(1) is the first element of the ridge regression coefficient W0, and W0(m) is the mth element of the ridge regression coefficient W0.

[0199] Optionally, in one embodiment of the present application, the computing module 100 is specifically configured to:

[0200] The weighted Euclidean distance between the query data and all samples in the standardized preset auxiliary variable dataset is calculated according to the preset input variable weight matrix:

[0201] Dx q =W var (x q ×1-X L )

[0202]

[0203] Among them, x q To query data, is a diagonal matrix And all elements are 1, the symbol It means multiplying the corresponding elements of two matrices, and the function sum(·) means adding the rows of the matrices;

[0204] A collaborative representation model of query data and target training data set is established, and the preset input variable weight matrix and weighted Euclidean distance are integrated. The optimization goal is:

[0205]

[0206] Among them, b is the synergistic representation coefficient, λ1 is the regularization term coefficient, is the two-norm operation;

[0207] Calculate the co-representation coefficient b of the standardized preset auxiliary variable data set and the query data:

[0208] b=(X L T W var X L +λ1D) -1 X L T W var x q

[0209] The weight matrix of each historical sample in the target training data set is obtained using the collaborative representation coefficient:

[0210]

[0211] Among them, b1 is the first element of vector b, b n is the nth element of vector b.

[0212] Optionally, in one embodiment of the present application, the prediction module 200 is specifically configured to:

[0213] A weighted ridge regression model is established based on the weight matrix of the target training data set and historical samples, and the optimization goal is:

[0214]

[0215] in, is the weighted ridge regression model coefficient, λ2 is the ridge regression regularization term coefficient;

[0216] The optimization objectives of the target collaborative representation model and the weighted ridge regression model are integrated to obtain a unified optimization objective:

[0217]

[0218] Among them, a is the weight coefficient of the optimization objectives of the two algorithms, b is the synergistic representation coefficient, λ1 is the synergistic representation regularization term coefficient, is the weighted ridge regression model coefficient, λ2 is the ridge regression regularization term coefficient;

[0219] Calculate the weighted ridge regression model coefficients w:

[0220]

[0221] in,

[0222] Use the weighted ridge regression model coefficients to calculate the predicted value of the query data:

[0223]

[0224] in, To query data x q The transpose of .

[0225] Optionally, in one embodiment of the present application, it further includes: an expansion module, which is used to calculate the actual value of the query data and add the actual value and the query data to the target training data set.

[0226] It should be noted that the above explanation of the embodiment of a soft sensor modeling method based on overall optimization and just-in-time learning is also applicable to a soft sensor modeling device based on overall optimization and just-in-time learning in this embodiment, which will not be repeated here.

[0227] According to the example of the present application, a soft measurement modeling device based on global optimization and instant learning is proposed. By converting the selection of similar samples into an optimization problem and integrating it with the local model optimization goal, the overall optimization of similar sample selection and local model establishment is achieved, thereby improving the rationality and reliability of sample weights and improving model optimization efficiency and prediction accuracy.

[0228] Figure 7 A schematic diagram of the structure of an electronic device provided in an embodiment of the present application. The electronic device may include:

[0229] A memory 701 , a processor 702 , and a computer program stored in the memory 701 and executable on the processor 702 .

[0230] When the processor 702 executes the program, the soft sensor modeling method based on global optimization and instant learning provided in the above embodiment is implemented.

[0231] Furthermore, the electronic device further comprises:

[0232] The communication interface 703 is used for communication between the memory 701 and the processor 702 .

[0233] The memory 701 is used to store computer programs that can be executed on the processor 702 .

[0234] The memory 701 may include a high-speed RAM memory, and may also include a non-volatile memory (non-volatile memory), such as at least one disk memory.

[0235] If the memory 701, the processor 702 and the communication interface 703 are implemented independently, the communication interface 703, the memory 701 and the processor 702 can be connected to each other through a bus and communicate with each other. The bus can be an Industry Standard Architecture (ISA) bus, a Peripheral Component (PCI) bus or an Extended Industry Standard Architecture (EISA) bus. The bus can be divided into an address bus, a data bus, a control bus, etc. For ease of representation, Figure 7 Only one thick line is used in the diagram, but this does not mean that there is only one bus or only one type of bus.

[0236] Optionally, in a specific implementation, if the memory 701, the processor 702 and the communication interface 703 are integrated on a chip, the memory 701, the processor 702 and the communication interface 703 can communicate with each other through an internal interface.

[0237] The processor 702 may be a central processing unit (CPU), or an application specific integrated circuit (ASIC), or one or more integrated circuits configured to implement the embodiments of the present application.

[0238] This embodiment also provides a computer-readable storage medium having a computer program stored thereon, characterized in that when the program is executed by a processor, the above-mentioned soft-sensor modeling method based on global optimization and instant learning is implemented.

[0239] In the description of this specification, the description with reference to the terms "one embodiment", "some embodiments", "example", "specific example", or "some examples" etc. means that the specific features, structures, materials or characteristics described in conjunction with the embodiment or example are included in at least one embodiment or example of the present application. In this specification, the schematic representations of the above terms do not necessarily refer to the same embodiment or example. Moreover, the specific features, structures, materials or characteristics described may be combined in any one or N embodiments or examples in a suitable manner. In addition, those skilled in the art may combine and combine the different embodiments or examples described in this specification and the features of the different embodiments or examples, without contradiction.

[0240] In addition, the terms "first" and "second" are used for descriptive purposes only and should not be understood as indicating or implying relative importance or implicitly indicating the number of technical features indicated. Therefore, a feature defined as "first" or "second" may explicitly or implicitly include at least one of the features. In the description of this application, "N" means at least two, such as two, three, etc., unless otherwise clearly and specifically defined.

[0241] Any process or method description in a flowchart or otherwise described herein may be understood to represent a module, fragment or portion of code comprising one or more executable instructions for implementing the steps of a custom logical function or process, and the scope of the preferred embodiments of the present application includes alternative implementations in which functions may not be performed in the order shown or discussed, including performing functions in a substantially simultaneous manner or in reverse order depending on the functions involved, which should be understood by technicians in the technical field to which the embodiments of the present application belong.

[0242] It should be understood that the various parts of the present application can be implemented by hardware, software, firmware or a combination thereof. In the above-mentioned embodiment, the N steps or methods can be implemented by software or firmware stored in a memory and executed by a suitable instruction execution system. For example, if implemented by hardware, as in another embodiment, it can be implemented by any one of the following technologies known in the art or their combination: a discrete logic circuit having a logic gate circuit for implementing a logic function for a data signal, a dedicated integrated circuit having a suitable combination of logic gate circuits, a programmable gate array (PGA), a field programmable gate array (FPGA), etc.

[0243] A person skilled in the art may understand that all or part of the steps in the method for implementing the above-mentioned embodiment may be completed by instructing related hardware through a program, and the program may be stored in a computer-readable storage medium, which, when executed, includes one or a combination of the steps of the method embodiment.

Claims

1. A soft sensor modeling method based on real-time learning of overall optimization, characterized in that: The following steps are involved: Calculate the weighted Euclidean distance between the collected query data and all samples in the preset auxiliary variable data set according to the preset input variable weight matrix, wherein the preset auxiliary variable data set is composed of auxiliary variables related to industrial process and quality collected and stored in real time by field sensors and storage devices, and the auxiliary variables include tower top temperature, tower bottom pressure, reflux flow, flow to the next process, tower plate temperature of the target layer, and tower bottom temperature; The weighted Euclidean distance is integrated into the collaborative representation regularization term to obtain a target collaborative representation model, and the target collaborative representation model is used to calculate the weight matrix of each historical sample in the preset auxiliary variable data set; A weighted ridge regression model is established according to the target training data set and the weight matrix of each historical sample, the target collaborative representation model and the optimization target of the weighted ridge regression model are integrated, and the weighted ridge regression model coefficients of the preset auxiliary variable data set and the query data are calculated; Calculating the predicted value of the query data using the weighted ridge regression model coefficients; The method of establishing a weighted ridge regression model according to the target training data set and the weight matrix of each historical sample, fusing the target collaborative representation model and the optimization target of the weighted ridge regression model, calculating the weighted ridge regression model coefficients of the preset auxiliary variable data set and the query data, and calculating the predicted value of the query data using the weighted ridge regression model coefficients includes: The weighted ridge regression model is established according to the weight matrix of the target training data set and the historical samples, and the optimization goal is: in, is the weighted ridge regression model coefficient, λ2 is the ridge regression regularization term coefficient; The optimization objectives of the target collaborative representation model and the weighted ridge regression model are integrated to obtain a unified optimization objective: Among them, a is the weight coefficient of the optimization objectives of the two algorithms, b is the synergistic representation coefficient, λ1 is the synergistic representation regularization term coefficient, is the weighted ridge regression model coefficient, λ2 is the ridge regression regularization term coefficient; Calculate the weighted ridge regression model coefficients w: in, Calculate the predicted value of the query data using the weighted ridge regression model coefficients in, To query data x q The transpose of .

2. The method according to claim 1, characterized in that Before establishing the weighted ridge regression model according to the target training data set and the weight matrix of each historical sample, the method further includes: Constructing and storing the preset auxiliary variable data set in the industrial process; Analyze the preset auxiliary variable data set to obtain the true quality variable value corresponding to each sample in the auxiliary variable data set; An initial training data set is constructed according to the auxiliary variable data and the true quality variable value, and the training data set is standardized to obtain the target training data set.

3. The method according to claim 2, characterized in that The standardization process is: in, For a data set that needs to be standardized, the function mean(·) means calculating the mean of each row of the matrix, and the function std(·) means calculating the standard deviation of each row of the matrix.

4. The method according to claim 1, characterized in that Before calculating the weighted Euclidean distance between the collected query data and all samples in the preset auxiliary variable data set according to the preset input variable weight matrix, the method further includes: An offline ridge regression model is established based on the target training data set, and the optimization objective is: in, is the ridge regression coefficient of the offline ridge regression model, λ0 is the regular term coefficient of the offline ridge regression model, X L is the standardized auxiliary variable data, is the true quality variable value after standardization; Solve the optimization target of the offline ridge regression model and obtain the ridge regression coefficient W0 of the offline ridge regression model: W0=(X L X L T +λ0×I) -1 X L AND L Among them, X L T For data X L The transpose of , I is the identity matrix; The weight matrix of each input variable is calculated according to the ridge regression coefficient to obtain the preset input variable weight matrix: Among them, W0(1) is the first element of the ridge regression coefficient W0, and W0(m) is the mth element of the ridge regression coefficient W0.

5. The method according to claim 4, characterized in that The weighted Euclidean distance between the collected query data and all samples in the preset auxiliary variable data set is calculated according to the preset input variable weight matrix, the weighted Euclidean distance is integrated into the collaborative representation regularization term to obtain the target collaborative representation model, and the weight matrix of each historical sample in the preset auxiliary variable data set is calculated using the target collaborative representation model, including: The weighted Euclidean distance between the query data and all samples in the standardized preset auxiliary variable data set is calculated according to the preset input variable weight matrix: Dx q =W var (x q ×1-X L ) Among them, x q To query data, is a diagonal matrix D i,i =d i ,i=1,2,…,n, And all elements are 1, the symbol It means multiplying the corresponding elements of two matrices, and the function sum(·) means adding the rows of the matrices; A collaborative representation model of the query data and the target training data set is established, and the preset input variable weight matrix and the weighted Euclidean distance are integrated. The optimization goal is: Among them, b is the synergistic representation coefficient, λ1 is the regularization term coefficient, is the two-norm operation; Calculate the synergistic representation coefficient b between the standardized preset auxiliary variable data set and the query data: b=(X L T W var X L +λ1D) -1 X L T W var x q The weight matrix of each historical sample in the target training data set is obtained using the collaborative representation coefficient: Among them, b1 is the first element of vector b, b n is the nth element of vector b.

6. The method according to any one of claims 1 to 5, characterized in that: An actual value of the query data is calculated, and the actual value and the query data are added to the target training data set.

7. A soft sensor modeling device based on real-time learning of overall optimization, characterized in that: include: A calculation module, for calculating the weighted Euclidean distance between the collected query data and all samples in a preset auxiliary variable data set according to a preset input variable weight matrix, fusing the weighted Euclidean distance into a collaborative representation regularization term to obtain a target collaborative representation model, and using the target collaborative representation model to calculate the weight matrix of each historical sample in the preset auxiliary variable data set, wherein the preset auxiliary variable data set is composed of auxiliary variables related to industrial processes and quality collected and stored in real time by field sensors and storage devices, and the auxiliary variables include tower top temperature, tower bottom pressure, reflux flow, flow to the next process, tower plate temperature of a target layer, and tower bottom temperature; A prediction module is used to establish a weighted ridge regression model according to the target training data set and the weight matrix of each historical sample, fuse the target collaborative representation model and the optimization target of the weighted ridge regression model, calculate the weighted ridge regression model coefficients of the preset auxiliary variable data set and the query data; and calculate the predicted value of the query data using the weighted ridge regression model coefficients; The prediction module is specifically used for: The weighted ridge regression model is established according to the weight matrix of the target training data set and the historical samples, and the optimization goal is: in, is the weighted ridge regression model coefficient, λ2 is the ridge regression regularization term coefficient; The optimization objectives of the target collaborative representation model and the weighted ridge regression model are integrated to obtain a unified optimization objective: Among them, a is the weight coefficient of the optimization objectives of the two algorithms, b is the synergistic representation coefficient, λ1 is the synergistic representation regularization term coefficient, is the weighted ridge regression model coefficient, λ2 is the ridge regression regularization term coefficient; Calculate the weighted ridge regression model coefficients w: in, The predicted value of the query data is calculated using the weighted ridge regression model coefficients: in, To query data x q The transpose of .

8. The device according to claim 7, characterized in that Also includes: A construction module, used for constructing and storing the preset auxiliary variable data set in the industrial process; An analysis module, used to analyze the preset auxiliary variable data set to obtain a true quality variable value corresponding to each sample in the auxiliary variable data set; The preprocessing module is used to construct an initial training data set according to the auxiliary variable data and the true quality variable value, and to perform standardization processing on the training data set to obtain the target training data set.

9. The device according to claim 8, characterized in that The standardization process is: in, For a data set that needs to be standardized, the function mean(·) means calculating the mean of each row of the matrix, and the function std(·) means calculating the standard deviation of each row of the matrix.

10. The device according to claim 7, characterized in that Also includes: The modeling module is used to establish an offline ridge regression model according to the target training data set before calculating the weighted Euclidean distance between the collected query data and all samples in the preset auxiliary variable data set according to the preset input variable weight matrix, and the optimization goal is: in, is the ridge regression coefficient of the offline ridge regression model, λ0 is the regular term coefficient of the offline ridge regression model, X L is the standardized auxiliary variable data, is the true quality variable value after standardization; A solution module is used to solve the optimization target of the offline ridge regression model and obtain the ridge regression coefficient W0 of the offline ridge regression model: W0=(X L X L T +λ0×I) -1 X L AND L Among them, X L T For data X L The transpose of , I is the identity matrix; The weight calculation module is used to calculate the weight matrix of each input variable according to the ridge regression coefficient to obtain the preset input variable weight matrix: Among them, W0(1) is the first element of the ridge regression coefficient W0, and W0(m) is the mth element of the ridge regression coefficient W0.

11. The device according to claim 10, characterized in that The computing module is specifically used for: The weighted Euclidean distance between the query data and all samples in the standardized preset auxiliary variable data set is calculated according to the preset input variable weight matrix: Dx q =W var (x q ×1-X L ) Among them, x q To query data, is a diagonal matrix D i,i =d i ,i=1,2,...,n, And all elements are 1, the symbol It means multiplying the corresponding elements of two matrices, and the function sum(·) means adding the rows of the matrices; A collaborative representation model of the query data and the target training data set is established, and the preset input variable weight matrix and the weighted Euclidean distance are integrated. The optimization goal is: Among them, b is the synergistic representation coefficient, λ1 is the regularization term coefficient, is the two-norm operation; Calculate the synergistic representation coefficient b between the standardized preset auxiliary variable data set and the query data: b=(X L T W var X L +λ1D) -1 X L T W var x q The weight matrix of each historical sample in the target training data set is obtained using the collaborative representation coefficient: Among them, b1 is the first element of vector b, b n is the nth element of vector b.

12. The device according to any one of claims 7 to 11, characterized in that: Also includes: The expansion module is used to calculate the actual value of the query data and add the actual value and the query data to the target training data set.

13. An electronic device, characterized in that: include: A memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor executes the program to implement the soft sensor modeling method based on overall optimization and instant learning as described in any one of claims 1 to 6.

14. A computer-readable storage medium having a computer program stored thereon, characterized in that: The program is executed by a processor to implement the soft sensor modeling method based on overall optimization and instant learning as described in any one of claims 1 to 6.