A pharmacy drug consumption forecasting and replenishment system and method incorporating prescription flow

By combining prescription flow with a pharmacy drug consumption prediction and replenishment system, real-time data collection and optimization are performed, solving the problems of overcapacity and drug shortage risks in pharmacies, and achieving efficient, accurate and stable pharmacy inventory management.

CN122158033APending Publication Date: 2026-06-05FIRST HOSPITAL AFFILIATED TO GENERAL HOSPITAL OF PLA

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
FIRST HOSPITAL AFFILIATED TO GENERAL HOSPITAL OF PLA
Filing Date
2026-03-20
Publication Date
2026-06-05

AI Technical Summary

Technical Problem

Existing pharmacy drug consumption forecasting and replenishment methods are unable to cope with fluctuations in prescription flow, resulting in overcapacity of storage spaces, high risk of drug shortages, and chaotic operations, and they fail to effectively combine storage space limits.

Method used

A pharmacy drug consumption prediction and replenishment system that combines prescription flow is adopted. By collecting prescription flow data in real time, time series analysis and linear programming are used to optimize replenishment volume. The system also optimizes storage location allocation by combining storage location capacity thresholds and dynamic simulation algorithms, updates replenishment priority, and performs iterative prediction to form a closed-loop management system.

Benefits of technology

It effectively reduced the incidence of drug shortages, improved the efficiency of storage space utilization, reduced operational chaos, and enhanced the accuracy and stability of pharmacy inventory management.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122158033A_ABST
    Figure CN122158033A_ABST
Patent Text Reader

Abstract

The application belongs to the technical field of medicine inventory management, and particularly relates to a pharmacy medicine consumption prediction and replenishment system and method combined with prescription flow. The system comprises a collection and prediction module, a first replenishment module, a storage location optimization module, an updating module, a prediction correction module and a second replenishment module. Prescription flow is collected in real time and combined with historical consumption records, and time series analysis is used to predict medicine consumption trends. When the predicted value exceeds the storage location capacity threshold, the replenishment amount is adjusted through linear programming optimization. Then, the storage location information is integrated, and a dynamic simulation algorithm is used to verify and optimize the storage location allocation scheme. Real-time medicine shortage risk indicators are then combined, the replenishment priority is updated, and time series refined prediction and linear programming iteration are performed again until the final inventory recovery level is determined. The application effectively reduces the medicine shortage rate, improves storage location utilization efficiency and reduces operational confusion, significantly improving the accuracy and stability of pharmacy inventory management.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention belongs to the field of pharmaceutical inventory management technology, specifically relating to a pharmacy drug consumption prediction and replenishment system and method that combines prescription flow. Background Technology

[0002] Pharmacy drug management is a core aspect of the daily operations of medical institutions, directly impacting the timeliness and safety of patient medication. Ensuring a continuous and stable drug supply is crucial. With rapidly changing prescription volumes, pharmacies need to accurately grasp drug consumption patterns to avoid drug shortages affecting treatment or excessive inventory tying up funds and space.

[0003] Current pharmacy methods for predicting and replenishing drug consumption largely rely on historical average consumption or manual experience. While these methods are effective when prescription volumes are relatively stable, they often fail to adapt quickly when prescription volumes fluctuate significantly, leading to increased prediction errors. More critically, existing methods typically focus only on overall consumption, rarely considering the specific location and quantity limitations of drugs on shelves, resulting in a disconnect between replenishment recommendations and actual shelf capacity.

[0004] Each shelf location in a pharmacy is pre-set with a fixed storage capacity. While this is intended to facilitate management and quick medication retrieval, it also introduces constraints. When a sudden surge in prescription volume leads to accelerated consumption of a particular medication, if the system only suggests replenishment based on the consumption rate without fully considering the maximum storage capacity of each location, replenishment recommendations may exceed the location's capacity. In such cases, pharmacy staff must repeatedly adjust replenishment plans manually or temporarily relocate other locations, potentially causing operational chaos or even incorrect medication delivery. Furthermore, because the shelf capacity is fixed, if replenishment is not timely and the remaining medication level drops below the safety threshold, it is difficult to quickly restore it to an appropriate level through a single, reasonable replenishment, further exacerbating the risk of medication shortages.

[0005] Therefore, the key issue in achieving efficient and precise management of pharmacy medicines is how to accurately determine the required amount of medicine based on changes in prescription flow during the process of predicting and replenishing medicine consumption, while also being constrained by the pre-set storage capacity of shelf locations and issuing timely warnings. Summary of the Invention

[0006] To address the problems existing in the prior art, this invention provides a pharmacy drug consumption prediction and replenishment system and method that combines prescription flow, aiming to achieve efficient and accurate management of pharmacy drugs.

