Drug information recording method based on artificial intelligence

By collecting and integrating multimodal data from drug production, performing time-series alignment and feature priority classification, constructing multi-level feature maps, and dynamically analyzing the evolution of drug quality, the problems of data correlation and risk assessment in drug information recording have been solved, thus realizing intelligent and precise drug quality management.

CN121583471APending Publication Date: 2026-02-27WUXI DOCTOR OF MEDICINE INTELLIGENT TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202511556445.2
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-10-29
Publication Date
2026-02-27

AI Technical Summary

Technical Problem

Existing methods for recording drug information cannot fully cover all key aspects of drug production. They lack effective integration and temporal alignment of multimodal data, resulting in weak data correlation and an inability to form standardized information sequences. This affects the accuracy of feature extraction and analysis, and they lack the ability to dynamically track the evolution of drug quality and assess risks, making it difficult to meet the regulatory needs of modern drug production.

Method used

Multimodal data from the drug production process is collected, time-series aligned to generate standardized drug information sequences, drug feature sets are extracted and feature priorities are assigned according to drug regulatory requirements, multi-level feature maps are constructed, dynamic weight allocation algorithms are used to analyze the temporal evolution of the feature maps, and anomaly probability distributions at key drug production nodes are calculated using deep learning models to generate drug information record reports.

Benefits of technology

It achieves comprehensive coverage and standardization of drug information recording, improves the accuracy of feature extraction and the precision of analysis, enables dynamic tracking of changes in drug quality, provides detailed risk assessment data, and supports drug quality and safety management.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121583471A_ABST
    Figure CN121583471A_ABST
Patent Text Reader

Abstract

The invention relates to the technical field of medicine information management, and discloses a medicine information recording method based on artificial intelligence. The method comprises the following steps: acquiring component spectral data, production environment parameters, package identification images and other multi-modal data in a drug production process, generating a standardized drug information sequence through time sequence alignment processing, and extracting component purity, production batch consistency and package integrity feature sets from the standardized drug information sequence; dividing feature priorities according to supervision requirements, and respectively constructing fine-grained and coarse-grained analysis grids to form a multi-level feature map; and obtaining a drug quality evolution spectrum through a dynamic weight distribution algorithm, calculating abnormal probability distribution of production key nodes by using a deep learning model, and outputting production state evaluation data. And combining the evaluation data to identify the number of defect events and a preset quality standard curve to obtain an accumulated risk value, and finally generating a medicine information recording report, thereby realizing intelligent and accurate recording and analysis of the whole flow information of medicine production.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The present application relates to the technical field of medicine information management, in particular to a medicine information recording method based on artificial intelligence. BACKGROUND

[0002] As a special commodity related to public health, the quality and safety of medicines have always been highly concerned by the society. The accurate recording of medicine information is an important prerequisite for ensuring the traceability and supervision of medicine quality. In the traditional medicine production process, information recording relies on manual operation or single-type data acquisition equipment, which has many limitations. The manual recording method not only has low efficiency, but also is prone to data errors, omissions and distortions due to human errors, making it difficult to meet the information management needs of large-scale medicine production. The single data acquisition mode cannot comprehensively cover all key links of medicine production, such as focusing on ingredient detection data while ignoring changes in production environment parameters, or recording packaging information while missing dynamic fluctuations in ingredient purity, resulting in incomplete medicine information that cannot fully reflect the true state of medicine production.

[0003] With the rapid development of the pharmaceutical industry, the medicine production process is becoming increasingly complex, and the multi-variety and multi-batch production mode has higher requirements for the timeliness and accuracy of information recording. In the existing technology, some medicine information recording systems attempt to integrate multi-source data, but due to differences in the collection time sequence of different types of data, there is a lack of effective alignment processing mechanism, resulting in weak correlation between data and inability to form standardized information sequences, which further affects the accuracy of subsequent feature extraction and analysis. At the same time, in the feature analysis process, the existing methods mostly use a unified analysis granularity, and fail to differentiateially process features of different importance levels according to medicine supervision requirements, so that the detailed information of high-priority features cannot be fully mined, and the analysis of low-priority features occupies too much computing resources, affecting the overall analysis efficiency.

[0004] Medicine quality is not static but presents a dynamic evolution characteristic over time in the whole production process. The existing information recording methods often only focus on quality data at a single time node, lack the ability to dynamically track and analyze the evolution of quality, and are difficult to identify potential production defect risks in advance. In the risk assessment link, traditional methods mostly make judgments based on a single defect event, without considering the cumulative effect of defect events, resulting in an incomplete assessment of medicine production risks and an inability to provide accurate risk warning basis for regulatory authorities and production enterprises. The existence of these problems makes the existing medicine information recording method difficult to adapt to the supervision needs of modern medicine production and unable to provide reliable information support for medicine quality and safety. Therefore, an intelligent medicine information recording method is needed that can integrate multi-modal data, achieve accurate feature analysis and dynamic risk assessment. SUMMARY

[0005] The present application aims to provide an artificial intelligence-based drug information recording method to solve the problems raised in the background art.

[0006] To achieve the above-mentioned purpose, the present application provides an artificial intelligence-based drug information recording method, which comprises:

[0007] Collecting multi-modal data in the drug production process, the multi-modal data including drug ingredient spectral data, production environment parameters and packaging identification images;

[0008] Performing time alignment processing on the multi-modal data to generate a standardized drug information sequence;

[0009] Extracting a drug feature set from the standardized drug information sequence, the drug feature set including ingredient purity features, production batch consistency features and packaging integrity features;

[0010] According to the drug regulatory requirements, dividing the feature priority, generating a fine-grained analysis grid for high-priority features and a coarse-grained analysis grid for low-priority features, and constructing a multi-level feature map of drug information based on the grid division results;

[0011] Using a dynamic weight distribution algorithm to analyze the time evolution law of the multi-level feature map to generate a drug quality evolution spectrum;

[0012] Based on the drug quality evolution spectrum, calculating the abnormal probability distribution of the drug production key nodes through a deep learning model, and outputting drug production state evaluation data;

[0013] According to the drug production state evaluation data, identifying the number of occurrences of drug production defect events, combining a preset drug quality standard curve to obtain a cumulative risk value of drug production defects, and then generating a drug information recording report based on each cumulative risk value.

[0014] Preferably, the time alignment processing of the multi-modal data comprises:

