A fully automatic online PAT continuous crystallization control method, medium and system

Through the fully automatic online PAT continuous crystallization control method, the multi-branch neural network model and genetic algorithm are used for parameter optimization, which solves the problem of difficulty in realizing adaptive online optimization in the existing technology, and realizes real-time optimization control of the continuous PAT crystallization process and the stability of product quality.

CN119310895BActive Publication Date: 2025-03-25PHARMAVISION QINGDAO INTELLIGENT TECH LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202411305108.1
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-09-19
Publication Date
2025-03-25
Estimated Expiration
2044-09-19

AI Technical Summary

Technical Problem

The existing PAT continuous crystallization control technology is difficult to achieve adaptive online optimization and cannot effectively respond to dynamic changes in production.

Method used

The fully automatic online PAT continuous crystallization control method is used to collect historical data for time series analysis and Bayesian network correlation analysis to establish a mapping relationship between parameters and effects. Then, the multi-branch neural network model is used to evaluate the effect, and the parameter optimization is performed through genetic algorithms, and finally the control parameters of the production equipment are calculated through the empirical equation system for automatic adjustment.

Benefits of technology

Real-time optimization and control of the continuous crystallization process of PAT is achieved, and the production process can be continuously optimized, respond to dynamic changes, and ensure the stability and consistency of product quality.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119310895B_ABST
    Figure CN119310895B_ABST
Patent Text Reader

Abstract

The present invention provides a fully automatic online PAT continuous crystallization control method, medium and system, belonging to the technical field of PAT continuous crystallization, including: first, performing time series analysis and Bayesian network correlation analysis on the collected crystallization process parameters and effect data to obtain the change optimization curve and spectrum characteristics of each parameter. Then, using these spectrum characteristics as input, a multi-branch neural network model is established to achieve online prediction of the current crystallization process effect. Next, through genetic algorithm optimization, the optimal crystallization process parameter combination is found, and it is converted into actual production equipment control parameters to automatically adjust the production equipment. The present invention collects and analyzes historical data of the PAT continuous crystallization process, establishes an online effect evaluation model based on a neural network, and solves the technical problem that it is difficult to achieve adaptive online optimization and respond to dynamic changes in production in the prior art.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention belongs to the technical field of PAT continuous crystallization, and in particular, relates to a fully automatic online PAT continuous crystallization control method, medium and system. Background Art

[0002] In the food, pharmaceutical, chemical and other industries, the crystallization process is an indispensable operation for the production of crystal products, and it is also a key operation for controlling the quality of crystal products. Most of the existing crystallizers are produced by intermittent crystallization. This method generally requires manual feeding, has low production efficiency, and is prone to poor product quality stability. In order to solve the above problems, a continuous crystallization device came into being, that is, a crystallization device that can achieve continuous feeding and continuous discharging. At present, the parameters such as the morphology, size, and supersaturation of the solution in the continuous crystallization device are not collected in real time, so the quality control of the final crystal product is still behind the advanced technology of developed countries, among which the application of process analytical technology (PAT) is the key. PAT technology is a system for designing, analyzing and controlling production by means of real-time monitoring (for example, during processing) of the key quality and performance characteristics of raw materials, intermediates and processes. The existing PAT continuous crystallization control technology has the technical problem of being difficult to achieve adaptive online optimization and respond to dynamic changes in production. Summary of the invention

[0003] In view of this, the present invention provides a fully automatic online PAT continuous crystallization control method, medium and system, which can solve the technical problem that the existing PAT continuous crystallization control technology is difficult to achieve adaptive online optimization and respond to dynamic changes in production.

[0004] The present invention is achieved in that:

[0005] A first aspect of the present invention provides a fully automatic online PAT continuous crystallization control method, which comprises the following steps:

[0006] S10, collecting historical PAT continuous crystallization process data and corresponding effect data, including temperature, particle size, morphology, turbidity, concentration, supersaturation, cooling rate, stirring rate, feed rate, and crystallization time; the crystallization process data is collected once every 1 minute; the effect data includes product yield, crystal purity, crystal size distribution, crystal morphology uniformity, and crystallization cycle;

[0007] S20, establishing a curve for each parameter in the crystallization process data, using a time series analysis method to perform smoothing and trend analysis on each curve, and using a Bayesian network to perform correlation analysis on the effect data to obtain a change optimization curve for each parameter;

[0008] S30, performing spectrum analysis on the variation optimization curve of each parameter by using fast Fourier transform to obtain the spectrum characteristics of each parameter;

[0009] S40, establishing a training data set, wherein the input of the training is the spectrum characteristics of each parameter, the output of the training is the effect data, and a neural network model with a multi-branch structure is trained to obtain an online PAT continuous crystallization effect evaluation model;

[0010] S50, obtaining process data of the current production heavy PAT continuous crystallization process to establish a corresponding curve, and using fast Fourier transform to perform spectrum analysis to obtain the spectrum characteristics of each parameter, recorded as the current spectrum characteristics, and input into the online PAT continuous crystallization effect evaluation model to obtain predicted effect data;

[0011] S60, based on the process data of the current production heavy PAT continuous crystallization process, a set of initial solutions is generated by data augmentation, each solution represents a set of possible process data, and the frequency spectrum characteristics represented by each solution are input into the online PAT continuous crystallization effect evaluation model to obtain predicted effect data;

[0012] S70, using the group of initial solutions as a population, using the preset target effect data as an objective function, using a genetic algorithm to iteratively solve, and obtaining the individual with the highest fitness as the optimal solution;

[0013] S80, converting the process data corresponding to the optimal solution into production equipment control parameters using an empirical equation group, including at least a temperature controller setting value, agitator speed, feed pump flow rate, and cooler power, and gradually adjusting various parameters of the production equipment through a control system;

[0014] S90, executing S50-S80 in a loop at a preset loop duration.

[0015] Specifically, the step S10 specifically includes: collecting data of the historical PAT continuous crystallization process, including process parameter data such as temperature, particle size, morphology, turbidity, concentration, supersaturation, cooling rate, stirring rate, feed rate and crystallization time, with a collection frequency of once every 1 minute. At the same time, corresponding effect data are also collected, including product yield, crystal purity, crystal size distribution, crystal morphology uniformity and crystallization cycle. This method can fully reflect the dynamic changes of the PAT continuous crystallization process, and establish a mapping relationship between parameters and effects, providing basic data support for subsequent optimization modeling.

[0016] Wherein, the step S20 specifically includes: establishing a time series curve for the collected crystallization process parameter data, and then using a time series analysis method such as exponential smoothing, moving average or Fourier analysis to smooth and trend each curve to remove random noise components. Then, the Bayesian network is used to perform correlation analysis in combination with the effect data to obtain the degree of influence of each parameter change on the quality of the final product, thereby establishing a change optimization curve for each parameter. This step aims to explore the complex dependency between parameters and effects, and provide an important basis for subsequent optimization control.

[0017] Wherein, the step S30 specifically includes: performing fast Fourier transform analysis on the change optimization curve of each parameter to extract its spectrum characteristics. Fourier transform can convert time domain signals into frequency domain signals, thereby revealing the periodic characteristics of parameter changes. Through spectrum analysis, the key frequency components of each parameter can be obtained, providing important feature input for subsequent neural network model training. This step aims to fully explore the inherent laws of parameter changes.

[0018] Wherein, the step S40 specifically includes: establishing a neural network model with a multi-branch structure as an online PAT continuous crystallization effect evaluation model. The model includes a feature screening module, an overall feature prediction branch network, a local feature prediction branch network, and a fusion network. The feature screening module uses principal component analysis and wavelet transform to reduce the dimension and denoise the spectrum features, and uses the information gain method to screen out key local features. The overall feature prediction branch network and the local feature prediction branch network use improved LSTM networks and CNN networks to predict the overall effect and local effect respectively. Finally, the fusion network fuses the prediction results of the two branches to obtain the final effect data. This multi-branch network structure can fully tap the global and local information in the spectrum features and effectively model the complex mapping relationship of the PAT continuous crystallization process.