[0007] To achieve the above objectives, the present invention provides the following solution: A pharmacy drug consumption prediction and replenishment system that combines prescription flow, the system comprising: a data collection and prediction module, a first replenishment module, a location optimization module, an update module, a prediction correction module, and a second replenishment module; The data acquisition and prediction module is used to collect prescription flow data from the HIS system in real time, use time series analysis to obtain data fluctuation characteristic parameters, and obtain the current drug consumption trend prediction value based on the data fluctuation characteristic parameters. The first replenishment module is used to obtain the initial replenishment recommendation quantity and determine the initial replenishment plan based on the current drug consumption trend forecast and the preset storage capacity threshold using linear programming optimization. The storage location optimization module is used to integrate storage location capacity information based on the initial replenishment plan, and to use dynamic simulation algorithms to verify potential points of operational chaos in order to obtain an optimized storage location allocation scheme. The update module is used to update the priority of replenishment suggestions and obtain the drug replenishment path based on the storage location allocation optimization plan and real-time drug shortage risk indicators. The prediction and correction module is used to extract relevant drug consumption data from the drug replenishment path, recalculate the data fluctuation characteristic parameters using time series analysis methods, and obtain refined consumption prediction and correction values. The second replenishment module is used to determine the final replenishment plan by solving the corrected replenishment recommendation quantity through linear programming iteratively based on the refined consumption forecast correction value and the preset storage capacity threshold.

[0008] Preferably, the acquisition and prediction module includes: a data acquisition unit, a data combination unit, a feature extraction unit, a first prediction unit, and a second prediction unit; The data acquisition unit is used to collect prescription flow data from the HIS system in real time and build a dynamic flow dataset; The data fusion unit is used to integrate historical drug consumption records based on dynamic flow datasets to form a comprehensive data matrix and determine the fusion dataset containing time and consumption dimensions. The feature extraction unit is used to extract features from the data fluctuations in the joint dataset using time series analysis methods, and to obtain data fluctuation feature parameters. The first prediction unit is used to obtain the predicted trend curve of drug consumption by combining the data fluctuation characteristic parameters with the current time point; The second prediction unit is used to determine the stability of the prediction trend curve. If the stability is lower than the preset threshold, the data fluctuation characteristic parameters are smoothed to obtain the final predicted value of the current drug consumption trend.

[0009] Preferably, the first replenishment module includes: a first comparison unit, a first replenishment unit, a second replenishment unit, and a first replenishment planning unit; The first comparison unit is used to compare the current drug consumption trend prediction value with the preset storage space capacity threshold to determine whether the current drug consumption trend prediction value exceeds the storage space capacity threshold. The first replenishment unit is used to directly use the original replenishment recommendation quantity as the initial replenishment recommendation quantity if the storage capacity threshold is not exceeded. The second replenishment unit is used to construct a linear programming model if the inventory capacity threshold is exceeded. The model aims to minimize the deviation of the replenishment recommendation quantity, sets the inventory capacity threshold as a constraint, and solves the optimized replenishment recommendation quantity as the initial replenishment recommendation quantity. The first replenishment planning unit is used to determine the initial replenishment recommendation quantity and the corresponding relationship between each drug, and to determine the initial replenishment plan.

[0010] Preferably, the storage location optimization module includes: an initial allocation unit, a first operation simulation unit, a confusion judgment unit, a conflict adjustment unit, a second operation simulation unit, and an optimization unit; The initial allocation unit is used to integrate storage capacity information based on the initial replenishment plan and generate initial storage location allocation results. The first operation simulation unit is used to perform replenishment operations on the initial storage location allocation results using a dynamic simulation algorithm and record the operation execution process. The chaos judgment unit is used to extract operation sequence conflicts from the operation execution process and judge the risk points of operation chaos. The conflict adjustment unit is used to adjust the positions of conflicting storage locations in the storage location allocation result based on the risk points of operational chaos, so as to obtain the adjusted storage location allocation result. The second operation simulation unit is used to re-execute the replenishment operation on the adjusted storage location allocation results through dynamic simulation algorithm to verify the changes in the risk points of operational chaos. The optimization unit is used to obtain the final optimized storage location allocation scheme based on the changes in operational chaos risk points after verification.

[0011] Preferably, the update module includes: a fusion unit, an update unit, and a path acquisition unit; The fusion unit is used to fuse the storage location allocation optimization scheme with the preset real-time drug shortage risk indicators to obtain the storage location risk status. The update unit is used to update the replenishment priority sequence based on the risk status of the storage location; The path acquisition unit is used to obtain the drug replenishment path based on the replenishment priority sequence, using a random forest model, combined with the distance to the storage location and the picking frequency.

[0012] This invention also provides a method for predicting and replenishing pharmacy drug consumption based on prescription flow, the method being implemented using the aforementioned system, the method comprising: Prescription flow data is collected in real time from the HIS system. Time series analysis is used to obtain data fluctuation characteristic parameters. Based on the data fluctuation characteristic parameters, the current drug consumption trend prediction value is obtained. Based on the current predicted trend of drug consumption and the preset storage capacity threshold, linear programming optimization is used to obtain the initial replenishment recommendation quantity and determine the initial replenishment plan; Based on the initial replenishment plan, the storage capacity information of the storage locations is integrated, and a dynamic simulation algorithm is used to verify potential points of operational chaos, thereby obtaining an optimized storage location allocation scheme. Based on the optimized location allocation scheme and real-time drug shortage risk indicators, update the priority of replenishment suggestions and obtain the drug replenishment path; Relevant drug consumption data are extracted from the drug replenishment path, and time series analysis is used to recalculate the data fluctuation characteristic parameters to obtain refined consumption prediction correction values. Based on the refined consumption forecast correction value and the preset storage capacity threshold, the corrected replenishment suggestion quantity is solved by linear programming iteration to determine the final replenishment plan.

