One-step granulation production control method and electronic device for traditional Chinese medicine granule preparation, and storage medium

By processing time-series data of traditional Chinese medicine granule preparations using the GRU model, the problem of automated control in the granulation process of traditional Chinese medicine granules was solved, achieving efficient and stable granulation production, adapting to changes in raw materials and equipment, and improving production efficiency and quality consistency.

CN122097272APending Publication Date: 2026-05-29KUNMING CHINESE MEDICINE FACTORY
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202610331208.4
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2026-03-18
Publication Date
2026-05-29

AI Technical Summary

Technical Problem

The one-step granulation process for traditional Chinese medicine granules has problems such as uneven granule density, high fine powder content, and sticking to the wall, resulting in large batch-to-batch differences, making it difficult to achieve automated control, and resulting in low production efficiency and standardization.

Method used

The GRU (Gated Cyclic Unit) model is used to process time series data. Combined with multi-dimensional key process parameters, the GRU model is constructed to realize the automatic calculation and adjustment of parameters. Combined with the SCADA system, a virtual model is constructed to realize the real-time bidirectional flow of data between the physical production line and the virtual model, reducing manual intervention.

Benefits of technology

It significantly improves the quality stability and automation level of traditional Chinese medicine granule preparations, reduces batch-to-batch quality fluctuations, enhances production efficiency and versatility, adapts to changes in raw materials and equipment for traditional Chinese medicine, and meets GMP requirements.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122097272A_ABST
    Figure CN122097272A_ABST
Patent Text Reader

Abstract

The application belongs to the technical field of automatic control, and specifically discloses a one-step granulation production control method for traditional Chinese medicine granules, an electronic device and a storage medium. The method is to collect key process parameters and divide them into input and output data; read the data and perform standardized transformation and normalization processing to construct an input-output sequence pair based on the current time point; perform GRU processing on the input sequence to obtain the final hidden state and map it to the output space through a full connection layer to serve as a prediction value, calculate the output value loss, perform loss back propagation to each parameter of the model, and perform loss gradient descent at a learning rate of 0.001 to obtain a GRU model; input the numerical value of the input sequence into the GRU model for calculation, map the obtained numerical value to the output space as a prediction value, and compare it with the numerical value of the output sequence; and adjust the process parameters, alarm and / or result output according to the comparison result. The application has the characteristics of good quality stability, high automation level and production efficiency, and small batch-to-batch difference.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention belongs to the field of automatic control technology, specifically relating to a one-step granulation production control method for traditional Chinese medicine granule preparations with good quality stability, high level of automation and production efficiency, and small batch-to-batch differences, as well as electronic equipment and storage media. Background Technology

[0002] Traditional Chinese medicine granules are modern dosage forms made from Chinese medicinal materials through processes such as extraction, concentration, mixing, granulation, and drying, making them convenient for consumption. One-step granulation technology (also known as fluidized bed granulation or boiling granulation) combines mixing, granulation, and drying into one step, thus significantly shortening the production cycle and becoming one of the core technologies in the production of Chinese medicine granules. For example, the production of Shugan granules uses one-step granulation technology. The entire production process is as follows: pretreatment is carried out in batches, first processing various Chinese medicinal materials according to standard processing techniques, then extracting the volatile oil and extract of Shugan granules through water extraction, then collecting the Shugan granule extract, volatile oil, and excipient sucrose according to batch production instructions and performing one-step granulation, followed by granulation, mixing, and packaging to obtain the finished Shugan granules.

[0003] While one-step granulation technology offers advantages over traditional wet granulation methods, such as simplified process flow, high operational efficiency, and high equipment integration, the complex composition of Chinese herbal raw materials (containing polysaccharides, alkaloids, tannins, etc.), significant differences in viscosity, and strong hygroscopicity lead to problems during granulation, including uneven particle density, high fine powder content, and adhesion to the granulation wall. This makes parameter control in one-step granulation complex and difficult to automate. Therefore, the one-step granulation production process for Shugan granules still follows the traditional manual offline operation mode. This not only involves cumbersome process control and numerous control factors, but also relies on human experience and skills for parameter adjustment, leading to human error and delayed parameter adjustments, resulting in significant batch-to-batch variations. Furthermore, manual judgment requires constant observation and adjustment of the fluidized bed granulator's operating status, consuming time and manpower, thus hindering production efficiency and standardization, weakening the company's market competitiveness, and impeding the modernization of Chinese medicine.

[0004] In existing technologies, to achieve the modernization of traditional Chinese medicine, there are process parameter optimization methods. These methods employ orthogonal experiments, response surface methodology (RSM), and uniform design to systematically examine the influence of key parameters (such as inlet air temperature, spray rate, and binder concentration) on target indicators (such as particle yield and particle size D90), establish mathematical models, and optimize parameter combinations. Because process parameter optimization methods can quantify the interactions between parameters, they can find the optimal process window to improve batch consistency. Moreover, compared to purely empirical methods relying on manual experience control, they are more scientific and repeatable. However, the need to conduct multiple sets of experiments (usually 10-20 sets) leads to long cycles and high costs. Furthermore, the model depends on specific material systems, requiring remodeling when changing product types, thus limiting its versatility. In addition, there is online monitoring and feedback control (process analysis technology, PAT) technology, which utilizes near-infrared spectroscopy (NIRS), Raman spectroscopy, and capacitive humidity sensors to monitor key indicators such as material moisture, particle size, and viscosity in real time, and combines PID control or machine learning algorithms to dynamically adjust process parameters (such as spray rate and inlet air temperature). Online monitoring and feedback control technology can significantly improve process stability and reduce human intervention errors due to its real-time feedback adjustment capabilities. It can also adapt to batch variations in Chinese herbal raw materials, effectively improving product uniformity. Furthermore, data traceability meets GMP requirements for process control. However, it also has drawbacks such as high equipment investment, the need for extensive data training for model development (e.g., spectral-moisture correlation models for different materials), the potential for spectral interference due to the complexity of Chinese herbal components, and the high technical requirements for operators, necessitating the maintenance of sensors and software systems. Therefore, its application is currently limited. Additionally, there is intelligent control algorithm technology that uses historical production data (process parameters and quality indicators) and algorithms such as neural networks (NN) and random forests (RF) to build predictive models, achieving intelligent parameter recommendation or autonomous optimization. Because intelligent control algorithms possess self-learning capabilities, they can adapt to long-term changes in raw materials and equipment, and can handle multivariate nonlinear relationships, outperforming traditional statistical models. However, they also have limitations, such as the difficulty in tracing the decision-making logic of deep learning models, which may affect the compliance of process validation. Therefore, its practical application is currently limited. Summary of the Invention