[0015] Detecting the offset between the time stamp of the drug ingredient spectral data and the time stamp of the production environment parameters;

[0016] Using an interpolation compensation algorithm to reconstruct the data of the time sequence segment whose offset exceeds the threshold value;

[0017] Spatially registering the reconstructed drug ingredient spectral data and the packaging identification images according to the production batch number to generate the standardized drug information sequence with a unified time reference.

[0018] Preferably, the extraction of the drug feature set from the standardized drug information sequence comprises:

[0019] performing wavelet transform decomposition on the standardized drug information sequence to obtain a frequency energy distribution of a drug component;

[0020] extracting a temperature gradient feature and a humidity fluctuation feature in the production environment parameter through a convolution attention mechanism;

[0021] performing local texture enhancement on the packaging identification image using a generative adversarial network to extract a pixel anomaly degree feature of a damaged packaging area;

[0022] combining the frequency energy distribution, the temperature gradient feature, the humidity fluctuation feature, and the pixel anomaly degree feature into the drug feature set.

[0023] Preferably, the feature priority is divided according to the drug regulatory requirements, including:

[0024] querying mandatory detection items in the drug production specification for different drug categories, and marking features corresponding to the mandatory detection items as high-priority features;

[0025] analyzing the defect type distribution in historical drug recall events, and dynamically adjusting features associated with high-frequency defect types to high-priority features;

[0026] using an entropy method to calculate the information contribution of the remaining features that are not marked, and dividing medium-priority features and low-priority features according to a contribution threshold.

[0027] Preferably, the high-priority features are generated into a fine-grained analysis grid, including:

[0028] mapping the high-priority features to a three-dimensional spatial coordinate according to the physical layout of the drug production line;

[0029] setting the grid cell length according to the preset drug component detection accuracy requirement with the three-dimensional spatial coordinate as the center;

[0030] using a parallel computing framework to perform boundary fusion processing on adjacent grid cells to generate the continuously distributed fine-grained analysis grid.

[0031] Preferably, the dynamic weight distribution algorithm is used to analyze the time evolution law of the multi-level feature map, including:

[0032] constructing an association matrix of drug production stages and feature change rates;

[0033] adjusting the weight coefficients of the association matrix according to real-time feedback data of drug production defect events;

[0034] capturing feature mutation points after weight adjustment through a time convolution network, and integrating feature change trajectories between adjacent mutation points into the drug quality evolution spectrum.

[0035] Preferably, the calculation of the abnormal probability distribution of the key nodes of the drug production by the deep learning model comprises:

[0036] A space-time graph neural network containing multi-dimensional features of drug ingredients, environment and packaging is constructed;

[0037] The drug quality evolution spectrum is input into the space-time graph neural network for node state prediction;

[0038] The deviation degree of the predicted state and the actual production data is decoded by a gated recurrent unit, and the abnormal probability distribution of each key node is output.

[0039] Preferably, the number of occurrence of the drug production defect event is identified according to the drug production state evaluation data, comprising:

[0040] A probability threshold and a duration threshold of the drug production defect event are set;

[0041] The abnormal nodes exceeding the probability threshold are detected by time window sliding, and the number of continuous abnormal sections meeting the duration threshold is counted;

[0042] Each continuous abnormal section is recorded as an independent drug production defect event.

[0043] Preferably, the preset drug quality standard curve is combined, comprising:

[0044] According to the type of the drug, the corresponding quality allowable fluctuation range is loaded from a regulatory database;

[0045] The cumulative risk value is mapped to a normalized coordinate of the quality allowable fluctuation range;

[0046] When the normalized coordinate exceeds a preset safety interval, a revision flag of a drug information record report is triggered.

[0047] Preferably, the drug information record report is further generated based on the cumulative risk value, comprising:

[0048] The multi-level feature map, the drug quality evolution spectrum and the abnormal probability distribution data of the whole process of drug production are aggregated;

[0049] The aggregated data is converted into a structured field according to a report template of a drug regulatory agency;

[0050] The structured field is version controlled based on the revision flag, and the final version of the drug information record report is output.

[0051] Compared with the prior art, the present application has the following advantages:

[0052] By collecting multi-modal data in the production process of pharmaceuticals, key information dimensions such as drug ingredients, production environment, and packaging identification are comprehensively covered, breaking the limitations of traditional single data collection mode. This makes the drug information record cover the core elements of the entire production process, forming a more complete information foundation. The introduction of multi-modal data can reflect the actual situation of drug production from different angles, avoiding the recording bias caused by one-sided information, and making subsequent analysis and evaluation more objective and comprehensive.

[0053] The application of time alignment processing mechanism effectively solves the problem of inconsistent timing of different types of data collection, converts scattered multi-modal data into standardized drug information sequences, and ensures the relevance and unity of the data. The standardized information sequence provides a standardized data foundation for subsequent feature extraction, making the extraction of feature sets more targeted and accurate, and enabling the precise capture of key features such as ingredient purity, production batch consistency, and packaging integrity, providing reliable feature support for drug quality analysis.

[0054] According to the requirements of drug regulation, the priority of features is divided, and multi-level feature maps are constructed using fine-grained and coarse-grained analysis grids, realizing the differentiated processing of features of different importance. Fine-grained analysis of high-priority features can deeply excavate the details of key information, fully meeting the strict requirements of regulators on core quality indicators; coarse-grained analysis of low-priority features effectively saves computing resources while ensuring basic information capture, improving overall analysis efficiency. This differentiated grid division approach balances the accuracy and efficiency of analysis, making the feature map more in line with actual regulatory needs.

[0055] The use of dynamic weight allocation algorithm can accurately capture the time evolution law of multi-level feature maps, and the generated drug quality evolution spectrum clearly presents the dynamic change trend of drug quality in the entire production process, changing the limitations of traditional methods that only focus on single time node data. Through analysis of the quality evolution law, possible quality fluctuations in the production process can be perceived in advance, providing an effective reference for timely adjustment of production strategies.

[0056] The introduction of deep learning models realizes the accurate calculation of the abnormal probability distribution of key nodes in drug production, and the output production status evaluation data can objectively reflect the production status of each link, helping to quickly identify production defect events. Combined with the preset drug quality standard curve to calculate the cumulative risk value, the cumulative effect of defect events is fully considered, making risk assessment more comprehensive and scientific. The generated drug information record report can provide detailed and reliable information for drug regulation, production optimization, and other aspects, promoting the development of drug production management towards intelligent and precise direction. BRIEF DESCRIPTION OF DRAWINGS