[0013] Preferably, the method of collecting prescription flow data in real time from the HIS system, obtaining data fluctuation characteristic parameters using time series analysis, and obtaining the current drug consumption trend prediction value based on the data fluctuation characteristic parameters includes: Real-time collection of prescription flow data from the HIS system to construct a dynamic flow dataset; Based on the dynamic flow dataset, historical drug consumption records are integrated to form a comprehensive data matrix, and a joint dataset containing time and consumption dimensions is determined. Time series analysis is used to extract features from the data fluctuations in the joint dataset and obtain data fluctuation characteristic parameters. By combining the data fluctuation characteristic parameters with the current time point, a predicted trend curve of drug consumption can be obtained; The stability of the predicted trend curve is assessed. If the stability is lower than a preset threshold, the data fluctuation characteristic parameters are smoothed to obtain the final predicted value of the current drug consumption trend.

[0014] Preferably, the method for determining the initial replenishment plan by using linear programming optimization to obtain the initial replenishment recommendation quantity based on the current drug consumption trend forecast and the preset storage capacity threshold includes: The current predicted value of drug consumption trend is compared with the preset storage space capacity threshold to determine whether the current predicted value of drug consumption trend exceeds the storage space capacity threshold. If the storage capacity threshold is not exceeded, the original replenishment recommendation quantity will be used directly as the initial replenishment recommendation quantity. If the inventory exceeds the storage capacity threshold, a linear programming model is constructed with the goal of minimizing the deviation of the replenishment recommendation quantity. The storage capacity threshold is set as a constraint, and the optimized replenishment recommendation quantity is obtained as the initial replenishment recommendation quantity. Determine the initial replenishment recommendation quantity and its correspondence with each drug, and determine the initial replenishment plan.

[0015] Preferred methods for obtaining optimized storage location allocation schemes based on initial replenishment plans, integrating storage capacity information, and employing dynamic simulation algorithms to verify potential points of operational chaos include: Based on the initial replenishment plan, integrate the storage capacity information of the storage locations to generate the initial storage location allocation results; A dynamic simulation algorithm is used to perform replenishment operations on the initial storage location allocation results, and the operation execution process is recorded. Extract operational sequence conflicts during the operation execution process to identify risk points of operational chaos; Based on the risk of operational chaos, the positions of conflicting storage locations in the storage location allocation results are adjusted to obtain the adjusted storage location allocation results; The replenishment operation was re-executed using a dynamic simulation algorithm to verify the changes in the risk points of operational chaos. Based on the changes in operational chaos risk points after verification, the final optimized storage location allocation scheme is obtained.

[0016] Preferred methods for updating replenishment recommendations and obtaining drug replenishment paths based on optimized storage location allocation schemes and real-time drug shortage risk indicators include: The location risk status is obtained by integrating the location allocation optimization scheme with the preset real-time drug shortage risk indicators. Update the replenishment priority sequence based on the risk status of the storage location; Based on the replenishment priority sequence, a random forest model is used, combined with location distance and picking frequency, to obtain the drug replenishment path.

[0017] Compared with the prior art, the beneficial effects of the present invention are as follows: This invention discloses a pharmacy drug consumption prediction and replenishment system and method that combines prescription flow. Addressing the challenges of traditional replenishment methods being susceptible to fluctuations in drug consumption, leading to overcapacity issues, high drug shortage risks, and operational chaos, this system employs a multi-stage iterative fusion mechanism. First, prescription flow is collected in real-time and integrated with historical consumption records, using time series analysis to predict drug consumption trends. When the predicted value exceeds the storage capacity threshold, linear programming is used to optimize and adjust the replenishment quantity. Next, storage location information is integrated, and a dynamic simulation algorithm is used to verify and optimize the storage location allocation scheme. Finally, real-time drug shortage risk indicators are integrated, replenishment priorities are updated, and time series fine-grained prediction and linear programming iterations are performed again until the final inventory recovery level is determined. This invention achieves a closed-loop correlation between prediction, optimization, verification, and risk control, effectively reducing drug shortage rates, improving storage location utilization efficiency, and minimizing operational chaos, significantly improving the accuracy and stability of pharmacy inventory management. Attached Figure Description

[0018] To more clearly illustrate the technical solution of the present invention, the drawings used in the embodiments are briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.

[0019] Figure 1 This is a schematic diagram of a pharmacy drug consumption prediction and replenishment system module that combines prescription flow according to an embodiment of the present invention; Figure 2 This is a schematic diagram of the pharmacy drug consumption prediction and replenishment method based on prescription flow, as described in an embodiment of the present invention. Detailed Implementation

[0020] The technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.

[0021] To make the above-mentioned objects, features and advantages of the present invention more apparent and understandable, the present invention will be further described in detail below with reference to the accompanying drawings and specific embodiments.

