Automatic feeding control method and device for medicine production line, equipment and storage medium
By collecting and analyzing material sensing data in real time and adjusting the feeding parameters of the pharmaceutical production line, the problem that traditional feeding control methods are difficult to cope with changes in material characteristics is solved, and more accurate material delivery control and production efficiency improvement is achieved.
Patent Information
- Application Number
- CN202411211782.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-08-30
- Publication Date
- 2024-11-08
- Estimated Expiration
- 2044-08-30
AI Technical Summary
The feeding control methods of traditional pharmaceutical production lines lack adaptability and are difficult to deal with changes in material characteristics, resulting in inaccurate feeding, affecting production quality and efficiency, and increasing resource waste.
By obtaining material sensing data collected by multiple sensors in real time, extracting real-time material feature vectors, calculating the similarity with standard feature vectors, determining the processing completion degree, and when the similarity does not reach the specified ratio, input the feature vector to pre-trained The prediction model is used to adjust the feeding parameters to achieve more accurate material delivery control.
Real-time detection and adaptive adjustment of material characteristics changes are achieved, the accuracy of feeding is improved, the degree of automation is improved, resource waste is reduced, and production efficiency and processing quality stability are improved.
Smart Images

Figure CN118907869A_ABST
Abstract
Description
Technical Field
[0001] The present invention belongs to the field of automatic control technology, and specifically relates to an automatic feeding control method and device, equipment, and storage medium for a pharmaceutical production line. Background Art
[0002] In the modern pharmaceutical production process, the transportation and preparation of materials is one of the key links. The traditional feeding control method mainly relies on preset formulas and fixed feeding rates. Although this method can meet basic production needs, it has certain limitations in practical applications. For example, different batches of raw materials may cause changes in the physical and chemical properties of the materials due to differences in sources, storage conditions, processing methods and other factors. The traditional fixed feeding method lacks adaptive capabilities and is difficult to make precise adjustments to cope with changes in material properties, resulting in inaccurate feeding amounts and feeding times, affecting production quality.
[0003] In order to reduce the instability and unpredictability in the processing process, manual intervention is currently required to adjust the feeding rate and feeding amount when dealing with changes in material properties, which increases downtime in the production process and reduces overall production efficiency. In addition, inaccurate feeding may lead to waste of raw materials or excessive use of processing materials, increase production costs, and may cause equipment wear and increase energy consumption, resulting in waste of resources.
[0004] Therefore, traditional feeding control methods lack adaptive capabilities and are difficult to make precise adjustments to cope with changes in material properties. They have a low degree of automation and are prone to waste of resources in the pharmaceutical production line, low production efficiency, and even unstable processing quality. Summary of the invention
[0005] The purpose of the present invention is to provide an automatic feeding control method and device, equipment, and storage medium for a pharmaceutical production line, which can adaptively respond to changes in material properties to achieve more accurate material feeding control, improve the degree of automation, reduce resource waste in the pharmaceutical production line, improve production efficiency, and make processing quality more stable.
[0006] The first aspect of the present invention discloses an automatic feeding control method for a pharmaceutical production line, comprising:
[0007] Obtain material sensing data collected by multiple sensors in real time;
[0008] Extracting a real-time material feature vector based on the material sensing data;
[0009] Calculating a first similarity between the real-time material feature vector and the standard feature vector, and determining a current processing completion degree of the material according to the first similarity;
[0010] Acquire an expected feature vector corresponding to the current processing completion degree, and calculate a second similarity between the real-time material feature vector and the expected feature vector;
[0011] If the second similarity is maintained for a specified period of time but does not reach a specified proportion, the real-time material feature vector is input into a pre-trained prediction model to obtain a first target feeding parameter;
[0012] The current feeding parameters of the pharmaceutical production line are adjusted to the first target feeding parameters.
[0013] In some embodiments, extracting a real-time material feature vector based on the material sensing data includes:
[0014] Preprocessing the material sensing data;
[0015] Feature extraction is performed based on the preprocessed material sensor data to obtain real-time material feature vectors.
[0016] In some embodiments, preprocessing the material sensing data includes:
[0017] Using a Kalman filter to filter the material sensor data;
[0018] After filtering, the material sensing data of all sensors are time-aligned using the timestamp synchronization method;
[0019] After time alignment, the moving average method is used to fill the missing values in the material sensor data;
[0020] After filling the missing values, the material sensing data of different sensors are normalized.
[0021] In some embodiments, the material sensing data includes temperature data, humidity data, pressure data, viscosity data, hardness data, water content data, solubility data and material appearance image; feature extraction is performed based on the preprocessed material sensing data to obtain a real-time material feature vector, including:
[0022] Inputting the material appearance image into a feature extraction model to obtain an image feature vector;
[0023] The temperature data, the humidity data, the pressure data, the viscosity data, the hardness data, the water content data and the solubility data are spliced onto the image feature vector to form a real-time material feature vector.
[0024] In some embodiments, after determining the current processing completion degree of the material according to the first similarity, the method further includes:
[0025] If the current processing completion degree reaches a preset upper limit, the real-time material feature vector is input into a pre-trained prediction model to obtain a second target feeding parameter;
[0026] The current feeding parameters of the pharmaceutical production line are adjusted to the second target feeding parameters.
[0027] The second aspect of the present invention discloses an automatic feeding control device for a pharmaceutical production line, comprising:
[0028] An acquisition unit, used to acquire material sensing data collected by various sensors in real time;
[0029] An extraction unit, used for extracting a real-time material feature vector according to the material sensing data;
[0030] A first calculation unit, used for calculating a first similarity between the real-time material feature vector and the standard feature vector;
[0031] a determination unit, configured to determine a current processing completion degree of the material according to the first similarity;
[0032] A second calculation unit is used to obtain an expected feature vector corresponding to the current processing completion degree, and calculate a second similarity between the real-time material feature vector and the expected feature vector;
[0033] A first prediction unit is configured to input the real-time material feature vector into a pre-trained prediction model to obtain a first target feeding parameter when the second similarity does not reach a specified proportion after a specified period of time;
[0034] The first adjustment unit is used to adjust the current feeding parameters of the pharmaceutical production line to the first target feeding parameters.
[0035] In some embodiments, the extraction unit comprises:
[0036] A preprocessing subunit, used for preprocessing the material sensing data;
[0037] The extraction subunit is used to extract features based on the preprocessed material sensor data to obtain a real-time material feature vector.
[0038] In some embodiments, the apparatus further comprises:
[0039] a second prediction unit, configured to input the real-time material feature vector into a pre-trained prediction model to obtain a second target feeding parameter after the determination unit determines the current processing completion degree of the material according to the first similarity, if the current processing completion degree reaches a preset upper limit;
[0040] The second adjustment unit is used to adjust the current feeding parameters of the pharmaceutical production line to the second target feeding parameters.
[0041] The third aspect of the present invention discloses an electronic device, comprising a memory storing executable program code and a processor coupled to the memory; the processor calls the executable program code stored in the memory to execute the automatic feeding control method for the pharmaceutical production line disclosed in the first aspect.
[0042] A fourth aspect of the present invention discloses a computer-readable storage medium storing a computer program, wherein the computer program enables a computer to execute the automatic feeding control method for a pharmaceutical production line disclosed in the first aspect.
[0043] The beneficial effect of the present invention lies in that, by acquiring material sensor data collected by multiple sensors in real time, a real-time material feature vector is extracted, a first similarity between the real-time material feature vector and the standard feature vector is calculated, the current processing completion of the material is determined according to the first similarity, and then the second similarity between the real-time material feature vector and the expected feature vector corresponding to the current processing completion is calculated. If the second similarity is maintained for a specified period of time and does not reach a specified proportion, the real-time material feature vector is input into a pre-trained prediction model to obtain a first target feeding parameter, and the current feeding parameter of the pharmaceutical production line is adjusted to the first target feeding parameter, so that the characteristics of the material can be detected in real time, and the material characteristics can be adaptively responded to changes in material characteristics to achieve more accurate material feeding control, improve the degree of automation, reduce resource waste of the pharmaceutical production line, improve production efficiency, and make the processing quality more stable. BRIEF DESCRIPTION OF THE DRAWINGS
[0044] The accompanying drawings herein show specific examples of the technical solutions described in the present invention, and together with the specific implementation methods constitute a part of the specification, and are used to explain the technical solutions, principles and effects of the present invention.
[0045] Unless otherwise specified or defined, the same reference numerals in different drawings represent the same or similar technical features, and the same or similar technical features may also be represented by different reference numerals.
[0046] Figure 1 This is a flow chart of an automatic feeding control method for a pharmaceutical production line disclosed in the present invention;
[0047] Figure 2 It is a structural schematic diagram of an automatic feeding control device for a pharmaceutical production line disclosed in the present invention;
[0048] Figure 3 It is a structural schematic diagram of an electronic device disclosed in the present invention;
[0049] Figure 4It is a schematic diagram of the architecture of an automatic feeding control system for a pharmaceutical production line disclosed in the present invention.
[0050] Description of reference numerals:
[0051] 201, acquisition unit; 202, extraction unit; 203, first calculation unit; 204, determination unit; 205, second calculation unit; 206, first prediction unit; 207, first adjustment unit; 301, memory; 302, processor. DETAILED DESCRIPTION
[0052] Unless otherwise specified or defined, all technical and scientific terms used herein have the same meaning as those generally understood by those skilled in the art. In the case of combining the technical solution of the present invention with realistic scenarios, all technical and scientific terms used herein may also have meanings corresponding to the purpose of implementing the technical solution of the present invention. The "first, second..." used herein is only used to distinguish the names and does not represent a specific quantity or order. The term "and / or" used herein includes any and all combinations of one or more related listed items.
[0053] It should be noted that when a component is considered to be "fixed to" another component, it can be directly fixed to the other component or there can be a central component; when an component is considered to be "connected to" another component, it can be directly connected to the other component or there can be a central component at the same time; when an component is considered to be "installed on" another component, it can be directly installed on the other component or there can be a central component at the same time. When an component is considered to be "set on" another component, it can be directly set on the other component or there can be a central component at the same time.
[0054] Unless otherwise specified or defined, the "said" and "the" used in this document refer to the technical features or technical contents mentioned or described before the corresponding position, and the technical features or technical contents may be the same as or similar to the technical features or technical contents mentioned therein. In addition, the terms "including" and "having" and any variations thereof used in this document are intended to cover non-exclusive inclusions. For example, a process, method, system, product or device that includes a series of steps or units is not limited to the listed steps or units, but may optionally include steps or units that are not listed, or may optionally include other steps or units inherent to these processes, methods, products or devices.
[0055] The embodiment of the present invention discloses an automatic feeding control method for a pharmaceutical production line, which can be implemented by computer programming. The execution subject of the method can be an electronic device such as a computer, a laptop, a tablet computer, or an automatic feeding control device for a pharmaceutical production line embedded in an electronic device, and the present invention is not limited to this. In order to facilitate the understanding of the present invention, the specific embodiments of the present invention will be described in more detail below with reference to the drawings of the specification.
[0056] like Figure 1 As shown, the method includes the following steps 110 to 160:
[0057] 110. Obtain material sensing data collected by multiple sensors in real time.
[0058] In an embodiment of the present invention, a variety of sensors can be installed on the pharmaceutical production line to detect and obtain material sensing data in real time. The material sensing data at least includes temperature data, humidity data, pressure data, viscosity data, hardness data, water content data, solubility data and material appearance images. The various sensors include temperature sensors, humidity sensors, pressure sensors, viscosity sensors, hardness sensors, infrared moisture sensors, solubility sensors and image sensors.
[0059] Among them, the temperature sensor is used to collect the temperature data of the material in the processing equipment; the humidity sensor is used to collect the humidity data of the material in the processing equipment; the pressure sensor is used to collect the pressure data of the material in the processing equipment; the viscosity sensor is used to collect the viscosity data of the material; the hardness sensor is used to collect the hardness data of the material; the infrared moisture sensor is used to collect the moisture content data of the material; the solubility sensor is used to collect the solubility data of the material; the image sensor is used to collect the appearance image of the material.
[0060] Preferably, the image sensor uses a 5-megapixel polarization camera, which can capture the polarization information of light reflected from the surface of the material. In scenes with complex lighting or insufficient contrast, the polarization camera can enhance the contrast of the surface features of the material and provide a clearer image of the material's appearance.
[0061] 120. Based on the material sensing data, the real-time material feature vector is extracted.
[0062] In step 120, the material sensor data may be preprocessed first, and then feature extraction may be performed based on the preprocessed material sensor data to obtain a real-time material feature vector.
[0063] Specifically, the implementation method of preprocessing the material sensor data may include steps S11 to S14 (not shown):
[0064] S11. Use a Kalman filter to filter the material sensor data.
[0065] Using Kalman filter to filter can remove high-frequency noise and transient interference during data acquisition. Especially for viscosity and hardness data, the filter can smooth short-term fluctuations to obtain more stable values.
[0066] S12. After filtering, the material sensing data of all sensors are time-aligned using the timestamp synchronization method. Time alignment can ensure the synchronization of data.
[0067] S13. After time alignment, the moving average method is used to fill the missing values in the material sensor data.
[0068] For example, if the temperature data at a certain sampling time is missing, the missing value can be linearly interpolated using the temperature data at the previous and next sampling times.
[0069] S14. After filling the missing values, the material sensing data of different sensors are normalized.
[0070] The material sensing data of different sensors are mapped to the same range (such as 0 to 1), so that parameters of different dimensions such as temperature, humidity, viscosity, hardness, etc. are on the same scale for easy analysis.
[0071] Furthermore, the material sensing data at least includes temperature data, humidity data, pressure data, viscosity data, hardness data, water content data, solubility data and material appearance image. In step 120, feature extraction is performed based on the pre-processed material sensing data to obtain a real-time material feature vector, which may include steps S21 to S22 (not shown):
[0072] S21. Input the material appearance image into the feature extraction model to obtain an image feature vector.
[0073] The feature extraction model can be trained by using a convolutional neural network (CNN). The architecture design of CNN includes an input layer, a first convolutional layer, a second convolutional layer, a third convolutional layer, a fourth convolutional layer, a first pooling layer, a second pooling layer, a third pooling layer, a fourth pooling layer and a fully connected layer connected in sequence;
[0074] Input layer: The input image size is H×W×C, where H=W=1024 (image resolution) and C=3 (number of RGB image channels).
[0075] First convolutional layer: number of filters 64, filter size 7×7, stride 2, padding set to same to keep the output size unchanged.
[0076] Output size calculation formula Where H and W are the input image height and width, F is the filter size, S is the stride, P is the padding, and K is the number of filters. Applied to the current convolutional layer parameter values, the calculated output size is 512×512×64.
[0077] Second convolutional layer: number of filters 128, filter size 5×5, stride 2, output size 128×128×128.
[0078] The third convolutional layer: number of filters is 256, filter size is 3×3, stride is 2, and output size is 32×32×256.
[0079] Fourth convolutional layer: number of filters 512, filter size 3×3, stride 2, output size 8×8×512.
[0080] First pooling layer: max pooling type, pooling window size 2×2, stride 2.
[0081] Output size calculation formula Where Hp and Wp are the height and width of the pooling layer input, Fp is the size of the pooling window, Sp is the step size, Cp is the number of input channels, and the calculated output size is 256×256×64.
[0082] Second pooling layer: max pooling type, pooling window size 2×2, stride 2, output size 64×64×128.
[0083] The third pooling layer: max pooling type, pooling window size 2×2, stride 2, output size 16×16×256.
[0084] Fourth pooling layer: max pooling type, pooling window size 2×2, stride 2, output size 4×4×512.
[0085] Fully connected layer: Flatten the output of the last pooling layer into a one-dimensional vector, the size of which is 4×4×512=8192. Considering the complexity of the current input part and the capacity requirements of the model, a double-layer smaller-scale fully connected layer is used, and the activation function is ReLU. The first fully connected layer holds 1024 neurons and outputs a 1024-dimensional vector; the second fully connected layer holds 512 neurons and finally outputs a 512-dimensional image feature vector, including the color distribution, shape parameters (such as aspect ratio, area, etc.), particle size and other feature values of the material.
[0086] S22. The temperature data, humidity data, pressure data, viscosity data, hardness data, water content data and solubility data are spliced onto the image feature vector to form a real-time material feature vector.
[0087] Among them, each sensor except the image sensor outputs a scalar, totaling 7 scalars, so the dimension of the final real-time material feature vector is 512+7=519.
[0088] 130. Calculate a first similarity between the real-time material feature vector and the standard feature vector, and determine a current processing completion degree of the material according to the first similarity.
[0089] The standard feature vector in the database is used to characterize the state of the material when the processing is completed. By calculating the first similarity between the real-time material feature vector and the standard feature vector, the current processing completion degree of the material can be determined. If the real-time material feature vector is highly similar to the standard feature vector, it can be determined that the current processing completion degree of the material is close to completion, otherwise it will continue to be processed. For example, if the first similarity is 60%, it is determined that the current processing completion degree of the material is 60%.
[0090] The cosine similarity is used to measure the first similarity between the real-time material feature vector and the standard feature vector, as shown in the following formula (1):
[0091]
[0092] Among them, cos(f current,i ·f database,i ) represents the first similarity, f current,i and f database,i are the i-th eigenvalues of the real-time material feature vector and the standard feature vector in the database, respectively, and n is the total number of features. The numerator of the formula is the sum of the products of the real-time material feature vector and the standard feature vector in the database in each feature dimension, and the denominator is the modulus length of the real-time material feature vector and the standard feature vector, and then multiplying them. The cosine similarity is between [-1, 1]. Since the feature vector is usually positive, the actual value range is [0, 1]. Close to 1 means that the real-time material feature vector and the standard feature vector are very similar, otherwise the difference is large.
[0093] 140. Obtain an expected feature vector corresponding to the current processing completion degree, and calculate a second similarity between the real-time material feature vector and the expected feature vector.
[0094] The expected feature vector is used to characterize the expected production process requirements under the current processing completion degree. By calculating the second similarity between the real-time material feature vector and the expected feature vector, it can be determined whether the material processing progress is normal. If the second similarity reaches a specified ratio (such as 90%, 96% or 98%, etc.), it means that the current characteristics and processing status of the material are consistent with the expected production process requirements, indicating that the material processing progress is normal, the current feeding control is appropriate, and the production process is running normally. If the second similarity does not reach the specified ratio, it means that the current characteristics and processing status of the material are inconsistent with the expected production process requirements, indicating that the material processing progress is abnormal.
[0095] 150. If the second similarity is maintained for a specified period of time but does not reach a specified proportion, the real-time material feature vector is input into a pre-trained prediction model to obtain a first target feeding parameter.
[0096] In normal production, there may be occasional short-term fluctuations in the degree of processing, but if such fluctuations quickly return to the normal range, there is no need to adjust the feeding parameters. Therefore, when the second similarity does not reach the specified ratio for a specified period of time, it is determined that the feeding parameters need to be adjusted, and the real-time material feature vector is input into the pre-trained prediction model for feeding parameter prediction.
[0097] Further, step 150 may include: if the second similarity is maintained for a specified period of time but does not reach a specified proportion, and the gap between the current processing completion degree and the expected completion degree reaches a specified gap, the real-time material feature vector is input into a pre-trained prediction model to obtain the first target feeding parameter.
[0098] Among them, the gap between the current processing completion degree and the expected completion degree reaches a specified gap: it means that the current processing completion degree does not meet expectations (such as too fast or too slow), so the current process parameters may not be suitable, and continuing the current feeding control may lead to unqualified products. By combining the second similarity and the gap between the current processing completion degree and the expected completion degree for judgment, the judgment accuracy can be further improved.
[0099] 160. Adjust the current feeding parameters of the pharmaceutical production line to the first target feeding parameters.
[0100] The first target feeding parameters include the first target feeding rate, the first target feeding amount and the first target feeding ratio. The first target feeding parameters are used for optimizing feeding control in the production process, including speeding up or slowing down the feeding process, so as to ensure that the material production proceeds according to the expected state or progress.
[0101] In some embodiments, after executing step 130, the following steps 171 to 172 (not shown) may also be executed:
[0102] 171. If the current processing completion degree reaches the preset upper limit, the real-time material feature vector is input into the pre-trained prediction model to obtain the second target feeding parameter.
[0103] The current processing completion degree reaches the preset upper limit (such as 95% or 97%), which means that the processing of the material is almost completed. Continuing to use the current feeding rate and feeding amount may lead to over-processing or waste.
[0104] 172. Adjust the current feeding parameters of the pharmaceutical production line to the second target feeding parameters.
[0105] The second target feeding parameters include a second target feeding rate, a second target feeding amount and a second target feeding ratio. The second target feeding parameters are used to slow down the feeding process to avoid over-processing and waste of resources.
[0106] In an embodiment of the present invention, the first target feeding parameter and the second target feeding parameter are both predicted by a pre-trained prediction model, which is trained based on a machine learning model and constructed using a reinforcement learning (Q-Learning) model according to the characteristics of the pharmaceutical production line.
[0107] Specifically, the action space, state representation, and reward function of Q-Learning are designed as follows:
[0108] (1) Action space: defines all actions that can be performed. The action space includes: Feed Rate: controls the speed of material input; Feed Quantity: controls the amount of material input each time; Feed Proportion: controls the feed ratio between different materials in the case of multiple materials (if there is only one material, the feed ratio defaults to 100%).
[0109] The action space is discretized, and the specific value range is as follows:
[0110] Feeding rate: r1, r2, ···, r n , such as 0.1, 0.2, 0.3, ..., 1.0 (unit: mass per unit time)
[0111] Feeding amount: q1, q2, ···, q m , such as 10kg, 20kg, 30kg,…, 100kg.
[0112] Feeding ratio: {p1, p2, ..., p k}, such as {(0.2, 0.8), (0.5, 0.5), (0.7, 0.3)} (the ratio of the two materials can be adjusted according to actual production).
[0113] In this way, the total number of action spaces is the Cartesian product of action types: total number of actions = n*m*k; where n, m, and k are the number of discretized options for feeding rate, feeding amount, and feeding ratio, respectively.
[0114] (2) State space: represents the current state of the system, usually composed of environmental information. In the present invention, the state space is composed of real-time material feature vectors, including image feature vectors and spliced scalars output by other sensors (temperature data, humidity data, pressure data, viscosity data, hardness data, water content data and solubility data). From the CNN architecture, the present invention proposes that the image feature vector output is The scalar outputs of other sensors are Where d is the number of other sensor types, d = 7. Therefore, the state space can be expressed as s = [fCNN, fsens], where It means that the image features output by CNN are fused with the scalars output by other sensors through splicing.
[0115] (3) Reward function: The reward function plays a key role in reinforcement learning, indicating the immediate return brought by each action. The reward function designed by the present invention takes into account the following factors: feed amount error (i.e., the deviation between the feed amount and the target feed amount), process yield (i.e., the qualified rate of products after material processing), and resource consumption rate (i.e., the proportion of waste or defective products).
[0116] Therefore, the reward function can be set as: R(s, a) = -α|∈ q |+β y -γ w , where α is the penalty factor (penalizing the feeding amount error), β is the reward factor (encouraging high process yield), γ is the penalty factor (penalizing high resource consumption), ∈ q is the feeding amount error, y is the process yield, and w is the resource consumption rate.
[0117] Once the system executes a feeding action a, this action will affect the state of the material and generate a new state s′. The system continuously monitors the new state changes and calculates the immediate reward R(s, a) based on the new state s′ and the previous feeding action a.
[0118] After completing the above preparations, the action value (Q value) of the learning state-action pair is
[0119] To guide strategy selection, the specific steps are as follows:
[0120] The update formula for defining the Q value is:
[0121]
[0122] Among them, Q(s, a) is the Q value function of selecting action a in state s; α is the learning rate, which is used to control the step size of Q value update; γ is the discount factor, which is used to control the weight of future rewards; R(s, a) is the immediate reward for executing action a in state s; s′ represents the new state that the system enters after executing action a in the current state s; a′ represents one of all possible actions that can be performed in state s′, and the largest Q value is selected by comparing the Q values of these possible actions. This part calculates the maximum expected reward that can be obtained by taking the optimal action in the next state.
[0123] Since the traditional Q table is difficult to process, in the embodiment of the present invention, a deep Q-learning network (DQN) is used instead of a Q table to approximate the Q value function. The Q value function of DQN is expressed as: Q(s, a; θ)≈Q(s, a). The input of DQN is state s and action a, and the output is the Q value of the corresponding action. Through back propagation and gradient descent algorithms, the network parameter θ of DQN is continuously optimized.
[0124] Finally, in the actual feeding control process, the ∈-greedy strategy is adopted to achieve balanced exploration and utilization, helping the system to find the best feeding strategy. The specific steps are as follows:
[0125] In the early stage, a high ∈ value is set, such as 0.9. This means that 90% of the time the system will randomly select actions, explore and try different combinations of feeding parameters to obtain a wider range of data. This data is used to train DQN to help it better approximate the optimal Q value function.
[0126] As the system continues to learn, the ∈ value gradually decreases (such as from 0.9 to 0.1), and the system chooses actions with the largest current Q value more often, which means that the system has begun to rely more on the optimal strategy it has learned.
[0127] By dynamically adjusting the ∈ value, the system can quickly collect rich experience in the early stage and gradually converge to the optimal strategy in the later stage. This strategy ensures that the system can not only explore the possible best feeding parameters, but also operate stably after learning the best strategy.
[0128] By combining the deep Q network with the ∈-greedy strategy, the following goals can be achieved in a complex production environment: First, through continuous learning and optimization, the system can adjust the feeding strategy in real time according to the characteristics of the current material and environmental conditions, ensuring that the feeding amount is highly matched with the actual demand and achieving accurate feeding. Second, by optimizing the feeding control, the waste of resources and time in the production process can be reduced, thereby improving the overall production efficiency. Third, accurate feeding control directly affects the quality of the final product. By adjusting the feeding parameters, the consistency and high quality of the finished product can be ensured, thereby improving product quality.
[0129] In some embodiments, after adjusting the current feeding parameters of the pharmaceutical production line to the first target feeding parameters or the second target feeding parameters, it is also possible to obtain the feeding data of the current production of the pharmaceutical production line when the production is completed, and perform analysis based on a preset analysis method corresponding to the feeding data to obtain analysis results, determine the third target feeding parameters based on the analysis results, and adjust the current feeding parameters of the pharmaceutical production line to the third target feeding parameters, which are used for feeding control during the next production.
[0130] Among them, the preset analysis method varies according to different feeding data, and the feeding data includes but is not limited to sensor data, feeding control parameters, different environmental conditions, etc. When the feeding data includes a single sensor data (such as material viscosity), the corresponding preset analysis method is the distribution analysis method; when the feeding data includes multiple sensor data (such as material temperature, humidity, viscosity, etc.), the corresponding preset analysis method is principal component analysis; when the feeding data includes multiple feeding control parameters, the corresponding preset analysis method is correlation analysis; when the feeding data includes different environmental conditions, the corresponding preset analysis method is cluster analysis.
[0131] By analyzing the feeding data of this production based on the actual output of this production, the feeding control settings for the next production can be realized, and the production feeding plan can be optimized. Among them, the preset analysis methods mentioned mainly include any of the following means:
[0132] (1) Distribution analysis: In feeding control, different material characteristics will be presented in different distribution forms. Assuming that for the actual finished product of this production, the focus is on the material viscosity distribution during the feeding process, the probability density function (PDF) is used to represent the viscosity: Among them, V iis the viscosity value, i is the time point of data collection, N is the number of samples, and δ is the Dirac function. By analyzing the shape of the function, such as skewness and kurtosis, it can be determined whether the viscosity is concentrated in a certain range or whether there are extreme values (abnormal conditions). During the production process, if the skewness of the viscosity distribution is large, it may indicate uneven feeding or fluctuations in the equipment status. The system needs to adjust the feeding rate or feeding ratio in time for the next production to correct this instability in the viscosity distribution.
[0133] (2) Correlation analysis: In the process of feeding control, multiple feeding control parameters may jointly affect the production results. Correlation analysis aims to identify the linear or nonlinear relationship between these feeding control parameters to help understand their combined impact on production results. For example, the Pearson correlation coefficient ρ between the feeding rate Ri and the finished product moisture content Wi is as follows: in, and are the mean of the feed rate and the moisture content of the finished product, Ri and Wi are the feed rate and the moisture content of the finished product of the ith sample, respectively, and N is the number of samples. By calculating ρ RW , the result is between [-1, 1]. When the result is close to 1, it is positively correlated (i.e., when the feed rate increases, the moisture content of the finished product also increases). When the result is close to -1, it is negatively correlated (i.e., when the feed rate increases, the moisture content of the finished product decreases). The system can quantify the impact of the feed rate on the moisture content of the finished product and adjust the feed rate for the next production, thereby ensuring that the moisture content of the actual finished product is controlled within the ideal range.
[0134] (3) Cluster analysis: Through cluster analysis, the system can identify the best feeding operation mode under different environmental conditions. For example, given the feature vector x i =[T i , H i , R i ], where T i is temperature, H i is humidity, R i The K-means clustering algorithm is used to divide these data points into (K) clusters: Among them C k is the Kth cluster, μ kis the cluster center. Through cluster analysis, each cluster center point represents the optimal combination of feeding parameters under a specific production environment (such as different temperature and humidity conditions). For example, a cluster center may represent the optimal feeding rate and ratio under a high temperature and high humidity environment. Each data point (that is, each production record) is assigned a cluster label, indicating the feeding strategy category applicable to the environmental conditions of the data point. For example, the label may indicate that the data point belongs to a "high temperature and low humidity" environment or a "low temperature and high humidity" environment. The system can identify which feeding rate is most appropriate under a specific environmental condition (such as a high temperature and high humidity environment), and then automatically select this strategy under the corresponding conditions to optimize production efficiency and product quality.
[0135] (4) Principal Component Analysis (PCA): When processing multidimensional data, PCA can help simplify model input, focus on the most important features, and reduce the computational burden. In other words, through PCA, the system can simplify multiple sensor data (such as temperature, humidity, viscosity, etc.) into several main components that can explain most of the variability of the production process, thereby simplifying model design and improving the efficiency of real-time control.
[0136] By combining these statistical analysis and pattern recognition techniques, we can gain a deeper understanding of the complex relationships in the feeding control process and apply these findings to optimize the control strategy (feeding action) in real time. This will not only improve production efficiency and product quality, but also maintain system stability and reliability in a complex and changing production environment.
[0137] In summary, by implementing the embodiments of the present invention, it is possible to detect the characteristics of materials in real time, adaptively respond to changes in material characteristics to achieve more accurate material delivery control, and improve the degree of automation, thereby reducing resource waste in the pharmaceutical production line, improving production efficiency, and making processing quality more stable.
[0138] like Figure 2 As shown, the embodiment of the present invention discloses an automatic feeding control device for a pharmaceutical production line, including an acquisition unit 201, an extraction unit 202, a first calculation unit 203, a determination unit 204, a second calculation unit 205, a first prediction unit 206, and a first adjustment unit 207, wherein:
[0139] An acquisition unit 201 is used to acquire material sensing data collected by various sensors in real time;
[0140] An extraction unit 202, used to extract a real-time material feature vector according to the material sensing data;
[0141] A first calculation unit 203, used to calculate a first similarity between a real-time material feature vector and a standard feature vector;
[0142] A determination unit 204, configured to determine a current processing completion degree of the material according to the first similarity;
[0143] The second calculation unit 205 is used to obtain an expected feature vector corresponding to the current processing completion degree, and calculate a second similarity between the real-time material feature vector and the expected feature vector;
[0144] The first prediction unit 206 is used to input the real-time material feature vector into a pre-trained prediction model to obtain a first target feeding parameter when the second similarity does not reach a specified proportion for a specified period of time;
[0145] The first adjustment unit 207 is used to adjust the current feeding parameters of the pharmaceutical production line to the first target feeding parameters.
[0146] As an optional implementation, the extraction unit 202 includes the following subunits (not shown):
[0147] A preprocessing subunit, used for preprocessing material sensor data;
[0148] The extraction subunit is used to extract features based on the preprocessed material sensor data to obtain a real-time material feature vector.
[0149] Further optionally, the above-mentioned preprocessing subunit is specifically used to filter the material sensor data using a Kalman filter; after filtering, the material sensor data of all sensors are time-aligned using a timestamp synchronization method; after time alignment, the moving average method is used to fill in the missing values in the material sensor data; after filling the missing values, the material sensor data of different sensors are normalized.
[0150] Further optionally, the material sensing data includes temperature data, humidity data, pressure data, viscosity data, hardness data, water content data, solubility data and material appearance image; accordingly, the above-mentioned extraction subunit is specifically used to input the material appearance image into the feature extraction model to obtain the image feature vector; the temperature data, humidity data, pressure data, viscosity data, hardness data, water content data and solubility data are spliced onto the image feature vector to form a real-time material feature vector.
[0151] As an optional implementation, the device further includes the following units not shown in the figure:
[0152] A second prediction unit is used for inputting the real-time material feature vector into a pre-trained prediction model to obtain a second target feeding parameter after the determination unit 204 determines the current processing completion degree of the material according to the first similarity, if the current processing completion degree reaches a preset upper limit;
[0153] The second adjustment unit is used to adjust the current feeding parameters of the pharmaceutical production line to second target feeding parameters.
[0154] like Figure 3 As shown, an embodiment of the present invention discloses an electronic device, including a memory 301 storing executable program codes and a processor 302 coupled to the memory 301;
[0155] The processor 302 calls the executable program code stored in the memory 301 to execute the automatic feeding control method for the pharmaceutical production line described in the above embodiments.
[0156] like Figure 4 As shown, an embodiment of the present invention also discloses an automatic feeding control system for a pharmaceutical production line, the overall architecture of which includes a hardware part, a business part, a machine learning part, a database, and an operating environment; wherein the hardware part includes a sensor module and a camera module, the hardware part is connected to the business part through a communication data bus, the business part includes a data processing unit, a data display unit, and a feeding control unit, the machine learning part includes a deep learning model CNN and a reinforcement learning model Q-learning, and the database includes MS SQL, Mongo, and Oracle; the operating environment is set as an independent server. Through the synergistic effect of the modules of the automatic feeding control system, the automatic feeding control method for the pharmaceutical production line described in the above embodiments is realized.
[0157] An embodiment of the present invention further discloses a computer-readable storage medium storing a computer program, wherein the computer program enables a computer to execute the automatic feeding control method for a pharmaceutical production line described in the above embodiments.
[0158] The purpose of the above embodiments is to exemplarily reproduce and deduce the technical solution of the present invention, and to fully describe the technical solution, purpose and effect of the present invention. Its purpose is to make the public understand the disclosed content of the present invention more thoroughly and comprehensively, and it does not limit the scope of protection of the present invention.
[0159] The above embodiments are not exhaustive enumerations of the present invention, and there may be multiple other implementations not listed. Any replacement and improvement made without violating the concept of the present invention shall fall within the protection scope of the present invention.
Claims
1. An automatic feeding control method for a pharmaceutical production line, characterized in that: include: Obtain material sensing data collected by multiple sensors in real time; Extracting a real-time material feature vector based on the material sensing data; Calculating a first similarity between the real-time material feature vector and the standard feature vector, and determining a current processing completion degree of the material according to the first similarity; Acquire an expected feature vector corresponding to the current processing completion degree, and calculate a second similarity between the real-time material feature vector and the expected feature vector; If the second similarity is maintained for a specified period of time but does not reach a specified proportion, the real-time material feature vector is input into a pre-trained prediction model to obtain a first target feeding parameter; The current feeding parameters of the pharmaceutical production line are adjusted to the first target feeding parameters.
2. The automatic feeding control method for a pharmaceutical production line according to claim 1, characterized in that: According to the material sensing data, a real-time material feature vector is extracted, including: Preprocessing the material sensing data; Feature extraction is performed based on the preprocessed material sensor data to obtain real-time material feature vectors.
3. The automatic feeding control method for a pharmaceutical production line according to claim 2, characterized in that: Preprocessing the material sensing data includes: Using a Kalman filter to filter the material sensor data; After filtering, the material sensing data of all sensors are time-aligned using the timestamp synchronization method; After time alignment, the moving average method is used to fill the missing values in the material sensor data; After filling the missing values, the material sensing data of different sensors are normalized.
4. The automatic feeding control method for a pharmaceutical production line according to claim 2, characterized in that: The material sensing data includes temperature data, humidity data, pressure data, viscosity data, hardness data, water content data, solubility data and material appearance images; Feature extraction is performed based on the preprocessed material sensor data to obtain real-time material feature vectors, including: Inputting the material appearance image into a feature extraction model to obtain an image feature vector; The temperature data, the humidity data, the pressure data, the viscosity data, the hardness data, the water content data and the solubility data are spliced onto the image feature vector to form a real-time material feature vector.
5. The automatic feeding control method for a pharmaceutical production line according to any one of claims 1 to 4, characterized in that: After determining the current processing completion degree of the material according to the first similarity, the method further includes: If the current processing completion degree reaches a preset upper limit, the real-time material feature vector is input into a pre-trained prediction model to obtain a second target feeding parameter; The current feeding parameters of the pharmaceutical production line are adjusted to the second target feeding parameters.
6. An automatic feeding control device for a pharmaceutical production line, characterized in that: include: An acquisition unit, used to acquire material sensing data collected by various sensors in real time; An extraction unit, used for extracting a real-time material feature vector according to the material sensing data; A first calculation unit, used for calculating a first similarity between the real-time material feature vector and the standard feature vector; a determination unit, configured to determine a current processing completion degree of the material according to the first similarity; A second calculation unit is used to obtain an expected feature vector corresponding to the current processing completion degree, and calculate a second similarity between the real-time material feature vector and the expected feature vector; A first prediction unit is configured to input the real-time material feature vector into a pre-trained prediction model to obtain a first target feeding parameter when the second similarity does not reach a specified proportion after a specified period of time; The first adjustment unit is used to adjust the current feeding parameters of the pharmaceutical production line to the first target feeding parameters.
7. The automatic feeding control device for a pharmaceutical production line according to claim 6, characterized in that: The extraction unit comprises: A preprocessing subunit, used for preprocessing the material sensing data; The extraction subunit is used to extract features based on the preprocessed material sensor data to obtain a real-time material feature vector.
8. The automatic feeding control device for a pharmaceutical production line according to claim 6, characterized in that: The device also includes: A second prediction unit is used for inputting the real-time material feature vector into a pre-trained prediction model to obtain a second target feeding parameter after the determination unit determines the current processing completion degree of the material according to the first similarity, if the current processing completion degree reaches a preset upper limit; The second adjustment unit is used to adjust the current feeding parameters of the pharmaceutical production line to the second target feeding parameters.
9. An electronic device, characterized in that: It includes a memory storing executable program code and a processor coupled to the memory; the processor calls the executable program code stored in the memory to execute the automatic feeding control method for a pharmaceutical production line according to any one of claims 1 to 5.
10. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a computer program, wherein the computer program enables a computer to execute the automatic feeding control method for a pharmaceutical production line according to any one of claims 1 to 5.
Citation Information
Patent Citations
Object name matching method based on information entropy
CN104899189A
Screw type material proportioning machine controller based on machine learning
CN110697448A
Text filtering method and device, equipment and storage medium
CN111966789A
Intelligent management system and method for feeding bin on blast furnace trough
CN114104755A
Intelligent coal loading method and system
CN115611029A