[0057] Figure 1 Trend chart of core characteristics of drug quality changing with production days;

[0058] Figure 2 Flow chart of extracting drug feature set;

[0059] Figure 3 Flow chart of dynamic weight distribution and drug quality evolution spectrum generation;

[0060] Figure 4 Drug quality evolution spectrum chart at each stage of drug production. DETAILED DESCRIPTION

[0061] The technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the drawings in the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present application, rather than all the embodiments. Based on the embodiments in the present application, all other embodiments obtained by those skilled in the art without creative labor fall within the scope of the present application.

[0062] Please refer to Figure 1 The present application provides a drug information recording method based on artificial intelligence, which comprises: starting to execute by collecting multi-modal data in the drug production process, wherein the multi-modal data specifically includes drug component spectrum data, production environment parameters and packaging identification images. Then, the collected multi-modal data is subjected to time sequence alignment processing, aiming to solve the problem of time asynchronization caused by different collection frequencies or starting time differences of different sources of data. The processed data is integrated to generate a standardized drug information sequence. Next, a key drug feature set is extracted from the standardized drug information sequence, which includes component purity features reflecting the intrinsic quality of the drug, production batch consistency features reflecting the production stability, and packaging integrity features reflecting the appearance quality. Then, according to the specific requirements of drug regulatory regulations, the extracted features are prioritized, fine-grained analysis grids are generated for high-priority features, and coarse-grained analysis grids are generated for low-priority features. Based on these grids of different granularities, a multi-level feature map capable of fully representing drug information is constructed. Then, a dynamic weight distribution algorithm is used to deeply analyze the dynamic change law of the multi-level feature map over time, thereby generating a drug quality evolution spectrum capable of tracing the quality changes. Based on this evolution spectrum, a deep learning model is used to calculate the probability distribution of abnormality of each key control node in the drug production process, and output quantitative evaluation data of the drug production state. Finally, the specific occurrence frequency of production defect events is identified according to the state evaluation data, and the cumulative risk value of defects is calculated by combining the preset drug quality standard curve, and finally a complete and structured drug information recording report is generated based on all related data.

[0063] Embodiment 1: refer to Figure 2 In the multi-modal data acquisition stage of drug product information, the system synchronously records the drug component spectral data from the output of the spectrometer, the production environment parameters recorded from the environmental sensor network, and the packaging identification image captured from the industrial camera. The drug component spectral data exists in the form of absorbance or reflectance sequence in a specific wavelength range, the production environment parameters include time series readings of variables such as temperature, humidity, and pressure difference, and the packaging identification image is a high-resolution optical image. The first step of time alignment processing is to accurately detect the offset between the timestamp sequence of drug component spectral data and the timestamp sequence of production environment parameters. The detection process is completed by comparing the time difference of the two types of data streams at the same physical event marker point. For example, the time when the spectrometer records a certain characteristic spectral peak should theoretically align with the time when the temperature sensor records the end of the heating stage of the reactor. The difference between the two times is the offset. When the absolute value of the calculated offset exceeds the preset threshold, such as more than five percent of the standard period of a single production process, the interpolation compensation algorithm is activated to reconstruct the data for the time sequence segment with offset exceeding the limit. The interpolation compensation algorithm uses a curve matching method based on dynamic time warping to fit and replace the missing or obviously misplaced data points while maintaining the original morphological characteristics of the data, generating a continuous and aligned compensated sequence on the time axis. After completing the time alignment and compensation of spectral data and environmental parameters, the processed data needs to be integrated with the packaging identification image, which itself contains the timestamp of the image acquisition time and the corresponding production batch number. The integration process spatially registers all data elements according to the unified production batch number. Spatial registration ensures that the component data, environmental data, and final packaging image of the same batch of drugs have the same starting reference point and the same sampling interval on the time axis, ultimately generating a standardized drug information sequence with a unified time reference and strict synchronization between multi-modal data.

[0064] The extraction of drug feature set from standardized drug information sequence is a multi-branch parallel processing process. For the drug ingredient spectrum data in the sequence, wavelet transform is used for multi-scale decomposition. Wavelet transform decomposes one-dimensional spectrum signal into coefficients on different frequency subbands. The energy value of each subband coefficient is calculated to obtain the frequency energy distribution representing the characteristics of the ingredients. This distribution can reflect the purity information of specific chemical ingredients in the drug and the possible interference of impurities. For the production environment parameters in the sequence, a convolution attention mechanism is used for deep feature extraction. The convolution attention mechanism model will perform convolution operation on temperature, humidity and other time series data to capture local fluctuation patterns, and automatically focus on the segments with sharp changes in the sequence through attention weight calculation, thereby extracting discriminative temperature gradient features and humidity fluctuation features. These features reflect the stability and controllability of the production environment. For the packaging identification image data in the sequence, the processing flow is to use the generative adversarial network architecture for local texture enhancement and defect feature extraction. The generator network in the generative adversarial network is responsible for super-resolution reconstruction and texture enhancement of the input image, so that the tiny scratches, blurred printing or stain areas on the packaging material become more obvious. The discriminator network in the generative adversarial network is responsible for distinguishing normal areas and potential abnormal areas in the enhanced image, and outputting pixel-level abnormality degree features of the packaging damage area by calculating the difference. Finally, the feature merging module performs standardization scaling and vector splicing operations on the frequency energy distribution features obtained from wavelet transform, the temperature gradient features and humidity fluctuation features extracted from the convolution attention mechanism, and the pixel abnormality degree features obtained from the generative adversarial network, and merges them to form a comprehensive drug feature set that comprehensively describes the drug ingredients, production environment and packaging status. The drug feature set is the direct input for subsequent analysis and atlas construction.