[0022] Example 1 like Figure 1 As shown, the present invention provides a pharmacy drug consumption prediction and replenishment system that combines prescription flow, including: a data collection and prediction module, a first replenishment module, a storage location optimization module, an update module, a prediction correction module, and a second replenishment module; The data acquisition and prediction module is used to collect prescription flow data from the HIS system in real time, use time series analysis to obtain data fluctuation characteristic parameters, and obtain the current drug consumption trend prediction value based on the data fluctuation characteristic parameters. The first replenishment module is used to obtain the initial replenishment recommendation quantity and determine the initial replenishment plan based on the current drug consumption trend forecast and the preset storage capacity threshold using linear programming optimization. The storage location optimization module is used to integrate storage location capacity information based on the initial replenishment plan, and to use dynamic simulation algorithms to verify potential points of operational chaos in order to obtain an optimized storage location allocation scheme. The update module is used to update the priority of replenishment suggestions and obtain the drug replenishment path based on the storage location allocation optimization plan and real-time drug shortage risk indicators. The prediction and correction module is used to extract relevant drug consumption data from the drug replenishment path, recalculate the data fluctuation characteristic parameters using time series analysis methods, and obtain refined consumption prediction and correction values. The second replenishment module is used to determine the final replenishment plan by solving the corrected replenishment recommendation quantity through linear programming iteratively based on the refined consumption forecast correction value and the preset storage capacity threshold.

[0023] The specific implementation process of this invention is as follows: The module includes a data acquisition and forecasting module, a first replenishment module, a storage location optimization module, an update module, a forecast correction module, and a second replenishment module. The data acquisition and prediction module includes: a data acquisition unit, a data combination unit, a feature extraction unit, a first prediction unit, and a second prediction unit.

[0024] The data acquisition unit is used to collect prescription flow data from the HIS system in real time and build a dynamic flow dataset. New prescription flow data, such as the number of prescriptions for each drug per day, is collected from the HIS system every hour and summarized into the daily flow record, thereby constructing the dynamic flow dataset.

[0025] The data fusion unit is used to integrate historical drug consumption records with dynamic flow datasets to form a comprehensive data matrix, determining a joint dataset that includes both time and consumption dimensions. It merges real-time collected prescription flow data with historical drug consumption records within a preset historical period to create a joint dataset containing time dimensions such as date and hour, and consumption dimensions such as actual dosage. This fusion helps to comprehensively reflect the seasonal and sudden changes in drug demand, avoiding biased judgments based solely on real-time data.

[0026] The feature extraction unit employs time series analysis methods to extract features from data fluctuations in the joint dataset, obtaining characteristic parameters of data fluctuations. Time series analysis methods, such as calculating moving average deviation or standard deviation, are used to identify data fluctuations. For example, if the daily consumption of a certain cold medicine suddenly increases from 50 boxes to 200 boxes during flu season, the extracted fluctuation amplitude parameter is 4 times. This feature extraction can detect abnormal demand early, effectively improving the accuracy of inventory early warning.

[0027] The first prediction unit is used to obtain the predicted trend curve of drug consumption by combining data fluctuation characteristic parameters with the current time point. It obtains the predicted trend curve of drug consumption based on ARIMA model trend extrapolation by combining data fluctuation characteristic parameters with the current time point.

[0028] The second prediction unit is used to determine the stability of the prediction trend curve. If the stability is lower than a preset threshold, the data fluctuation characteristic parameters are smoothed to obtain the final predicted value of the current drug consumption trend. This process improves the stability and reliability of the prediction, helping managers make more robust inventory decisions and significantly reducing the costs of expired drugs or emergency restocking.

[0029] The first replenishment module includes: a first comparison unit, a first replenishment unit, a second replenishment unit, and a first replenishment planning unit.

[0030] The first comparison unit compares the current predicted consumption trend of medicines with the preset storage space capacity threshold to determine whether the predicted consumption trend exceeds the threshold. For example, if the maximum capacity reserved for a certain medicine on a pharmacy shelf is 800 boxes, and the current predicted consumption trend is 840 boxes, then the capacity threshold is exceeded by 40 boxes. In this case, the original replenishment recommendation cannot be used directly, and an optimization and adjustment phase is required. The comparison unit can promptly identify potential inventory overflow risks and avoid blind replenishment that leads to wasted space.

[0031] The first replenishment unit is used to directly use the original replenishment recommendation quantity as the initial replenishment recommendation quantity if the storage capacity threshold is not exceeded.

[0032] The second replenishment unit is used to construct a linear programming model if the inventory exceeds the storage capacity threshold. The model aims to minimize the deviation of the recommended replenishment quantity, using the storage capacity threshold as a constraint. The optimized replenishment recommendation is then used as the initial replenishment recommendation. For example, if the current consumption trend forecast for this medicine is 900 boxes, but the storage capacity is limited to 800 boxes, the linear programming model can be adjusted to replenish in two stages, keeping the total quantity within 800 boxes. The final optimized quantity is 780 boxes. This adjustment satisfies the forecast requirements while strictly adhering to storage space constraints, thereby improving the overall inventory turnover efficiency of the pharmacy.

[0033] The first replenishment planning unit is used to determine the initial replenishment recommendation quantity and its correspondence with each drug, thus establishing the initial replenishment plan. For example, the optimized replenishment quantity of 780 boxes is associated with specific drug codes and updated in the pharmacy's procurement list. This plan effectively reduces the risk of inventory backlog while ensuring clinical supply continuity, making pharmacy operations more efficient and cost-effective.

[0034] The storage location optimization module includes: an initial allocation unit, a first operation simulation unit, a confusion judgment unit, a conflict adjustment unit, a second operation simulation unit, and an optimization unit.

