A smart pharmacy control system and method

By using an intelligent pharmacy control system to filter and predict drug data, establish dynamic replenishment routes, and optimize the drug replenishment process, the problems of long replenishment time and inaccurate routes in traditional methods are solved, thus achieving rapid and safe drug supply.

CN116959688BActive Publication Date: 2026-06-30WEIHAI BOHUA MEDICAL EQUIP CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2023-08-08
Publication Date
2026-06-30

AI Technical Summary

Technical Problem

Traditional smart pharmacy control methods require manual determination of drug replenishment, the replenishment route is not streamlined enough, resulting in long drug replenishment time and inability to accurately replenish the stations that need replenishment.

Method used

By acquiring drug data from the database, target drugs are screened and predicted, a dynamic drug supply distance matrix is ​​established, the supply route of the intelligent vehicle is optimized, and homomorphic encryption technology is used to ensure data security.

Benefits of technology

It has achieved efficient, accurate and timely drug replenishment, reduced replenishment costs and energy consumption, improved the flexibility and security of drug supply, and avoided drug expiration and shortages.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN116959688B_ABST
    Figure CN116959688B_ABST
Patent Text Reader

Abstract

This invention relates to the field of data processing technology, and more particularly to an intelligent pharmacy control system and method. The method includes the following steps: filtering target drug data from an initial dataset to generate target drug data; calculating drug replenishment time based on the target drug data and drug application data to generate drug replenishment time data; collecting replenishment station locations and establishing a drug replenishment distance matrix based on the target drug data, and dynamically weighting the matrix nodes using the drug replenishment time data to generate a dynamic drug replenishment distance matrix; dynamically planning and optimizing the dynamic drug replenishment distance matrix to generate an optimized intelligent vehicle replenishment route; and replenishing and encrypting the target drug data according to drug replenishment control commands and using the optimized intelligent vehicle replenishment route to generate real-time encrypted drug replenishment data. This invention achieves precise drug replenishment and solves the problem of time-consuming drug replenishment.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of data processing technology, and in particular to an intelligent pharmacy control system and method. Background Technology

[0002] The demand for intelligent pharmacy control methods stems from the digitalization and automation trends in the healthcare industry. By applying intelligent technologies, pharmacies can achieve efficient, accurate, and safe drug management and distribution processes. Intelligent pharmacy control methods can effectively reduce human error, improve work efficiency, and conserve medical resources. Through the introduction of intelligent technologies, intelligent pharmacies can also monitor drug inventory in real time, automatically replenish stock, ensure timely supply to patients, improve the quality of medical services, and achieve automated drug storage and management, thereby reducing the risk of human error. However, traditional intelligent pharmacy control methods still require manual determination of drug replenishment needs, and the replenishment routes are not streamlined enough, failing to accurately replenish at the necessary stations, resulting in lengthy replenishment times. Summary of the Invention

[0003] Based on this, the present invention provides an intelligent pharmacy control system and method to solve at least one of the above-mentioned technical problems.

[0004] To achieve the above objectives, a smart pharmacy control method includes the following steps:

[0005] Step S1: Obtain initial pharmacy drug data from the database; perform target drug data filtering on the initial dataset to generate target drug data;

[0006] Step S2: Obtain drug application data from the database; filter and predict drug application data based on target drug data to generate predicted drug application data; calculate drug replenishment time based on target drug data and predicted drug application data to generate drug replenishment time data.

[0007] Step S3: Collect data on the supply stations of the target drug based on the target drug data to generate drug supply station data; establish a drug supply distance matrix based on the drug supply station data, and use drug supply time data to dynamically weight the matrix nodes to generate a dynamic drug supply distance matrix; perform dynamic route planning and optimization on the dynamic drug supply distance matrix to generate an optimized intelligent vehicle supply route.

[0008] Step S4: Obtain the drug supply control command; according to the drug supply control command, and using the optimized intelligent vehicle supply route, supply the target drug data to generate drug supply data; perform homomorphic encryption and real-time update processing on the drug supply data to generate real-time encrypted drug supply data.

[0009] This invention provides a data foundation for subsequent steps by acquiring initial pharmacy drug data from a database. Target drug data filtering identifies the target drugs requiring replenishment from the initial data, avoiding the processing of unnecessary drug information and improving the efficiency and accuracy of subsequent steps. Filtering the initial pharmacy drug data ensures the system only processes relevant target drugs, thereby reducing the burden of data storage and processing. Acquiring drug application data from the database provides an understanding of actual drug usage, helping to formulate more accurate replenishment plans. Application data filtering and prediction of drug application data clarifies the application needs of target drugs, reducing processing time for useless data, reducing computing power, and lowering the load on hardware processing. Calculating drug replenishment time data allows the system to replenish at appropriate times, avoiding waste caused by replenishing too early or too late, or excessively long patient waiting times. It also better manages drug inventory, preventing drug expiration and shortages, and conserving drug resources. By collecting replenishment site data for target drugs, the system can build an accurate replenishment site database, ensuring the accuracy and timeliness of replenishment. The establishment and time-weighted dynamic drug supply distance matrix enable real-time adjustments to supply routes based on actual conditions, adapting to traffic conditions and drug demand at different times. This improves the flexibility and efficiency of supply routes. Dynamic route planning and optimization methods can adjust drug supply routes in real time based on factors such as time periods and traffic conditions, thereby reducing the operating time and cost of the intelligent vehicle and improving drug supply efficiency. Dynamic route planning and optimization help reduce the travel time and distance of the intelligent vehicle during the supply process, lowering supply costs and energy consumption. By acquiring drug supply control commands, the accuracy and standardization of the supply process are ensured, avoiding potential errors and vulnerabilities. Optimizing the application of intelligent vehicle supply routes makes the supply process more efficient, accurate, and controllable, reducing risks and uncertainties. The application of homomorphic encryption technology ensures the security and privacy of drug supply data, guaranteeing the protection of sensitive information during transmission and storage. Therefore, the intelligent pharmacy control method of the present invention still needs to automatically determine whether medicines need to be replenished by predicting the quantity of medicines used and the inventory information between medicines. Furthermore, it dynamically analyzes the sites that need to be replenished when medicines are replenished and optimizes the routes to make the replenishment time shorter and more accurate.

[0010] Preferably, step S1 includes the following steps:

[0011] Step S11: Obtain initial pharmacy drug data from the database;

[0012] Step S12: Perform data cleaning on the initial pharmacy drug data to generate cleaned drug data;

[0013] Step S13: Obtain drug expiration date data;

[0014] Step S14: Based on the drug expiration date data, perform effective drug data filtering on the cleaned drug data to generate effective drug data;

[0015] Step S15: Extract target drug data from the effective drug data based on the preset target drug data to generate target drug data.

[0016] This invention performs data cleaning on initial pharmacy drug data, removing duplicates, missing data, errors, and other invalid data to ensure the accuracy of drug data. This helps avoid drug information chaos and inventory management problems caused by incomplete or erroneous data, thereby improving the reliability and accuracy of pharmacy management. By acquiring drug expiration date data, the cleaned drug data is filtered to generate valid drug data. This filtering is beneficial for timely identification of expired or near-expiration drugs, preventing patients from purchasing or using expired drugs and ensuring the safety and efficacy of patient medication. Based on preset target drug data, the valid drug data is extracted and processed to generate target drug data. This extraction can be tailored to the needs of hospitals or pharmacies, selectively identifying drugs that require key management and supply, optimizing drug inventory structure, improving inventory turnover, reducing inventory backlog, and rationally planning drug replenishment strategies to avoid stockouts or surpluses, thereby improving the flexibility and responsiveness of drug supply.

[0017] Preferably, step S2 includes the following steps:

[0018] Step S21: Obtain drug application data from the database;

[0019] Step S22: Filter the drug application data based on the target drug data to generate target drug application data;

[0020] Step S23: Use the Long Short-Term Memory Network algorithm to perform drug application prediction processing on the target drug application data to generate predicted drug application data;

[0021] Step S24: Calculate the drug replenishment time using the drug replenishment time calculation formula for the target drug data and the predicted drug application data, and generate drug replenishment time data.

[0022] This invention filters drug application data based on target drug data, retaining only application data relevant to the target drug. This filtering reduces interference from irrelevant data, making the drug application data more accurate and focused on the target drug, thereby improving the quality of the drug application data. It utilizes a Long Short-Term Memory (LSTM) network algorithm to predict drug application data. This prediction, based on historical drug application data, captures patterns and trends in the time series, thus predicting the pharmacy's demand for the target drug in the future. By predicting drug application, pharmacies can prepare drug replenishment in advance, avoiding disruptions to patient treatment plans due to insufficient drug supply. Finally, it uses a drug replenishment time calculation formula to calculate the drug replenishment time based on the target drug data and predicted drug application data. This calculation helps determine the optimal replenishment time, ensuring that drug replenishment matches the pharmacy's demand, avoiding replenishment too early or too late, and optimizing drug supply chain management.