[0019] Wherein, the step S50 specifically includes: firstly obtaining the actual data of the PAT continuous crystallization process in the current production, establishing the corresponding time series curve, and using the fast Fourier transform to obtain the spectrum characteristics of each parameter. Then, these spectrum characteristics are input into the online PAT continuous crystallization effect evaluation model established in step S40 to obtain the predicted effect data. Through this step, the product quality level that may be achieved under the current production process can be quickly estimated, providing a basis for subsequent optimization control.

[0020] Wherein, the step S60 specifically includes: based on the actual data of the PAT continuous crystallization process in the current production, a set of initial solutions is generated by data augmentation. Each initial solution represents a set of possible process data. Then, the spectral features corresponding to each initial solution are input into the online PAT continuous crystallization effect evaluation model to obtain predicted effect data. This step is intended to provide a sufficiently rich initial solution space for subsequent optimization iterations and increase the exploration scope of the algorithm.

[0021] Wherein, the step S70 specifically includes: using a set of initial solutions generated in step S60 as a population, using the pre-set target effect data as the objective function, and using a genetic algorithm for iterative optimization and solution. The genetic algorithm continuously evaluates the fitness of each individual by simulating the mechanisms of biological evolution such as selection, crossover, and mutation, and selects the individual with the highest fitness as the parent for further optimization, and finally obtains the individual with the highest fitness as the optimal solution. This step aims to find the best process parameter combination that can meet the target effect.

[0022] Wherein, the step S80 specifically includes: converting the process data corresponding to the optimal solution obtained in step S70 into specific control parameters of production equipment such as temperature controller setting value, agitator speed, feed pump flow, cooler power, etc. through an empirical equation group. These empirical equation groups take into account the influence of various process factors on equipment parameters. Finally, these control parameters gradually adjust the relevant settings of the production equipment through the control system to achieve optimal control of the PAT continuous crystallization process. This step aims to convert the optimized parameter scheme into an operational production equipment control strategy.

[0023] Wherein, the step S90 specifically includes: repeating steps S50 to S80 every 30 minutes. This time interval is sufficient to observe the effect changes after the parameter adjustment, and can also respond to dynamic changes in the production process in a timely manner. By periodically repeating these steps, the PAT continuous crystallization process can be continuously optimized to ensure that the product quality is stable and meets the standards. This step is intended to achieve real-time monitoring and adaptive regulation of the PAT continuous crystallization process.

[0024] On the basis of the above technical solution, a fully automatic online PAT continuous crystallization control method of the present invention can also be improved as follows:

[0025] The preset cycle duration is specifically 30 minutes.

[0026] This length of time is sufficient to observe the effects of parameter adjustments and to respond promptly to changes in the production process.

[0027] Furthermore, the empirical equation group includes a temperature controller setting equation, an agitator speed setting equation, a feed pump flow setting equation, and a cooler power setting equation.

[0028] The formula of each equation in the empirical equation group is specifically described as follows:

[0029] 1. Temperature controller setting equation:

[0030]

[0031] Where, T set is the temperature controller set value (℃); T base is the base temperature (℃); ΔC is the difference between the current supersaturation and the target supersaturation (g / L); k 1 ,k 2 ,k 3 ,k 4 is the unknown coefficient; ω is the temperature fluctuation frequency (rad / min); φ is the fitting phase angle (rad); t is the time (min).

[0032] Parameter acquisition method:

[0033] T base Determined through experiments, the specific steps are:

[0034] 1) Conduct PAT crystallization experiments under uncontrolled conditions and record the temperature changes during the crystallization process;

[0035] 2) Analyze the temperature curve and select the temperature at the beginning of crystallization as T base .

[0036] ΔC is obtained by online measurement, the steps are as follows:

[0037] 1) Use an online concentration measuring instrument (such as a refractometer or infrared spectrometer) to measure the solution concentration;

[0038] 2) Calculate supersaturation based on the solubility curve at the current temperature;

[0039] 3) Subtract the calculated supersaturation from the preset target supersaturation to obtain ΔC.

[0040] 2. Agitator speed setting equation:

[0041]

[0042] Where, N is the stirrer speed (rpm); N min is the minimum stirring speed (rpm); N max is the maximum stirring speed (rpm); μ is the solution dynamic viscosity (Pa·s); μ refis the reference dynamic viscosity (Pa·s); ρ is the solution density (kg / m 3 );ρ ref is the reference density (kg / m 3 );E a is the apparent activation energy (J / mol); R is the gas constant (J / (mol·K)); and T is the absolute temperature (K).

[0043] Parameter acquisition method:

[0044] μ and ρ are obtained through online measurement or empirical formula calculation. The online measurement steps are as follows:

[0045] 1) Use an online viscometer to measure the solution dynamic viscosity;

[0046] 2) Use an online densitometer to measure the solution density.

[0047] The calculation steps of the empirical formula are as follows:

[0048] 1) Establish a relationship model between solution viscosity, temperature and concentration:

[0049] μ=a 1 +a 2 C+a 3 T+a 4 CT+a 5 C 2 +a 6 T 2 ;

[0050] 2) Establish the relationship model between solution density, temperature and concentration:

[0051] ρ=b 1 +b 2 C+b 3 T+b 4 CT+b 5 C 2 +b 6 T 2 ;

[0052] Where, C is the solution concentration (g / L), a i and b i is the fitting coefficient.

[0053] E a Through experimental determination, the steps are as follows:

[0054] 1) Measure the crystallization rate at different temperatures;

[0055] 2) plotting lnk versus 1 / T, where k is the crystallization rate constant;

[0056] 3) According to the Arrhenius equation, the slope of the graph is -E a / R.

[0057] 3. Feed pump flow setting equation:

[0058]

[0059] Where, Q is the feed pump flow rate (L / min); Q 0 is the basic feed flow rate (L / min); S is the supersaturation; L is the characteristic crystal size (μm); α, β, γ are the coefficients to be determined; ω f is the flow fluctuation frequency (rad / min); φ f is the phase angle (rad); t is the time (min).

[0060] Parameter acquisition method:

[0061] It is obtained through online measurement and numerical calculation, the steps are as follows:

[0062] 1) Continuously measure the solution concentration using an online concentration meter;

[0063] 2) Calculate supersaturation based on the solubility curve;

[0064] 3) Use numerical differentiation methods (such as the central difference method) to calculate the rate of change of supersaturation.

[0065] Obtained by online particle size analyzer and numerical calculation, the steps are as follows:

[0066] 1) Continuously measure the crystal size distribution using an online particle size analyzer (such as FBRM);

[0067] 2) Calculate characteristic crystal size (such as D50);

[0068] 3) Use numerical differentiation methods to calculate the rate of change of characteristic crystal dimensions.

[0069] 4. Cooler power setting equation:

[0070]

[0071] Where, P is the cooler power (W); P max is the maximum cooling power (W); λ is the cooling response coefficient; T is the current temperature (℃); T target is the target temperature (℃); η is the temperature acceleration coefficient; θ is the periodic adjustment amplitude; i is the imaginary unit; ω c is the cooling power adjustment frequency (rad / min); t is the time (min).

[0072] Parameter acquisition method:

[0073] It is obtained through temperature measurement and numerical calculation, the steps are as follows:

[0074] 1) Use a temperature sensor to continuously measure the crystallizer temperature;

[0075] 2) Use numerical differentiation methods (such as the second-order central difference method) to calculate the second-order derivative of temperature.

[0076] λ is obtained through experiments, the steps are as follows:

[0077] 1) Start the cooler at different initial temperatures and record the temperature changes over time;

[0078] 2) Fitting temperature curve: T(t) = T target +(T 0 -T target ) -λt

[0079] Among them, T 0 is the initial temperature, t is the time;

[0080] 3) Determine the λ value by the least squares method.

[0081] Furthermore, the multi-branch neural network model specifically includes a feature screening module, an overall feature prediction branch network, a local feature prediction branch network and a fusion network.