[0065] In the data reconstruction stage of the time alignment processing, the dynamic time warping algorithm minimizes the cumulative distance by finding the optimal nonlinear alignment path between the two time series. The algorithm traverses all points of the spectral data sequence and the environmental parameter sequence, calculates the Euclidean distance between points and constructs a distance matrix, then uses the dynamic programming method to find a path from the top left corner to the bottom right corner of the matrix, so that the sum of the distances of each point on the path is minimized. This path is the optimal bending path, according to which the original sequence is resampled and interpolated, so that the two sequences are aligned in time. For the integration of the packaging identification image, the system reads the metadata information of the image to obtain the acquisition timestamp accurate to milliseconds, and regards the image data as a multi-dimensional data point at a specific time point, together with the spectral data and environmental parameter data at the corresponding time, arranged in chronological order to form a unified standardized drug information sequence. In the feature extraction stage, the wavelet transform decomposition selects a wavelet basis function to decompose the spectral data into multiple layers, each layer of decomposition produces approximation coefficients and detail coefficients, and the energy value of each layer is calculated by squaring the detail coefficients to form a frequency energy distribution vector. The convolution attention mechanism model is composed of a one-dimensional convolution layer and an attention layer. The convolution layer slides and scans the environmental parameter sequence to extract local feature maps, and the attention layer assigns different weights to the features at different time steps in the sequence. The features corresponding to the time steps with large weight values are strengthened, and finally the temperature gradient feature and the humidity fluctuation feature are obtained after pooling. The training process of the generative adversarial network is to alternately optimize the generator network and the discriminator network. The generator network learns to map low-resolution or normal packaging images to high-resolution images with enhanced defects, while the discriminator network learns to distinguish between real normal packaging images and enhanced images generated by the generator network. In the adversarial training, the generator network gradually learns to highlight potential defect areas, and then quantifies the abnormality by calculating the pixel-level difference between the enhanced image and the standard template image. The final merged drug feature set is a high-dimensional numerical vector, which provides data input for subsequent priority division and grid analysis.

[0066] The priority of the features in the feature set is determined by three steps. The first step is to query the GMP database. The system will automatically match the mandatory test items according to the registered type and dosage form of the current production drug. The query process will locate the indicators that must be tested for a specific drug category in the specification file, such as for injection solution for intravenous injection, the specification requires testing of sterility, bacterial endotoxin, visible foreign matter and insoluble particles, while for oral solid preparation, the specification emphasizes content uniformity, dissolution and related substances. The system marks the features in the drug feature set that directly correspond to these mandatory test items as high-priority features. The component purity feature is usually associated with content, related substances, and the packaging integrity feature is associated with visible foreign matter. The next step is to access the historical drug recall event database, which records drug recall announcements and detailed defect classification issued by regulatory agencies over a period of time. The system analyzes the defect types in the database and calculates the frequency of each defect type, such as component content inconsistency, poor packaging seal, cross contamination, etc. in all recall events, generating a defect type distribution histogram. For high-frequency defect types in the distribution histogram with a frequency exceeding a certain threshold, the system dynamically adjusts the features in the drug feature set associated with them to high priority, even if these features are not explicitly listed as mandatory test items in the current production specification. This dynamic adjustment mechanism enables the priority classification to respond to actual quality risks.

[0067] For the remaining unmarked features in the drug feature set after the above two-step processing, the system uses the entropy method to calculate their information contribution. The calculation process of the entropy method is to calculate the information entropy of each feature according to its value distribution in the entire historical data set. The more uniform the feature value distribution, the higher the uncertainty, and the larger the information entropy value, indicating that the feature may carry more information. The specific calculation is to calculate the probability of each feature value falling into each preset interval, and then sum it according to the information entropy formula. The information entropy value of each feature is converted into its proportion relative to the total entropy value of all features, which is the information contribution of the feature. The system presets a contribution threshold, which can be set according to the total feature dimension and the analysis accuracy requirement. The features with a calculated information contribution higher than the threshold are classified as medium-priority features, and the features with a calculated information contribution lower than the threshold are classified as low-priority features. Through the three steps of specification query, historical event analysis and entropy method calculation, all features in the drug feature set are assigned to one of the three priority levels of high, medium and low, completing the priority classification of the features.

[0068] The high-priority features generated by the division are used to generate a fine-grained analysis grid. The grid generation process begins with spatial mapping. The system reads the digital design drawings of the pharmaceutical production line, which contain the three-dimensional spatial coordinates of all major equipment such as ingredient tanks, reaction kettles, conveying pipelines, filling machines, and sealing machines. High-priority features are mapped to the corresponding three-dimensional spatial coordinates according to their physical locations, such as the temperature gradient feature collected from the middle sensor of the reaction kettle is mapped to the three-dimensional coordinates of the center point of the reaction kettle, and the packaging image feature collected from the camera near the filling head is mapped to the three-dimensional coordinates of the filling point. The mapping process establishes a direct association between features and physical space. Next, the system determines the basic size of the grid cells according to the accuracy requirements of pharmaceutical ingredient detection. The accuracy requirements usually come from pharmacopoeia standards or internal quality control standards, such as the requirement for the detection accuracy of active ingredient concentration to be 0.05%. This accuracy requirement is converted into the minimum distance that can be distinguished in three-dimensional space, thereby setting the edge length of the grid cells. In the three-dimensional space model, a preliminary cubic grid cell is generated with the mapped coordinate point of each high-priority feature as the center, according to the set grid cell edge length. The initially generated grid cells in space may be discrete, discontinuous, or even overlapping or have gaps. In order to generate a continuously distributed analysis grid, boundary fusion processing of the initial grid cells needs to be performed using a parallel computing framework. The parallel computing framework divides the entire three-dimensional space into multiple sub-regions, which are assigned to different computing nodes for processing. Each computing node is responsible for boundary detection of the grid cells in its region, identifying overlapping or gap regions with adjacent grid cells. For overlapping regions, the parallel computing framework merges overlapping grid cells; for gap regions, the framework inserts new grid cells to fill the gaps. Boundary fusion processing ensures seamless connection between grid cells in the entire feature distribution space through iterative calculation, ultimately forming a fine-grained analysis grid that covers the spatial range of all high-priority features, with uniform cell size and continuous distribution. This fine-grained analysis grid provides a structured framework for deep spatial correlation analysis of high-priority features.