[0023] Preferably, step S23 includes the following steps:

[0024] Step S231: Collect historical target drug application data from the target drug application data to generate historical drug application data;

[0025] Step S232: Use the Long Short-Term Memory Network algorithm to establish a mapping relationship for the prediction of target drug application data and generate an initial drug application prediction model;

[0026] Step S233: Use historical drug application data to perform model prediction processing on the initial drug application prediction model to generate a drug application prediction model;

[0027] Step S234: Optimize the model parameters of the drug application prediction model using the drug application prediction model optimization formula to generate an optimized drug application prediction model;

[0028] Step S235: Transmit the target drug application data to the optimized drug application prediction model for drug application prediction processing to generate predicted drug application data.

[0029] This invention collects historical data on the application of target drugs, which helps to establish a time series of drug application data, capture historical patterns and trends in drug use, and improve the accuracy and generalization ability of the prediction model by collecting historical data. A Long Short-Term Memory (LSTM) network algorithm is used to establish a mapping relationship for the prediction of target drug application data, generating an initial drug application prediction model. LSTM is a deep learning model suitable for predicting sequence data, capable of capturing long-term dependencies in sequence data, and has good performance in predicting drug application data. The initial drug application prediction model is processed using historical drug application data to generate a new drug application prediction model. The model's parameters are then optimized using the drug application prediction model optimization formula to generate an optimized drug application prediction model. This optimization process helps improve the performance of the prediction model, making the prediction results more accurate and reliable. After parameter optimization, the model has a certain degree of adaptability and flexibility, and can adaptively adjust according to different time periods and pharmacy demand periods, making it suitable for different prediction needs and better able to cope with drug demand prediction in different scenarios. By establishing the optimized drug application prediction model, the target drug application data is transmitted to the model for prediction processing, generating predicted drug application data. This forecasting process can more accurately predict drug demand over a future period, helping pharmacies better plan their drug replenishment strategies and improve the accuracy and efficiency of drug supply.

[0030] Preferably, the optimization formula for the drug application prediction model in step S234 is as follows:

[0031] ;

[0032] In the formula, This is represented by the minimum loss function optimization exponent of the drug application prediction model. Indicates the type of medicine. This represents the initial adjustment value of the model's minimum loss function. This is represented as a model adjustment correction term. Represented as the first Historical application data for this type of drug Represented as the first The historical rate of change in the number of applications of a certain type of drug Represented as according to the Weighting information for the price generation of various drug categories. It is represented as the outlier adjustment value of the minimum loss function optimization exponent.

[0033] This invention utilizes a drug application prediction model optimization formula, which fully considers the types of drugs. The initial adjustment value of the model's minimum loss function Model adjustment and correction items , No. Historical application data of various types of drugs , No. Historical application change rate of various drug types According to the first Weighting information for the price generation of various drug types And the interaction relationships between functions, to form functional relationships:

[0034] Right now, By considering multiple drug types, the model can more comprehensively predict the application volume. Furthermore, by setting independent historical data and weight information for each drug type, the model can more flexibly adapt to the application trends of different drugs, helping pharmacies better meet the medication needs of different drugs and improve the accuracy and targeting of drug replenishment. The initial adjustment value of the minimum loss function is the starting point of the optimization process. By adjusting the value of 'a', the shape and optimization direction of the loss function can be initially adjusted. The model adjustment correction term is used to fine-tune the model to adapt to the characteristics of actual data. By adjusting the value of the model adjustment correction term, the model's predictions can be fine-tuned to make them closer to reality. Historical usage data for each drug type is used to better train the model, enabling it to predict future drug usage based on past usage trends; The historical rate of change in the number of applications for each drug type reflects the trend of growth or decline in the number of applications. Considering the historical rate of change in the number of applications allows the model to more flexibly predict the number of applications in the future; according to the... The weighting information generated by the price of different drug types is based on the principle that higher-priced drugs have lower weights, indicating lower demand for higher-priced drugs. This approach more accurately reflects the application trends of drugs at different price points. Through parameter calculations, historical application volume data and application volume change rates can be more accurately fitted. This optimization makes drug application prediction more precise, reduces prediction errors, and provides smart pharmacies with more reliable drug demand forecasts. The outlier adjustment value of the index is optimized using a minimum loss function. The functional relationship is adjusted and corrected to reduce the impact of errors caused by outliers or error terms, thereby generating the minimum loss function optimization exponent for the drug application prediction model more accurately. This improves the accuracy and reliability of optimizing model parameters for drug application prediction models. Furthermore, the weight information and adjustment values ​​in this formula can be adjusted according to actual conditions to adapt to different parameters in drug application prediction models, thus enhancing the algorithm's flexibility and applicability.

[0035] Preferably, the formula for calculating the drug replenishment time in step S24 is as follows:

[0036] ;

[0037] In the formula, This represents data on drug replenishment time. This represents the drug inventory for the target drug. This represents the predicted consumption rate based on predicted drug use data. This is expressed as the rate of change in the predicted consumption rate based on predicted drug use data. This indicates the validity period of the target drug data. This is represented as the weight information of the target drug data. This represents the demand for data related to the target drug. This represents an abnormal adjustment value for drug replenishment time data.

[0038] This invention utilizes the drug inventory of a target drug data. Predicted consumption rate of drug use data The rate of change in the predicted consumption rate of predicted drug use data. Validity period of target drug data Weighting information of target drug data The demand for target drug data And the interaction relationships between functions, to form functional relationships:

[0039] Right now, By comprehensively considering both the drug inventory and demand data of the target drug, the formula can more comprehensively assess the demand for the target drug. The predicted consumption rate represents the speed of drug use over a future period, while the demand represents the pharmacy's overall demand for the drug. The drug replenishment time calculation more accurately reflects the urgency and timing of drug replenishment. By using the demand and weight information of the target drug data, the formula balances the drug inventory and expiration date of the target drug data. If the inventory is high but the expiration date is short, more urgent replenishment may be needed to avoid drug waste due to expiration. Conversely, if the inventory is low but the expiration date is long, replenishment time can be arranged more flexibly. This balancing consideration allows pharmacies to rationally plan replenishment time, optimize inventory management, and reduce losses from expired drugs. By considering the rate of change of the predicted consumption rate based on the predicted drug application data, the formula takes into account that the predicted consumption rate may change. This rate of change allows for more flexible replenishment time arrangements. If the predicted consumption rate changes, it may mean that the demand for drugs is increasing or decreasing. The formula can be adjusted according to this trend, improving the adaptability of the replenishment plan. By optimizing refill time calculations, smart pharmacies can better meet their refill needs, improving the accuracy and efficiency of refill plans. This is achieved by utilizing anomaly adjustments to drug refill time data. The functional relationship is adjusted and corrected to reduce the impact of errors caused by outliers or error terms, thereby generating more accurate drug replenishment time data. This improves the accuracy and reliability of calculating drug replenishment time based on target drug data and predicted drug application data. Furthermore, the weighting information and adjustment values ​​in the formula can be adjusted according to actual conditions, allowing it to be applied to different target drug data and predicted drug application data, thus enhancing the algorithm's flexibility and applicability.

[0040] Preferably, step S3 includes the following steps:

[0041] Step S31: Collect data from the target drug supply stations based on the target drug data, and generate drug supply station data;

[0042] Step S32: Establish a distance matrix for drug supply based on drug supply station data, and generate a drug supply distance matrix;

[0043] Step S33: Use the drug supply time data to dynamically assign time weights to the matrix nodes of the drug supply distance matrix to generate a dynamic drug supply distance matrix;

[0044] Step S34: Perform dynamic route planning on the dynamic medicine supply distance matrix to generate an initial intelligent vehicle supply route;

[0045] Step S35: Obtain obstacle point data for the supply route;

[0046] Step S36: Adjust the initial intelligent vehicle supply route based on the obstacle point data of the supply route to generate an intelligent vehicle supply route;

[0047] Step S37: Optimize the intelligent vehicle resupply route using the shortest path algorithm to generate an optimized intelligent vehicle resupply route.