[0082] Furthermore, the feature screening module is used to screen the frequency spectrum features of each input parameter by using principal component analysis for dimension reduction, wavelet transform for denoising, and information gain method to obtain local features.

[0083] The specific description of the feature screening module is as follows:

[0084] 1. Principal Component Analysis (PCA) Dimensionality Reduction:

[0085] Perform principal component analysis on the spectral features of each parameter to reduce the dimension of the features. The specific steps are as follows:

[0086] a) Standardized data: Standardize the original data so that the mean of each feature is 0 and the variance is 1.

[0087]

[0088] b) Calculate the covariance matrix:

[0089]

[0090] c) Calculate the eigenvalues ​​and eigenvectors of the covariance matrix:

[0091] Cv=λv;

[0092] d) Select the eigenvectors corresponding to the first k largest eigenvalues ​​to form the projection matrix P.

[0093] e) Project the standardized data into the new feature space:

[0094] Y=X std P;

[0095] 2. Wavelet transform denoising:

[0096] Perform wavelet transform denoising on the data after PCA dimensionality reduction to reduce the noise in the data. The specific steps are as follows:

[0097] a) Choose an appropriate wavelet basis function (such as Daubechies wavelet, expressed as DWT) and the number of decomposition levels.

[0098] b) Perform wavelet decomposition on the data:

[0099] [cA j ,cD j ,cD j-1 ,...,cD 1 ] = DWT(Y);

[0100] Among them, cA j is the j-th layer approximation coefficient, cD k is the detail coefficient of the kth layer.

[0101] c) Perform threshold processing on detail coefficients:

[0102] Threshold identifies the preset threshold function, which can be an empirical threshold.

[0103] The threshold can be selected as a hard threshold or a soft threshold, and λ can use a general threshold:

[0104]

[0105] Where σ is the noise standard deviation and N is the signal length.

[0106] d) Use the processed coefficients for wavelet reconstruction (expressed as IDWT):

[0107]

[0108] 3. Information gain method to select features:

[0109] The denoised features are screened using the information gain method to select the most discriminative local features.

[0110] a) Calculate the entropy of the data set:

[0111]

[0112] Among them, p i is the probability of the ith category.

[0113] b) Calculate the conditional entropy of feature A for data set D:

[0114]

[0115] Among them, v is the number of values ​​of feature A, D j It is the sample subset when feature A takes the jth value.

[0116] c) Calculate information gain:

[0117] IG(A)=H(D)-H(D|A);

[0118] d) Sort the features according to information gain and select several features with the highest information gain as local features.

[0119] Furthermore, the overall feature prediction branch network is used for inputting the spectral features of each parameter, and outputting the product yield and crystal purity. The structure is an improved LSTM network obtained by replacing the forget gate in the LSTM network with an adaptive forget gate. The network depth is 1 / 4 of the number of input features, and the number of neurons in each layer is 1 / 2 of the number of input features.

[0120] Furthermore, the local feature prediction branch network is used for inputting the local features of each parameter, and outputting the crystal size distribution and crystal morphology uniformity. The structure is an improved CNN network obtained by replacing the ordinary convolution layer with a hole convolution layer using a CNN network. The network depth is 1 / 3 of the number of local features, and the number of convolution kernels in each layer is twice the number of local features.

[0121] Furthermore, the fusion network is used, the input is the output of the overall feature prediction branch network and the local feature prediction branch network, the output is the final effect data, and the structure is a feedforward neural network containing 2 hidden layers.

[0122] A second aspect of the present invention provides a computer-readable storage medium, wherein the computer-readable storage medium stores program instructions, and when the program instructions are run in a computer, they are used to execute the above-mentioned fully automatic online PAT continuous crystallization control method.

[0123] A third aspect of the present invention provides a fully automatic online PAT continuous crystallization control system, which includes the above-mentioned computer-readable storage medium.

[0124] Compared with the prior art, the fully automatic online PAT continuous crystallization control method, medium and system provided by the present invention have the following beneficial effects:

[0125] First, this method makes full use of historical PAT continuous crystallization process data, including process parameters such as temperature, particle size, morphology, concentration, supersaturation, and effect data such as product yield, crystal purity, and crystal size distribution. Through time series analysis, Bayesian network correlation analysis and other methods, the mapping relationship between each process parameter and product quality is established, which provides an important basis for subsequent optimization. Compared with the existing empirical model control method, this method does not need to rely on complex mechanism models such as crystallization kinetics, and is more adaptable to the dynamic changes of the production environment.

[0126] Secondly, this method uses a multi-branch neural network model as an online PAT continuous crystallization effect evaluation model. The model includes multiple sub-networks such as feature screening, overall effect prediction and local effect prediction, which can fully mine the global and local information in the process parameter spectrum characteristics and effectively characterize the complex parameter-effect mapping relationship. Compared with a single data-driven model, this method can improve the generalization ability and robustness of the model and better adapt to changes in the production process.

[0127] Finally, this method realizes the real-time optimization control of the PAT continuous crystallization process. First, the aforementioned effect evaluation model is used to predict the product quality under the current production process, and a set of initial parameter solutions is generated based on this. Then, a genetic algorithm is used to iteratively optimize these initial solutions to find the optimal process parameter combination that can meet the target product quality requirements. Finally, based on the optimized parameters, the specific control parameters of the production equipment such as the temperature controller setting value, stirring speed, feed flow rate, cooling power, etc. are calculated through the empirical equation group, and automatically adjusted through the control system. This adaptive online optimization mechanism enables this method to continuously optimize the PAT continuous crystallization process, cope with the dynamic changes of the production environment, and ensure the stability and consistency of product quality.

[0128] In summary, the fully automatic online PAT continuous crystallization control method proposed in the present invention can make full use of historical production data to establish an interpretable parameter-effect mapping relationship, adopt a multi-branch neural network model to improve the generalization ability of the model, and realize adaptive online optimization control, thereby effectively solving the technical problems of the existing PAT continuous crystallization control technology that it is difficult to realize adaptive online optimization and respond to dynamic changes in production. BRIEF DESCRIPTION OF THE DRAWINGS

[0129] Figure 1 A flow chart of the method provided by the present invention;

[0130] Figure 2 Schematic diagram of the device structure in Example 2. DETAILED DESCRIPTION

[0131] In order to make the purpose, technical solution and advantages of the embodiments of the present invention more clear, the technical solution in the embodiments of the present invention will be clearly and completely described below in conjunction with the accompanying drawings in the embodiments of the present invention.

[0132] like Figure 1 As shown, it is a flow chart of a fully automatic online PAT continuous crystallization control method provided by the first aspect of the present invention, and the method comprises the following steps:

[0133] S10, collect historical PAT continuous crystallization process data and corresponding effect data, including temperature, particle size, morphology, turbidity, concentration, supersaturation, cooling rate, stirring rate, feed rate, crystallization time; the collection frequency of crystallization process data is once every 1 minute; effect data include product yield, crystal purity, crystal size distribution, crystal morphology uniformity, crystallization cycle;

[0134] S20, establishing a curve for each parameter in the crystallization process data, using a time series analysis method to perform smoothing and trend analysis on each curve, and using a Bayesian network to perform correlation analysis on the effect data to obtain a change optimization curve for each parameter;

[0135] S30, performing spectrum analysis on the variation optimization curve of each parameter by using fast Fourier transform to obtain the spectrum characteristics of each parameter;

[0136] S40, establishing a training data set, wherein the input of the training is the spectrum characteristics of each parameter, the output of the training is the effect data, and a neural network model with a multi-branch structure is trained to obtain an online PAT continuous crystallization effect evaluation model;

[0137] S50, obtaining process data of the current production heavy PAT continuous crystallization process to establish a corresponding curve, and using fast Fourier transform to perform spectrum analysis to obtain the spectrum characteristics of each parameter, record them as current spectrum characteristics, and input them into the input online PAT continuous crystallization effect evaluation model to obtain predicted effect data;

