Background
Catalytic cracking is an important means for converting heavy oil into light oil, is a core device for producing gasoline and diesel oil in a refinery, and is also a main benefit source of the refinery. In recent years, crude oil is increasingly heavy and inferior, market demands for clean fuels and low-carbon olefins are rising, indexes of safety and environmental protection are more and more strict, international competition of petrochemicals is more and more intense, and new challenges are provided for catalytic cracking production by the new requirements. The catalytic cracking is the most complex catalytic production device in the petroleum refining industry, the process mechanism model established for the whole device is very complex, the big data technology directly excavates the rules from mass production data, and the analysis process can reduce the dependence on the complex process mechanism. The data analysis technology of leading edges such as big data and artificial intelligence is applied to the device optimization field, can further improve device control level, and the even running efficiency of hoisting device between optimum operation interval improves the target product yield, promotes product quality, reduces energy consumption and manufacturing cost, improves the security, controls environmental protection index, improves production efficiency and increases economic benefits from a plurality of dimensions.
At present, the application of the big data technology in the field of petrochemical plant optimization is still in the beginning stage of development, some enterprises and scientific research units begin to carry out some researches and attempts, some achievements are obtained, and still a great development and improvement space exists. The research utilizes a transfer entropy algorithm to research the relevance and causal links among all sites, and further establishes a device alarm analysis model; key parameters are determined by combining principal component analysis and coking mechanism analysis, a coking prediction model is established by utilizing a neural network, and a correlation network is established by utilizing cluster analysis, cross-correlation function analysis and the like, so that a scheme for slowing down coking is provided; a gasoline yield prediction model is established by machine learning methods such as a support vector machine. The research obtains a primary application effect, and the long-term applicability of the research needs to be checked. In other researches, the eight lumped dynamic model and the BP type neural network are combined to predict the yield of the catalytic cracking product, the prediction precision is improved compared with that of a single lumped model, however, only 120 groups of training production sample data exist, the coverage time range is small, and the applicability test under wider working conditions is lacked. There are also some researches to apply the artificial neural network technology to device control, but there are also problems of limited training samples and narrow application range.
Therefore, to summarize the deficiencies of the existing methods, several aspects are included: (1) the mechanism model is complex, the establishment difficulty is large, and the time is long. (2) The complex mechanism model has high non-linearity degree, low calculation speed and poor convergence. (3) The number of data samples is small, and the time range is small. (4) The existing method does not consider the time delay effect, and the intrinsic causal relationship between data does not correspond, so that the model extrapolation performance is poor. (5) The variable selection depends on the experience of human experts, some influence variables can be ignored, invalid variables can be added, and the complexity of the model is increased.
Disclosure of Invention
The invention aims to overcome the defects and provides a catalytic cracking unit optimization method based on a data model, and the method is independent of a complex process mechanism, and is used for establishing a reaction unit model according to production history big data; the yield and key properties of the product can be accurately predicted. The variable relevance algorithm provided by the invention can intelligently screen out variables strongly related to the target variable from a large amount of DCS (distributed control system) bit numbers and Lims variables, so that the complexity of the model is reduced to the minimum, and meanwhile, the reliability is ensured. Meanwhile, the method has the advantages of high operation speed, high convergence and strong adaptability, and can be used for guiding real-time online optimization. The invention adopts an intelligent algorithm to determine the time delay effect among different process parameters, so that the calculation is more accurate.
The invention achieves the aim through the following technical scheme: a catalytic cracking unit optimization method based on a data model comprises the following steps:
(1) reading the historical production data of DCS and LIMS of the device, and establishing a DCS and LIMS standard database; standardizing database formats, and establishing index rules, so as to facilitate later-stage query, new addition and extraction;
(2) extracting variable data used for modeling from a standard database for preprocessing, and preparing for later analysis; the preprocessing comprises deleting invalid data, carrying out interpolation fitting filling on missing values, eliminating the influence of noise signals and abnormal values by using a data smoothing technology, carrying out variable classification and carrying out data nonnegative normalization processing; the interpolation method selects one of nearest neighbor interpolation, linear interpolation and cubic spline interpolation; the data smoothing technology adopts a fast Fourier filter smoothing technology to eliminate the influence of high-frequency noise signals and abnormal values on data analysis; and (3) dividing variable types: dividing the variables into a feeding variable, a control variable, a controlled variable and an intermediate monitoring variable; carrying out non-negative normalization processing on the data to eliminate dimension difference of different variables, wherein the processing formula is as follows:
![Figure GDA0002732194800000031](https://patentimages.storage.googleapis.com/2a/87/9d/cf428e13013c6b/GDA0002732194800000031.png)
(3) analyzing the relevance of the variables to select the variables with strong relevance for modeling; the method specifically comprises the following steps: performing relevance analysis on all variables in the process flow to obtain a correlation coefficient matrix, setting a relevance threshold, and selecting variables with strong relevance from a plurality of variables for modeling to reduce complexity on the premise of ensuring precision; the variable correlation analysis adopts the following method: firstly, drawing time series data of DCS and LIMS variables, converting the time series data into image data, then performing appropriate compression on the image data, retaining main image change characteristics, calculating the similarity of a trend graph by using an image similarity algorithm, and finally obtaining a similarity coefficient matrix of each variable;
(4) correcting the time lag effect among variable data by adopting a delay time analysis technology to obtain a variable database directly corresponding to the causal relationship; the delay time analysis technology specifically comprises the following steps: firstly, calculating the Delay time range from Delay _ min to Delay _ max according to device size information and process parameters, then selecting a corresponding DCS variable to draw a historical data time trend graph, establishing a similarity model of a fluctuation signal in the graph according to a graph theory method, searching the similarity of the fluctuation signal in the time range of +/-gamma Delay _ max, determining the time point with the highest similarity as the optimal Delay time, and gamma is a time range coefficient greater than 1; finally, after all delay times are established, a delay time matrix is obtained, the delay time matrix is used for processing the original data, and a variable database corresponding to the cause and effect relationship is obtained;
(5) based on the variable database feeding clustering and the working condition clustering obtained in the step (4); during clustering, firstly, clustering feeding materials into M categories according to three characteristics of feeding material composition, properties and flow, then clustering the feeding materials into N categories under each category of feeding materials according to operation conditions, and counting the sample volume of each category; the clustering algorithm adopts any one of a fuzzy c-means clustering method, a k-means clustering method and a system clustering method; the calculation formula of the clustering distance is as follows:
wherein, the variable X1=(x11,x12,…,x1n);X2=(x21,x22,…,x2n);d12Represents variable X1And X2The distance between them; α ═ α (α)1,α2,…αn) A weight representing each property component; the determination method of α is as follows:
α=Xmax-Xmin;
(6) establishing a variable prediction model through machine learning; the method specifically comprises the following steps: according to the variable correlation analysis in the step (3), determining input and output variables of a prediction model, constructing an ensemble learning method formed by combining a plurality of neural networks, and training and testing the model by using divided sample data; the parameter learning adopts a small batch Mini-batch gradient descent method, each Mini-batch contains the sample of each category obtained by clustering in the step (5), the samples are randomly extracted from each category, and the number of the samples of each category in the Mini-batch is the same; training to obtain a neural network input and output prediction model;
(7) setting an optimization target and corresponding constraint conditions according to the optimization requirements of actual production, optimizing based on the variable prediction model obtained in the step (6), and calculating optimal operation parameters by using a global optimization algorithm to obtain an optimization model; the optimization model constructs a gasoline yield maximization model, a product weighted value maximization model and a product quality index optimization model according to requirements; the optimal operating parameters calculated by the global optimization algorithm are specifically as follows: firstly, determining the category of the feeding to be optimized according to the clustering rule in the step (5), searching a historical sample which enables an objective function to be optimal under the category, calculating the similar distance between the feeding of the sample and the current feeding to be optimized, setting a distance threshold value, and if the distance is smaller than the threshold value, taking the operating condition of the historical sample as the optimal condition of the current feeding; if the distance is greater than the threshold value, the feeding materials are classified into smaller types, and then the searching process is repeated until the optimal working condition is obtained; when the optimization precision is required to be further improved, the working condition obtained by the method can be used as an initial value, and then one global optimization algorithm of a simulated annealing method, a genetic algorithm and a particle swarm optimization algorithm is used for carrying out optimization solution;
(8) predicting based on a variable prediction model, and optimizing based on an optimization model;
(9) and (4) designing an automatic updating mode for the variable prediction model, and after the variable prediction model is updated, synchronously updating the optimization model according to the method for obtaining the optimization model in the step (7) so as to adapt to new working conditions.
Preferably, in the step (2), the interpolation method may select one of nearest neighbor interpolation, linear interpolation and cubic spline interpolation; the data smoothing technology adopts a fast Fourier filter smoothing technology to eliminate the influence of high-frequency noise signals and abnormal values on data analysis; and (3) dividing variable types: dividing the variables into feed variables, control variables (operating conditions), controlled variables and intermediate monitoring variables; carrying out non-negative normalization processing on the data to eliminate dimension difference of different variables, wherein the processing formula is as follows:
preferably, the step (3) is specifically: performing relevance analysis on all variables in the process flow to obtain a correlation coefficient matrix, setting a relevance threshold, and selecting variables with strong relevance from a plurality of variables for modeling to reduce complexity on the premise of ensuring precision; the variable correlation analysis adopts the following method: firstly, time series data of DCS and LIMS variables are mapped and converted into image data, then the image data are compressed appropriately, main image change characteristics are reserved, the similarity of a trend graph is calculated by using an image similarity algorithm, and finally a similarity coefficient matrix of each variable is obtained.
Preferably, the step (4) corrects the time lag effect between data by a delay time analysis technique, wherein the delay time analysis technique is specifically: firstly, estimating the approximate range Delay _ min-Delay _ max of Delay time according to device size information and process parameters, then selecting a corresponding DCS variable to draw a historical data time trend graph, establishing a similarity model of fluctuation signals in the graph according to a graph theory method, searching the similarity of the fluctuation signals in the time range of +/-gamma Delay _ max, determining the time point with the highest similarity as the optimal Delay time, and gamma is a time range coefficient greater than 1; and finally, after all delay time is established, obtaining a delay time matrix, and processing the original data by using the delay time matrix to obtain a variable database corresponding to the cause-effect relationship.
Preferably, in the step (5), during clustering, the feeding materials are firstly clustered into M categories according to the characteristics of feeding material composition, properties, flow rate and the like, then the feeding materials are clustered into N categories according to the operation conditions under each category of feeding materials, and the sample amount of each category is counted; the clustering algorithm adopts any one of a fuzzy c-means clustering method, a k-means clustering method and a system clustering method;
the following method is used for calculating the clustering distance, and the formula is as follows:
wherein, the variable X1=(x11,x12,…,x1n);X2=(x21,x22,…,x2n);d12Represents variable X1And X2The distance between them; α ═ α (α)1,α2,…αn) Representing the weight of each property component. The determination method of α is as follows:
α=Xmax-Xmin。
preferably, the step (6) is specifically: according to the variable correlation analysis in the step (3), determining input and output variables of a prediction model, constructing an ensemble learning method formed by combining a plurality of neural networks, and training and testing the model by using divided sample data; the parameter learning adopts a small batch Mini-batch gradient descent method, each Mini-batch contains samples of each category obtained by the 5 th clustering, the samples are randomly extracted from each category, and the number of the samples of each category in the Mini-batch is basically the same; and obtaining a neural network input and output prediction model through training.
Preferably, the optimization model can construct a gasoline yield maximization model, a product weighted value maximization model and a product quality index optimization model according to requirements.
Preferably, the calculating the optimal operating parameters by using the global optimization algorithm specifically includes: firstly, determining the category of the feeding to be optimized according to the clustering rule in the step (5), searching a historical sample which enables an objective function to be optimal under the category, calculating the similar distance between the feeding of the sample and the current feeding to be optimized, setting a distance threshold value, and if the distance is smaller than the threshold value, taking the operating condition of the historical sample as the optimal condition of the current feeding; if the distance is greater than the threshold value, the feeding materials are classified into smaller types, and then the searching process is repeated until the optimal working condition is obtained; when the optimization precision is required to be further improved, the working condition obtained by the method can be used as an initial value, and then one global optimization algorithm of a simulated annealing method, a genetic algorithm and a particle swarm optimization algorithm is used for carrying out optimization solution.
Preferably, the step (8) performs prediction based on a variable prediction model, and the optimization based on an optimization model includes an offline mode and an online mode, specifically as follows:
(i) an off-line mode:
based on a variable prediction model, the yield and the product property of a predicted product can be simulated by manually inputting feeding information and operating conditions in an off-line mode; based on the optimization model, the feeding information is manually input in an off-line mode, and the optimal operation condition can be calculated;
(ii) and (3) online mode:
reading DCS and LIMS data related to feeding information and operating conditions in real time in an online mode, predicting product yield and product property indexes under the current operating condition in real time according to a prediction model, serving as a soft measuring instrument, and guiding field operation in time; the optimization function reads DCS and LIMS data describing feeding information in real time, and an optimal operation condition suggestion is calculated in real time by applying the optimization model obtained in the step (7); further, the optimization model can be combined with advanced control to realize real-time optimization control.
Preferably, the step (9) designs the automatic updating mode for the variable prediction model as a combination of two updating strategies: firstly, updating at regular time, and secondly, updating immediately when the working condition is continuously changed greatly; when updating, adding new production data into the data set, eliminating a part of the oldest data, and training new model parameters by using the new data set; some hidden parameters such as the mass transfer performance of the device and the like can change slowly along with the use time, and the timeliness of the model can be ensured by updating at regular time; when the working condition is greatly adjusted, new model parameters need to be trained by using new production data in time to adapt to new working conditions.
The invention has the beneficial effects that: (1) the invention fully utilizes the production historical data, can efficiently process data sets with the time of more than years and the data volume of millions of data sets; (2) the correlation algorithm provided by the invention converts the time sequence data into image data, calculates the image similarity after compression, can perform efficient parallel calculation by using a GPU (graphics processing Unit) and efficiently extracts correlation variables, so that the practical application of a large-scale and high-timeliness refining enterprise becomes possible; (3) the invention utilizes the method of graph theory to calculate the delay time between variables, thereby effectively solving the time lag problem in device modeling; (4) the invention adopts an integrated learning algorithm combining a plurality of neural networks, can realize the parallel training of a plurality of computers, improves the model precision and ensures the faster training speed; (5) the optimization algorithm designed by the invention ensures absolute convergence, can obtain an optimization result in a short time, responds to the feeding change of the device in time, and can adjust the optimization time according to the precision requirement; (6) the invention has better universality. The sample data density is high, the acquisition interval is short, the coverage time range can reach several years, the sample distribution is processed through clustering to avoid sample inclination, and the adaptability of the model to various working conditions is greatly improved; (7) the invention designs an automatic updating mode of the model parameters, and ensures the model parameters to adapt to the latest production requirements.
Detailed Description
The invention will be further described with reference to specific examples, but the scope of the invention is not limited thereto:
example (b): as shown in fig. 1, a method for optimizing a catalytic cracking unit based on a data model comprises the following steps:
(1) and establishing a production history database. Reading the complete historical data of the DCS and the LIMS of the catalytic cracking unit in the last year, automatically recording the production process parameter data every 1 minute, and analyzing the outlet component and product material property detection data every 4 hours. And (4) sorting and combining the original data of the DCS and the LIMS, and establishing a database with a well-organized format so as to ensure that the two types of data are easy to read in subsequent analysis.
(2) And (4) data extraction and preprocessing. And performing descriptive statistical analysis on the collected DCS production process parameter data and LIMS material property detection data, analyzing the distribution characteristics, types and statistical significance of the data, and judging whether the data set has missing values and abnormal values. And filling missing values by using an interpolation fitting method. And smoothing the original data by using a fast Fourier filter smoothing technology, filtering a high-frequency noise signal and eliminating the influence of an abnormal value. The data is then nonnegatively normalized. And marking and dividing the variables according to the feeding variable, the control variable, the controlled variable and the intermediate variable.
(3) The variable relevance analysis is modeled by picking strongly relevant variables, as shown in FIG. 2. The DCS system has 516 bit numbers, the LIMS system has 340 material property detections, and in order to obtain a mathematical model which is as accurate as possible and as simple as possible, a group of variables which are most relevant to a prediction optimization model need to be selected. Firstly considering all the position numbers and material property characteristics, and performing modular analysis on three systems of reaction regeneration, fractionation and absorption stability of the catalytic cracking device according to the reality of a production device and by combining the professional knowledge and the associated analysis algorithm of a process engineer. Firstly, the correlation and the causal relationship network among the process parameters of each module are explored, and then the adjustable process parameters and the property characteristics which have great influence on the yield and the quality of the finished product are screened out to be used as input variables of a mathematical model. And the correlation analysis adopts a graph similarity analysis algorithm.
(4) The lag time effect between variable data is corrected by a delay time analysis technique, as shown in fig. 3:
through correlation analysis, variables with strong correlation with product yield and quality properties are screened out, firstly, an approximate range Delay _ min-Delay _ max of Delay time is estimated according to device size information and process parameters, then, corresponding DCS variables are selected to draw a historical data time trend graph, a similarity calculation model of fluctuation signals is established, the similarity of the fluctuation signals is searched within the time range of +/-gamma Delay _ max (gamma is 2-100), and the time point with the highest similarity is determined as the optimal Delay time.
And after all delay time is established, obtaining a delay time matrix, and processing the original data by using the delay time matrix to obtain a variable database directly corresponding to the cause and effect relationship.
(5) Feed clustering and operating condition clustering, as shown in fig. 4 and 5:
and (4) performing cluster analysis on the data samples based on the database obtained in the step 4. Firstly, feeding materials are clustered into different categories according to information such as feeding material composition, properties and flow, and the operation conditions are clustered into a plurality of groups under each category of feeding materials. And (4) according to the intensity of data fluctuation, the feeding categories are grouped into M categories, M is 2 to 30, the operation conditions under each feeding category are grouped into N categories, N is 2 to 50, and the sample size of each category is counted.
(6) Machine learning to establish a variable prediction model:
and (3) determining input and output variables of an optimization model through the analysis of the step 3, constructing an ensemble learning method formed by combining 3 to 10 neural networks, training and testing by using divided sample data, wherein the parameter learning adopts a small batch gradient descent method, each Mini-batch comprises samples of each large class of the 5 th step of clustering, a part of samples are randomly extracted from each large class, and the number of the samples of each large class in the Mini-batch is the same. And obtaining an input and output prediction model through training.
(7) Establishing an optimization model:
and (3) endowing each product with a value coefficient according to the market price of each product, taking the sum of the product of the yield of each product and the value coefficient as a value function of the total product, taking the value function of the total product as a target, and calculating the optimal operation parameters corresponding to different feeding conditions by using an optimization algorithm based on the input-output model obtained in the step 6. The optimization objective may also be to select a gasoline yield maximization, or a product quality index optimization.
The optimal operation parameter optimization adopts an algorithm specially designed by the invention, firstly, the category of the feeding to be optimized is determined according to the clustering rule of the step 5, a historical sample which enables an objective function to be optimal under the category is searched, the similar distance between the sample feeding and the current feeding to be optimized is calculated, a distance threshold value is set, and if the distance is smaller than the threshold value, the operation working condition of the historical sample is taken as the optimal working condition of the current feeding; if the distance is greater than the threshold, the feed is classified into smaller classes and the search process is repeated until an optimum condition is obtained. When the optimization precision is required to be further improved, the working condition obtained by the method can be used as an initial value, and then one of global optimization algorithms such as a simulated annealing method, a genetic algorithm, a particle swarm algorithm and the like is used for further optimization.
(8) Respectively predicting and optimizing the variable prediction model and the optimization model; wherein the line mode is separated from the online mode as follows:
an off-line mode:
and (4) manually inputting feeding information and operating conditions in an off-line mode based on the prediction model obtained in the step 6, so that the yield and the product property of the predicted product can be simulated.
And (4) manually inputting feeding information in an off-line mode based on the optimization model obtained in the step 7, and calculating the optimal operation condition.
And (3) online mode:
and reading DCS and LIMS data related to the feeding information and the operation condition in real time in an online mode, predicting the product yield and the product property index under the current operation condition in real time according to the prediction model, and serving as a soft measuring instrument to guide field operation in time. And the optimization function reads DCS and LIMS data describing feeding information in real time, and calculates an optimal operation condition suggestion in real time by applying the optimization model obtained in the step 7. Furthermore, the optimization model can be combined with advanced control, so that real-time optimization control is realized, and the device is ensured to be in an optimal operation interval for a long time.
(9) And (3) automatic updating of the model:
two automatic model updating modes are designed, so that the prediction optimization model can always adapt to new working conditions. Firstly, updating at regular time, and secondly, updating immediately when the working condition continuously changes greatly. And when updating, adding new production data into the data set, simultaneously eliminating a part of the oldest data, and training new model parameters by using the new data set. Some hidden parameters such as the mass transfer performance of the device and the like can change slowly along with the use time, the timeliness of the model can be ensured by updating at regular time, and the period of updating at regular time is selected from 1 to 6 months. When the working condition is greatly adjusted, new model parameters need to be trained by using new production data in time to adapt to new working conditions. And designing a working condition fluctuation monitor, and automatically starting an updating mode when the fluctuation degree continuously exceeds a design threshold value.
The method is used for a refining enterprise, as shown in figure 6, the method is applied to carry out prediction optimization on the working condition of one month, the average prediction error of the gasoline/diesel yield is less than 2%, the average prediction error of key properties such as distillation points and the like is less than 0.8%, and the prediction model achieves very high precision. The optimization model provides guidance suggestions of optimal operation parameters in real time according to price data and feeding information, adjustment suggestions are provided every 5-10min, the prediction model is used for estimation, the operation suggestions provided by the optimization model are used, and the total product value can be improved by more than 4%.
While the invention has been described in connection with specific embodiments thereof, it will be understood by those skilled in the art that various changes in form and details may be made therein without departing from the spirit and scope of the invention as defined by the appended claims.