[0069] For medium and low priority features, different strategies are adopted to generate coarse-grained analysis grids. The generation of coarse-grained analysis grids also starts with spatial mapping, but the edge length of grid cells is set based on the analysis accuracy requirement for such features, which is relatively low. After the initial grid cells are generated, the parallel computing framework performs similar boundary fusion processing, but the fusion criteria are more relaxed, allowing larger grid cells to exist, and finally forming coarse-grained analysis grids with wider coverage and larger cell size. The coarse-grained analysis grid aims to capture the macroscopic distribution trend of medium and low priority features at a lower computational cost. Based on the divided fine-grained analysis grid and coarse-grained analysis grid, the system constructs a multi-level feature map of drug information. The multi-level feature map is a data structure that fills high-priority feature values into each cell of the fine-grained grid, fills medium and low-priority feature values into each cell of the coarse-grained grid, and records the spatial correspondence between different granularity grids. The multi-level feature map can simultaneously present the local details and overall outline of drug features.

[0070] In the entropy-based priority classification calculation step, the system needs to preprocess historical data to eliminate the dimension effect, and normalize each feature value to fall within the range of 0 to 1. Then, the probability of each feature value appearing in the historical sample is calculated, and then the entropy value is calculated according to the information entropy formula. The entropy value calculation involves logarithmic operation, and the system uses a stable numerical calculation library to ensure the accuracy of the calculation. The calculation of information contribution is to divide the entropy value of each feature by the sum of all feature entropy values, obtaining a percentage value between 0 and 1. The threshold setting is usually based on the feature dimension and the analysis target, for example, when the feature dimension is high, a lower contribution threshold may be set to filter out the features with relatively prominent information into the medium priority, to avoid too many medium priority features. In the fine-grained grid generation process, the determination of the grid cell edge length is a key step. The system converts the detection accuracy requirement into spatial resolution, for example, if the temperature gradient in the reaction kettle is required to be monitored to 0.1 Celsius degree change, and the spatial response characteristics of the temperature sensor are known, the minimum distance that can distinguish this temperature change in the reaction kettle space can be calculated, which is taken as the reference of the grid cell edge length. Parallel computing frameworks such as Apache Spark are used for boundary fusion, and Spark converts three-dimensional spatial data into elastic distributed datasets, and by parallel executing the adjacency relationship judgment and fusion algorithm of the grid cell on the cluster nodes, the speed of processing large-scale spatial data is significantly improved. The fusion algorithm checks whether the faces, edges and corners between the grid cells are in contact or overlap, and performs the corresponding merging or splitting operation. The final continuous fine-grained grid enables spatial interpolation, gradient calculation and other analysis operations to proceed smoothly. The construction of multi-level feature map is essentially a multi-resolution representation of spatial data, similar to the pyramid structure in image processing, fine-grained grid corresponds to high-resolution layer, and coarse-grained grid corresponds to low-resolution layer, this structure facilitates the analysis of feature patterns at different scales.

[0071] Example 3: see Figure 3The starting point of the dynamic weight allocation algorithm to analyze the time evolution law of multi-level feature spectrum is to construct the correlation matrix of drug production stages and feature change rates. The correlation matrix is a two-dimensional mathematical structure, the row index of which corresponds to each discrete stage of drug production, such as raw material pretreatment stage, synthesis reaction stage, purification and refining stage, sterile filling stage, and final packaging stage, and the column index of which corresponds to all features extracted from the drug feature set, including ingredient purity feature, production batch consistency feature, and sub-features under the packaging integrity feature. Each element value in the correlation matrix represents the initial weight coefficient of the change rate of the corresponding feature at a specific production stage. The assignment of the initial weight coefficient is based on the feature fluctuation typical pattern obtained by statistical analysis of historical normal production batch data. For example, in the synthesis reaction stage, the change rate of the reaction kettle temperature feature is usually more significant, and its initial weight coefficient will be set higher; in the final packaging stage, the change rate of the packaging sealing feature is more critical, and its initial weight coefficient will also be correspondingly increased.

[0072] After the correlation matrix is constructed, its weight coefficients will be dynamically adjusted according to the real-time feedback data of drug production defect events. The real-time feedback data comes from abnormal events reported by the quality control system upstream of the production line in real time, such as the online monitoring system detecting a filling volume instantaneous deviation exceeding the standard event. When such an event occurs, the system will analyze the event type and its associated production stage and feature dimension, and then update the weight coefficient at the corresponding position in the correlation matrix according to the preset adjustment rule. The adjustment rule can be expressed as:

[0073]

[0074] Wherein: represents the weight coefficient corresponding to the th production stage and the th feature in the correlation matrix after the th time interval or the th adjustment event. represents the weight coefficient after the next adjustment. is a learning rate parameter that controls the magnitude of weight adjustment. is an indicator function, which is 1 when the most recent defect event is identified as being related to the th production stage and the th feature, and 0 otherwise. is the severity index of the current defect event, which is quantitatively assigned according to the degree of deviation from the quality standard. Through this dynamic adjustment mechanism, the correlation matrix can gradually focus on the stage and feature combination that actually shows high risk in the current production process.

[0075] The weight-adjusted association matrix and the continuously updated multi-level feature map together serve as the input of the time convolution network. The time convolution network adopts an inflated causal convolution structure, which can capture long-term dependencies in time series without using recurrent connections. The network takes the feature sequence corresponding to each production stage (whose rate of change has been weighted by the adjusted weight coefficient) as the input channel, gradually expands the receptive field through multi-layer inflation convolution operation, and analyzes the evolution pattern of the features in the time dimension. The core task of the time convolution network is to identify the mutation points in the feature sequence, which refer to the time when the feature value or its rate of change jumps significantly and unexpectedly. The network determines the location of the mutation point by calculating the first-order difference and second-order difference of the sequence and combining the preset mutation threshold. Once the time convolution network identifies a series of mutation points in the feature sequence, the dynamic weight distribution algorithm defines the time interval between adjacent mutation points as a feature evolution segment. For each evolution segment, the algorithm integrates the change trajectory of all features within the segment, including calculating the difference between the feature values at the start and end points of the segment, calculating the average rate of change within the segment, and fitting the trend line. The information obtained after integrating each evolution segment, including the change direction, change amplitude, and change duration, is encapsulated as a feature evolution unit. Connecting all continuous feature evolution units in the time sequence of the entire production batch forms a complete trajectory depicting how the drug quality parameter dynamically evolves from the beginning to the end of production, which is defined as the drug quality evolution spectrum. The drug quality evolution spectrum not only records the change of the feature value itself, but more importantly, highlights the impact of key production events on the quality characteristics through dynamic weight and mutation point analysis, providing background information evolving over time for subsequent abnormal probability calculation.