[0138] S60, based on the process data of the current heavy PAT continuous crystallization process, a set of initial solutions is generated by data augmentation, each solution represents a set of possible process data, and the frequency spectrum characteristics represented by each solution are input into the online PAT continuous crystallization effect evaluation model to obtain predicted effect data;

[0139] S70, using a group of initial solutions as a population, using pre-set target effect data as an objective function, using a genetic algorithm to iteratively solve, and obtaining the individual with the highest fitness as the optimal solution;

[0140] S80, converting the process data corresponding to the optimal solution into production equipment control parameters using the empirical equation group, including at least the temperature controller setting value, the agitator speed, the feed pump flow rate, and the cooler power, and gradually adjusting the various parameters of the production equipment through the control system;

[0141] S90, executing S50-S80 in a loop at a preset loop duration.

[0142] The specific implementation methods of the above steps are described in detail below:

[0143] The specific implementation method of step S10 is to collect data of the historical PAT continuous crystallization process, including temperature, particle size, morphology, turbidity, concentration, supersaturation, cooling rate, stirring rate, feed rate and crystallization time, etc. The frequency of collecting these data is once every 1 minute. At the same time, corresponding effect data are also collected, including product yield, crystal purity, crystal size distribution, crystal morphology uniformity and crystallization cycle, etc.

[0144] The data collected in this way can fully reflect the dynamic changes of the PAT continuous crystallization process and provide basic data support for subsequent correlation analysis and optimization modeling. In particular, the continuous sampling of each parameter can restore its change trend, laying the foundation for time series analysis and spectrum analysis. At the same time, combined with the collection of effect data, the mapping relationship between each process parameter and the final product quality can be revealed.

[0145] The specific implementation method of step S20 is to establish a time series curve for each parameter in the crystallization process data, and then use a time series analysis method to smooth and trend each curve. Here, methods such as exponential smoothing, moving average or Fourier analysis can be used to smooth the original data to remove random noise components and highlight the overall change trend of the parameters. At the same time, time series analysis methods such as Holt-Winters model and ARIMA model can also be used to predict and model the parameter change trend.

[0146] Next, we use Bayesian network to conduct correlation analysis based on the effect data to obtain the degree of influence of each parameter change on the quality of the final product. Bayesian network is a machine learning method based on probabilistic graphical models that can effectively mine the complex dependencies between variables. Through Bayesian network analysis, we can obtain the change optimization curve of each parameter, providing an important basis for subsequent optimization control.

[0147] The specific implementation method of step S30 is to perform a fast Fourier transform (FFT) analysis on the change optimization curve of each parameter to obtain its spectrum characteristics. Fast Fourier transform is an efficient discrete Fourier transform algorithm that can convert time domain signals into frequency domain signals, thereby revealing the periodic characteristics of parameter changes. Through spectrum analysis, the key frequency components of each parameter can be extracted, providing important feature input for subsequent neural network model training.

[0148] The specific implementation of step S40 is to establish a multi-branch neural network model as an online PAT continuous crystallization effect evaluation model. The input of the model is the spectrum characteristics of each parameter, and the output is effect data.

[0149] Specifically, the neural network model includes the following modules:

[0150] 1. Feature screening module:

[0151] -Use principal component analysis (PCA) to reduce the dimensionality of the input spectrum features to reduce the feature dimensions. The specific steps of PCA include: standardizing data, calculating covariance matrix, finding eigenvalues ​​and eigenvectors, and selecting principal components.

[0152] -Then wavelet transform is used to denoise the data after PCA dimension reduction to reduce the impact of noise on subsequent analysis. Specifically, it includes the steps of selecting wavelet basis function, wavelet decomposition, threshold processing, wavelet reconstruction, etc.

[0153] -Finally, the information gain method is used to screen the denoised features and select the features with the highest information gain as local features. The calculation of the information gain method includes: calculating the entropy of the data set, calculating the conditional entropy, calculating the information gain, and sorting and selecting features based on the information gain.

[0154] 2. Overall feature prediction branch network:

[0155] -An improved LSTM network structure is adopted, in which the forget gate in the standard LSTM is replaced with an adaptive forget gate to improve the modeling ability of time series features.

[0156] -The network depth is set to 1 / 4 of the number of input features, and the number of neurons in each layer is 1 / 2 of the number of input features.

[0157] -The input of this branch network is the spectrum characteristics of each parameter, and the output is the product yield and crystal purity.

[0158] 3. Local feature prediction branch network:

[0159] -An improved CNN network structure is adopted, in which the standard convolution layer is replaced by a hole convolution layer to increase the receptive field and extract richer local features.

[0160] -The network depth is set to 1 / 3 of the number of local features, and the number of convolution kernels in each layer is twice the number of local features.

[0161] -The input of this branch network is the local characteristics of each parameter, and the output is the crystal size distribution and crystal morphology uniformity.

[0162] 4. Converged Network:

[0163] -Adopting a feedforward neural network structure, the input is the output of the overall feature prediction branch network and the local feature prediction branch network, and the output is the final effect data.

[0164] -The network contains 2 hidden layers, and the number of neurons in the hidden layers is set according to the specific situation.

[0165] Through this multi-branch network structure, the overall and local information in the spectral features can be fully utilized, and the prediction of comprehensive effect data can be achieved through the final fusion network. This network structure takes into account the nonlinear relationship and timing characteristics between parameters, and can effectively model the complex mapping relationship of the PAT continuous crystallization process.

[0166] The specific implementation of step S50 is to first obtain the process data of the PAT continuous crystallization process in the current production and establish the corresponding time series curve. Then, the spectrum analysis of these curves is performed using fast Fourier transform to obtain the spectrum characteristics of each parameter. These spectrum characteristics are recorded as "current spectrum characteristics".

[0167] Next, these current spectrum features are input into the online PAT continuous crystallization effect evaluation model established in step S40 to obtain predicted effect data, so that the product quality level that can be achieved under the current production process can be quickly estimated, providing a basis for subsequent optimization control.

[0168] The specific implementation of step S60 is to generate a set of initial solutions based on the actual data of the PAT continuous crystallization process in current production by means of data augmentation. Each initial solution represents a set of possible process data. Then, the spectral features corresponding to each initial solution are input into the online PAT continuous crystallization effect evaluation model to obtain predicted effect data.

[0169] The purpose of this step is to provide a sufficiently rich initial solution space for subsequent optimization iterations. Through the data augmentation method, a series of reasonable hypothetical solutions can be generated based on the current actual data, which increases the exploration scope of the algorithm search. At the same time, it also ensures that the initial solutions are physically feasible and no meaningless solutions appear.

[0170] The specific implementation of step S70 is to use a group of initial solutions generated in step S60 as a population, use the pre-set target effect data as the objective function, and use a genetic algorithm to perform iterative optimization. A genetic algorithm is a heuristic optimization algorithm based on natural evolution, which guides the population to gradually evolve towards the optimal solution by simulating the mechanisms of biological evolution such as selection, crossover, and mutation.

[0171] In this example, the objective function of the genetic algorithm is the desired effect data, such as product yield, crystal purity, etc. The algorithm will continuously evaluate the fitness of each individual, select the individual with the highest fitness as the parent for crossover and mutation operations, and finally obtain the individual with the highest fitness as the optimal solution. The process data corresponding to this optimal solution is the expected best operation plan.

[0172] The specific implementation of step S80 is to convert the process data corresponding to the optimal solution obtained in step S70 into specific control parameters of the production equipment through an empirical equation group. The empirical equation group includes:

[0173] 1. Temperature controller setting equation:

[0174]

[0175] The equation takes into account the deviation between the current supersaturation and the target supersaturation, the rate of change of supersaturation, and periodic fluctuations. 1 to k 4 And frequency ω, phase φ and other parameters to accurately control the temperature.

[0176] 2. Agitator speed setting equation:

[0177]