[0048] This invention collects resupply station data based on target drug data to determine suitable locations for resupply stations within or around pharmacies. This data collection helps optimize the layout of resupply stations, making drug resupply more distributed and efficient. By rationally setting up resupply stations, the transportation path of the intelligent vehicle can be shortened, resupply time reduced, and thus the efficiency of drug resupply improved. A drug resupply distance matrix is ​​established based on the resupply station data. This matrix records the distance information between each resupply station, including straight-line distance and actual travel distance. By establishing the distance matrix, the distance relationships between different resupply stations can be quantified, providing basic data for subsequent route planning. By dynamically weighting the supply distance matrix using drug replenishment time data, with weighting states of 0 and 1, the traffic conditions encountered by the intelligent vehicle will vary at different times during route planning. For example, if some target drugs do not yet need replenishment, the station where the target drug is located will not be weighted, and the weighting state will be 0. If the target drug needs replenishment, the station where the target drug is located will be weighted, and the weighting state will be 1. This route adjustment under different conditions improves the transportation efficiency and timely replenishment of the intelligent vehicle. By dynamically planning the drug replenishment distance matrix, an initial intelligent vehicle replenishment route is generated. Dynamic route planning considers factors such as replenishment stations and distances, and can formulate a replenishment route suitable for the current situation. This avoids unnecessary waiting, detours, or congestion for the intelligent vehicle, thereby improving the efficiency and accuracy of drug replenishment. Based on obstacle point data along the supply route, the initial supply route of the intelligent vehicle is adjusted. Obstacle point data can include real-time collected traffic information and densely populated areas. By considering these obstacles, the supply route is adjusted to avoid congestion and ensure the intelligent vehicle reaches its destination smoothly. The shortest path algorithm is used to optimize the intelligent vehicle's supply route. This algorithm finds the shortest path connecting the starting point and the target point, reducing travel distance and time. Through shortest path optimization, the intelligent vehicle can complete the medicine supply task faster and more efficiently, improving supply efficiency while reducing energy consumption and costs.

[0049] Preferably, step S33 includes the following steps:

[0050] When the drug supply station data in the drug supply distance matrix is ​​already within the drug supply time data, the matrix nodes of the drug supply distance matrix are assigned time weights; when the drug supply station data in the drug supply distance matrix is ​​not within the drug supply time data, the matrix nodes of the drug supply distance matrix are not assigned time weights, thereby generating a dynamic drug supply distance matrix.

[0051] This invention dynamically weights the drug replenishment distance matrix over time. Nodes in the distance matrix are weighted according to drug replenishment time data. This weighting method allows the intelligent vehicle to flexibly adjust its replenishment route at different times. Dynamic time weighting considers different time periods, assigning weights to stations requiring replenishment while ignoring those that don't, reducing unnecessary calculations and time adjustments. This improves computational efficiency, reduces system overhead, and generates a more realistic dynamic drug replenishment distance matrix. This makes the replenishment route more intelligent and efficient. By analyzing whether a replenishment station is within the drug replenishment time data range for time weighting, the intelligent vehicle can prioritize shorter paths, reducing travel time and improving replenishment efficiency. This is crucial for pharmacy drug replenishment, ensuring timely replenishment of target drugs and improving pharmacy service quality.

[0052] Preferably, step S4 includes the following steps:

[0053] Step S41: Obtain the medicine supply control instruction;

[0054] Step S42: Based on the drug supply control instruction and by using the optimized intelligent vehicle supply route, drug supply data is generated for the target drug data.

[0055] Step S43: Use a homomorphic encryption algorithm to perform homomorphic encryption on the drug supply data to generate encrypted drug supply data;

[0056] Step S44: Perform real-time update processing on the drug supply data to generate real-time drug supply data;

[0057] Step S45: Based on the real-time drug supply data, perform real-time encryption update processing on the encrypted drug supply data to generate real-time encrypted drug supply data.

[0058] This invention enables pharmacies to acquire drug replenishment control instructions. These instructions may originate from doctors' prescriptions, patients' medication needs, or automated replenishment scheduling. By acquiring these instructions, pharmacies can accurately determine the types, quantities, and timing of medications requiring replenishment, thus preparing for subsequent replenishment processes. Based on these instructions, and utilizing an optimized intelligent vehicle replenishment route, the system replenishes the target medications. This allows the intelligent vehicle to quickly and accurately deliver the required medications to the designated location according to the optimized path planning, ensuring the efficiency and accuracy of the replenishment operation and improving the timeliness of medication supply. The drug replenishment data undergoes homomorphic encryption. This encryption method allows computational operations on the encrypted data without decryption, maintaining data security and privacy. Homomorphic encryption ensures the security of drug replenishment data during transmission and processing, preventing potential information leakage and tampering, and protecting patient medication privacy and data integrity. Real-time updates of drug supply data ensure its accuracy and timeliness. During drug supply, unpredictable circumstances can lead to data changes; timely updates help address these changes promptly, prevent errors, and safeguard patient medication safety and accuracy. By updating and processing encrypted drug supply data in real-time based on existing data, real-time encrypted drug supply data is generated. This process ensures the timeliness and confidentiality of the supply data, protecting its security during transmission and processing.

[0059] This specification provides an intelligent pharmacy control system, characterized in that it includes:

[0060] Drug data processing module: used to acquire initial pharmacy drug data from the database; to filter and process the initial dataset to generate target drug data;

[0061] Drug replenishment time calculation module: used to obtain drug application data from the database; to filter and predict drug application data based on target drug data, and generate predicted drug application data; to calculate drug replenishment time based on target drug data and predicted drug application data, and generate drug replenishment time data.

[0062] Supply route planning module: This module collects supply station data for target drugs based on target drug data, generates drug supply station data; establishes a drug supply distance matrix based on the drug supply station data, and dynamically assigns time weights to the matrix nodes using drug supply time data to generate a dynamic drug supply distance matrix; and performs dynamic route planning and optimization on the dynamic drug supply distance matrix to generate an optimized intelligent vehicle supply route.

[0063] Drug supply control module: used to acquire drug supply control instructions; according to the drug supply control instructions, and using the optimized intelligent vehicle supply route to supply drugs to the target drug data, generate drug supply data; perform homomorphic encryption and real-time update processing on the drug supply data to generate real-time encrypted drug supply data.

[0064] The beneficial effects of this application are as follows: By using data filtering, drug application prediction, and dynamic route planning optimization, the smart pharmacy can rationally plan replenishment routes based on advance prediction of drug demand, achieving rapid and timely drug supply. This helps avoid affecting user needs due to drug shortages or untimely replenishment, improving the efficiency and accuracy of drug supply. Through data collection and dynamic route planning optimization at drug replenishment stations, the smart pharmacy can more rationally lay out replenishment stations, reducing the travel distance of the smart carts, thereby reducing energy consumption and costs. Real-time updates of drug application prediction and replenishment data enable the pharmacy to accurately replenish according to actual medication needs, avoiding over-replenishment and inventory backlog, and reducing resource waste. By predicting patient medication needs and achieving timely replenishment, the smart pharmacy ensures that patients can obtain medications promptly when needed, avoiding long waits or shortages, improving patient convenience and satisfaction. Data encryption and real-time updates protect the privacy and security of drug replenishment data, increasing user trust and satisfaction. Smart pharmacies achieve refined management of the pharmaceutical supply chain through data filtering and optimized drug refill stations. Drug application prediction and dynamic route planning optimization enable pharmacies to flexibly adjust refill strategies and optimize resource allocation based on actual conditions. This helps reduce inventory management costs, improve drug utilization, and optimize pharmacy operational efficiency. By utilizing data analysis, predictive algorithms, and optimization technologies, an intelligent refill process is achieved. This allows pharmacies to better adapt to drug refill needs, optimize refill strategies, and improve refill timeliness and efficiency. Intelligent operational management enhances pharmacy service quality, providing users with a more convenient, efficient, and safe experience. Attached Figure Description

[0065] Figure 1 This is a flowchart illustrating the steps of an intelligent pharmacy control method according to the present invention;

[0066] Figure 2 for Figure 1 A detailed flowchart illustrating the implementation steps of step S2.

[0067] Figure 3 for Figure 2 A detailed flowchart illustrating the implementation steps of step S23.

[0068] Figure 4 for Figure 1 A detailed flowchart illustrating the implementation steps of step S3.

[0069] The realization of the objective, functional features and advantages of the present invention will be further explained in conjunction with the embodiments and with reference to the accompanying drawings. Detailed Implementation

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

[0071] Furthermore, the accompanying drawings are merely illustrative of the invention and are not necessarily drawn to scale. The same reference numerals in the drawings denote the same or similar parts, and therefore repeated descriptions of them will be omitted. Some block diagrams shown in the drawings are functional entities and do not necessarily correspond to physically or logically independent entities. These functional entities can be implemented in software, in one or more hardware modules or integrated circuits, or in different network and / or processor methods and / or microcontroller methods.

[0072] It should be understood that although the terms "first," "second," etc., may be used herein to describe various units, these units should not be limited by these terms. These terms are used merely to distinguish one unit from another. For example, without departing from the scope of the exemplary embodiments, a first unit may be referred to as a second unit, and similarly, a second unit may be referred to as a first unit. The term "and / or" as used herein includes any and all combinations of one or more of the associated listed items.

[0073] To achieve the above objectives, please refer to Figures 1 to 4 This invention provides an intelligent pharmacy control method, comprising the following steps:

[0074] Step S1: Obtain initial pharmacy drug data from the database; perform target drug data filtering on the initial dataset to generate target drug data;