[0076] In the initial stage of constructing the association matrix, the system needs to access a data warehouse containing a large number of historical normal production records. Each record in the data warehouse is marked with the production stage and the corresponding feature measurement value. The system assigns appropriate initial weights to each element in the association matrix by calculating statistical quantities such as standard deviation and coefficient of variation for each feature value in each stage, combined with the experience of domain experts. A feature with a high coefficient of variation may be assigned a lower initial weight in a particular stage, as it is inherently more volatile unless such volatility is proven to be strongly correlated with defects. The learning rate parameter needs to be set carefully, as a too large may cause weight oscillation, and a too small Quantification of the anomaly is usually based on the ratio of the deviation value to the standard limit, or according to the event type to look up a preset severity level table. The training of the time convolution network requires a large amount of labeled data, i.e., time series data containing known mutation point positions. The training process is carried out by minimizing the error between the predicted mutation point position of the network and the true mutation point position. The dilation factor of the dilated convolution increases exponentially with the increase of the depth of the network layer, for example, the first layer dilation factor is 1, the second layer is 2, the third layer is 4, and so on, which enables the deep network unit to see the input information in a very long time range. The detection of the mutation point is essentially a segmentation point recognition problem of the time series. In addition to the differential-based method, a likelihood ratio test or Bayesian information criterion-based method can also be used. The final generated drug quality evolution spectrum is a sequence structure of time series, and each time point corresponds to the summary information of a feature evolution unit. This evolution spectrum is the basic input for the subsequent deep learning model to perform node state prediction and anomaly detection.

[0077] Referring to Figure 4 , the graph takes the five key stages of drug production, raw material pretreatment, synthesis reaction, purification and refining, sterile filling, and final packaging, as the horizontal axis, and the quality index value as the vertical axis, synchronously presenting the dynamic evolution trend of the two core quality characteristics of ingredient purity and packaging integrity. From the ingredient purity curve: the raw material pretreatment stage is 92%, the synthesis reaction stage is improved to 95%, and the purification and refining stage reaches a peak of 97%; then the sterile filling stage decreases slightly, and the final packaging stage rebounds to 97.2%, showing a trend of gradual improvement-small fluctuations-final optimization. From the packaging integrity curve: the raw material pretreatment stage is at a high level, the synthesis reaction stage decreases slightly, and the purification and refining stage remains unchanged; but the sterile filling stage decreases significantly, and the final packaging stage rebounds, reflecting the characteristics of early stability-filling stage fluctuations-late partial recovery. The dynamic comparison of the two curves clearly shows the differential impact of different production stages on the two types of quality characteristics: purification and refining is the core link for improving ingredient purity, while sterile filling is the risk node for packaging integrity, providing intuitive data support for subsequent identification of key nodes of quality fluctuations, optimization of production process, and risk prevention and control.

[0078] Example 4: Constructing a deep learning model for computing the abnormal probability distribution of the key nodes in drug production, the core of which is to design a spatio-temporal graph neural network. The graph structure of the spatio-temporal graph neural network is constructed based on the physical layout and process logic of the drug production process. The key nodes in the drug production process are abstracted as nodes of the graph, including raw material feeding port, premix tank, main reactor, heat exchanger, precision filter, filling needle, and capping machine. The connection edges between nodes represent the actual flow direction and process sequence of materials or semi-finished products, for example, there is a directed edge from the raw material feeding port to the premix tank, and another directed edge from the main reactor to the heat exchanger. Each node is assigned a state vector containing multi-dimensional features collected or calculated at the corresponding node, which are derived from the drug feature set and may include component spectral features, temperature and pressure environment features, and intermediate product image features at the node. The advantage of the spatio-temporal graph neural network is that it can model both the spatial structural dependence relationship and the temporal dynamic evolution pattern between nodes. The drug quality evolution spectrum generated in the previous step is used as the main input data of the spatio-temporal graph neural network. The drug quality evolution spectrum provides the trajectory of the features at each key node over time. The processing of the spatio-temporal graph neural network includes information aggregation in both spatial and temporal dimensions. In the spatial dimension, graph convolution operations are performed at each time step, which aggregate the feature information of each node itself and its adjacent nodes, thereby capturing the mutual influence between different equipment nodes on the production line, for example, the temperature fluctuation of the main reactor may affect the efficiency of the downstream heat exchanger, which is reflected in the feature space through graph convolution. In the time dimension, the network uses structures such as gated recurrent units or temporal convolution to learn the dynamic change rule of the state sequence of each node. The gated recurrent unit selectively remembers historical state information and fuses the current input through its update gate and reset gate mechanism, thereby capturing the long-term temporal dependence of the node state.

[0079] Referring to Table 1, the spatio-temporal graph neural network predicts the state of each key node at one or more future time steps through alternating or coupled operations of spatial graph convolution and temporal sequence learning. The node state prediction value is a multi-dimensional vector representing the numerical value that the node feature should appear under normal production conditions. Subsequently, a gated recurrent unit decoder is used to calculate the deviation between the predicted state vector of the node and the actual state vector collected from the sensor. The deviation calculation usually uses distance measurement methods such as Euclidean distance or cosine similarity to quantify the difference between the predicted vector and the actual vector as a scalar value. This scalar deviation is then mapped to the interval of 0 to 1 through a fully connected layer and a Sigmoid activation function, and the output value is the abnormal probability of the node at that time point. This process is repeated for all key nodes at all sampling time points, and finally a detailed abnormal probability distribution map is obtained, which reveals when and where problems may occur in the production process.

[0080] Table 1: Drug production defect event identification parameters

[0081] Parameter Category Parameter Name Parameter Description Typical Value Threshold Parameter Threshold for Abnormal Probability The minimum probability value to determine a single time point as abnormal 0.75 Threshold Parameter Threshold for Duration The minimum continuous abnormal time required to determine an abnormal event as true 3 sampling periods Identification Parameter Time Window Step The time unit to move each time for sliding window detection 1 sampling period Output Parameter Defect Event Count The number of continuous abnormal segments that meet the threshold condition Integer (e.g. 0, 1, 2,...)