[0005] To address the shortcomings of existing technologies, this invention provides a one-step granulation production control method for traditional Chinese medicine granule preparations with good quality stability, high automation level and production efficiency, and small batch-to-batch differences. It also provides an electronic device for controlling the one-step granulation production of traditional Chinese medicine granule preparations and a computer-readable storage medium.

[0006] The one-step granulation production control method for traditional Chinese medicine granule preparations of this invention is implemented as follows: it includes data acquisition, data preprocessing, process modeling, real-time control and output steps, and the specific steps are as follows: A. Data Acquisition: Collect the values ​​of key process parameters, including time variables, during the one-step granulation process of traditional Chinese medicine granules according to the preset parameters, and divide the collected key process values ​​into input data. X i and output data Y i ; B. Data Preprocessing: Read the aforementioned data respectively, and then process the input data. X i Perform standardization transformation on the output data. Y i Normalization is performed, and then the processed data is used to construct input-output sequence pairs based on the current time point; C. Process Modeling: Construct an initial GRU model, load the input sequence into the initial GRU model to obtain the final hidden state, and then map the final hidden state to the output space as the prediction value through the fully connected layer mapping of the initial GRU model. Then calculate the loss of the output value: In the formula n The total number of output data items in the training dataset is given. Then, the derivative of the aforementioned loss function MSE is calculated, and the derivative result is passed to the parameters in the initial GRU model through the chain rule. The loss gradient descent is performed with a learning rate of 0.001, and the GRU model is obtained after stabilization. D. Real-time control and output: Input the numerical values ​​of the input sequence into the GRU model, calculate and map the obtained values ​​to the output space as predicted values, compare the predicted values ​​with the corresponding output sequence values, and adjust process parameters, alarm and / or output results based on the comparison results.