[0075] Step S2: Obtain drug application data from the database; filter and predict drug application data based on target drug data to generate predicted drug application data; calculate drug replenishment time based on target drug data and predicted drug application data to generate drug replenishment time data.

[0076] Step S3: Collect data on the supply stations of the target drug based on the target drug data to generate drug supply station data; establish a drug supply distance matrix based on the drug supply station data, and use drug supply time data to dynamically weight the matrix nodes to generate a dynamic drug supply distance matrix; perform dynamic route planning and optimization on the dynamic drug supply distance matrix to generate an optimized intelligent vehicle supply route.

[0077] Step S4: Obtain the drug supply control command; according to the drug supply control command, and using the optimized intelligent vehicle supply route, supply the target drug data to generate drug supply data; perform homomorphic encryption and real-time update processing on the drug supply data to generate real-time encrypted drug supply data.

[0078] This invention provides a data foundation for subsequent steps by acquiring initial pharmacy drug data from a database. Target drug data filtering identifies the target drugs requiring replenishment from the initial data, avoiding the processing of unnecessary drug information and improving the efficiency and accuracy of subsequent steps. Filtering the initial pharmacy drug data ensures the system only processes relevant target drugs, thereby reducing the burden of data storage and processing. Acquiring drug application data from the database provides an understanding of actual drug usage, helping to formulate more accurate replenishment plans. Application data filtering and prediction of drug application data clarifies the application needs of target drugs, reducing processing time for useless data, reducing computing power, and lowering the load on hardware processing. Calculating drug replenishment time data allows the system to replenish at appropriate times, avoiding waste caused by replenishing too early or too late, or excessively long patient waiting times. It also better manages drug inventory, preventing drug expiration and shortages, and conserving drug resources. By collecting replenishment site data for target drugs, the system can build an accurate replenishment site database, ensuring the accuracy and timeliness of replenishment. The establishment and time-weighted dynamic drug supply distance matrix enable real-time adjustments to supply routes based on actual conditions, adapting to traffic conditions and drug demand at different times. This improves the flexibility and efficiency of supply routes. Dynamic route planning and optimization methods can adjust drug supply routes in real time based on factors such as time periods and traffic conditions, thereby reducing the operating time and cost of the intelligent vehicle and improving drug supply efficiency. Dynamic route planning and optimization help reduce the travel time and distance of the intelligent vehicle during the supply process, lowering supply costs and energy consumption. By acquiring drug supply control commands, the accuracy and standardization of the supply process are ensured, avoiding potential errors and vulnerabilities. Optimizing the application of intelligent vehicle supply routes makes the supply process more efficient, accurate, and controllable, reducing risks and uncertainties. The application of homomorphic encryption technology ensures the security and privacy of drug supply data, guaranteeing the protection of sensitive information during transmission and storage. Therefore, the intelligent pharmacy control method of the present invention still needs to automatically determine whether medicines need to be replenished by predicting the quantity of medicines used and the inventory information between medicines. Furthermore, it dynamically analyzes the sites that need to be replenished when medicines are replenished and optimizes the routes to make the replenishment time shorter and more accurate.

[0079] In this embodiment of the invention, reference is made to Figure 1 The above is a flowchart illustrating the steps of an intelligent pharmacy control method according to the present invention. In this embodiment, the intelligent pharmacy control method includes the following steps:

[0080] Step S1: Obtain initial pharmacy drug data from the database; perform target drug data filtering on the initial dataset to generate target drug data;

[0081] In this embodiment of the invention, it is assumed that the initial drug data of the smart pharmacy is stored in a database, containing information such as the name, inventory, and expiration date of various drugs. The initial pharmacy drug data is then acquired. By filtering the initial dataset, target drugs that need to be replenished are selected. For example, drugs A, B, and C are selected as target drugs. If the inventory of these drugs is below a certain threshold, replenishment is required, generating target drug data containing detailed information about the target drugs.

[0082] Step S2: Obtain drug application data from the database; filter and predict drug application data based on target drug data to generate predicted drug application data; calculate drug replenishment time based on target drug data and predicted drug application data to generate drug replenishment time data.

[0083] In this embodiment of the invention, drug application data is obtained from a database, recording the usage of various drugs over a past period. The drug application data is then filtered based on the generated target drug data to extract application data related to the target drug. A prediction algorithm, such as a Long Short-Term Memory (LSTM) network, is used to predict the application data of the target drug. The prediction results show that within the next week, the application volume of drug A is expected to increase by 10%, the application volume of drug B is expected to decrease by 5%, and the application volume of drug C is expected to remain unchanged. Based on the target drug data and the drug inventory consumption rate in the predicted drug application data, the drug replenishment time is calculated, generating drug replenishment time data.

[0084] Step S3: Collect data on the supply stations of the target drug based on the target drug data to generate drug supply station data; establish a drug supply distance matrix based on the drug supply station data, and use drug supply time data to dynamically weight the matrix nodes to generate a dynamic drug supply distance matrix; perform dynamic route planning and optimization on the dynamic drug supply distance matrix to generate an optimized intelligent vehicle supply route.

[0085] In this embodiment of the invention, based on the target drug data, the pharmacy begins collecting refill site data for the target drug. For example, for drugs A, B, and C, the pharmacy identifies three refill sites: site A, site B, and site C. Based on this site data, a drug refill distance matrix is ​​constructed, representing the distance between each site. Combining drug usage and refill time data, the nodes of the distance matrix are dynamically weighted over time to account for the operational status of the refill sites at different time periods. For example, if drugs A and C need to be refilled at a certain time, sites A and C are weighted, while site B is not weighted. The weighted sites are then connected to generate a dynamic drug refill distance matrix.

[0086] Step S4: Obtain the drug supply control command; according to the drug supply control command, and using the optimized intelligent vehicle supply route, supply the target drug data to generate drug supply data; perform homomorphic encryption and real-time update processing on the drug supply data to generate real-time encrypted drug supply data.

[0087] In this embodiment of the invention, the pharmacy receives a drug replenishment control command specifying the replenishment of a target drug. Following an optimized replenishment route, the intelligent vehicle departs to replenish the drug. For example, the optimized route instructs the intelligent vehicle to first replenish drug A at station A, and then proceed to station C to replenish drug C. Since station B is not authorized and drug B does not require replenishment, the vehicle only needs to replenish both drugs A and C via stations A and C. The intelligent vehicle replenishes drugs according to the command and the optimized route, recording information such as drug inventory and timestamps during the replenishment process to generate drug replenishment data. Homomorphic encryption is applied to the drug replenishment data to ensure data security, and the replenishment data is updated in real time, synchronizing the latest inventory and replenishment time to the database.

[0088] Preferably, step S1 includes the following steps:

[0089] Step S11: Obtain initial pharmacy drug data from the database;

[0090] Step S12: Perform data cleaning on the initial pharmacy drug data to generate cleaned drug data;

[0091] Step S13: Obtain drug expiration date data;

[0092] Step S14: Based on the drug expiration date data, perform effective drug data filtering on the cleaned drug data to generate effective drug data;

[0093] Step S15: Extract target drug data from the effective drug data based on the preset target drug data to generate target drug data.

[0094] This invention performs data cleaning on initial pharmacy drug data, removing duplicates, missing data, errors, and other invalid data to ensure the accuracy of drug data. This helps avoid drug information chaos and inventory management problems caused by incomplete or erroneous data, thereby improving the reliability and accuracy of pharmacy management. By acquiring drug expiration date data, the cleaned drug data is filtered to generate valid drug data. This filtering is beneficial for timely identification of expired or near-expiration drugs, preventing patients from purchasing or using expired drugs and ensuring the safety and efficacy of patient medication. Based on preset target drug data, the valid drug data is extracted and processed to generate target drug data. This extraction can be tailored to the needs of hospitals or pharmacies, selectively identifying drugs that require key management and supply, optimizing drug inventory structure, improving inventory turnover, reducing inventory backlog, and rationally planning drug replenishment strategies to avoid stockouts or surpluses, thereby improving the flexibility and responsiveness of drug supply.

[0095] In this embodiment of the invention, initial pharmacy drug data is obtained from a database containing information on various drugs, including drug name, production batch number, production date, inventory, sales volume, and supplier information. The initial pharmacy drug data undergoes data cleaning. This includes data deduplication, missing value handling, and outlier handling, such as removing duplicate drug records, filling in missing inventory information, and checking and correcting abnormal sales volumes. Through data cleaning, a clean and accurate set of cleaned drug data is obtained, providing a reliable data foundation for subsequent steps. Drug expiration date data is then obtained. This data typically consists of the drug's production date and expiration date. For example, if a drug's production date is January 1, 2023, and its expiration date is 2 years, then the expiration date data for that drug is January 1, 2025. Based on the drug expiration date data, the cleaned drug data undergoes a valid drug data screening process. This step aims to select drugs within their expiration date, avoid using expired drugs, and ensure medication safety and quality. For example, all drugs with at least 3 months remaining on their expiration date are screened and included as valid drug data, while other expired drug records are removed. Based on the preset target drug data, the effective drug data is processed by extracting target drug data. Target drug data refers to the drugs that the smart pharmacy needs to focus on and replenish at present. These may be drugs with low inventory or drugs with high demand. For example, if the target drugs are set as drug A and drug B, drug A and drug B with low inventory and high demand are selected as target drug data based on indicators such as inventory and demand.

