Quality detection data analysis method of recent-effect-period liquid medicine preparation
By combining multi-wavelength optical sensing arrays and temperature and humidity sensors on edge devices with cloud models, the problem of insufficient computing power on edge devices has been solved, enabling efficient and low-latency early warning of near-expiration drug quality and ensuring drug safety.
Patent Information
- Application Number
- CN202610018099.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2026-01-08
- Publication Date
- 2026-02-06
- Estimated Expiration
- 2046-01-08
AI Technical Summary
In existing technologies, the limited computing power of edge devices prevents the efficient fusion and analysis of multi-wavelength spectral data, resulting in delayed early warnings of quality deterioration of near-expiration liquid drugs and missing critical intervention windows.
By deploying a multi-wavelength optical sensor array to collect spectral data in real time, lightweight feature compression at the edge side generates low-dimensional feature vectors, and combined with temperature and humidity sensor data, the data is uploaded to the cloud to construct a multi-scale degradation evolution trajectory model for dynamic trajectory matching, calculate the drug degradation risk index, and trigger an early warning.
It enables high-precision, low-latency early warning of near-expiry drug quality deterioration even when edge devices have limited computing power, predicting deterioration trends 48 hours in advance, reducing drug waste and safety risks.
Smart Images

Figure CN121481355A_ABST
Abstract
Description
Technical Field
[0001] This invention belongs to the interdisciplinary field of biomedicine and data processing, and specifically relates to a method for quality testing data analysis of near-expiration liquid pharmaceutical preparations. Background Technology
[0002] With the continuous improvement of the drug safety supervision system and the significant enhancement of public health awareness, the quality risk management of near-expiration liquid drug preparations has become a key issue in the pharmaceutical distribution and use process. Liquid drugs are susceptible to multiple environmental factors such as temperature, light, oxidation, and microbial contamination during storage and transportation. Their physicochemical properties may irreversibly deteriorate as the expiration date approaches, such as degradation of the main component, pH shift, particulate precipitation, or decreased clarity. Traditional quality testing relies on offline laboratory analysis, which is time-consuming and has a slow response time, making it difficult to support dynamic risk warnings for near-expiration drugs. In recent years, online monitoring technology based on multi-wavelength spectral sensing has been gradually introduced into drug quality monitoring scenarios due to its non-invasive and real-time advantages. By integrating multi-band spectral data such as ultraviolet-visible-near-infrared, it is possible to comprehensively characterize changes in the molecular structure of drugs and the trend of impurity formation.
[0003] Early identification of quality deterioration in near-expiration liquid pharmaceuticals relies heavily on refined fusion analysis of high-dimensional spectral features. This research aims to extract latent degradation indicators strongly correlated with drug stability through collaborative modeling of multi-wavelength signals, thereby triggering an early warning mechanism before significant deviations in physicochemical properties occur. Its core lies in constructing an intelligent analytical model capable of capturing subtle spectral drifts and nonlinear degradation patterns to achieve advanced prediction of key quality attributes.
[0004] In existing technologies, multi-wavelength spectral data is typically collected by edge sensing devices deployed in pharmacies, cold chain vehicles, or warehouse nodes, forming a continuous real-time data stream. However, due to limitations in the computing resources and power consumption of edge devices, existing solutions struggle to efficiently execute highly complex multi-wavelength feature fusion and deep learning inference tasks locally.
[0005] To reduce computational load, some methods employ simplified models or single-band analysis, leading to the loss of crucial degradation information. Other solutions upload raw data to the cloud for processing, but network latency and bandwidth limitations cause severe delays in early warning response, often missing the golden intervention period for drug deterioration. The contradiction between computing power, accuracy, and timeliness is particularly prominent in primary healthcare institutions or mobile delivery scenarios, urgently requiring a technical solution that can achieve high-precision, low-latency early warning of near-expiration drug quality deterioration at resource-constrained edge environments. Summary of the Invention
[0006] This invention provides a method for analyzing quality testing data of near-expiry liquid pharmaceutical preparations, aiming to solve the technical problem that real-time data streams in quality testing cannot complete multi-wavelength fusion analysis due to the limitation of computing power of edge devices, resulting in delayed early warning of near-expiry deterioration and missing of critical intervention windows.
[0007] This invention provides a method for analyzing quality testing data of near-expiration liquid pharmaceutical preparations, comprising:
[0008] By deploying a multi-wavelength optical sensor array outside the drug storage container, the transmitted light intensity signal of liquid drugs at multiple preset wavelengths is collected in real time to form a raw multi-channel spectral time-series data stream; at the same time, by deploying temperature and humidity sensors and light intensity sensors in the drug storage environment, environmental parameter time-series data is collected in real time, and the sampling frequency is consistent with the transmitted light intensity signal.
[0009] The original multi-channel spectral time-series data stream is subjected to edge-side lightweight feature compression to generate a low-dimensional spectral feature vector; and the mean and variance of the environmental parameter time-series data within the current time window are calculated as a 2-dimensional environmental feature vector, which is then concatenated with the low-dimensional spectral feature vector to form an 8-dimensional fused feature vector.
[0010] The 8-dimensional fused feature vector is uploaded to the cloud-based collaborative analysis platform;
[0011] In the cloud-based collaborative analysis platform, a multi-scale degradation evolution trajectory model is constructed based on the full life cycle spectral database of historical batches of drugs. The multi-scale degradation evolution trajectory model incorporates environmental parameter influencing factors to achieve collaborative modeling of spectral characteristics and environmental factors.
[0012] Using the multi-scale degradation evolution trajectory model, dynamic trajectory matching and deviation measurement are performed on the 8-dimensional fusion feature vector of the current batch of drugs to calculate the drug degradation risk index.
[0013] When the drug deterioration risk index exceeds a preset threshold, a near-expiration deterioration warning instruction is triggered, and intervention suggestion information is generated.
[0014] Preferably, the multi-wavelength optical sensing array includes at least five light-emitting units and a shared photoelectric receiving unit. The at least five light-emitting units emit monochromatic light with center wavelengths of 280 nm, 320 nm, 410 nm, 550 nm and 650 nm, respectively. Each light-emitting unit is lit up in turn in turn. The shared photoelectric receiving unit synchronously records the intensity of transmitted light at the corresponding wavelength, and the sampling frequency is not less than 10 times per second.
[0015] Preferably, edge-side lightweight feature compression is performed on the original multi-channel spectral time-series data stream to generate low-dimensional spectral feature vectors, including:
[0016] The original transmitted light intensity sequence for each wavelength channel is subjected to sliding window mean filtering, with a window length of 30 sampling points;
[0017] Calculate the normalized absorbance value of each wavelength channel within the current time window. The normalized absorbance value is equal to the ratio of the transmitted light intensity under negative natural logarithm to the initial reference transmitted light intensity.
[0018] The three wavelength channels with the largest changes in the rate of change of the normalized absorbance value over adjacent time windows (i.e., the absolute value of the first-order difference) are selected, and their corresponding normalized absorbance values and first-order difference values are combined to form a 6-dimensional spectral feature vector, which is used as the low-dimensional spectral feature vector.
[0019] Preferably, the historical batch drug full life cycle spectral database stores the multi-wavelength normalized absorbance sequence of each historical batch of drug measured daily under the same environmental conditions from the date of manufacture to the expiration date, as well as the key degradation inflection point timestamps and main component degradation path identifiers determined in the accelerated stability test for the corresponding batch.
[0020] Preferably, the multi-scale degradation evolution trajectory model is a hierarchical hidden Markov model, in which the bottom-level state nodes represent the initial oxidation or hydrolysis reaction stage of the drug at the microscopic molecular level, the middle-level state nodes represent the gradual shift stage of macroscopic physicochemical properties such as turbidity and color, and the top-level state nodes represent the abrupt degradation stage near the expiration date; the transition probability matrix and observation probability distribution parameters of the hierarchical hidden Markov model are obtained by offline training using the full life cycle spectral database of the historical batches of drugs through the maximum likelihood estimation method.
[0021] Preferably, the multi-scale degradation evolution trajectory model is used to perform dynamic trajectory matching and deviation measurement on the 8-dimensional fused feature vector of the current batch of drugs, and the drug degradation risk index is calculated, including:
[0022] The low-dimensional spectral feature vector sequence of the current batch of drugs is input into the hierarchical hidden Markov model to calculate its most likely state transition path.
[0023] Extract the predicted first entry time of the top-level state node in the state transition path;
[0024] The predicted first entry time is compared with the current remaining validity period. If the predicted first entry time is earlier than the current remaining validity period minus 72 hours, it is determined that there is a risk of degradation.
[0025] The drug deterioration risk index is a negative function of the time difference between the predicted initial entry time and the current remaining shelf life, specifically a negative exponential function, expressed as:
[0026] ;
[0027] in The time constant is 12 hours. To mitigate the risk index, The current remaining validity period, For the first entry into the predicted time value, the risk index increases exponentially as the time difference decreases; the smaller the time difference, the higher the risk index.
[0028] Preferably, the preset threshold is set according to the drug category. For biological liquid drugs, the time difference corresponding to the preset threshold is 48 hours; for chemically synthesized liquid drugs, the time difference corresponding to the preset threshold is 24 hours.
[0029] Preferably, the intervention recommendation information includes one or more of the following: recommending the priority use of this batch of drugs, initiating a re-inspection process, adjusting storage temperature and humidity parameters, or isolating and awaiting disposal. The generation rules for the intervention recommendation information are jointly determined based on the drug category, current storage environment parameters, and the quantitative level of the deterioration risk index.
[0030] Preferably, the method further includes:
[0031] The edge device locally caches the raw multi-channel spectral time-series data streams of the most recent 7 days.
[0032] When the degradation risk index returned by the cloud-based collaborative analysis platform exceeds the preset threshold, the edge device automatically retrieves cached data and performs high-resolution local reanalysis, which includes: using a sliding window filter with a window length of 10 sampling points, calculating the second difference of the normalized absorbance value, and retaining the original features of all 5 wavelength channels to verify the reliability of the warning results.
[0033] If the reanalysis results are consistent with the cloud-based alert, then the release permission for that batch of drugs is locked, and a lock command is sent to the quality management system.
[0034] Preferably, the temperature and humidity sensor has a measurement range of -20℃ to 60℃ and a relative humidity of 10% to 95%, with measurement accuracies of ±0.5℃ and ±3%, respectively; the light intensity sensor has a measurement range of 0 to 10000 lux and a measurement accuracy of ±5%.
[0035] Environmental parameter time series data and transmitted light intensity signal are sampled synchronously, and a set of environmental parameter data is generated every 3 seconds, which is associated with the spectral data of the corresponding time window.
[0036] The mean and variance of the environmental feature vector are calculated from the environmental parameter data of 30 sampling points within the current time window. They are then concatenated with the 6-dimensional spectral feature vector in the order of mean temperature, temperature variance, mean humidity, humidity variance, mean illumination, and illumination variance, i.e., the original 6-dimensional spectral feature vector, to form an 8-dimensional fused feature vector.
[0037] Compared with the prior art, the beneficial effects of the present invention are as follows:
[0038] 1. This invention constructs a two-level analysis architecture that integrates edge and cloud, offloading highly complex multi-wavelength fusion analysis tasks to the cloud and performing feature compression operations with extremely low computational overhead only on the edge side, effectively avoiding the bottleneck of insufficient computing power of edge devices.
[0039] 2. The edge side adopts a 6-dimensional spectral feature vector representation method based on key wavelength channel screening and first-order difference combination. While retaining the core dynamic information of drug deterioration, it compresses the data transmission volume to less than 5% of the original data stream, which significantly reduces the communication bandwidth requirements and cloud load.
[0040] 3. The cloud-based system employs a hierarchical hidden Markov model trained on historical full lifecycle data, which can accurately capture the multi-stage evolution of drugs from microscopic reactions to macroscopic deterioration, enabling early prediction of near-expiration deterioration trends. The warning time window is at least 48 hours earlier than the traditional single-wavelength threshold alarm method.
[0041] 4. This invention does not require large-scale renovation of existing drug storage facilities. It only requires the addition of standardized multi-wavelength optical sensor arrays and edge computing units to achieve intelligent quality monitoring of existing drugs. This solves the problem of missing critical intervention windows due to early warning delays, ensures the safety of clinical drug use, and reduces economic losses caused by expired drugs. Attached Figure Description
[0042] Figure 1 This is a schematic diagram of the overall technical solution architecture of a quality testing data analysis method for near-expiration liquid pharmaceutical preparations proposed in this invention;
[0043] Figure 2 This is a schematic diagram of the core principle framework of the multi-scale degradation evolution trajectory model in this invention;
[0044] Figure 3 This is a logical flow diagram of edge-side lightweight feature compression and cloud-based collaborative analysis in this invention;
[0045] Figure 4 This is a logical flowchart of the dynamic trajectory matching and deviation measurement in this invention;
[0046] Figure 5This is a schematic diagram of the multi-level interaction relationship and data flow between edge devices and the cloud-based collaborative analysis platform in this invention;
[0047] Figure 6 This is a flowchart illustrating the logical flow framework of intervention suggestion generation and local reanalysis verification in this invention. Detailed Implementation
[0048] Please refer to Figures 1 to 6 This invention provides a method for analyzing quality testing data of near-expiry liquid pharmaceutical preparations. Its core lies in constructing a two-level analysis architecture that integrates edge and cloud to solve the technical problem that real-time data streams in quality testing cannot complete multi-wavelength fusion analysis due to the limited computing power of edge devices, resulting in delayed early warning of near-expiry deterioration and missing of critical intervention windows.
[0049] This invention utilizes a multi-wavelength optical sensing array deployed outside the drug storage container to collect transmitted light intensity signals of liquid drugs at multiple preset wavelengths in real time, forming a raw multi-channel spectral time-series data stream. Edge-side lightweight feature compression is performed on the raw multi-channel spectral time-series data stream to generate a low-dimensional spectral feature vector. This low-dimensional spectral feature vector is uploaded to a cloud-based collaborative analysis platform. On this platform, a multi-scale degradation evolution trajectory model is constructed based on a historical batch drug's full life-cycle spectral database. Using this multi-scale degradation evolution trajectory model, dynamic trajectory matching and deviation measurement are performed on the 8-dimensional fused feature vector of the current batch of drugs to calculate a drug degradation risk index. When the drug degradation risk index exceeds a preset threshold, a near-expiration degradation warning command is triggered, and intervention suggestion information is generated.
[0050] It should be noted that temperature, humidity, and light intensity in the drug storage environment are key external factors affecting the deterioration rate of liquid drugs. Therefore, an integrated environmental sensor module is deployed synchronously in the drug storage area. This module shares the power supply and communication interface of the edge computing unit with the multi-wavelength optical sensor array. The temperature and humidity sensor uses a digital sensor chip that supports the I2C communication protocol, and the light intensity sensor uses a photodiode array. The output analog signal is synchronously digitized by the analog-to-digital converter of the edge computing unit. The environmental parameters and the transmitted light intensity signal are sampled synchronously at a frequency of 10 times per second to ensure strict alignment of their timestamps, providing a data foundation for subsequent collaborative modeling.
[0051] The temperature and humidity sensor has a measurement range of -20℃ to 60℃ and a relative humidity of 10% to 95%, with measurement accuracies of ±0.5℃ and ±3%, respectively; the light intensity sensor has a measurement range of 0 to 10000 lux and a measurement accuracy of ±5%.
[0052] Step S1 involves using a multi-wavelength optical sensing array deployed outside the drug storage container to collect real-time transmitted light intensity signals of the liquid drug at multiple preset wavelengths, forming a raw multi-channel spectral time-series data stream. This multi-wavelength optical sensing array consists of at least five light-emitting units and a shared photoelectric receiving unit. Each light-emitting unit emits monochromatic light with center wavelengths of 280 nm, 320 nm, 410 nm, 550 nm, and 650 nm, respectively.
[0053] The selection of the above wavelengths is based on the UV-Vis absorption characteristics of common active ingredients and degradation products in liquid pharmaceuticals. Among them, 280 nm and 320 nm correspond to the characteristic absorption bands of aromatic amino acids and protein secondary structures, 410 nm is used to detect the formation of oxidation byproducts such as quinones, and 550 nm and 650 nm are used to monitor changes in solution turbidity and scattering effects caused by suspended particulate matter.
[0054] Each light-emitting unit is sequentially polled and illuminated according to a fixed time sequence, with a polling period not exceeding 100 milliseconds, ensuring that the sampling frequency of each wavelength channel is not less than 10 times per second. A shared photoelectric receiving unit synchronously records the transmittance intensity signal at the corresponding wavelength, outputting an analog voltage signal. After being digitized at 12-bit resolution by an analog-to-digital converter, it forms a 5-channel parallel raw spectral time-series data stream. Each data point includes a timestamp, wavelength identifier, and corresponding digital intensity value. The data stream is temporarily stored in the memory of the edge device in the form of a circular buffer with a buffer depth of 7200 sampling points, corresponding to two hours of continuous data acquisition.
[0055] Step S2 involves performing edge-side lightweight feature compression on the original multi-channel spectral time-series data stream to generate low-dimensional spectral feature vectors. This compression process is executed on the microcontroller of the edge computing unit, employing an embedded real-time algorithm that does not rely on floating-point units. First, a sliding window mean filter is applied to the original transmitted light intensity sequence for each wavelength channel. The window length is set to 30 sampling points, i.e., a 3-second time window, to suppress high-frequency electronic noise and ambient light interference. The filtered intensity value is denoted as... ,in Indicates the wavelength channel number. This indicates the end time of the current time window. Then, the normalized absorbance value for each wavelength channel within the current time window is calculated. Its definition is:
[0056]
[0057] in, The initial reference transmitted light intensity, measured during the factory acceptance of this batch of drugs, is written into the non-volatile memory of the edge device by the quality management system upon drug warehousing and serves as the benchmark for all subsequent absorbance calculations. The normalized absorbance value eliminates the influence of initial concentration differences between different batches, ensuring cross-batch comparability of the characteristics. Next, the first-order difference of the normalized absorbance value for each wavelength channel is calculated. :
[0058]
[0059] in, This represents the interval between adjacent time windows, which is 3 seconds.
[0060] The rate of change of the normalized absorbance value is characterized by the absolute value of the first-order difference between adjacent time windows, i.e., through... Quantify the degree of characteristic changes in each wavelength channel to ensure that the spectral dimensions most sensitive to the degradation process are selected.
[0061] The first-order difference reflects the instantaneous rate of change of absorbance and is more sensitive to early degradation signals. Subsequently, the system iterates through the five wavelength channels, calculating the values for each channel. The three wavelength channels with the largest rate of change are selected. This screening mechanism ensures that only the spectral dimensions most responsive to the current degradation process are retained, avoiding redundant information transmission. Finally, the three selected wavelength channels are... and The spectral feature vectors are assembled sequentially by channel to form a 6-dimensional spectral feature vector. :
[0062]
[0063] The first selected wavelength channel (numbered as follows) At that moment The corresponding spectral parameters; The first selected wavelength channel (numbered as follows) The change in spectral parameters at time t; The second selected wavelength channel (numbered as follows) At that moment The corresponding spectral parameters; The second selected wavelength channel (numbered as follows) At that moment The amount of change in spectral parameters; The third selected wavelength channel (numbered as follows) At that moment The corresponding spectral parameters; The third selected wavelength channel (numbered as follows) At that moment The amount of change in spectral parameters;
[0064] This serves as the low-dimensional spectral feature vector. This vector is generated every 3 seconds, and the data volume is only 4.8% of the original 5-channel data stream, significantly reducing subsequent communication load.
[0065] Simultaneously, the edge computing unit calculates the mean and variance of 30 environmental parameter sampling points (temperature, humidity, and light intensity) within the current 3-second time window, forming a 2D environmental feature vector (mean temperature, temperature variance, mean humidity, humidity variance, mean light intensity, and variance). This vector is then concatenated with the 6D spectral feature vector in the order of mean temperature, temperature variance, mean humidity, humidity variance, mean light intensity, and variance light intensity, forming an 8D fused feature vector. This fusion method retains the core degradation information of the spectral features while incorporating the influence patterns of environmental factors, enabling subsequent cloud-based modeling to simultaneously consider the synergistic effects of intrinsic drug degradation and external environmental stress.
[0066] Step S3: Upload the low-dimensional spectral feature vector to the cloud-based collaborative analysis platform. The upload process is implemented through the wireless communication module built into the edge device, employing a data transmission mechanism based on a message queue telemetry transmission protocol. Each low-dimensional spectral feature vector is encapsulated into a structured data packet, the data packet format including: a 16-byte batch number field, an 8-byte timestamp field (accurate to milliseconds), a 24-byte 6-dimensional spectral feature vector field (each floating-point number occupies 4 bytes), and a 4-byte cyclic redundancy check code. The data packet is sent to the data access service module of the cloud-based collaborative analysis platform through an encrypted channel.
[0067] To ensure data integrity, edge devices perform CRC32 verification on the data packet content before sending and append the checksum to the end of the packet. The cloud receiver recalculates the checksum before parsing; if they do not match, the packet is discarded and a retransmission is requested. In addition, the edge devices locally cache the raw multi-channel spectral time-series data streams of the most recent 7 days in non-volatile memory, using a rolling over strategy to ensure that data is not lost during network outages or communication failures.
[0068] Step S4: In the cloud-based collaborative analysis platform, a multi-scale degradation evolution trajectory model is constructed based on the full life cycle spectral database of historical batches of drugs. This full life cycle spectral database of historical batches of drugs stores the multi-wavelength normalized absorbance sequence of each historical batch of drugs measured daily under standard environmental conditions (temperature 25℃, relative humidity 60%) from the date of manufacture to the expiration date.
[0069] Each sequence contains a complete 5-channel diurnal absorbance curve, linked to a critical degradation inflection point time stamp and principal component degradation pathway identifier determined in accelerated stability testing for that batch. The critical degradation inflection point refers to the point in time when the physicochemical properties of the drug undergo irreversible mutations, verified and confirmed by high-performance liquid chromatography (HPLC). The principal component degradation pathway identifier indicates the main degradation mechanism of that batch, such as "oxidation-dominated," "hydrolysis-dominated," or "photosensitive degradation."
[0070] The multi-scale degradation evolution trajectory model adopts a hierarchical hidden Markov model structure. The bottom-level state nodes represent the initial oxidation or hydrolysis reaction stage of the drug at the microscopic molecular level. During this stage, the absorbance changes are weak but have specific wavelength selectivity. The middle-level state nodes represent the gradual shift stage of macroscopic physicochemical properties such as turbidity and color, which is characterized by a synchronous and slow increase in absorbance across multiple wavelengths. The top-level state nodes represent the abrupt degradation stage near the expiration period, characterized by a sharp increase in absorbance in a short period of time, especially in the 410 nm and 550 nm channels.
[0071] The transition probability matrix and observation probability distribution parameters of this hierarchical Hidden Markov Model were obtained through offline training using complete columnar trajectories in a historical spectral database via maximum likelihood estimation. During training, each historical trajectory was labeled with its true state transition path, and the model parameters were iteratively optimized until convergence.
[0072] During model training, the statistical characteristics of environmental parameters from historical batches are incorporated as conditional variables into the calculation of observation probability distribution. This enables the model to learn the differences in degradation trajectories under different environmental conditions, such as accelerated degradation patterns under high temperature and humidity and photosensitive degradation patterns under strong light irradiation, thereby improving the early warning adaptability under different storage scenarios.
[0073] Step S5: Using the multi-scale degradation evolution trajectory model, dynamic trajectory matching and deviation measurement are performed on the 8-dimensional fused feature vector of the current batch of drugs to calculate the drug degradation risk index. This process is executed by the model inference engine of the cloud-based collaborative analysis platform.
[0074] First, the low-dimensional spectral feature vector sequence of the current batch over a continuous 24-hour period is input into a hierarchical hidden Markov model, and the Viterbi algorithm is used to calculate its most probable state transition path. This path reveals the current deterioration stage of the drug and its evolution trend. Subsequently, the predicted first-entry time of the top-level state node in this state transition path is extracted. This value represents the time point at which the model predicts the drug will enter a stage of rapid deterioration. Simultaneously, the remaining shelf life of the current batch is obtained from the quality management system. That is, the time interval from the current moment to the nominal expiration date. If If the drug deteriorates within a certain timeframe, it is considered to have a risk of deterioration. Drug Deterioration Risk Index Using a negative exponential function:
[0075]
[0076] in, The time constant, set to 12 hours, is used to adjust the sensitivity of the risk index to time differences. This formula ensures that the smaller the time difference, the higher the risk index, and that it grows exponentially, highlighting the urgency of impending failure.
[0077] The negative exponential function adopts an exponential form and is the optimal fitting form verified based on historical degradation data. It can accurately amplify the risk level near the stage of sudden degradation, avoid over-warning in low-risk stages, and ensure the urgency of warnings in high-risk stages.
[0078] Step S6: When the drug deterioration risk index exceeds a preset threshold, a near-expiration deterioration warning instruction is triggered, and intervention suggestion information is generated. The preset threshold is set according to the drug category: for biological liquid drugs, due to their complex molecular structure and severe degradation consequences, the time difference corresponding to the preset threshold is 48 hours, that is, when... If the risk index exceeds the threshold within 24 hours, the preset threshold is set at 24 hours.
[0079] Intervention recommendations are generated by the early warning decision engine and include one or more suggestions such as prioritizing the use of this batch of medicine, initiating a re-inspection process, adjusting storage temperature and humidity parameters, or isolating it for disposal. The generation rules are determined based on the drug category, current storage environment parameters, and the quantitative level of the deterioration risk index. For example, when the risk index of a biological product is between 0.7 and 0.9, and the current storage temperature is above 25°C, the system generates a recommendation to "immediately adjust the refrigeration temperature to 2°C to 8°C and arrange a re-inspection within 24 hours"; if the risk index exceeds 0.95, the system directly generates an instruction to "lock outbound access and isolate the product for disposal."
[0080] The method also includes a local reanalysis verification mechanism for edge devices. When the degradation risk index returned by the cloud-based collaborative analysis platform exceeds a preset threshold, the edge device automatically retrieves the most recent 7 days of raw multi-channel spectral time-series data stream cached in non-volatile memory and performs high-resolution local reanalysis.
[0081] High resolution is reflected in three aspects:
[0082] First, the sliding window length has been reduced from 30 sampling points to 10 sampling points, improving the ability to capture subtle local changes;
[0083] Second, the calculation of the second difference value of the normalized absorbance value is added to enhance the perception of changes in the degradation rate.
[0084] Third, the original features of all five wavelength channels are retained to avoid information loss caused by feature screening and to ensure the comprehensiveness and accuracy of the reanalysis results.
[0085] The reanalysis process skips the feature compression step and directly applies a finer sliding window (window length 10 sampling points) and higher-order difference calculations (second-order difference) to the original 5-channel data to verify the existence of a real degradation trend. If the reanalysis results confirm that the absorbance shows a continuous upward trend in the key wavelength channels, and is consistent with the degradation pattern in the cloud-based early warning, the edge device sends a locking command to the drug warehouse management system via the internal bus to prohibit the outbound operation of that batch of drugs, and sends the verification results back to the cloud as evidence of early warning confirmation. This mechanism effectively prevents false alarms caused by communication interference or model misjudgment, improving system reliability.
[0086] The interaction between the edge devices and the cloud-based collaborative analysis platform follows strict timing and security protocols. The edge devices generate feature vectors every 3 seconds and upload them in packets every 30 seconds, reducing connection establishment overhead. The cloud platform performs identity authentication, integrity verification, and timestamp validity checks on received data packets; invalid data packets are logged in the audit log. The model inference engine is containerized, supporting horizontal scaling and capable of handling thousands of batches of parallel analysis tasks simultaneously. The historical spectral database is regularly updated, incorporating newly completed batches of data from full lifecycle monitoring to ensure the continuous evolution of the multi-scale degradation trajectory model.
[0087] The mounting position of the multi-wavelength optical sensing array has been optimized through optical simulation to ensure an effective optical path of 10 mm through the liquid drug column and to avoid refractive distortion caused by the curvature of the container wall. The light-emitting unit adopts a pulse-driven method with a duty cycle of less than 10% to prevent local heating from affecting the stability of the drug. The photoelectric receiving unit is equipped with an automatic gain control circuit to adapt to the measurement needs of drugs with different transmittances, and the dynamic range covers 0.01 to 1.0 absorbance units.
[0088] The edge computing unit's microcontroller runs a real-time operating system, and task scheduling priorities ensure that the feature compression algorithm executes immediately after each data acquisition, with end-to-end processing latency not exceeding 50 milliseconds. The non-volatile memory uses industrial-grade flash memory chips, possessing power-loss data retention capabilities and a write endurance of no less than 100,000 cycles. The wireless communication module supports dual-band operation, prioritizing 4G network availability and switching to a narrowband IoT channel otherwise to ensure connectivity in remote warehouses.
[0089] The cloud-based collaborative analysis platform's data access service module adopts a distributed message queue architecture, supporting a throughput of tens of thousands of data packets per second. The hierarchical Hidden Markov Model loaded by the model inference engine is stored as a tensor in the graphics processor's memory, utilizing parallel computing to accelerate state path inference. The early warning decision engine incorporates a rule engine; its decision tree is jointly developed by drug regulatory experts and data scientists and continuously optimized through historical false alarm cases.
[0090] In summary, this embodiment constructs a complete, reliable, and low-latency early warning system for near-expiration liquid drugs by employing precise wavelength selection, efficient edge feature compression, multi-scale evolutionary modeling based on full lifecycle data, dynamic trajectory matching and risk quantification, and a closed-loop local verification mechanism. This invention minimizes edge computing load while retaining core dynamic information about drug deterioration, and leverages the powerful computing capabilities of the cloud to achieve high-precision predictions. This effectively solves the problem of early warning delays caused by insufficient edge computing power, providing technical assurance for drug quality and safety.
[0091] The quality testing data analysis system for near-expiry liquid pharmaceutical preparations includes a multi-wavelength optical sensor array, an edge computing unit, a cloud-based collaborative analysis platform, and an intervention decision module. The multi-wavelength optical sensor array is located outside the pharmaceutical storage container and is used to collect the transmitted light intensity signals of the liquid pharmaceutical at multiple preset wavelengths in real time.
[0092] The edge computing unit is connected to the multi-wavelength optical sensing array and includes a microcontroller, non-volatile memory, and a wireless communication module. The microcontroller runs an embedded feature compression algorithm program, the non-volatile memory is used to cache the raw data of the most recent 7 days, and the wireless communication module supports the message queue telemetry transmission protocol and is responsible for uploading low-dimensional spectral feature vectors to the cloud.
[0093] The cloud-based collaborative analysis platform includes a data access service module, a model inference engine, a historical spectral database, and an early warning decision engine. The data access service module receives and parses structured data packets from various edge computing units. The model inference engine loads a trained hierarchical Hidden Markov Model and performs state path inference. The early warning decision engine calculates a risk index based on the inference results and compares it with a threshold, triggering corresponding early warning actions. The intervention decision module generates intervention recommendations based on the drug deterioration risk index and sends instructions to the warehouse management, environmental control, and quality inspection subsystems via the enterprise service bus, achieving an automated intervention closed loop.
Claims
1. A method for analyzing quality inspection data of a near-expiration liquid pharmaceutical preparation, characterized by, The application relates to a method for predicting the near expiration degradation risk of liquid drugs, comprising the following steps: Real-time acquisition of the transmission light intensity signals of liquid drugs at multiple preset wavelengths through a multi-wavelength optical sensing array deployed outside a drug storage container, to form an original multi-channel spectral time series data stream; Simultaneous real-time acquisition of environmental parameter time series data through a temperature and humidity sensor and an illumination intensity sensor deployed in the drug storage environment, the sampling frequency being consistent with that of the transmission light intensity signals; Edge-side lightweight feature compression is performed on the original multi-channel spectral time series data stream to generate a low-dimensional spectral feature vector; and the mean and variance of the environmental parameter time series data within a current time window are calculated as a 2-dimensional environmental feature vector, which is spliced with the low-dimensional spectral feature vector to form an 8-dimensional fusion feature vector; The 8-dimensional fusion feature vector is uploaded to a cloud collaborative analysis platform; In the cloud collaborative analysis platform, a multi-scale degradation evolution trajectory model is constructed based on a full-life-cycle spectral database of historical batches of drugs, the multi-scale degradation evolution trajectory model incorporating environmental parameter influencing factors to realize collaborative modeling of spectral features and environmental factors; The 8-dimensional fusion feature vector of the current batch of drugs is subjected to dynamic trajectory matching and deviation measurement by using the multi-scale degradation evolution trajectory model, and a drug degradation risk index is calculated; When the drug degradation risk index exceeds a preset threshold, a near expiration degradation early warning instruction is triggered, and intervention suggestion information is generated.
2. The method for analyzing quality inspection data of near-expiration liquid pharmaceutical preparations according to claim 1, characterized by, The multi-wavelength optical sensing array comprises at least five light emitting units and one common photoelectric receiving unit, the at least five light emitting units respectively emitting monochromatic light with central wavelengths of 280 nanometers, 320 nanometers, 410 nanometers, 550 nanometers and 650 nanometers, the light emitting units being sequentially polled and lighted, and the common photoelectric receiving unit synchronously recording the transmission light intensity at the corresponding wavelengths, the sampling frequency being not less than 10 times per second.
3. The method of analyzing quality inspection data of near-expiration liquid pharmaceutical preparations according to claim 1, characterized by, The edge-side lightweight feature compression performed on the original multi-channel spectral time series data stream to generate a low-dimensional spectral feature vector comprises the following steps: Sliding window mean filtering is performed on the original transmission light intensity sequence of each wavelength channel, the window length being 30 sampling points; The normalized absorbance value of each wavelength channel within a current time window is calculated, the normalized absorbance value being equal to the ratio of the transmission light intensity to the initial reference transmission light intensity under the negative natural logarithm; The absolute values of the first-order difference values of the change rates of the normalized absorbance values of the three wavelength channels with the largest normalized absorbance value change rates are selected, and the normalized absorbance values and the first-order difference values thereof are combined into a 6-dimensional spectral feature vector, which is taken as the low-dimensional spectral feature vector.
4. The method of analyzing quality inspection data of near-expiration liquid pharmaceutical preparations according to claim 1, characterized by, The full-life-cycle spectral database of the historical batches of drugs stores the multi-wavelength normalized absorbance sequences of each historical batch of drugs measured under the same environmental conditions from the date of leaving the factory to the date of expiration, and the key degradation inflection point time stamp and the principal component degradation path identifier of the corresponding batch determined in the accelerated stability test.
5. The method of claim 1, wherein the method is a method of analyzing quality test data of a near-expiry liquid pharmaceutical preparation, characterized by, The multi-scale deterioration evolution trajectory model is a hierarchical hidden Markov model, wherein a bottom layer state node represents an initial oxidation or hydrolysis reaction stage at a micro-molecular level, a middle layer state node represents a gradual deviation stage of macroscopic physicochemical properties such as turbidity and chroma, and a top layer state node represents a mutation deterioration stage near a failure period. Transition probability matrices and observation probability distribution parameters of the hierarchical hidden Markov model are obtained by offline training using a full-life-cycle spectrum database of the historical batches of drugs through a maximum likelihood estimation method.
6. The method of analyzing quality inspection data of near-expiration liquid pharmaceutical preparations according to claim 5, characterized by, Using the multi-scale deterioration evolution trajectory model, a 8-dimensional fusion feature vector of the current batch of drugs is subjected to dynamic trajectory matching and deviation measurement, and a drug deterioration risk index is calculated, including: a low-dimensional spectrum feature vector sequence of the current batch of drugs is input into the hierarchical hidden Markov model, and a most probable state transition path is calculated; a first entry time prediction value of a top layer state node in the state transition path is extracted; the first entry time prediction value is compared with a current remaining validity period, and if the first entry time prediction value is earlier than the current remaining validity period minus 72 hours, it is determined that there is a deterioration risk; the drug deterioration risk index is a negative function of a time difference between the first entry time prediction value and the current remaining validity period, specifically an exponential negative function, and the expression is: ; wherein is a 12 hour time constant, is a deterioration risk index, is a current remaining validity period, is a first entry time prediction value, the risk index exponentially increases with decreasing time difference value, the smaller the time difference value, the higher the risk index.
7. The method of analyzing quality inspection data of near-expiration liquid pharmaceutical preparations according to claim 6, characterized by, The preset threshold is set according to the drug category, and for biological product liquid drugs, the time difference corresponding to the preset threshold is 48 hours; for chemical synthesis liquid drugs, the time difference corresponding to the preset threshold is 24 hours.
8. The method of analyzing quality inspection data of near-expiry liquid pharmaceutical preparations according to claim 1, characterized by, The intervention suggestion information includes one or more of suggestions for preferentially using the batch of drugs, starting a re-inspection process, adjusting storage temperature and humidity parameters, or isolating for scrap processing, and the generation rule of the intervention suggestion information is determined based on the drug category, the current storage environment parameters and the quantitative level of the deterioration risk index.
9. The method of analyzing quality inspection data of near-expiry liquid pharmaceutical preparations according to claim 1, characterized by, The method further includes: storing, in the edge device, original multi-channel spectrum time series data streams of the last 7 days locally; when the deterioration risk index returned by the cloud collaborative analysis platform exceeds the preset threshold, the edge device automatically retrieves the cached data and performs high-resolution local reanalysis, specifically including: using a sliding window filter with a window length of 10 sampling points, calculating the second difference value of the normalized absorbance value, and retaining the original features of all 5 wavelength channels, to verify the reliability of the early warning result; if the reanalysis result is consistent with the cloud early warning, the out-of-stock permission of the batch of drugs is locked, and a locking instruction is sent to the quality management system.
10. The method of analyzing quality inspection data of near-expiration liquid pharmaceutical preparations according to claim 3, characterized by, The measurement range of the temperature and humidity sensor is -20℃ to 60℃ for temperature and 10% to 95% for relative humidity, and the measurement accuracy is ±0.5℃ and ±3% respectively; the measurement range of the light intensity sensor is 0 to 10000 lux, and the measurement accuracy is ±5%; The environmental parameter time series data and the transmission light intensity signal are synchronously sampled, and one set of environmental parameter data is generated every 3 seconds, which is associated with the spectrum data of the corresponding time window one by one; The mean and variance of the environment feature vector are calculated by the environment parameter data of 30 sampling points in the current time window, and the 6-dimensional spectrum feature vector is spliced with the temperature mean, temperature variance, humidity mean, humidity variance, illumination mean and illumination variance, i.e., the original 6-dimensional spectrum feature vector, to form an 8-dimensional fusion feature vector.
Citation Information
Patent Citations
Systems and methods for measuring, learning, and using emergent properties of complex adaptive systems
CA3192913A1
Name entity recognition with deep learning
CN113853606A
Capsule medicine multi-modal defect detection system and multi-dimensional detection method
CN120177730A
Method for predicting technical condition of tunnel civil engineering structure
CN120197136A
Equipment state data management method and system applied to automatic radix astragali seu hedysari refined production line
CN120471323A