[0007] Furthermore, the key process parameters in step A include the inlet air temperature setpoint, inlet air temperature, material temperature setpoint, material temperature, outlet air temperature, inlet air humidity, bed pressure, filter bag pressure differential, bed pressure differential, spray speed, fan frequency, and relative equipment operating time; the input data X i = [ x i-进风温度 , x i-物料温度 , x i-出风温度 , x i-进风湿度 , x i-床体压力 , x i-滤袋压差 , x i-床体压差 , x i-设备运行相对时间 ] T The output data Yi =[y i-进风温度设定值 、y i-物料温度设定值 、y i-风机频率 、y i-喷雾转速 T where: x i-进风温度 is the i th in a set of inlet air temperature data, y i-进风温度设定值 is the i th in a set of inlet air temperature set value data, T is the transpose symbol.

[0008] Further, in step A, when any one or any combination of variety, raw material, ratio, and performance index of the traditional Chinese medicine granule preparation changes for the first time, the total data of the key process parameters are divided into a training data set , a test data set and a validation data set in proportion based on the number of batches. The training data set , the test data set and the validation data set each include input data X i and output data Y i . The key process parameters in each of the above data sets constitute the feature vectors therein.

[0009] Further, in step B, the training data set , the test data set and the validation data set are read respectively, and then the input data X i in each data set is respectively subjected to a standardization transformation , where: N train is the total number of data in the training data set, N test is the total number of data in the test data set; is the mean of the x th feature vector in the data set, is the standard deviation of the x th feature vector in the data set; at the same time, the output data Y i in each data set is respectively applied with min-max normalization to the interval [-1, 1]: , where: y is the current output value in the data set, min(y) is the corresponding minimum output value in the data set, and max(y) is the corresponding maximum output value in the data set.

[0010] ​Furthermore, in step B, the input-output sequence pair based on the current time point is constructed after processing the data. This is based on the current time point, and the input sequence is an 8×6 matrix composed of the six most recent time points of each feature vector in the standardized input data. The output sequence is constructed from the four feature vectors in the output data at the current time point: ;in, x i For the first in the input data i The current time point data of each feature vector; y i For the first in the output data i The current time point data of each feature vector; i =0,1,2,...,N-6, where N is the size of the dataset.

[0011] Furthermore, in step C, an initial GRU model is constructed, the input sequence is loaded into the initial GRU model to obtain the final hidden state, and then the final hidden state is mapped to the output space as the predicted value through the fully connected layer of the initial GRU model. The process involves first reading the input-output sequence pairs, and then initially processing the input sequence sequentially at each time step using the GRU model. Each 8-eight-eight-eight-eight-eight-eight-eight-eight-eight-eight-eight-thousands-of-zero hidden-layer h0 is used in the initial GRU model to calculate the first hidden layer h1. The h1 hidden layer is then used with the second 8-eight ...thousands-of-zeros-of-hidden-layer h0 to calculate the second hidden layer h2, and so on, until the final hidden layer h6 is obtained. Finally, the hidden state is mapped through a fully connected layer. Mapped to the output space as the predicted value: ;in, The input matrix is ​​(8×6). W 0 This is the parameter matrix of the fully connected layer. b 0 This is the bias term for the fully connected layer.

[0012] Furthermore, in step C, the process of loading the input sequence into the initial GRU model to obtain the final hidden state is as follows: First, calculate the reset gate. R t With the update gate Z t : In the formula: x t Let be an 8-element eigenvector of the current input matrix at time step t. h t-1This is the hidden state from the previous stage. W xr , W hr , W xz , W hz These are the weight matrices, b r、 b z Here, σ represents the bias, sigmoid activation function, and t represents the current time step; Then, use the reset door. R t Calculate candidate hidden state : , In the formula: tanh is the activation function. The multiplication is performed element-wise, where h is the number of parameters in the hidden layer. W xh This is the weight matrix from the input matrix to the first hidden layer. W hh This is the weight matrix from the previous hidden layer to the current hidden layer. b h For the bias of the hidden layer; Then, use the update gate. Z t Combined with the hidden state in the previous stage h t-1 With candidate hidden state Generate the hidden state at time step t: , Finally, the final hidden state Mapped to the output space via a fully connected layer: .

[0013] Furthermore, in step C, after stabilization, the GRU model is obtained by calculating and recording the output loss MSE using the validation dataset after each round of training with the training dataset. Then, after performing the same operation in the next round, the output MSE' loss for the new round is calculated and compared with the MSE. If the MSE' is smaller, the loss and model are recorded. If the loss after at least 4 rounds of training is not smaller than the current minimum loss, the loss is considered to be stable, and the current model is used as the GRU model.

[0014] The electronic device for controlling the one-step granulation production of traditional Chinese medicine granules of the present invention is implemented as follows: it includes a memory, a processor, and a computer program stored in the memory and capable of running on the processor. When the processor executes the computer program, it implements the steps of the aforementioned one-step granulation production control method for traditional Chinese medicine granules.

[0015] The computer-readable storage medium of the present invention is implemented as follows: it stores a computer program thereon, which can be executed by one or more processors to implement the aforementioned one-step granulation production control method for traditional Chinese medicine granule preparations.

[0016] The beneficial effects of this invention are: 1. This invention processes time-series data using a GRU (Gated Circulating Unit) model and constructs a GRU model by combining multi-dimensional key process parameters (such as inlet air temperature, material temperature, spray speed, etc.). This model can capture the dynamic correlation and nonlinear relationship of parameters over time during granulation. Compared with traditional manual experience control or single-parameter optimization methods, it can more accurately predict and replace manual adjustment of output parameters (such as inlet air temperature setpoint, fan frequency, etc.), effectively solving problems such as uneven particle density, high fine powder rate, and wall adhesion caused by the complexity of traditional Chinese medicine components. It also significantly reduces batch-to-batch quality fluctuations and ensures the uniformity and stability of the quality of traditional Chinese medicine granule preparations.

[0017] 2. This invention achieves automatic calculation and adjustment of parameters through data acquisition, preprocessing, and process modeling. Combined with the SCADA system, a virtual model is constructed to realize real-time bidirectional data flow between the physical production line and the virtual model. This reduces the lag and misjudgment risk of manual offline detection and experience-based adjustments, thereby eliminating the need for operators to continuously observe and manually adjust the equipment status, significantly reducing labor costs. At the same time, it avoids human factors interfering with the production process and effectively improves the automation level of production control.

[0018] 3. This invention uses data-driven modeling, so only actual production data needs to be collected to train the GRU model, without having to conduct multiple sets of experiments repeatedly, which can significantly shorten the parameter optimization cycle. At the same time, through real-time control and virtual model simulation, potential faults can be detected in advance and parameter configuration optimization can be simulated, reducing downtime to improve production continuity, thereby effectively improving production efficiency.

[0019] 4. The model of this invention can automatically capture the interaction between parameters and quickly find the optimal process window. Combined with the data acquisition stage, the training / test set is divided according to changes in varieties, raw materials, etc., and the GRU model learns the time series characteristics of different varieties. It not only has cross-variety generalization ability, but also can quickly adapt to changes in raw materials, ratios, etc., thereby significantly shortening the cycle of introducing new varieties or adjusting processes. Its versatility is better than traditional methods that rely on specific material systems.

[0020] 5. Unlike the "black box" problem of existing deep learning models, this invention adopts the relatively clear GRU technology. Its time series processing logic (such as the dynamic calculation of reset gates and update gates) is traceable, and the model decision basis (the mapping relationship between input parameters and output settings) is easy to verify. Moreover, through real-time monitoring and feedback adjustment, it avoids quality risks caused by parameter runaway. At the same time, the virtual model provides a safe and efficient environment for process verification and operator training, thereby ensuring that production meets the compliance requirements of GMP for process verification and data traceability, thus facilitating the implementation of the technology.

[0021] 6. To address the issue of batch-to-batch variations in raw materials and equipment aging that may cause drift in granulation conditions, this invention utilizes multi-feature input (8 key parameters) and time-series modeling to drive real-time model updates. This allows the model to automatically adapt to long-term changes in raw materials and equipment, thereby maintaining the stability of the granulation process. It overcomes problems such as spectral interference and complex sensor maintenance in existing online monitoring technologies, and is more suitable for the special characteristics of traditional Chinese medicine preparations.

[0022] In summary, this invention effectively solves the problems of inaccurate manual control, long process optimization cycle, and difficulty in adapting multiple varieties in one-step granulation of traditional Chinese medicine granules by dynamically modeling time series data of one-step granulation using GRU networks, combined with data preprocessing, real-time control, and virtual production line management. It achieves granulation process control with high automation, good batch consistency, excellent production efficiency, and strong long-term stability, providing a new approach to promote the intelligent and modern process of traditional Chinese medicine granule production. Attached Figure Description

[0023] Figure 1 This is a flowchart of the one-step granulation process for the liver-soothing granules in this embodiment of the invention. Figure 2 This is a CPP relationship diagram of the one-step granulation of Shugan granules in an embodiment of the present invention; Figure 3 This is a schematic diagram illustrating the working principle of the GRU unit in an embodiment of the present invention; Figure 4 This is a schematic diagram illustrating the working principle of a single data processing operation in an embodiment of the present invention; Figure 5 This is a flowchart illustrating the internal micro-processing of the GRU in an embodiment of the present invention. Figure 6 This is a training loss curve of the GRU model in an embodiment of the present invention; Figure 7 This is an adaptive process parameter control system in an embodiment of the present invention. Detailed Implementation

[0024] The present invention will be further described below with reference to the accompanying drawings and embodiments, but this does not limit the present invention in any way. Any changes or improvements made based on the teachings of the present invention shall fall within the protection scope of the present invention.

[0025] like Figures 1 to 7 As shown, the one-step granulation production control method for traditional Chinese medicine granule preparations of the present invention is implemented as follows: it includes data acquisition, data preprocessing, process modeling, real-time control and output steps, and the specific steps are as follows: A. Data Acquisition: Collect the values ​​of key process parameters, including time variables, during the one-step granulation process of traditional Chinese medicine granules according to the preset parameters, and divide the collected key process values ​​into input data. X i and output data Y i ; B. Data Preprocessing: Read the aforementioned data respectively, and then process the input data. X i Perform standardization transformation on the output data. Y i Normalization is performed, and then the processed data is used to construct input-output sequence pairs based on the current time point; C. Process Modeling: Construct an initial GRU model, load the input sequence into the initial GRU model to obtain the final hidden state, and then map the final hidden state to the output space as the prediction value through the fully connected layer mapping of the initial GRU model. Then calculate the loss of the output value: In the formula n The total number of output data items in the training dataset is given. Then, the derivative of the aforementioned loss function MSE is calculated, and the derivative result is passed to the parameters in the initial GRU model through the chain rule. The loss gradient descent is performed with a learning rate of 0.001, and the GRU model is obtained after stabilization. D. Real-time control and output: Input the numerical values ​​of the input sequence into the GRU model, calculate and map the obtained values ​​to the output space as predicted values, compare the predicted values ​​with the corresponding output sequence values, and adjust process parameters, alarm and / or output results based on the comparison results.

[0026] The key process parameters in step A include inlet air temperature setpoint, inlet air temperature, material temperature setpoint, material temperature, outlet air temperature, inlet air humidity, bed pressure, filter bag pressure differential, bed pressure differential, spray speed, fan frequency, and relative equipment operating time; the input data X i = [ x i-进风温度 , x i-物料温度 , xi-出风温度 , x i-进风湿度 , x i-床体压力 , x i-滤袋压差 , x i-床体压差 , x i-设备运行相对时间 T , the output data Y i = [y i-进风温度设定值 , y i-物料温度设定值 , y i-风机频率 , y i-喷雾转速 T , where: x i-进风温度 is the i th in a set of inlet air temperature data, and y i-进风温度设定值 is the i th in a set of inlet air temperature set value data, T is the transpose symbol (i.e., arranging each data vertically).

[0027] X i = x i-进风温度 , x i-物料温度 , x i-出风温度 , x i-进风湿度 , x i-床体压力 , x i-滤袋压差 , x i-床体压差 , x i-设备运行相对时间 T That is: Y i = [y i-进风温度设定值 , y i-物料温度设定值 , y i-风机频率 , y i-喷雾转速 T That is: .

[0028] In step A, the key process parameters are recorded in units of each pot in one-step granulation. The relative running time of the equipment is marked with relative time according to the pot number. That is, the relative time of the first data is 0, and the relative time of each subsequent data is +1 until the data of this pot is completed.

[0029] ​​​​In step A, when any one or any combination of the variety, raw materials, formulation, and performance indicators of the traditional Chinese medicine granule preparation changes for the first time, the total data of the key process parameters is divided into a training dataset proportionally, based on the batch. Test dataset and validation dataset The training dataset Test dataset Both the input data and the validation dataset include the validation dataset. X i and output data Y i The key process parameters in the aforementioned datasets constitute the feature vectors.

[0030] In step B, the training dataset is read respectively. Test dataset and validation dataset Then, the input data in each dataset... X i Perform standardization transformation separately In the formula: N train The total number of data points in the training dataset. N test The total number of data points in the test dataset; For the first in the dataset x The mean of the eigenvectors, For the first in the dataset x The standard deviation of each feature vector; and the output data in each dataset. Y i Apply min-max normalization to the interval [-1, 1] respectively: In the formula: y is the current output value in the dataset, min(y) is the corresponding minimum output value in the dataset, and max(y) is the corresponding maximum output value in the dataset.

[0031] In step B, the input-output sequence pairs based on the current time point are constructed from the processed data. The current time point is used as the reference, and the input sequence is an 8×6 matrix composed of the six most recent time points of each feature vector in the standardized input data. The output sequence is constructed from the four feature vectors in the output data at the current time point: ;in, x i For the first in the input data i The current time point data of each feature vector; y i For the first in the output data iThe current time point data of each feature vector; i =0,1,2,...,N-6, where N is the size of the dataset.

[0032] It should be noted that, due to the input data X i The ranges of the various feature vectors vary considerably. For example, the inlet air temperature is 0~120°C, and the filter bag pressure difference may be between -1 and 10°C. Without standardization, variables with large values ​​will have a greater impact on the model, resulting in slow convergence and large oscillations during model training. The model in step C will require more training rounds to achieve the expected results. Standardization, on the other hand, can define the numerical ranges of different feature vectors to a consistent interval, allowing the model to achieve the expected results with fewer training rounds, thus improving the training efficiency of the model.

[0033] Standardization processes the input data, while normalization processes the output data; both involve processing the dataset, i.e., the input data. X i (i.e., feature data) is standardized to process the output data. Y i After normalization, the processed data is transmitted to the model in step C for training. The trained model accepts the standardized input and outputs the normalized result. After inverse scaling of these results, the actual device parameters that need to be transmitted to the device can be obtained.

[0034] In step C, an initial GRU model is constructed, the input sequence is loaded into the initial GRU model to obtain the final hidden state, and then the final hidden state is mapped to the output space as the prediction value through the fully connected layer mapping of the initial GRU model. The process involves first reading the input-output sequence pairs, and then initially processing the input sequence sequentially at each time step using the GRU model. Each 8-eight-eight-eight-eight-eight-eight-eight-eight-eight-eight-eight-thousands-of-zero hidden-layer h0 is used in the initial GRU model to calculate the first hidden layer h1. The h1 hidden layer is then used with the second 8-eight ...thousands-of-zeros-of-hidden-layer h0 to calculate the second hidden layer h2, and so on, until the final hidden layer h6 is obtained. Finally, the hidden state is mapped through a fully connected layer. Mapped to the output space as the predicted value: ;in, The input matrix is ​​(8×6). W 0 This is the parameter matrix of the fully connected layer. b 0 This is the bias term for the fully connected layer.

[0035] In step C, the process of loading the input sequence into the initial GRU model to obtain the final hidden state is as follows: First, calculate the reset gate. R t With the update gate Z t : In the formula: x t Let be an 8-element eigenvector of the current input matrix at time step t. h t-1 This is the hidden state from the previous stage. W xr , W hr , W xz , W hz These are the weight matrices, b r、 b z Here, σ represents the bias, sigmoid activation function, and t represents the current time step; Then, use the reset door. R t Calculate candidate hidden state : , In the formula: tanh is the activation function. The multiplication is performed element-wise, where h is the number of parameters in the hidden layer. W xh This is the weight matrix from the input matrix to the first hidden layer. W hh This is the weight matrix from the previous hidden layer to the current hidden layer. b h For the bias of the hidden layer; Then, use the update gate. Z t Combined with the hidden state in the previous stage h t-1 With candidate hidden state Generate the hidden state at time step t h t (This is the hidden state at time step t obtained by a single GRU unit calculating the hidden layer): , Finally, after fully connected and denormalized processing, the final hidden state is obtained. and hide the state h 6Mapped to the output space via a fully connected layer: .

[0036] It should be noted that the weight matrix W xr , W hr , W xz , W hz and bias b r、 b z All of these are results obtained through backpropagation and gradient descent within the model. If all initial values ​​in the model are set to 1, the model training process (i.e., the GRU model) is as follows: The model receives standardized input values ​​and, based on the existing weight matrices of each hidden layer, calculates backwards (input layer → hidden layer → output layer), finally obtaining the output value. The model's output value and the actual output values ​​(i.e., predicted values) in the training set are compared using MSE to calculate the loss. Then, based on this loss, gradient descent is applied back to the model. The parameters in the model's weight matrix adjust their values ​​according to the calculation results; since the initial value is set to 1, the new weights are obtained by subtracting the gradient value from 1. After all weights are updated, the next training iteration is performed, repeating the above process. The loss gradually decreases, and finally, training ends when the validation set determines that the model is optimal. The number of hidden layers and the size of the hidden layers (i.e., the number of hidden layer parameters) can be adjusted. Through continuous adjustment, the optimal number of hidden layers and hidden layer parameters can be explored.

[0037] In step C, after stabilization, the GRU model is obtained by calculating and recording the output loss MSE using the validation dataset after each round of training. Then, the same operation is performed in the next round, and the output MSE' loss is calculated and compared with the MSE. If the MSE' is smaller, the loss and model are recorded. If the loss after at least 4 rounds of training is not smaller than the current lowest loss (the lowest loss from the first round of training to the last round), the loss is considered to be stable and training can be terminated. The model is then tested using the test dataset, the final model loss is calculated, and the current model is used as the GRU model.

[0038] It should be noted that testing the model using the test dataset involves feeding the test dataset into the GRU model, performing a single calculation, comparing the predicted values ​​with the output values, calculating an error rate, and generating a chart to represent the final performance of the GRU model (the loss and error calculated using the validation set are not used directly to represent the model in order to avoid overfitting).

[0039] The loss of the output value is calculated in step C: ,in =[ -进风温度设定值 , -物料温度设定值 , -风机频率 , -喷雾转速 ] T , These are predicted values.

[0040] =[ -进风温度设定值 , -物料温度设定值 , -风机频率 , -喷雾转速 ] T That is: ; Then, let the i-th MSE be denoted as . MSE i : , After training the model using the training set in each round, calculate the loss for each data point, and then calculate the average of the losses. This is the model's loss: , In the formula: n This represents the number of samples.

[0041] In step C, the loss gradient descent is performed with a learning rate of 0.001. This means that the learning rate of 0.001 is used to multiply the loss to ensure that the gradient descent step size in each round of the model is not too long, so as not to cross the optimal point. In other words, "the step is not too big".

[0042] In step D, the normal one-step granulation production line for traditional Chinese medicine granules is managed in a unified manner through the SCADA global data hub, along with real-time data, historical data, and model settings. A virtual model that is highly consistent with the actual production line is constructed to achieve real-time data synchronization, bidirectional data flow between the physical production line and the virtual model, early detection of potential faults to reduce downtime, simulation of different parameter configurations in the virtual environment to optimize the production process, and a safe simulation training environment for operators.

[0043] The electronic device for controlling the one-step granulation production of traditional Chinese medicine granules of the present invention includes a memory, a processor, and a computer program stored in the memory and capable of running on the processor. When the processor executes the computer program, it implements the steps of the aforementioned one-step granulation production control method for traditional Chinese medicine granules.

[0044] The present invention provides a computer-readable storage medium having a computer program stored thereon, the computer program being executable by one or more processors to implement the aforementioned one-step granulation production control method for traditional Chinese medicine granule preparations.

[0045] Example

[0046] First, such as Figure 1 As shown, the entire production process of Shugan granules can be completed in one piece of equipment (fluidized bed granulator). Based on production experience, the one-step process performed in the fluidized bed granulator can be broken down into several smaller stages, as follows: Dry mixing stage: Dry materials such as sugar powder are put into the fluidized bed granulator and the parameters are adjusted for premixing.

[0047] Spray granulation stage: The extract is mixed with water to a certain density and atomized into droplets through a liquid delivery cart. These droplets continuously form powder aggregates with the dry material in the boiling state in the fluidized bed granulator, eventually forming granules. During the process, parameters need to be adjusted according to the granule forming situation.

[0048] Drying stage: After the extract is sprayed, turn off the infusion pump on the infusion cart and adjust the parameters to enter the drying stage.

[0049] Cooling stage: After the moisture content is dried to the quality control requirements, turn off the heating, cool the material to below 40°C, add volatile oil, mix for a period of time, and then remove from the pot to proceed to the next process.

[0050] Secondly, the relationship between the CPP (critical process parameters) of the one-step granulation process for Shugan granules is as follows: CPP will serve as the control core of the one-step granulation production model for Shugan granules. Based on the manual experience of operators in the one-step granulation of Shugan granules, a diagram showing the relationship between various CPP values ​​in the one-step granulation process of Shugan granules will be compiled. Figure 2 Based on the relationship between CPP, the parameters are divided into input values / independent variables (fan frequency, spray speed, material temperature) and output values / dependent variables (bed pressure difference, filter bag pressure difference, outlet air temperature, inlet air temperature, bed pressure).

[0051] Based on the above analysis, the one-step granulation production control of Shugan granules is as follows: S100: Collects the values ​​of key process parameters (inlet air temperature setpoint, inlet air temperature, material temperature setpoint, material temperature, outlet air temperature, inlet air humidity, bed pressure, filter bag pressure difference, bed pressure difference, spray speed, fan frequency, and relative equipment running time) during the one-step granulation process of Shugan granules according to preset parameters, including time variables, and divides the collected key process values ​​into input data. X i = [ x i-进风温度, x i-物料温度 , x i-出风温度 , x i-进风湿度 , x i-床体压力 , x i-滤袋压差 , x i-床体压差 , x i-设备运行相对时间 T and the output data Y i = [y i-进风温度设定值 , y i-物料温度设定值 , y i-风机频率 , y i-喷雾转速 T , where: x i-进风温度 is the i th in a set of inlet air temperature data, y i-进风温度设定值 is the i th in a set of inlet air temperature set value data. The meanings of other symbols are similar. T is the transpose symbol. Among them, the above key process parameters are recorded in units of each pot in one-step granulation. The relative operation time of the equipment is marked relatively by pot. The relative time of the first data is 0, and the relative time of each subsequent data is +1 (for example, the acquisition interval of two data is 10s) until the data of this pot ends.

[0052] It should be noted that when any one or any combination of raw materials, ratios, and performance indicators of the Shugan Granule preparation changes for the first time, the total data of the key process parameters are divided into training data sets in proportion (such as the total data in a ratio of 6:3:1) in units of pots , test data sets and validation data sets , and each data set respectively includes input data X i and output data Y i , and the key process parameters in each data set constitute the feature vectors therein. For example, for 100 pots of data, 60 pots are taken as the training data set , 30 pots as the test data set and 10 pots as the validation data set ; and 60 pots are 60 excel sheets, which are merged into a large csv sheet for subsequent reading by the GRU model. Because of the relative operation time parameter of the equipment, the pot information can be clear, and the performance of the GRU model will not decline after the merged table. The processing method of the test data set is the same as above. ​​

[0053] S200: First, read the training datasets respectively. Test dataset and validation dataset Then, the input data in each dataset... X i Perform standardization transformation separately In the formula: N train The total number of data points in the training dataset. N test The total number of data points in the test dataset; For the first in the dataset x The mean of the eigenvectors, For the first in the dataset x The standard deviation of each eigenvector; At the same time, the output data in each dataset Y i Apply min-max normalization to the interval [-1, 1] respectively: In the formula: y is the current output value in the dataset, min(y) is the minimum output value in the dataset, and max(y) is the maximum output value in the dataset. Subsequently, an input-output sequence pair based on the current time point is constructed from the processed data. That is, with the current time point as the reference, the input sequence is an 8×6 matrix composed of the most recent 6 time point data of each feature vector in the standardized input data. The output sequence is constructed from the four feature vectors in the output data at the current time point: ;in, x i For the first in the input data i The current time point data of each feature vector; y i For the first in the output data i The current time point data of each feature vector; i =0,1,2,...,N-6, where N is the size of the dataset.

[0054] S300: Construct an initial GRU model, load the input sequence into the initial GRU model to obtain the final hidden state, and then map the final hidden state to the output space as the prediction value through the fully connected layer of the initial GRU model. Then calculate the loss of the output value: In the formula nThe total number of output data items in the training dataset is given. Then, the derivative of the aforementioned loss function MSE is calculated, and the derivative result is passed to the parameters in the initial GRU model through the chain rule. The loss gradient descent is performed with a learning rate of 0.001, and the GRU model is obtained after stabilization.

[0055] like Figure 3 and 4 As shown, the initial GRU model (hereinafter referred to as GRU) is used to process the input sequence sequentially at each time step. Each 8-eight-eight-eight-eight-eight-eight-eight-eight-eight-eight-eight-thousands-of-zero hidden-layer h0 is used in the initial GRU model to calculate the first hidden layer h1. The h1 hidden layer is then used with the second 8-eight ...thousands-of-zeros-hidden-layer h0 to calculate the second hidden layer h2, and so on, until the final hidden layer h6 is obtained. The final hidden state is then mapped through a fully connected layer. Mapped to the output space containing 4-element feature vectors as predicted values: Then, by calculating the loss and taking its derivative with respect to the model, the loss is backpropagated to the model's parameters to adjust their values, and gradient descent is performed with a learning rate of 0.001 (e.g., ...). Figure 7 (as shown), until the GRU model is obtained after stabilization; The input matrix is ​​(8×6). W 0 This is the parameter matrix of the fully connected layer. b 0 This is the bias term for the fully connected layer.

[0056] The process of obtaining a stable GRU model involves calculating and recording the output loss MSE after each round of training using the training set and then using the validation set. The same operation is repeated in the next round, calculating the new output loss MSE' and comparing it with the original MSE. If MSE' is smaller, the loss and model are recorded. If the loss after at least four rounds of training (e.g., four, five, or six rounds, the number of rounds can be determined) is not smaller than the current minimum loss, the loss is considered stable and training can end. The model is then tested using a test dataset, the final model loss is calculated, and the current model is used as the GRU model.

[0057] like Figure 4 As shown, after each time the model reads the data from the 8×6 matrix, it splits the matrix into six 8-dimensional vectors and performs the above calculations to obtain the final equipment control parameters to be transmitted to the device: inlet air temperature setpoint, material temperature setpoint, fan frequency, and spray speed.

[0058] The workflow after the model is put into production is as follows: First, four equipment parameters are pre-defined (because the model needs parameters at 6 time points to output each time). The model monitors 8 process parameters of the equipment in real time, and then uses a queue (a data structure that can be first-in, first-out) to store the data. Data is recorded every 10 seconds. After storing 6 data, the above calculation is started, and the control parameters (4) are output. The model continues to monitor the equipment parameters at 10-second intervals. When a new parameter is detected, the earliest parameter in the queue is popped and added to the end of the queue, forming a new queue containing six data points, which is also a new 8×6 matrix. The model then uses this matrix to calculate the new control parameters.

[0059] Therefore, the overall workflow is as follows: the model only listens to data and does not output anything for the first 60 seconds. During this period, the device is also in the initial dry mixing stage. The operation of the device is relatively fixed during this stage. After 60 seconds, the model starts to output control parameters, and it outputs once every ten seconds.

[0060] The parameter configuration dimensions are as follows: sequence_length = 6 # Use data from the past 6 time points (60 seconds) input_size = 8 # Input feature dimensions: bed pressure, bed pressure difference, filter bag pressure difference, material temperature, etc. hidden_size = 128 # GRU hidden layer size num_layers = 3 # Number of GRU layers output_size = 4 # Output dimensions: fan frequency, infusion pump speed num_epochs = 350 # Number of training epochs learning_rate = 0.001 #learning rate The process of loading the input sequence into the initial GRU model to obtain the final hidden state is as follows: First, calculate the reset gate. R t With the update gate Z t : In the formula: x t Let be an 8-element eigenvector of the current input matrix at time step t. h t-1 This is the hidden state from the previous stage. W xr , W hr , Wxz , W hz These are the weight matrices, b r、 b z Here, σ represents the bias, sigmoid activation function, and t represents the current time step; Then, use the reset door. R t Calculate candidate hidden state : , In the formula: tanh is the activation function. The multiplication is performed element-wise, where h is the number of parameters in the hidden layer. W xh This is the weight matrix from the input matrix to the first hidden layer. W hh This is the weight matrix from the previous hidden layer to the current hidden layer. b h For the bias of the hidden layer; Then, use the update gate. Z t Combined with the hidden state in the previous stage h t-1 With candidate hidden state Generate the hidden state at time step t: , Finally, the final hidden state Mapped to the output space via a fully connected layer: .

[0061] S400: The actual one-step granulation production line for liver-soothing granules is managed uniformly through the SCADA global data hub, real-time data, historical data, and model settings. A virtual model highly consistent with the actual production line is constructed to achieve real-time data synchronization and bidirectional data flow between the physical production line and the virtual model. The numerical values ​​of the input sequence are input into the aforementioned GRU model. After calculation, the obtained values ​​are mapped to the output space. The values ​​mapped to the output space are compared with the corresponding output sequence values. Based on the comparison results, adaptive process parameter control is performed on the one-step granulation production line, and alarms are issued and / or results are displayed for timely manual intervention, thereby detecting potential faults in advance and reducing downtime.

[0062] Among them, such as Figure 7As shown, the adaptive process parameter control modifies the fluidized bed granulator PLC system based on the GRU model, and an anomaly-triggered model-PLC system is established based on the prediction results of the GRU model. A "zero-intrusion, self-evolving" control paradigm is constructed using a dual-layer decoupled architecture of "millisecond-level PLC hard-core closed loop + low-frequency cognitive optimization". By using SCADA as the OT / IT fusion neural center, precise injection of single-point setpoints under abnormal operating conditions is achieved, ensuring a balance between millisecond-level process steady-state protection and intelligent optimization decision-making.

[0063] (1) Technical Architecture Field device layer: sensor-actuator-PLC millisecond-level small closed loop, EtherNet / IP real-time bus, ensuring inherent safety.

[0064] Information layer: SCADA serves as a global data hub, archiving data to a MySQL database every 1 second; the anomaly triggering model performs high-dimensional comparisons of real-time operating conditions and historical qualified envelopes with a cognitive cycle of ≥30 seconds, with communication latency ≤2 seconds and zero impact on stability.

[0065] Decision-making level: Data anomalies trigger the built-in optimization engine to generate a globally optimal new setpoint under multiple constraints such as valve opening degree and temperature safety limits; the setpoint is updated by sending it to SCADA and then to PLC via OPC UA-DA / Modbus.

[0066] (2) Operational paradigm Daily steady state: PLC local closed-loop autonomous operation, SCADA data transfer, and continuous recording by MySQL.

[0067] Abnormal intervention: Model identification within seconds and injection within milliseconds; new set values ​​are instantly written to the PLC register via SCADA; the entire switching event is timestamped for auditing to ensure traceability and auditability.

[0068] The one-step granulation production of Shugan granules, using the above control methods, achieves the following results compared to the original manual offline operation mode: 1. Improved production efficiency: The production efficiency of the 3g Shugan Granules preparation increased by more than 25%, while simultaneously reducing labor, material consumption, and management costs, resulting in an overall increase in output of approximately RMB 3.9 million per year; 2. Cost savings: By connecting to the model, the production process can output and adjust the optimal parameters in a timely manner, thereby reducing wear and tear on equipment caused by overload, resulting in a total saving of approximately RMB 3.84 million per year.

[0069] The above description is merely a preferred embodiment of the present invention, but the scope of protection of the present invention is not limited thereto. Any variations or substitutions that can be easily conceived by those skilled in the art within the technical scope disclosed in the present invention should be included within the scope of protection of the present invention. Therefore, the scope of protection of the present invention should be determined by the scope of the claims.

Claims

1. A one-step granulation production control method for traditional Chinese medicine granule preparations, characterized in that: The process includes data acquisition, data preprocessing, process modeling, real-time control, and output. The specific steps are as follows: A. Data Acquisition: Collect the values ​​of key process parameters, including time variables, during the one-step granulation process of traditional Chinese medicine granules according to the preset parameters, and divide the collected key process values ​​into input data. X i and output data Y i ; B. Data Preprocessing: Read the aforementioned data respectively, and then process the input data. X i Perform standardization transformation on the output data. Y i Normalization is performed, and then the processed data is used to construct input-output sequence pairs based on the current time point; C. Process Modeling: Construct an initial GRU model, load the input sequence into the initial GRU model to obtain the final hidden state, and then map the final hidden state to the output space as the prediction value through the fully connected layer mapping of the initial GRU model. Then calculate the loss of the output value: In the formula n The total number of output data items in the training dataset is given. Then, the derivative of the aforementioned loss function MSE is calculated, and the derivative result is passed to the parameters in the initial GRU model through the chain rule. The loss gradient descent is performed with a learning rate of 0.001, and the GRU model is obtained after stabilization. D. Real-time control and output: Input the numerical values ​​of the input sequence into the GRU model, calculate and map the obtained values ​​to the output space as predicted values, compare the predicted values ​​with the corresponding output sequence values, and adjust process parameters, alarm and / or output results based on the comparison results.

2. The one-step granulation production control method for traditional Chinese medicine granules according to claim 1, characterized in that: The key process parameters in step A include the set value of the inlet air temperature, the inlet air temperature, the set value of the material temperature, the material temperature, the outlet air temperature, the inlet air humidity, the bed pressure, the differential pressure of the filter bag, the differential pressure of the bed, the spray rotation speed, the fan frequency, and the relative operation time of the equipment; the input data X i = x i-进风温度 、 x i-物料温度 、 x i-出风温度 、 x i-进风湿度 、 x i-床体压力 、 x i-滤袋压差 、 x i-床体压差 、 x i-设备运行相对时间 T , The output data Y i =[y i-进风温度设定值 、y i-物料温度设定值 、y i-风机频率 、y i-喷雾转速 T , where: x i-进风温度 is the i th in a set of inlet air temperature data, and y i-进风温度设定值 is the i th in a set of inlet air temperature set value data, T is the transpose symbol.​​ 3. The one-step granulation production control method for traditional Chinese medicine granules according to claim 2, characterized in that: In step A, when any one or any combination of the variety, raw materials, formulation, and performance indicators of the traditional Chinese medicine granule preparation changes for the first time, the total data of the key process parameters is divided into a training dataset proportionally, based on the batch. Test dataset and validation dataset The training dataset Test dataset Both the input data and the validation dataset include the input data. X i and output data Y i The key process parameters in the aforementioned datasets constitute the feature vectors.

4. The one-step granulation production control method for traditional Chinese medicine granule preparations according to claim 3, characterized in that: In step B, the training dataset is read respectively. Test dataset and validation dataset Then, the input data in each dataset... X i Perform standardization transformation separately In the formula: N train The total number of data points in the training dataset. N test The total number of data points in the test dataset; For the first in the dataset x The mean of the eigenvectors, For the first in the dataset x The standard deviation of each feature vector; and the output data in each dataset. Y i Apply min-max normalization to the interval [-1, 1] respectively: In the formula: y is the current output value in the dataset, min(y) is the corresponding minimum output value in the dataset, and max(y) is the corresponding maximum output value in the dataset.

5. The one-step granulation production control method for traditional Chinese medicine granules according to claim 4, characterized in that: In step B, the input-output sequence pairs based on the current time point are constructed after processing the data. The current time point is used as the reference, and the input sequence is an 8×6 matrix composed of the six most recent time points of each feature vector in the standardized input data. ; The output sequence is constructed from the four feature vectors in the output data at the current time point: ; in, x i For the first in the input data i The current time point data of each feature vector; y i For the first in the output data i The current time point data of each feature vector; i =0,1,2,...,N-6, where N is the size of the dataset.

6. The one-step granulation production control method for traditional Chinese medicine granule preparations according to claim 5, characterized in that: In step C, an initial GRU model is constructed, the input sequence is loaded into the initial GRU model to obtain the final hidden state, and then the final hidden state is mapped to the output space as the prediction value through the fully connected layer mapping of the initial GRU model. The process involves first reading the input-output sequence pairs, and then initially processing the input sequence sequentially at each time step using the GRU model. Each 8-eight-eight-eight-eight-eight-eight-eight-eight-eight-eight-eight-thousands-of-zero hidden-layer h0 is used in the initial GRU model to calculate the first hidden layer h1. The h1 hidden layer is then used with the second 8-eight ...thousands-of-zeros-of-hidden-layer h0 to calculate the second hidden layer h2, and so on, until the final hidden layer h6 is obtained. Finally, the hidden state is mapped through a fully connected layer. Mapped to the output space as the predicted value: ;in, The input matrix is ​​(8×6). W 0 This is the parameter matrix of the fully connected layer. b 0 This is the bias term for the fully connected layer.

7. The one-step granulation production control method for traditional Chinese medicine granule preparations according to claim 6, characterized in that: In step C, the process of loading the input sequence into the initial GRU model to obtain the final hidden state is as follows: First, calculate the reset gate. R t With the update gate Z t : In the formula: x t Let be an 8-element eigenvector of the current input matrix at time step t. h t-1 This is the hidden state from the previous stage. W xr , W hr , W xz , W hz These are the weight matrices, b r、 b z Here, σ represents the bias, sigmoid activation function, and t represents the current time step; Then, use the reset door. R t Calculate candidate hidden state : , In the formula: tanh is the activation function. The multiplication is performed element-wise, where h is the number of parameters in the hidden layer. W xh This is the weight matrix from the input matrix to the first hidden layer. W hh This is the weight matrix from the previous hidden layer to the current hidden layer. b h The bias of the hidden layer; Then, use the update gate. Z t Combined with the hidden state in the previous stage h t-1 With candidate hidden state Generate the hidden state at time step t: , Finally, the final hidden state Mapped to the output space via a fully connected layer: .

8. The one-step granulation production control method for traditional Chinese medicine granule preparations according to claim 7, characterized in that: The GRU model obtained after stabilization in step C is achieved by calculating and recording the output loss MSE using the validation dataset after each round of training using the training dataset. Then, the same operation is performed in the next round to calculate the output loss MSE' and compare it with the previous MSE. If MSE' is smaller, the loss and model are recorded. If the loss after at least 4 rounds of training is not smaller than the current minimum loss, the loss is considered to be stable, and the current model is used as the GRU model.

9. An electronic control device for one-step granulation production of traditional Chinese medicine granules, comprising a memory, a processor, and a computer program stored in the memory and capable of running on the processor, characterized in that: When the processor executes the computer program, it implements the steps of the one-step granulation production control method for traditional Chinese medicine granule preparations as described in any one of claims 1 to 8.

10. A computer-readable storage medium having a computer program stored thereon, characterized in that: The computer program can be executed by one or more processors to implement the one-step granulation production control method for traditional Chinese medicine granule preparations as described in any one of claims 1 to 8.