[0178] The equation takes into account the influence of factors such as the solution's dynamic viscosity, density, and temperature on the stirrer speed, and adjusts the stirring rate by measuring or calculating these parameters.

[0179] 3. Feed pump flow setting equation:

[0180]

[0181] The equation takes into account the change rate of supersaturation, the change rate of crystal size, and periodic fluctuations. By setting the corresponding coefficients α, β, γ and frequency ω f , phase φ f To adjust the feed flow.

[0182] 4. Cooler power setting equation:

[0183]

[0184] The equation takes into account the deviation between the current temperature and the target temperature, the second-order derivative of the temperature, and the periodic adjustment. c To adjust the cooling power.

[0185] Through these empirical equations, the specific control parameters of the production equipment such as the set value of the temperature controller, the speed of the agitator, the flow rate of the feed pump, the power of the cooler, etc. can be calculated according to the process data corresponding to the optimal solution. These parameters are gradually adjusted through the control system to achieve the optimal control of the PAT continuous crystallization process.

[0186] The specific implementation of step S90 is to perform steps S50 to S80 every 30 minutes. This time interval is sufficient to observe the effect changes after parameter adjustment, and can also respond to dynamic changes in the production process in a timely manner. By periodically repeating these steps, the PAT continuous crystallization process can be continuously optimized to ensure that the product quality is stable and meets the standards.

[0187] In general, this fully automatic online PAT continuous crystallization control method makes full use of historical data and machine learning technology to achieve automatic optimization of crystallization process parameters. By collecting detailed process data, establishing a parameter-effect mapping model, using optimization algorithms to find the optimal parameter combination, and feedback control, the production efficiency and product quality stability of PAT continuous crystallization can be effectively improved. This method has good versatility and scalability and can be widely used in the intelligent control of various continuous crystallization processes.

[0188] In order to better understand and implement the present invention, a specific embodiment 1 of the method of the present invention is provided below. The steps of this embodiment 1 are described in detail as follows: The specific implementation method of step S10 is as follows:

[0189] First, collect historical PAT continuous crystallization process data, including temperature T, particle size D, morphology M, turbidity T c , concentration C, supersaturation S, cooling rate R c , stirring rate N, feed rate Q and crystallization time t and other process parameters. The data are collected once every 1 minute. At the same time, the corresponding effect data are also collected, including product yield Y, crystal purity P, crystal size distribution {D i}、Crystal morphology uniformity M and the crystallization period t c wait.

[0190] This method can fully reflect the dynamic changes of the PAT continuous crystallization process. Continuous sampling of each parameter can restore its change trend, laying the foundation for subsequent time series analysis and spectrum analysis. At the same time, combined with the collection of effect data, it can reveal the mapping relationship between each process parameter and the final product quality.

[0191] The specific implementation of step S20 includes:

[0192] 1. Create a time series curve

[0193] For the collected crystallization process parameter data x(t), where x can be T, D, M, T c , C, S, R c , N, Q or t, and establish its time series curve x(t).

[0194] 2. Time series smoothing and trend analysis

[0195] Each time series curve x(t) is smoothed using exponential smoothing to obtain a smooth curve The formula for exponential smoothing is:

[0196]

[0197] Here, α is the smoothing coefficient, and its value range is [0,1], and α is usually taken as 0.1 or 0.2.

[0198] Then, the Holt-Winters model is used to smooth the time series. Perform trend analysis to obtain the change trend curve of parameter x The Holt-Winters model includes the following formula:

[0199]

[0200] in, is the horizontal term, b(t) is the trend term, ∈(t) is the random error term. α and β are smoothing coefficients, ranging from [0,1].

[0201] 3. Bayesian network correlation analysis

[0202] Combined with effect data y, such as Y, P, {D i}、U M or c Etc., using Bayesian network to analyze the dependency between parameter x and effect y, the influence of each parameter change on the quality of the final product can be obtained.

[0203] Bayesian network is a machine learning method based on probabilistic graphical models. Its core idea is to describe the dependency relationship between variables through the joint probability distribution P(X,Y). For the relationship between parameter x and effect y in this example, the following Bayesian network structure can be established:

[0204] P(x,y)=P(y|x)P(x);

[0205] Among them, P(y|x) represents the conditional probability distribution of effect y given parameter x, and P(x) represents the prior probability distribution of parameter x. By learning these two probability distributions, we can get the influence of each parameter x on the final effect y.

[0206] The specific implementation of step S30 includes:

[0207] The change trend curve of each parameter obtained in step S20 is obtained by fast Fourier transform (FFT). Perform spectrum analysis and extract its spectrum characteristics. Fourier transform can convert time domain signal Converted to frequency domain signal X(ω), the formula is:

[0208]

[0209] Where ω is the angular frequency. The FFT algorithm can be used to efficiently calculate the discrete Fourier transform of discrete-time signals.

[0210] Spectral analysis can reveal the periodic characteristics of parameter x changes. By analyzing the amplitude spectrum and phase spectrum of X(ω), the key frequency components of parameter changes can be extracted, providing important feature input for subsequent neural network model training.

[0211] The specific implementation of step S40 is as follows:

[0212] A multi-branch neural network model was established as an online PAT continuous crystallization effect evaluation model. The model includes the following modules:

[0213] 1. Feature screening module

[0214] Principal Component Analysis (PCA) Dimensionality Reduction

[0215] First, the spectral feature X(ω) of each parameter is subjected to principal component analysis and dimension reduction. The formula of PCA is as follows:

[0216] Y=X std P;

[0217] Among them, X stdis the standardized spectral feature matrix, and P is the projection matrix composed of the first k principal components selected. PCA can effectively reduce the feature dimension.

[0218] Wavelet transform denoising

[0219] Then, the data Y after PCA dimension reduction is subjected to wavelet transform denoising. The wavelet transform formula is:

[0220] [cA j ,cD j ,cD j-1 ,...,cD 1 ] = DWT(Y);

[0221] Among them, cA j is the j-th layer approximation coefficient, cD k is the detail coefficient of the kth layer. The detail coefficient cD is processed by thresholding k To suppress the noise component, and finally use IDWT to reconstruct the denoised features

[0222] Information Gain Feature Selection

[0223] Finally, the information gain method is used to Perform feature selection and select the m features with the highest information gain as local features. The information gain formula is:

[0224] IG(A)=H(D)-H(D|A);

[0225] Among them, H(D) is the entropy of the data set D, and H(D|A) is the conditional entropy of the given feature A.

[0226] 2. Overall feature prediction branch network

[0227] An improved LSTM network structure is adopted, in which the forget gate in the standard LSTM is replaced with an adaptive forget gate to improve the modeling ability of time series features. The network depth is set to 1 / 4 of the number of input features, and the number of neurons in each layer is 1 / 2 of the number of input features. The input of this branch network is the spectral feature X(ω) of each parameter, and the output is the product yield Y and crystal purity P.

[0228] 3. Local feature prediction branch network

[0229] An improved CNN network structure is used, in which the standard convolution layer is replaced by a hole convolution layer to increase the receptive field and extract richer local features. The network depth is set to 1 / 3 of the number of local features, and the number of convolution kernels in each layer is twice the number of local features. The input of this branch network is the local feature of each parameter. The output is the crystal size distribution {D i} and crystal morphology uniformity U M .

[0230] 4. Converged Network

[0231] The feedforward neural network structure is adopted, the input is the output of the overall feature prediction branch network and the local feature prediction branch network, and the output is the final effect data. The network contains 2 hidden layers, and the number of neurons in the hidden layer is set according to the specific situation.

[0232] Through this multi-branch network structure, the overall and local information in the spectral features can be fully utilized, and the prediction of comprehensive effect data can be achieved through the final fusion network. This network structure takes into account the nonlinear relationship and timing characteristics between parameters, and can effectively model the complex mapping relationship of the PAT continuous crystallization process.

[0233] The specific implementation of step S50 includes:

[0234] 1. Obtain the process data of the PAT continuous crystallization process in current production and establish the corresponding time series curve x(t).