[0035] The initial allocation unit is used to integrate storage capacity information based on the initial replenishment plan and generate initial storage location allocation results. When generating initial storage location allocation results based on the initial replenishment plan, frequently used medicines can be prioritized for allocation to locations closer to the outbound exit based on the turnover rate and storage requirements of the medicines. For example, assuming a warehouse has 100 storage locations, each with a maximum capacity of 500 units, and the initial replenishment plan shows that a certain medicine requires replenishment of 300 units, the initial allocation will prioritize locations with sufficient remaining capacity and convenient locations. This method effectively shortens picking paths and improves operational efficiency.

[0036] The first operation simulation unit is used to perform replenishment operations on the initial storage location allocation results using a dynamic simulation algorithm, and to record the operation execution process. When performing replenishment operations on the initial storage location allocation results using a dynamic simulation algorithm and recording the process, it can simulate the movement path and operation sequence of the replenishment operator in the warehouse.

[0037] The chaos judgment unit is used to extract operational sequence conflicts from the operation execution process and identify operational chaos risk points. Assuming the initial storage location allocation results in movement paths and operational sequences involving 10 storage locations, simulations reveal that the replenishment operations for the 3rd and 5th storage locations cause time conflicts due to path overlap, which are then recorded as potential risk points. This simulation can intuitively reflect bottleneck problems in the operation.

[0038] The conflict adjustment unit is used to adjust the positions of conflicting storage locations in the storage location allocation result based on operational chaos risk points, resulting in an adjusted storage location allocation. It determines whether the operational chaos risk points exceed a preset threshold, which can be set to no more than 5 conflicts per day. If the simulation results show 7 conflicts, the storage location allocation needs to be adjusted. During adjustment, medicines in conflicting storage locations can be redistributed to adjacent empty storage locations to reduce path intersections. This adjustment effectively reduces the possibility of operational chaos.

[0039] The second operation simulation unit is used to re-execute the replenishment operation on the adjusted storage location allocation results using a dynamic simulation algorithm, verifying the changes in operational chaos risk points. When re-executing the replenishment operation to verify the changes in operational chaos risk points, if the number of conflicts decreases to 3 after adjustment, which is below the threshold, the feasibility of the adjustment plan can be confirmed. This verification mechanism ensures the reliability of the allocation plan.

[0040] The optimization unit is used to derive the final optimized storage location allocation scheme based on the verified changes in operational chaos risk points. When determining the optimized storage location allocation scheme, operational efficiency and space utilization can be comprehensively considered, prioritizing the scheme with the fewest conflicts and the highest capacity utilization. Assuming the final scheme concentrates high-frequency drugs in the front-row storage locations, reducing operational conflicts by 50%, it can significantly improve the overall operational efficiency of the warehouse. The benefits of this optimization include reduced manual intervention and improved replenishment accuracy. Through the above multi-faceted examples and analyses, a complete logical chain is formed from initial allocation to dynamic adjustment and final optimization, fully demonstrating the practical value of optimizing storage location allocation in pharmaceutical inventory management.

[0041] The update module includes: a fusion unit, an update unit, and a path acquisition unit.

[0042] The fusion unit is used to combine the location allocation optimization scheme with the preset real-time drug shortage risk indicators to obtain the location risk status. First, it obtains the drug type, current inventory, and historical drug shortage records for each location in the location allocation optimization scheme. Then, it combines the above data with the preset real-time drug shortage risk indicators through a weighted average method to obtain a comprehensive risk score, thus obtaining the location risk status.

[0043] The update unit is used to update the replenishment priority sequence based on the location risk status. When updating the replenishment priority sequence based on the location risk status, the minimum inventory threshold for the drug and the daily prescription volume can be referenced. For example, if amoxicillin currently has only 20 boxes in stock, the minimum inventory threshold is 50 boxes, and the predicted daily prescription volume is 80 boxes, then its initial priority is first; omeprazole has 60 boxes in stock, the minimum inventory threshold is 40 boxes, but the risk of shortage is high, so it also enters the top three priority sequences. This calculation is beneficial for allocating limited replenishment resources to the most urgent drugs.

[0044] The path acquisition unit is used to obtain drug replenishment paths based on the replenishment priority sequence, employing a random forest model that combines location distance and picking frequency. The input features of the random forest model include the distance from the replenishment staff to the location, the average daily number of drug picks, and the priority score corresponding to the replenishment priority sequence. For example, for amoxicillin, the random forest model might generate three candidate paths: Path 1, 15 meters away but passing through a high-frequency picking area; Path 2, 18 meters away avoiding congestion; and Path 3, 12 meters away but crossing a temporary storage area. When selecting the final drug replenishment path from the candidate paths, the optimal path is chosen by comparing path length, real-time congestion monitoring data, and picking frequency, ensuring both efficiency and minimizing operational interference. This selection helps reduce the walking time of replenishment staff while avoiding conflicts with normal picking processes, ultimately improving the overall pharmacy operational smoothness and the timeliness of patient medication access.

[0045] The prediction correction module includes: a consumption sequence extraction unit, a parameter recalculation unit, and a prediction correction unit.

