Drug moisture detection method and device
Through the dynamic sampling frequency model and multi-level data architecture, the sampling frequency and processing process of drug moisture detection are adjusted in real time, and the problems of static sampling strategies and response delay in parallel operations in multi-production lines are solved, realizing accurate monitoring and efficient early warning of drug moisture detection.
Patent Information
- Application Number
- CN202510436628.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-04-09
- Publication Date
- 2025-07-08
AI Technical Summary
Traditional pharmaceutical moisture detection methods have problems such as static sampling strategies, resource mismatch, response delay and environmental correlation in the parallel operation mode of multi-production lines, which are difficult to adapt to dynamic changes in production line load, resulting in low detection accuracy and efficiency.
A dynamic sampling frequency model is used to combine edge computing and central processing multi-level data architecture, and by obtaining drug production information, environmental parameters and moisture sensitivity index, the sampling frequency is adjusted in real time, multi-level data processing and hierarchical abnormality warning are carried out, and moisture status reports are generated.
It realizes accurate monitoring and hierarchical early warning of the moisture status of the drug, optimizes resource allocation, improves the foresight of detection efficiency and abnormal early warning, and solves the problem of sampling resource mismatch and response delay in traditional methods.
Smart Images

Figure CN120275594A_ABST
Abstract
Description
Technical Field
[0001] This application relates to the technical field of quality control, and in particular, to a method and device for detecting the moisture content of drugs. Background Art
[0002] In the modern pharmaceutical industry quality control system, moisture control during the drug production process is a core parameter affecting product stability and effectiveness. With the expansion of the production scale of pharmaceutical enterprises and the diversification of product types, the parallel operation mode of multiple production lines has become the norm. The sensitivity differences of different dosage forms of drugs to moisture control are significant. From the microgram-level moisture control of freeze-dried preparations to the humidity tolerance threshold of sugar-coated tablets, higher requirements are put forward for the dynamic adaptability of the detection system. The dynamic fluctuations of production line environmental parameters are coupled with the characteristics of drug production stages. For example, the sudden changes in temperature and humidity during the coating process and the continuous drying requirements during the tableting stage form a complex moisture control scenario. Traditional detection methods based on fixed-frequency sampling are difficult to effectively capture the moisture change characteristics of key process nodes.
[0003] The technical bottlenecks commonly existing in the prior art are mainly reflected in three aspects: First, the static sampling strategy leads to resource misallocation. In the key production stages of highly sensitive drugs, instantaneous abnormalities may be missed due to insufficient sampling density, while excessive sampling in low-sensitivity stages causes waste of computing resources; Second, the centralization of the data processing architecture causes response delays. When a large amount of sensing data is generated concurrently by multiple production lines, a single central processing unit is difficult to achieve real-time anomaly diagnosis; Third, the lack of environmental correlation analysis makes the early warning mechanism lack foresight, and a dynamic correlation model between moisture parameters and production environment factors such as temperature, humidity, and air pressure has not been established, resulting in low efficiency of anomaly traceability. More notably, the existing system cannot adapt to the impact of dynamic changes in production line load on detection accuracy. For example, local temperature rise caused by equipment startup and shutdown may interfere with sensor accuracy, but traditional methods have not established a dynamic compensation mechanism.
[0004] In view of the above problems, the prior art urgently needs to be improved. Summary of the Invention
[0005] The purpose of this application is to provide a method and device for detecting the moisture content of drugs, which have the advantages of dynamically adapting to the requirements of parallel operation of multiple production lines, optimizing resource allocation, improving the real-time performance of detection, and the foresight of anomaly early warning.
[0006] In a first aspect, this application provides a method for detecting the moisture content of drugs, and the technical solution is as follows: The method includes: Obtaining the drug production information, environmental parameter information of multiple production lines, and the moisture sensitivity index of each drug; Calculating the real-time sampling frequency of each production line through a dynamic sampling frequency model according to the drug production information, environmental parameter information, and moisture sensitivity index; Collect moisture data through a moisture sensor network distributed across each production line according to the calculated real-time sampling frequency; Perform multi-level processing on the collected moisture data, including: preliminary data filtering and outlier identification in an edge computing unit directly connected to the moisture sensor; global analysis and multi-dimensional data association in a central processing unit; Generate a moisture status report based on the results of multi-level processing, where the moisture status report includes moisture content, change trend, and production environment relevance; Conduct hierarchical anomaly warnings on the moisture status report according to a preset specific moisture threshold for the drug.
[0007] Further, in this application, the step of calculating the real-time sampling frequency of each production line through a dynamic sampling frequency model according to the drug production information, environmental parameter information, and moisture sensitivity index includes: Obtain real-time production line status information, where the real-time production line status information includes production line load, the type of drug currently being produced, and the production stage; Based on the real-time production line status information, dynamically adjust the weight parameters in the dynamic sampling frequency model, where the weight parameters include coefficients related to drug moisture sensitivity, production stage criticality, and environmental fluctuations; Input the drug production information, environmental parameter information, moisture sensitivity index, and the adjusted weight parameters into the dynamic sampling frequency model; Calculate the real-time sampling frequency of each production line through the dynamic sampling frequency model.
[0008] Further, in this application, the method further includes: Monitor the production line status. When it is detected that the production line status changes beyond a threshold relative to a preset reference value, trigger a quick response mechanism, increase the sampling frequency of the corresponding production line to a preset maximum value, and decrease the sampling frequency after the status returns within the threshold range; The step of monitoring the production line status, when it is detected that the production line status changes beyond a threshold relative to a preset reference value, trigger a quick response mechanism, increase the sampling frequency of the corresponding production line to a preset maximum value, and decrease the sampling frequency after the status returns within the threshold range includes: Obtain the duration and amplitude of the production line status change; According to the duration and amplitude, combined with the characteristics of the drug type currently being produced, calculate an adjustment coefficient for the sampling frequency; Multiply the current sampling frequency by the adjustment coefficient to obtain an adjusted sampling frequency, and ensure that this frequency is within the preset maximum and minimum values; Perform moisture data acquisition according to the adjusted sampling frequency, and record the sampling frequency change curve at the same time; Continuously monitor the production line status. When the status returns to within the threshold range, calculate the recovery coefficient based on the recorded sampling frequency change curve and the current drug production stage; Multiply the current sampling frequency by the recovery coefficient, and gradually reduce the sampling frequency to the normal level suitable for the current drug production stage.
[0009] Further, in the present application, the step of dynamically adjusting the weight parameters in the dynamic sampling frequency model based on the real-time production line status information includes: Obtain the historical weight parameter adjustment records within a preset time window, and the historical weight parameter adjustment records include the adjustment histories of the drug moisture sensitivity coefficient, the production stage criticality coefficient, and the environmental fluctuation coefficient; Based on the historical weight parameter adjustment records, calculate the response time of each weight parameter to the change of the production line status; According to the response time, establish a weight parameter adjustment priority queue, and place the parameters with short response times at the front of the queue; When it is detected that the real-time production line status information changes by more than the preset threshold, calculate and update each weight parameter in turn according to the order of the priority queue; Apply the updated weight parameters to the dynamic sampling frequency model, and record the result of this parameter adjustment.
[0010] Further, in the present application, the step of continuously monitoring the production line status, and when the status returns to within the threshold range, calculating the recovery coefficient based on the recorded sampling frequency change curve and the current drug production stage includes: Obtain the production line parameters at the time of status recovery, including temperature, humidity, pressure, and production speed; Based on the production line parameters, retrieve the standard parameter range of the current drug production stage from the pre-established production stage database, and the database also contains the moisture sensitivity index of different types of drugs in each production stage; Calculate the deviation degree between the current production line parameters and the standard parameter range, and combine the moisture sensitivity index of the current drug to generate a status recovery score; According to the status recovery score and the recorded sampling frequency change curve, calculate the initial recovery coefficient; Based on the specific moisture control requirements of the current drug production stage, correct the initial recovery coefficient to obtain the final recovery coefficient.
[0011] Further, in the present application, the step of establishing a weight parameter adjustment priority queue according to the response time and placing the parameters with short response times at the front of the queue includes: Construct a multi-time-scale data matrix, which includes real-time monitoring data, minute-level aggregated data, and hourly trend data; Extract the eigenvectors of each weight parameter in the data matrix at different time scales; Calculate the dynamic time-varying correlation coefficient matrix between weight parameters; Convert the dynamic time-varying correlation coefficient matrix into a parameter dependence graph; Identify highly correlated parameter clusters in the parameter dependence graph; Calculate the comprehensive response time of each weight parameter according to the degree of mutual influence within the parameter cluster; Based on the comprehensive response time, construct a priority queue and place the parameters with short response times at the front of the queue.
[0012] Further, in this application, the step of calculating the comprehensive response time of each weight parameter according to the degree of mutual influence within the parameter cluster includes: Construct a parameter influence matrix, where the matrix elements represent the influence strength and direction between parameters; Perform matrix eigenvalue decomposition to obtain the main modes of parameter influence; Calculate the contribution degree of each parameter in the main mode; Based on the contribution degree and mode eigenvalue, construct an initial estimate of the parameter response time; Apply time series analysis methods to identify the periodicity and trend of parameter changes; Combine the periodicity and trend information to correct the initial estimate and generate the comprehensive response time of each weight parameter.
[0013] Further, in this application, the step of generating a moisture status report based on the results of multi-level processing, where the moisture status report includes moisture content, change trend, and production environment correlation, includes: Construct a multi-dimensional data model and map the moisture content data, production environment parameters, and drug characteristic information to the feature space of the multi-dimensional data model; Perform dimensionality reduction analysis to extract the influencing factors of the moisture status; Based on the influencing factors, calculate the time-varying correlation coefficient between the moisture content and the environmental parameters, and separate the trend, period, and random components of the moisture content; According to the decomposition results, fit the moisture change trend curve; Based on the time-varying correlation coefficient and the change trend curve, construct a moisture-environment causal network graph; Match the moisture-environment causal network graph with the drug production process flow chart, identify the moisture-sensitive areas of the process nodes, and generate a moisture status report.
[0014] Further, in the present application, the step of calculating the real-time sampling frequency of each production line through the dynamic sampling frequency model according to the drug production information, environmental parameter information, and moisture sensitivity index includes: Obtain the base sampling frequency Fbase, the drug moisture sensitivity index d, the changes in environmental parameters ΔT and ΔH, the production line load L(t), the criticality index of the production stage C(t), the change amplitude Δs, and the duration τ; Calculate the drug moisture sensitivity function S(d) = 1 + log(1 + d); Calculate the environmental parameter influence function E(t) = exp(k1 * ΔT + k2 * ΔH), where k1 and k2 are preset constants; Calculate the production information influence function P(t) = 1 + a * L(t) + b * C(t), where a and b are preset constants; Calculate the fast response adjustment function R(t) = max(1, min(Rmax, 1 + c * Δs / τ)), where c is a preset constant and Rmax is the preset maximum response coefficient; Obtain the dynamic weight coefficients w1, w2, and w3, which satisfy w1 + w2 + w3 = 1; Calculate the real-time sampling frequency F(t) according to the formula F(t) = Fbase * [w1 * S(d) + w2 * E(t) + w3 * P(t)] * R(t); Adjust the value of F(t) according to the constraint condition Fmin ≤ F(t) ≤ Fmax, where Fmin is the minimum sampling frequency and Fmax is the maximum sampling frequency; Output the adjusted real-time sampling frequency F(t).
[0015] Further, the present application also proposes a drug moisture detection device, which includes: An acquisition module, configured to acquire the drug production information, environmental parameter information of multiple production lines, and the moisture sensitivity index of each drug; An acquisition module, configured to calculate the real-time sampling frequency of each production line through the dynamic sampling frequency model according to the drug production information, environmental parameter information, and moisture sensitivity index; A calculation module, configured to collect moisture data through a moisture sensor network distributed on each production line according to the calculated real-time sampling frequency; A processing module, configured to perform multi-level processing on the collected moisture data, including: performing preliminary data filtering and outlier identification in an edge computing unit directly connected to the moisture sensor; performing global analysis and multi-dimensional data association in a central processing unit; A generation module, configured to generate a moisture status report based on the results of multi-level processing, where the moisture status report includes moisture content, change trend, and production environment relevance; An early warning module, configured to perform hierarchical anomaly warnings on the moisture status report according to a preset specific moisture threshold for drugs.
[0016] As can be seen from the above, a drug moisture detection method and device provided by this application adjust the data collection frequency of multiple production lines in real time through a dynamic sampling frequency model, and combine a multi-level data architecture of edge computing and central processing to achieve precise monitoring and hierarchical early warning of the moisture status during the drug production process, solving the problems of mismatched sampling resources, response delays, and lack of environmental relevance in traditional methods, and having the advantages of optimizing resource allocation, improving detection efficiency, and enhancing the predictability of anomaly warnings. Description of the Drawings
[0017] Figure 1 It is a schematic flowchart of a drug moisture detection method provided by this application.
[0018] Figure 2 It is a schematic structural diagram of a drug moisture detection device provided by this application.
[0019] In the figure: 210, an acquisition module; 220, a calculation module; 230, a collection module; 240, a processing module; 250, a generation module. Detailed Embodiments
[0020] Next, the technical solutions in this application will be clearly and completely described in conjunction with the drawings in this application. Obviously, the described embodiments are only a part of the embodiments of this application, rather than all the embodiments. The components of this application described and illustrated in the drawings here can be arranged and designed in various different configurations. Therefore, the following detailed description of the embodiments of this application provided in the drawings is not intended to limit the scope of this application that is required to be protected, but only represents the selected embodiments of this application. Based on the embodiments of this application, all other embodiments obtained by those skilled in the art without creative efforts belong to the scope of protection of this application.
[0021] It should be noted that: similar reference numerals and letters indicate similar items in the following drawings. Therefore, once an item is defined in one drawing, it does not need to be further defined and explained in subsequent drawings. At the same time, in the description of this application, terms such as "first" and "second" are only used for differential description and cannot be understood as indicating or implying relative importance.
[0022] In the traditional pharmaceutical production process, the fixed sampling frequency mechanism results in a mismatch between data acquisition efficiency and the dynamic requirements of production. The deployment mode of a single detection point cannot fully cover the complex environment of multiple production lines, causing monitoring blind spots in local areas. The centralized data processing architecture leads to data transmission delays and reduces the ability to make real-time decisions. The setting of static warning thresholds is difficult to adapt to the moisture sensitivity differences of different drugs and the fluctuations of environmental parameters, resulting in a lag in abnormal response.
[0023] In response to this, referring to Figure 1 , this application proposes a method for detecting the moisture content of drugs, which includes: S110. Obtain the drug production information, environmental parameter information of multiple production lines, and the moisture sensitivity index of each drug; S120. Calculate the real-time sampling frequency of each production line through a dynamic sampling frequency model; S130. According to the calculated real-time sampling frequency, collect moisture data through a moisture sensor network distributed on each production line; S140. Perform multi-level processing on the collected moisture data, including: performing preliminary data filtering and outlier identification in an edge computing unit directly connected to the moisture sensor; performing global analysis and multi-dimensional data association in a central processing unit; S150. Generate a moisture status report based on the results of multi-level processing, where the moisture status report includes moisture content, change trend, and production environment correlation; S160. Perform hierarchical anomaly warning on the moisture status report according to a preset specific moisture threshold for drugs.
[0024] Among them, the dynamic sampling frequency model refers to a mathematical model that calculates the sampling frequency in real time based on drug production information, environmental parameters, and moisture sensitivity index. Specifically, it can be implemented by combining a multi-parameter weighted algorithm with a response function. By dynamically adjusting the sampling frequency, the problems of resource waste or insufficient monitoring caused by fixed-frequency sampling are solved.
[0025] Among them, the moisture sensor network distributed on each production line refers to a set of distributed sensing devices deployed on different production lines. Specifically, Internet of Things technology can be used to achieve communication between nodes. Its distribution characteristics ensure coverage of multiple production lines and obtain local data, solving the problem of monitoring blind spots at a single detection point.
[0026] Specifically, moisture sampling and detection points can be set at different positions on the production line. Drugs are sampled through these detection points and then moisture detection is carried out to obtain moisture data. Such a moisture sampling and detection point serves as a node of the moisture sensor network. Then, the detected moisture data is sent to the edge computing unit. It should be noted that the moisture sensor referred to in this application is not a specific sensor, but an abstract concept. Its actual meaning is the node that detects and obtains moisture data, which can be a specific sensor or a detection site.
[0027] Among them, multi-level processing includes a hierarchical data processing architecture of an edge computing unit and a central processing unit. Specifically, an edge intelligent device can be used to perform data filtering, and a central server can perform correlation analysis. By dividing the work at different levels, data transmission delay is reduced and processing efficiency is improved.
[0028] Specifically, the edge computing unit can specifically adopt an edge intelligent device with a processor built-in with a preset algorithm to perform data filtering, and then send the filtered data to the central server. It should be noted that in the solution of this application, regarding data filtering and outlier identification of the edge computing unit, two different types of data need to be clearly distinguished. The first type is invalid data, which specifically refers to obvious error data caused by non-process factors such as sensor hardware failures, electromagnetic interference, and communication interruptions, such as a reading jump exceeding the physically possible range (for example, the humidity jumps from 40% to 90% within 1 second). The second type is abnormal state data, which specifically refers to valid data reflecting abnormal real production environments, such as a slow but continuous increase in moisture, periodic fluctuations, or mutations at specific process nodes.
[0029] The preliminary data filtering of the edge computing unit only targets invalid data. Some processing mechanisms can be set. For example, specifically, the identified invalid data can be marked and the original value can be recorded. At the same time, an estimated value is calculated for transmission instead to retain the continuity of the data. When invalid data is continuously detected a preset number of times, a sensor anomaly report is automatically triggered and sent to the central processing unit, and it is included in the traceability analysis as part of the system state anomaly. Metadata tags are attached to all transmitted data, including data credibility scores, environmental factor records, etc., to provide data quality references for the central processing unit. The edge computing unit extracts features from possible abnormal state data, such as change rate, amplitude, duration, etc., and transmits them as priority data to improve the timeliness of anomaly traceability.
[0030] Through the above mechanisms, the data filtering of the edge computing unit does not affect the efficiency of anomaly traceability, but significantly improves the accuracy and response speed of anomaly traceability by reducing invalid interference data and increasing the transmission priority of valid data.
[0031] In this application, the edge computing unit is responsible for filtering real-time moisture data and initially identifying outliers, reducing the amount of data transmitted. The central processing unit is responsible for aggregating data from multiple production lines, performing correlation analysis across process points, and trend prediction. The edge computing unit transmits the filtered data to the central processing unit according to priority, including the processed moisture data, anomaly event markers, and processing statistics of the edge unit. The edge unit provides local analysis results in the time dimension (such as moisture change rate, short-term fluctuation characteristics), and the central unit integrates global data in the space dimension (the correlation of multiple production lines and different process points). The central unit combines the environmental parameters and drug characteristics dimensions to form a complete multi-dimensional analysis. Through this collaborative mechanism, the system can achieve comprehensive multi-dimensional data correlation analysis while ensuring real-time performance, effectively solving the response delay problem of traditional centralized architectures.
[0032] Among them, the drug moisture sensitivity index is a quantitative index that reflects the sensitivity of different drugs to moisture changes. Specifically, it can be obtained by calculating parameters such as hygroscopicity and disintegration time through experiments, providing a basis for differential adjustment of dynamic sampling.
[0033] Among them, hierarchical anomaly warning refers to dividing different risk levels based on specific moisture thresholds of drugs. Specifically, it can be implemented by using a multi-threshold interval matching algorithm, improving the warning accuracy and reducing false alarms through a hierarchical response mechanism.
[0034] The core innovation of this application lies in the collaborative effect of the dynamic sampling frequency model and the distributed sensor network, combined with a multi-level data processing architecture, to achieve real-time dynamic monitoring of moisture in a multi-production line environment. At the same time, based on drug characteristic differentiation and a hierarchical warning mechanism, a closed-loop quality control system is formed.
[0035] The working process and principle of this application are as follows: First, obtain the drug production information, environmental parameter information of multiple production lines, and the drug moisture sensitivity index of each drug. These information are used as input parameters for the dynamic sampling frequency model. The dynamic sampling frequency model calculates the real-time sampling frequency of each production line based on the obtained information. The calculated real-time sampling frequency is used to guide the moisture sensor network distributed on each production line to collect moisture data.
[0036] The collected moisture data undergoes multi-level processing. The first-level processing is performed in the edge computing unit directly connected to the moisture sensor, including preliminary data filtering and outlier identification. This step can quickly eliminate significantly abnormal data and reduce the amount of data transmitted. The second-level processing is performed in the central processing unit, including global analysis and multi-dimensional data correlation. The central processing unit aggregates data from all production lines for more in-depth analysis.
[0037] Based on the results of multi-level processing, the system generates a moisture status report. The moisture status report contains moisture content, change trends, and production environment relevance. This information fully reflects the moisture status of each production line. Finally, the system performs graded abnormal warnings on the moisture status report based on the preset drug-specific moisture thresholds. Different drugs may have different moisture control requirements, so using drug-specific thresholds can improve the accuracy of warnings.
[0038] The dynamic sampling frequency model adjusts the sampling frequency according to real-time information, so that the moisture sensor network can increase the sampling density at critical moments and reduce the sampling frequency at non-critical moments, thereby optimizing resource utilization. The multi-level data processing architecture ensures the real-time data processing and realizes global data correlation analysis through the cooperation of edge computing and central processing. The generation of moisture status reports and the hierarchical early warning mechanism convert the processing results into actionable information to support production management decisions.
[0039] The introduction of a dynamic sampling frequency model enables the system to flexibly adjust sampling strategies according to production needs, improving the efficiency and pertinence of data collection. The design of a multi-level data processing architecture balances the needs of real-time and analysis depth, reducing data transmission and processing delays. The graded abnormal warning mechanism takes into account the characteristics of different drugs and improves the accuracy and timeliness of warnings.
[0040] As a preferred embodiment, the solution of the present application is specifically implemented as follows: In a pharmaceutical workshop, it is assumed that there are three parallel production lines, which are used to produce tablets, capsules and powders respectively. Each production line is equipped with 10 moisture sensors to form a distributed sensor network.
[0041] The system first obtains real-time information of each production line: the tablet production line is in the coating process, the capsule production line is in the filling stage, and the powder production line is in the drying operation. The environmental parameters show that the temperature is 25°C and the relative humidity is 60%. The moisture sensitivity index of each drug is: 0.85 for tablets, 0.70 for capsules, and 0.95 for powders.
[0042] The dynamic sampling frequency model calculates the real-time sampling frequency based on the above information. The model uses a weighted summation method to consider the influence of drug sensitivity, production stage and environmental parameters. The calculation results show that the sampling frequency of the tablet production line is once every 30 seconds, the capsule production line is once every 60 seconds, and the powder production line is once every 15 seconds.
[0043] The moisture sensor collects data at the calculated frequency. Each sensor is connected to an edge computing unit for preliminary data filtering. The edge computing unit uses a sliding window method to remove outliers that exceed 3 times the standard deviation. The filtered data is transmitted to the central processing unit.
[0044] The central processing unit receives data from all production lines and conducts global analysis. The principal component analysis method is used to identify the main factors affecting moisture changes, the time series analysis is adopted to predict the moisture change trend, and the multi-dimensional data correlation analysis is carried out to calculate the correlation between the moisture content and environmental parameters.
[0045] Based on the analysis results, the system generates a moisture status report. The report includes: the average moisture content of each production line, the change trend chart within 24 hours, and the correlation coefficient matrix between the moisture content and temperature and humidity.
[0046] Finally, the system conducts graded early warning according to the preset specific moisture thresholds for drugs. The moisture warning value for tablets is set at 3.5%, for capsules at 4.0%, and for powders at 1.5%. The system compares the current moisture content with these thresholds and combines the change trend to generate three-level early warning signals: green (normal), yellow (approaching the warning line), and red (exceeding the warning line).
[0047] Through the above solutions, this application realizes the real-time dynamic monitoring and intelligent early warning of the moisture content of multiple production lines and various drug types. The dynamic sampling frequency model enables the system to flexibly adjust the sampling strategy according to the moisture sensitivity of different drugs and the characteristics of the production stage, avoiding the inefficiency problem caused by fixed-frequency sampling. The distributed moisture sensor network covers the key nodes of the production line, overcoming the limitation that it is difficult to comprehensively monitor with a single detection point. The multi-level data processing architecture reduces the data transmission volume and improves the processing efficiency through the collaboration of edge computing and central processing, solving the data processing delay problem faced by the traditional centralized architecture. The graded early warning mechanism based on the specific moisture thresholds for drugs realizes accurate early warning for different drug types, improving the accuracy and timeliness of anomaly identification. This comprehensive solution significantly improves the accuracy and real-time performance of moisture detection in the drug production process, providing strong support for ensuring drug quality.
[0048] In some of the above solutions of this application, a dynamic sampling frequency model is proposed to calculate the real-time sampling frequency to adapt to different production line states. However, in the implementation process, due to the existence of dynamic factors such as production line load, drug type switching, and production stage changes, the fixed weight parameters will cause the model to fail to respond to the real-time changes in the production state in a timely manner. Especially when the environmental parameters fluctuate or the drug production stage changes, the static weight allocation method of the existing model is difficult to accurately reflect the sensitivity requirements of the current production environment for moisture detection, resulting in a decrease in the matching degree between the sampling frequency and the actual demand, and further affecting the detection accuracy and resource utilization efficiency.
[0049] In response to this, the present application further proposes that the steps of calculating the real-time sampling frequency of each production line through a dynamic sampling frequency model based on drug production information, environmental parameter information, and moisture sensitivity index include: obtaining real-time production line status information, where the real-time production line status information includes production line load, the type of drug currently being produced, and the production stage; based on the real-time production line status information, dynamically adjusting the weight parameters in the dynamic sampling frequency model, and the weight parameters include coefficients related to drug moisture sensitivity, production stage criticality, and environmental fluctuations; inputting the drug production information, environmental parameter information, moisture sensitivity index, and the adjusted weight parameters into the dynamic sampling frequency model; and calculating the real-time sampling frequency of each production line through the dynamic sampling frequency model.
[0050] Among them, in the process of dynamically adjusting the weight parameters, the production line load is collected in real time through a load sensor, the production stage obtains a stage identifier through a production control system, and the drug type obtains a product code through a material tracking system. The drug moisture sensitivity coefficient is set as a preset value bound to the product code, and the production stage criticality coefficient retrieves the corresponding weight value in the process database according to the stage identifier. The environmental fluctuation coefficient is dynamically corrected by calculating the deviation amplitude between the current environmental parameters and the reference value and combining the parameter change rate. For example, when the temperature fluctuation amplitude exceeds ±2°C and the change rate reaches 0.5°C / min, the environmental fluctuation coefficient is increased to 1.2 - 1.5 times the reference value.
[0051] Specifically, the real-time production line status information is continuously monitored. When a change in the drug type is detected, the system automatically triggers a weight parameter update process. The production line load data is collected through a sensor network, and the load level is divided into three intervals: low, medium, and high, corresponding to different load correction coefficients. The production stage criticality coefficient presets weights according to the process flow chart. The environmental parameter information is obtained in real time through a temperature and humidity sensor group, and its fluctuation amplitude is calculated through a moving average algorithm. When the fluctuation amplitude exceeds the preset threshold for three consecutive sampling periods, the environmental fluctuation coefficient is dynamically increased. The adjusted weight parameters and the drug moisture sensitivity index are combined through a weighted fusion algorithm, and the drug moisture sensitivity function can adopt a logarithmic function form to enhance the weight response of highly sensitive drugs. This dynamic adjustment mechanism enables the sampling frequency to complete parameter adaptation after the drug type is switched and achieve a rapid response within seconds in the event of sudden environmental fluctuations, effectively improving the matching accuracy between the sampling frequency and the actual requirements.
[0052] During specific implementation, first obtain the real-time production line status information. This includes reading the current production line load data, such as production speed, equipment operation status, etc., from the production line control system; obtaining the information on the type of drug currently being produced, including drug name, batch number, etc., from the production management system; and obtaining the current production stage information, such as mixing, granulation, drying, etc., from the process control system.
[0053] Next, based on the obtained real-time production line status information, the weight parameters in the dynamic sampling frequency model are dynamically adjusted. Specifically, through a preset mapping relationship, the production line load data is converted into a load coefficient, with a range of 0.8 - 1.2; according to the moisture sensitivity level of the drug type, a moisture sensitivity coefficient is set, with a range of 1 - 5; based on the criticality level of the production stage, a production stage criticality coefficient is determined, with a range of 1 - 3; based on the fluctuation range of the environmental monitoring data, an environmental fluctuation coefficient is calculated, with a range of 0.9 - 1.1.
[0054] Then, the drug production information (such as batch size, estimated production time, etc.), environmental parameter information (such as temperature, humidity, etc.), moisture sensitivity index, and the adjusted weight parameters are input into the dynamic sampling frequency model. This model adopts a multi-layer neural network structure. The input layer contains the above-mentioned parameters, the hidden layer uses the ReLU activation function, and the output layer is a single neuron representing the sampling frequency.
[0055] Finally, through the trained dynamic sampling frequency model, the real-time sampling frequency of each production line is calculated.
[0056] Through the above technical solution, the present application realizes the dynamic optimization of the sampling frequency. Since the weight parameters are adjusted in real time according to the production line status, the model can quickly respond to changes in the production environment. When the drug type is switched, the adjustment of the moisture sensitivity coefficient ensures the key monitoring of moisture-sensitive drugs. When entering the critical production stage, the increase in the production stage criticality coefficient guarantees an increase in the sampling density. The introduction of the environmental fluctuation coefficient enables the model to increase the sampling frequency when the environmental parameters change drastically. This multi-dimensional dynamic adjustment mechanism significantly improves the matching degree between the sampling strategy and the actual production requirements, effectively balancing the detection accuracy and resource utilization efficiency. At the same time, due to the adoption of the neural network model, the system has an adaptive learning ability and can continuously optimize the weight adjustment strategy according to historical data, further improving the accuracy and robustness of the model.
[0057] The present application further proposes that the method further includes: monitoring the production line status, and when it is detected that the production line status changes by more than a threshold relative to a preset reference value, triggering a quick response mechanism, increasing the sampling frequency of the corresponding production line to a preset maximum value, and reducing the sampling frequency after the status returns to within the threshold range; monitoring the production line status, and when it is detected that the production line status changes by more than a threshold relative to a preset reference value, triggering a quick response mechanism, increasing the sampling frequency of the corresponding production line to a preset maximum value, and the steps of reducing the sampling frequency after the status returns to within the threshold range include: obtaining the duration and amplitude of the production line status change; calculating an adjustment coefficient for the sampling frequency based on the duration and amplitude, in combination with the characteristics of the drug type currently being produced; multiplying the current sampling frequency by the adjustment coefficient to obtain the adjusted sampling frequency, and ensuring that the frequency is within the preset maximum and minimum ranges; performing moisture data collection according to the adjusted sampling frequency, and simultaneously recording the sampling frequency change curve; continuously monitoring the production line status, and when the status returns to within the threshold range, calculating a recovery coefficient based on the recorded sampling frequency change curve and the current drug production stage; multiplying the current sampling frequency by the recovery coefficient to gradually reduce the sampling frequency to a normal level suitable for the current drug production stage.
[0058] Among them, a quick response mechanism is introduced to cope with drastic changes in the production line status. When it is detected that the status parameter deviates from the preset reference value beyond the threshold, the quick response mechanism is triggered. After being triggered, the sampling frequency is immediately increased to the preset maximum value to ensure sufficient collection of moisture data during the abnormal status period. The status parameter may include but is not limited to parameters such as temperature, humidity, pressure, or production speed that can reflect the operating status of the production line. The preset reference value and the threshold are determined based on historical production data, drug characteristics, and process requirements. For example, for temperature-sensitive drugs, the temperature threshold can be set to ±2°C. The maximum value of the sampling frequency is set according to sensor performance, data processing capabilities, and real-time requirements.
[0059] During the status recovery stage, the process of reducing the sampling frequency is finely controlled. The system does not immediately reduce the sampling frequency to the original level but first obtains the duration and amplitude of the status change. The duration can be recorded by a timer, and the amplitude can be obtained by comparing the deviation of the status parameter from the reference value. The calculation of the adjustment coefficient comprehensively considers the duration, amplitude, and the characteristics of the drug type currently being produced. The characteristics of the drug type, such as moisture sensitivity, determine the calculation model and parameters of the adjustment coefficient. The adjustment coefficient is used to multiply the current sampling frequency to obtain the adjusted sampling frequency. The adjusted sampling frequency needs to be limited within the preset maximum and minimum ranges to prevent the frequency from being too high or too low.
[0060] While collecting moisture data, the sampling frequency change curve is recorded. This curve records the trajectory of the sampling frequency over time, providing a data basis for the subsequent frequency reduction during state recovery. The determination of state recovery is based on the real-time data of the production line status monitoring unit. When the state parameters return to within the threshold range, the state recovery process is initiated. The recovery coefficient is calculated based on the recorded sampling frequency change curve and the current pharmaceutical production stage. The sampling frequency change curve reflects the impact of previous state changes on the sampling frequency, and the pharmaceutical production stage determines the moisture control requirements for the current stage. The recovery coefficient is used to multiply the current sampling frequency to achieve a gradual reduction in the sampling frequency. The gradual reduction avoids data mutations or system instability problems that may be introduced by a sudden drop in frequency. Finally, the sampling frequency is smoothly reduced to a normal level suitable for the current pharmaceutical production stage. The normal level is determined based on the pharmaceutical production process regulations and historical data.
[0061] Specifically, to address the problem of sampling frequency response lag when the production line state mutates, this solution introduces a fast response mechanism and a refined state recovery mechanism. Under normal production conditions, the system collects moisture data at the real-time sampling frequency calculated according to the dynamic sampling frequency model. When the production line status monitoring module detects significant fluctuations in key state parameters, such as the temperature in the production workshop, for example, when the temperature sensor detects that the temperature has risen by more than the preset threshold within a short period, the fast response mechanism is triggered. The system immediately increases the sampling frequency of the moisture sensor from the normal frequency, such as sampling once per minute, to the preset maximum value, such as sampling once per second. High-frequency sampling ensures that during abnormal temperature fluctuations, the system can collect moisture data more densely and capture possible moisture anomalies.
[0062] During the state recovery stage, when the temperature drops back to within the normal threshold range, the system does not immediately return to low-frequency sampling. Instead, it calculates the recovery coefficient based on the duration of the temperature anomaly and the magnitude of the temperature change. For example, if the high temperature has lasted for ten minutes, the temperature has risen by 5°C, and the current production is a pharmaceutical product that is sensitive to moisture, the recovery coefficient will be set to a relatively small value, such as 0.8. The current sampling frequency is multiplied by 0.8 to obtain a new sampling frequency, such as reducing from once per second to once every 1.25 seconds. The system will gradually adjust the recovery coefficient, for example, slightly increasing the recovery coefficient every once in a while, so that the sampling frequency decreases slowly. At the same time, the system refers to the recorded sampling frequency change curve to ensure the smoothness of the frequency reduction process. Finally, when the production line state is completely stable and the pharmaceutical production enters a stage with low moisture requirements, the sampling frequency will gradually decrease to a normal level suitable for the current production stage, such as returning to sampling once per minute. Through this fast response and slow recovery mechanism, the system not only ensures the data collection density under abnormal conditions but also avoids unnecessary data redundancy and resource waste after state recovery, optimizing the efficiency and accuracy of moisture detection.
[0063] In some of the above solutions of the present application, a technical means of adapting to changes in the production line state by dynamically adjusting the weight parameters in the dynamic sampling frequency model is proposed. However, when the real-time production line state fluctuates violently, the synchronous adjustment of multiple weight parameters may cause response delays or parameter conflicts, resulting in unstable model output. Especially when there are complex time-varying relationships among the drug moisture sensitivity coefficient, the production stage criticality coefficient, and the environmental fluctuation coefficient, the existing methods are difficult to effectively coordinate the priorities and timing logics of different parameter adjustments, which may cause delays in the adjustment of key parameters and affect the timeliness and accuracy of sampling frequency calculation.
[0064] In response to this, the present application further proposes steps for dynamically adjusting the weight parameters in the dynamic sampling frequency model based on real-time production line state information, including: obtaining historical weight parameter adjustment records within a preset time window, where the historical weight parameter adjustment records include the adjustment histories of the drug moisture sensitivity coefficient, the production stage criticality coefficient, and the environmental fluctuation coefficient; calculating the response time of each weight parameter to changes in the production line state based on the historical weight parameter adjustment records; establishing a weight parameter adjustment priority queue according to the response time, and placing the parameters with shorter response times at the front of the queue; when it is detected that the real-time production line state information changes by more than a preset threshold, calculating and updating each weight parameter in sequence according to the order of the priority queue; applying the updated weight parameters to the dynamic sampling frequency model and recording the results of this parameter adjustment.
[0065] Among them, the preset time window can be set to 5 - 15 minutes to ensure the timeliness and integrity of historical data. The response time is obtained by calculating the average value of the time difference from the occurrence of the state change to the completion of parameter adjustment in the parameter adjustment record. Specifically, a sliding window algorithm is used to calculate the moving average response time during implementation. During the construction of the priority queue, the response time threshold can be set to 30 seconds, and the parameters shorter than this threshold are automatically assigned to the first 30% of the queue. The parameter update order is designed as a serial execution mode, and a buffer period of 3 - 5 milliseconds needs to be waited after each parameter update is completed before calculating the next parameter. When recording the results of parameter adjustment, a timestamp marking mechanism is adopted, and the parameter values before and after adjustment, the queue position, and the response time data are stored in a circular buffer.
[0066] Specifically, when the production line undergoes out-of-threshold state changes such as a sudden increase in temperature or a sudden drop in humidity, the historical weight parameter adjustment records are first obtained. This record contains the time series data of the coefficient adjustments within the most recent 10 minutes. For example, by analyzing the time intervals from the state change to the completion of adjustment for each parameter in the historical data, the average response time of the environmental fluctuation coefficient is calculated to be 28 seconds, the criticality coefficient during the production stage is 35 seconds, and the drug moisture sensitivity coefficient is 42 seconds. Based on this response time sorting, the environmental fluctuation coefficient is preferentially placed at the front of the queue. During the parameter update stage, the environmental fluctuation coefficient is first calculated and updated, and its adjustment result is immediately written into the dynamic sampling frequency model. Subsequently, the criticality coefficient during the production stage and the drug moisture sensitivity coefficient are updated in sequence. After each parameter update, the adjustment time, parameter value, and model output result are recorded in the database, forming a closed-loop feedback mechanism. This process effectively avoids the computational resource competition during multi-parameter synchronous updates. Through the priority sorting quantified by the response time, the parameters most sensitive to the state changes of the production line are given the priority to be processed. At the same time, the serial update mechanism reduces the probability of parameter conflicts. The parameter adjustment trajectory formed by the records provides data support for the subsequent response time calculation, enabling the priority queue to dynamically adapt to the evolution of the production line operating state.
[0067] As a preferred embodiment, the solution of the present application is specifically implemented as follows: Obtain the historical weight parameter adjustment records within a preset time window. The historical weight parameter adjustment records include the adjustment histories of the drug moisture sensitivity coefficient, the criticality coefficient during the production stage, and the environmental fluctuation coefficient. The time window is set to 30 days, and the record contains the timestamp of each adjustment, the parameter values before and after the adjustment, and the production line state information triggering the adjustment.
[0068] Based on the historical weight parameter adjustment records, calculate the response time of each weight parameter to the state changes of the production line. Using the time series analysis method, perform autocorrelation analysis on the adjustment sequence of each parameter to extract the periodic characteristics of the parameter changes. Through cross-correlation analysis, calculate the time delay between the parameter adjustment and the production line state change. Finally, the average response time of the drug moisture sensitivity coefficient is 10 seconds, the criticality coefficient during the production stage is 5 seconds, and the environmental fluctuation coefficient is 15 seconds.
[0069] According to the response time, establish a priority queue for weight parameter adjustment, and place the parameters with shorter response times at the front of the queue. The queue is sorted from the shortest to the longest response time, i.e., the criticality coefficient during the production stage, the drug moisture sensitivity coefficient, and the environmental fluctuation coefficient. The queue is implemented using a linked list structure for easy dynamic adjustment of priorities.
[0070] When it is detected that the real-time production line status information has changed by more than a preset threshold, the weight parameters are calculated and updated in turn according to the order of the priority queue. The preset threshold is set such that the production line load changes by more than 20% or the temperature and humidity change by more than 10%. The update process adopts an incremental adjustment method, with each adjustment amplitude not exceeding 5% of the current value of the parameter to avoid drastic fluctuations in the parameter.
[0071] Apply the updated weight parameters to the dynamic sampling frequency model and record the results of this parameter adjustment. The adjustment result record includes the adjustment time, the parameter values before and after adjustment, the production line status information that triggered the adjustment, and the change in the sampling frequency after adjustment. These records will be used as new historical data for subsequent calculation of the parameter response time and priority adjustment.
[0072] Through the above technical solutions, the present application realizes the dynamic optimization and adjustment of the weight parameters. A parameter response characteristic analysis mechanism based on historical data is established to objectively reflect the adjustment efficiency of different parameters during state changes. The priority queue mechanism is introduced to transform the physical characteristics of the parameters into calculation logic, effectively solving the resource competition problem of multi-parameter adjustment. The incremental adjustment strategy is adopted to avoid drastic fluctuations in the parameters and ensure the stability of the model output. This method not only ensures the immediate adjustment of key parameters but also avoids the computational load impact of synchronous updates, fundamentally solving the timing conflict problem of multi-parameter collaborative adjustment and improving the timeliness and accuracy of sampling frequency calculation.
[0073] In some of the above solutions of the present application, when calculating the recovery coefficient based on the sampling frequency change curve and the current production stage to gradually reduce the sampling frequency during the recovery of the production line state, there are problems such as a single dimension for state recovery evaluation, lack of dynamic adaptability in the calculation of the recovery coefficient, and failure to precisely adjust in combination with the characteristics of the pharmaceutical production stage, resulting in possible lag responses or over-adjustments during the sampling frequency recovery process, affecting the balance between moisture detection efficiency and quality control.
[0074] In response to this, the present application further proposes continuously monitoring the production line status. When the status returns to within the threshold range, the steps for calculating the recovery coefficient based on the recorded sampling frequency change curve and the current pharmaceutical production stage include: obtaining the production line parameters at the time of status recovery, including temperature, humidity, pressure, and production speed; based on the production line parameters, retrieving the standard parameter range of the current pharmaceutical production stage from a pre-established production stage database, and the database also contains the moisture sensitivity index of different types of drugs at each production stage; calculating the deviation degree between the current production line parameters and the standard parameter range, and generating a status recovery score in combination with the moisture sensitivity index of the current drug; calculating an initial recovery coefficient according to the status recovery score and the recorded sampling frequency change curve; and correcting the initial recovery coefficient based on the specific moisture control requirements of the current pharmaceutical production stage to obtain the final recovery coefficient.
[0075] Among them, the acquisition of production line parameters includes using an infrared sensor array for temperature monitoring, a capacitive sensor for humidity monitoring, collecting pressure data through a distributed pressure transmitter, and measuring the production speed in real time through an encoder. The production stage database adopts a time-series relational data structure. The stored temperature standard ranges for different drugs in the granulation stage, drying stage, and coating stage are 25 - 30 °C, 35 - 40 °C, and 28 - 32 °C respectively, and the humidity standard ranges are 40 - 50%, 15 - 25%, and 30 - 40% respectively. The Euclidean distance algorithm is used to calculate the deviation degree, and a weight factor is set in combination with the moisture sensitivity index. For example, when the sensitivity index exceeds 8, the deviation weight is increased to 1.5 times. The state recovery score is converted into the range of 0 - 100 points through normalization processing, and when the score is lower than 60 points, a secondary verification mechanism is triggered. The initial recovery coefficient adopts an exponential decay model, and the decay rate is fitted according to the score and the historical curve. For example, when the score is 80 points, the decay coefficient is set to 0.85. The correction of the final recovery coefficient introduces stage characteristic parameters. For example, the correction factor for the drying stage is 1.2, and for the coating stage is 0.8.
[0076] Specifically, during the production line state recovery process, an environmental recovery evaluation benchmark is established through multi-dimensional parameter acquisition of temperature, humidity, pressure, and production speed to eliminate the limitations of single-parameter evaluation. Through real-time retrieval of the production stage database, the current parameters are dynamically matched with the standard ranges of drug types and process stages. For example, the humidity standard for a certain tablet coating stage is 30 - 40%, and when the actual humidity recovers to 35%, it is determined as an effective recovery. The weighted calculation of the deviation degree dynamically adjusts the tolerance range through the moisture sensitivity index. For example, the allowable humidity deviation for highly sensitive freeze-dried injections in the drying stage is reduced to ±2%. The joint analysis of the state recovery score and the sampling frequency change curve can identify the stability of the recovery trend. For example, when the curve volatility is lower than 5%, a fast decay strategy is adopted. The product operation of the initial recovery coefficient and the production stage correction factor realizes dual regulation. For example, in the drying stage, the initial coefficient of 0.9 is corrected by 1.2 times to obtain a final coefficient of 1.08, accelerating the recovery of the sampling frequency. This process effectively balances the detection efficiency and quality control requirements through multi-dimensional monitoring of environmental parameters, dynamic matching of drug characteristics, and hierarchical correction of stage characteristics, avoiding monitoring loopholes or resource waste caused by premature or delayed recovery in traditional methods.
[0077] As a preferred embodiment, the solution of the present application is specifically implemented as follows: When the state of the drug production line returns to within the threshold range, the real-time parameter data of the production line is first obtained. These parameters include temperature (accurate to 0.1 °C), relative humidity (accurate to 1%), pressure (accurate to 0.01 MPa), and production speed (accurate to 1 piece / minute). For example, the parameters obtained at a certain moment are: temperature 25.3 °C, relative humidity 45%, pressure 0.1 MPa, and production speed 60 pieces / minute.
[0078] Next, the system accesses the pre-established production stage database. This database stores the standard parameter ranges and moisture sensitivity indices for different types of drugs at each production stage. For example, for a certain type of tablet being produced, the standard parameter range for its coating stage is: temperature 24 - 26 °C, relative humidity 40 - 50%, pressure 0.09 - 0.11 MPa, production speed 55 - 65 pieces / minute; the moisture sensitivity index is 0.8 (range 0 - 1).
[0079] The system calculates the deviation degree between the current parameters and the standard range. The specific method is to calculate the percentage position of each parameter within the standard range and then take the average. In this example, the deviation percentages of temperature, humidity, pressure, and speed are 65%, 50%, 50%, and 50% respectively, and the average deviation is 53.75%. Multiply this deviation by the moisture sensitivity index of 0.8 to obtain a state recovery score of 0.43 (range 0 - 1).
[0080] Based on the state recovery score and the previously recorded sampling frequency change curve, the system calculates the initial recovery coefficient. Assume that the current sampling frequency is 10 times per minute and the normal frequency is 2 times per minute. The system uses the exponential decay function: initial recovery coefficient = exp(-k * score), where k is a preset constant, for example, k = 2. Substitute the values to get the initial recovery coefficient approximately 0.42.
[0081] Finally, the system corrects the initial recovery coefficient according to the specific moisture control requirements of the current drug production stage. For example, in the coating stage, it is required that the moisture changes slowly, and the system multiplies the initial recovery coefficient by 0.9 to obtain the final recovery coefficient of 0.378. This means that the sampling frequency will be reduced from 10 times per minute to approximately 3.78 times per minute.
[0082] Through the above technical solution, the present application realizes the precise recovery control of the sampling frequency. By constructing a multi-dimensional state recovery evaluation system, the system can comprehensively evaluate the degree of state recovery of the production line, avoiding the one-sidedness caused by single-parameter evaluation. The dynamic correction mechanism ensures that the recovery coefficient highly conforms to the current drug characteristics and production stage requirements, preventing lag response or over-adjustment during the sampling frequency adjustment process. This refined control strategy effectively balances the requirements of moisture detection efficiency and quality control, improving the stability and reliability of the overall production process.
[0083] In some of the above - mentioned solutions of this application, when dynamically adjusting the weight parameters, due to the complex time - varying correlation between parameters, traditional single - time - dimension analysis is difficult to accurately capture the dynamic dependence between parameters, resulting in the construction of the priority queue lacking consideration of the synergistic effect between parameters and the influence of multiple time scales, and causing the problem that the matching degree between the parameter adjustment order and the real - time production status is insufficient.
[0084] To this end, this application further proposes to construct a multi - time - scale data matrix, which includes real - time monitoring data, minute - level aggregated data, and hourly - level trend data; extract the eigenvectors of each weight parameter in the data matrix at different time scales; calculate the dynamic time - varying correlation coefficient matrix between the weight parameters; transform the dynamic time - varying correlation coefficient matrix into a parameter dependence graph; identify highly correlated parameter clusters in the parameter dependence graph; calculate the comprehensive response time of each weight parameter according to the degree of mutual influence within the parameter cluster; construct a priority queue based on the comprehensive response time, and place the parameter with a short response time at the front of the queue.
[0085] Among them, when constructing the multi - time - scale data matrix, the real - time monitoring data acquisition frequency is set to 5 times per second, the minute - level data is generated by moving average processing with a sliding window, the window length is set to 60 seconds, and the hourly - level data is calculated using the exponentially weighted moving average algorithm. The eigenvector extraction uses the wavelet transform method, extracting high - frequency component features for real - time data and low - frequency trend features for hourly - level data. The dynamic time - varying correlation coefficient matrix is calculated through a sliding time window, the window length is set to 10 minutes, the step size is set to 1 minute, and the correlation coefficient threshold is set to 0.85 for determining highly correlated parameter clusters.
[0086] The construction of the parameter dependence graph uses the adjacency matrix representation method in graph theory, and the edge weight is determined by the correlation coefficient value. The parameter cluster identification uses the spectral clustering algorithm, and the number of clusters is dynamically adjusted according to the production stage. For example, it is set to 3 groups in the drug drying stage and 5 groups in the mixing stage. The comprehensive response time is calculated using the weighted average method, and the weight distribution is that the real - time data influence factor accounts for 60%, the hourly - level trend factor accounts for 30%, and the interaction factor within the parameter cluster accounts for 10%.
[0087] Specifically, the real - time monitoring data is collected through a sensor network distributed on the production line, the sampling interval is set to 200 milliseconds, forming an original data stream with time - stamp alignment. The minute - level aggregated data uses the piecewise linear interpolation method to process missing values, and the hourly - level trend data is generated by fitting a continuous curve using a cubic spline function. During the eigenvector extraction process, the fast Fourier transform is applied to the real - time data to extract spectral features, and the autoregressive coefficient is calculated for the minute - level data to describe the short - term dynamic characteristics.
[0088] The calculation of the dynamic time-varying correlation coefficient matrix can adopt an improved Pearson correlation coefficient algorithm, introducing a forgetting factor λ = 0.95 to achieve exponential decay weighting of historical data. After the parameter dependency graph is transformed into a weighted undirected graph, a community discovery algorithm is applied to identify parameter clusters. It is found that, for example, in the drug coating stage, the environmental temperature parameter and the production line speed parameter form a strong correlation cluster with a correlation coefficient of 0.91. When calculating the comprehensive response time, a 1.2-fold impact weight factor is applied to the parameters within the cluster, and the basic response time is retained for independent parameters.
[0089] When the production line load mutation exceeds 15%, by updating the correlation coefficient matrix in real time, the parameter dependency graph can be regenerated within 30 seconds. During the construction of the priority queue, a production stage correction coefficient is introduced in the response time calculation. For example, in the high-temperature drying stage, the response time of the environmental humidity parameter is shortened by 20%. The update frequency of the finally generated priority queue is set to be refreshed once per minute to ensure that the parameter adjustment order is synchronized with the current production status.
[0090] As a preferred embodiment, the solution of the present application is specifically implemented as follows: When constructing the multi-time scale data matrix, real-time monitoring data, 5-minute aggregated data, and 1-hour trend data are selected. The acquisition frequency of the real-time monitoring data is 1 second / time. The 5-minute data is obtained by calculating the mean value of the real-time data, and the 1-hour data is further aggregated based on the 5-minute data. The data matrix contains environmental parameters such as temperature, humidity, pressure, production speed, etc., and historical values of each weight parameter.
[0091] When extracting feature vectors, wavelet transform is applied to the real-time data to extract high-frequency features, Fourier transform is performed on the 5-minute data to obtain medium-frequency features, and principal component analysis is executed on the 1-hour data to extract low-frequency features. These feature vectors are combined to form a multi-scale feature representation of each weight parameter.
[0092] The sliding window method is used to calculate the dynamic time-varying correlation coefficient matrix. The window size is set to 1 hour, and the step size is 5 minutes. Within each window, the Pearson correlation coefficient between weight parameters is calculated to obtain an n×n correlation coefficient matrix, where n is the number of weight parameters.
[0093] When converting the correlation coefficient matrix into a parameter dependency graph, the correlation coefficient threshold is set to 0.7. When the absolute value of the correlation coefficient between two parameters is greater than 0.7, the two parameter nodes are connected in the graph, and the thickness of the connection line represents the correlation strength.
[0094] The spectral clustering algorithm is used to identify highly correlated parameter clusters. First, the Laplacian matrix of the graph is constructed, and then its eigenvalues and eigenvectors are calculated. The eigenvectors corresponding to the k smallest non-zero eigenvalues are selected, where the k value is determined by the silhouette coefficient method. Finally, these k eigenvectors are clustered using K-means to obtain parameter clusters.
[0095] When calculating the comprehensive response time, the average correlation coefficient between parameters in each parameter cluster is first calculated as the intra-cluster influence strength. Then the average correlation coefficient of each parameter in its cluster is multiplied by the size of the cluster (number of parameters) to obtain the parameter's intra-cluster influence score. Finally, the independent response time of the parameter (obtained through autocorrelation analysis) and its intra-cluster influence score are weighted averaged to obtain the comprehensive response time.
[0096] The priority queue is constructed using a heap sort algorithm, with the inverse of the comprehensive response time as the priority value. The head of the queue corresponds to the parameter with the shortest response time, and the tail corresponds to the parameter with the longest response time. When the weight parameter needs to be adjusted, it is processed one by one in the queue order.
[0097] Through the above technical scheme, the present application realizes the precise quantification of the dynamic dependency of weight parameters, and improves the pertinence and timeliness of parameter adjustment. The construction of multi-time scale data matrix captures the comprehensive information of parameter changes, and the eigenvector extraction separates the parameter behavior patterns at different frequencies. The dynamic time-varying correlation coefficient matrix reflects the changes in the real-time correlation strength between parameters, and the parameter dependency diagram intuitively displays the complex parameter interaction network. The identification of highly correlated parameter clusters reveals the law of coordinated changes in parameter groups, and the calculation of the comprehensive response time takes into account the independent characteristics and group effects of the parameters. The priority queue constructed based on this ensures that the parameters that are most sensitive to changes in system status are adjusted first, thereby improving the adaptability and response speed of the entire dynamic sampling frequency model to changes in the production environment.
[0098] In some of the above-mentioned schemes in the present application, the problem of deviation in the comprehensive response time evaluation stems from the failure to effectively quantify the dynamic time-varying correlation strength and direction of action between parameters, and the failure to consider the periodicity and trend factors in the parameter change pattern, resulting in insufficient timing accuracy of weight parameter adjustment.
[0099] In this regard, the present application further proposes a technical solution for constructing a parameter influence matrix to represent the intensity and direction of influence between parameters, performing matrix eigenvalue decomposition to obtain the main influence mode, calculating the contribution of the parameters in the main mode, constructing an initial estimate of the response time based on the contribution and the mode eigenvalue, applying time series analysis methods to identify periodicity and trend, and combining the two to correct the initial estimate to generate a comprehensive response time.
[0100] Among them, the parameter influence matrix is realized by a normalized correlation coefficient matrix. The value range of matrix elements is set to [-1, 1]. A positive value indicates a positive influence, a negative value indicates a negative influence, and the absolute value reflects the influence intensity. The eigenvalue decomposition adopts the singular value decomposition algorithm. When the matrix dimension exceeds 50×50, the Lanczos iteration method is preferably used to reduce the computational complexity. The contribution degree calculation is realized by extracting the sum of the squares of the eigenvector load coefficients. For example, in three main modes, the load coefficients of a certain parameter are 0.8, -0.3, and 0.1 respectively, and its contribution degree is 0.8² + (-0.3)² + 0.1² = 0.74. The time series analysis uses Fourier transform to extract periodic components, combines wavelet analysis to detect trend fluctuations, and controls the correction amplitude of the initial estimated value within the range of ±30%, which is specifically realized by the weighting coefficient α ∈ [0.7, 1.3]. When synergistically interacting with the topological structure of the parameter dependence graph, when there are more than 5 highly correlated parameters in the parameter cluster, the periodic correction weight automatically increases by 15%.
[0101] Specifically, by constructing a parameter influence matrix, the multi-dimensional parameter relationship is transformed into a quantifiable numerical matrix. For example, the correlation coefficient between the temperature parameter and the humidity parameter is quantified as 0.65, and it has a negative correlation of -0.4 with the pressure parameter. After performing matrix eigenvalue decomposition, the first three main modes can explain more than 85% of the system variance. For example, in a pharmaceutical production line, the first mode dominated by environmental parameters and the second mode dominated by equipment status parameters are detected. When calculating the contribution degree, the load coefficient of the humidity parameter in the first mode reaches 0.92, and its contribution degree accounts for more than 50%. In the initial estimated value construction stage, the logarithmic conversion value of the mode eigenvalue and the contribution degree are linearly weighted. For example, for the first mode eigenvalue λ1 = 3.2 and the humidity parameter contribution degree 0.5, its initial estimated component is calculated as log(3.2) × 0.5 ≈ 1.16. In the time series analysis stage, it is detected that the environmental parameters have a fluctuation characteristic with a period of 8 hours, and the equipment status parameters show a linear drift trend of 0.2% per hour. Based on this, the initial estimated value is corrected in the time domain. The average error between the finally generated comprehensive response time and the measured value is reduced from 23% before improvement to 7.5%. At key production nodes such as batch switching, the timing accuracy of parameter adjustment is improved by more than 40%, effectively solving the evaluation deviation problem caused by ignoring dynamic correlations and time-varying characteristics in the original solution.
[0102] As a preferred embodiment, the solution of the present application is specifically implemented as follows: Construct a parameter influence matrix, and the matrix elements represent the influence intensity and direction between parameters. Specifically, first define n weight parameters and construct an n×n matrix M. The matrix element M[i][j] represents the influence of parameter i on parameter j, and its value range is [-1, 1]. A positive value indicates a positive correlation, a negative value indicates a negative correlation, and the absolute value represents the influence intensity.
[0103] Perform matrix eigenvalue decomposition to obtain the main patterns affected by parameters. Use the Singular Value Decomposition (SVD) method to decompose matrix M, getting M = UΣV^T, where Σ is a diagonal matrix, and the diagonal elements σ1 ≥ σ2 ≥... ≥ σn are eigenvalues. Select the eigenvectors corresponding to the top k largest eigenvalues as the main patterns.
[0104] Calculate the contribution degree of each parameter in the main patterns. For the i-th main pattern vi, calculate the contribution degree cij of each parameter j as cij = |vij| / Σ|vij|, where vij is the j-th element in vi.
[0105] Based on the contribution degree and pattern eigenvalues, construct an initial estimate of the parameter response time. For parameter j, its initial response time estimate is tj = Σ(σi * cij) / Σσi, where σi is the eigenvalue of the i-th main pattern.
[0106] Apply time series analysis methods to identify the periodicity and trend of parameter changes. Perform a Fast Fourier Transform (FFT) on the historical data of each parameter to identify the main frequency components as periodic features. Use the exponential smoothing method to fit the long-term trend.
[0107] Combine the periodic and trend information to correct the initial estimate and generate the comprehensive response time for each weight parameter. Set the periodic correction factor fp and the trend correction factor ft, and the final response time T = tj * fp * ft. Where fp is proportional to the identified period length, and ft is proportional to the absolute value of the trend slope.
[0108] Through the above technical solutions, this application achieves the precise quantification of the response time of weight parameters. By constructing a parameter influence matrix, the complex interaction relationships between parameters are captured. Matrix eigenvalue decomposition extracts the main change patterns of the system, avoiding the interference of secondary factors. The contribution degree calculation objectively reflects the importance of each parameter in the system dynamics. Time series analysis methods identify the periodic and trend characteristics of parameter changes, making the response time estimate more in line with the dynamic changes of the actual production process. Considering both the spatial correlation and the time evolution law between parameters, it improves the timing accuracy of weight parameter adjustment and provides a reliable basis for establishing a scientific priority queue.
[0109] In some of the above solutions of this application, there are problems of insufficient integration of multi-dimensional data and insufficient accuracy in environmental correlation analysis. Traditional methods cannot effectively establish the relationship between moisture parameters and production process nodes, resulting in the generated moisture status report lacking targeted guidance.
[0110] In response to this, the present application further proposes to construct a multi-dimensional data model, map the moisture content data, production environment parameters, and drug characteristic information to the feature space of the multi-dimensional data model; perform dimensionality reduction analysis to extract the influencing factors of the moisture state; based on the influencing factors, calculate the time-varying correlation coefficient between the moisture content and the environmental parameters, and separate the trend, periodic, and random components of the moisture content; according to the decomposition results, fit the moisture change trend curve; based on the time-varying correlation coefficient and the change trend curve, construct a moisture-environment causal network diagram; match the moisture-environment causal network diagram with the drug production process flow diagram, identify the moisture-sensitive areas of the process nodes, and generate a moisture state report.
[0111] Among them, the dimension of the feature space of the multi-dimensional data model is set to 8-12 dimensions, and more than 30 parameters of the original data are reduced to the core influencing factors through principal component analysis. The variance contribution rate of the feature space after dimensionality reduction needs to reach more than 85% to ensure that key information is not lost. The calculation of the time-varying correlation coefficient adopts the sliding window method, the window length is set to the production cycle data of 5-15 minutes, and the update frequency of the correlation coefficient matrix is adjusted synchronously with the production line speed. The trend component decomposition is realized by the empirical mode decomposition algorithm, and the number of intrinsic mode functions is controlled within 3-5 to balance the calculation efficiency and decomposition accuracy. The edge weights of the causal network diagram are calculated by combining Granger causality test and mutual information, and the significance level is set in the range of 0.01-0.05. The process flow diagram matching is realized by the topological structure similarity algorithm.
[0112] Specifically, the real-time data collected by the moisture sensor is first standardized and processed, and jointly input into the multi-dimensional data model together with the environmental parameters of the historical production batches and the hygroscopicity index of the current drug. In the feature space, the temperature gradient data and the drug porosity parameters are mapped into a three-dimensional vector cluster, and the humidity fluctuation data and the material fluidity index form a correlation matrix. Through kernel principal component analysis, the high-dimensional features are projected onto a two-dimensional plane to identify the environmental fluctuations in the vacuum drying stage as the main influencing factors. The dynamic correlation coefficient calculation module is updated every 8 seconds. When the correlation coefficient between the inlet air humidity and the tablet core moisture content in the coating process exceeds 0.7, the trend decomposition and recombination mechanism is triggered. The decomposed trend curve is processed by cubic spline interpolation and phase comparison with the autoclave temperature curve to construct a causal network with time delay compensation. This network diagram performs feature matching with the process flow diagram through a graph neural network, and identifies the moisture-sensitive area at the atomization pressure node of the fluid bed granulation process. The final report generation module labels the causal path between the punch die temperature of the tablet press and the residual moisture of the granules as a critical control point to guide the operator to adjust the preheating parameters. By mapping the data features to specific equipment nodes, a quantitative relationship is established between the exhaust valve opening of the drying oven and the specific surface area parameter of the material, realizing the closed-loop control of quality traceability and process optimization.
[0113] It should be noted that this application adopts a data analysis strategy that gives priority to real-time data and uses historical data as an auxiliary. Water content data and environmental parameters are collected in real time through a sensor network. Historical data is mainly used to establish a reference baseline and optimize the analysis model. A time-weighted mechanism is adopted, with the weight of real-time data being 0.7 - 0.9 and the weight of historical data being 0.1 - 0.3.
[0114] This combined mechanism ensures that the system maintains a high sensitivity to current environmental changes, while using historical experience to improve the accuracy of analysis, achieving real-time monitoring and accurate prediction of changes in the production environment.
[0115] As a preferred embodiment, the solution of this application is specifically implemented as follows: When constructing a multi-dimensional data model, the principal component analysis method is used to map the water content data, temperature and humidity environmental parameters, and the porosity and hydrophilic coefficient characteristic information of the drug into a three-dimensional feature space. The sampling interval of environmental parameters is set to 5 seconds, and the drug characteristic data is uploaded in real time through a physical property detector. When performing dimensionality reduction analysis, the t-SNE algorithm is applied to compress the original 12-dimensional data into 3 core influencing factors, retaining the dimensions with a variance contribution rate exceeding 85%. When calculating the time-varying correlation coefficient, a sliding window mechanism is adopted, and the dynamic Pearson coefficient between the water content and temperature parameters is calculated with a 30-minute time window length. At the same time, the STL decomposition method is used to decompose the water content sequence into a trend term, a periodic term, and a residual term. When fitting the water content change trend curve, the cubic spline interpolation method is used to generate a continuously differentiable curve function. When constructing a causal network diagram, the causal relationship strength between environmental parameters and water content indicators is determined through Bayesian network structure learning, and the confidence threshold is set to 0.95. When matching the causal network diagram with the process flow diagram, based on the key frame matching algorithm, the spatial correspondence relationship between the impeller speed parameter node of the mixing process and the water-sensitive area is identified, and finally a water content status report containing a gradient-colored process node diagram is generated.
[0116] Through the above technical solutions, this application realizes the feature space fusion of multi-source heterogeneous data, eliminates the information island phenomenon between data dimensions; effectively eliminates high-frequency noise interference in environmental monitoring through dynamic dimensionality reduction, and improves the identification accuracy of core factors; uses time-varying correlation analysis to capture the non-linear influence law of the temperature lag effect on water content in the drying process; the construction of the causal network diagram breaks through the limitations of traditional linear regression models and reveals the coupling mechanism between humidity mutation and water migration in the coating stage; the process node matching technology converts the data analysis results into control parameters of specific equipment, guiding the adjustment of the fluidized bed inlet valve opening to optimize the uniformity of water distribution.
[0117] The steps for further calculating the real-time sampling frequency of each production line by the dynamic sampling frequency model according to the drug production information, environmental parameter information, and moisture sensitivity index of the present application include: obtaining the basic sampling frequency Fbase, the drug moisture sensitivity index d, the environmental parameter changes ΔT and ΔH, the production line load L(t), the criticality index C(t) of the production stage, the state change amplitude Δs, and the duration τ; calculating the drug moisture sensitivity function S(d) = 1 + log(1 + d); calculating the environmental parameter influence function E(t) = exp(k1 * ΔT + k2 * ΔH), where k1 and k2 are preset constants; calculating the production information influence function P(t) = 1 + a * L(t) + b * C(t), where a and b are preset constants; calculating the fast response adjustment function R(t) = max(1, min(Rmax, 1 + c * Δs / τ)), where c is a preset constant and Rmax is the preset maximum response coefficient; obtaining the dynamic weight coefficients w1, w2, and w3, which satisfy w1 + w2 + w3 = 1; calculating the real-time sampling frequency F(t) according to the formula F(t) = Fbase * [w1 * S(d) + w2 * E(t) + w3 * P(t)] * R(t); adjusting the value of F(t) according to the constraint condition Fmin ≤ F(t) ≤ Fmax, where Fmin is the minimum sampling frequency and Fmax is the maximum sampling frequency; and outputting the adjusted real-time sampling frequency F(t).
[0118] Among them, the input parameters include the basic sampling frequency Fbase, the drug moisture sensitivity index d, the environmental parameter changes ΔT and ΔH, the production line load L(t), the criticality index C(t) of the production stage, the state change amplitude Δs, and the duration τ, and these parameters are obtained from sensors and system configurations. The functions S(d), E(t), P(t), and R(t) are used to quantify the influence of different factors on the sampling frequency, and these functions are calculated using the input parameters and preset constants. For example, S(d) increases with the increase of d, E(t) increases with the increase of ΔT and ΔH, P(t) increases with the increase of L(t) and C(t), and R(t) increases with the increase of Δs and the decrease of τ. The functions calculate the intermediate frequency through the weighted combination of the weights w1, w2, and w3, and the weights can be dynamically adjusted based on the specific requirements of the production line. The R(t) function adjusts the frequency based on the sudden state change to ensure a fast response to abnormalities. The frequency constraints Fmin and Fmax ensure that the calculated frequency remains within the practical range. The final output is the adjusted real-time sampling frequency F(t). Thus, the dynamic sampling frequency model can be adjusted according to the drug moisture sensitivity, environmental parameters, production information, and state changes to achieve the dynamic optimization of the sampling frequency.
[0119] Specifically, the dynamic sampling frequency model aims to address the issue of low static sampling efficiency in traditional moisture detection systems. By incorporating factors such as drug sensitivity, environmental conditions, production line status, and sudden state changes, the model dynamically adjusts the sampling frequency to optimize resource allocation and improve detection accuracy. The model first obtains key parameters that reflect the current state of the production line and the specific requirements of the drugs being produced. These parameters are then input into a series of functions designed to quantify the independent impact of each factor on the required sampling frequency. Through the weighted combination of these functions and a rapid response adjustment mechanism, the model can calculate the real-time sampling frequency that is sensitive to key factors and responsive to dynamic changes. By setting upper and lower limits for the sampling frequency, the model ensures practical operation while providing a more refined and efficient moisture detection method. This dynamic adjustment guarantees high-frequency monitoring of critical production stages for sensitive drugs while avoiding over-sampling and resource waste for less critical stages or less sensitive drugs. As a result, resources are optimally allocated, and detection efficiency and accuracy are improved.
[0120] In some specific embodiments, consider a pharmaceutical production line for Drug A and Drug B. Drug A is a high-moisture-sensitivity drug (d = 5), and Drug B is a low-moisture-sensitivity drug (d = 1). The base sampling frequency Fbase is set at 1 Hz. For Drug A, S(d) ≈ 2.79 is calculated; for Drug B, S(d) ≈ 1.69 is calculated. Assuming minimal environmental changes (E(t) ≈ 1), normal production load (P(t) ≈ 1), and no rapid response triggered (R(t) ≈ 1), with equal weights (w1 = w2 = w3 = 1 / 3). The sampling frequency for Drug A is approximately F(t)_A ≈ 1.59 Hz, and the sampling frequency for Drug B is approximately F(t)_B ≈ 1.23 Hz. When the temperature suddenly rises (ΔT = 10°C) and k1 is set at 0.05, E(t) ≈ 1.65 is calculated. Assuming other factors remain unchanged, the sampling frequency for Drug A will increase to F(t)_A_env ≈ 1.81 Hz, demonstrating dynamic adjustment based on environmental changes. If the state changes, Δs = 0.2, the duration τ = 10 seconds, and c = 0.5, then R(t) ≈ 1.01 (assuming Rmax is large enough). This results in a further slight increase in the sampling frequency. This example shows how the model dynamically adjusts the sampling frequency based on drug sensitivity, environmental parameters, and production line status to ensure efficient and responsive moisture detection. Thus, the dynamic sampling frequency model can adaptively adjust the sampling frequency of moisture detection according to the real-time state of the production line and drug characteristics, optimizing sampling resources and improving system efficiency while ensuring detection accuracy.
[0121] Through the above technical solutions, the present application effectively solves the technical defect that the traditional sampling frequency adjustment mechanism is difficult to adapt to the multi-variable coupling effect. By constructing a mathematical model for multi-dimensional parameter fusion, heterogeneous parameters such as moisture sensitivity, environmental fluctuations, and production load are transformed into quantifiable impact factors, and the dynamic characteristics of different parameters are captured using non-linear functional relationships. The fast response mechanism realizes the elastic control of the sampling intensity by quantifying the spatio-temporal characteristics of the state change, avoiding monitoring blind spots under abnormal working conditions. The double amplitude limiting of the constraint conditions prevents system resource overload while ensuring the basic monitoring requirements, enabling the sampling frequency adjustment to maintain sensitivity to key parameters and overall system stability.
[0122] In a second aspect, with reference to Figure 2 , the present application further proposes a drug moisture detection device, which includes: An acquisition module 210, configured to acquire drug production information, environmental parameter information of multiple production lines, and the moisture sensitivity index of each drug; An acquisition module 220, configured to calculate the real-time sampling frequency of each production line through a dynamic sampling frequency model according to the drug production information, environmental parameter information, and moisture sensitivity index; A calculation module 230, configured to collect moisture data through a moisture sensor network distributed on each production line according to the calculated real-time sampling frequency; A processing module 240, configured to perform multi-level processing on the collected moisture data, including: performing preliminary data filtering and outlier identification in an edge computing unit directly connected to the moisture sensor; performing global analysis and multi-dimensional data association in a central processing unit; A generation module 250, configured to generate a moisture status report based on the results of the multi-level processing, where the moisture status report includes moisture content, change trend, and production environment correlation; An early warning module 260, configured to perform hierarchical anomaly early warning on the moisture status report according to a preset specific moisture threshold for the drug.
[0123] By adjusting the data acquisition frequency of multiple production lines in real time through a dynamic sampling frequency model and combining a multi-level data architecture of edge computing and central processing, accurate monitoring and hierarchical early warning of the moisture status during the drug production process are realized, solving the problems of misallocation of sampling resources, response delay, and lack of environmental relevance in traditional methods, and having the advantages of optimizing resource allocation, improving detection efficiency, and enhancing the predictability of anomaly early warning.
[0124] In addition, in some preferred embodiments, a drug moisture detection device proposed by the present application can execute any one of the steps in the above method.
[0125] The above are only embodiments of the present application and are not intended to limit the protection scope of the present application. For those skilled in the art, the present application may have various changes and modifications. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present application shall be included within the protection scope of the present application.
Claims
1. A method for detecting the moisture content of a drug, characterized in that, The method includes: Obtaining the drug production information, environmental parameter information of multiple production lines, and the moisture sensitivity index of each drug; Calculating the real-time sampling frequency of each production line through a dynamic sampling frequency model according to the drug production information, environmental parameter information, and moisture sensitivity index; Collecting moisture data according to the calculated real-time sampling frequency through a moisture sensor network distributed on each production line; Performing multi-level processing on the collected moisture data, including: performing preliminary data filtering and outlier identification in an edge computing unit directly connected to the moisture sensor; performing global analysis and multi-dimensional data association in a central processing unit; Generating a moisture status report based on the results of multi-level processing, where the moisture status report includes moisture content, change trend, and production environment correlation; Performing hierarchical anomaly warning on the moisture status report according to a preset drug-specific moisture threshold.
2. The method for detecting the moisture content of a drug according to claim 1, wherein, The step of calculating the real-time sampling frequency of each production line through a dynamic sampling frequency model according to the drug production information, environmental parameter information, and moisture sensitivity index includes: Obtaining real-time production line status information, where the real-time production line status information includes production line load, the type of drug currently being produced, and the production stage; Dynamically adjusting the weight parameters in the dynamic sampling frequency model based on the real-time production line status information, where the weight parameters include coefficients related to drug moisture sensitivity, production stage criticality, and environmental fluctuations; Inputting the drug production information, environmental parameter information, moisture sensitivity index, and the adjusted weight parameters into the dynamic sampling frequency model; Calculating the real-time sampling frequency of each production line through the dynamic sampling frequency model.
3. The method for detecting the moisture content of a drug according to claim 2, wherein The method further includes: Monitoring the production line status, and when it is detected that the production line status changes by more than a threshold relative to a preset reference value, triggering a quick response mechanism, increasing the sampling frequency of the corresponding production line to a preset maximum value, and reducing the sampling frequency after the status returns to within the threshold range; The step of monitoring the production line status, and when it is detected that the production line status changes by more than a threshold relative to a preset reference value, triggering a quick response mechanism, increasing the sampling frequency of the corresponding production line to a preset maximum value, and reducing the sampling frequency after the status returns to within the threshold range includes: Obtaining the duration and amplitude of the production line status change; Calculating an adjustment coefficient for the sampling frequency according to the duration and amplitude, in combination with the characteristics of the type of drug currently being produced; Multiplying the current sampling frequency by the adjustment coefficient to obtain an adjusted sampling frequency, and ensuring that the frequency is within the preset maximum and minimum ranges; Performing moisture data collection according to the adjusted sampling frequency, and simultaneously recording the sampling frequency change curve; Continuously monitoring the production line status, and when the status returns to within the threshold range, calculating a recovery coefficient based on the recorded sampling frequency change curve and the current drug production stage; Multiplying the current sampling frequency by the recovery coefficient to gradually reduce the sampling frequency to a normal level suitable for the current drug production stage.
4. A method for detecting the moisture content of a drug according to claim 2, characterized in that, The step of dynamically adjusting the weight parameters in the dynamic sampling frequency model based on the real-time production line status information includes: Obtain the historical weight parameter adjustment records within a preset time window, where the historical weight parameter adjustment records include the adjustment histories of the drug moisture sensitivity coefficient, the production stage criticality coefficient, and the environmental fluctuation coefficient; Based on the historical weight parameter adjustment records, calculate the response time of each weight parameter to changes in the production line state; According to the response time, establish a weight parameter adjustment priority queue, and place the parameters with shorter response times at the front of the queue; When it is detected that the real-time production line state information changes by more than a preset threshold, calculate and update each weight parameter in turn according to the order of the priority queue; Apply the updated weight parameters to the dynamic sampling frequency model and record the results of this parameter adjustment.
5. A method for detecting the moisture content of a drug according to claim 3, characterized in that, The step of continuously monitoring the production line state and, when the state returns to within the threshold range, calculating the recovery coefficient based on the recorded sampling frequency change curve and the current drug production stage includes: Obtain the production line parameters at the time of state recovery, including temperature, humidity, pressure, and production speed; Based on the production line parameters, retrieve the standard parameter range of the current drug production stage from a pre-established production stage database, and the database also contains the moisture sensitivity index of different types of drugs at each production stage; Calculate the deviation degree between the current production line parameters and the standard parameter range, and combine the moisture sensitivity index of the current drug to generate a state recovery score; According to the state recovery score and the recorded sampling frequency change curve, calculate the initial recovery coefficient; Based on the specific moisture control requirements of the current drug production stage, correct the initial recovery coefficient to obtain the final recovery coefficient.
6. The method for detecting the moisture content of a drug according to claim 4, wherein The step of establishing a weight parameter adjustment priority queue according to the response time and placing the parameters with shorter response times at the front of the queue includes: Construct a multi-time scale data matrix, which contains real-time monitoring data, minute-level aggregated data, and hourly trend data; Extract the eigenvectors of each weight parameter in the data matrix at different time scales; Calculate the dynamic time-varying correlation coefficient matrix between weight parameters; Convert the dynamic time-varying correlation coefficient matrix into a parameter dependency graph; Identify the highly correlated parameter clusters in the parameter dependency graph; According to the degree of mutual influence within the parameter cluster, calculate the comprehensive response time of each weight parameter; Based on the comprehensive response time, construct a priority queue and place the parameters with shorter response times at the front of the queue.
7. A method for detecting the moisture content of a drug according to claim 6, characterized in that, The step of calculating the comprehensive response time of each weight parameter according to the degree of mutual influence within the parameter cluster includes: Construct a parameter influence matrix, where the matrix elements represent the influence intensity and direction between parameters; Perform matrix eigenvalue decomposition to obtain the main modes of parameter influence; Calculate the contribution degree of each parameter in the main mode; Based on the contribution degree and the mode eigenvalue, construct an initial estimate of the parameter response time; Apply time series analysis methods to identify the periodicity and trend of parameter changes; Combine the periodicity and trend information to correct the initial estimate and generate the comprehensive response time of each weight parameter.
8. A method for detecting the moisture content of a drug according to claim 1, characterized in that, Steps for generating a moisture status report based on the results of multi-level processing, where the moisture status report includes moisture content, change trend, and production environment relevance, are as follows: Construct a multi-dimensional data model and map moisture content data, production environment parameters, and drug characteristic information to the feature space of the multi-dimensional data model; Perform dimensionality reduction analysis to extract the influencing factors of the moisture status; Based on the influencing factors, calculate the time-varying correlation coefficient between the moisture content and environmental parameters, and separate the trend, periodic, and random components of the moisture content; According to the decomposition results, fit the moisture change trend curve; Based on the time-varying correlation coefficient and the change trend curve, construct a moisture-environment causal network diagram; Match the moisture-environment causal network diagram with the drug production process flow chart, identify the moisture-sensitive areas of the process nodes, and generate a moisture status report.
9. The method for detecting the moisture content of a drug according to claim 1, characterized in that, The steps for calculating the real-time sampling frequency of each production line through a dynamic sampling frequency model according to the drug production information, environmental parameter information, and moisture sensitivity index are as follows: Obtain the base sampling frequency Fbase, the drug moisture sensitivity index d, the changes in environmental parameters ΔT and ΔH, the production line load L(t), the criticality index C(t) of the production stage, the change amplitude Δs, and the duration τ; Calculate the drug moisture sensitivity function S(d) = 1 + log(1 + d); Calculate the environmental parameter influence function E(t) = exp(k1 * ΔT + k2 * ΔH), where k1 and k2 are preset constants; Calculate the production information influence function P(t) = 1 + a * L(t) + b * C(t), where a and b are preset constants; Calculate the rapid response adjustment function R(t) = max(1, min(Rmax, 1 + c * Δs / τ)), where c is a preset constant and Rmax is the preset maximum response coefficient; Obtain the dynamic weight coefficients w1, w2, and w3, which satisfy w1 + w2 + w3 = 1; Calculate the real-time sampling frequency F(t) according to the formula F(t) = Fbase * [w1 * S(d) + w2 * E(t) + w3 * P(t)] * R(t); Adjust the value of F(t) according to the constraint condition Fmin ≤ F(t) ≤ Fmax, where Fmin is the minimum sampling frequency and Fmax is the maximum sampling frequency; Output the adjusted real-time sampling frequency F(t).
10. A pharmaceutical moisture detection device, characterized in that, The device includes: An acquisition module for acquiring drug production information, environmental parameter information of multiple production lines, and the moisture sensitivity index of each drug; An acquisition module for calculating the real-time sampling frequency of each production line through a dynamic sampling frequency model according to the drug production information, environmental parameter information, and moisture sensitivity index; A calculation module for collecting moisture data through a moisture sensor network distributed on each production line according to the calculated real-time sampling frequency; A processing module for performing multi-level processing on the collected moisture data, including: performing preliminary data filtering and outlier identification in an edge computing unit directly connected to the moisture sensor; performing global analysis and multi-dimensional data association in a central processing unit; A generation module for generating a moisture status report based on the results of the multi-level processing, where the moisture status report includes moisture content, change trend, and production environment correlation; An early warning module for performing hierarchical anomaly warnings on the moisture status report according to a preset specific moisture threshold for the medicine.
Citation Information
Cited By
SCADA (supervisory control and data acquisition)-based multi-specification flexible subpackage control method and system for medicines
CN121069937A