Intelligent medicine storage management system based on artificial intelligence
By constructing an AI-based intelligent pharmaceutical warehousing and inventory management system, and combining structured data coupling analysis with an improved DistilBERT text risk identification algorithm, the problem of insufficient quantitative modeling of drug status in existing technologies has been solved. This enables risk-driven refined inventory control and closed-loop optimization management, thereby improving the intelligence level and security of inventory management.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- XINJIANG YAODUHUI PHARMACEUTICAL CO LTD
- Filing Date
- 2026-03-06
- Publication Date
- 2026-06-05
AI Technical Summary
Existing pharmaceutical warehouse management systems lack the ability to quantitatively model the condition and quality of medicines. They are unable to couple and analyze multi-source structured data such as temperature and humidity deviations, handling vibrations, and warehouse location migrations. This leads to high-risk batch delays, concentrated inventory in high-risk areas, and a disconnect between replenishment and allocation decisions and the actual risk situation, making it difficult to achieve risk-driven, refined inventory control and closed-loop optimization management.
An AI-based intelligent pharmaceutical warehousing and inventory management system is adopted. Through structured data coupling analysis, improved DistilBERT text risk identification algorithm and warehousing situation flow modeling technology, a risk flow trend model is constructed to generate outbound priority ranking and demand elasticity control strategies, thereby achieving dynamic closed-loop regulation.
It enables dynamic characterization of drug batch status, improves the comprehensiveness and accuracy of risk identification, avoids the retention of high-risk batches and the accumulation of inventory in risky areas, and improves inventory turnover efficiency and management intelligence.
Smart Images

