Soft measurement method and system for pH value of reaction kettle based on intelligent algorithm
By optimizing hyperparameters using an ensemble learning model and the Evergreen optimization algorithm, the problem of large pH measurement error in the reactor was solved, achieving high-precision and real-time pH measurement and meeting the closed-loop control requirements of industrial production.
Patent Information
- Application Number
- CN202511639617.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-11-11
- Publication Date
- 2026-02-27
AI Technical Summary
In the existing technology, the direct measurement method of pH value in the reactor is easily affected by viscous materials in complex chemical reaction environments, resulting in large measurement errors and poor real-time performance, which cannot meet the requirements of closed-loop control.
An ensemble learning model based on intelligent algorithms is adopted, which combines Long Short-Term Memory Network (LSTM) and Convolutional Neural Network (CNN) to acquire process variable data in real time through a distributed control system, construct an ensemble learning model, and use the Evergreen optimization algorithm to optimize hyperparameters to achieve soft measurement of pH value.
This improves the accuracy and real-time performance of pH measurement, reduces human intervention and subjective errors, and ensures the reliability and validity of measurement results.
Smart Images

Figure CN121583350A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of intelligent pH prediction technology for reactors, and in particular to a soft measurement method and system for reactor pH based on intelligent algorithms. Background Technology
[0002] In process industries such as chemical, pharmaceutical, and food processing, reaction vessels are core production equipment. The progress and effectiveness of the reactions within them directly determine the quality, yield, and safety of the products. pH plays a crucial role in reaction vessels. As an indicator of the acidity or alkalinity of aqueous solutions, pH has a decisive influence on the conduct of chemical reactions. Controlling the pH value within a reaction vessel can affect the reaction rate, reaction selectivity, and the quality and yield of the products. In industrial production, pH adjustment and control are important means of improving production processes. By adjusting the pH value, production processes can be optimized, and production efficiency can be improved; by controlling the pH value, reaction conditions can be optimized, reaction efficiency and selectivity can be improved, and the occurrence of side reactions can be reduced.
[0003] Currently, monitoring the pH value of reaction vessels in industrial production mainly relies on direct measurement methods, i.e., using online pH meters. This method involves immersing a pH electrode in the reactants to directly obtain the pH signal. However, in practical applications, especially in complex chemical reaction environments, this direct measurement method has revealed several inherent drawbacks:
[0004] In the later stages of the reaction, the reactants often become viscous, easily adhering to, crystallizing, or scaling on the pH electrode's sensitive membrane. This leads to sluggish electrode response, signal drift, measurement errors, and even complete measurement failure. Operators typically need to frequently perform manual sampling and offline laboratory testing to calibrate online instruments or directly acquire data. This method is not only labor-intensive and prone to human error, but also significantly lags behind the real-time reaction process, failing to provide timely and effective feedback for closed-loop control. Summary of the Invention
[0005] In order to overcome the above-mentioned shortcomings of the prior art, the purpose of this invention is to provide a method and system for soft measurement of pH value in a reactor based on an intelligent algorithm, so as to solve the problems mentioned in the background art.
[0006] The technical solution adopted by this invention to solve its technical problem is: a soft measurement method for pH value of a reaction vessel based on an intelligent algorithm, comprising the following steps:
[0007] Time series data of multiple process variables during the operation of the reactor are acquired, and the time series data are preprocessed and divided into training set, validation set and test set;
[0008] An ensemble learning model is constructed, which includes at least two different neural network models as base models, for extracting features from the process variable data and establishing a mapping relationship with pH value;
[0009] An intelligent optimization algorithm is used to obtain the hyperparameter combination of the ensemble learning model with the performance of the ensemble learning model on the validation set as the optimization objective, thereby completing the training and optimization of the ensemble learning model.
[0010] The process variable data acquired in real time are input into the trained and optimized ensemble learning model, and the final pH soft measurement result is output by selection or fusion based on the results of each base model on the validation set.
[0011] As a further improvement of the present invention: the acquisition of time series data of multiple process variables during the operation of the reactor includes: real-time acquisition of historical time series data of multiple process variables related to pH value from the distributed control system of the reactor, wherein the process variables include liquid alkali opening degree, cocoyl chloride opening degree, temperature and pH value.
[0012] As a further improvement of the present invention: the preprocessing of the time series data and the division into training set, validation set and test set includes:
[0013] The historical time series data is cleaned and normalized preprocessed, and the dataset is divided into training set, validation set and test set according to time order;
[0014] The data preprocessing includes:
[0015] The data cleaning process is used to identify and remove outliers, fill in missing values, and filter noise in the historical time series data.
[0016] The data normalization process is used to linearly transform the data of each process variable to the [0,1] interval using a normalization method;
[0017] The dataset partitioning process is used to divide the complete dataset into training, validation, and test sets in an 8:1:1 ratio.
[0018] As a further improvement of the present invention: the integrated learning model uses a long short-term memory network (LSTM) and a convolutional neural network (CNN) as base models, wherein the CNN is used to extract local features in the temporal dimension from the input sequence data, and the LSTM is used to capture long-term dependencies in the sequence data.
[0019] As a further improvement of the present invention: the input of the integrated learning model is a sequence of process variable data from the previous N consecutive time steps, and the output is the pH prediction value at the current time step;
[0020] The convolutional neural network module consists of three cascaded one-dimensional convolutional layers, with a ReLU activation function connected after each convolutional layer. The long short-term memory network module consists of two cascaded LSTM networks.
[0021] As a further improvement of the present invention: the intelligent optimization algorithm adopts the ivy optimization algorithm, which obtains and determines the optimal hyperparameter combination of the ensemble learning model. The prediction error of the ensemble learning model on the validation set is used as the fitness function of the ivy optimization algorithm. Iterative optimization is performed within a preset hyperparameter search space by simulating the growth, diffusion, and evolution of ivy plants. The hyperparameters to be obtained by the ivy optimization algorithm include at least the learning rate of the ensemble learning model, batch size, the number of filters and kernel size of the convolutional neural network, and the number of hidden units in the long short-term memory network.
[0022] As a further improvement of the present invention: the real-time acquired process variable data is input into the trained and optimized ensemble learning model, and the preprocessed real-time process variable data is input into the trained and optimized ensemble learning model to obtain the pH prediction value output by the ensemble learning model;
[0023] As a further improvement of the present invention: the final output of the ensemble learning model is based on the error comparison of the Long Short-Term Memory (LSTM) network and the Convolutional Neural Network (CNN) on the validation set.
[0024] When the error difference between the Long Short-Term Memory (LSTM) network and the Convolutional Neural Network (CNN) exceeds a preset threshold, the output of the base model with the smaller error is selected as the final predicted value.
[0025] When the error difference is less than or equal to the preset threshold, the outputs of the two base models are weighted and fused, and the fusion result is used as the final predicted value.
[0026] The final predicted value for pH is:
[0027] pH final =W c pH cnn +W l pH lstm
[0028] Among them, W c pH represents the weight coefficients of a convolutional neural network (CNN). cnn pH is the pH prediction value of a convolutional neural network (CNN). lstm W represents the pH prediction value of the Long Short-Term Memory (LSTM) network. l These are the weight coefficients of the Long Short-Term Memory (LSTM) network.
[0029] As a further improvement of the present invention: in the weighted fusion of the outputs of the two base models, the method for determining the weight coefficients is as follows: calculate the reciprocal of the mean squared error of the Long Short-Term Memory (LSTM) network and the Convolutional Neural Network (CNN) on the validation set, and use the proportion of the reciprocal in the sum of the reciprocals of the LSTM network and the CNN network as the weight coefficient for the base model.
[0030] The weight coefficients of a Convolutional Neural Network (CNN) are calculated as follows:
[0031]
[0032] The weight coefficients of the Long Short-Term Memory (LSTM) network are calculated as follows:
[0033]
[0034] Among them, MSE c It is the validation set MSE of the convolutional neural network (CNN). l It is the validation set MSE of the Long Short-Term Memory (LSTM) network.
[0035] On the other hand, the present invention also provides an intelligent system for soft-sensing pH measurement of a reaction vessel for implementing the method described in any of the preceding claims, comprising:
[0036] The data acquisition module is used to acquire historical time series data of the multiple process variables from the distributed control system of the reactor in real time;
[0037] The data preprocessing module is used to clean and normalize the received data and to divide the dataset.
[0038] The soft measurement model module, based on an ensemble learning model constructed from long short-term memory networks and convolutional neural networks, is used to receive preprocessed data and predict pH values.
[0039] The intelligent optimization module employs the Evergreen optimization algorithm to automatically search for and determine the optimal hyperparameter combination of the soft measurement model module.
[0040] The prediction output module receives the prediction results from the Long Short-Term Memory Network and the Convolutional Neural Network, and outputs the final pH soft measurement value based on the error comparison results of the Long Short-Term Memory Network and the Convolutional Neural Network on the validation set.
[0041] Compared with the prior art, the beneficial effects of the present invention are:
[0042] This invention acquires real-time process data from the underlying DCS, analyzes the impact of process parameters on the pH of the reactor, and selects suitable intelligent algorithms to obtain the final soft measurement model. The final model is based on a CNN-LSTM ensemble learning model. By constructing a CNN-LSTM ensemble learning model, the advantages of CNN in extracting local temporal features and LSTM in capturing long-term dependencies are fully utilized, which can more accurately describe the complex nonlinear dynamic process in the reactor. The performance of the ensemble learning model is often affected by the selection of hyperparameters. In order to reduce human intervention and subjective errors, the IVY algorithm is introduced to adaptively select the hyperparameters of the model, which improves the prediction accuracy of the model and ensures the reliability and effectiveness of the prediction results. Attached Figure Description
[0043] Figure 1 This is a flowchart of the soft measurement method for pH value in a reaction vessel provided by the present invention.
[0044] Figure 2 This is a schematic diagram of the structure of the CNN-LSTM ensemble learning model used in this embodiment of the invention.
[0045] Figure 3 This is an overall flowchart of the soft measurement method for pH value in a reaction vessel provided in an embodiment of the present invention. Detailed Implementation
[0046] In order to clearly and completely understand the technical solution, the present invention will be further described in conjunction with the embodiments and accompanying drawings. Obviously, the described embodiments are only some embodiments of the present invention. All other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.
[0047] It should be understood that, when used in this specification and the appended claims, the terms "comprising" and "including" indicate the presence of the described features, integrals, steps, operations, elements and / or components, but do not exclude the presence or addition of one or more other features, integrals, steps, operations, elements, components and / or collections thereof.
[0048] It should also be understood that the terminology used in this specification is for the purpose of describing particular embodiments only and is not intended to limit the invention. As used in this specification and the appended claims, the singular forms “a,” “an,” and “the” are intended to include the plural forms unless the context clearly indicates otherwise.
[0049] It should also be further understood that the term "and / or" as used in this specification and the appended claims refers to any combination of one or more of the associated listed items and all possible combinations, and includes such combinations.
[0050] Embodiments of the present invention provide a method for soft measurement of pH value in a reaction vessel based on an intelligent algorithm, comprising the following steps:
[0051] Time series data of multiple process variables during the operation of the reactor are acquired, and the time series data are preprocessed and divided into training set, validation set and test set;
[0052] An ensemble learning model is constructed, which includes at least two different neural network models as base models, for extracting features from the process variable data and establishing a mapping relationship with pH value;
[0053] An intelligent optimization algorithm is used to obtain the hyperparameter combination of the ensemble learning model with the performance of the ensemble learning model on the validation set as the optimization objective, thereby completing the training and optimization of the ensemble learning model.
[0054] The process variable data acquired in real time are input into the trained and optimized ensemble learning model, and the final pH soft measurement result is output by selection or fusion based on the results of each base model on the validation set.
[0055] As a further improvement of the present invention: the acquisition of time series data of multiple process variables during the operation of the reactor includes: real-time acquisition of historical time series data of multiple process variables related to pH value from the distributed control system of the reactor, wherein the process variables include liquid alkali opening degree, cocoyl chloride opening degree, temperature and pH value.
[0056] As a further improvement of the present invention: the preprocessing of the time series data and the division into training set, validation set and test set includes:
[0057] The historical time series data is cleaned and normalized preprocessed, and the dataset is divided into training set, validation set and test set according to time order;
[0058] The data preprocessing includes:
[0059] The data cleaning process is used to identify and remove outliers, fill in missing values, and filter noise in the historical time series data.
[0060] The 3σ criterion was used to identify and remove outliers that were significantly outside the process range; for individual missing data points, linear interpolation was used to fill in the missing data.
[0061] The data normalization process uses the minimum-maximum normalization method to linearly transform the data of each process variable to the [0,1] interval;
[0062] The dataset partitioning process uses the current time as a baseline, taking historical data from the previous 1000 time steps as an input sample, with the corresponding output being the pH value at the current time. This constructs a dataset for supervised learning, which is then divided into training, validation, and test sets in an 8:1:1 ratio according to chronological order.
[0063] The entire dataset was divided into training, validation, and test sets in an 8:1:1 ratio. The training set was used for model parameter training; the validation set was used to monitor and adjust model performance in real time during training to prevent overfitting or underfitting and to determine the optimal parameter configuration; and the test set was used to objectively and fairly evaluate the model's final performance after training to measure its generalization ability. The dataset was partitioned chronologically to ensure that the data distribution in each subset remained consistent with the original dataset, thus guaranteeing the effectiveness and reliability of model training and evaluation.
[0064] As a further improvement of the present invention: the integrated learning model uses a long short-term memory network (LSTM) and a convolutional neural network (CNN) as base models, wherein the CNN is used to extract local features in the temporal dimension from the input sequence data, and the LSTM is used to capture long-term dependencies in the sequence data.
[0065] Furthermore, the input of the ensemble learning model is a sequence of process variable data from the previous N consecutive time steps, and the output is the pH prediction value at the current time step.
[0066] The convolutional neural network module consists of three cascaded one-dimensional convolutional layers, with a ReLU activation function connected after each convolutional layer. The long short-term memory network module consists of two cascaded LSTM networks.
[0067] In this invention, to construct the ensemble learning model, Long Short-Term Memory (LSTM) and Convolutional Neural Network (CNN) are selected as base models. The LSTM model, with its unique gating mechanism, can effectively handle long-term dependencies in time-series data, exhibiting significant advantages in modeling data with temporal dimensions; while the CNN model, with its powerful feature extraction capabilities, performs excellently when processing spatially structured data. Using these two models as base models aims to fully leverage their respective advantages to address different types of data features, providing a diverse model foundation for subsequent ensemble learning.
[0068] An ensemble learning model consists of an input layer, convolutional blocks, recurrent blocks, and an output layer.
[0069] The input layer receives the input data from the cleaned dataset described above;
[0070] Convolutional Block (CNN): Consists of three cascaded one-dimensional convolutional layers. The first layer uses 32 convolutional kernels of size 3, the second layer uses 64 convolutional kernels of size 3, and the third layer uses 128 convolutional kernels of size 3. Each convolutional layer is followed by a ReLU activation function and a max pooling layer of length 2.
[0071] Recurrent Block (LSTM): The feature sequence output from the convolutional block is input into a recurrent block consisting of two cascaded LSTM layers. The first LSTM layer has 100 hidden units and returns the complete sequence; the second LSTM layer has 50 hidden units and returns only the output of the last time step.
[0072] Output layer: A multilayer perceptron with one neuron, a linear activation function, and outputs the final pH prediction value;
[0073] The input layer is a fully connected (FC) layer, which transforms low-dimensional data into high-dimensional data to facilitate subsequent feature extraction. The convolutional block consists of three cascaded CNN layers, effectively extracting temporal features from the input sequence data. After processing by the convolutional block, the data enters a recurrent block composed of two cascaded LSTM layers. The recurrent block captures the temporal dependencies of the data. Finally, the FC layer of the output layer is used to...
[0074] Calculate the predicted target value.
[0075] As a further improvement of the present invention: the intelligent optimization algorithm adopts the ivy optimization algorithm, which obtains and determines the optimal hyperparameter combination of the ensemble learning model. The prediction error of the ensemble learning model on the validation set is used as the fitness function of the ivy optimization algorithm. Iterative optimization is performed within a preset hyperparameter search space by simulating the growth, diffusion, and evolution of ivy plants. The hyperparameters to be obtained by the ivy optimization algorithm include at least the learning rate of the ensemble learning model, batch size, the number of filters and kernel size of the convolutional neural network, and the number of hidden units in the long short-term memory network.
[0076] Specifically, the Ivy (IVY) algorithm is a novel heuristic optimization algorithm that simulates the coordinated and orderly population growth, diffusion, and evolution of ivy plants. This algorithm is a highly efficient optimization tool, its main feature being its ability to maintain population diversity, thus preventing premature convergence to local optima. Its simple and flexible design makes it easy to modify and extend, adapting to different optimization problems and needs. The algorithm flow is as follows:
[0077] a) Population initialization: The IVY algorithm uses an ivy plant population as a model, where each individual represents a potential solution. During initialization, the position of each individual in the population is randomly generated by formula (1), and these positions represent potential values in the search space.
[0078] I i =I min +rand(1,D)☉(I max -I min ), i = 1, 2, 3, ..., Npop
[0079] Among them, I min and I max These are the upper and lower bounds of the search space, respectively. rand(1,D) represents a D-dimensional vector of uniformly distributed random numbers in the interval [0,1]. The operation "⊙" represents the Hadamard product of the two vectors. Npop and D represent the number of population members and the number of decision variables in the problem, respectively.
[0080] b) Growth rate model: This algorithm uses a differential equation to simulate the growth rate G of ivy. v (t), by adjusting the growth rate ψ and a correction factor To simulate the ivy's adaptation to the environment and its resource acquisition strategies.
[0081]
[0082] c) Guided Growth and Diffusion: During the algorithm's iteration, each ivy individual determines its growth direction based on information from other ivy plants nearby, simulating the behavior of ivy in nature—optimizing its survival and growth by growing towards light sources and attaching itself to other plants or structures. The description of ivy individual I... i Using individual I ii It grows along the direction of the light source.
[0083]
[0084] in, Let N(1, D) represent the current Ivy individual, and let N(1, D) represent a D-dimensional random vector. Indicates the growth rate.
[0085] Adaptive growth: Ivy plants select their growth path based on fitness, prioritizing neighboring plants with the highest fitness. best As a growth direction, it enables the algorithm to quickly locate a better solution area.
[0086]
[0087] e) Population update and selection: At the end of each iteration, the algorithm updates the population based on the fitness evaluation results of individuals, retaining individuals with high fitness and eliminating individuals with low fitness, thereby achieving convergence of the algorithm towards excellent solutions.
[0088] The Ivy League (IVY) optimization algorithm is used to automatically optimize the model hyperparameters, with the optimization objective being to minimize the mean squared error (MSE) of the model on the validation set.
[0089] The hyperparameter search space is set as follows: learning rate: [0.0001, 0.01]; batch size: [16, 32, 64]; number of first-layer CNN convolutional kernels: [16, 32, 64]; number of first-layer LSTM hidden units: [50, 100, 150]. Within the preset hyperparameter search space, an initial population consisting of multiple "evergreen individuals" is randomly generated. The position of each individual ((X_i)) represents a set of possible hyperparameter combinations, such as a specific set of learning rates, batch sizes, number of filters, etc. This is the starting point for the algorithm to perform global exploration and evaluate the quality of each individual in the population. The fitness function is defined as the prediction error of the CNN-LSTM model on the validation set, such as the mean squared error (MSE). The smaller the error, the higher the fitness. The model training process is called: the CNN-LSTM model is temporarily trained using the hyperparameters represented by the individuals, and its performance is evaluated using the validation set. The IVY algorithm updates the population position by simulating the growth behavior of ivy. A dynamic growth rate is defined for each individual, controlling its exploration step size. Individuals tend to grow towards the nearest best individual (X_{best}) while a random perturbation (N(1,D)) is introduced for diffusion. The fitness of the updated position determines whether to accept the new position, ensuring the population evolves towards a better region. The termination condition is typically set to reaching the maximum number of iterations, or when the highest fitness of the population no longer increases after multiple consecutive iterations. After the algorithm finishes running, the individual with the highest fitness is selected from all iterations; the hyperparameter combination represented by this individual is the globally optimal or near-optimal solution found by the IVY algorithm. This hyperparameter will be used to train the CNN-LSTM ensemble learning model for actual prediction. The IVY algorithm is a novel intelligent optimization algorithm that simulates the climbing growth strategy of ivy. Its core role in pH prediction is to accurately tune the model's hyperparameters, thereby improving prediction accuracy and stability. Specifically, in pH prediction tasks, the input variables typically include multiple parameters. The IVY algorithm simulates a two-stage "climb-expansion" search mechanism to efficiently explore the solution space, automatically find the optimal combination of hyperparameters, and improve the model's fitting ability and generalization performance.
[0090] For the optimization parameters, upper and lower limits are set to ensure that the parameter search process is conducted within a feasible range, avoiding model training failure or performance anomalies due to excessively large or small parameter values. Simultaneously, the number of optimization iterations is determined, such as 100 iterations, to ensure that the model can fully learn the features and patterns in the data within a limited number of iterations, without getting trapped in local optima or increasing computational costs due to excessive iteration. This invention employs the IVY algorithm. As an advanced adaptive optimization algorithm, the IVY algorithm can dynamically adjust the optimization parameters based on the model's performance during training, thereby achieving efficient and accurate optimization of the ensemble learning model parameters. Through the application of the IVY algorithm, the model can quickly explore the parameter space, find the optimal parameter combination, and thus improve the overall performance of the model, making it more adaptable and accurate when processing complex data.
[0091] As a further improvement of the present invention: the real-time acquired process variable data is input into the trained and optimized ensemble learning model, and the preprocessed real-time process variable data is input into the trained and optimized ensemble learning model to obtain the pH prediction value output by the ensemble learning model;
[0092] As a further improvement of the present invention: the final output of the ensemble learning model is based on the error comparison of the Long Short-Term Memory (LSTM) network and the Convolutional Neural Network (CNN) on the validation set.
[0093] When the error difference between the Long Short-Term Memory (LSTM) network and the Convolutional Neural Network (CNN) exceeds a preset threshold, the output of the base model with the smaller error is selected as the final predicted value.
[0094] When the error difference is less than or equal to the preset threshold, the outputs of the two base models are weighted and fused, and the fusion result is used as the final predicted value.
[0095] The preset threshold θ is set to 0.05, and the comparison method is as follows:
[0096]
[0097] The final predicted value for pH is:
[0098] pH final =W c pH cnn +W l pH lstm
[0099] Among them, W c pH represents the weight coefficients of a convolutional neural network (CNN). cnn pH is the pH prediction value of a convolutional neural network (CNN). lstm W represents the pH prediction value of the Long Short-Term Memory (LSTM) network.l These are the weight coefficients of the Long Short-Term Memory (LSTM) network.
[0100] As a further improvement of the present invention: in the weighted fusion of the outputs of the two base models, the method for determining the weight coefficients is as follows: calculate the mean squared error of the Long Short-Term Memory Network (LSTM) and the Convolutional Neural Network (CNN) on the validation set, and use the proportion of the reciprocal of the mean squared error in the sum of the LSTM and CNN as the weight coefficient for the base model.
[0101] The weight coefficients of a Convolutional Neural Network (CNN) are calculated as follows:
[0102]
[0103] The weight coefficients of the Long Short-Term Memory (LSTM) network are calculated as follows:
[0104]
[0105] Among them, MSE c It is the validation set MSE of the convolutional neural network (CNN). l It is the validation set MSE of the Long Short-Term Memory (LSTM) network.
[0106] On the other hand, the present invention also provides an intelligent system for soft-sensing pH measurement of a reaction vessel for implementing the method described in any of the preceding claims, comprising:
[0107] The data acquisition module is used to acquire historical time series data of the multiple process variables from the distributed control system of the reactor in real time;
[0108] The data preprocessing module is used to clean and normalize the received data and to divide the dataset.
[0109] The soft measurement model module, based on an ensemble learning model constructed from long short-term memory networks and convolutional neural networks, is used to receive preprocessed data and predict pH values.
[0110] The intelligent optimization module employs the Evergreen optimization algorithm to automatically search for and determine the optimal hyperparameter combination of the soft measurement model module.
[0111] The prediction output module receives the prediction results from the Long Short-Term Memory Network and the Convolutional Neural Network, and outputs the final pH soft measurement value based on the error comparison results of the Long Short-Term Memory Network and the Convolutional Neural Network on the validation set.
[0112] In summary, after reading this invention document, those skilled in the art can make various other corresponding modifications to the technical solutions and concepts based on this invention without creative mental effort, and all of these modifications fall within the scope of protection of this invention.
Claims
1. A soft measurement method for pH value in a reaction vessel based on an intelligent algorithm, characterized in that, Includes the following steps: Time series data of multiple process variables during the operation of the reactor are acquired, and the time series data are preprocessed and divided into training set, validation set and test set; An ensemble learning model is constructed, which includes at least two different neural network models as base models, for extracting features from the process variable data and establishing a mapping relationship with pH value; An intelligent optimization algorithm is used to obtain the hyperparameter combination of the ensemble learning model with the performance of the ensemble learning model on the validation set as the optimization objective, thereby completing the training and optimization of the ensemble learning model. The process variable data acquired in real time are input into the trained and optimized ensemble learning model, and the final pH soft measurement result is output by selection or fusion based on the results of each base model on the validation set.
2. The method for soft measurement of pH value in a reaction vessel based on an intelligent algorithm according to claim 1, characterized in that, The acquisition of time series data of multiple process variables during the operation of the reactor includes: real-time acquisition of historical time series data of multiple process variables related to pH value from the distributed control system of the reactor, wherein the process variables include liquid alkali opening degree, cocoyl chloride opening degree, temperature and pH value.
3. The method for soft measurement of pH value in a reaction vessel based on an intelligent algorithm according to claim 2, characterized in that, The preprocessing of the time series data and its division into training, validation, and test sets includes: The historical time series data is cleaned and normalized preprocessed, and the dataset is divided into training set, validation set and test set according to time order; The data preprocessing includes: The data cleaning process is used to identify and remove outliers, fill in missing values, and filter noise in the historical time series data. The data normalization process is used to linearly transform the data of each process variable to the [0,1] interval using a normalization method; The dataset partitioning process is used to divide the complete dataset into training, validation, and test sets in an 8:1:1 ratio.
4. The method for soft measurement of pH value in a reaction vessel based on an intelligent algorithm according to claim 3, characterized in that, The ensemble learning model uses a Long Short-Term Memory (LSTM) network and a Convolutional Neural Network (CNN) as base models. The CNN is used to extract local features in the temporal dimension from the input sequence data, while the LSTM network is used to capture long-term dependencies in the sequence data.
5. The method for soft measurement of pH value in a reaction vessel based on an intelligent algorithm according to claim 4, characterized in that, The input to the ensemble learning model is a sequence of process variable data from the previous N consecutive time steps, and the output is the pH prediction value at the current time step. The convolutional neural network module consists of three cascaded one-dimensional convolutional layers, with a ReLU activation function connected after each convolutional layer. The long short-term memory network module consists of two cascaded LSTM networks.
6. The method for soft measurement of pH value in a reaction vessel based on an intelligent algorithm according to claim 5, characterized in that, The intelligent optimization algorithm employs the Ivy optimization algorithm, which acquires and determines the optimal hyperparameter combination of the ensemble learning model. The prediction error of the ensemble learning model on the validation set is used as the fitness function of the Ivy optimization algorithm. It iterative optimization is performed within a preset hyperparameter search space by simulating the growth, diffusion, and evolution of ivy plants. The hyperparameters to be acquired by the Ivy optimization algorithm include at least the learning rate of the ensemble learning model, batch size, the number of filters and kernel size of the convolutional neural network, and the number of hidden units in the long short-term memory network.
7. The method for soft measurement of pH value in a reaction vessel based on an intelligent algorithm according to claim 6, characterized in that, The process variable data acquired in real time is input into the trained and optimized ensemble learning model, and the preprocessed real-time process variable data is input into the trained and optimized ensemble learning model to obtain the pH prediction value output by the ensemble learning model.
8. The method for soft measurement of pH value in a reaction vessel based on an intelligent algorithm according to claim 7, characterized in that, The final output of the ensemble learning model is based on an error comparison of the Long Short-Term Memory (LSTM) network and the Convolutional Neural Network (CNN) on the validation set. When the error difference between the Long Short-Term Memory (LSTM) network and the Convolutional Neural Network (CNN) exceeds a preset threshold, the output of the base model with the smaller error is selected as the final predicted value. When the error difference is less than or equal to the preset threshold, the outputs of the two base models are weighted and fused, and the fusion result is used as the final predicted value. The final predicted value for pH is: pH final =W c pH cnn +W l pH lstm Among them, W c pH represents the weight coefficients of a convolutional neural network (CNN). cnn pH is the pH prediction value of a convolutional neural network (CNN). lstm W represents the pH prediction value of the Long Short-Term Memory (LSTM) network. l These are the weight coefficients of the Long Short-Term Memory (LSTM) network.
9. The method for soft measurement of pH value in a reaction vessel based on an intelligent algorithm according to claim 8, characterized in that, In the weighted fusion of the outputs of the two base models, the weight coefficients are determined as follows: the reciprocals of the mean squared errors of the Long Short-Term Memory (LSTM) network and the Convolutional Neural Network (CNN) on the validation set are calculated, and the proportion of these reciprocals in the sum of the reciprocals of the LSTM and CNN networks is used as the weight coefficients for the base models. The weight coefficients of a Convolutional Neural Network (CNN) are calculated as follows: The weight coefficients of the Long Short-Term Memory (LSTM) network are calculated as follows: Among them, MSE c It is the validation set MSE of the convolutional neural network (CNN). l It is the validation set MSE of the Long Short-Term Memory (LSTM) network.
10. A smart system for soft-sensing pH measurement of a reaction vessel for implementing the method as described in any one of claims 1-9, characterized in that, include: The data acquisition module is used to acquire historical time series data of the multiple process variables from the distributed control system of the reactor in real time; The data preprocessing module is used to clean and normalize the received data and to divide the dataset. The soft measurement model module, based on an ensemble learning model constructed from long short-term memory networks and convolutional neural networks, is used to receive preprocessed data and predict pH values. The intelligent optimization module employs the Evergreen optimization algorithm to automatically search for and determine the optimal hyperparameter combination of the soft measurement model module. The prediction output module receives the prediction results from the Long Short-Term Memory Network and the Convolutional Neural Network, and outputs the final pH soft measurement value based on the error comparison results of the Long Short-Term Memory Network and the Convolutional Neural Network on the validation set.