[0096] Preferably, step S2 includes the following steps:

[0097] Step S21: Obtain drug application data from the database;

[0098] Step S22: Filter the drug application data based on the target drug data to generate target drug application data;

[0099] Step S23: Use the Long Short-Term Memory Network algorithm to perform drug application prediction processing on the target drug application data to generate predicted drug application data;

[0100] Step S24: Calculate the drug replenishment time using the drug replenishment time calculation formula for the target drug data and the predicted drug application data, and generate drug replenishment time data.

[0101] This invention filters drug application data based on target drug data, retaining only application data relevant to the target drug. This filtering reduces interference from irrelevant data, making the drug application data more accurate and focused on the target drug, thereby improving the quality of the drug application data. It utilizes a Long Short-Term Memory (LSTM) network algorithm to predict drug application data. This prediction, based on historical drug application data, captures patterns and trends in the time series, thus predicting the pharmacy's demand for the target drug in the future. By predicting drug application, pharmacies can prepare drug replenishment in advance, avoiding disruptions to patient treatment plans due to insufficient drug supply. Finally, it uses a drug replenishment time calculation formula to calculate the drug replenishment time based on the target drug data and predicted drug application data. This calculation helps determine the optimal replenishment time, ensuring that drug replenishment matches the pharmacy's demand, avoiding replenishment too early or too late, and optimizing drug supply chain management.

[0102] As an example of the present invention, reference is made to Figure 2 As shown, Figure 1 A detailed flowchart illustrating the implementation steps of step S2 is provided. In this example, step S2 includes:

[0103] Step S21: Obtain drug application data from the database;

[0104] In this embodiment of the invention, drug application data is obtained from a database. This data includes the usage of various drugs over a period of time, including information such as the frequency and duration of pharmacy use for each drug. This data is recorded and stored in real time by the intelligent pharmacy system and can reflect the actual application of drugs.

[0105] Step S22: Filter the drug application data based on the target drug data to generate target drug application data;

[0106] In this embodiment of the invention, the drug application data is filtered based on the target drug data. Based on the target drug data, records related to the target drug are extracted from the drug application data. For example, if the target drugs are drug A and drug B, then all medication records related to drug A and drug B are filtered from the drug application data. These records constitute the target drug application data.

[0107] Step S23: Use the Long Short-Term Memory Network algorithm to perform drug application prediction processing on the target drug application data to generate predicted drug application data;

[0108] In this embodiment of the invention, the Long Short-Term Memory (LSTM) network algorithm is used to perform drug application prediction processing on the target drug application data. LSTM is a deep learning algorithm that can process sequence data and has good performance in drug application prediction. By inputting the historical application data of the target drug, LSTM can learn the time series pattern of drug application and make application predictions for a period of time in the future. For example, the LSTM algorithm predicts that the dosage of drug A will be 1,000 pills and the dosage of drug B will be 500 pills in the next week.

[0109] Step S24: Calculate the drug replenishment time using the drug replenishment time calculation formula for the target drug data and the predicted drug application data, and generate drug replenishment time data.

[0110] In this embodiment of the invention, the drug replenishment time calculation formula is used to calculate the drug replenishment time for target drug data and predicted drug application data. The drug replenishment time calculation formula comprehensively considers multiple factors such as drug inventory, predicted drug application data, and drug expiration date to determine the optimal replenishment time. For example, by combining information such as target drug inventory and predicted drug usage in the next week, the replenishment time for drug A and drug B is calculated to be the third day.

[0111] Preferably, step S23 includes the following steps:

[0112] Step S231: Collect historical target drug application data from the target drug application data to generate historical drug application data;

[0113] Step S232: Use the Long Short-Term Memory Network algorithm to establish a mapping relationship for the prediction of target drug application data and generate an initial drug application prediction model;

[0114] Step S233: Use historical drug application data to perform model prediction processing on the initial drug application prediction model to generate a drug application prediction model;

[0115] Step S234: Optimize the model parameters of the drug application prediction model using the drug application prediction model optimization formula to generate an optimized drug application prediction model;

[0116] Step S235: Transmit the target drug application data to the optimized drug application prediction model for drug application prediction processing to generate predicted drug application data.

[0117] This invention collects historical data on the application of target drugs, which helps to establish a time series of drug application data, capture historical patterns and trends in drug use, and improve the accuracy and generalization ability of the prediction model by collecting historical data. A Long Short-Term Memory (LSTM) network algorithm is used to establish a mapping relationship for the prediction of target drug application data, generating an initial drug application prediction model. LSTM is a deep learning model suitable for predicting sequence data, capable of capturing long-term dependencies in sequence data, and has good performance in predicting drug application data. The initial drug application prediction model is processed using historical drug application data to generate a new drug application prediction model. The model's parameters are then optimized using the drug application prediction model optimization formula to generate an optimized drug application prediction model. This optimization process helps improve the performance of the prediction model, making the prediction results more accurate and reliable. After parameter optimization, the model has a certain degree of adaptability and flexibility, and can adaptively adjust according to different time periods and pharmacy demand periods, making it suitable for different prediction needs and better able to cope with drug demand prediction in different scenarios. By establishing the optimized drug application prediction model, the target drug application data is transmitted to the model for prediction processing, generating predicted drug application data. This forecasting process can more accurately predict drug demand over a future period, helping pharmacies better plan their drug replenishment strategies and improve the accuracy and efficiency of drug supply.

[0118] As an example of the present invention, reference is made to Figure 3 As shown, Figure 2 A detailed flowchart illustrating the implementation steps of step S23 is provided in this example. Step S23 includes:

[0119] Step S231: Collect historical target drug application data from the target drug application data to generate historical drug application data;

[0120] In this embodiment of the invention, historical data collection is performed on the application data of the target drug. Assuming the target drug is drug X, the historical data collection process will collect the application information of drug X over a period of time, including daily dosage, medication time, medication frequency, etc. By collecting a large amount of historical data, a historical application dataset of drug X is established.

[0121] Step S232: Use the Long Short-Term Memory Network algorithm to establish a mapping relationship for the prediction of target drug application data and generate an initial drug application prediction model;

[0122] In this embodiment of the invention, a mapping relationship for predicting target drug application data is established using the Long Short-Term Memory (LSTM) network algorithm. The LSTM model can capture the dynamic changes and periodic patterns of drug application volume, thereby establishing a predictive mapping relationship for drug application data.

[0123] Step S233: Use historical drug application data to perform model prediction processing on the initial drug application prediction model to generate a drug application prediction model;

[0124] In this embodiment of the invention, historical drug application data is used to perform model prediction processing on the initial drug application prediction model. The established LSTM model is trained and predicted using historical datasets. Through training, the initial drug application prediction model can make relatively accurate predictions on historical drug application data, thus obtaining the drug application prediction model.

[0125] Step S234: Optimize the model parameters of the drug application prediction model using the drug application prediction model optimization formula to generate an optimized drug application prediction model;

[0126] In this embodiment of the invention, the model parameters of the drug application prediction model are optimized using the drug application prediction model optimization formula. Considering the accuracy and stability of drug application prediction, the parameters of the drug application prediction model are adjusted and optimized through the optimization formula. The goal of the optimization is to minimize the prediction error of the model, thereby obtaining a more accurate and reliable optimized drug application prediction model.

[0127] Step S235: Transmit the target drug application data to the optimized drug application prediction model for drug application prediction processing to generate predicted drug application data.

[0128] In this embodiment of the invention, the target drug application data is transmitted to an optimized drug application prediction model for drug application prediction processing. In this step, the current target drug application data of the smart pharmacy is input into the optimized drug application prediction model to predict drug application over a future period. The prediction results will include information such as the dosage and administration time of the target drug, which will be used for subsequent drug replenishment time calculation and drug replenishment control.

[0129] Preferably, the optimization formula for the drug application prediction model in step S234 is as follows:

[0130] ;

[0131] In the formula, This is represented by the minimum loss function optimization exponent of the drug application prediction model. Indicates the type of medicine. This represents the initial adjustment value of the model's minimum loss function. This is represented as a model adjustment correction term. Represented as the first Historical application data for this type of drug Represented as the first The historical rate of change in the number of applications of a certain type of drug Represented as according to the Weighting information for the price generation of various drug categories. It is represented as the outlier adjustment value of the minimum loss function optimization exponent.