[0235] 2. Use fast Fourier transform to perform spectrum analysis on these curves to obtain the spectrum characteristics X(ω) of each parameter. These spectrum characteristics are recorded as "current spectrum characteristics".

[0236] 3. Input the current spectrum feature X(ω) into the online PAT continuous crystallization effect evaluation model established in step S40 to obtain the predicted effect data include wait.

[0237] In this way, the product quality level that can be achieved under the current production process can be quickly estimated, providing a basis for subsequent optimization control.

[0238] The specific implementation of step S60 includes:

[0239] 1. Based on the actual data x(t) of the PAT continuous crystallization process in current production, a set of initial solutions is generated by data augmentation Each initial solution x k (t) represents a set of possible process data.

[0240] 2. For each initial solution x k (t) Perform fast Fourier transform to obtain its spectrum feature X k (ω).

[0241] 3. The spectral feature X of each initial solution k (ω) is input into the online PAT continuous crystallization effect evaluation model to obtain the predicted effect data

[0242] The purpose of this step is to provide a sufficiently rich initial solution space for subsequent optimization iterations. Through the data augmentation method, a series of reasonable hypothetical solutions can be generated based on the current actual data, which increases the exploration scope of the algorithm search. At the same time, it also ensures that the initial solutions are physically feasible and no meaningless solutions appear.

[0243] The specific implementation of step S70 includes:

[0244] 1. A set of initial solutions generated in step S60 As a population, with the pre-set target effect data y * as the objective function.

[0245] 2. Use genetic algorithm to iteratively optimize the population. The objective function of genetic algorithm is:

[0246]

[0247] Among them, y(x(t)) represents the effect data predicted based on the process parameter x(t).

[0248] 3. The genetic algorithm continuously evaluates the fitness of each individual through operations such as selection, crossover, and mutation, and selects the individual with the highest fitness as the parent for further optimization, and finally obtains the individual with the highest fitness x opt (t) is the optimal solution.

[0249] This optimal solution x opt (t) The corresponding process parameters are the expected optimal operation plan.

[0250] The specific implementation of step S80 includes:

[0251] The optimal solution x obtained in step S70 opt (t) is converted into specific control parameters of the production equipment through empirical equations, including the temperature controller setting value T set , agitator speed N, feed pump flow Q, cooler power P, etc.

[0252] 1. Temperature controller setting equation:

[0253]

[0254] Among them, T base is the base temperature, ΔS=SS * is the difference between the current supersaturation and the target supersaturation, k 1 to k 4 is the unknown coefficient, ω is the temperature fluctuation frequency, and φ is the phase angle.

[0255] 2. Agitator speed setting equation:

[0256]

[0257] Among them, N min and N max are the minimum and maximum stirring speeds, μ and ρ are the dynamic viscosity and density of the solution, respectively. ref and ρ ref is the reference value, E a is the apparent activation energy.

[0258] 3. Feed pump flow setting equation:

[0259]

[0260] 4. Feed pump flow setting equation (continued):

[0261]

[0262] Among them, Q 0 is the basic feed flow rate, α, β and γ are unknown coefficients, ω f is the flow fluctuation frequency, φ f is the phase angle. and are the rates of change of supersaturation and characteristic crystal size, respectively.

[0263] 5. Cooler power setting equation:

[0264]

[0265] Among them, P max is the maximum cooling power, λ is the cooling response coefficient, T target is the target temperature, η is the temperature acceleration coefficient, θ is the periodic adjustment amplitude, ω c Adjust frequency for cooling power. is the second derivative of temperature.

[0266] Through these empirical equations, the optimal solution x opt (t) Calculate the specific control parameters of each production equipment. These parameters are gradually adjusted through the control system to achieve optimal control of the PAT continuous crystallization process.

[0267] The specific implementation of step S90 is as follows:

[0268] Steps S50 to S80 are repeated every 30 minutes, which is enough to observe the effect of parameter adjustment and respond to dynamic changes in the production process in a timely manner.

[0269] Specifically:

[0270] 1. Execute step S50, obtain the process data x(t) of the current production process, establish a time series curve, and perform fast Fourier transform to obtain the spectrum feature X(ω), which is input into the effect evaluation model to obtain the predicted effect data

[0271] 2. Execute step S60 to generate an initial solution set {x k (t)}, calculate its spectral characteristics {X k (ω)}, and predicted by the effect evaluation model

[0272] 3. Execute step S70, use genetic algorithm to optimize the initial solution set, and obtain the optimal solution x opt (t).

[0273] 4. Execute step S80, according to x opt (t) Calculate the control parameters of production equipment such as temperature control, stirring, feeding, cooling, etc., and adjust the equipment operation through the control system.

[0274] By repeating this process in a 30-minute cycle, the PAT continuous crystallization process can be continuously optimized to ensure that product quality is stable and up to standard. This real-time monitoring and adaptive control method can effectively respond to dynamic changes in the production process and improve product consistency.

[0275] In general, this Example 1 makes full use of historical data and machine learning technology to achieve intelligent optimization of crystallization process parameters. By establishing a parameter-effect mapping model, using an optimization algorithm to find the optimal parameter combination, and using feedback control to adjust production equipment, the production efficiency and product quality of PAT continuous crystallization can be continuously improved.

[0276] A second aspect of the present invention provides a computer-readable storage medium, wherein the computer-readable storage medium stores program instructions, and when the program instructions are run in a computer, they are used to execute the above-mentioned fully automatic online PAT continuous crystallization control method.

[0277] A third aspect of the present invention provides a fully automatic online PAT continuous crystallization control system, which includes the above-mentioned computer-readable storage medium.

[0278] Specifically, the principle of the present invention is to make full use of historical production data, establish an interpretable model between process parameters and product quality, and use an adaptive optimization algorithm to achieve online regulation to adapt to complex and changeable production environments.

[0279] First, by collecting detailed data of the historical PAT continuous crystallization process, including process parameters and product effects, a comprehensive data foundation was established. Time series analysis can extract the changing trend of each process parameter, while Bayesian network analysis can mine the complex dependencies between parameters and effects. This lays the foundation for subsequent optimization modeling. Compared with the control method that relies on the mechanism model, this method does not require the establishment of complex mathematical models such as crystallization kinetics in advance, and is closer to the actual production environment.

[0280] Secondly, this method adopts a multi-branch neural network model as an online PAT continuous crystallization effect evaluation model. The model consists of three sub-networks: feature screening, overall effect prediction, and local effect prediction. The feature screening module uses methods such as principal component analysis and wavelet transform to extract key local features from the spectral characteristics of process parameters, providing effective input for subsequent predictions. The overall effect prediction branch uses an improved LSTM network, which can model the temporal dependency between parameters and predict overall effects such as product yield and crystal purity. The local effect prediction branch uses an improved CNN network, which can extract rich spatial information from local features and predict local effects such as crystal size distribution and morphology uniformity. By fusing the prediction results of these two branches, a comprehensive product quality prediction is finally obtained. This multi-branch network structure can better characterize the complex parameter-effect mapping relationship of PAT continuous crystallization.

[0281] Finally, this method realizes the real-time optimization control of the PAT continuous crystallization process. First, the aforementioned effect evaluation model is used to predict the product quality under the current production process, and a set of initial parameter solutions is generated based on this. Then, a genetic algorithm is used to iteratively optimize these initial solutions to find the optimal process parameter combination that can meet the target product quality requirements. Finally, based on the optimized parameters, the specific control parameters of the production equipment such as the temperature controller setting value, stirring speed, feed flow rate, cooling power, etc. are calculated through the empirical equation group, and automatically adjusted through the control system. This adaptive online optimization mechanism enables this method to continuously optimize the PAT continuous crystallization process, cope with the dynamic changes of the production environment, and ensure the stability and consistency of product quality.

