A pharmacy intelligent production and operation system
By establishing a data governance platform in the hospital pharmacy, the coding of Western medicine, traditional Chinese medicine and equipment is unified. Combined with equipment health monitoring and early warning, a comprehensive procurement plan is generated to optimize equipment maintenance and logistics scheduling. This solves the problem of data silos between pharmacy systems and realizes equipment health-driven collaborative scheduling and logistics optimization.
Patent Information
- Application Number
- CN202611637371.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2026-10-22
- Publication Date
- 2026-11-17
AI Technical Summary
The independent information platforms and logistics channels of the hospital pharmacy's Western medicine pharmacy and traditional Chinese medicine pharmacy result in the dispersion of drug master data, equipment status data, and prescription execution data, making it impossible to effectively share and coordinate decision-making. This leads to the superposition of risks of equipment failure and drug shortages.
By using a data governance platform, unified logical identification is achieved for Western medicine codes, Chinese herbal medicine codes, and equipment consumable codes. Combined with dynamic equipment monitoring and fault early warning, procurement decision support, digital twin preventive scheduling, and collaborative scheduling engines, a unified data asset is built to generate comprehensive procurement plans and optimize equipment maintenance and logistics scheduling.
It achieves unified data across pharmacy systems, coordinated prevention and control of equipment health status and procurement scheduling, reduces the risk of equipment failure and drug shortages, and improves operational efficiency.
Smart Images