[0046] The consumption sequence extraction unit is used to extract relevant drug consumption data from the drug replenishment path to obtain the raw consumption sequence. Extracting consumption data from the drug replenishment path allows for the acquisition of actual records of drug usage during the replenishment process, forming the raw consumption sequence. This sequence reflects the daily or shift-specific changes in drug consumption.

[0047] The parameter recalculation unit is used to recalculate the data fluctuation characteristic parameters based on the original consumption sequence using time series analysis methods, and obtain the fluctuation residual data.

[0048] The prediction correction unit is used to obtain refined consumption prediction correction values ​​based on the recalculated data fluctuation characteristic parameters.

[0049] The second replenishment module includes: a second comparison unit, a replenishment correction unit, and a second replenishment planning unit.

[0050] The second comparison unit is used to compare the refined consumption forecast correction value with the preset storage space capacity threshold to determine whether the refined consumption forecast correction value exceeds the storage space capacity threshold. The replenishment correction unit is used to solve the corrected replenishment recommendation quantity based on the comparison results using linear programming iteration; The second replenishment planning unit is used to determine the revised replenishment recommendation quantity and its correspondence with each drug, and to determine the final replenishment plan.

[0051] In summary, this invention discloses a pharmacy drug consumption prediction and replenishment system that integrates prescription flow. First, prescription flow is collected in real time and historical consumption records are integrated; time series analysis is used to predict drug consumption trends. When the predicted value exceeds the storage capacity threshold, linear programming is used to optimize and adjust the replenishment quantity. Next, storage location information is integrated, and a dynamic simulation algorithm is used to verify and optimize the storage location allocation scheme. Finally, real-time drug shortage risk indicators are integrated, replenishment priorities are updated, and time series fine-grained prediction and linear programming iterations are performed again until the final inventory recovery level is determined. This invention achieves a closed-loop correlation between prediction, optimization, verification, and risk control, effectively reducing the drug shortage rate, improving storage location utilization efficiency, and reducing operational chaos, significantly improving the accuracy and stability of pharmacy inventory management.

[0052] Example 2 like Figure 2 As shown, based on the same inventive concept, this invention also provides a method for predicting and replenishing pharmacy drug consumption by combining prescription flow, implemented using the system described in the foregoing embodiments. The method includes: Prescription flow data is collected in real time from the HIS system. Time series analysis is used to obtain data fluctuation characteristic parameters. Based on the data fluctuation characteristic parameters, the current drug consumption trend prediction value is obtained. Based on the current predicted trend of drug consumption and the preset storage capacity threshold, linear programming optimization is used to obtain the initial replenishment recommendation quantity and determine the initial replenishment plan; Based on the initial replenishment plan, the storage capacity information of the storage locations is integrated, and a dynamic simulation algorithm is used to verify potential points of operational chaos, thereby obtaining an optimized storage location allocation scheme. Based on the optimized location allocation scheme and real-time drug shortage risk indicators, update the priority of replenishment suggestions and obtain the drug replenishment path; Relevant drug consumption data are extracted from the drug replenishment path, and time series analysis is used to recalculate the data fluctuation characteristic parameters to obtain refined consumption prediction correction values. Based on the refined consumption forecast correction value and the preset storage capacity threshold, the corrected replenishment suggestion quantity is solved by linear programming iteration to determine the final replenishment plan.

[0053] Furthermore, in this embodiment, the method for collecting prescription flow data in real time from the HIS system, obtaining data fluctuation characteristic parameters using time series analysis, and obtaining the current drug consumption trend prediction value based on the data fluctuation characteristic parameters includes: Real-time collection of prescription flow data from the HIS system to construct a dynamic flow dataset; Based on the dynamic flow dataset, historical drug consumption records are integrated to form a comprehensive data matrix, and a joint dataset containing time and consumption dimensions is determined. Time series analysis is used to extract features from the data fluctuations in the joint dataset and obtain data fluctuation characteristic parameters. By combining the data fluctuation characteristic parameters with the current time point, a predicted trend curve of drug consumption can be obtained; The stability of the predicted trend curve is assessed. If the stability is lower than a preset threshold, the data fluctuation characteristic parameters are smoothed to obtain the final predicted value of the current drug consumption trend.

[0054] Furthermore, in this embodiment, the method for determining the initial replenishment plan by using linear programming optimization to obtain the initial replenishment recommendation quantity based on the current drug consumption trend forecast and the preset storage capacity threshold includes: The current predicted value of drug consumption trend is compared with the preset storage space capacity threshold to determine whether the current predicted value of drug consumption trend exceeds the storage space capacity threshold. If the storage capacity threshold is not exceeded, the original replenishment recommendation quantity will be used directly as the initial replenishment recommendation quantity. If the inventory exceeds the storage capacity threshold, a linear programming model is constructed with the goal of minimizing the deviation of the replenishment recommendation quantity. The storage capacity threshold is set as a constraint, and the optimized replenishment recommendation quantity is obtained as the initial replenishment recommendation quantity. Determine the initial replenishment recommendation quantity and its correspondence with each drug, and determine the initial replenishment plan.