[0282] In order to better understand and implement the present invention, a specific embodiment 2 of the present invention is provided below: Figure 2The fully automatic online PAT continuous crystallization device of the present embodiment 2 shown is mainly composed of a hardware system, a software system, and a data acquisition and communication system. The hardware system includes a feed tank, a crystallization tank (one or more), a product tank, a temperature control system, a stirring system, a material conveying system (including a peristaltic pump, etc.) and an online process analysis PAT instrument (including a probe, a host, etc.). The software system is mainly a closed-loop control software system, including a fully automatic control method. The data acquisition and communication system includes a computer and a DCS system running the PAT software. The workflow of the device includes a preparation stage, a crystallization process, a control process, and a product output. In the preparation stage, the equipment connection is checked and the material is put in; during the crystallization process, the material enters the crystallization tank from the feed tank, and the PAT instrument monitors the key parameters in real time; the control process is executed by a closed-loop control software system, including collecting historical data, data analysis and model training, real-time process evaluation, parameter optimization, equipment control parameter adjustment, and loop execution control; when the crystal parameters reach the preset value, the product is transferred to the product tank.

[0283] The fully automatic control method in the closed-loop control software system includes the following steps: S10 collecting historical data; S20-S40 performing data analysis and model training; S50 real-time process evaluation; S60-S70 parameter optimization; S80 equipment control parameter adjustment; S90 loop execution control. The specific implementation details of these steps are the same as those described in the invention scheme.

[0284] The probe of the PAT equipment can be placed in each tank (preferably a crystallization tank), and the host provides signal operation for the probe to collect key parameters in real time. The computer system runs the PAT software, processes the collected parameters and uploads them to the DCS system. The DCS system performs closed-loop control based on these parameters. The multi-branch structure neural network model used in the control process includes a feature screening module, an overall feature prediction branch network, a local feature prediction branch network and a fusion network, and its specific structure and function are consistent with those described in the invention scheme.

[0285] This fully automatic online PAT continuous crystallization device is suitable for a variety of crystallization processes, including evaporation crystallization, cooling crystallization and anti-solvent crystallization, and can be used in experimental and production environments. By combining advanced PAT technology with intelligent control algorithms, this embodiment 2 achieves full automation and precise control of the crystallization process, greatly improving product quality and production efficiency.

[0286] The following is an example 3 of a specific application scenario of the present invention: Example 3 is a PAT continuous crystallization production line of a pharmaceutical company. The production line uses a continuous stirring crystallizer to produce a crystalline drug raw material. In order to improve production stability and product quality consistency, the company decided to use the fully automatic online PAT continuous crystallization control method proposed in the present invention to optimize and transform the production line.

[0287] First, the company collected historical production data of the production line over the past three years, including:

[0288] 1. Process parameter data: temperature T (℃); particle size D (μm); morphology M (-); turbidity T c (NTU); concentration C (g / L); supersaturation S (g / L); cooling rate R c (℃ / min); stirring speed N (rpm); feed flow rate Q (L / min); crystallization time t (min);

[0289] 2. Product effect data: product yield Y (%); crystal purity P (%); crystal particle size distribution {D i}(μm); Crystal morphology uniformity U M (-); crystallization period t c (h);

[0290] The data are collected once every minute.

[0291] After collecting the historical data, the enterprise began to implement the fully automatic online PAT continuous crystallization control method according to the steps of the present invention.

[0292] Step S10: Collect historical production data

[0293] The historical data collected by the enterprise is shown in Table 1:

[0294] Table 1 Historical PAT continuous crystallization process data

[0295]

[0296] Step S20: Time series analysis and Bayesian network correlation analysis

[0297] First, the company established a time series curve for each process parameter data in Table 1. These time series curves were subjected to exponential smoothing and Holt-Winters trend analysis to obtain the change trend curve of each parameter.

[0298] Then, the company uses Bayesian network to analyze the dependency between process parameters and product effects. Taking product yield Y as an example, its conditional probability distribution with each process parameter is shown in Table 2:

[0299] Table 2 Bayesian network analysis results of product yield Y and process parameters

[0300]

[0301] It can be seen from this that parameters such as temperature T, stirring speed N and crystallization time t have the greatest impact on product yield.

[0302] Step S30: Spectral feature extraction

[0303] Perform fast Fourier transform on the trend curve of each parameter to obtain its spectrum feature X(ω). For example, temperature T has two main frequency components, namely ω 1 =0.05rad / min and ω 2 =0.2rad / min. These spectrum features will be used as input features of the subsequent neural network model.

[0304] Step S40: Establishing a neural network effect evaluation model

[0305] Based on the spectrum features extracted in step S30, the company established a multi-branch neural network model including modules such as feature screening, overall effect prediction and local effect prediction.

[0306] 1. Feature screening module:

[0307] PCA dimensionality reduction: Perform principal component analysis on the spectral feature X(ω) of each parameter, retain the first 5 principal components, and obtain the feature Y after dimensionality reduction.

[0308] Wavelet transform denoising: Perform Daubechies wavelet transform on Y, use soft threshold to process detail coefficients, and reconstruct the denoised features

[0309] Information Gain Screening: Calculation The information gain IG of each feature in is used, and the first three features with the highest information gain are selected as local features.

[0310] 2. Overall effect prediction branch network: -Network structure: Using improved LSTM network, the number of hidden layers is 5, and each layer has 128 neurons.

[0311] Input: Spectral characteristics X(ω) of each parameter.

[0312] Output: product yield Y and crystal purity P.

[0313] 3. Local effect prediction branch network:

[0314] Network structure: An improved CNN network is used with 3 convolution layers and 64 convolution kernels in each layer.

[0315] Input: Local features

[0316] Output: Crystal size distribution {D i} and crystal morphology uniformity U M .

[0317] 4. Fusion network: Network structure: feedforward neural network, with 2 hidden layers and 64 neurons in each layer.

[0318] Input: Output of the global effect prediction branch and the local effect prediction branch.

[0319] Output: Final product performance data.

[0320] Through training, the prediction accuracy of the neural network model reached more than 90%, and it can be used for real-time effect evaluation of online PAT continuous crystallization process.

[0321] Step S50: Obtain current production data and perform effect prediction

[0322] In actual production, the company collects the process parameter data of the current PAT continuous crystallization process every 1 minute and establishes a time series curve. Then, the spectrum feature X(ω) of each parameter is extracted by fast Fourier transform and input into the neural network effect evaluation model established in step S40 to obtain the predicted product effect data. wait.

[0323] For example, at the 10th minute of production, the process parameter data collected by the company is shown in Table 3:

[0324] Table 3 PAT continuous crystallization process data at the 10th minute

[0325] parameter value T 25.6℃ D 125μm M 0.88 <![CDATA[T c ]]> 48NTU C 328g / L S 13.2g / L <![CDATA[R c ]]> 1.4℃ / min N 215rpm Q 2.7L / min t 15min

[0326] Through fast Fourier transform, the spectrum feature X(ω) of each parameter is obtained and input into the neural network effect evaluation model to predict:

[0327]

[0328] These prediction results indicate that under the current process conditions, the product quality requirements may not be fully met and further optimization and adjustment are needed.

[0329] Step S60: Generate initial parameter solution and predict effect

[0330] In order to further optimize the PAT continuous crystallization process, the company based on the current production data {x i (10)}, generating a set of initial parameter solutions {x k (t)}. The specific approach is:

[0331] 1. Calculate the standard deviation σ of the current parameters i , as the disturbance range.

[0332] 2. For each parameter x i Randomly generate n = 20 initial solutions xki (t), the value range is [x i (10)-3σ i ,x i (10)+3σ i ].

[0333] 3. Combine these 20 initial solutions into an initial solution set {x k (t)}.

[0334] Then, the enterprise calculates each initial solution x k (t) Perform fast Fourier transform to obtain the spectrum feature X k (ω), input into the neural network effect evaluation model to predict the corresponding product effect include wait.

[0335] Through this step, the enterprise obtains a set of feasible initial parameter solutions and their prediction effects, providing a basis for subsequent optimization iterations.

[0336] Step S70: Genetic algorithm optimization