[0132] This invention utilizes a drug application prediction model optimization formula, which fully considers the types of drugs. The initial adjustment value of the model's minimum loss function Model adjustment and correction items , No. Historical application data of various types of drugs , No. Historical application change rate of various drug types According to the first Weighting information for the price generation of various drug types And the interaction relationships between functions, to form functional relationships:

[0133] Right now, By considering multiple drug types, the model can more comprehensively predict the application volume. Furthermore, by setting independent historical data and weight information for each drug type, the model can more flexibly adapt to the application trends of different drugs, helping pharmacies better meet the medication needs of different drugs and improve the accuracy and targeting of drug replenishment. The initial adjustment value of the minimum loss function is the starting point of the optimization process. By adjusting the value of 'a', the shape and optimization direction of the loss function can be initially adjusted. The model adjustment correction term is used to fine-tune the model to adapt to the characteristics of actual data. By adjusting the value of the model adjustment correction term, the model's predictions can be fine-tuned to make them closer to reality. Historical usage data for each drug type is used to better train the model, enabling it to predict future drug usage based on past usage trends; The historical rate of change in the number of applications for each drug type reflects the trend of growth or decline in the number of applications. Considering the historical rate of change in the number of applications allows the model to more flexibly predict the number of applications in the future; according to the... The weighting information generated by the price of different drug types is based on the principle that higher-priced drugs have lower weights, indicating lower demand for higher-priced drugs. This approach more accurately reflects the application trends of drugs at different price points. Through parameter calculations, historical application volume data and application volume change rates can be more accurately fitted. This optimization makes drug application prediction more precise, reduces prediction errors, and provides smart pharmacies with more reliable drug demand forecasts. The outlier adjustment value of the index is optimized using a minimum loss function. The functional relationship is adjusted and corrected to reduce the impact of errors caused by outliers or error terms, thereby generating the minimum loss function optimization exponent for the drug application prediction model more accurately. This improves the accuracy and reliability of optimizing model parameters for drug application prediction models. Furthermore, the weight information and adjustment values ​​in this formula can be adjusted according to actual conditions to adapt to different parameters in drug application prediction models, thus enhancing the algorithm's flexibility and applicability.

[0134] Preferably, the formula for calculating the drug replenishment time in step S24 is as follows: ;

[0135] In the formula, This represents data on drug replenishment time. This represents the drug inventory for the target drug. This represents the predicted consumption rate based on predicted drug use data. This is expressed as the rate of change in the predicted consumption rate based on predicted drug use data. This indicates the validity period of the target drug data. This is represented as the weight information of the target drug data. This represents the demand for data related to the target drug. This represents an abnormal adjustment value for drug replenishment time data.

[0136] This invention utilizes the drug inventory of a target drug data. Predicted consumption rate of drug use data The rate of change in the predicted consumption rate of predicted drug use data. Validity period of target drug data Weighting information of target drug data The demand for target drug data And the interaction relationships between functions, to form functional relationships:

[0137] Right now, By comprehensively considering both the drug inventory and demand data of the target drug, the formula can more comprehensively assess the demand for the target drug. The predicted consumption rate represents the speed of drug use over a future period, while the demand represents the pharmacy's overall demand for the drug. The drug replenishment time calculation more accurately reflects the urgency and timing of drug replenishment. By using the demand and weight information of the target drug data, the formula balances the drug inventory and expiration date of the target drug data. If the inventory is high but the expiration date is short, more urgent replenishment may be needed to avoid drug waste due to expiration. Conversely, if the inventory is low but the expiration date is long, replenishment time can be arranged more flexibly. This balancing consideration allows pharmacies to rationally plan replenishment time, optimize inventory management, and reduce losses from expired drugs. By considering the rate of change of the predicted consumption rate based on the predicted drug application data, the formula takes into account that the predicted consumption rate may change. This rate of change allows for more flexible replenishment time arrangements. If the predicted consumption rate changes, it may mean that the demand for drugs is increasing or decreasing. The formula can be adjusted according to this trend, improving the adaptability of the replenishment plan. By optimizing refill time calculations, smart pharmacies can better meet their refill needs, improving the accuracy and efficiency of refill plans. This is achieved by utilizing anomaly adjustments to drug refill time data. The functional relationship is adjusted and corrected to reduce the impact of errors caused by outliers or error terms, thereby generating more accurate drug replenishment time data. This improves the accuracy and reliability of calculating drug replenishment time based on target drug data and predicted drug application data. Furthermore, the weighting information and adjustment values ​​in the formula can be adjusted according to actual conditions, allowing it to be applied to different target drug data and predicted drug application data, thus enhancing the algorithm's flexibility and applicability.

[0138] Preferably, step S3 includes the following steps:

[0139] Step S31: Collect data from the target drug supply stations based on the target drug data, and generate drug supply station data;

[0140] Step S32: Establish a distance matrix for drug supply based on drug supply station data, and generate a drug supply distance matrix;

[0141] Step S33: Use the drug supply time data to dynamically assign time weights to the matrix nodes of the drug supply distance matrix to generate a dynamic drug supply distance matrix;

[0142] Step S34: Perform dynamic route planning on the dynamic medicine supply distance matrix to generate an initial intelligent vehicle supply route;

[0143] Step S35: Obtain obstacle point data for the supply route;

[0144] Step S36: Adjust the initial intelligent vehicle supply route based on the obstacle point data of the supply route to generate an intelligent vehicle supply route;

[0145] Step S37: Optimize the intelligent vehicle resupply route using the shortest path algorithm to generate an optimized intelligent vehicle resupply route.

[0146] This invention collects resupply station data based on target drug data to determine suitable locations for resupply stations within or around pharmacies. This data collection helps optimize the layout of resupply stations, making drug resupply more distributed and efficient. By rationally setting up resupply stations, the transportation path of the intelligent vehicle can be shortened, resupply time reduced, and thus the efficiency of drug resupply improved. A drug resupply distance matrix is ​​established based on the resupply station data. This matrix records the distance information between each resupply station, including straight-line distance and actual travel distance. By establishing the distance matrix, the distance relationships between different resupply stations can be quantified, providing basic data for subsequent route planning. By dynamically weighting the supply distance matrix using drug replenishment time data, with weighting states of 0 and 1, the traffic conditions encountered by the intelligent vehicle will vary at different times during route planning. For example, if some target drugs do not yet need replenishment, the station where the target drug is located will not be weighted, and the weighting state will be 0. If the target drug needs replenishment, the station where the target drug is located will be weighted, and the weighting state will be 1. This route adjustment under different conditions improves the transportation efficiency and timely replenishment of the intelligent vehicle. By dynamically planning the drug replenishment distance matrix, an initial intelligent vehicle replenishment route is generated. Dynamic route planning considers factors such as replenishment stations and distances, and can formulate a replenishment route suitable for the current situation. This avoids unnecessary waiting, detours, or congestion for the intelligent vehicle, thereby improving the efficiency and accuracy of drug replenishment. Based on obstacle point data along the supply route, the initial supply route of the intelligent vehicle is adjusted. Obstacle point data can include real-time collected traffic information and densely populated areas. By considering these obstacles, the supply route is adjusted to avoid congestion and ensure the intelligent vehicle reaches its destination smoothly. The shortest path algorithm is used to optimize the intelligent vehicle's supply route. This algorithm finds the shortest path connecting the starting point and the target point, reducing travel distance and time. Through shortest path optimization, the intelligent vehicle can complete the medicine supply task faster and more efficiently, improving supply efficiency while reducing energy consumption and costs.

[0147] As an example of the present invention, reference is made to Figure 4 As shown, Figure 2 A detailed flowchart illustrating the implementation steps of step S3 is provided in this example. Step S3 includes:

[0148] Step S31: Collect data from the target drug supply stations based on the target drug data, and generate drug supply station data;

[0149] In this embodiment of the invention, the replenishment station data of the target drug is collected based on the target drug data. Assuming that there are drugs A, B and C in the smart pharmacy that are target drugs and need to be replenished, during the replenishment station data collection process, the station coordinates of the corresponding drugs are collected to generate drug replenishment station data.

[0150] Step S32: Establish a distance matrix for drug supply based on drug supply station data, and generate a drug supply distance matrix;

[0151] In this embodiment of the invention, a distance matrix for drug supply is established based on drug supply station data. The smart pharmacy calculates the distance between each drug supply station according to the coordinate location information of the supply stations, and forms a distance matrix from these distances. For example, the distance between supply station A and supply station B is 10 kilometers, and the distance between supply station A and supply station C is 15 kilometers. This distance information constitutes the drug supply distance matrix.

[0152] Step S33: Use the drug supply time data to dynamically assign time weights to the matrix nodes of the drug supply distance matrix to generate a dynamic drug supply distance matrix;