[0082] The number of drug production defect events is identified according to the drug production state evaluation data, which requires clear judgment rules. The core of the judgment rules is to set two threshold parameters: an abnormal probability threshold and a duration threshold. The abnormal probability threshold is a value between 0 and 1, which is used to determine whether the node state at a single sampling time point is abnormal. If the abnormal probability value of a node at a certain time point exceeds the abnormal probability threshold, the time point is marked as an abnormal time point. The duration threshold is a time length value, which is used to determine whether the anomaly lasts long enough to constitute a meaningful defect event, rather than a transient disturbance. The identification process uses a time window sliding detection algorithm. The algorithm traverses the entire production time axis and checks the abnormal probability sequence of each key node. For each time point in the sequence where the abnormal probability value exceeds the abnormal probability threshold, the algorithm checks the continuity of the abnormal state backward from the time point. The algorithm counts the number of time points that continuously exceed the abnormal probability threshold, and if the time length corresponding to the number of continuous abnormal time points is greater than or equal to the set duration threshold, the continuous abnormal time period is identified as an independent drug production defect event. The number of defect events identified on each key node is recorded separately, and finally the total number of defect events of all key nodes is summed up to obtain the total number of drug production defect events in the current production batch. This judgment method based on double thresholds and continuity can effectively filter out short-term random fluctuations and focus on persistent abnormalities with actual quality impact.

[0083] In the specific implementation of the spatio-temporal graph neural network, the graph convolution operation can use the graph attention network mechanism, so that the model can assign different attention weights to different neighbor nodes, thereby more finely depicting the influence strength between nodes. The input of the gated recurrent unit decoder includes not only the predicted state and the actual state of the current node, but also the feature summary of the global production state, to provide more rich context information for the deviation degree calculation. The generation of the abnormal probability distribution map is almost real-time, and as new production data flows into the model, the model will quickly update the prediction and probability calculation. In the defect event identification stage, the time window sliding detection algorithm can be applied to all key nodes in parallel to improve the calculation efficiency. Each defect event identified is recorded with its start time, end time, duration, associated key node information, and maximum abnormal probability value. These detailed information is helpful for subsequent root cause analysis.

[0084] Example 5: The operation in conjunction with the pre-set drug quality standard curve starts with loading the corresponding quality allowable fluctuation range from the regulatory database according to the specific type of the current production drug, which is matched by the unique identification code of the drug in the regulatory database, and the matching process is accurate to the generic name, dosage form, specification and even the manufacturer of the drug. The regulatory database stores the digitized files of various drug quality standards approved by the drug regulatory authorities, and the quality allowable fluctuation range exists in the form of structured data, which clearly specifies the upper limit, lower limit and target value of the key quality attributes. For example, for a certain chemical injection, the quality allowable fluctuation range may include the percentage of the labeled amount of active ingredient content, the allowable range of pH value, and the upper limit of the number of insoluble particles; for a certain biological product, the range may cover the minimum requirement of protein purity, the standard of residual DNA, and the range of potency. The system loads the quality allowable fluctuation range data that completely matches the current batch, which is internally represented as one or more computable quality standard curves. After loading the quality allowable fluctuation range, it is necessary to map the calculated cumulative risk value of the drug production defects into the normalized coordinate system of the range. The cumulative risk value is a quantitative indicator that integrates the frequency, severity and duration of defect events. The mapping process uses a linear or nonlinear normalization function, the input of which is the original value of the cumulative risk value, and the output is a normalized coordinate value between 0 and 1. The parameters of the normalization function are set according to the safety boundary of the quality allowable fluctuation range, for example, mapping the cumulative risk value of 0 to the normalized coordinate 0, mapping the cumulative risk value reaching the warning line threshold set by the quality allowable fluctuation range to the normalized coordinate 0.8, and mapping the cumulative risk value reaching the upper limit of the quality allowable fluctuation range to the normalized coordinate 1. Through normalization mapping, cumulative risk values of different dimensions and scales are converted to a unified and comparable coordinate scale.

[0085] The system presets a safety interval, which is a sub-interval on the normalized coordinate axis, for example, defined as [0, 0.7]. The system compares the normalized coordinate value corresponding to the cumulative risk value of the current batch of drugs with the preset safety interval in real time. When the normalized coordinate value falls within the safety interval, it indicates that the drug production quality risk is at an acceptable low level. When the normalized coordinate value exceeds the safety interval, for example, reaches 0.75, the system will immediately trigger a revision flag. The revision flag is a state variable, and its activation means that the final drug information record report cannot be directly output as the final version, but needs to go through an additional review or content revision process. The triggering condition of the revision flag can be set in stages, for example, when the normalized coordinate value exceeds 0.7 but does not exceed 0.9, trigger a first-level revision flag, prompting the quality engineer to review; when it exceeds 0.9, trigger a second-level revision flag, prompting the deviation investigation procedure to be started. The first step in generating a drug information record report based on each cumulative risk value is data aggregation, which collects all relevant data generated during the entire drug production process. The aggregated data includes standardized drug information sequences obtained from processed raw multi-modal data, extracted drug feature sets, constructed multi-level feature maps, calculated drug quality evolution spectra, abnormal probability distributions of key nodes output by the spatio-temporal graph neural network, identified drug production defect event lists and their cumulative risk values, and normalized coordinate results after comparison with the quality standard curve. Data aggregation ensures that the report content has complete traceability and data support.

[0086] The aggregated data is a mixture of multiple formats, including time series, feature vectors, graph structures, and probability matrices. The system converts the aggregated data into structured fields specified by the electronic report template published by the drug regulatory agency. The conversion process involves data format conversion and content extraction, for example, extracting the statistical features (mean, variance, trend slope) of the drug quality evolution spectrum time series data and filling them into the "quality trend analysis" table of the report template; summarizing the abnormal probability distribution data into the maximum and average abnormal probabilities of each production stage and filling them into the "key control point analysis" chapter; filling the cumulative risk value and its normalized coordinate value directly into the "overall risk assessment" field. The report template defines the name, data type, data format, and filling specification of each field.

[0087] The system continuously checks the status of the revision flag during the generation of the report. If the revision flag is in the inactive state, the system will directly output the current version of the structured report as the final version of the drug information record report. If the revision flag is in the active state, the system will initiate the version control mechanism. The version control mechanism will record the initial version of the report generation, and perform different revision processes based on the level of the revision flag. For a first-level revision flag, the system can automatically add a note in a specific section of the report, indicating that some risk parameters deviate slightly from the ideal range, and generate a report revision version number. For a second-level revision flag, the system can lock the automatic publishing process of the report, and push the draft report together with detailed abnormal data to the quality management personnel for manual review and revision, and generate a new report version after the review and revision. The final output of the drug information record report will be clearly marked with its version number, generation time, and whether it has been revised.