[0337] Based on the initial solution set {x k (t)} and predicted effect The enterprise uses genetic algorithms for optimization iteration. The specific process is as follows:

[0338] 1. Set the initial solution set {x k (t)} as the initial population.

[0339] 2. Based on product yield Y, crystal purity P, crystal size distribution {D i} and morphology uniformity U M As the objective function, the fitness function is defined as: Among them, Y * , P * , and is the expected target effect value, ω 1 To 4 is the weight coefficient.

[0340] 3. The genetic algorithm operation of roulette selection, single-point crossover and random mutation was used to iterate the population for 20 generations.

[0341] 4. Select the individual x with the highest fitness opt (t) is the optimal solution.

[0342] After optimization, the company obtained the optimal process parameter combination x that can meet the product quality goals. opt (t).

[0343] Step S80: Calculation and adjustment of control parameters

[0344] According to the optimal solution x obtained in step S70 opt (t), the enterprise calculates the corresponding production equipment control parameters and adjusts them through the control system. The details are as follows:

[0345] 1. Temperature controller setting value T set :

[0346]

[0347] Among them, ΔS=S-14.0 is the difference between the current supersaturation and the target supersaturation.

[0348] 2. Agitator speed N:

[0349]

[0350] Where, μ = 0.8 × 10 -3 Pa·s is the dynamic viscosity of the solution, ρ=1200kg / m 3 is the solution density, E a =30000 J / mol is the apparent activation energy.

[0351] 3. Feed pump flow Q:

[0352]

[0353] in, is the rate of change of supersaturation, is the characteristic crystal size D 50 The rate of change.

[0354] 4. Cooler power P:

[0355]

[0356] in, is the second derivative of temperature.

[0357] Through these empirical equations, the enterprise solves x according to the optimal parameters obtained by optimization. opt (t) Calculate the specific control parameters of each production equipment and automatically adjust them through the control system.

[0358] The specific implementation of step S90 is as follows:

[0359] Every 30 minutes, the company repeats steps S50 to S80 to continuously optimize the PAT continuous crystallization process. The details are as follows:

[0360] 1. Execute step S50, obtain the data x(t) of the current production process, calculate the spectrum feature X(ω), and input the effect evaluation model to obtain the predicted effect

[0361] 2. Execute step S60 to generate 20 initial solutions {x k (t)}, calculate the spectrum feature {X k (ω)}, and predict the effect

[0362] 3. Execute step S70, use genetic algorithm to optimize the initial solution set, and obtain the optimal solution x opt (t).

[0363] 4. Execute step S80, according to x opt (t) Calculate equipment parameters such as temperature, stirring, feeding, cooling, etc. and adjust them through the control system.

[0364] Repeating the optimization cycle every 30 minutes can continuously optimize the PAT continuous crystallization process and ensure stable product quality. This cycle is long enough to observe the effect changes after parameter adjustment, and it can also respond to dynamic changes in production in a timely manner.

[0365] In general, the fully automatic online PAT continuous crystallization control method makes full use of historical data and machine learning technology to achieve intelligent optimization of crystallization process parameters. By establishing a parameter-effect mapping model, using an optimization algorithm to find the optimal parameter combination, and using feedback control to adjust production equipment, the production efficiency and product quality of PAT continuous crystallization can be continuously improved.

[0366] The above description is only a specific implementation mode of the present invention, but the protection scope of the present invention is not limited thereto. Any technician familiar with the technical field can easily think of changes or substitutions within the technical scope disclosed by the present invention, which should be covered by the protection scope of the present invention.

Claims

1. A fully automatic online PAT continuous crystallization control method, characterized in that: The following steps are involved: S10, collecting historical PAT continuous crystallization process data and corresponding effect data, including temperature, particle size, morphology, turbidity, concentration, supersaturation, cooling rate, stirring rate, feed rate, and crystallization time; the crystallization process data is collected once every 1 minute; the effect data includes product yield, crystal purity, crystal size distribution, crystal morphology uniformity, and crystallization cycle; S20, establishing a curve for each parameter in the crystallization process data, using a time series analysis method to perform smoothing and trend analysis on each curve, and using a Bayesian network to perform correlation analysis on the effect data to obtain a change optimization curve for each parameter; S30, performing spectrum analysis on the variation optimization curve of each parameter by using fast Fourier transform to obtain the spectrum characteristics of each parameter; S40, establishing a training data set, wherein the input of the training is the spectrum characteristics of each parameter, the output of the training is the effect data, and a neural network model with a multi-branch structure is trained to obtain an online PAT continuous crystallization effect evaluation model; S50, obtaining process data of the PAT continuous crystallization process in current production to establish a corresponding curve, and using fast Fourier transform to perform spectrum analysis to obtain the spectrum characteristics of each parameter, recorded as the current spectrum characteristics, and input into the online PAT continuous crystallization effect evaluation model to obtain predicted effect data; S60, based on the process data of the PAT continuous crystallization process in the current production, a set of initial solutions is generated by data augmentation, each solution represents a set of possible process data, and the frequency spectrum characteristics represented by each solution are input into the online PAT continuous crystallization effect evaluation model to obtain predicted effect data; S70, using the group of initial solutions as a population, using the preset target effect data as an objective function, using a genetic algorithm to iteratively solve, and obtaining the individual with the highest fitness as the optimal solution; S80, converting the process data corresponding to the optimal solution into production equipment control parameters using an empirical equation group, including at least a temperature controller setting value, agitator speed, feed pump flow, and cooler power, and gradually adjusting various parameters of the production equipment through a control system; S90, executing S50-S80 in a loop at a preset loop duration.

2. A fully automatic online PAT continuous crystallization control method according to claim 1, characterized in that: The preset cycle duration is specifically 30 minutes.

3. A fully automatic online PAT continuous crystallization control method according to claim 2, characterized in that: The empirical equation group includes a temperature controller setting equation, an agitator speed setting equation, a feed pump flow setting equation, and a cooler power setting equation.

4. A fully automatic online PAT continuous crystallization control method according to claim 3, characterized in that: The neural network model with a multi-branch structure specifically includes a feature screening module, an overall feature prediction branch network, a local feature prediction branch network and a fusion network.

5. A fully automatic online PAT continuous crystallization control method according to claim 4, characterized in that: The feature screening module is used to obtain local features of the frequency spectrum features of each input parameter by using principal component analysis for dimension reduction, wavelet transform for denoising, and information gain method for screening.

6. A fully automatic online PAT continuous crystallization control method according to claim 5, characterized in that: The overall feature prediction branch network is used for inputting the spectral features of each parameter and outputting the product yield and crystal purity. The structure is an improved LSTM network obtained by replacing the forget gate with an adaptive forget gate using an LSTM network. The network depth is 1 / 4 of the number of input features, and the number of neurons in each layer is 1 / 2 of the number of input features.

7. A fully automatic online PAT continuous crystallization control method according to claim 6, characterized in that: The local feature prediction branch network is used for inputting the local features of each parameter and outputting the crystal size distribution and crystal morphology uniformity. The structure is an improved CNN network obtained by replacing the ordinary convolution layer with a hole convolution layer using a CNN network. The network depth is 1 / 3 of the number of local features, and the number of convolution kernels in each layer is twice the number of local features.

8. A fully automatic online PAT continuous crystallization control method according to claim 7, characterized in that: The fusion network is used, the input is the output of the overall feature prediction branch network and the local feature prediction branch network, the output is the final effect data, and the structure is a feedforward neural network including 2 hidden layers.

9. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores program instructions, and when the program instructions are run in a computer, they are used to execute the fully automatic online PAT continuous crystallization control method according to any one of claims 1 to 8.

10. A fully automatic online PAT continuous crystallization control system, characterized in that: A computer-readable storage medium comprising the computer-readable storage medium of claim 9.

Citation Information

Patent Citations

  • Method and system for preparing synthetic multicomponent biotechnological and chemical process samples

    CN106462656A

  • Methods for controlling crystallization based on turbidity and systems therefor

    US20220143527A1