[0055] Furthermore, in this embodiment, the method for obtaining an optimized storage location allocation scheme by integrating storage capacity information based on the initial replenishment plan and using a dynamic simulation algorithm to verify potential points of operational chaos includes: Based on the initial replenishment plan, integrate the storage capacity information of the storage locations to generate the initial storage location allocation results; A dynamic simulation algorithm is used to perform replenishment operations on the initial storage location allocation results, and the operation execution process is recorded. Extract operational sequence conflicts during the operation execution process to identify risk points of operational chaos; Based on the risk of operational chaos, the positions of conflicting storage locations in the storage location allocation results are adjusted to obtain the adjusted storage location allocation results; The replenishment operation was re-executed using a dynamic simulation algorithm to verify the changes in the risk points of operational chaos. Based on the changes in operational chaos risk points after verification, the final optimized storage location allocation scheme is obtained.

[0056] Furthermore, in this embodiment, the method for updating replenishment recommendation priorities and obtaining drug replenishment paths based on the optimized storage location allocation scheme and real-time drug shortage risk indicators includes: The location risk status is obtained by integrating the location allocation optimization scheme with the preset real-time drug shortage risk indicators. Update the replenishment priority sequence based on the risk status of the storage location; Based on the replenishment priority sequence, a random forest model is used, combined with location distance and picking frequency, to obtain the drug replenishment path.

[0057] The embodiments described above are merely preferred embodiments of the present invention and are not intended to limit the scope of the present invention. Various modifications and improvements made to the technical solutions of the present invention by those skilled in the art without departing from the spirit of the present invention should fall within the protection scope defined by the claims of the present invention.

Claims

1. A pharmacy drug consumption prediction and replenishment system that combines prescription flow, characterized in that, The system includes: a data acquisition and forecasting module, a first replenishment module, a storage location optimization module, an update module, a forecast correction module, and a second replenishment module; The data acquisition and prediction module is used to collect prescription flow data from the HIS system in real time, use time series analysis to obtain data fluctuation characteristic parameters, and obtain the current drug consumption trend prediction value based on the data fluctuation characteristic parameters. The first replenishment module is used to obtain the initial replenishment recommendation quantity and determine the initial replenishment plan based on the current drug consumption trend forecast and the preset storage capacity threshold using linear programming optimization. The storage location optimization module is used to integrate storage location capacity information based on the initial replenishment plan, and to use dynamic simulation algorithms to verify potential points of operational chaos in order to obtain an optimized storage location allocation scheme. The update module is used to update the priority of replenishment suggestions and obtain the drug replenishment path based on the storage location allocation optimization plan and real-time drug shortage risk indicators. The prediction and correction module is used to extract relevant drug consumption data from the drug replenishment path, recalculate the data fluctuation characteristic parameters using time series analysis methods, and obtain refined consumption prediction and correction values. The second replenishment module is used to determine the final replenishment plan by solving the corrected replenishment recommendation quantity through linear programming iteratively based on the refined consumption forecast correction value and the preset storage capacity threshold.

2. The system according to claim 1, characterized in that, The data acquisition and prediction module includes: a data acquisition unit, a data combination unit, a feature extraction unit, a first prediction unit, and a second prediction unit; The data acquisition unit is used to collect prescription flow data from the HIS system in real time and build a dynamic flow dataset; The data fusion unit is used to integrate historical drug consumption records based on dynamic flow datasets to form a comprehensive data matrix and determine the fusion dataset containing time and consumption dimensions. The feature extraction unit is used to extract features from the data fluctuations in the joint dataset using time series analysis methods, and to obtain data fluctuation feature parameters. The first prediction unit is used to obtain the predicted trend curve of drug consumption by combining the data fluctuation characteristic parameters with the current time point; The second prediction unit is used to determine the stability of the prediction trend curve. If the stability is lower than the preset threshold, the data fluctuation characteristic parameters are smoothed to obtain the final predicted value of the current drug consumption trend.

3. The system according to claim 1, characterized in that, The first replenishment module includes: a first comparison unit, a first replenishment unit, a second replenishment unit, and a first replenishment planning unit; The first comparison unit is used to compare the current drug consumption trend prediction value with the preset storage space capacity threshold to determine whether the current drug consumption trend prediction value exceeds the storage space capacity threshold. The first replenishment unit is used to directly use the original replenishment recommendation quantity as the initial replenishment recommendation quantity if the storage capacity threshold is not exceeded. The second replenishment unit is used to construct a linear programming model if the inventory capacity threshold is exceeded. The model aims to minimize the deviation of the replenishment recommendation quantity, sets the inventory capacity threshold as a constraint, and solves the optimized replenishment recommendation quantity as the initial replenishment recommendation quantity. The first replenishment planning unit is used to determine the initial replenishment recommendation quantity and the corresponding relationship between each drug, and to determine the initial replenishment plan.

4. The system according to claim 1, characterized in that, The storage location optimization module includes: an initial allocation unit, a first operation simulation unit, a confusion judgment unit, a conflict adjustment unit, a second operation simulation unit, and an optimization unit; The initial allocation unit is used to integrate storage capacity information based on the initial replenishment plan and generate initial storage location allocation results. The first operation simulation unit is used to perform replenishment operations on the initial storage location allocation results using a dynamic simulation algorithm and record the operation execution process. The chaos judgment unit is used to extract operation sequence conflicts from the operation execution process and judge the risk points of operation chaos. The conflict adjustment unit is used to adjust the positions of conflicting storage locations in the storage location allocation result based on the risk points of operational chaos, so as to obtain the adjusted storage location allocation result. The second operation simulation unit is used to re-execute the replenishment operation on the adjusted storage location allocation results through dynamic simulation algorithm to verify the changes in the risk points of operational chaos. The optimization unit is used to obtain the final optimized storage location allocation scheme based on the changes in operational chaos risk points after verification.