Figure CN122155608A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of intelligent warehouse management technology, and in particular to an intelligent pharmaceutical warehouse inventory management system based on artificial intelligence. Background Technology
[0002] With the expansion of pharmaceutical distribution and the increasing demands for cold chain supervision, pharmaceutical warehouse management systems have gradually evolved from traditional manual ledger management to an information-based management model centered on the warehouse management system. Existing technologies typically achieve inventory management, batch traceability, and first-in, first-out (FIFO) control by recording and querying drug batch information, production dates, expiration dates, inbound and outbound records, and temperature and humidity monitoring data. Some systems can issue alarms for abnormal events such as excessive temperature and humidity or cold chain interruptions, and, combined with simple rules, lock or alert inventory, thus improving warehouse security and compliance to a certain extent.
[0003] However, existing technologies primarily focus on inventory quantity and single-point anomaly management, lacking the ability to quantitatively model the condition and quality of pharmaceuticals. They cannot couple and analyze multi-source structured data such as temperature and humidity deviations, handling vibrations, and storage location relocations, making it difficult to form a unified evaluation index reflecting the real-time health status of batches. Furthermore, for unstructured text data such as quality inspection records, anomaly handling instructions, and transportation anomaly notifications, existing systems typically only archive them as attachments, failing to automatically identify and quantify risk information within the text, thus preventing potential risks from being incorporated into inventory decision-making models.
[0004] Existing warehousing systems mostly employ static inventory strategies or replenishment models based on historical sales, failing to dynamically adjust based on batch status differences, risk distribution across storage areas, and the flow of risk between storage locations. They lack the overall capacity to characterize and predict the evolution of risk. This easily leads to problems such as high-risk batches remaining unsold, concentrated inventory in risky areas, and a disconnect between replenishment and allocation decisions and the actual risk situation, making it difficult to achieve risk-driven, refined inventory control and closed-loop optimization management.
[0005] Therefore, how to provide an AI-based intelligent pharmaceutical warehousing and inventory management system is a problem that urgently needs to be solved by those skilled in the art. Summary of the Invention
[0006] One objective of this invention is to propose an intelligent pharmaceutical warehousing and inventory management system based on artificial intelligence. This invention comprehensively utilizes structured data coupling analysis, an improved DistilBERT text risk identification algorithm, and warehousing situation flow modeling technology to quantitatively assess the status of drug batches, construct a risk flow trend model, and generate outbound priority ranking and demand elasticity control strategies based on this model. This enables dynamic closed-loop control of replenishment, allocation, and outbound operations, and has the advantages of strong risk identification capabilities, high precision in inventory decision-making, timely risk response, and improved inventory turnover efficiency.
[0007] The intelligent pharmaceutical warehousing and inventory management system based on artificial intelligence according to an embodiment of the present invention includes:
[0008] The data acquisition module collects structured and unstructured data from the pharmaceutical warehousing system.
[0009] The status fidelity module generates an initial status fidelity value for each batch of medicines based on structured data, and deducts the value item by item based on temperature and humidity deviation, handling records, vibration events and storage location relocation to obtain the current status fidelity value.
[0010] The text risk fusion module inputs unstructured data into the improved DistilBERT model, identifies risk categories and risk levels, generates text risk quantities, converts the text risk quantities into state fidelity deduction values, and corrects the state fidelity values based on the state fidelity deduction values to obtain the comprehensive state fidelity values for each batch.
[0011] The Situation Flow and Priority module constructs a warehouse situation flow structure based on the comprehensive status fidelity value, the batch's warehouse location migration path, the risk level of the storage area, and the batch's dwell time. It analyzes and identifies the risk flow trend within the warehouse, generates batch outbound priority ranking results, and calculates the proportion of high-risk batches.
[0012] The elastic control module generates an upper limit range for demand elasticity based on the overall status fidelity value of each batch in the entire warehouse, the risk density changes in the warehouse situation flow, and the proportion of high-risk batches, and controls the replenishment and allocation quantities.
[0013] The strategy write-back module generates replenishment strategies, transfer strategies, and outbound execution instructions based on the batch outbound priority sorting results and replenishment and allocation control results, and writes the execution results back to the warehouse management system to update warehouse inventory data and status flow data.
[0014] Optionally, the structured data includes drug batch information, production date, expiration date, inbound and outbound records, storage location migration, temperature and humidity monitoring data, cold chain exposure records, and risk level of storage area; the unstructured data includes quality inspection records, abnormal handling instructions, transportation abnormality notices, and inventory operation logs.
[0015] Optionally, the state fidelity module includes:
[0016] Based on the drug batch information, production date, and expiration date in the structured data, the nominal expiration date of each drug batch is determined, and combined with the risk level of the storage area in the structured data, a corresponding initial value for state fidelity is generated.
[0017] Based on the temperature and humidity monitoring data and cold chain exposure records in the structured data, the duration of temperature and humidity deviation of the batch within the statistical period is calculated, and based on the inbound and outbound records and storage location migration records in the structured data, the number of times the batch is handled and the number of times the storage location is migrated within the statistical period are calculated.
[0018] Based on the duration of temperature and humidity deviation, number of handling operations, and number of warehouse relocations, the initial value of state fidelity is deducted item by item according to the corresponding risk deduction weight to obtain the basic state fidelity value.
[0019] During the item-by-item deduction process, time correlation analysis is performed on multiple types of events from temperature and humidity monitoring data, cold chain exposure records, and inbound and outbound records. When temperature and humidity deviations and handling operations occur continuously within a set time window, the corresponding deduction results are superimposed and amplified. When temperature and humidity deviations persist for multiple statistical periods, the deduction values for each period are incremented to form event-coupled cumulative deduction results.
[0020] The basic state fidelity value after event coupling accumulation and deduction is subject to boundary constraint processing to ensure that the basic state fidelity value is not lower than zero and not higher than the initial state fidelity value, and the current state fidelity value is output.
[0021] Optionally, the text risk fusion module includes:
[0022] Unstructured data is subjected to text normalization processing, which includes character set unification, invalid symbol removal, and unification of time and quantity expression formats. According to the source type of unstructured data, the text is marked as quality inspection record text, anomaly handling description text, transportation anomaly notification text, or inventory operation log text, resulting in standardized text with source type marking.
[0023] An improved DistilBERT model is constructed, which consists of an input representation layer, a risk evidence aggregation layer, and a risk output calibration layer, wherein:
[0024] The input representation layer segments the standardized text into words and generates word vectors. At the same time, it introduces the source vectors corresponding to the source type tags and merges them with the word vectors to form the input sequence representation.
[0025] The risk evidence aggregation layer sets up a risk trigger fragment channel and a numerical time fragment channel on the basis of the DistilBERT encoding output. The risk trigger fragment channel aggregates keyword fragment representations related to risk, and the numerical time fragment channel aggregates fragment representations related to duration, frequency and magnitude.
[0026] The risk output calibration layer outputs risk category and risk level based on the aggregation results of the two channels, and performs consistency calibration on the combination of risk category and risk level to generate risk confidence.
[0027] The DistilBERT model is improved by inputting standardized text with source type tags to obtain the risk category, risk level and risk confidence level corresponding to each batch of drugs. The risk category, risk level and risk confidence level are summarized to generate the text risk quantity of the corresponding batch. The text risk quantity is determined by the risk category correspondence coefficient, the risk level correspondence coefficient and the risk confidence level according to the weighted synthesis method.
[0028] A state fidelity deduction value is generated based on the text risk quantity, and the state fidelity deduction value is determined by mapping the text risk quantity to the text mapping coefficient;
[0029] The state fidelity deduction value is applied to the state fidelity value to correct it, thereby obtaining the comprehensive state fidelity value for each batch.
[0030] Optionally, the situation flow and priority module includes:
[0031] Within a preset statistical period, the overall status fidelity value, storage location migration path, risk level of the storage area to which the storage location belongs, and residence time of each storage location are obtained for each batch of drugs. Each batch is organized into a sequence of multiple residence segments in chronological order. Each residence segment includes batch identifier, storage location, residence time, regional risk level, and overall status fidelity value.
[0032] Each storage location is discretized into storage location time nodes at a fixed time granularity. For any batch of adjacent residence periods, a spatial migration connection is established from the previous storage location time node to the next storage location time node. The risk load determined by the comprehensive state fidelity value and the risk level of the area before and after migration is recorded. For adjacent time nodes of the same storage location, a time continuity connection is established, and the risk residence amount determined by the residence duration and the decay result over time are recorded, forming a situation flow structure that includes spatial migration connection and time continuity connection.
[0033] By summarizing the risk retention at each storage location at each time point, the risk density changes over time. By summarizing the risk load at each spatial migration connection, the risk flow intensity between storage locations changes over time. Storage locations with continuously increasing risk density, migration directions with continuously increasing risk flow intensity, and main risk flow directions are identified, and the risk flow trend is output.
[0034] For each batch, based on the comprehensive status fidelity value, cumulative dwell time, number of migrations, number of high-risk storage location time nodes experienced, and the consistency of the path with the main risk flow, an outbound priority score is generated and the batches in the entire warehouse are sorted, and the outbound priority ranking result is output.
[0035] High-risk batches are marked according to preset high-risk judgment rules. The high-risk judgment rules include the overall state fidelity value being lower than the threshold or the risk density in the situation flow reaching the threshold. The proportion of high-risk batches to the total number of batches in the entire portfolio is used as the output of the high-risk batch ratio.
[0036] Optionally, the elastic control module includes:
[0037] Within a preset statistical period, the overall status fidelity value of each batch in the entire warehouse is obtained and the distribution characteristics of the overall status fidelity are summarized by category. The risk density change results of the warehouse situation flow in this period relative to the previous period and the proportion of high-risk batches in this period are obtained to form a set of flexible control input indicators.
[0038] Based on the set of elastic control input indicators, the center value of the elastic upper limit and the width of the elastic upper limit interval are determined. The center value of the elastic upper limit tightens as the overall fidelity of the comprehensive state decreases, the risk density increases, or the proportion of high-risk batches increases. The width of the elastic upper limit interval narrows as the risk density changes more drastically. Boundary constraints are applied to the center value of the elastic upper limit and the width of the elastic upper limit interval to obtain the demand elastic upper limit interval.
[0039] Based on the risk flow trend identification results, areas with continuously rising risk density and risk-dominant flow directions pointing to target areas are marked. When replenishment or transfer causes inventory to concentrate in the marked areas, the upper limit range of demand elasticity for the corresponding category is tightened. When replenishment or transfer causes inventory to disperse to low-risk areas, the upper limit range of demand elasticity for the corresponding category is widened, forming a dynamic upper limit range of demand elasticity.
[0040] For each product category, a replenishment recommendation quantity is generated based on the predicted demand, available inventory, and in-transit quantity. The upper limit range of dynamic demand elasticity is used as a replenishment ratio constraint. When the replenishment recommendation quantity exceeds the maximum allowable replenishment quantity corresponding to the upper limit range of dynamic demand elasticity, it is truncated. When the replenishment recommendation quantity is lower than the minimum guaranteed replenishment quantity corresponding to the lower limit range of dynamic demand elasticity and there is a risk of supply disruption, it is increased, and the replenishment control quantity is output.
[0041] Based on the available transfer volume in the source warehouse and the gap in the target warehouse, a transfer recommendation volume is generated for each transfer direction and category. The transfer limit is set using a dynamic demand elasticity upper limit range. When the proportion of high-risk batches in the source warehouse increases, or the source warehouse falls into a region with continuously increasing risk density, or the risk-driven flow points to the target region, the transfer limit is lowered. When the proportion of high-risk batches in the target warehouse decreases, or the transfer achieves risk de-transfer, the transfer priority is increased and executed within the transfer limit. The dynamic demand elasticity upper limit range, replenishment control volume, and transfer control volume are output.
[0042] Optionally, the policy write-back module includes:
[0043] Obtain the batch outbound priority sorting result, replenishment control quantity for each category, and transfer control quantity for each transfer direction. Use the batch outbound priority sorting result as the outbound execution order input, and use the replenishment control quantity and transfer control quantity as the upper limit of the execution quantity input to form an execution parameter set.
[0044] According to the batch outbound priority sorting results, the order demand and the current available inventory are matched in descending order to determine the actual outbound quantity of each batch. The actual outbound quantity does not exceed the current available inventory and does not exceed the order demand. The corresponding batch outbound instruction is generated and written into the execution queue.
[0045] For each product category, a replenishment execution quantity is generated based on the replenishment control quantity. The replenishment execution quantity shall not exceed the quantity limited by the replenishment control quantity. An inbound record is generated for each replenishment batch and the batch status parameters are initialized. A replenishment inbound instruction is generated and written to the execution queue.
[0046] For each allocation direction and category, the allocation execution quantity is determined based on the allocation control quantity. The allocation execution quantity does not exceed the quantity limited by the allocation control quantity. Source warehouse transfer-out instructions and target warehouse transfer-in instructions are generated simultaneously. The warehouse location migration path records and migration time records of the batches are updated to form new dwell time data.
[0047] After the outbound, replenishment and transfer are completed, the inventory quantity, batch inventory status and in-transit quantity of each warehouse are updated. Based on the updated batch set, the overall status fidelity value, the proportion of high-risk batches and the risk density data in the warehouse status flow are recalculated. The update results are written into the warehouse management system to complete the closed-loop update of inventory data and status flow data.
[0048] The beneficial effects of this invention are:
[0049] This invention constructs a batch status quantification model centered on comprehensive status fidelity. It couples structured data such as temperature and humidity deviations, handling vibrations, and storage location migrations, and introduces a text-based risk identification mechanism based on an improved DistilBERT model. This transforms unstructured information such as quality inspection records, anomaly handling instructions, and transportation anomaly notifications into calculable risk quantities and incorporates them into the status correction process, thereby achieving a dynamic depiction of the true quality status of drug batches. Compared to existing technologies that rely solely on quantity management or single-point alarms, this invention can form a unified, continuous, and comparable batch risk assessment index, significantly improving the comprehensiveness and accuracy of risk identification.
[0050] This invention further analyzes and identifies the flow trends of risk across different storage locations and time periods by constructing a warehouse situation flow structure that incorporates spatial migration and temporal evolution relationships. Based on these risk flow trends, it generates batch outbound priority ranking and high-risk batch proportion indicators, thereby achieving risk-driven outbound decision optimization. Compared to traditional first-in-first-out (FIFO) or fixed-rule strategies, this invention avoids the retention of high-risk batches and the accumulation of inventory in risky areas, improving the security and stability of the inventory structure.
[0051] At the inventory control level, this invention combines the overall state fidelity distribution, risk density changes, and the proportion of high-risk batches to generate a dynamic upper limit range for demand elasticity, and links replenishment and allocation volumes for control. Simultaneously, it writes back the execution results to form a closed-loop update mechanism, achieving real-time coupling between inventory decisions and risk status. Through the above technical solution, this invention can improve inventory turnover efficiency, reduce the probability of risk diffusion, and enhance the intelligence level and precision of warehouse management while ensuring pharmaceutical quality and safety. Attached Figure Description
[0052] The accompanying drawings are provided to further illustrate the invention and form part of the specification. They are used in conjunction with embodiments of the invention to explain the invention and do not constitute a limitation thereof. In the drawings:
[0053] Figure 1 The flowchart shows the intelligent pharmaceutical warehousing and inventory management system based on artificial intelligence proposed in this invention.
[0054] Figure 2 This is a schematic diagram of the improved DistilBERT text risk recognition structure of the AI-based intelligent pharmaceutical warehousing and inventory management system proposed in this invention. Detailed Implementation
[0055] The present invention will now be described in further detail with reference to the accompanying drawings. These drawings are simplified schematic diagrams, illustrating only the basic structure of the invention, and therefore only show the components relevant to the invention.
[0056] refer to Figure 1 and Figure 2 An AI-based intelligent pharmaceutical warehousing and inventory management system includes:
[0057] The data acquisition module collects structured and unstructured data from the pharmaceutical warehousing system.
[0058] The status fidelity module generates an initial status fidelity value for each batch of medicines based on structured data, and deducts the value item by item based on temperature and humidity deviation, handling records, vibration events and storage location relocation to obtain the current status fidelity value.
[0059] The text risk fusion module inputs unstructured data into the improved DistilBERT model, identifies risk categories and risk levels, generates text risk quantities, converts the text risk quantities into state fidelity deduction values, and corrects the state fidelity values based on the state fidelity deduction values to obtain the comprehensive state fidelity values for each batch.
[0060] The Situation Flow and Priority module constructs a warehouse situation flow structure based on the comprehensive status fidelity value, the batch's warehouse location migration path, the risk level of the storage area, and the batch's dwell time. It analyzes and identifies the risk flow trend within the warehouse, generates batch outbound priority ranking results, and calculates the proportion of high-risk batches.
[0061] The elastic control module generates an upper limit range for demand elasticity based on the overall status fidelity value of each batch in the entire warehouse, the risk density changes in the warehouse situation flow, and the proportion of high-risk batches, and controls the replenishment and allocation quantities.
[0062] The strategy write-back module generates replenishment strategies, transfer strategies, and outbound execution instructions based on the batch outbound priority sorting results and replenishment and allocation control results, and writes the execution results back to the warehouse management system to update warehouse inventory data and status flow data.
[0063] In this embodiment, the structured data includes drug batch information, production date, expiration date, inbound and outbound records, storage location relocation, temperature and humidity monitoring data, cold chain exposure records, and risk level of storage area. The unstructured data includes quality inspection records, abnormal handling instructions, transportation abnormality notifications, and inventory operation logs.
[0064] In this embodiment, the state fidelity module includes:
[0065] Based on the drug batch information, production date, and expiration date in the structured data, the nominal shelf life of each drug batch is determined. Combined with the risk level of the storage area in the structured data, a corresponding initial value for state fidelity is generated. Specifically, generating the corresponding initial value for state fidelity involves:
[0066] The nominal shelf life is calculated based on drug batch information, production date and expiration date, and the percentage of remaining shelf life at the statistical point in time is calculated. The percentage of remaining shelf life is used as the basic factor for the initial value.
[0067] Read the risk level of the storage area corresponding to the current location of the batch, map the risk level of the storage area to the regional risk correction factor, and the regional risk correction factor decreases as the risk level increases.
[0068] The initial value is calculated by fusing the basic factor and the regional risk correction factor and performing upper and lower limit processing to output the initial value of state fidelity.
[0069] Based on the temperature and humidity monitoring data and cold chain exposure records in the structured data, the duration of temperature and humidity deviation of the batch within the statistical period is calculated, and based on the inbound and outbound records and storage location migration records in the structured data, the number of times the batch is handled and the number of times the storage location is migrated within the statistical period are calculated.
[0070] Based on the duration of temperature and humidity deviation, number of handling operations, and number of warehouse relocations, the initial value of state fidelity is deducted item by item according to the corresponding risk deduction weight to obtain the basic state fidelity value.
[0071] During the item-by-item deduction process, time correlation analysis is performed on multiple types of events from temperature and humidity monitoring data, cold chain exposure records, and inbound and outbound records. When temperature and humidity deviations and handling operations occur continuously within a set time window, the corresponding deduction results are superimposed and amplified. When temperature and humidity deviations persist for multiple statistical periods, the deduction values for each period are incremented to form event-coupled cumulative deduction results.
[0072] The basic state fidelity value after event coupling accumulation and deduction is subject to boundary constraint processing to ensure that the basic state fidelity value is not lower than zero and not higher than the initial state fidelity value, and the current state fidelity value is output.
[0073] In this embodiment, the text risk fusion module includes:
[0074] Unstructured data is subjected to text normalization processing, which includes character set unification, invalid symbol removal, and unification of time and quantity expression formats. According to the source type of unstructured data, the text is marked as quality inspection record text, anomaly handling description text, transportation anomaly notification text, or inventory operation log text, resulting in standardized text with source type marking.
[0075] An improved DistilBERT model is constructed, which consists of an input representation layer, a risk evidence aggregation layer, and a risk output calibration layer, wherein:
[0076] The input representation layer segments the standardized text into words and generates word vectors. Simultaneously, it incorporates source vectors corresponding to source type tags and fuses them with the word vectors to form an input sequence representation. Specifically, the input representation layer segments the standardized text into words and generates word vectors as follows:
[0077] The standardized text is segmented into sub-words according to preset word segmentation rules to obtain a word sequence, and the word sequence is truncated and padded to meet the preset maximum sequence length;
[0078] The word sequence is mapped to a word index sequence, generating corresponding word embedding vectors, and simultaneously generating position encoding vectors to represent the position information of words in the sequence;
[0079] The word embedding vector and the position encoding vector are added element by element to obtain the word vector sequence;
[0080] The risk evidence aggregation layer sets up a risk trigger fragment channel and a numerical time fragment channel on the basis of the DistilBERT encoding output. The risk trigger fragment channel aggregates keyword fragment representations related to risk, and the numerical time fragment channel aggregates fragment representations related to duration, frequency and magnitude.
[0081] The risk output calibration layer outputs risk category and risk level based on the aggregation results of two channels, and performs consistency calibration on the combination of risk category and risk level to generate risk confidence. Specifically, the risk output calibration layer outputs risk category and risk level based on the aggregation results of two channels as follows:
[0082] The results of the risk-triggered fragment channel aggregation and the results of the numerical time fragment channel aggregation are concatenated to obtain a joint feature vector, and the joint feature vector is then dimensionally aligned.
[0083] Input the joint feature vector into the risk category output header to obtain the risk category prediction result; input the joint feature vector into the risk level output header to obtain the risk level prediction result.
[0084] The risk category prediction results and risk level prediction results are normalized and the corresponding category labels and level labels are output as inputs for consistency calibration.
[0085] The DistilBERT model is improved by inputting standardized text with source type tags to obtain the risk category, risk level and risk confidence level corresponding to each batch of drugs. The risk category, risk level and risk confidence level are summarized to generate the text risk quantity of the corresponding batch. The text risk quantity is determined by the risk category correspondence coefficient, the risk level correspondence coefficient and the risk confidence level according to the weighted synthesis method.
[0086] A state fidelity deduction value is generated based on the text risk quantity. The state fidelity deduction value is determined by mapping the text risk quantity to the text mapping coefficient, wherein the text mapping coefficient is a coefficient used to convert the text risk quantity into a state fidelity deduction amount.
[0087] The state fidelity deduction value is applied to the state fidelity value to correct it, thereby obtaining the comprehensive state fidelity value for each batch.
[0088] In this embodiment, the situation flow and priority module includes:
[0089] Within a preset statistical period, the comprehensive status fidelity value, storage location migration path, risk level of the storage area to which the storage location belongs, and residence time of each storage location are obtained for each batch of drugs. Each batch is organized into a sequence of multiple residence segments in chronological order. Each residence segment includes batch identifier, storage location, residence time, regional risk level, and comprehensive status fidelity value. The preset statistical period is 24 hours.
[0090] Each storage location is discretized into storage location time nodes at a fixed time granularity. For any batch of adjacent residence periods, a spatial migration connection is established from the previous storage location time node to the next storage location time node. The risk load determined by the comprehensive state fidelity value and the risk level of the area before and after migration is recorded. For adjacent time nodes of the same storage location, a time continuity connection is established, and the risk residence amount determined by the residence duration and the decay result over time are recorded, forming a situation flow structure that includes spatial migration connection and time continuity connection.
[0091] By summarizing the risk retention at each storage location at each time point, the risk density changes over time. By summarizing the risk load at each spatial migration connection, the risk flow intensity between storage locations changes over time. Storage locations with continuously increasing risk density, migration directions with continuously increasing risk flow intensity, and main risk flow directions are identified, and the risk flow trend is output.
[0092] For each batch, based on the comprehensive status fidelity value, cumulative dwell time, number of migrations, number of high-risk storage location time nodes experienced, and consistency of the path with the main risk flow, an outbound priority score is generated, and all batches in the warehouse are sorted. The outbound priority ranking result is output. The generation of the outbound priority score is as follows:
[0093] For each batch, scoring elements are extracted, including the overall status fidelity value, the cumulative dwell time of the batch, the number of batch migrations, the number of high-risk storage location time nodes experienced by the batch, and the consistency markers between the batch migration path and the main risk flow.
[0094] The scoring elements are standardized and their direction is unified. The overall status fidelity value is converted into a risk item with higher priority as the value is lower. The cumulative stay time is converted into a timeliness item with higher priority as the time is longer. The number of migrations is converted into a disturbance item with higher priority as the number of times is more. The number of time nodes of high-risk storage locations is converted into an exposure item with higher priority as the number is more. The consistency mark is converted into a trend item with higher priority as the consistency is more.
[0095] The risk item, timeliness item, disturbance item, exposure item and trend item are weighted and synthesized according to the preset weight to obtain the outbound priority score. The batches in the whole warehouse are sorted from high to low according to the outbound priority score, and the outbound priority ranking result is output.
[0096] High-risk batches are marked according to preset high-risk judgment rules. The high-risk judgment rules include the overall state fidelity value being lower than the threshold or the risk density in the situation flow reaching the threshold. The proportion of high-risk batches to the total number of batches in the entire portfolio is used as the output of the high-risk batch ratio.
[0097] In this embodiment, the elastic control module includes:
[0098] Within a preset statistical period, the overall status fidelity value of each batch in the entire warehouse is obtained and the distribution characteristics of the overall status fidelity are summarized by category. The risk density change results of the warehouse situation flow in this period relative to the previous period and the proportion of high-risk batches in this period are obtained to form a set of flexible control input indicators.
[0099] Based on the set of elastic control input indicators, the center value of the elastic upper limit and the width of the elastic upper limit interval are determined. The center value of the elastic upper limit tightens as the overall fidelity of the comprehensive state decreases, the risk density increases, or the proportion of high-risk batches increases. The width of the elastic upper limit interval narrows as the risk density changes more drastically. Boundary constraints are applied to the center value of the elastic upper limit and the width of the elastic upper limit interval to obtain the demand elastic upper limit interval.
[0100] Based on the risk flow trend identification results, areas with continuously rising risk density and risk-dominant flow directions pointing to target areas are marked. When replenishment or transfer causes inventory to concentrate in the marked areas, the upper limit range of demand elasticity for the corresponding category is tightened. When replenishment or transfer causes inventory to disperse to low-risk areas, the upper limit range of demand elasticity for the corresponding category is widened, forming a dynamic upper limit range of demand elasticity.
[0101] For each product category, a replenishment recommendation quantity is generated based on the predicted demand, available inventory, and in-transit quantity. The upper limit range of dynamic demand elasticity is used as a replenishment ratio constraint. When the replenishment recommendation quantity exceeds the maximum allowable replenishment quantity corresponding to the upper limit range of dynamic demand elasticity, it is truncated. When the replenishment recommendation quantity is lower than the minimum guaranteed replenishment quantity corresponding to the lower limit range of dynamic demand elasticity and there is a risk of supply disruption, it is increased, and the replenishment control quantity is output.
[0102] Based on the available transfer volume in the source warehouse and the gap in the target warehouse, a transfer recommendation volume is generated for each transfer direction and category. The transfer limit is set using a dynamic demand elasticity upper limit range. When the proportion of high-risk batches in the source warehouse increases, or the source warehouse falls into a region with continuously increasing risk density, or the risk-driven flow points to the target region, the transfer limit is lowered. When the proportion of high-risk batches in the target warehouse decreases, or the transfer achieves risk de-transfer, the transfer priority is increased and executed within the transfer limit. The dynamic demand elasticity upper limit range, replenishment control volume, and transfer control volume are output.
[0103] In this embodiment, the policy write-back module includes:
[0104] Obtain the batch outbound priority sorting result, replenishment control quantity for each category, and transfer control quantity for each transfer direction. Use the batch outbound priority sorting result as the outbound execution order input, and use the replenishment control quantity and transfer control quantity as the upper limit of the execution quantity input to form an execution parameter set.
[0105] According to the batch outbound priority sorting results, the order demand and the current available inventory are matched in descending order to determine the actual outbound quantity of each batch. The actual outbound quantity does not exceed the current available inventory and does not exceed the order demand. The corresponding batch outbound instruction is generated and written into the execution queue.
[0106] For each product category, a replenishment execution quantity is generated based on the replenishment control quantity. The replenishment execution quantity shall not exceed the quantity limited by the replenishment control quantity. An inbound record is generated for each replenishment batch and the batch status parameters are initialized. A replenishment inbound instruction is generated and written to the execution queue.
[0107] For each allocation direction and category, the allocation execution quantity is determined based on the allocation control quantity. The allocation execution quantity does not exceed the quantity limited by the allocation control quantity. Source warehouse transfer-out instructions and target warehouse transfer-in instructions are generated simultaneously. The warehouse location migration path records and migration time records of the batches are updated to form new dwell time data.
[0108] After the outbound, replenishment and transfer are completed, the inventory quantity, batch inventory status and in-transit quantity of each warehouse are updated. Based on the updated batch set, the overall status fidelity value, the proportion of high-risk batches and the risk density data in the warehouse status flow are recalculated. The update results are written into the warehouse management system to complete the closed-loop update of inventory data and status flow data.
[0109] Example 1:
[0110] To verify the feasibility of this invention in practice, it was applied to a regional pharmaceutical logistics and distribution center. This distribution center has a building area of approximately 18,000 square meters, including approximately 3,200 square meters of cold chain storage. It serves three prefecture-level cities, encompassing 24 hospitals and 52 retail pharmacies, processing an average of approximately 6,200 batches of medicines per month and handling approximately 190 outbound orders per day. The warehouse has been equipped with a conventional warehouse management system and an online temperature and humidity monitoring system. However, in actual operation, problems remain, including the inability to quantify batch risk, the failure to incorporate abnormal text information into inventory decisions, and a disconnect between inventory allocation and actual risk conditions.
[0111] Under the existing system, the warehouse primarily relied on the first-in, first-out (FIFO) rule and safety stock level for outbound and replenishment decisions. While the temperature and humidity monitoring system could trigger alarms for exceeding limits, it lacked a cumulative assessment mechanism for multiple minor fluctuations, short-term cold chain interruptions, and frequent handling vibrations. Quality inspection records and transportation anomaly reports were archived in text form and primarily reviewed manually, without being integrated into the inventory sorting logic. Statistical data showed that high-risk batches had an average dwell time of 11.8 days; some batches with transportation delays or minor packaging damage were not identified in advance, and the risk density in certain cold chain storage locations continuously increased without timely intervention.
[0112] After deploying the system of this invention, the system collects structured data, including batch information, inbound and outbound records, temperature and humidity data, storage location migration records and cold chain exposure records. At the same time, it collects quality inspection reports and abnormal handling text data to generate an initial value of state fidelity for each batch. Then, it deducts the value item by item based on the duration of temperature and humidity deviation, number of handling operations, vibration events and storage location migration frequency to form the current state fidelity value.
[0113] The improved DistilBERT model inputs quality inspection records and transportation anomaly notifications to identify risk categories and levels, generate textual risk quantities, and map them to status fidelity deduction values. This process corrects the batch status and forms a comprehensive status fidelity. After the system was implemented, it was found that approximately 6.3% of batches were prioritized in the outbound sorting process because textual risks were identified earlier and their comprehensive status fidelity was reduced.
[0114] The system constructs a warehouse situation flow structure based on comprehensive status fidelity values, storage location migration paths, and regional risk levels. Storage locations are discretized along the time dimension to generate data on risk retention and risk flow intensity. The system identifies a continuously rising risk density in the A2 channel of the cold chain area and a risk flow trend pointing towards the outbound buffer zone. Subsequently, it increases the outbound priority of relevant batches and restricts the concentration of inventory in this area.
[0115] The system generates an upper limit range for demand elasticity based on the overall state fidelity distribution, changes in risk density, and the proportion of high-risk batches. For product categories in areas with continuously rising risk density, the demand elasticity range is appropriately tightened, and replenishment volumes are controlled within a reasonable range of predicted demand; normal replenishment ratios are maintained in lower-risk areas. Allocation decisions also consider the direction of risk transfer to avoid inventory concentration in high-risk areas.
[0116] The system generates outbound execution instructions based on the outbound priority ranking results, generates corresponding strategies based on the replenishment and transfer control results, and writes back inventory data and situation flow data after execution, forming a closed-loop update mechanism.
[0117] Table 1 Comparison of the operational effects of pilot warehousing centers
[0118] index Before deployment After deployment range of change Statistical sample illustrate High-risk batch ratio 7.2% 4.9% ↓2.3 percentage points Approximately 18,000 batches Overall state fidelity determination Average dwell time of high-risk batches 11.8 days 7.4 days ↓37% Approximately 1200 batches Outbound priority optimization results Average monthly inventory turnover rate 3.5 times 4.1 times ↑17% Full position data Results after elastic control Supply interruption rate 2.4% 1.6% ↓0.8 percentage points Order data Replenishment strategy optimization Text risk identification participation rate 0% 6.3% +6.3 percentage points Abnormal text samples Textual risk enters decision-making Inventory capital tied up 86.5 million yuan 80.6 million yuan ↓6.8% Financial Statistics Inventory structure optimization
[0119] According to the data in Table 1, the proportion of high-risk batches decreased from 7.2% to 4.9% after the system deployment, a reduction of 2.3 percentage points. This indicates that the assessment and handling mechanism based on comprehensive status fidelity can identify and manage more batches at the edge of risk in advance, thus reducing the proportion of high-risk batches in inventory. Simultaneously, the average retention time of high-risk batches decreased from 11.8 days to 7.4 days, a reduction of approximately 37%, consistent with the mechanism of prioritizing outbound shipments. This suggests that batches with higher risk or worse condition are processed more quickly, reducing the time window for continued exposure and spread of high-risk batches within the warehouse.
[0120] From the perspective of supply and turnover efficiency, the average monthly inventory turnover rate increased from 3.5 times to 4.1 times, an increase of approximately 17%. This indicates that the coordinated control of replenishment, allocation, and outbound shipments has made the inventory structure closer to actual demand, while reducing ineffective accumulation and inefficient turnover. The supply disruption rate decreased from 2.4% to 1.6%, a reduction of 0.8 percentage points. This shows that the upper limit of demand elasticity and replenishment control are not simply leading to insufficient supply due to tightening, but rather achieving a more stable supply guarantee under the constraints of risk situation and inventory status, thus improving the availability and executability of inventory strategies.
[0121] From the perspective of data sources and decision-making loop, the participation rate of text risk identification increased from 0% to 6.3%, meaning that unstructured information such as quality inspection records and transportation anomaly notifications were identified by the model and entered into the state correction and sorting control chain. This transformed risk clues that could only be viewed manually into inputs that could be used for batch decision-making. The amount of inventory capital tied up decreased from 86.5 million yuan to 80.6 million yuan, a decrease of approximately 6.8%. This corresponds to the improvement in turnover rate and the decrease in supply disruption rate, reflecting that the capital tied up has been substantially reduced after the optimization of inventory structure, while maintaining supply stability. This demonstrates the comprehensive effect of risk-driven refined inventory control and the execution of write-back closed-loop updates.
[0122] The above description is only a preferred embodiment of the present invention, but the scope of protection of the present invention is not limited thereto. Any equivalent substitutions or modifications made by those skilled in the art within the scope of the technology disclosed in the present invention, based on the technical solution and inventive concept of the present invention, should be covered within the scope of protection of the present invention.
Claims
1. A pharmaceutical intelligent warehousing and inventory management system based on artificial intelligence, characterized in that: include: The data acquisition module collects structured and unstructured data from the pharmaceutical warehousing system. The status fidelity module generates an initial status fidelity value for each batch of medicines based on structured data, and deducts the value item by item based on temperature and humidity deviation, handling records, vibration events and storage location relocation to obtain the current status fidelity value. The text risk fusion module inputs unstructured data into the improved DistilBERT model, identifies risk categories and risk levels, generates text risk quantities, converts the text risk quantities into state fidelity deduction values, and corrects the state fidelity values based on the state fidelity deduction values to obtain the comprehensive state fidelity values for each batch. The Situation Flow and Priority module constructs a warehouse situation flow structure based on the comprehensive status fidelity value, the batch's warehouse location migration path, the risk level of the storage area, and the batch's dwell time. It analyzes and identifies the risk flow trend within the warehouse, generates batch outbound priority ranking results, and calculates the proportion of high-risk batches. The elastic control module generates an upper limit range for demand elasticity based on the overall status fidelity value of each batch in the entire warehouse, the risk density changes in the warehouse situation flow, and the proportion of high-risk batches, and controls the replenishment and allocation quantities. The strategy write-back module generates replenishment strategies, transfer strategies, and outbound execution instructions based on the batch outbound priority sorting results and replenishment and allocation control results, and writes the execution results back to the warehouse management system to update warehouse inventory data and status flow data.
2. The AI-based intelligent pharmaceutical warehousing and inventory management system according to claim 1, characterized in that, The structured data includes drug batch information, production date, expiration date, inbound and outbound records, storage location relocation, temperature and humidity monitoring data, cold chain exposure records, and risk level of storage area. The unstructured data includes quality inspection records, abnormal handling instructions, transportation abnormality notices, and inventory operation logs.
3. The AI-based intelligent pharmaceutical warehousing and inventory management system according to claim 1, characterized in that, The state fidelity module includes: Based on the drug batch information, production date, and expiration date in the structured data, the nominal expiration date of each drug batch is determined, and combined with the risk level of the storage area in the structured data, a corresponding initial value for state fidelity is generated. Based on the temperature and humidity monitoring data and cold chain exposure records in the structured data, the duration of temperature and humidity deviation of the batch within the statistical period is calculated, and based on the inbound and outbound records and storage location migration records in the structured data, the number of times the batch is handled and the number of times the storage location is migrated within the statistical period are calculated. Based on the duration of temperature and humidity deviation, number of handling operations, and number of warehouse relocations, the initial value of state fidelity is deducted item by item according to the corresponding risk deduction weight to obtain the basic state fidelity value. During the item-by-item deduction process, time correlation analysis is performed on multiple types of events from temperature and humidity monitoring data, cold chain exposure records, and inbound and outbound records. When temperature and humidity deviations and handling operations occur continuously within a set time window, the corresponding deduction results are superimposed and amplified. When temperature and humidity deviations persist for multiple statistical periods, the deduction values for each period are incremented to form event-coupled cumulative deduction results. The basic state fidelity value after event coupling accumulation and deduction is subject to boundary constraint processing to ensure that the basic state fidelity value is not lower than zero and not higher than the initial state fidelity value, and the current state fidelity value is output.
4. The AI-based intelligent pharmaceutical warehousing and inventory management system according to claim 1, characterized in that, The text risk fusion module includes: Unstructured data is subjected to text normalization processing, which includes character set unification, invalid symbol removal, and unification of time and quantity expression formats. According to the source type of unstructured data, the text is marked as quality inspection record text, anomaly handling description text, transportation anomaly notification text, or inventory operation log text, resulting in standardized text with source type marking. An improved DistilBERT model is constructed, which consists of an input representation layer, a risk evidence aggregation layer, and a risk output calibration layer, wherein: The input representation layer segments the standardized text into words and generates word vectors. At the same time, it introduces the source vectors corresponding to the source type tags and merges them with the word vectors to form the input sequence representation. The risk evidence aggregation layer sets up a risk trigger fragment channel and a numerical time fragment channel on the basis of the DistilBERT encoding output. The risk trigger fragment channel aggregates keyword fragment representations related to risk, and the numerical time fragment channel aggregates fragment representations related to duration, frequency and magnitude. The risk output calibration layer outputs risk category and risk level based on the aggregation results of the two channels, and performs consistency calibration on the combination of risk category and risk level to generate risk confidence. The DistilBERT model is improved by inputting standardized text with source type tags to obtain the risk category, risk level and risk confidence level corresponding to each batch of drugs. The risk category, risk level and risk confidence level are summarized to generate the text risk quantity of the corresponding batch. The text risk quantity is determined by the risk category correspondence coefficient, the risk level correspondence coefficient and the risk confidence level according to the weighted synthesis method. A state fidelity deduction value is generated based on the text risk quantity, and the state fidelity deduction value is determined by mapping the text risk quantity to the text mapping coefficient; The state fidelity deduction value is applied to the state fidelity value to correct it, thereby obtaining the comprehensive state fidelity value for each batch.
5. The AI-based intelligent pharmaceutical warehousing and inventory management system according to claim 1, characterized in that, The situation flow and priority module includes: Within a preset statistical period, the overall status fidelity value, storage location migration path, risk level of the storage area to which the storage location belongs, and residence time of each storage location are obtained for each batch of drugs. Each batch is organized into a sequence of multiple residence segments in chronological order. Each residence segment includes batch identifier, storage location, residence time, regional risk level, and overall status fidelity value. Each storage location is discretized into storage location time nodes at a fixed time granularity. For any batch of adjacent residence periods, a spatial migration connection is established from the previous storage location time node to the next storage location time node. The risk load determined by the comprehensive state fidelity value and the risk level of the area before and after migration is recorded. For adjacent time nodes of the same storage location, a time continuity connection is established, and the risk residence amount determined by the residence duration and the decay result over time are recorded, forming a situation flow structure that includes spatial migration connection and time continuity connection. By summarizing the risk retention at each storage location at each time point, the risk density changes over time. By summarizing the risk load at each spatial migration connection, the risk flow intensity between storage locations changes over time. Storage locations with continuously increasing risk density, migration directions with continuously increasing risk flow intensity, and main risk flow directions are identified, and the risk flow trend is output. For each batch, based on the comprehensive status fidelity value, cumulative dwell time, number of migrations, number of high-risk storage location time nodes experienced, and the consistency of the path with the main risk flow, an outbound priority score is generated and the batches in the entire warehouse are sorted, and the outbound priority ranking result is output. High-risk batches are marked according to preset high-risk judgment rules. The high-risk judgment rules include the overall state fidelity value being lower than the threshold or the risk density in the situation flow reaching the threshold. The proportion of high-risk batches to the total number of batches in the entire portfolio is used as the output of the high-risk batch ratio.
6. The AI-based intelligent pharmaceutical warehousing and inventory management system according to claim 1, characterized in that, The elastic control module includes: Within a preset statistical period, the overall status fidelity value of each batch in the entire warehouse is obtained and the distribution characteristics of the overall status fidelity are summarized by category. The risk density change results of the warehouse situation flow in this period relative to the previous period and the proportion of high-risk batches in this period are obtained to form a set of flexible control input indicators. Based on the set of elastic control input indicators, the center value of the elastic upper limit and the width of the elastic upper limit interval are determined. The center value of the elastic upper limit tightens as the overall fidelity of the comprehensive state decreases, the risk density increases, or the proportion of high-risk batches increases. The width of the elastic upper limit interval narrows as the risk density changes more drastically. Boundary constraints are applied to the center value of the elastic upper limit and the width of the elastic upper limit interval to obtain the demand elastic upper limit interval. Based on the risk flow trend identification results, areas with continuously rising risk density and risk-dominant flow directions pointing to target areas are marked. When replenishment or transfer causes inventory to concentrate in the marked areas, the upper limit range of demand elasticity for the corresponding category is tightened. When replenishment or transfer causes inventory to disperse to low-risk areas, the upper limit range of demand elasticity for the corresponding category is widened, forming a dynamic upper limit range of demand elasticity. For each product category, a replenishment recommendation quantity is generated based on the predicted demand, available inventory, and in-transit quantity. The upper limit range of dynamic demand elasticity is used as a replenishment ratio constraint. When the replenishment recommendation quantity exceeds the maximum allowable replenishment quantity corresponding to the upper limit range of dynamic demand elasticity, it is truncated. When the replenishment recommendation quantity is lower than the minimum guaranteed replenishment quantity corresponding to the lower limit range of dynamic demand elasticity and there is a risk of supply disruption, it is increased, and the replenishment control quantity is output. Based on the available transfer volume in the source warehouse and the gap in the target warehouse, a transfer recommendation volume is generated for each transfer direction and category. The transfer limit is set using a dynamic demand elasticity upper limit range. When the proportion of high-risk batches in the source warehouse increases, or the source warehouse falls into a region with continuously increasing risk density, or the risk-driven flow points to the target region, the transfer limit is lowered. When the proportion of high-risk batches in the target warehouse decreases, or the transfer achieves risk de-transfer, the transfer priority is increased and executed within the transfer limit. The dynamic demand elasticity upper limit range, replenishment control volume, and transfer control volume are output.
7. The AI-based intelligent pharmaceutical warehousing and inventory management system according to claim 1, characterized in that, The policy write-back module includes: Obtain the batch outbound priority sorting result, replenishment control quantity for each category, and transfer control quantity for each transfer direction. Use the batch outbound priority sorting result as the outbound execution order input, and use the replenishment control quantity and transfer control quantity as the upper limit of the execution quantity input to form an execution parameter set. According to the batch outbound priority sorting results, the order demand and the current available inventory are matched in descending order to determine the actual outbound quantity of each batch. The actual outbound quantity does not exceed the current available inventory and does not exceed the order demand. The corresponding batch outbound instruction is generated and written into the execution queue. For each product category, a replenishment execution quantity is generated based on the replenishment control quantity. The replenishment execution quantity shall not exceed the quantity limited by the replenishment control quantity. An inbound record is generated for each replenishment batch and the batch status parameters are initialized. A replenishment inbound instruction is generated and written to the execution queue. For each allocation direction and category, the allocation execution quantity is determined based on the allocation control quantity. The allocation execution quantity does not exceed the quantity limited by the allocation control quantity. Source warehouse transfer-out instructions and target warehouse transfer-in instructions are generated simultaneously. The warehouse location migration path records and migration time records of the batches are updated to form new dwell time data. After the outbound, replenishment and transfer are completed, the inventory quantity, batch inventory status and in-transit quantity of each warehouse are updated. Based on the updated batch set, the overall status fidelity value, the proportion of high-risk batches and the risk density data in the warehouse status flow are recalculated. The update results are written into the warehouse management system to complete the closed-loop update of inventory data and status flow data.