[0153] In this embodiment of the invention, drug replenishment time data is used to dynamically weight the nodes of the drug replenishment distance matrix. The smart pharmacy converts the time information into the weight value of the node according to the predicted replenishment time, which is used to dynamically weight the distance matrix. For example, according to the current time, drug A needs to be replenished, while drug B does not need to be replenished for the time being. Therefore, the weight of station A corresponding to drug A is assigned to 1, and the weight of station B corresponding to drug B is assigned to 0. The stations with a weight of 1 are connected to construct a dynamic drug replenishment distance matrix.

[0154] Step S34: Perform dynamic route planning on the dynamic medicine supply distance matrix to generate an initial intelligent vehicle supply route;

[0155] In this embodiment of the invention, dynamic route planning is performed on the dynamic drug supply distance matrix to generate an initial intelligent vehicle supply route. Weighted station coordinates are connected, and the stations are assigned a distribution order based on their distance from the intelligent vehicle's departure position to generate the initial intelligent vehicle supply route.

[0156] Step S35: Obtain obstacle point data for the supply route;

[0157] In this embodiment of the invention, the obstacle point data refers to information such as obstacles that may exist on the supply route, densely populated areas of pharmacies, etc. For example, there may be tables or densely populated areas on the route. This obstacle point data is a factor to be considered when adjusting and optimizing the supply route in subsequent steps.

[0158] Step S36: Adjust the initial intelligent vehicle supply route based on the obstacle point data of the supply route to generate an intelligent vehicle supply route;

[0159] In this embodiment of the invention, the initial supply route of the intelligent vehicle is adjusted based on the obstacle point data of the supply route. The intelligent pharmacy adjusts the initial supply route according to the acquired obstacle point data to avoid possible obstacles and ensure the smooth progress of the supply process. For example, if an obstacle point with a closed road is found on the initial route, the route is adjusted to bypass this area and another road is selected to go to the supply station, ensuring the completion of the supply task and generating the intelligent vehicle supply route.

[0160] Step S37: Optimize the intelligent vehicle resupply route using the shortest path algorithm to generate an optimized intelligent vehicle resupply route.

[0161] In this embodiment of the invention, the shortest path algorithm is used to optimize the supply route of the intelligent vehicle. The adjusted supply route is then optimized again using the shortest path algorithm to ensure that the final supply route is the shortest. For example, by applying the shortest path algorithm, the intelligent pharmacy further optimizes the supply route, making the travel distance of the supply vehicle the shortest, thereby saving time and costs.

[0162] Preferably, step S33 includes the following steps:

[0163] When the drug supply station data in the drug supply distance matrix is ​​already within the drug supply time data, the matrix nodes of the drug supply distance matrix are assigned time weights; when the drug supply station data in the drug supply distance matrix is ​​not within the drug supply time data, the matrix nodes of the drug supply distance matrix are not assigned time weights, thereby generating a dynamic drug supply distance matrix.

[0164] This invention dynamically weights the drug replenishment distance matrix over time. Nodes in the distance matrix are weighted according to drug replenishment time data. This weighting method allows the intelligent vehicle to flexibly adjust its replenishment route at different times. Dynamic time weighting considers different time periods, assigning weights to stations requiring replenishment while ignoring those that don't, reducing unnecessary calculations and time adjustments. This improves computational efficiency, reduces system overhead, and generates a more realistic dynamic drug replenishment distance matrix. This makes the replenishment route more intelligent and efficient. By analyzing whether a replenishment station is within the drug replenishment time data range for time weighting, the intelligent vehicle can prioritize shorter paths, reducing travel time and improving replenishment efficiency. This is crucial for pharmacy drug replenishment, ensuring timely replenishment of target drugs and improving pharmacy service quality.

[0165] In this embodiment of the invention, for the supply station data of drug A, assuming the predicted supply time is the third day and the current time is the fourth day, since the supply time for drug A has arrived, the stations in the corresponding dynamic distance matrix of drug A are weighted, and the node weight of station A is 1. For the supply station data of drug B, assuming the predicted supply time is the fifth day and the current time is the fourth day, since the supply time for drug B has not arrived, the stations in the corresponding dynamic distance matrix of drug B are not weighted, and the node weight of station B is 0. By connecting the stations with a weight of 1, this dynamic time weighting mechanism can avoid stations corresponding to drugs that do not yet need to be supplied when planning the supply route, thereby saving a lot of time.

[0166] Preferably, step S4 includes the following steps:

[0167] Step S41: Obtain the medicine supply control instruction;

[0168] Step S42: Based on the drug supply control instruction and by using the optimized intelligent vehicle supply route, drug supply data is generated for the target drug data.

[0169] Step S43: Use a homomorphic encryption algorithm to perform homomorphic encryption on the drug supply data to generate encrypted drug supply data;

[0170] Step S44: Perform real-time update processing on the drug supply data to generate real-time drug supply data;

[0171] Step S45: Based on the real-time drug supply data, perform real-time encryption update processing on the encrypted drug supply data to generate real-time encrypted drug supply data.

[0172] This invention enables pharmacies to acquire drug replenishment control instructions. These instructions may originate from doctors' prescriptions, patients' medication needs, or automated replenishment scheduling. By acquiring these instructions, pharmacies can accurately determine the types, quantities, and timing of medications requiring replenishment, thus preparing for subsequent replenishment processes. Based on these instructions, and utilizing an optimized intelligent vehicle replenishment route, the system replenishes the target medications. This allows the intelligent vehicle to quickly and accurately deliver the required medications to the designated location according to the optimized path planning, ensuring the efficiency and accuracy of the replenishment operation and improving the timeliness of medication supply. The drug replenishment data undergoes homomorphic encryption. This encryption method allows computational operations on the encrypted data without decryption, maintaining data security and privacy. Homomorphic encryption ensures the security of drug replenishment data during transmission and processing, preventing potential information leakage and tampering, and protecting patient medication privacy and data integrity. Real-time updates of drug supply data ensure its accuracy and timeliness. During drug supply, unpredictable circumstances can lead to data changes; timely updates help address these changes promptly, prevent errors, and safeguard patient medication safety and accuracy. By updating and processing encrypted drug supply data in real-time based on existing data, real-time encrypted drug supply data is generated. This process ensures the timeliness and confidentiality of the supply data, protecting its security during transmission and processing.

[0173] In this embodiment of the invention, a drug replenishment control command is obtained. For example, a hospital system issues a replenishment control command to the smart pharmacy, instructing the smart pharmacy which drugs need to be replenished. Based on the drug replenishment control command and combined with an optimized smart cart replenishment route, the target drug data is replenished. After receiving the command, the smart cart replenishes drugs at stations along the route. According to the optimized smart cart replenishment route, the smart cart delivers drugs to each target station sequentially along the shortest path. After completing the drug replenishment, the drug replenishment data is homomorphically encrypted. Homomorphic encryption is an encryption technology that allows computation without decryption, ensuring data privacy and security during data transmission. The replenishment data is updated in real time. Once drug replenishment is complete, the smart pharmacy updates the replenishment data in the database in real time for reference and adjustment in the next replenishment task. For example, the smart pharmacy records information such as the type and quantity of replenished drugs and the replenishment time, and updates this data to the database in a timely manner for more accurate replenishment planning and decision-making in the future. The encrypted supply data is updated in real time based on real-time drug supply data. To further enhance data security, the smart pharmacy uses real-time supply data to update the homomorphically encrypted supply data, ensuring that the supply data remains encrypted throughout the transmission and storage process, preventing unauthorized access and tampering.

[0174] This specification provides an intelligent pharmacy control system, characterized in that it includes:

[0175] Drug data processing module: used to acquire initial pharmacy drug data from the database; to filter and process the initial dataset to generate target drug data;

[0176] Drug replenishment time calculation module: used to obtain drug application data from the database; to filter and predict drug application data based on target drug data, and generate predicted drug application data; to calculate drug replenishment time based on target drug data and predicted drug application data, and generate drug replenishment time data.

[0177] Supply route planning module: This module collects supply station data for target drugs based on target drug data, generates drug supply station data; establishes a drug supply distance matrix based on the drug supply station data, and dynamically assigns time weights to the matrix nodes using drug supply time data to generate a dynamic drug supply distance matrix; and performs dynamic route planning and optimization on the dynamic drug supply distance matrix to generate an optimized intelligent vehicle supply route.

[0178] Drug supply control module: used to acquire drug supply control instructions; according to the drug supply control instructions, and using the optimized intelligent vehicle supply route to supply drugs to the target drug data, generate drug supply data; perform homomorphic encryption and real-time update processing on the drug supply data to generate real-time encrypted drug supply data.