Figure CN123120240A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of pharmacy operation and management technology, specifically to an intelligent pharmacy production and operation system. Background Technology
[0002] Hospital pharmacies are typically divided into two independent operating units: a Western medicine pharmacy and a traditional Chinese medicine pharmacy. The former is responsible for dispensing Western medicine, while the latter is responsible for decocting traditional Chinese medicine. Each system has its own independent information platform, logistics channels, and scheduling strategies. This "siloed" construction model results in drug master data, equipment status data, and prescription execution data being scattered across different systems. Inconsistent coding rules and data definitions create fundamental data barriers to cross-system information sharing and collaborative decision-making. For example, when a critical decoction machine experiences a potential malfunction, the information regarding its limited capacity cannot be detected in real time by the procurement system and used to adjust the inventory strategy for related drugs, leading to a compounded risk of equipment failure and drug shortages. Although technologies such as digital twins and edge computing have been gradually applied to predictive maintenance and production scheduling of industrial equipment, in the unique scenario of pharmacies involving the collaboration of multiple systems and product categories, how to break down data barriers between systems and effectively link equipment health status with operational decisions such as procurement and scheduling remains a challenge that current technological solutions have not adequately addressed. Summary of the Invention
[0003] In view of the above problems, the present invention provides a pharmacy intelligent production and operation system, which breaks down the information barriers between multiple systems through a unified data platform, links the health status of equipment to procurement and scheduling decisions in real time, and realizes collaborative prevention and control of equipment failure and material shortage.
[0004] To achieve the above objectives, this application provides a pharmacy intelligent production and operation system, including a data governance platform, an equipment dynamic monitoring and fault early warning subsystem, a procurement auxiliary decision-making subsystem, a digital twin preventive scheduling module, a collaborative scheduling engine, and a shared logistics network. The data governance platform interfaces with the Western medicine supply subsystem, the traditional Chinese medicine decoction subsystem, and the hospital information system. The data governance platform has a built-in drug master data mapping engine that associates Western medicine codes, traditional Chinese medicine decoction piece codes, and equipment consumable codes with a unified logical identifier, generating unified data assets. The equipment dynamic monitoring and fault early warning subsystem collects data through vibration, temperature, and current sensors, extracts spectrum and temperature rise characteristics through edge computing, inputs them into a long short-term memory network model, outputs an equipment health index, and generates a maintenance warning when the index is lower than the maintenance threshold. Information; The procurement support decision-making subsystem acquires unified data assets and generates a comprehensive procurement plan. This subsystem is built upon a large language model and a multi-agent architecture, including inventory agents, equipment agents, supplier agents, and seasonal epidemic agents. The digital twin preventative scheduling module constructs a pharmacy digital twin in virtual space based on equipment health index and remaining service life prediction. Combined with predicted prescription task volume, it uses a time-space optimization algorithm to plan equipment maintenance windows and production task scheduling. The collaborative scheduling engine connects to the execution equipment of each subsystem. The shared logistics network consists of a first mobile robot cluster and a second mobile robot cluster. The collaborative scheduling engine dynamically allocates robots to perform tasks such as transporting Western medicine or handling traditional Chinese medicine decoction containers based on prescription urgency and real-time equipment load.
[0005] Furthermore, the equipment dynamic monitoring and fault early warning subsystem collects data through vibration, temperature, and current sensors, extracts spectral and temperature rise characteristics through edge computing, inputs this data into a long short-term memory network model, outputs an equipment health index, and generates maintenance early warning information when the index falls below a maintenance threshold, including:
[0006] Vibration sensors collect time-domain vibration waveforms of key components of each device at a preset sampling frequency; temperature sensors collect time-series data of motor and bearing surface temperatures; and current sensors collect three-phase current waveforms of the drive motor. The time-domain vibration waveforms, time-series data of motor and bearing surface temperatures, and three-phase current waveforms of the drive motor are transmitted via industrial Ethernet to edge computing nodes deployed on the device itself.
[0007] Edge computing nodes perform fast Fourier transform on the time-domain vibration waveform to convert the time-domain signal to the frequency domain and generate a frequency-domain energy distribution vector. The ratio of energy proportion in the normal operating frequency band and the fault characteristic frequency band is extracted from the frequency-domain energy distribution vector as the vibration spectrum feature. The energy proportion ratio characterizes the degree of mechanical degradation of the rotating and transmission components of the equipment.
[0008] Edge computing nodes perform differential operations on temperature time-series data to calculate the rate of temperature change per unit time, generating a temperature rise rate feature. The temperature rise rate feature characterizes the real-time changing trend of the equipment's thermal load status and the efficiency of the heat dissipation system.
[0009] Edge computing nodes perform harmonic analysis on the three-phase current waveform, extract the fundamental amplitude and the amplitude of each harmonic through Fourier series decomposition, calculate the total harmonic distortion rate and the proportion of specific harmonics, and generate current harmonic distortion rate characteristics. The current harmonic distortion rate characteristics characterize the degree of degradation of the motor winding insulation state and the balance of the drive load.
[0010] Vibration spectrum features, temperature rise rate features, and current harmonic distortion rate features are concatenated into a multidimensional feature vector. The multidimensional feature vector carries degradation information in three dimensions: mechanical state, thermal state, and electrical state. This vector is then input into the long short-term memory network model.
[0011] The Long Short-Term Memory Network model is based on historical health degradation patterns and current multidimensional feature vectors. It learns the weight contribution of each dimension feature at different degradation stages through a gating mechanism and outputs the health index of each device in the next preset period. The health index represents the current operating status and potential degradation degree of the device in a percentage system.
[0012] The health index is compared with a preset maintenance threshold. When the health index is lower than the preset maintenance threshold, the equipment dynamic monitoring and fault early warning subsystem generates maintenance early warning information. The maintenance early warning information includes equipment identification, current health index, fault mode classification and suggested maintenance time window.
[0013] Furthermore, the Long Short-Term Memory (LSTM) network model, based on historical health degradation patterns and current multi-dimensional feature vectors, learns the weight contributions of each dimension's features at different degradation stages through a gating mechanism, outputting the health index of each device in the next preset period, including:
[0014] The long short-term memory network model receives a multi-dimensional feature vector composed of vibration spectrum features, temperature rise rate features and current harmonic distortion rate features. The multi-dimensional feature vector forms a time series input with a preset time step.
[0015] The forget gate inside the Long Short-Term Memory network model calculates the forget gate activation value based on the multidimensional feature vector of the current time step and the hidden state of the previous time step. The forget gate activation value determines which degradation information in the cell state of the previous time step needs to be retained. Among them, the mechanical degradation information corresponding to the vibration spectrum feature is retained at a higher proportion than the electrical degradation information corresponding to the current harmonic distortion rate feature in the early stage of equipment operation. The electrical degradation information corresponding to the current harmonic distortion rate feature is retained at a gradually increasing proportion in the later stage of equipment operation.
[0016] The input gate inside the Long Short-Term Memory Network model calculates the input gate activation value and candidate cell state based on the multidimensional feature vector of the current time step and the hidden state of the previous time step. The input gate activation value determines which degradation information in the multidimensional feature vector of the current time step needs to be written into the cell state. The candidate cell state includes the mechanical state degradation increment, thermal state degradation increment and electrical state degradation increment extracted in the current time step.
[0017] The Long Short-Term Memory Network model weights and sums the cell state of the previous time step after the forget gate and the candidate cell state after the input gate to generate the updated cell state of the current time step. While updating the cell state, it accumulates the historical degradation trajectory and current degradation increment of the three dimensions of mechanical state, thermal state and electrical state.
[0018] The output gate inside the Long Short-Term Memory network model calculates the output gate activation value based on the multidimensional feature vector of the current time step and the updated cell state. The output gate activation value determines which degenerate information in the updated cell state needs to be output to the hidden state of the current time step.
[0019] The Long Short-Term Memory network model updates the cell state, compresses it using a nonlinear activation function, and then multiplies it element-wise with the output gate activation value to generate the hidden state at the current time step. The hidden state carries the three-dimensional degradation features fused at the current time step.
[0020] The Long Short-Term Memory (LSTM) network model inputs the hidden state of the last time step into the fully connected layer. The fully connected layer maps the hidden state into a percentage value through linear transformation and nonlinear activation function, and outputs the health index of each device in the next preset period.
[0021] Furthermore, the procurement decision support subsystem acquires unified data assets. This subsystem is built upon a large language model and a multi-agent architecture, including inventory agents, equipment agents, supplier agents, and seasonal epidemic agents, to generate a comprehensive procurement plan, including:
[0022] The inventory intelligence agent obtains the real-time inventory level and historical consumption rate of each drug from the data governance platform, calculates the number of days the current inventory can last based on the preset safety stock model, and generates an inventory status vector. The inventory status vector includes the inventory level, consumption trend and stockout risk level of each drug.
[0023] The equipment intelligence agent obtains the health index and remaining service life prediction of each piece of equipment from the data governance platform. Based on the list of equipment with a health index below the maintenance threshold, it extracts the drug processing list associated with each piece of equipment and generates the equipment capacity constraint vector. The equipment capacity constraint vector includes the expected reduction in production quantity and reduction time window of each associated drug due to potential equipment failure.
[0024] The supplier intelligence agent obtains the delivery cycle, historical on-time performance rate and current inventory availability of each drug supplier from the data governance platform, and generates a supplier capability vector. The supplier capability vector includes the reliability score and emergency order response capability of each supplier.
[0025] The seasonal epidemic intelligence agent obtains hospital outpatient volume trends and regional epidemiological monitoring data from the data governance platform. It identifies seasonal drug demand fluctuations within a preset period through a time series analysis model and generates an epidemic impact vector. The epidemic impact vector includes the expected change in demand for each drug due to the epidemic trend.
[0026] The inventory status vector, equipment capacity constraint vector, supplier capability vector, and epidemic impact vector are input into a multi-agent negotiation framework based on a large language model. The multi-agent negotiation framework is based on a preset negotiation round. In each round of negotiation, each agent proposes replenishment needs and constraints based on its own vector information. The large language model performs semantic understanding and conflict resolution on the needs and constraints of each agent, and generates a compromise solution acceptable to each agent.
[0027] A comprehensive procurement plan is generated based on the compromise solution. The comprehensive procurement plan includes the replenishment quantity of each drug, the emergency procurement indicator, the recommended supplier list and the expected delivery time window. The emergency procurement indicator is determined jointly based on the production reduction time window in the equipment capacity constraint vector and the demand change magnitude in the epidemic impact vector.
[0028] Furthermore, the inventory status vector, equipment capacity constraint vector, supplier capability vector, and epidemic impact vector are input into a multi-agent negotiation framework based on a large language model. The multi-agent negotiation framework operates on a preset negotiation round cycle. In each round, each agent proposes replenishment needs and constraints based on its own vector information. The large language model performs semantic understanding and conflict resolution on the needs and constraints of each agent, generating a compromise solution acceptable to all agents, including:
[0029] The multi-agent negotiation framework initiates the first round of negotiation. The inventory agent generates the first round of replenishment request proposals based on the list of drugs with a stockout risk level higher than a preset threshold in the inventory state vector. The first round of replenishment request proposals includes the expected replenishment quantity and expected arrival time for each drug.
[0030] The equipment agent receives the first round of replenishment request proposals and generates the first round of capacity constraint feedback based on the production reduction time window and production reduction quantity in the equipment capacity constraint vector. The first round of capacity constraint feedback includes the upper limit of the replenishment quantity that cannot be met due to potential equipment failure and the suggested adjustment of the delivery time window.
[0031] The supplier agent receives the first round of replenishment request proposals and the first round of capacity constraint feedback. Based on the reliability score and emergency order response capability of each supplier in the supplier capability vector, it generates the first round of supply capability feedback, which includes the maximum replenishment quantity and the shortest delivery cycle that each supplier can provide.
[0032] The seasonal epidemic agent receives the first round of replenishment demand proposals and generates the first round of demand adjustment suggestions based on the expected change in demand in the epidemic impact vector. The first round of demand adjustment suggestions includes the replenishment quantity that needs to be increased due to the epidemic trend and a list of medicines that are recommended to be replenished first.
[0033] The large language model receives the first round of replenishment demand proposals, the first round of capacity constraint feedback, the first round of supply capacity feedback, and the first round of demand adjustment suggestions. It performs semantic understanding of the needs and constraints of each agent and identifies the conflict points between the agents. The conflict points include quantity conflicts between the expected replenishment quantity of the inventory agent and the upper limit of the replenishment quantity in the equipment capacity constraint feedback, and time conflicts between the expected delivery time of the inventory agent and the shortest delivery cycle in the supplier capacity feedback.
[0034] The large language model prioritizes each conflict point and generates a first-round compromise solution. The first-round compromise solution includes the adjusted replenishment quantity of each drug, the adjusted delivery time window, and the recommended supplier. The first-round compromise solution is then fed back to each agent.
[0035] Each agent receives the first round of compromise solutions and judges whether the compromise solution is acceptable based on its own vector information. When the inventory agent judges that the adjusted replenishment quantity in the compromise solution is lower than the minimum safety stock corresponding to the stockout risk level, the inventory agent generates a second round of replenishment demand proposal. The second round of replenishment demand proposal includes a list of drugs that need to be further increased in replenishment quantity and the increase amount.
[0036] The multi-agent negotiation framework repeats the above negotiation process with a preset number of negotiation rounds as the upper limit, until all agents accept the current compromise solution or the preset number of negotiation rounds is reached. The compromise solution generated in the last round is taken as the final compromise solution that is acceptable to all agents and is output.
[0037] Furthermore, the operating system also includes:
[0038] When the device agent detects that the health index is lower than the maintenance threshold, it sends a capacity constraint signal to the procurement auxiliary decision-making subsystem. The capacity constraint signal carries the device identifier and the associated drug type.
[0039] The inventory agent calculates the types and quantities of production cuts based on capacity constraint signals, increases the safety stock threshold and increases preventative replenishment, and then adjusts the safety stock threshold back down once the health status recovers.
[0040] Furthermore, the inventory agent calculates the types and quantities of production reductions based on capacity constraint signals, raises the safety stock threshold, and increases preventative replenishment. Once the health status recovers, the safety stock threshold is adjusted back, including:
[0041] The inventory agent receives a capacity constraint signal, which includes equipment identification, associated drug type, expected failure time window and failure mode classification. The inventory agent obtains all prescription records processed by the equipment corresponding to the equipment identification in the historical preset period from the data governance platform, and extracts the average daily consumption and consumption rate fluctuation variance of each associated drug from the prescription records.
[0042] The inventory agent calculates the number of days of equipment downtime based on the start and end times of the expected failure time window and the duration of maintenance required. It then multiplies the average daily consumption of each related drug by the number of days of equipment downtime to generate the basic reduction quantity of each related drug.
[0043] The inventory agent categorizes failure modes, queries the consumption rate fluctuation compensation coefficient corresponding to the failure mode from the preset failure impact coefficient table, multiplies the basic production reduction quantity with the consumption rate fluctuation compensation coefficient, and generates the preventive replenishment quantity for each related drug.
[0044] The inventory agent obtains the current safety stock threshold of each related drug from the data governance platform, adds the current safety stock threshold to the preventive replenishment quantity, generates the adjusted safety stock threshold, and writes the adjusted safety stock threshold into the inventory parameter table of the data governance platform.
[0045] The inventory agent generates a preventative replenishment quantity based on the difference between the adjusted safety stock threshold and the current inventory level. The preventative replenishment quantity is equal to the difference between the adjusted safety stock threshold and the current inventory level. When the difference is positive, the procurement auxiliary decision-making subsystem is triggered to add the preventative replenishment quantity to the comprehensive procurement plan.
[0046] The inventory agent continuously monitors the health index corresponding to the device identifier output by the device dynamic monitoring and fault early warning subsystem. When the health index rises above the preset recovery threshold and remains stable for a preset duration, the inventory agent determines that the device health has recovered.
[0047] After determining that the health of the equipment has recovered, the inventory agent obtains the original safety stock threshold of the associated drug from the data governance platform, restores the adjusted safety stock threshold to the original safety stock threshold, and writes the callback safety stock threshold into the inventory parameter table of the data governance platform. At the same time, it sends a safety stock callback signal to the procurement auxiliary decision-making subsystem. The procurement auxiliary decision-making subsystem reassesses whether it is necessary to reduce the replenishment quantity in the subsequent procurement plan based on the callback safety stock threshold.
[0048] Furthermore, the digital twin preventative scheduling module constructs a pharmacy digital twin in virtual space based on equipment health index and remaining service life prediction. Combined with predicted prescription volume, it uses a time-space optimization algorithm to plan equipment maintenance windows and production task scheduling, including:
[0049] The digital twin preventive scheduling module obtains the health index and remaining service life prediction of each piece of equipment from the equipment dynamic monitoring and fault early warning subsystem, extracts the distribution pattern of prescription volume in each time period from historical prescription data, and generates the predicted amount of prescription tasks in the future preset period through the time series prediction model. The predicted amount of prescription tasks includes the predicted values of Western medicine prescription volume and traditional Chinese medicine prescription volume in each time period.
[0050] The digital twin preventive scheduling module constructs a digital twin of the pharmacy in virtual space. The digital twin includes a three-dimensional geometric model and a physical behavior model of an automated three-dimensional warehouse for Western medicine, an intelligent dispensing station, a traditional Chinese medicine decoction unit, a logistics channel, and a mobile robot. The digital twin keeps its movement synchronized with the real equipment through real-time data streams.
[0051] The digital twin preventive scheduling module identifies candidate devices whose health index will fall below the maintenance threshold within a preset prediction period based on the remaining service life prediction, and generates a candidate device list. The candidate device list includes the device identifier of each candidate device, the expected time to reach the maintenance threshold, and the maintenance duration.
[0052] The digital twin preventive scheduling module inputs the candidate equipment list and the predicted prescription task volume into the time-space optimization algorithm. The time-space optimization algorithm takes minimizing the time overlap between the maintenance window and the peak prescription period as the first optimization objective and minimizing the space occupation of the logistics channel by the maintenance path as the second optimization objective. Monte Carlo simulation is performed in the digital twin to evaluate the feasibility of multiple candidate maintenance windows and output the optimal maintenance plan. The optimal maintenance plan includes the start and end times of the maintenance window for each candidate equipment, the maintenance path planning, and the production task migration plan during the maintenance period. The production task migration plan specifies that the production tasks involving the maintenance equipment will be transferred to the standby equipment or adjusted to other time periods outside the maintenance window.
[0053] The digital twin preventive scheduling module issues the optimal maintenance plan to the collaborative scheduling engine in the form of task instructions and maps the execution status in real time in the digital twin. When deviation occurs during execution, the plan is dynamically adjusted.
[0054] Furthermore, the digital twin preventative scheduling module inputs the candidate equipment list and the predicted prescription task volume into a time-space optimization algorithm. The time-space optimization algorithm takes minimizing the time overlap between the maintenance window and peak prescription periods as its first optimization objective, and minimizing the space occupation of the logistics channel by the maintenance path as its second optimization objective. Monte Carlo simulations are performed within the digital twin to evaluate the feasibility of multiple candidate maintenance windows and output the optimal maintenance plan, including:
[0055] The time-space optimization algorithm extracts the expected time when each candidate device will reach the maintenance threshold and the maintenance duration from the candidate device list, extracts the prescription volume prediction value for each time period from the prescription task prediction volume, and marks the time period when the prescription volume prediction value is higher than the preset peak threshold as the prescription peak period.
[0056] The time-space optimization algorithm takes the expected time when each candidate device reaches the maintenance threshold as the center, and expands a preset time range forward and backward to generate multiple candidate maintenance windows. Each candidate maintenance window includes the maintenance start time and the maintenance end time.
[0057] The time-space optimization algorithm calculates the time intersection length between each candidate maintenance window and all prescription peak periods, and uses the time intersection length as the evaluation value of the first optimization objective. The smaller the time intersection length, the smaller the time overlap between the maintenance window and the prescription peak period.
[0058] The time-space optimization algorithm plans a maintenance path from the maintenance start point to the maintenance end point for each candidate maintenance window based on the three-dimensional geometric model of each candidate device in the digital twin and the topology of the logistics channel. The maintenance path consists of a series of logistics channel node coordinates.
[0059] The time-space optimization algorithm calculates the number of logistics channel nodes occupied by each maintenance path and the occupation time. The product of the number of occupied nodes and the occupation time is used as the evaluation value of the second optimization objective. The smaller the product, the smaller the space occupation of the logistics channel by the maintenance path.
[0060] The time-space optimization algorithm weights and sums the evaluation values of the first optimization objective and the second optimization objective to generate a comprehensive evaluation value for each candidate maintenance window, where the weight of the first optimization objective is higher than the weight of the second optimization objective.
[0061] The time-space optimization algorithm performs Monte Carlo simulations on a preset number of candidate maintenance windows with the highest comprehensive evaluation values in the digital twin. The Monte Carlo simulation is capped at a preset number of simulations. In each simulation, the predicted amount of prescription tasks and the maintenance time are randomly perturbed. The actual time overlap between the maintenance window and the peak prescription period and the actual space occupation of the maintenance path on the logistics channel are recorded in each simulation.
[0062] The time-space optimization algorithm calculates the mean and variance of time overlap and space occupancy in the Monte Carlo simulation results, selects the candidate maintenance window with the smallest mean and the lowest variance as the optimal maintenance window, and outputs the maintenance path plan corresponding to the optimal maintenance window, which is the final optimal maintenance scheme.
[0063] Furthermore, the shared logistics network consists of a first mobile robot cluster and a second mobile robot cluster. A collaborative scheduling engine dynamically allocates robots to perform tasks such as transporting Western medicine or moving traditional Chinese medicine decoction containers based on the urgency of prescriptions and the real-time load rate of equipment.
[0064] The collaborative scheduling engine obtains the urgency level tags of each prescription from the data governance platform. The urgency level tags are calculated based on the time difference between the prescription generation time and the patient's expected medication pickup time. At the same time, it obtains the real-time load rate of each workstation in the Western medicine intelligent supply subsystem and the traditional Chinese medicine decoction subsystem. The real-time load rate is calculated based on the ratio of the number of currently queued tasks to the processing capacity of each workstation.
[0065] The collaborative scheduling engine obtains the current position coordinates and idle status indicators of each robot from the first mobile robot cluster and the second mobile robot cluster. The idle status indicator indicates whether the robot is in standby state, executing a task state or charging state.
[0066] The collaborative scheduling engine inputs prescription urgency labels, real-time workstation load rates, and robot idle status indicators into the task allocation algorithm. The task allocation algorithm aims to minimize the weighted waiting time of all prescriptions. The weighting is dynamically adjusted based on the urgency labels. The algorithm outputs a task allocation scheme for each robot, which includes the starting workstation, ending workstation, task type, and estimated execution time for each robot's next task.
[0067] The task allocation algorithm determines whether a task is a Western medicine transportation task or a traditional Chinese medicine decoction barrel handling task based on the task type and drug form characteristics parameters. When the number of Western medicine prescriptions is low, resulting in idle robots in the first mobile robot cluster, the task allocation algorithm will allocate the idle robots to the traditional Chinese medicine decoction side to perform the traditional Chinese medicine decoction barrel handling task. When the number of prescriptions on the traditional Chinese medicine decoction side is low, resulting in idle robots in the second mobile robot cluster, the task allocation algorithm will allocate the idle robots to the Western medicine side to perform the Western medicine transportation task.
[0068] The collaborative scheduling engine issues task allocation plans to each robot in the form of path planning instructions. Each robot executes tasks according to the planned path in the shared logistics network. The ground logistics loop and vertical lifting mechanism in the shared logistics network are shared by the first mobile robot cluster and the second mobile robot cluster. The collaborative scheduling engine dynamically adjusts the path planning according to the real-time position of each robot to avoid congestion in the logistics channel.
[0069] Unlike existing technologies, the above-mentioned technical solution provides a pharmacy intelligent production and operation system. Through a data governance platform, it links Western medicine codes, traditional Chinese medicine decoction piece codes, and equipment consumable codes to a unified logical identifier, generating unified data assets. An equipment dynamic monitoring and fault early warning subsystem outputs equipment health indices and generates maintenance warnings based on sensor data and a long short-term memory network. A procurement auxiliary decision-making subsystem generates comprehensive procurement plans based on a large language model and a multi-agent architecture using the unified data assets. A digital twin preventative scheduling module plans maintenance windows and task scheduling by combining health indices and prescription task predictions. A collaborative scheduling engine dynamically allocates robots to perform transfer tasks through a shared logistics network. This invention achieves unified cross-system data and equipment health-driven collaborative scheduling within the pharmacy.
[0070] The above description of the invention is merely an overview of the technical solution of this application. In order to enable those skilled in the art to better understand the technical solution of this application and to implement it based on the description and drawings, and to make the above-mentioned objectives and other objectives, features and advantages of this application easier to understand, the following description is provided in conjunction with the specific embodiments and drawings of this application. Attached Figure Description
[0071] The accompanying drawings are only used to illustrate the principles, implementation methods, applications, features, and effects of specific embodiments of the present invention and other related contents, and should not be considered as limitations on this application.
[0072] In the accompanying drawings of the instruction manual:
[0073] Figure 1 This is a schematic diagram of the structure of the pharmacy intelligent production and operation system described in a specific implementation method;
[0074] Figure 2 This is a schematic diagram illustrating steps S101 to S107 as described in the specific implementation method;
[0075] Figure 3 This is a schematic diagram illustrating steps S201 to S206 as described in the specific implementation method;
[0076] Figure 4 This is a schematic diagram illustrating steps S301 to S308 as described in the specific implementation method;
[0077] Figure 5 The following is a schematic diagram illustrating steps S401 to S407 as described in the specific implementation method.
[0078] The reference numerals used in the above figures are explained as follows:
[0079] 1. Pharmacy Intelligent Production and Operation System; 11. Data Governance Platform; 12. Equipment Dynamic Monitoring and Fault Early Warning Subsystem; 13. Procurement Auxiliary Decision Subsystem; 14. Digital Twin Preventive Scheduling Module; 15. Collaborative Scheduling Engine; 16. Shared Logistics Network. Detailed Implementation
[0080] To illustrate the possible application scenarios, technical principles, implementable specific solutions, and achievable objectives and effects of this application in detail, the following description, in conjunction with the listed specific embodiments and accompanying drawings, provides a detailed explanation. The embodiments described herein are merely illustrative of the technical solutions of this application and are therefore intended to limit the scope of protection of this application.
[0081] In this document, the term "embodiment" means that a specific feature, structure, or characteristic described in connection with an embodiment may be included in at least one embodiment of this application. The term "embodiment" appearing in various places throughout the specification does not necessarily refer to the same embodiment, nor does it specifically limit its independence or connection with other embodiments. In principle, in this application, as long as there are no technical contradictions or conflicts, the technical features mentioned in each embodiment can be combined in any way to form corresponding implementable technical solutions.
[0082] Unless otherwise defined, the technical terms used herein have the same meaning as commonly understood by one of ordinary skill in the art to which this application pertains; the use of related terms herein is merely for the purpose of describing particular embodiments and is not intended to limit this application.
[0083] In the description of this application, the term "and / or" is used to describe the logical relationship between objects, indicating that three relationships can exist. For example, A and / or B means: A exists, B exists, and A and B exist simultaneously. Additionally, the character " / " in this document generally indicates that the preceding and following objects have an "or" logical relationship.
[0084] In this application, terms such as “first” and “second” are used only to distinguish one entity or operation from another, and do not necessarily require or imply any actual quantity, hierarchy or order relationship between these entities or operations.
[0085] Without further limitations, the use of terms such as “comprising,” “including,” “having,” or other similar open-ended expressions in this application is intended to cover non-exclusive inclusion, which does not exclude the presence of additional elements in a process, method, or product that includes the stated elements, such that a process, method, or product that includes a list of elements may include not only those defined elements but also other elements not expressly listed, or elements inherent to such a process, method, or product.
[0086] The processor described in the embodiments of this application can be implemented by hardware, firmware, software, or a combination thereof. It can be a circuit, one or more of an application-specific integrated circuit (ASIC), a digital signal processor (DSP), a digital signal processing device (DSPD), a programmable logic device (PLD), a field-programmable gate array (FPGA), a central processing unit (CPU), a controller, a microcontroller, or a microprocessor. It also includes other physical, biological, or chemical structures that can implement the same or equivalent functions as the processors listed above, such as biological neurons, quantum computing units, DNA computing units, etc., so that the processor can execute some or all of the steps in the computer program or method involved in the various embodiments of this application, or any combination of the steps mentioned therein.
[0087] The computer program involved in the embodiments can be stored in a computer device readable storage medium, which includes, but is not limited to, disks, magnetic tapes, magnetic cards, floppy disks, flash memory, optical disks, optical cards, read-only memory (ROM), random access memory (RAM), erasable programmable ROM (EPROM), and electrically erasable programmable ROM (EEPROM), etc., and also includes other biological, physical, or chemical structures that can achieve the same or equivalent functions as the storage media listed above, such as DNA, RNA, proteins, and other units with information storage capabilities. In specific embodiments, the storage medium involved can be one of the above-mentioned media types, or a combination of the above-mentioned media types. In different embodiments, the computer program involved in the embodiments can be centrally stored in a single medium, or distributed and stored in multiple media. The memory containing the computer device readable storage medium can be non-volatile memory or random access memory. These computer device readable storage media can be built into the device, or can be connected to the device involved in the embodiments as an external device or part of an external device. In some embodiments, the memory having a computer device readable storage medium is deployed locally; in other embodiments, the memory may be deployed remotely from the processor, for example, as a network-attached memory accessed via RF circuitry or an external port and a communication network, wherein the communication network may be the Internet, one or more intranets, a local area network (LAN), a wide area network (WLAN), a storage area network (SAN), or a suitable combination thereof, as long as computer device access to the memory is enabled. Furthermore, the computer program involved in the embodiments may be stored in plaintext / ciphertext form, or it may be designed as training data, integrated and recombined through model training and implicitly stored in the parameter states of a deep neural network or other machine learning model.
[0088] Please see Figure 1This embodiment provides a pharmacy intelligent production and operation system 1, including a data governance platform 11, an equipment dynamic monitoring and fault early warning subsystem 12, a procurement auxiliary decision-making subsystem 13, a digital twin preventive scheduling module 14, a collaborative scheduling engine 15, and a shared logistics network 16. The data governance platform 11 interfaces with the Western medicine supply subsystem, the traditional Chinese medicine decoction subsystem, and the hospital information system. The data governance platform 11 has a built-in drug master data mapping engine, which associates Western medicine codes, traditional Chinese medicine decoction piece codes, and equipment consumable codes with a unified logical identifier to generate unified data assets. The equipment dynamic monitoring and fault early warning subsystem 12 collects data through vibration, temperature, and current sensors, extracts spectrum and temperature rise features through edge computing, inputs them into a long short-term memory network model, outputs an equipment health index, and generates a maintenance warning when the index is lower than the maintenance threshold. Information; the procurement auxiliary decision-making subsystem 13 acquires unified data assets and generates a comprehensive procurement plan. The procurement auxiliary decision-making subsystem 13 is built based on a large language model and a multi-agent architecture, including an inventory agent, an equipment agent, a supplier agent, and a seasonal epidemic agent; the digital twin preventive scheduling module 14 constructs a pharmacy digital twin in virtual space based on equipment health index and remaining service life prediction, and plans equipment maintenance windows and production task scheduling through time-space optimization algorithms, combined with prescription task prediction volume; the collaborative scheduling engine 15 connects to the execution equipment of each subsystem; the shared logistics network 16 consists of a first mobile robot cluster and a second mobile robot cluster. The collaborative scheduling engine 15 dynamically allocates robots to perform tasks such as transporting Western medicine or handling Chinese medicine decoction barrels according to the urgency of prescriptions and the real-time load rate of equipment.
[0089] In this embodiment, the data governance platform 11 interfaces with the Western medicine supply subsystem, the traditional Chinese medicine decoction subsystem, and the hospital information system via a database interface. The platform's built-in drug master data mapping engine uses a preset mapping rule table to associate Western medicine codes, traditional Chinese medicine decoction piece codes, and equipment consumable codes with a unified logical identifier. This unified logical identifier is composed of the drug's generic name, dosage form, and standardized unit of measurement. The mapped and cleaned data is written into a unified data asset, which is stored using a hybrid relational database and time-series database. Cross-dimensional relational queries are achieved through the unified logical identifier and timestamp.
[0090] Vibration, temperature, and current sensors deployed on key components of each device collect raw signals in real time. These signals are transmitted via industrial Ethernet to edge computing nodes deployed on the device itself for local preprocessing. Spectral features are extracted from the vibration signals to characterize the wear level of mechanical components; temperature rise rate features are extracted from the temperature signals to characterize thermal load changes; and current harmonic distortion rate features are extracted from the current signals to characterize electrical condition degradation. These multidimensional feature vectors are input into a long short-term memory network model. Based on historical degradation patterns and current features, the model outputs a health index for each device in the next preset period. When the health index falls below a preset maintenance threshold, the subsystem generates a maintenance warning. The maintenance threshold is set based on the equipment manufacturer's recommended value or historical fault data statistics.
[0091] In the procurement support decision-making subsystem 13, the inventory agent obtains the real-time inventory level and consumption rate of each medicine from the data assets; the equipment agent obtains the health index and remaining service life prediction of each piece of equipment; the supplier agent obtains the delivery cycle and historical performance data of each supplier; and the seasonal epidemic agent obtains the trend of hospital outpatient volume and regional epidemiological monitoring data. The agents engage in iterative dialogue through a negotiation mechanism based on a large language model. This large language model, acting as a semantic understanding and conflict resolution engine, fuses multi-dimensional information to generate a comprehensive procurement plan.
[0092] The pharmacy's digital twin maintains synchronization with the real equipment through real-time data streaming. The digital twin's preventative scheduling module 14 combines the predicted prescription tasks generated from historical prescription data through time-series analysis, and uses a time-space optimization algorithm to plan equipment maintenance windows and production task scheduling.
[0093] The collaborative scheduling engine 15 interfaces with the execution devices of each subsystem through a unified protocol stack. The first and second mobile robot clusters of the shared logistics network 16 share a ground logistics loop and a vertical lifting mechanism on the physical channel. The collaborative scheduling engine 15 dynamically allocates robots to perform tasks such as transporting Western medicine or moving traditional Chinese medicine decoction containers based on the urgency tags of each prescription and the real-time load rate of each workstation. The prescription urgency is calculated based on the time difference between the prescription generation time and the patient's expected medication pickup time, and the real-time load rate is calculated based on the ratio of the number of currently queued tasks to the processing capacity of each workstation.
[0094] This embodiment establishes a unified data foundation through a data governance platform 11, eliminating information barriers between Western medicine supply, traditional Chinese medicine decoction, and equipment monitoring; the equipment dynamic monitoring and fault early warning subsystem 12 perceives the health status of equipment in real time; the procurement auxiliary decision-making subsystem 13 integrates multi-dimensional information into a comprehensive procurement plan; the digital twin preventive scheduling module 14 collaboratively optimizes maintenance and production scheduling in virtual space; and the collaborative scheduling engine 15 uniformly schedules robot clusters through a shared logistics network 16. The collaborative work of these modules achieves unified cross-system data and intelligent scheduling driven by equipment health within the pharmacy.
[0095] Please see Figure 2 In some embodiments, the equipment dynamic monitoring and fault early warning subsystem collects data through vibration, temperature, and current sensors, extracts spectral and temperature rise features through edge computing, inputs the data into a long short-term memory network model, outputs an equipment health index, and generates maintenance early warning information when the index is lower than a maintenance threshold, including:
[0096] S101. The vibration sensor collects the time-domain vibration waveform of key components of each device at a preset sampling frequency. The temperature sensor collects the time-series data of the surface temperature of the motor and bearing. The current sensor collects the three-phase current waveform of the drive motor. The time-domain vibration waveform, the time-series data of the surface temperature of the motor and bearing, and the three-phase current waveform of the drive motor are transmitted to the edge computing node deployed on the device body via industrial Ethernet.
[0097] S102. The edge computing node performs a fast Fourier transform on the time-domain vibration waveform, converts the time-domain signal to the frequency domain, generates a frequency-domain energy distribution vector, and extracts the ratio of energy proportion in the normal operating frequency band and the fault characteristic frequency band from the frequency-domain energy distribution vector as the vibration spectrum feature. The energy proportion ratio characterizes the degree of mechanical degradation of the rotating parts and transmission parts of the equipment.
[0098] S103. Edge computing nodes perform differential operations on temperature time-series data to calculate the rate of temperature change per unit time and generate temperature rise rate characteristics. The temperature rise rate characteristics characterize the real-time changing trend of equipment thermal load status and heat dissipation system efficiency.
[0099] S104. Edge computing nodes perform harmonic analysis on the three-phase current waveform. They extract the fundamental amplitude and the amplitude of each harmonic through Fourier series decomposition, calculate the total harmonic distortion rate and the proportion of specific harmonics, and generate current harmonic distortion rate characteristics. The current harmonic distortion rate characteristics characterize the degree of degradation of the motor winding insulation state and the balance of the drive load.
[0100] S105. The vibration spectrum features, temperature rise rate features and current harmonic distortion rate features are concatenated into a multi-dimensional feature vector. The multi-dimensional feature vector carries degradation information of three dimensions: mechanical state, thermal state and electrical state. It is then input into the long short-term memory network model.
[0101] S106. The Long Short-Term Memory Network Model is based on the historical health degradation pattern and the current multi-dimensional feature vector. It learns the weight contribution of each dimension feature at different degradation stages through a gating mechanism and outputs the health index of each device in the next preset period. The health index represents the current operating status and potential degradation degree of the device in a percentage system.
[0102] S107. The health index is compared with the preset maintenance threshold. When the health index is lower than the preset maintenance threshold, the equipment dynamic monitoring and fault early warning subsystem generates maintenance early warning information. The maintenance early warning information includes equipment identification, current health index, fault mode classification and suggested maintenance time window.
[0103] In step S101, the preset sampling frequency is set to more than twice the highest analysis frequency, based on the highest rotational frequency of the key components of the monitored equipment and the expected fault characteristic frequency range, according to the Nyquist sampling theorem. Temperature sensors are attached to the motor housing and bearing housing surfaces to collect temperature time-series data at fixed time intervals. Current sensors are clamped onto the three-phase power supply line of the drive motor to synchronously collect three-phase current waveforms. The time-domain vibration waveform, the temperature time-series data of the motor and bearing surfaces, and the three-phase current waveform of the drive motor are aggregated through an industrial Ethernet interface to an edge computing node deployed on the equipment body, where they are uniformly received and timestamped.
[0104] In step S102, the normal operating frequency band and fault characteristic frequency band of the equipment are calibrated by performing spectral analysis on the vibration signals of the equipment model under healthy and known fault conditions. The frequency bands with concentrated energy under healthy conditions are marked as normal operating frequency bands, and the frequency bands with newly concentrated energy under fault conditions are marked as fault characteristic frequency bands. The energy ratio is calculated by the ratio of the sum of squares of the amplitudes at each frequency point within the target frequency band to the sum of squares of the amplitudes of the total frequency band, and this ratio serves as the vibration spectral characteristic.
[0105] In step S103, the temperature rise rate feature is generated by dividing the difference between the current temperature value and the previous temperature value by the time interval, using the sampling time interval of the temperature sensor as the unit.
[0106] In step S104, the total harmonic distortion rate is calculated by the ratio of the square root of the sum of the squares of the amplitudes of each harmonic to the amplitude of the fundamental frequency. The proportion of specific harmonics is pre-selected based on the number of pole pairs of the motor and the characteristic harmonic orders corresponding to common electrical faults. The ratio of the amplitude of the selected harmonic to the amplitude of the fundamental frequency is used as the proportion of specific harmonics. The proportion of specific harmonics and the total harmonic distortion rate together constitute the current harmonic distortion rate characteristic.
[0107] In steps S105 and S106, the total dimension of the multidimensional feature vector is determined by adding the dimensions of the three features individually. The historical health degradation pattern is obtained by training the historical health index sequence and its corresponding multidimensional feature vector. The next preset cycle is set based on the equipment maintenance strategy and prediction accuracy requirements; a shorter maintenance cycle results in higher prediction accuracy but also higher computational overhead. The Long Short-Term Memory (LSTM) network model learns the weight contributions of each feature dimension at different degradation stages through a gating mechanism, outputting the health index of each device within the next preset cycle.
[0108] In step S107, the fault mode classification is obtained by comparing the distribution characteristics of the current multidimensional feature vector with the standard feature vectors of various faults in the historical fault mode library, and the fault mode with the highest similarity is taken as the classification result. The recommended maintenance time window is determined by extrapolating the degradation trend of the health index to the time point corresponding to the maintenance threshold. The maintenance warning information includes equipment identification, current health index, fault mode classification, and recommended maintenance time window.
[0109] This embodiment uses three types of sensors—vibration, temperature, and current—to collect raw signals in three dimensions: mechanical, thermal, and electrical. Vibration spectrum features, temperature rise rate features, and current harmonic distortion rate features are extracted by edge computing nodes, and then concatenated into a multi-dimensional feature vector, which is then input into a long short-term memory network model. The model outputs a health index based on historical degradation patterns and current features. When the index is lower than the maintenance threshold, it generates maintenance warning information that includes equipment identification, health index, fault mode classification, and suggested maintenance time window, thus realizing real-time monitoring of the operating status of pharmacy equipment and quantitative assessment of degradation trends.
[0110] In some embodiments, the Long Short-Term Memory (LSTM) network model, based on historical health degradation patterns and current multidimensional feature vectors, learns the weight contributions of each dimension's features at different degradation stages through a gating mechanism, and outputs the health index of each device in the next preset period, including:
[0111] The long short-term memory network model receives a multi-dimensional feature vector composed of vibration spectrum features, temperature rise rate features and current harmonic distortion rate features. The multi-dimensional feature vector forms a time series input with a preset time step.
[0112] The forget gate inside the Long Short-Term Memory network model calculates the forget gate activation value based on the multidimensional feature vector of the current time step and the hidden state of the previous time step. The forget gate activation value determines which degradation information in the cell state of the previous time step needs to be retained. Among them, the mechanical degradation information corresponding to the vibration spectrum feature is retained at a higher proportion than the electrical degradation information corresponding to the current harmonic distortion rate feature in the early stage of equipment operation. The electrical degradation information corresponding to the current harmonic distortion rate feature is retained at a gradually increasing proportion in the later stage of equipment operation.
[0113] The input gate inside the Long Short-Term Memory Network model calculates the input gate activation value and candidate cell state based on the multidimensional feature vector of the current time step and the hidden state of the previous time step. The input gate activation value determines which degradation information in the multidimensional feature vector of the current time step needs to be written into the cell state. The candidate cell state includes the mechanical state degradation increment, thermal state degradation increment and electrical state degradation increment extracted in the current time step.
[0114] The Long Short-Term Memory Network model weights and sums the cell state of the previous time step after the forget gate and the candidate cell state after the input gate to generate the updated cell state of the current time step. While updating the cell state, it accumulates the historical degradation trajectory and current degradation increment of the three dimensions of mechanical state, thermal state and electrical state.
[0115] The output gate inside the Long Short-Term Memory network model calculates the output gate activation value based on the multidimensional feature vector of the current time step and the updated cell state. The output gate activation value determines which degenerate information in the updated cell state needs to be output to the hidden state of the current time step.
[0116] The Long Short-Term Memory network model updates the cell state, compresses it using a nonlinear activation function, and then multiplies it element-wise with the output gate activation value to generate the hidden state at the current time step. The hidden state carries the three-dimensional degradation features fused at the current time step.
[0117] The Long Short-Term Memory (LSTM) network model inputs the hidden state of the last time step into the fully connected layer. The fully connected layer maps the hidden state into a percentage value through linear transformation and nonlinear activation function, and outputs the health index of each device in the next preset period.
[0118] In this embodiment, the preset time step is set according to the time-varying rate of the device degradation process. Devices with a slower degradation rate use a longer time step to cover a longer historical degradation trajectory, while devices with a faster degradation rate use a shorter time step to capture rapidly changing degradation signals.
[0119] The mechanical state degradation increment in candidate cell states is obtained from the dimension segment corresponding to the vibration spectrum feature in the multidimensional feature vector; the thermal state degradation increment is obtained from the dimension segment corresponding to the temperature rise rate feature; and the electrical state degradation increment is obtained from the dimension segment corresponding to the current harmonic distortion rate feature.
[0120] Preferably, the Long Short-Term Memory (LSTM) network model updates the cell state by compressing it using the tanh function and then multiplying it element-wise with the output gate activation value to generate the hidden state at the current time step.
[0121] After the hidden state of the last time step is input into the fully connected layer, the fully connected layer performs a linear transformation on the hidden state through the weight matrix and the bias vector. Then, the sigmoid function maps the linear transformation result to the interval between 0 and 1, multiplies it by 100 to convert it into a percentage value, and outputs the health index of each device in the next preset period.
[0122] This embodiment utilizes the collaborative operation of the forget gate, input gate, and output gate within the Long Short-Term Memory network model to enable the model to adaptively adjust the retention and update ratio of mechanical, thermal, and electrical degradation information according to the equipment's operational stage. The hidden state of the last time step is mapped to a percentage-based health index through a fully connected layer, achieving multi-dimensional temporal modeling of the equipment degradation process and quantitative output of its health status.
[0123] Please see Figure 3 In some embodiments, the procurement support decision-making subsystem acquires unified data assets. This subsystem is built upon a large language model and a multi-agent architecture, including inventory agents, equipment agents, supplier agents, and seasonal epidemic agents, and generates a comprehensive procurement plan, including:
[0124] S201. The inventory intelligence agent obtains the real-time inventory level and historical consumption rate of each drug from the data governance platform, calculates the number of days the current inventory can be maintained according to the preset safety stock model, and generates an inventory status vector. The inventory status vector includes the inventory level, consumption trend and stockout risk level of each drug.
[0125] S202. The equipment intelligent agent obtains the health index and remaining service life prediction of each piece of equipment from the data governance platform. Based on the list of equipment with a health index below the maintenance threshold, it extracts the drug processing list associated with each piece of equipment and generates the equipment capacity constraint vector. The equipment capacity constraint vector includes the expected reduction in production quantity and reduction time window of each associated drug due to potential equipment failure.
[0126] S203. The supplier intelligence agent obtains the delivery cycle, historical on-time performance rate and current inventory availability of each drug supplier from the data governance platform, and generates a supplier capability vector. The supplier capability vector includes the reliability score and emergency order response capability of each supplier.
[0127] S204. The seasonal epidemic intelligence agent obtains hospital outpatient volume trends and regional epidemiological monitoring data from the data governance platform. It identifies seasonal drug demand fluctuations within a preset period through a time series analysis model and generates an epidemic impact vector. The epidemic impact vector includes the expected change in demand for each drug due to the epidemic trend.
[0128] S205. Input the inventory status vector, equipment capacity constraint vector, supplier capability vector and epidemic impact vector into the multi-agent negotiation framework based on the big language model. The multi-agent negotiation framework takes a preset negotiation round as the cycle. In each round of negotiation, each agent proposes replenishment needs and constraints based on its own vector information. The big language model performs semantic understanding and conflict resolution on the needs and constraints of each agent and generates a compromise solution acceptable to each agent.
[0129] S206. Generate a comprehensive procurement plan based on the compromise solution. The comprehensive procurement plan includes the replenishment quantity of each drug, emergency procurement indicator, recommended supplier list and expected delivery time window. The emergency procurement indicator is determined jointly based on the production reduction time window in the equipment capacity constraint vector and the demand change magnitude in the epidemic impact vector.
[0130] In step S201, the preset safety stock model calculates the upper and lower limits of safety stock based on the historical consumption volatility of each drug and the supplier's replenishment cycle. The stockout risk level is classified according to the ratio of the number of days the current inventory can be maintained to the replenishment cycle.
[0131] In step S202, the list of drug processing associated with the equipment can be obtained through the association table between equipment identifier and drug code in the data governance platform 11. The expected reduction in production is estimated based on the product of the equipment's historical processing capacity per unit time and the expected failure time window.
[0132] In step S203, the reliability score is calculated based on the supplier's historical on-time performance rate and delivery cycle volatility, and the emergency order response capability is determined based on the supplier's historical emergency order performance record.
[0133] In step S204, the time-series analysis model employs a seasonal differential autoregressive moving average model, and the expected change in demand is calculated based on the deviation between historical epidemiological data and current monitoring data. Preferably, the epidemiological monitoring data acquired by the seasonal epidemic agent includes meteorological exposure data: the seasonal epidemic agent incorporates a prediction model, which uses historical meteorological characteristics and the number of hospital admissions for specific diseases within the corresponding time period as training data. It fits the nonlinear mapping relationship between meteorological characteristics and the number of hospital admissions using a tree model, and extracts the risk threshold for each meteorological characteristic triggering a surge in hospital admissions. In actual prediction, the model outputs the expected number of hospital admissions for each relevant disease within a preset future period based on the meteorological forecast data, and uses this expected number of hospital admissions as the basis for calculating the expected change in demand in the epidemic impact vector.
[0134] In step S205, the preset negotiation rounds are set according to the urgency of the medicine and the supplier's response speed. The big language model converts the numerical demands and constraints proposed by each agent into natural language descriptions, identifies contradictions, and generates compromise solutions through semantic understanding. The big language model has preset prompt word templates adapted to the pharmacy procurement scenario. These templates automatically fill in the numerical conflicts in the proposals and feedback from each agent into natural language query statements. The big language model performs semantic understanding on the query based on its pre-trained knowledge and generates a response containing the reasons for adjustment and suggested values. The system extracts structured compromise solution data from this response through the output parsing module.
[0135] In step S206, when the production reduction time window overlaps with the demand increase window, it is marked as an emergency purchase, and the recommended supplier list is selected after being sorted according to the reliability score in the supplier capability vector.
[0136] In this embodiment, the inventory agent, equipment agent, supplier agent, and seasonal epidemic agent obtain the data they need from the data governance platform 11 and generate state vectors. The four vectors are then input into a multi-agent negotiation framework based on a large language model for semantic understanding and conflict resolution to generate a compromise solution. Finally, a comprehensive procurement plan is output, which includes replenishment quantity, emergency procurement flag, recommended supplier list, and expected delivery time window.
[0137] In some embodiments, the seasonal epidemic agent generates an epidemic impact vector through the following steps:
[0138] The seasonal epidemic agent obtains historical outpatient volume, historical inpatient number, and external meteorological data from the data governance platform. The agent is internally deployed with a meteorological-driven disease inpatient number prediction model based on extreme gradient boosting trees. This model uses historical meteorological features (including daily maximum temperature, daily minimum temperature, daily temperature range, precipitation, average relative humidity, maximum wind speed, UV index, and visibility) as input features and the total number of inpatients for a certain type of specialty disease in the future preset period as the prediction target. During model training, Tweedie regression is used as the objective function to fit the overdispersion and right-skewed distribution characteristics of the inpatient number sequence.
[0139] After model training, the seasonal epidemic agent extracts the independent marginal effects and nonlinear trigger thresholds of each meteorological feature on hospital admission risk using the cumulative local effects algorithm. This algorithm effectively avoids interpretative bias caused by feature multicollinearity by calculating local gradients within a conditional subset of the feature space, outputting the relative risk increase curves and key trigger thresholds for each meteorological feature across different numerical ranges. For example, model training results show that a daily maximum temperature below 12 degrees Celsius has a significant positive triggering effect on disease onset; a sharp increase in hospital admission risk occurs when the average temperature over the next 14 days reaches the 25-26 degree Celsius range; and the effect on hospital admissions peaks when the cumulative precipitation over the next 14 days enters the 90-140 mm load range.
[0140] The seasonal epidemic agent takes the predicted number of hospital admissions for each specialty within a future preset period output by the aforementioned meteorological-driven disease hospital admission prediction model, and combines it with the probability distribution of patients with different diseases entering each treatment group and the proportion of medications used by each treatment group for different diseases from historical medical data to calculate the future expected demand for each drug layer by layer. This deduction process decomposes drug demand into three continuous links: disease occurrence probability, patient flow path, and clinical medication behavior, so that the epidemic impact vector is based on the real clinical diagnosis and treatment process rather than a simple data fitting. The seasonal epidemic agent outputs the final generated change in the expected demand of each drug as the epidemic impact vector to the multi-agent negotiation framework.
[0141] Please see Figure 4 In some embodiments, inventory status vectors, equipment capacity constraint vectors, supplier capability vectors, and epidemic impact vectors are input into a multi-agent negotiation framework based on a large language model. The multi-agent negotiation framework operates on a preset negotiation round cycle. In each round, each agent proposes replenishment needs and constraints based on its own vector information. The large language model performs semantic understanding and conflict resolution on the needs and constraints of each agent, generating a compromise solution acceptable to all agents, including:
[0142] S301. The multi-agent negotiation framework initiates the first round of negotiation. The inventory agent generates a first-round replenishment request proposal based on the list of drugs with a stockout risk level higher than a preset threshold in the inventory state vector. The first-round replenishment request proposal includes the expected replenishment quantity and expected arrival time for each drug.
[0143] S302. The equipment agent receives the first round of replenishment request proposals and generates the first round of capacity constraint feedback based on the production reduction time window and production reduction quantity in the equipment capacity constraint vector. The first round of capacity constraint feedback includes the upper limit of the replenishment quantity that cannot be met due to potential equipment failure and the suggested adjustment of the delivery time window.
[0144] S303. The supplier agent receives the first round of replenishment request proposals and the first round of capacity constraint feedback. Based on the reliability score and emergency order response capability of each supplier in the supplier capability vector, it generates the first round of supply capability feedback, which includes the maximum replenishment quantity and the shortest delivery cycle that each supplier can provide.
[0145] S304. The seasonal epidemic intelligence agent receives the first round of replenishment demand proposals and generates the first round of demand adjustment suggestions based on the expected change in demand in the epidemic impact vector. The first round of demand adjustment suggestions includes the replenishment quantity that needs to be increased due to the epidemic trend and a list of medicines that are recommended to be replenished first.
[0146] S305, the large language model receives the first round of replenishment demand proposals, the first round of capacity constraint feedback, the first round of supply capacity feedback and the first round of demand adjustment suggestions, performs semantic understanding of the needs and constraints of each agent, and identifies the conflict points between each agent. The conflict points include the quantity conflict between the expected replenishment quantity of the inventory agent and the upper limit of the replenishment quantity in the equipment capacity constraint feedback, and the time conflict between the expected delivery time of the inventory agent and the shortest delivery cycle in the supplier capacity feedback.
[0147] S306. The large language model sorts the conflict points according to their priority and generates a first-round compromise solution. The first-round compromise solution includes the adjusted replenishment quantity of each drug, the adjusted delivery time window, and the recommended supplier. The first-round compromise solution is then fed back to each agent.
[0148] S307. Each agent receives the first round of compromise solutions and judges whether the compromise solution is acceptable based on its own vector information. When the inventory agent judges that the adjusted replenishment quantity in the compromise solution is lower than the minimum safety stock corresponding to the stockout risk level, the inventory agent generates a second round of replenishment demand proposal. The second round of replenishment demand proposal includes a list of drugs that need to be further replenished and the increase amount.
[0149] S308. The multi-agent negotiation framework repeats the above negotiation process with a preset number of negotiation rounds as the upper limit, until all agents accept the current compromise solution or the preset number of negotiation rounds is reached. The compromise solution generated in the last round is taken as the final compromise solution that is acceptable to all agents and is output.
[0150] In step S301, the preset threshold is set according to the clinical necessity and replenishment cycle of each drug. The higher the clinical necessity or the longer the replenishment cycle of a drug, the lower the preset threshold for its shortage risk level.
[0151] In step S302, the upper limit of the replenishment quantity is calculated based on the upper limit of the number of drugs that the equipment can process within the production reduction time window in the equipment capacity constraint vector. The recommended adjustment of the delivery time window is determined jointly based on the equipment's expected recovery time and the supplier's shortest delivery cycle.
[0152] In step S303, the maximum replenishment quantity that each supplier can provide is calculated based on the current available inventory in the supplier's capacity vector and the emergency order response capability, and the shortest delivery cycle is determined based on the shortest actual delivery time of similar drugs in the supplier's historical delivery records.
[0153] In step S304, the list of medicines recommended for priority replenishment is selected after sorting them from high to low according to the expected change in demand in the epidemic impact vector.
[0154] In step S305, the degree of quantity conflict is calculated by dividing the difference between the expected replenishment quantity and the upper limit of the replenishment quantity by the expected replenishment quantity, and the degree of time conflict is calculated by dividing the time difference between the expected arrival time and the shortest delivery cycle by the replenishment cycle.
[0155] In step S306, the priority ranking is arranged from high to low according to the degree of conflict, and the conflict points with higher degree of conflict are adjusted first in the first round of compromise solutions.
[0156] In step S307, the minimum safety stock is calculated based on the historical consumption fluctuations of the drug and the supplier's replenishment cycle. When the adjusted replenishment quantity is lower than the minimum safety stock, the increase is determined based on the difference between the minimum safety stock and the adjusted replenishment quantity.
[0157] In step S308, the upper limit of the preset negotiation rounds is set according to the urgency of the drug and the supply chain response speed. The higher the urgency of the drug, the lower the upper limit of the preset negotiation rounds in order to speed up the decision-making process.
[0158] This embodiment initiates multiple rounds of negotiation through a multi-agent negotiation framework. Each agent proposes replenishment needs and constraints in turn based on its own vector information. The large language model identifies and sorts the conflict points and generates a compromise solution, which is then fed back to each agent. Each agent judges whether the solution is acceptable and initiates the next round of negotiation if it is unacceptable. The process continues until all agents accept the solution or the preset negotiation round limit is reached, at which point the final compromise solution is output.
[0159] In some embodiments, the operating system further includes:
[0160] When the device agent detects that the health index is lower than the maintenance threshold, it sends a capacity constraint signal to the procurement auxiliary decision-making subsystem. The capacity constraint signal carries the device identifier and the associated drug type.
[0161] The inventory agent calculates the types and quantities of production cuts based on capacity constraint signals, increases the safety stock threshold and increases preventative replenishment, and then adjusts the safety stock threshold back down once the health status recovers.
[0162] In this embodiment, the capacity constraint signal is generated by the equipment agent in a structured data format. The associated drug types are obtained by querying the association table between equipment identifiers and drug codes in the data governance platform 11. The capacity constraint signal is transmitted to the procurement auxiliary decision-making subsystem 13 via the message queue of the data governance platform 11, and is received and parsed by the inventory agent.
[0163] Preferably, the inventory agent obtains the historical prescription records of each associated drug from the data governance platform 11 based on the associated drug types in the capacity constraint signal, extracts the average daily consumption of each drug under normal equipment operation, and calculates the basic production reduction quantity in combination with the expected equipment downtime; the increase in the safety stock threshold is determined based on the basic production reduction quantity, and the preventive replenishment quantity is equal to the difference between the adjusted safety stock threshold and the current inventory level; the health recovery criterion is that the health index output by the equipment dynamic monitoring and fault early warning subsystem 12 rises above the maintenance threshold and remains stable; when the health is determined to be recovered, the inventory agent obtains the original safety stock threshold of the associated drug from the data governance platform 11 and restores the adjusted safety stock threshold to the original value.
[0164] In this embodiment, when the health index of the equipment is lower than the maintenance threshold, the equipment intelligent agent sends a capacity constraint signal carrying the equipment identifier and the associated drug type to the procurement auxiliary decision-making subsystem 13. The inventory intelligent agent calculates the types and quantities of production reduction based on the signal, raises the safety stock threshold, and increases the preventive replenishment quantity. After the health index recovers, the safety stock threshold is adjusted back, thus realizing the dynamic linkage between equipment health status and inventory strategy.
[0165] Please see Figure 5 In some embodiments, the inventory agent calculates the types and quantities of production reductions based on capacity constraint signals, increases the safety stock threshold, and adds preventative replenishment. When the health status recovers, the safety stock threshold is adjusted back up, including:
[0166] S401. The inventory agent receives a capacity constraint signal. The capacity constraint signal includes the equipment identifier, associated drug type, expected failure time window and failure mode classification. The inventory agent obtains all prescription records processed by the equipment corresponding to the equipment identifier within a historical preset period from the data governance platform, and extracts the average daily consumption and consumption rate fluctuation variance of each associated drug from the prescription records.
[0167] S402. The inventory agent calculates the number of days of equipment downtime based on the start and end times of the expected failure time window and the maintenance duration. It then multiplies the average daily consumption of each related drug by the number of days of equipment downtime to generate the basic reduction quantity of each related drug.
[0168] S403. The inventory agent classifies the failure modes, queries the consumption rate fluctuation compensation coefficient corresponding to the failure mode from the preset failure impact coefficient table, multiplies the basic production reduction quantity with the consumption rate fluctuation compensation coefficient, and generates the preventive replenishment quantity of each related drug.
[0169] S404. The inventory agent obtains the current safety stock threshold of each related drug from the data governance platform, adds the current safety stock threshold to the preventive replenishment quantity, generates the adjusted safety stock threshold, and writes the adjusted safety stock threshold into the inventory parameter table of the data governance platform.
[0170] S405. The inventory agent generates a preventative replenishment quantity based on the difference between the adjusted safety stock threshold and the current inventory level. The preventative replenishment quantity is equal to the difference between the adjusted safety stock threshold and the current inventory level. When the difference is positive, the procurement auxiliary decision-making subsystem is triggered to add the preventative replenishment quantity to the comprehensive procurement plan.
[0171] S406. The inventory agent continuously monitors the health index corresponding to the device identifier output by the device dynamic monitoring and fault early warning subsystem. When the health index rises above the preset recovery threshold and remains stable for a preset duration, the inventory agent determines that the device health has recovered.
[0172] S407. After determining that the health of the equipment has recovered, the inventory agent obtains the original safety stock threshold of the associated drug from the data governance platform, restores the adjusted safety stock threshold to the original safety stock threshold, and writes the callback safety stock threshold into the inventory parameter table of the data governance platform. At the same time, it sends a safety stock callback signal to the procurement auxiliary decision-making subsystem. The procurement auxiliary decision-making subsystem reassesses whether it is necessary to reduce the replenishment quantity in the subsequent procurement plan based on the callback safety stock threshold.
[0173] In step S401, the historical preset period is set according to the equipment maintenance cycle, covering the time interval from the last maintenance of the equipment to the current time; the consumption rate fluctuation variance is obtained by calculating the variance of the daily average consumption sequence of each related drug within the time interval.
[0174] In step S402, the maintenance duration is determined based on the historical average maintenance time corresponding to the fault mode classification, and the equipment downtime duration is equal to the end time of the expected fault time window minus the start time, divided by twenty-four hours.
[0175] In step S403, the preset fault impact coefficient table can be calibrated by taking the average value after statistically analyzing the actual impact ratio of each fault mode on the equipment's unit time processing capacity during the historical occurrence period. The impact ratio is equal to the ratio of the actual processing volume of the equipment during the fault period to the normal processing volume. The more severe the fault, the lower the ratio, and the higher the corresponding consumption rate fluctuation compensation coefficient.
[0176] In steps S404 and S405, the current safety stock threshold is set based on the historical consumption volatility of each related drug and the supplier's replenishment cycle, taking the weighted value of the average historical consumption and the maximum consumption within the replenishment cycle; the original safety stock threshold is the safety stock threshold when the equipment health is normal, and is stored in the inventory parameter table of the data governance platform 11; after the adjusted safety stock threshold is written into the inventory parameter table of the data governance platform 11, the procurement auxiliary decision-making subsystem 13 automatically reads the updated threshold when generating the comprehensive procurement plan next time. When the difference between the adjusted safety stock threshold and the current inventory level is positive, the preventative replenishment quantity is added to the comprehensive procurement plan as an independent entry.
[0177] In step S406, the preset recovery threshold is set according to the lower limit of normal operating health recommended by the equipment manufacturer, and the preset stabilization time is determined according to the shortest historical time for the equipment health index to fall from above the recovery threshold to below the threshold.
[0178] In step S407, the safety stock callback signal includes the associated drug identifier and the safety stock threshold after the callback. After receiving the signal, the procurement auxiliary decision-making subsystem 13 re-evaluates the subsequent replenishment plan for the drug.
[0179] In this embodiment, after receiving the capacity constraint signal through the inventory agent, it obtains historical prescription records from the data governance platform 11 to calculate the basic production reduction quantity, and generates a preventive replenishment quantity by combining the consumption rate fluctuation compensation coefficient corresponding to the fault mode classification. Based on this, the safety stock threshold is increased and written into the data governance platform 11. After the health is restored, the safety stock threshold is reverted to the original value and the procurement auxiliary decision-making subsystem 13 is notified to adjust the subsequent procurement plan.
[0180] In some embodiments, the data governance platform incorporates a drug master data mapping engine to associate Western medicine codes, traditional Chinese medicine decoction piece codes, and equipment consumable codes with a unified logical identifier, generating unified data assets, including:
[0181] The data governance platform connects to the hospital information system database of the Western medicine intelligent supply subsystem, the manufacturing execution system database of the traditional Chinese medicine decoction subsystem, and the time series database of the equipment dynamic monitoring and fault early warning subsystem through standard database interfaces.
[0182] The drug master data mapping engine is configured with a mapping rule table. The mapping rule table is stored in a triplet structure. The first item is the Western medicine code, the second item is the Chinese herbal medicine code, and the third item is the unified logical identifier. The unified logical identifier is composed of the drug generic name string, the standardized dosage form string, and the standard unit of measurement based on grams.
[0183] The data governance platform is configured with a data cleaning rule base, which includes rules for duplicate record detection, rules for filling null values, and rules for converting units of measurement. It automatically normalizes duplicate records, null fields, and abnormal units of measurement from different systems.
[0184] After mapping and cleaning, the data is written into a unified data asset repository. The unified data asset repository is a hybrid storage of relational database and time-series database. The relational database stores drug inventory snapshots, prescription execution records and procurement history records, while the time-series database stores continuous sampling data of equipment vibration, temperature and current. The association key between the two is a unified logical identifier and timestamp.
[0185] The unified data asset repository supports cross-dimensional related queries based on the generic name of the drug. The query results simultaneously return the inventory of the drug in the Western medicine warehouse, the consumption rate in the traditional Chinese medicine decoction warehouse, and the maintenance status of the associated equipment.
[0186] In this embodiment, the standard database interface is configured according to the database type of each subsystem. The hospital information system database of the Western medicine intelligent supply subsystem adopts the relational database interface, the manufacturing execution system database of the traditional Chinese medicine decoction subsystem adopts the industrial database interface, and the time-series database of the equipment dynamic monitoring and fault early warning subsystem 12 adopts the time-series database dedicated interface.
[0187] The standardized dosage form string of the unified logical identifier in the mapping rule table is determined according to the dosage form classification standard in the National Drug Coding Catalog. The standard unit of measurement based on grams is obtained by uniformly converting the original units of measurement of each system according to the International System of Units (SI) conversion factor.
[0188] The duplicate record detection rules in the data cleaning rule base are determined based on the uniqueness of the combination of drug code and generic name. The null value filling rules are filled based on the historical statistical mode or median of the field. The unit conversion rules are configured according to the conversion relationship between the original units of measurement of each system and the International System of Units (SI) standard units of measurement.
[0189] In the unified data asset repository, relational databases and time-series databases are linked by foreign keys using a unified logical identifier and timestamp, enabling cross-database join queries. Cross-dimensional join queries use structured query statements to align inventory and prescription data in the relational database with equipment status data in the time-series database within a time window before returning the results.
[0190] In some embodiments, the collaborative scheduling engine interfaces with the execution devices of each subsystem, including:
[0191] The collaborative scheduling engine is deployed on the industrial control server, adopts a unified clock synchronization and a unified data model, and connects to the execution devices of the Western medicine intelligent supply subsystem and the traditional Chinese medicine decoction subsystem through a hybrid protocol stack of OPC unified architecture and Modbus transmission control protocol.
[0192] The collaborative scheduling engine performs unified clock synchronization on the execution equipment of the Western medicine intelligent supply subsystem and the traditional Chinese medicine decoction subsystem, shortening the control cycle to within a preset millisecond threshold.
[0193] The collaborative scheduling engine uses the ground logistics loop and vertical lifting mechanism in the shared logistics network to uniformly schedule the first and second mobile robot clusters, and maps the position and motion status of each robot in real time in the digital twin.
[0194] In this embodiment, unified clock synchronization is achieved through a clock synchronization service deployed on the industrial control server. This service uses a preset clock source as a reference and periodically sends time correction commands to each execution device through a clock synchronization protocol, ensuring that all devices maintain the same time reference. The preset millisecond threshold is set according to the response time tolerance of each execution device to control commands; the smaller the response time tolerance of a device, the lower its corresponding preset millisecond threshold.
[0195] In the hybrid protocol stack of OPC unified architecture and Modbus transmission control protocol, OPC unified architecture is used to transmit structured data models and complex control commands, while Modbus transmission control protocol is used to transmit switch and analog signals with high real-time requirements. The two protocols are dynamically switched according to the transmission requirements of data types.
[0196] The ground logistics loop consists of magnetic strips or QR code paths laid on the ground, while the vertical lifting mechanism consists of lifting platforms installed between floors. Both are connected to the collaborative scheduling engine 15 through a unified physical interface and communication protocol, enabling the first and second mobile robot clusters to seamlessly switch transportation channels between different floors. The position and motion status of each robot in the digital twin are updated driven by real-time coordinate data and motion speed data reported by the robot itself.
[0197] This embodiment achieves millisecond-level collaborative control of cross-system execution devices through unified clock synchronization and hybrid protocol stack, and realizes cross-regional collaborative scheduling and status visualization of Chinese and Western medicine logistics resources through shared logistics network 16 and digital twin real-time mapping, thereby improving the overall collaborative efficiency and response speed of the pharmacy production and operation system.
[0198] In some embodiments, the digital twin preventative scheduling module constructs a pharmacy digital twin in virtual space based on equipment health index and remaining service life prediction. Combining this with predicted prescription volume, it plans equipment maintenance windows and production task scheduling using a time-space optimization algorithm, including:
[0199] The digital twin preventive scheduling module obtains the health index and remaining service life prediction of each piece of equipment from the equipment dynamic monitoring and fault early warning subsystem, extracts the distribution pattern of prescription volume in each time period from historical prescription data, and generates the predicted amount of prescription tasks in the future preset period through the time series prediction model. The predicted amount of prescription tasks includes the predicted values of Western medicine prescription volume and traditional Chinese medicine prescription volume in each time period.
[0200] The digital twin preventive scheduling module constructs a digital twin of the pharmacy in virtual space. The digital twin includes a three-dimensional geometric model and a physical behavior model of an automated three-dimensional warehouse for Western medicine, an intelligent dispensing station, a traditional Chinese medicine decoction unit, a logistics channel, and a mobile robot. The digital twin keeps its movement synchronized with the real equipment through real-time data streams.
[0201] The digital twin preventive scheduling module identifies candidate devices whose health index will fall below the maintenance threshold within a preset prediction period based on the remaining service life prediction, and generates a candidate device list. The candidate device list includes the device identifier of each candidate device, the expected time to reach the maintenance threshold, and the maintenance duration.
[0202] The digital twin preventive scheduling module inputs the candidate equipment list and the predicted prescription task volume into the time-space optimization algorithm. The time-space optimization algorithm takes minimizing the time overlap between the maintenance window and the peak prescription period as the first optimization objective and minimizing the space occupation of the logistics channel by the maintenance path as the second optimization objective. Monte Carlo simulation is performed in the digital twin to evaluate the feasibility of multiple candidate maintenance windows and output the optimal maintenance plan. The optimal maintenance plan includes the start and end times of the maintenance window for each candidate equipment, the maintenance path planning, and the production task migration plan during the maintenance period. The production task migration plan specifies that the production tasks involving the maintenance equipment will be transferred to the standby equipment or adjusted to other time periods outside the maintenance window.
[0203] The digital twin preventive scheduling module issues the optimal maintenance plan to the collaborative scheduling engine in the form of task instructions and maps the execution status in real time in the digital twin. When deviation occurs during execution, the plan is dynamically adjusted.
[0204] In this embodiment, the time-series prediction model can select the model structure based on the periodic characteristics of historical prescription data. For example, if the prescription volume shows a fixed periodic fluctuation, the seasonal difference autoregressive moving average model is used; if there is no obvious periodicity, the autoregressive moving average model is used.
[0205] In a digital twin, the three-dimensional geometric model is constructed using 3D modeling software based on the actual dimensions and spatial coordinates of each device, while the physical behavior model is configured using a simulation platform based on the kinematic and dynamic parameters of each device.
[0206] The preset prediction cycle is set based on the equipment health degradation rate. Equipment with a faster degradation rate uses a shorter preset prediction cycle to identify equipment that is about to reach the maintenance threshold in advance. The maintenance time required in the candidate equipment list is determined based on the average time taken for similar maintenance operations in the equipment's historical maintenance records.
[0207] In the time-space optimization algorithm, the time overlap of the first optimization objective is calculated by the length of the time intersection between the candidate maintenance window and the peak prescription period. The space occupancy of the second optimization objective is calculated by the product of the number of logistics channel nodes occupied by the maintenance path and the occupation time. The input to the Monte Carlo simulation is the probability distribution of the predicted prescription task quantity and the maintenance required time. Each simulation randomly samples a set of inputs from this distribution and calculates the optimization objective value. The mean and variance of multiple simulation results are used to evaluate the robustness of the candidate maintenance window. The production task migration scheme in the optimal maintenance plan is determined based on the current load rate and available capacity of the standby equipment.
[0208] In this embodiment, the health index and remaining service life prediction are obtained from the equipment dynamic monitoring and fault early warning subsystem 12 through the digital twin preventive scheduling module 14. Combined with the prescription task prediction amount generated by the time series prediction model, the optimal maintenance plan is output in the digital twin through time-space optimization algorithm and Monte Carlo simulation. The optimal maintenance plan is then sent to the collaborative scheduling engine 15 for execution and real-time mapping.
[0209] In some embodiments, the digital twin preventive scheduling module inputs a candidate equipment list and a predicted prescription task quantity into a time-space optimization algorithm. The time-space optimization algorithm takes minimizing the time overlap between the maintenance window and peak prescription periods as its first optimization objective, and minimizing the space occupancy of the maintenance path on the logistics channel as its second optimization objective. Monte Carlo simulations are performed in the digital twin to evaluate the feasibility of multiple candidate maintenance windows and output the optimal maintenance plan, including:
[0210] The time-space optimization algorithm extracts the expected time when each candidate device will reach the maintenance threshold and the maintenance duration from the candidate device list, extracts the prescription volume prediction value for each time period from the prescription task prediction volume, and marks the time period when the prescription volume prediction value is higher than the preset peak threshold as the prescription peak period.
[0211] The time-space optimization algorithm takes the expected time when each candidate device reaches the maintenance threshold as the center, and expands a preset time range forward and backward to generate multiple candidate maintenance windows. Each candidate maintenance window includes the maintenance start time and the maintenance end time.
[0212] The time-space optimization algorithm calculates the time intersection length between each candidate maintenance window and all prescription peak periods, and uses the time intersection length as the evaluation value of the first optimization objective. The smaller the time intersection length, the smaller the time overlap between the maintenance window and the prescription peak period.
[0213] The time-space optimization algorithm plans a maintenance path from the maintenance start point to the maintenance end point for each candidate maintenance window based on the three-dimensional geometric model of each candidate device in the digital twin and the topology of the logistics channel. The maintenance path consists of a series of logistics channel node coordinates.
[0214] The time-space optimization algorithm calculates the number of logistics channel nodes occupied by each maintenance path and the occupation time. The product of the number of occupied nodes and the occupation time is used as the evaluation value of the second optimization objective. The smaller the product, the smaller the space occupation of the logistics channel by the maintenance path.
[0215] The time-space optimization algorithm weights and sums the evaluation values of the first optimization objective and the second optimization objective to generate a comprehensive evaluation value for each candidate maintenance window, where the weight of the first optimization objective is higher than the weight of the second optimization objective.
[0216] The time-space optimization algorithm performs Monte Carlo simulations on a preset number of candidate maintenance windows with the highest comprehensive evaluation values in the digital twin. The Monte Carlo simulation is capped at a preset number of simulations. In each simulation, the predicted amount of prescription tasks and the maintenance time are randomly perturbed. The actual time overlap between the maintenance window and the peak prescription period and the actual space occupation of the maintenance path on the logistics channel are recorded in each simulation.
[0217] The time-space optimization algorithm calculates the mean and variance of time overlap and space occupancy in the Monte Carlo simulation results, selects the candidate maintenance window with the smallest mean and the lowest variance as the optimal maintenance window, and outputs the maintenance path plan corresponding to the optimal maintenance window, which is the final optimal maintenance scheme.
[0218] In this embodiment, the preset peak threshold is set based on the statistical distribution of prescription volume in historical prescription data for each time period, and the upper quartile of the prescription volume distribution is taken as the criterion for determining the peak prescription period. The preset time range is set based on the interval between the maximum time required for equipment maintenance and the peak prescription period, ensuring that the generated candidate maintenance window can cover all feasible time periods during which the equipment can be maintained.
[0219] The number of candidate maintenance windows generated is affected by the ratio of the preset time range to the maintenance duration; the larger the ratio, the more candidate maintenance windows are generated. Maintenance path planning is based on the topological connectivity of the logistics channels in the digital twin, prioritizing channel node sequences that do not intersect with the current production task path to reduce the interference of maintenance operations on production logistics.
[0220] The ratio of the weight of the first optimization objective to the weight of the second optimization objective is set according to the relative importance of production timeliness and smooth logistics in the pharmacy operation strategy. When the risk of prescription backlog is high, the weight of the first optimization objective is increased, and when the risk of logistics channel congestion is high, the weight of the second optimization objective is increased.
[0221] The preset number is determined based on the balance between the total number of candidate maintenance windows and computing resources. Windows with the highest comprehensive evaluation values among the total number of candidate maintenance windows are selected for Monte Carlo simulation. The preset number of simulations is set according to the required statistical confidence level; the higher the confidence level requirement, the more simulations are preset. The magnitude of random perturbations in the Monte Carlo simulation is set based on the historical prediction error distribution of the prescription task prediction quantity and the maintenance time required. Each simulation randomly samples perturbation values from this distribution and then superimposes them onto the original input.
[0222] The optimal maintenance window is selected based on the mean and variance of time overlap and space occupancy in the Monte Carlo simulation results. The mean reflects the performance of the window under average conditions, and the variance reflects the sensitivity of the window to input disturbances. The candidate maintenance window with the smallest mean and the lowest variance is selected as the optimal maintenance window.
[0223] This embodiment uses a time-space optimization algorithm to extract the expected time when each candidate device will reach the maintenance threshold and the maintenance duration required for each candidate device from the candidate device list. After combining the prescription task prediction volume to mark the peak prescription period, multiple candidate maintenance windows are generated. The time overlap and space occupation of each window are calculated as the optimization target evaluation value. After weighted summation and Monte Carlo simulation, the candidate maintenance window with the smallest mean and the lowest variance is selected as the optimal maintenance scheme.
[0224] In some embodiments, the shared logistics network comprises a first mobile robot cluster and a second mobile robot cluster. A collaborative scheduling engine dynamically allocates robots to perform tasks such as transporting Western medicine or moving traditional Chinese medicine decoction containers based on the urgency of prescriptions and the real-time load rate of equipment.
[0225] The collaborative scheduling engine obtains the urgency level tags of each prescription from the data governance platform. The urgency level tags are calculated based on the time difference between the prescription generation time and the patient's expected medication pickup time. At the same time, it obtains the real-time load rate of each workstation in the Western medicine intelligent supply subsystem and the traditional Chinese medicine decoction subsystem. The real-time load rate is calculated based on the ratio of the number of currently queued tasks to the processing capacity of each workstation.
[0226] The collaborative scheduling engine obtains the current position coordinates and idle status indicators of each robot from the first mobile robot cluster and the second mobile robot cluster. The idle status indicator indicates whether the robot is in standby state, executing a task state or charging state.
[0227] The collaborative scheduling engine inputs prescription urgency labels, real-time workstation load rates, and robot idle status indicators into the task allocation algorithm. The task allocation algorithm aims to minimize the weighted waiting time of all prescriptions. The weighting is dynamically adjusted based on the urgency labels. The algorithm outputs a task allocation scheme for each robot, which includes the starting workstation, ending workstation, task type, and estimated execution time for each robot's next task.
[0228] The task allocation algorithm determines whether a task is a Western medicine transportation task or a traditional Chinese medicine decoction barrel handling task based on the task type and drug form characteristics parameters. When the number of Western medicine prescriptions is low, resulting in idle robots in the first mobile robot cluster, the task allocation algorithm will allocate the idle robots to the traditional Chinese medicine decoction side to perform the traditional Chinese medicine decoction barrel handling task. When the number of prescriptions on the traditional Chinese medicine decoction side is low, resulting in idle robots in the second mobile robot cluster, the task allocation algorithm will allocate the idle robots to the Western medicine side to perform the Western medicine transportation task.
[0229] The collaborative scheduling engine issues task allocation plans to each robot in the form of path planning instructions. Each robot executes tasks according to the planned path in the shared logistics network. The ground logistics loop and vertical lifting mechanism in the shared logistics network are shared by the first mobile robot cluster and the second mobile robot cluster. The collaborative scheduling engine dynamically adjusts the path planning according to the real-time position of each robot to avoid congestion in the logistics channel.
[0230] In this embodiment, the weighting is dynamically adjusted as follows: the prescription with the highest urgency label has a weight that is several times the baseline value; for each level decrease in urgency label, the weighting decreases by a fixed proportion. The task allocation algorithm determines the starting and ending workstations for each robot's next task by finding the minimum sum of weighted waiting times for each robot's task allocation scheme.
[0231] The morphological characteristics of drugs include the packaging form and physical dimensions of the drugs. The morphological characteristics of drugs corresponding to the transportation tasks of Western medicine are boxed or bottled solids, while the morphological characteristics of drugs corresponding to the transportation tasks of traditional Chinese medicine decoction barrels are barreled liquids. The task allocation algorithm determines the task assignment based on the matching relationship between the morphological characteristics of drugs and the robot vehicle type.
[0232] The collaborative scheduling engine 15 sends path planning instructions to each robot via a wireless communication network. These instructions include robot identifiers and task execution sequences. Upon receiving the instructions, each robot autonomously navigates according to the starting and ending workstation coordinates. Based on the real-time position coordinates reported by each robot, and combined with the occupancy status table of the ground logistics loop and the vertical lifting mechanism, the collaborative scheduling engine 15 dynamically adjusts the robot's travel path and passage order.
[0233] In this embodiment, the prescription urgency level label, workstation real-time load rate and robot idle status identifier are input into the task allocation algorithm through the collaborative scheduling engine 15. The algorithm outputs the task allocation scheme of each robot with the optimization objective of minimizing the weighted waiting time, and issues it in the form of path planning instructions for execution. The path planning is dynamically adjusted according to the real-time position of the robot to avoid congestion in the logistics channel.
[0234] By adopting the above technical solutions, this invention differs from existing technologies and has the following beneficial effects: The pharmacy intelligent production and operation system 1, through the data governance platform 11, associates Western medicine codes, traditional Chinese medicine decoction piece codes, and equipment consumable codes with a unified logical identifier and generates unified data assets, enabling cross-system data to be correlated and queried under a unified standard; the equipment dynamic monitoring and fault early warning subsystem 12 extracts multi-dimensional features through edge computing and inputs them into a long short-term memory network model to output a health index, providing a quantitative basis for equipment degradation trends; and the procurement auxiliary decision-making subsystem 13 utilizes a large language model and multiple agents... The architecture integrates inventory, equipment, supplier, and epidemic information into a comprehensive procurement plan, enabling procurement decisions to simultaneously consider equipment capacity constraints and fluctuations in medication demand. A digital twin preventative scheduling module 14, combined with prescription task predictions, uses a time-space optimization algorithm to plan maintenance windows and production schedules in a virtual space, ensuring that maintenance operations and production peaks are staggered in time and space. A collaborative scheduling engine 15 dynamically allocates robots to perform tasks such as transporting Western medicine or moving traditional Chinese medicine decoction containers based on prescription urgency and real-time equipment load rates through a shared logistics network 16, allowing logistics resources to flow between the two systems on demand. This technical solution, through the collaborative work of the data governance platform 11, the equipment dynamic monitoring and fault early warning subsystem 12, the procurement auxiliary decision-making subsystem 13, the digital twin preventative scheduling module 14, the collaborative scheduling engine 15, and the shared logistics network 16, achieves unified cross-system data and intelligent scheduling driven by equipment health in the pharmacy.
[0235] Finally, it should be noted that although the above embodiments have been described in the text and drawings of this application, this should not limit the scope of patent protection of this application. Any technical solutions that are based on the essential concept of this application and utilize the content described in the text and drawings of this application, resulting in equivalent structural or procedural substitutions or modifications, as well as the direct or indirect application of the technical solutions of the above embodiments to other related technical fields, are all included within the scope of patent protection of this application.
Claims
1. A pharmacy intelligent production and operation system, characterized in that, include: The data governance platform connects with the Western medicine supply subsystem, the traditional Chinese medicine decoction subsystem, and the hospital information system. The data governance platform has a built-in drug master data mapping engine that associates Western medicine codes, traditional Chinese medicine decoction piece codes, and equipment and consumable codes with a unified logical identifier to generate unified data assets. The equipment dynamic monitoring and fault early warning subsystem collects data through vibration, temperature and current sensors, extracts spectrum and temperature rise characteristics through edge computing, inputs them into a long short-term memory network model, outputs an equipment health index, and generates maintenance early warning information when the index is lower than the maintenance threshold. The procurement decision support subsystem acquires unified data assets. It is built on a large language model and multi-agent architecture, including inventory agents, equipment agents, supplier agents, and seasonal epidemic agents, and generates a comprehensive procurement plan. The digital twin preventive scheduling module constructs a pharmacy digital twin in virtual space based on equipment health index and remaining service life prediction. Combined with the predicted prescription task volume, it plans equipment maintenance windows and production task scheduling through time-space optimization algorithms. The collaborative scheduling engine interfaces with the execution devices of various subsystems. The shared logistics network consists of a first mobile robot cluster and a second mobile robot cluster. The collaborative scheduling engine dynamically allocates robots to perform tasks such as transporting Western medicine or moving Chinese medicine decoction pots based on the urgency of prescriptions and the real-time load rate of equipment.
2. The pharmacy intelligent production and operation system according to claim 1, characterized in that, The equipment dynamic monitoring and fault early warning subsystem collects data through vibration, temperature, and current sensors, extracts spectral and temperature rise characteristics through edge computing, inputs this data into a long short-term memory network model, outputs an equipment health index, and generates maintenance early warning information when the index falls below a maintenance threshold, including: Vibration sensors collect time-domain vibration waveforms of key components of each device at a preset sampling frequency; temperature sensors collect time-series data of motor and bearing surface temperatures; and current sensors collect three-phase current waveforms of the drive motor. The time-domain vibration waveforms, time-series data of motor and bearing surface temperatures, and three-phase current waveforms of the drive motor are transmitted via industrial Ethernet to edge computing nodes deployed on the device itself. Edge computing nodes perform fast Fourier transform on the time-domain vibration waveform to convert the time-domain signal to the frequency domain and generate a frequency-domain energy distribution vector. The ratio of energy proportion in the normal operating frequency band and the fault characteristic frequency band is extracted from the frequency-domain energy distribution vector as the vibration spectrum feature. The energy proportion ratio characterizes the degree of mechanical degradation of the rotating and transmission components of the equipment. Edge computing nodes perform differential operations on temperature time-series data to calculate the rate of temperature change per unit time and generate a temperature rise rate feature, which characterizes the real-time changing trend of the device's thermal load status and the efficiency of the heat dissipation system. Edge computing nodes perform harmonic analysis on the three-phase current waveform, extract the fundamental amplitude and the amplitude of each harmonic through Fourier series decomposition, calculate the total harmonic distortion rate and the proportion of specific harmonics, and generate current harmonic distortion rate characteristics. The current harmonic distortion rate characteristics characterize the degree of degradation of the motor winding insulation state and the balance of the drive load. Vibration spectrum features, temperature rise rate features, and current harmonic distortion rate features are concatenated into a multidimensional feature vector. The multidimensional feature vector carries degradation information in three dimensions: mechanical state, thermal state, and electrical state. This vector is then input into the long short-term memory network model. The Long Short-Term Memory Network model is based on historical health degradation patterns and current multidimensional feature vectors. It learns the weight contribution of each dimension feature at different degradation stages through a gating mechanism and outputs the health index of each device in the next preset period. The health index represents the current operating status and potential degradation degree of the device in a percentage system. The health index is compared with a preset maintenance threshold. When the health index is lower than the preset maintenance threshold, the equipment dynamic monitoring and fault early warning subsystem generates maintenance early warning information. The maintenance early warning information includes equipment identification, current health index, fault mode classification and suggested maintenance time window.
3. The pharmacy intelligent production and operation system according to claim 2, characterized in that, The Long Short-Term Memory (LSTM) network model, based on historical health degradation patterns and current multidimensional feature vectors, learns the weight contributions of each feature dimension at different degradation stages through a gating mechanism. It outputs the health index of each device in the next preset period, including: The long short-term memory network model receives a multi-dimensional feature vector composed of vibration spectrum features, temperature rise rate features and current harmonic distortion rate features. The multi-dimensional feature vector forms a time series input with a preset time step. The forget gate inside the Long Short-Term Memory network model calculates the forget gate activation value based on the multidimensional feature vector of the current time step and the hidden state of the previous time step. The forget gate activation value determines which degradation information in the cell state of the previous time step needs to be retained. Among them, the mechanical degradation information corresponding to the vibration spectrum feature is retained at a higher proportion than the electrical degradation information corresponding to the current harmonic distortion rate feature in the early stage of equipment operation. The electrical degradation information corresponding to the current harmonic distortion rate feature is retained at a gradually increasing proportion in the later stage of equipment operation. The input gate inside the Long Short-Term Memory Network model calculates the input gate activation value and candidate cell state based on the multidimensional feature vector of the current time step and the hidden state of the previous time step. The input gate activation value determines which degradation information in the multidimensional feature vector of the current time step needs to be written into the cell state. The candidate cell state includes the mechanical state degradation increment, thermal state degradation increment and electrical state degradation increment extracted in the current time step. The Long Short-Term Memory Network model weights and sums the cell state of the previous time step after the forget gate and the candidate cell state after the input gate to generate the updated cell state of the current time step. While updating the cell state, it accumulates the historical degradation trajectory and current degradation increment of the three dimensions of mechanical state, thermal state and electrical state. The output gate inside the Long Short-Term Memory network model calculates the output gate activation value based on the multidimensional feature vector of the current time step and the updated cell state. The output gate activation value determines which degenerate information in the updated cell state needs to be output to the hidden state of the current time step. The Long Short-Term Memory network model updates the cell state, compresses it using a nonlinear activation function, and then multiplies it element-wise with the output gate activation value to generate the hidden state at the current time step. The hidden state carries the three-dimensional degradation features fused at the current time step. The Long Short-Term Memory (LSTM) network model inputs the hidden state of the last time step into the fully connected layer. The fully connected layer maps the hidden state into a percentage value through linear transformation and nonlinear activation function, and outputs the health index of each device in the next preset period.
4. The pharmacy intelligent production and operation system according to claim 1, characterized in that, The procurement decision support subsystem acquires unified data assets. Built upon a large language model and multi-agent architecture, it includes inventory agents, equipment agents, supplier agents, and seasonal epidemic agents to generate a comprehensive procurement plan, including: The inventory intelligence agent obtains the real-time inventory level and historical consumption rate of each drug from the data governance platform, calculates the number of days the current inventory can last based on the preset safety stock model, and generates an inventory status vector. The inventory status vector includes the inventory level, consumption trend and stockout risk level of each drug. The equipment intelligence agent obtains the health index and remaining service life prediction of each piece of equipment from the data governance platform. Based on the list of equipment with a health index below the maintenance threshold, it extracts the drug processing list associated with each piece of equipment and generates the equipment capacity constraint vector. The equipment capacity constraint vector includes the expected reduction in production quantity and reduction time window of each associated drug due to potential equipment failure. The supplier intelligence agent obtains the delivery cycle, historical on-time performance rate and current inventory availability of each drug supplier from the data governance platform, and generates a supplier capability vector. The supplier capability vector includes the reliability score and emergency order response capability of each supplier. The seasonal epidemic intelligence agent obtains hospital outpatient volume trends and regional epidemiological monitoring data from the data governance platform. It identifies seasonal drug demand fluctuations within a preset period through a time series analysis model and generates an epidemic impact vector. The epidemic impact vector includes the expected change in demand for each drug due to the epidemic trend. The inventory status vector, equipment capacity constraint vector, supplier capability vector, and epidemic impact vector are input into a multi-agent negotiation framework based on a large language model. The multi-agent negotiation framework is based on a preset negotiation round. In each round of negotiation, each agent proposes replenishment needs and constraints based on its own vector information. The large language model performs semantic understanding and conflict resolution on the needs and constraints of each agent, and generates a compromise solution acceptable to each agent. A comprehensive procurement plan is generated based on the compromise solution. The comprehensive procurement plan includes the replenishment quantity of each drug, the emergency procurement indicator, the recommended supplier list and the expected delivery time window. The emergency procurement indicator is determined jointly based on the production reduction time window in the equipment capacity constraint vector and the demand change magnitude in the epidemic impact vector.
5. The pharmacy intelligent production and operation system according to claim 4, characterized in that, The inventory status vector, equipment capacity constraint vector, supplier capability vector, and epidemic impact vector are input into a multi-agent negotiation framework based on a large language model. The multi-agent negotiation framework operates on a pre-defined negotiation cycle. In each round, each agent proposes replenishment needs and constraints based on its own vector information. The large language model performs semantic understanding and conflict resolution on the needs and constraints of each agent, generating a compromise solution acceptable to all agents, including: The multi-agent negotiation framework initiates the first round of negotiation. The inventory agent generates the first round of replenishment request proposals based on the list of drugs with a stockout risk level higher than a preset threshold in the inventory state vector. The first round of replenishment request proposals includes the expected replenishment quantity and expected arrival time for each drug. The equipment agent receives the first round of replenishment request proposals and generates the first round of capacity constraint feedback based on the production reduction time window and production reduction quantity in the equipment capacity constraint vector. The first round of capacity constraint feedback includes the upper limit of the replenishment quantity that cannot be met due to potential equipment failure and the suggested adjustment of the delivery time window. The supplier agent receives the first round of replenishment request proposals and the first round of capacity constraint feedback. Based on the reliability score and emergency order response capability of each supplier in the supplier capability vector, it generates the first round of supply capability feedback, which includes the maximum replenishment quantity and the shortest delivery cycle that each supplier can provide. The seasonal epidemic agent receives the first round of replenishment demand proposals and generates the first round of demand adjustment suggestions based on the expected change in demand in the epidemic impact vector. The first round of demand adjustment suggestions includes the replenishment quantity that needs to be increased due to the epidemic trend and a list of medicines that are recommended to be replenished first. The large language model receives the first round of replenishment demand proposals, the first round of capacity constraint feedback, the first round of supply capacity feedback, and the first round of demand adjustment suggestions. It performs semantic understanding of the needs and constraints of each agent and identifies the conflict points between the agents. The conflict points include quantity conflicts between the expected replenishment quantity of the inventory agent and the upper limit of the replenishment quantity in the equipment capacity constraint feedback, and time conflicts between the expected delivery time of the inventory agent and the shortest delivery cycle in the supplier capacity feedback. The large language model prioritizes each conflict point and generates a first-round compromise solution. The first-round compromise solution includes the adjusted replenishment quantity of each drug, the adjusted delivery time window, and the recommended supplier. The first-round compromise solution is then fed back to each agent. Each agent receives the first round of compromise solutions and judges whether the compromise solution is acceptable based on its own vector information. When the inventory agent judges that the adjusted replenishment quantity in the compromise solution is lower than the minimum safety stock corresponding to the stockout risk level, the inventory agent generates a second round of replenishment demand proposal. The second round of replenishment demand proposal includes a list of drugs that need to be further increased in replenishment quantity and the increase amount. The multi-agent negotiation framework repeats the above negotiation process with a preset number of negotiation rounds as the upper limit, until all agents accept the current compromise solution or the preset number of negotiation rounds is reached. The compromise solution generated in the last round is taken as the final compromise solution that is acceptable to all agents and is output.
6. The pharmacy intelligent production and operation system according to claim 4, characterized in that, The operating system also includes: When the device agent detects that the health index is lower than the maintenance threshold, it sends a capacity constraint signal to the procurement auxiliary decision-making subsystem. The capacity constraint signal carries the device identifier and the associated drug type. The inventory agent calculates the types and quantities of production cuts based on capacity constraint signals, increases the safety stock threshold and increases preventative replenishment, and then adjusts back to the safety stock threshold once the health status recovers.
7. The pharmacy intelligent production and operation system according to claim 6, characterized in that, The inventory agent calculates the types and quantities of production cuts based on capacity constraint signals, raises the safety stock threshold, and increases preventative replenishment. Once the health status recovers, the safety stock threshold is adjusted back, including: The inventory agent receives a capacity constraint signal, which includes equipment identification, associated drug type, expected failure time window and failure mode classification. The inventory agent obtains all prescription records processed by the equipment corresponding to the equipment identification in the historical preset period from the data governance platform, and extracts the average daily consumption and consumption rate fluctuation variance of each associated drug from the prescription records. The inventory agent calculates the number of days of equipment downtime based on the start and end times of the expected failure time window and the duration of maintenance required. It then multiplies the average daily consumption of each related drug by the number of days of equipment downtime to generate the basic reduction quantity of each related drug. The inventory agent categorizes failure modes, queries the consumption rate fluctuation compensation coefficient corresponding to the failure mode from the preset failure impact coefficient table, multiplies the basic production reduction quantity with the consumption rate fluctuation compensation coefficient, and generates the preventive replenishment quantity for each related drug. The inventory agent obtains the current safety stock threshold of each related drug from the data governance platform, adds the current safety stock threshold to the preventive replenishment quantity, generates the adjusted safety stock threshold, and writes the adjusted safety stock threshold into the inventory parameter table of the data governance platform. The inventory agent generates a preventative replenishment quantity based on the difference between the adjusted safety stock threshold and the current inventory level. The preventative replenishment quantity is equal to the difference between the adjusted safety stock threshold and the current inventory level. When the difference is positive, the procurement auxiliary decision-making subsystem is triggered to add the preventative replenishment quantity to the comprehensive procurement plan. The inventory agent continuously monitors the health index corresponding to the device identifier output by the device dynamic monitoring and fault early warning subsystem. When the health index rises above the preset recovery threshold and remains stable for a preset duration, the inventory agent determines that the device health has recovered. After determining that the health of the equipment has recovered, the inventory agent obtains the original safety stock threshold of the associated drug from the data governance platform, restores the adjusted safety stock threshold to the original safety stock threshold, and writes the callback safety stock threshold into the inventory parameter table of the data governance platform. At the same time, it sends a safety stock callback signal to the procurement auxiliary decision-making subsystem. The procurement auxiliary decision-making subsystem reassesses whether it is necessary to reduce the replenishment quantity in the subsequent procurement plan based on the callback safety stock threshold.
8. The intelligent pharmacy production and operation system according to claim 1, characterized in that, The digital twin preventative scheduling module constructs a digital twin of the pharmacy in virtual space based on equipment health index and remaining service life prediction. Combining this with predicted prescription volumes, it uses a time-space optimization algorithm to plan equipment maintenance windows and production task scheduling, including: The digital twin preventive scheduling module obtains the health index and remaining service life prediction of each piece of equipment from the equipment dynamic monitoring and fault early warning subsystem, extracts the distribution pattern of prescription volume in each time period from historical prescription data, and generates the predicted amount of prescription tasks in the future preset period through the time series prediction model. The predicted amount of prescription tasks includes the predicted values of Western medicine prescription volume and traditional Chinese medicine prescription volume in each time period. The digital twin preventive scheduling module constructs a digital twin of the pharmacy in virtual space. The digital twin includes a three-dimensional geometric model and a physical behavior model of an automated three-dimensional warehouse for Western medicine, an intelligent dispensing station, a traditional Chinese medicine decoction unit, a logistics channel, and a mobile robot. The digital twin keeps its movement synchronized with the real equipment through real-time data streams. The digital twin preventive scheduling module identifies candidate devices whose health index will fall below the maintenance threshold within a preset prediction period based on the remaining service life prediction, and generates a candidate device list. The candidate device list includes the device identifier of each candidate device, the expected time to reach the maintenance threshold, and the maintenance duration. The digital twin preventive scheduling module inputs the candidate equipment list and the predicted prescription task volume into the time-space optimization algorithm. The time-space optimization algorithm takes minimizing the time overlap between the maintenance window and the peak prescription period as the first optimization objective and minimizing the space occupation of the logistics channel by the maintenance path as the second optimization objective. Monte Carlo simulation is performed in the digital twin to evaluate the feasibility of multiple candidate maintenance windows and output the optimal maintenance plan. The optimal maintenance plan includes the start and end times of the maintenance window for each candidate equipment, the maintenance path planning, and the production task migration plan during the maintenance period. The production task migration plan specifies that the production tasks involving the maintenance equipment will be transferred to the standby equipment or adjusted to other time periods outside the maintenance window. The digital twin preventive scheduling module issues the optimal maintenance plan to the collaborative scheduling engine in the form of task instructions and maps the execution status in real time in the digital twin. When deviation occurs during execution, the plan is dynamically adjusted.
9. The intelligent pharmacy production and operation system according to claim 8, characterized in that, The digital twin preventative scheduling module inputs the candidate equipment list and the predicted prescription task volume into a time-space optimization algorithm. The algorithm's primary optimization objective is to minimize the time overlap between the maintenance window and peak prescription periods, and its secondary objective is to minimize the space occupancy of the maintenance path on the logistics channel. Monte Carlo simulations are performed within the digital twin to evaluate the feasibility of multiple candidate maintenance windows and output the optimal maintenance plan, including: The time-space optimization algorithm extracts the expected time when each candidate device will reach the maintenance threshold and the maintenance duration from the candidate device list, extracts the prescription volume prediction value for each time period from the prescription task prediction volume, and marks the time period when the prescription volume prediction value is higher than the preset peak threshold as the prescription peak period. The time-space optimization algorithm takes the expected time when each candidate device reaches the maintenance threshold as the center, and expands a preset time range forward and backward to generate multiple candidate maintenance windows. Each candidate maintenance window includes the maintenance start time and the maintenance end time. The time-space optimization algorithm calculates the time intersection length between each candidate maintenance window and all prescription peak periods, and uses the time intersection length as the evaluation value of the first optimization objective. The smaller the time intersection length, the smaller the time overlap between the maintenance window and the prescription peak period. The time-space optimization algorithm plans a maintenance path from the maintenance start point to the maintenance end point for each candidate maintenance window based on the three-dimensional geometric model of each candidate device in the digital twin and the topology of the logistics channel. The maintenance path consists of a series of logistics channel node coordinates. The time-space optimization algorithm calculates the number of logistics channel nodes occupied by each maintenance path and the occupation time. The product of the number of occupied nodes and the occupation time is used as the evaluation value of the second optimization objective. The smaller the product, the smaller the space occupation of the logistics channel by the maintenance path. The time-space optimization algorithm weights and sums the evaluation values of the first optimization objective and the second optimization objective to generate a comprehensive evaluation value for each candidate maintenance window, where the weight of the first optimization objective is higher than the weight of the second optimization objective. The time-space optimization algorithm performs Monte Carlo simulations on a preset number of candidate maintenance windows with the highest comprehensive evaluation values in the digital twin. The Monte Carlo simulation is capped at a preset number of simulations. In each simulation, the predicted amount of prescription tasks and the maintenance time are randomly perturbed. The actual time overlap between the maintenance window and the peak prescription period and the actual space occupation of the maintenance path on the logistics channel are recorded in each simulation. The time-space optimization algorithm calculates the mean and variance of time overlap and space occupancy in the Monte Carlo simulation results, selects the candidate maintenance window with the smallest mean and the lowest variance as the optimal maintenance window, and outputs the maintenance path plan corresponding to the optimal maintenance window, which is the final optimal maintenance scheme.
10. The intelligent pharmacy production and operation system according to claim 1, characterized in that, The shared logistics network consists of a first mobile robot cluster and a second mobile robot cluster. A collaborative scheduling engine dynamically allocates robots to perform tasks such as transporting Western medicine or moving traditional Chinese medicine decoction containers based on the urgency of prescriptions and the real-time load rate of equipment. The collaborative scheduling engine obtains the urgency level tags of each prescription from the data governance platform. The urgency level tags are calculated based on the time difference between the prescription generation time and the patient's expected medication pickup time. At the same time, it obtains the real-time load rate of each workstation in the Western medicine intelligent supply subsystem and the traditional Chinese medicine decoction subsystem. The real-time load rate is calculated based on the ratio of the number of currently queued tasks to the processing capacity of each workstation. The collaborative scheduling engine obtains the current position coordinates and idle status indicators of each robot from the first mobile robot cluster and the second mobile robot cluster. The idle status indicator indicates whether the robot is in standby state, executing a task state or charging state. The collaborative scheduling engine inputs prescription urgency labels, real-time workstation load rates, and robot idle status indicators into the task allocation algorithm. The task allocation algorithm aims to minimize the weighted waiting time of all prescriptions. The weighting is dynamically adjusted based on the urgency labels. The algorithm outputs a task allocation scheme for each robot, which includes the starting workstation, ending workstation, task type, and estimated execution time for each robot's next task. The task allocation algorithm determines whether a task is a Western medicine transportation task or a traditional Chinese medicine decoction barrel handling task based on the task type and drug form characteristics parameters. When the number of Western medicine prescriptions is low, resulting in idle robots in the first mobile robot cluster, the task allocation algorithm will allocate the idle robots to the traditional Chinese medicine decoction side to perform the traditional Chinese medicine decoction barrel handling task. When the number of prescriptions on the traditional Chinese medicine decoction side is low, resulting in idle robots in the second mobile robot cluster, the task allocation algorithm will allocate the idle robots to the Western medicine side to perform the Western medicine transportation task. The collaborative scheduling engine issues task allocation plans to each robot in the form of path planning instructions. Each robot executes tasks according to the planned path in the shared logistics network. The ground logistics loop and vertical lifting mechanism in the shared logistics network are shared by the first mobile robot cluster and the second mobile robot cluster. The collaborative scheduling engine dynamically adjusts the path planning according to the real-time position of each robot to avoid congestion in the logistics channel.