5. The system according to claim 1, characterized in that, The update module includes: a fusion unit, an update unit, and a path acquisition unit; The fusion unit is used to fuse the storage location allocation optimization scheme with the preset real-time drug shortage risk indicators to obtain the storage location risk status. The update unit is used to update the replenishment priority sequence based on the risk status of the storage location; The path acquisition unit is used to obtain the drug replenishment path based on the replenishment priority sequence, using a random forest model, combined with the distance to the storage location and the picking frequency.

6. A method for predicting and replenishing pharmacy drug consumption based on prescription flow, wherein the method is implemented using the system described in any one of claims 1-5, characterized in that, The method includes: Prescription flow data is collected in real time from the HIS system. Time series analysis is used to obtain data fluctuation characteristic parameters. Based on the data fluctuation characteristic parameters, the current drug consumption trend prediction value is obtained. Based on the current predicted trend of drug consumption and the preset storage capacity threshold, linear programming optimization is used to obtain the initial replenishment recommendation quantity and determine the initial replenishment plan; Based on the initial replenishment plan, the storage capacity information of the storage locations is integrated, and a dynamic simulation algorithm is used to verify potential points of operational chaos, thereby obtaining an optimized storage location allocation scheme. Based on the optimized location allocation scheme and real-time drug shortage risk indicators, update the priority of replenishment suggestions and obtain the drug replenishment path; Relevant drug consumption data are extracted from the drug replenishment path, and time series analysis is used to recalculate the data fluctuation characteristic parameters to obtain refined consumption prediction correction values. Based on the refined consumption forecast correction value and the preset storage capacity threshold, the corrected replenishment suggestion quantity is solved by linear programming iteration to determine the final replenishment plan.

7. The method according to claim 6, characterized in that, Methods for collecting prescription flow data in real time from the HIS system, obtaining data fluctuation characteristic parameters using time series analysis, and then predicting the current drug consumption trend based on these data fluctuation characteristic parameters include: Real-time collection of prescription flow data from the HIS system to construct a dynamic flow dataset; Based on the dynamic flow dataset, historical drug consumption records are integrated to form a comprehensive data matrix, and a joint dataset containing time and consumption dimensions is determined. Time series analysis is used to extract features from the data fluctuations in the joint dataset and obtain data fluctuation characteristic parameters. By combining the data fluctuation characteristic parameters with the current time point, a predicted trend curve of drug consumption can be obtained; The stability of the predicted trend curve is assessed. If the stability is lower than a preset threshold, the data fluctuation characteristic parameters are smoothed to obtain the final predicted value of the current drug consumption trend.

8. The method according to claim 6, characterized in that, Based on the current predicted drug consumption trend and the preset storage capacity threshold, linear programming optimization is used to obtain the initial replenishment recommendation quantity. The methods for determining the initial replenishment plan include: The current predicted value of drug consumption trend is compared with the preset storage space capacity threshold to determine whether the current predicted value of drug consumption trend exceeds the storage space capacity threshold. If the storage capacity threshold is not exceeded, the original replenishment recommendation quantity will be used directly as the initial replenishment recommendation quantity. If the inventory storage capacity threshold is exceeded, a linear programming model is constructed with the goal of minimizing the deviation of the replenishment recommendation quantity. The inventory storage capacity threshold is set as a constraint, and the optimized replenishment recommendation quantity is obtained as the initial replenishment recommendation quantity. Determine the initial replenishment recommendation quantity and its correspondence with each drug, and determine the initial replenishment plan.

9. The method according to claim 6, characterized in that, Based on the initial replenishment plan, integrating storage capacity information, and employing dynamic simulation algorithms to verify potential points of operational chaos, the method for obtaining optimized storage location allocation solutions includes: Based on the initial replenishment plan, integrate the storage capacity information of the storage locations to generate the initial storage location allocation results; A dynamic simulation algorithm is used to perform replenishment operations on the initial storage location allocation results, and the operation execution process is recorded. Extract operational sequence conflicts during the operation execution process to identify risk points of operational chaos; Based on the risk of operational chaos, the positions of conflicting storage locations in the storage location allocation results are adjusted to obtain the adjusted storage location allocation results; The replenishment operation was re-executed using a dynamic simulation algorithm to verify the changes in the risk points of operational chaos. Based on the changes in operational chaos risk points after verification, the final optimized storage location allocation scheme is obtained.

10. The method according to claim 6, characterized in that, Based on the optimized storage location allocation scheme and real-time drug shortage risk indicators, the methods for updating replenishment recommendations and obtaining drug replenishment paths include: The location risk status is obtained by integrating the location allocation optimization scheme with the preset real-time drug shortage risk indicators. Update the replenishment priority sequence based on the risk status of the storage location; Based on the replenishment priority sequence, a random forest model is used, combined with location distance and picking frequency, to obtain the drug replenishment path.