[0179] The beneficial effects of this application are as follows: By using data filtering, drug application prediction, and dynamic route planning optimization, the smart pharmacy can rationally plan replenishment routes based on advance prediction of drug demand, achieving rapid and timely drug supply. This helps avoid affecting user needs due to drug shortages or untimely replenishment, improving the efficiency and accuracy of drug supply. Through data collection and dynamic route planning optimization at drug replenishment stations, the smart pharmacy can more rationally lay out replenishment stations, reducing the travel distance of the smart carts, thereby reducing energy consumption and costs. Real-time updates of drug application prediction and replenishment data enable the pharmacy to accurately replenish according to actual medication needs, avoiding over-replenishment and inventory backlog, and reducing resource waste. By predicting patient medication needs and achieving timely replenishment, the smart pharmacy ensures that patients can obtain medications promptly when needed, avoiding long waits or shortages, improving patient convenience and satisfaction. Data encryption and real-time updates protect the privacy and security of drug replenishment data, increasing user trust and satisfaction. Smart pharmacies achieve refined management of the pharmaceutical supply chain through data filtering and optimized drug refill stations. Drug application prediction and dynamic route planning optimization enable pharmacies to flexibly adjust refill strategies and optimize resource allocation based on actual conditions. This helps reduce inventory management costs, improve drug utilization, and optimize pharmacy operational efficiency. By utilizing data analysis, predictive algorithms, and optimization technologies, an intelligent refill process is achieved. This allows pharmacies to better adapt to drug refill needs, optimize refill strategies, and improve refill timeliness and efficiency. Intelligent operational management enhances pharmacy service quality, providing users with a more convenient, efficient, and safe experience.

[0180] Therefore, the embodiments should be considered as exemplary and non-limiting in all respects, and the scope of the invention is defined by the appended claims rather than the foregoing description. Thus, all variations falling within the meaning and scope of the equivalents of the application are intended to be included within the invention.

[0181] The above description is merely a specific embodiment of the present invention, enabling those skilled in the art to understand or implement the invention. Various modifications to these embodiments will be readily apparent to those skilled in the art, and the general principles defined herein may be implemented in other embodiments without departing from the spirit or scope of the invention. Therefore, the present invention is not to be limited to the embodiments shown herein, but is to be accorded the widest scope consistent with the principles and novel features of the invention herein.

Claims

1. A smart pharmacy control method, characterized in that, Includes the following steps: Step S1: Obtain initial pharmacy drug data from the database; perform target drug data filtering on the initial dataset to generate target drug data; Step S2: Obtain drug application data from the database; filter and predict drug application data based on target drug data to generate predicted drug application data; calculate drug replenishment time based on target drug data and predicted drug application data to generate drug replenishment time data. Step S3: Collect data from the target drug supply stations based on the target drug data, and generate drug supply station data; A distance matrix for drug supply is established based on drug supply station data, and dynamic time weighting of matrix nodes is performed using drug supply time data to generate a dynamic drug supply distance matrix. Dynamic route planning and optimization are performed on the dynamic drug supply distance matrix to generate optimized intelligent vehicle supply routes; Step S3 includes the following steps: Step S31: Collect data from the target drug supply stations based on the target drug data, and generate drug supply station data; Step S32: Establish a distance matrix for drug supply based on drug supply station data, and generate a drug supply distance matrix; Step S33: Use the drug supply time data to dynamically assign time weights to the matrix nodes of the drug supply distance matrix to generate a dynamic drug supply distance matrix; Step S33 includes the following steps: When the data of the drug supply stations in the drug supply distance matrix is ​​already in the drug supply time data, the time weighting of the matrix nodes is applied to the drug supply distance matrix; when the data of the drug supply stations in the drug supply distance matrix is ​​not in the drug supply time data, the time weighting of the matrix nodes is not applied to the drug supply distance matrix, thereby generating a dynamic drug supply distance matrix. Step S34: Perform dynamic route planning on the dynamic medicine supply distance matrix to generate an initial intelligent vehicle supply route; Step S35: Obtain obstacle point data for the supply route; Step S36: Adjust the initial intelligent vehicle supply route based on the obstacle point data of the supply route to generate an intelligent vehicle supply route; Step S37: Optimize the intelligent vehicle resupply route using the shortest path algorithm to generate an optimized intelligent vehicle resupply route; Step S4: Obtain the drug supply control command; according to the drug supply control command, and using the optimized intelligent vehicle supply route, supply the target drug data to generate drug supply data; perform homomorphic encryption and real-time update processing on the drug supply data to generate real-time encrypted drug supply data.

2. The intelligent pharmacy control method according to claim 1, characterized in that, Step S1 includes the following steps: Step S11: Obtain initial pharmacy drug data from the database; Step S12: Perform data cleaning on the initial pharmacy drug data to generate cleaned drug data; Step S13: Obtain drug expiration date data; Step S14: Based on the drug expiration date data, perform effective drug data filtering on the cleaned drug data to generate effective drug data; Step S15: Extract target drug data from the effective drug data based on the preset target drug data to generate target drug data.

3. The intelligent pharmacy control method according to claim 2, characterized in that, Step S2 includes the following steps: Step S21: Obtain drug application data from the database; Step S22: Filter the drug application data based on the target drug data to generate target drug application data; Step S23: Use the Long Short-Term Memory Network algorithm to perform drug application prediction processing on the target drug application data to generate predicted drug application data; Step S24: Calculate the drug replenishment time using the drug replenishment time calculation formula for the target drug data and the predicted drug application data, and generate drug replenishment time data.

4. The intelligent pharmacy control method according to claim 3, characterized in that, Step S23 includes the following steps: Step S231: Collect historical target drug application data from the target drug application data to generate historical drug application data; Step S232: Use the Long Short-Term Memory Network algorithm to establish a mapping relationship for the prediction of target drug application data and generate an initial drug application prediction model; Step S233: Use historical drug application data to perform model prediction processing on the initial drug application prediction model to generate a drug application prediction model; Step S234: Optimize the model parameters of the drug application prediction model using the drug application prediction model optimization formula to generate an optimized drug application prediction model; Step S235: Transmit the target drug application data to the optimized drug application prediction model for drug application prediction processing to generate predicted drug application data.

5. The intelligent pharmacy control method according to claim 4, characterized in that, The optimization formula for the drug application prediction model in step S234 is shown below: ; In the formula, This is represented by the minimum loss function optimization exponent of the drug application prediction model. Indicates the type of medicine. This represents the initial adjustment value of the model's minimum loss function. This is represented as a model adjustment correction term. Represented as the first Historical application data for this type of drug Represented as the first The historical rate of change in the number of applications of a certain type of drug Represented as according to the Weighting information for the price generation of various drug categories. It is represented as the outlier adjustment value of the minimum loss function optimization exponent.

6. The intelligent pharmacy control method according to claim 5, characterized in that, The formula for calculating the drug replenishment time in step S24 is as follows: ; In the formula, This represents data on drug replenishment time. This represents the drug inventory for the target drug. This represents the predicted consumption rate based on predicted drug use data. This is expressed as the rate of change in the predicted consumption rate based on predicted drug use data. This indicates the validity period of the target drug data. This is represented as the weight information of the target drug data. This represents the demand for data related to the target drug. This represents an abnormal adjustment value for drug replenishment time data.

7. The intelligent pharmacy control method according to claim 6, characterized in that, Step S4 includes the following steps: Step S41: Obtain the medicine supply control instruction; Step S42: Based on the drug supply control instruction and by using the optimized intelligent vehicle supply route, drug supply data is generated for the target drug data. Step S43: Use a homomorphic encryption algorithm to perform homomorphic encryption on the drug supply data to generate encrypted drug supply data; Step S44: Perform real-time update processing on the drug supply data to generate real-time drug supply data; Step S45: Based on the real-time drug supply data, perform real-time encryption update processing on the encrypted drug supply data to generate real-time encrypted drug supply data.

8. An intelligent pharmacy control system, used to implement the intelligent pharmacy control method as described in claim 1, characterized in that, include: Drug data processing module: used to obtain initial pharmacy drug data from the database; The initial dataset is processed to filter target drug data, generating target drug data. Drug replenishment time calculation module: used to obtain drug application data from the database; to filter and predict drug application data based on target drug data, and generate predicted drug application data; to calculate drug replenishment time based on target drug data and predicted drug application data, and generate drug replenishment time data. Supply route planning module: Used to collect supply station data for target drugs based on target drug data, and generate drug supply station data; A distance matrix for drug supply is established based on drug supply station data, and dynamic time weighting of matrix nodes is performed using drug supply time data to generate a dynamic drug supply distance matrix. Dynamic route planning and optimization are performed on the dynamic drug supply distance matrix to generate optimized intelligent vehicle supply routes; Drug supply control module: used to acquire drug supply control instructions; according to the drug supply control instructions, and using the optimized intelligent vehicle supply route to supply drugs to the target drug data, generate drug supply data; perform homomorphic encryption and real-time update processing on the drug supply data to generate real-time encrypted drug supply data.

Citation Information

Patent Citations

  • Intelligent pharmacy

    CN109285593A

  • Hospital medicine purchase plan prediction method and system based on LSTM

    CN113888090A