An intelligent pharmacy management system
By introducing drug density and weighting coefficients, combined with drug fuzzy clustering and inventory optimization, the problems of drug mixing and expiration date risk in pharmacy management are solved, achieving high efficiency and reliability in pharmacy management.
Patent Information
- Application Number
- CN202511517914.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-10-23
- Publication Date
- 2025-12-30
- Estimated Expiration
- 2045-10-23
AI Technical Summary
Existing pharmacy management systems ignore the cost attributes of drugs, resulting in high-value drugs being mixed with low-cost drugs, increasing inventory risk and management difficulty. Furthermore, neglecting expiration date risk leads to the accumulation and spoilage of drugs nearing their expiration date, resulting in poor management efficiency and reliability.
By defining drug density, introducing weighting coefficients and functional association constraints, fuzzy clustering of drugs is performed. Combined with inventory cost and expiration date risk management, drug classification and inventory strategies are optimized to achieve accurate classification and inventory level adjustment based on cost sensitivity and functional association.
To improve the efficiency and reliability of pharmacy management, reduce the impact of extreme values, ensure that drug classification results closely reflect actual characteristics, avoid drug expiration, and adapt to fluctuations in demand.
Smart Images

Figure CN120996724B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of pharmacy management, specifically to an intelligent pharmacy management system. Background Technology
[0002] Pharmacy management systems are information technology tools that assist hospital pharmacies, community pharmacies, and other institutions in carrying out daily operations. Their core objectives are to standardize drug management processes, improve operational efficiency, reduce inventory backlog and stockout risks, and ensure stable supply. However, typical pharmacy management systems often neglect the cost attributes of drugs, potentially mixing high-value drugs with low-cost drugs, increasing inventory risk and management difficulty. They are also susceptible to extreme values, causing classification results to deviate from the true characteristics of most drugs, leading to poor pharmacy management efficiency. Furthermore, typical pharmacy management systems often ignore expiration date risks, resulting in the accumulation and spoilage of near-expiration drugs, and making it difficult for drug inventory to adapt to demand fluctuations, thus leading to poor pharmacy management reliability. Summary of the Invention
[0003] To address the above issues and overcome the shortcomings of existing technologies, this invention provides an intelligent pharmacy management system. It addresses the problems of general pharmacy management systems neglecting drug cost attributes, allowing high-value drugs to be mixed with low-cost drugs, increasing inventory risk and management difficulty, and being susceptible to extreme values that cause classification results to deviate from the true characteristics of most drugs, leading to poor pharmacy management efficiency. This solution defines drug density, introduces weighting coefficients to highlight the impact of inventory costs, and incorporates functional association constraints to avoid excessive splitting of functionally related drugs, achieving accurate classification based on cost sensitivity and functional association. Furthermore, by dynamically adjusting cluster centers by selecting representative points within each class, the impact of extreme values on classification is reduced, ensuring accurate drug classification. The results more closely reflect the true characteristics of most drugs, thereby improving pharmacy management efficiency. Addressing the issue that general pharmacy management systems often neglect expiration date risks, leading to stockpiling and overstocking of near-expiration drugs, and inventory levels failing to adapt to demand fluctuations, resulting in poor pharmacy management reliability, this solution incorporates expiration date risk management. By introducing an expired loss term into the objective function, it quantifies the impact of the proportion of near-expiration drugs on total costs, prompting inventory strategies to balance stockouts and expiration. Based on clustering results, the optimal inventory is calculated separately for each type of drug. Three trial points from the current inventory are selected to calculate initial inventory candidate values, which are dynamically adjusted based on marginal cost changes, ensuring that inventory levels respond to cost and demand fluctuations, thus improving pharmacy management reliability.
[0004] The technical solution adopted by the present invention is as follows: The present invention provides an intelligent pharmacy management system, including a drug data acquisition module, an initial drug cluster center selection module, a drug fuzzy clustering processing module, and a pharmacy inventory optimization module;
[0005] The drug data acquisition module obtains drug operation data;
[0006] The initial drug cluster center selection module selects initial cluster centers based on drug operation data by defining drug density and introducing constraints such as weight, cost sensitivity, and drug functional similarity.
[0007] The drug fuzzy clustering processing module performs fuzzy clustering on drug operation data based on the initial cluster centers, introduces cluster center update optimization, and stores drugs in the same cluster after clustering.
[0008] The pharmacy inventory optimization module constructs an objective function that includes inventory costs, stockout costs, and expiration losses, and determines the optimal inventory level for each type of medicine based on marginal cost adjustments.
[0009] Furthermore, the drug data acquisition module acquires drug operation data, including average daily sales, inventory costs, remaining shelf life, replenishment cycle, and stockout frequency; and performs data standardization processing.
[0010] Furthermore, the initial drug cluster center selection module determines the initial drug classification centers and defines drug density. Based on drug operation data Centered on the average daily sales - remaining expiration date, the number of data points whose feature distance from the drug operation data is less than the threshold r is represented as: Where p(·) is an indicator function that returns 1 if the condition is met, and 0 otherwise; n is the total number of drugs, and j is the drug index; and These are the average daily sales of the i-th drug and the j-th drug, respectively. and Let be the remaining expiration dates of the i-th and j-th drugs, respectively; r is the distance threshold; the drug with the highest density is preferentially selected as the first initial cluster center. When there is more than one highest density, the drug with a larger average distance from other drugs is preferentially selected as the initial cluster center; for the k-th initial cluster center (k>1), a weight is introduced to highlight cost sensitivity, and a drug correlation constraint is added. Represented as: Where X is the set of all medicines; It is the j-th initial cluster center; M is the set of selected initial centers; and These are the inventory costs of the i-th and j-th drugs, respectively. and These are weighting coefficients; It refers to the similarity of drug functions; These are constraint weights.
[0011] Furthermore, the drug fuzzy clustering processing module performs fuzzy clustering processing on drug operation data based on the initial cluster centers; it introduces cluster center update optimization, dynamically adjusts the cluster centers, and selects three representative points for the characteristics of each type of drug in the cluster, namely the lowest within the cluster, the median within the cluster, and the highest within the cluster, to calculate the optimized cluster center characteristics.
[0012] Furthermore, the pharmacy inventory optimization module sets an optimal inventory level for each type of drug and obtains the current inventory level of the drugs. For the k-th type of drug, the objective is to minimize the total cost, introduce an expiration loss term, and define an inventory optimization objective function for each type of drug. The inventory optimization process includes: determining initial inventory candidate values, selecting 3 trial points, and constructing initial inventory candidate values; adjusting the inventory level based on changes in marginal cost; setting the drug inventory capacity, and if the inventory cost at the time of convergence of the inventory optimization objective function is lower than the drug inventory capacity, then the inventory cost at this time is taken as the optimal inventory of the drug; otherwise, the drug inventory capacity is taken as the optimal inventory of the drug.
[0013] The beneficial effects achieved by the present invention using the above solution are as follows:
[0014] (1) In view of the problems that general pharmacy management systems ignore the cost attributes of drugs, high-value drugs may be mixed with low-cost drugs, increasing inventory risk and management difficulty, and are easily affected by extreme values, resulting in classification results that deviate from the true characteristics of most drugs, thus leading to poor pharmacy management efficiency, this solution defines drug density, introduces weight coefficients to highlight the impact of inventory costs, adds functional association constraints to avoid excessive splitting of functionally related drugs, and achieves accurate classification of cost-sensitive and functionally related drugs; by selecting representative points within the class to dynamically adjust the cluster center, the impact of extreme values on classification is reduced, making the drug classification results closer to the true characteristics of most drugs; thereby improving pharmacy management efficiency.
[0015] (2) In response to the problem that general pharmacy management systems neglect the risk of expiration dates, resulting in the accumulation and expiration of drugs nearing their expiration date, and the inability of drug inventory to adapt to demand fluctuations, thus leading to poor pharmacy management reliability, this solution incorporates expiration date risk control. By introducing an expiration loss term into the objective function, the impact of the proportion of drugs nearing their expiration date on the total cost is quantified, prompting the inventory strategy to take into account both stockouts and expiration. Based on the clustering results, the optimal inventory is calculated separately for each type of drug, and three trial points of the current inventory are selected to calculate the initial inventory candidate value. The inventory level is dynamically adjusted based on changes in marginal cost, so that the inventory level can respond to cost and demand fluctuations, thereby improving the reliability of pharmacy management. Attached Figure Description
[0016] Figure 1 This is a flowchart illustrating an intelligent pharmacy management system provided by the present invention.
[0017] The accompanying drawings are provided to further illustrate the invention and form part of the specification. They are used together with the embodiments of the invention to explain the invention and do not constitute a limitation thereof. Detailed Implementation
[0018] The technical solutions of the present invention will be clearly and completely described below with reference to the accompanying drawings of the embodiments of the present invention. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. All other embodiments obtained by those skilled in the art based on the embodiments of the present invention without creative effort are within the scope of protection of the present invention.
[0019] In the description of this invention, it should be understood that the terms "upper", "lower", "front", "rear", "left", "right", "top", "bottom", "inner", "outer", etc., indicate the orientation or positional relationship based on the orientation or positional relationship shown in the accompanying drawings. They are only for the convenience of describing this invention and simplifying the description, and do not indicate or imply that the device or element referred to must have a specific orientation, or be constructed and operated in a specific orientation. Therefore, they should not be construed as limitations on this invention.
[0020] Example 1, see Figure 1 The present invention provides an intelligent pharmacy management system, including a drug data acquisition module, an initial drug cluster center selection module, a drug fuzzy clustering processing module, and a pharmacy inventory optimization module;
[0021] The drug data acquisition module obtains drug operation data and sends the data to the initial drug clustering center selection module.
[0022] The initial drug cluster center selection module selects initial cluster centers based on drug operation data by defining drug density and introducing constraints such as weight, cost sensitivity, and drug functional similarity; and sends the data to the drug fuzzy clustering processing module.
[0023] The drug fuzzy clustering processing module performs fuzzy clustering on drug operation data based on the initial cluster centers, introduces cluster center updates and optimizations, and stores drugs in the same cluster after clustering; and sends the data to the pharmacy inventory optimization module.
[0024] The pharmacy inventory optimization module constructs an objective function that includes inventory costs, stockout costs, and expiration losses, and determines the optimal inventory level for each type of medicine based on marginal cost adjustments.
[0025] Example 2, see Figure 1This embodiment is based on the above embodiment. The drug data acquisition module acquires drug operation data, which includes average daily sales S, inventory cost C, remaining shelf life D, replenishment cycle T, and stockout frequency F; and performs data standardization processing, using max-min normalization.
[0026] Example 3, see Figure 1 This embodiment is based on the above embodiment. The initial drug cluster center selection module determines the initial drug classification center to avoid classification bias caused by random selection, including misclassifying best-selling but short-lived drugs and slow-selling but long-lived drugs into the same category. The specific operation is as follows: Define drug density. Based on drug operation data Centered on the average daily sales - remaining expiration date, the number of data points whose feature distance from the drug operation data is less than a threshold r is counted, reflecting the density of drugs with similar characteristics, and is expressed as: Where p(·) is an indicator function that returns 1 if the condition is met, and 0 otherwise; n is the total number of drugs, and j is the drug index; and These are the average daily sales of the i-th drug and the j-th drug, respectively. and Let be the remaining expiration dates of the i-th and j-th drugs, respectively; r is the distance threshold; the drug with the highest density is preferentially selected as the first initial cluster center. When there is more than one highest density, the drug with a larger average distance from other drugs is preferentially selected as the initial cluster center; for the k-th initial cluster center (k>1), a weight is introduced to highlight cost sensitivity, high-cost drugs need to be classified separately, and drug correlation constraints are added to avoid over-splitting of functionally related drugs. Represented as: Where X is the set of all medicines; It is the j-th initial cluster center; M is the set of selected initial centers; and These are the inventory costs of the i-th and j-th drugs, respectively. and These are weighting coefficients; This refers to the functional similarity of drugs. The indication text of the drugs is preprocessed, including word segmentation and stop word removal. The text is converted into vectors using the Word2Vec word vector model, and the cosine similarity of the vectors is calculated to obtain the functional similarity of the drugs. The larger the value, the closer the semantics of the indications are. These are constraint weights;
[0027] Pharmacy medications are identified by density in areas of high concentration, and by spacing to ensure coverage of different types, avoiding initial classification bias towards a particular category of medications.
[0028] Example 4, see Figure 1 This embodiment is based on the above embodiment. The drug fuzzy clustering processing module performs fuzzy clustering processing on drug operation data based on the initial cluster centers; it introduces cluster center update optimization to dynamically adjust the cluster centers and avoid the influence of extreme values, including drugs that suddenly become unsaleable; for the characteristics of each type of drug in the cluster, three representative points are selected, namely the lowest within the class. Within-class median and the highest within the class ; Calculate the optimized cluster center features , is represented as: ; It is the adjustment range; by dynamically adjusting the cluster center interval, the classification is made closer to the true characteristics of most drugs; after the clustering is completed, drugs belonging to the same cluster are stored together.
[0029] By performing the above operations, this solution addresses the problems of general pharmacy management systems, which often neglect drug cost attributes, allowing high-value drugs to be mixed with low-cost drugs, increasing inventory risk and management difficulty, and being susceptible to extreme values, leading to classification results that deviate from the true characteristics of most drugs and consequently resulting in poor pharmacy management efficiency. This solution defines drug density, introduces weighting coefficients to highlight the impact of inventory costs, and incorporates functional association constraints to avoid over-splitting of functionally related drugs, achieving accurate classification based on cost sensitivity and functional relevance. Furthermore, by dynamically adjusting cluster centers using representative points within each class, the solution reduces the impact of extreme values on classification, making drug classification results closer to the true characteristics of most drugs, thereby improving pharmacy management efficiency.
[0030] Example 5, see Figure 1 This embodiment is based on the above embodiment. The pharmacy inventory optimization module sets an optimal inventory level for each type of drug, balancing stockout losses and inventory costs, avoiding stockouts of core drugs, and reducing the backlog of low-priority drugs. Specifically, it obtains the current inventory level of the drugs; for the k-th type of drug, the objective is to minimize the total cost. This includes inventory costs plus stockout costs, and introduces an expiration loss term to prevent inventory strategies from ignoring expiration date risks; after clustering, an inventory optimization objective function is defined for each type of drug. , is represented as: ; Where Q is the inventory level, only the numerical value is retained; This is the unit inventory cost; only the numerical value is retained. This represents the unit loss due to stockout; only the numerical value is retained. It is the daily average demand, which is the within-cluster mean based on the clustering results and needs to be reverse-normalized; It is an overdue loss item; This represents the unit loss due to drug expiration; only the numerical value is retained. It is the expiration date threshold; This refers to the quantity of drugs nearing their expiration date. This refers to the total quantity of medicines; the inventory optimization process involves determining initial inventory candidate values. Select 3 trial points , and , Corresponding to current inventory; ; The initial inventory candidate value is represented as: Adjusting inventory levels based on changes in marginal cost is expressed as: ; It is an indicator function; This is the updated inventory level; It is the adjustment rate; set the drug inventory capacity. If the inventory cost when the inventory optimization objective function converges is lower than the drug inventory capacity, then the inventory cost at this time is taken as the optimal inventory of the drug; otherwise, the drug inventory capacity is taken as the optimal inventory of the drug.
[0031] By implementing the above operations, this solution addresses the problem of general pharmacy management systems neglecting expiration date risks, leading to stockpiling and expiration of near-expiration drugs, and making it difficult for drug inventory to adapt to demand fluctuations, thus resulting in poor pharmacy management reliability. This solution incorporates expiration date risk management, quantifying the impact of the proportion of near-expiration drugs on total costs by introducing an expiration loss term into the objective function, thus prompting inventory strategies to balance stockouts and expiration. Based on clustering results, the optimal inventory is calculated separately for each type of drug, and three trial points of the current inventory are selected to calculate initial inventory candidate values. These values are dynamically adjusted based on changes in marginal cost, enabling inventory levels to respond to cost and demand fluctuations, thereby improving the reliability of pharmacy management.
[0032] Although embodiments of the invention have been shown and described, it will be understood by those skilled in the art that various changes, modifications, substitutions and alterations can be made to these embodiments without departing from the principles and spirit of the invention.
[0033] The present invention and its embodiments have been described above. This description is not restrictive, and the accompanying drawings are only one embodiment of the present invention; the actual structure is not limited thereto. In conclusion, if those skilled in the art are inspired by this description and design similar structures and embodiments without departing from the spirit of the invention, such designs should fall within the protection scope of the present invention.
Claims
1. An intelligent pharmacy management system, characterized in that: The system comprises a medicine data acquisition module, an initial medicine clustering center selection module, a medicine fuzzy clustering processing module and a pharmacy inventory optimization module. The medicine data acquisition module acquires medicine operation data. The initial medicine clustering center selection module selects an initial clustering center based on the medicine operation data by defining medicine density, introducing weight, cost sensitivity and medicine function similarity constraint. The medicine fuzzy clustering processing module performs fuzzy clustering on the medicine operation data based on the initial clustering center, introduces cluster center updating optimization, and uniformly stores the same cluster medicine after clustering. The pharmacy inventory optimization module determines the optimal inventory level of each type of medicine by constructing a target function containing inventory cost, stockout loss and expiration loss, and based on marginal cost adjustment. The initial medicine clustering center selection module determines an initial medicine clustering center, and defines a medicine density , with medicine operation data as the center, in a daily sales-residual validity period two-dimensional space, the number of data with a feature distance less than a threshold r from the medicine operation data is counted, and is represented as: ; wherein p(·) is an indicator function, returns 1 if the condition is met, and returns 0 otherwise; n is the total number of medicines, and j is the medicine index; and are the daily sales of the i-th medicine and the j-th medicine, respectively; and are the residual validity periods of the i-th medicine and the j-th medicine, respectively; r is the distance threshold; the medicine with the highest density is preferentially selected as the first initial clustering center, and when there is more than one, the medicine with a larger average distance from other medicines is preferentially selected as the initial cluster center; for the k-th initial clustering center, k>1, a weight is introduced to highlight the cost sensitivity, a medicine correlation degree constraint is added, and the k-th initial clustering center is represented as: ; wherein X is a set of all medicines; is the j-th initial clustering center; M is a set of selected initial centers; and are the inventory costs of the i-th medicine and the j-th medicine, respectively; and are weight coefficients; is a medicine function similarity; is a constraint weight; The pharmacy inventory optimization module sets an optimal inventory level for each type of drug and obtains the current inventory level of the drugs; for the k-th type of drug, the objective is to minimize the total cost. This includes inventory costs and stockout losses, and introduces an expiration loss term; after clustering, an inventory optimization objective function is defined for each type of drug. , represented as: ; Where Q is the inventory level; This is the unit inventory cost; This is a loss due to stock shortages within the unit; This is the average daily demand; It is an overdue loss item; This refers to the unit loss due to the drug's expiration date; It is the expiration date threshold; This refers to the quantity of drugs nearing their expiration date. This represents the total number of drugs. For inventory optimization, a drug inventory capacity is set. If the inventory cost at the convergence of the inventory optimization objective function is lower than the drug inventory capacity, then the inventory cost at this point is taken as the optimal inventory of drugs; otherwise, the drug inventory capacity is taken as the optimal inventory of drugs.
2. The intelligent pharmacy management system according to claim 1, wherein: The medicine fuzzy clustering processing module performs fuzzy clustering processing on the medicine operation data based on the initial clustering center; introduces cluster center updating optimization, dynamically adjusts the cluster center, selects three representative points for the characteristics of each type of medicine in the cluster, which are the lowest in the class, the median in the class and the highest in the class, and calculates the optimized cluster center characteristics.
3. The intelligent pharmacy management system according to claim 2, wherein: The inventory optimization is to determine the initial inventory candidate value, select three trial points, and construct the initial inventory candidate value. Adjust the inventory level based on the marginal cost change.
4. The intelligent pharmacy management system of claim 3, wherein: The medicine data acquisition module acquires medicine operation data, and the medicine operation data includes daily average sales, inventory cost, remaining validity period, replenishment cycle and stockout frequency; and performs data standardization processing.
Citation Information
Patent Citations
Hospital pharmacy prescription information intelligent management method
CN119889572A
Inventory data accuracy verification system and method applied to financial cloud secondary development
CN120123327A