[0088] It should be noted that the relational terms herein such as first and second and the like are used solely to distinguish one from another entity or action, without necessarily requiring or implying any such actual relationship or order between such entities or actions. Moreover, the terms "comprises", "comprising", or any other variations thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements does not include only those elements but can include other elements not expressly listed or inherent to such process, method, article, or apparatus.

[0089] While the embodiments of the application have been illustrated and described, it will be understood by those skilled in the art that various changes, modifications, substitutions, and alterations can be made therein without departing from the spirit and scope of the application, which is defined by the following claims and their equivalents.

Claims

1. A method for recording drug information based on artificial intelligence, characterized in that, include: Collect multimodal data during the drug production process, including drug component spectral data, production environment parameters, and packaging label images; The multimodal data is subjected to time-series alignment processing to generate a standardized drug information sequence; A drug feature set is extracted from the standardized drug information sequence, and the drug feature set includes component purity features, production batch consistency features, and packaging integrity features. Based on drug regulatory requirements, feature priorities are divided, fine-grained analysis grids are generated for high-priority features, and coarse-grained analysis grids are generated for low-priority features. Based on the grid division results, a multi-level feature map of drug information is constructed. A dynamic weight allocation algorithm is used to analyze the temporal evolution of the multi-level feature map and generate a drug quality evolution spectrum. Based on the aforementioned drug quality evolution spectrum, the abnormal probability distribution of key nodes in drug production is calculated using a deep learning model, and drug production status assessment data is output. The number of drug production defect events is identified based on the drug production status assessment data. Combined with a preset drug quality standard curve, the cumulative risk value of drug production defects is obtained, and then a drug information record report is generated based on each cumulative risk value.

2. The method for recording drug information based on artificial intelligence as described in claim 1, characterized in that, The time-series alignment process for the multimodal data includes: The offset between the timestamp of the drug component spectral data and the timestamp of the production environment parameters; An interpolation compensation algorithm is used to reconstruct data for time series segments where the offset exceeds a threshold. The reconstructed drug component spectral data and packaging label images are spatially registered according to the production batch number to generate the standardized drug information sequence with a unified time reference.

3. The method for recording drug information based on artificial intelligence as described in claim 2, characterized in that, The step of extracting drug feature sets from the standardized drug information sequence includes: The standardized drug information sequence is decomposed by wavelet transform to obtain the frequency domain energy distribution of the drug components; Temperature gradient and humidity fluctuation features in production environment parameters are extracted using a convolutional attention mechanism. A generative adversarial network is used to enhance the local texture of packaging label images and extract pixel anomaly features of damaged packaging areas. The frequency domain energy distribution, temperature gradient features, humidity fluctuation features, and pixel anomaly features are combined into the drug feature set.

4. The method for recording drug information based on artificial intelligence as described in claim 1, characterized in that, The prioritization of characteristics based on drug regulatory requirements includes: Search for mandatory testing items for different drug categories in the drug manufacturing specifications, and mark the features corresponding to the mandatory testing items as high-priority features; Analyze the distribution of defect types in historical drug recall events and dynamically adjust the features associated with high-frequency defect types to high-priority features; The information contribution of the remaining unlabeled features is calculated using the entropy method, and features are divided into medium-priority features and low-priority features based on the contribution threshold.

5. The method for recording drug information based on artificial intelligence as described in claim 4, characterized in that, The generation of fine-grained analysis meshes for high-priority features includes: High-priority features are mapped to three-dimensional spatial coordinates based on the physical layout of the drug production line; Centered on the three-dimensional spatial coordinates, the side length of the grid cells is set according to the preset drug component detection accuracy requirements; A parallel computing framework is used to perform boundary fusion processing on adjacent grid cells to generate the continuously distributed fine-grained analysis grid.

6. The method for recording drug information based on artificial intelligence as described in claim 1, characterized in that, The analysis of the temporal evolution of the multi-level feature map using a dynamic weight allocation algorithm includes: Construct a correlation matrix between drug production stages and characteristic change rates; The weighting coefficients of the correlation matrix are adjusted based on real-time feedback data of drug manufacturing defect events; The feature mutation points after weight adjustment are captured by a temporal convolutional network, and the feature change trajectories between adjacent mutation points are integrated into the drug quality evolution spectrum.

7. The method for recording drug information based on artificial intelligence as described in claim 1, characterized in that, The calculation of the anomaly probability distribution of key nodes in drug production using a deep learning model includes: Construct a spatiotemporal graph neural network that incorporates multidimensional features of drug components, environment, and packaging; The drug quality evolution spectrum is input into a spatiotemporal graph neural network for node state prediction; The deviation between the predicted state and the actual production data is decoded by the gated loop unit, and the abnormal probability distribution of each key node is output.

8. The method for recording drug information based on artificial intelligence as described in claim 7, characterized in that, The step of identifying the frequency of drug manufacturing defect events based on the drug manufacturing status assessment data includes: Set probability thresholds and duration thresholds for drug manufacturing defect events; For abnormal nodes that exceed the probability threshold, a time window sliding detection is performed to count the number of consecutive abnormal segments that meet the duration threshold. Each consecutive abnormal segment is recorded as an independent drug manufacturing defect event.

9. The method for recording drug information based on artificial intelligence as described in claim 1, characterized in that, The combination of the preset drug quality standard curve includes: Load the corresponding permissible quality fluctuation range from the regulatory database based on the drug type; Map the cumulative risk value to normalized coordinates of the permissible fluctuation range of quality; When the normalized coordinates exceed the preset safety range, a revision flag for the drug information record report is triggered.

10. The method for recording drug information based on artificial intelligence as described in claim 9, characterized in that, The process of generating a drug information record report based on the cumulative risk values ​​includes: The multi-level feature map, drug quality evolution spectrum, and anomaly probability distribution data of the entire drug production process are aggregated. Convert aggregated data into structured fields according to the reporting templates of drug regulatory agencies; Version control is applied to structured fields based on revision flags, and the final version of the drug information record report is output.