An intelligent regulation method and system for a modular pharmaceutical security system
By combining fuzzy PID control and a load forecasting model with an improved traveling salesman problem model, environmental control and drug retrieval routes are dynamically adjusted, solving the problems of environmental rigidity and insufficient emergency response capabilities in the drug supply system. This achieves efficient and safe drug supply and is suitable for complex scenarios.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- FOURTH MILITARY MEDICAL UNIVERSITY
- Filing Date
- 2026-03-20
- Publication Date
- 2026-07-03
AI Technical Summary
The existing drug supply system suffers from rigid environmental controls, low efficiency in dispensing multiple drugs, and weak emergency response capabilities, making it difficult to adapt to stable operation and efficient collaborative work in complex and demanding scenarios.
The system employs a fuzzy PID control algorithm and a load prediction model to dynamically adjust environmental control, combines an improved traveling salesman problem model for drug retrieval route planning, and switches to battery power mode when the main power supply is interrupted, implementing a multimodal emergency coordination strategy.
It achieves high-precision and high-efficiency environmental control, improves the overall efficiency and safety of drug dispensing operations, enhances the system's robustness and emergency survivability, and provides good scalability and adaptability, making it suitable for complex and uncertain scenarios.
Smart Images

Figure CN122337538A_ABST
Abstract
Description
Technical Field
[0001] This application belongs to the field of intelligent control and Internet of Things technology, and specifically relates to an intelligent control method and system for a modular drug supply system. Background Technology
[0002] With the development of automated pharmacies, intelligent drug vending machines, and other equipment, the level of intelligence in drug management is gradually improving. Existing technologies typically focus on automatic prescription recognition, mechanical drug grabbing and dispensing, or simple inventory management through sensors. However, the control logic of these systems has significant limitations.
[0003] On the one hand, the environmental control strategies of existing systems are relatively rigid, mostly employing on / off control with preset thresholds. This lacks comprehensive consideration of dynamic changes in the internal and external environment, differences in heat load between modules, and energy efficiency, making it difficult to maintain long-term stability and uniformity of the internal microenvironment under complex external disturbances. On the other hand, when executing multiple drug prescriptions, drug retrieval path planning typically uses simple sequential or fixed strategies, failing to fully consider the dynamic performance of the robotic arm, the real-time distribution of drug locations, and the physical characteristics of the drugs themselves. This results in an inability to achieve an optimal balance between retrieval efficiency, equipment lifespan, and drug safety. Furthermore, for modular and scalable drug supply systems, existing technologies lack control algorithms capable of dynamically sensing system topology changes, intelligently allocating global resources, and achieving efficient collaborative operations, limiting the overall energy efficiency and deployment flexibility of the system. Simultaneously, existing systems generally suffer from large size, low module integration, and inconvenience in portability, making them unsuitable for complex mobile scenarios such as battlefields. Moreover, they lack specific designs for the storage stability and retrieval protection of unpackaged drugs, hindering their effectiveness in combat rescue and field emergency response scenarios.
[0004] A more prominent problem is that existing systems heavily rely on a continuous mains power supply and a centralized controller. In the event of power outages or network interruptions, the system is highly susceptible to paralysis or can only provide extremely limited basic functions. It lacks the intelligent emergency coordination capabilities to autonomously degrade operation and prioritize the supply of core medicines in an edge computing mode. Furthermore, for modular and scalable drug supply systems, existing technologies lack control algorithms capable of dynamically sensing system topology changes, intelligently allocating global resources, and achieving efficient collaborative operations, thus limiting the overall energy efficiency and deployment flexibility of the system.
[0005] Therefore, there is an urgent need for a highly intelligent, modular, and portable control method and system that can provide modular drug supply systems with adaptive and precise environmental control, efficient drug retrieval route planning, and robust multimodal emergency coordination capabilities. This system should be adapted to the storage and retrieval needs of unpackaged drugs, thereby ensuring safe, reliable, and efficient operation in various complex and demanding battlefield scenarios, including the field, disaster areas, and battlefields, where frequent relocation is required. Summary of the Invention
[0006] The purpose of this application is to provide an intelligent control method and system for a modular drug supply system. This addresses the problems mentioned in the background section regarding the rigid environmental control, low efficiency in dispensing multiple drugs, and weak emergency response capabilities of existing drug supply systems.
[0007] To achieve the above objectives, this application adopts the following technical solution: In a first aspect, an intelligent control method for a modular drug supply system is provided, the system comprising a system control cabin and at least one detachably connected modular functional drug compartment, the method being executed by a controller in the system control cabin, comprising: The system collects internal environmental parameters, working status of each modular functional drug compartment, and external environmental data in real time. Based on fuzzy PID control algorithm and load prediction model, it dynamically adjusts the operation strategy of the environmental control unit to maintain the set target range of the internal microenvironment of the system. When a prescription instruction containing multiple types of drugs is received, the real-time coordinates of each target drug in the high-density drug dish matrix in the corresponding modular functional drug warehouse are obtained. Based on the improved traveling salesman problem model, the dynamic constraints of the robotic arm and the weights of drug attributes are integrated to generate the drug retrieval path sequence with the best time or the best energy consumption in real time. The system continuously monitors the power status and network connection status; when a main power interruption is detected, it automatically switches to battery power mode and triggers an emergency control strategy. The emergency control strategy includes at least dynamically reducing the environmental protection area according to drug priority and authorizing the modular functional drug warehouse to enter the local emergency operation mode.
[0008] In one possible implementation, the construction of the load forecasting model in the environmental adaptive regulation step includes: Based on historical data, the system learns the correlation between internal temperature / humidity changes and external environmental temperature / humidity, the frequency of drug dispensing operations in each modular functional drug compartment, and the working status of the environmental control unit. Using the aforementioned correlations, the internal environmental load in the near future can be predicted; The operating strategy of the dynamically adjusted environmental control unit includes: adjusting the power of the semiconductor refrigeration chip or the start-stop cycle of the molecular sieve dehumidifier in advance based on the prediction results to achieve proactive control.
[0009] In one possible implementation, the optimization objective function F of the improved traveling salesman problem model is as follows: F=Minimize(α*T_total+β*P_direction+γ*W_fragility) in: α, β, and γ are adjustable weighting coefficients used to balance different optimization objectives; T_total is the total movement time, and its value is calculated based on the velocity-acceleration curve of the robotic arm moving between the coordinate points of each target drug. P_direction is a direction switching penalty term used to quantify and suppress frequent start-stop and turning actions in the robotic arm's motion trajectory. Its calculation is based on the change in the direction angle of adjacent line segments in the path. W_fragility is a weighted term for drug fragility. It weights relevant path segments based on the attribute weights of drugs in the prescription. For fragile drugs that need to be handled with care, the weight value of the corresponding path segment is increased to guide the algorithm to plan a lower speed or a smoother movement trajectory for that path segment.
[0010] In one possible implementation, the dynamic reduction of the environmental protection area based on drug priority includes: Obtain the priority tags of the medicines stored in each modular functional pharmacy; In battery-powered mode, based on the remaining power and estimated battery life, the environmental control supply to the modular functional pharmacy storing low-priority drugs is gradually shut down, concentrating energy to ensure the stability of the microenvironment in the area where high-priority drugs are located.
[0011] In one possible implementation, the method further includes: When a new modular functional drug storage unit is detected to be connected or an existing drug storage unit is removed, the system bus is automatically scanned and the system module topology is updated. Based on the updated topology and the processor load of each module, the tasks of environmental data acquisition, local sterilization control, and inventory calculation are dynamically redistributed to achieve load balancing.
[0012] In one possible implementation, the method further includes: During network outages, all operation logs, environmental data, and prescription execution records are recorded to a local cache. When the network connection is restored, the cached data is automatically synchronized bidirectionally with the cloud server, and the local drug information database and control algorithm parameters are updated.
[0013] Secondly, an intelligent control system for a modular drug supply system is provided, for implementing the intelligent control method described in any one of the first aspects, wherein the system is integrated within the system control cabin, comprising: The data sensing module is used to collect the environmental parameter set, working status, external environmental data and prescription instructions in real time; The core control module includes: An environmental control unit is configured to execute the environmental adaptive control steps. The path planning unit is configured to execute the dynamic planning steps for the drug retrieval path. The emergency management unit is configured to execute the aforementioned multimodal emergency coordination steps; The instruction execution module is used to convert the control strategy generated by the core control module into specific drive instructions and send them to the environmental control unit, the prescription processing module and the modular functional drug storage.
[0014] In one possible implementation, the data sensing module includes: Temperature sensors, humidity sensors, and pressure sensors deployed inside and outside the system; Status sensors deployed at the access control points of each modular functional pharmacy warehouse; The instruction interface for communicating with the prescription processing module; The power management unit provides a power status monitoring interface.
[0015] In one possible implementation, the core control module further includes a learning optimization unit, which is configured as follows: Continuously collect system operation data, including actual environmental control effectiveness, drug dispensing task completion time and energy consumption, and emergency event handling results; The parameters of the fuzzy PID control algorithm, the weight coefficients in the improved traveling salesman problem model, and the emergency control strategy are iteratively optimized using reinforcement learning algorithms.
[0016] Thirdly, a computer-readable storage medium is provided having a computer program stored thereon, which, when executed by a processor, implements the intelligent control method described in the first aspect.
[0017] Compared with the prior art, this application has the following beneficial effects: This application provides an intelligent control method and system for a modular drug supply system, which achieves high-precision and high-energy-efficiency environmental control: by integrating fuzzy PID algorithm and load prediction model, it realizes forward-looking and adaptive adjustment of environmental control unit, effectively resists external environmental disturbances and internal heat load changes, and significantly reduces system energy consumption while ensuring a highly stable drug storage environment.
[0018] One possible implementation improves the overall efficiency and safety of drug retrieval operations: by introducing an improved TSP model that integrates robotic arm dynamics and drug properties for path planning, not only is the total time for retrieving multiple drugs shortened, but also the ineffective movements and sudden stops and turns of the robotic arm are reduced, equipment wear is decreased, and drug safety is ensured by planning smooth paths for fragile drugs.
[0019] One possible implementation enhances the system's robustness and emergency survivability: an innovative multimodal emergency coordination mechanism enables the system to intelligently switch to battery mode in the event of a main power failure, and dynamically adjusts resource allocation based on drug priority to ensure that core drugs receive the longest possible protection under limited energy. Simultaneously, authorizing modular pharmacy units to enter local mode ensures the possibility of manual drug retrieval in the worst-case scenario, significantly improving system reliability.
[0020] One possible implementation endows the system with good scalability and adaptability: the module topology self-discovery and task allocation functions enable the system to expand or shrink modules "plug and play" and automatically rebalance the computational load. An offline synchronization mechanism ensures data integrity. A learning optimization unit allows the system to continuously self-optimize as it runs, and its intelligence level continues to evolve.
[0021] In one possible implementation, a complete perception-decision-execution-learning closed loop is constructed: the method and the system constitute a complete intelligent control closed loop, which transforms the modular drug supply system from a passive execution device into an intelligent life form that can actively adapt to the environment, optimize operations, and cope with failures. It is particularly suitable for complex and uncertain scenarios such as field operations and disaster relief. Attached Figure Description
[0022] Figure 1 A flowchart of an intelligent control method for a modular drug supply system provided in this application. Detailed Implementation
[0023] In the following description, only certain exemplary embodiments are briefly described. As those skilled in the art will recognize, the described embodiments can be modified in various ways without departing from the spirit or scope. Therefore, the drawings and description are considered to be exemplary in nature and not restrictive.
[0024] In the description of this application, it should be understood that the terms "center", "longitudinal", "lateral", "length", "width", "thickness", "upper", "lower", "front", "rear", "left", "right", "vertical", "horizontal", "top", "bottom", "inner", "outer", "clockwise", "counterclockwise", "axial", "radial", "circumferential", etc., indicating the orientation or positional relationship based on the orientation or positional relationship shown in the accompanying drawings, are only for the convenience of describing this application and simplifying the description, and do not indicate or imply that the device or element referred to must have a specific orientation, or be constructed and operated in a specific orientation, and therefore should not be construed as a limitation of this application.
[0025] Furthermore, the terms "first" and "second" are used for descriptive purposes only and should not be construed as indicating or implying relative importance or implicitly specifying the number of technical features indicated. Thus, a feature defined as "first" or "second" may explicitly or implicitly include one or more of that feature. In the description of this application, "a plurality of" means two or more, unless otherwise explicitly defined. The specific embodiments of this application will be further described in detail below with reference to the accompanying drawings.
[0026] In this application, unless otherwise expressly specified and limited, the terms "installation," "connection," "linking," and "fixing," etc., should be interpreted broadly. For example, they can refer to a fixed connection, a detachable connection, or an integral part; they can refer to a mechanical connection, an electrical connection, or a communication connection; they can refer to a direct connection or an indirect connection through an intermediate medium; they can refer to the internal communication of two components or the interaction between two components. Those skilled in the art can understand the specific meaning of the above terms in this application according to the specific circumstances.
[0027] In this application, unless otherwise expressly specified and limited, "above" or "below" the second feature can include direct contact between the first and second features, or contact between the first and second features through another feature between them. Furthermore, "above," "over," and "on top" of the second feature includes the first feature being directly above or diagonally above the second feature, or simply indicates that the first feature is at a higher horizontal level than the second feature. "Below," "below," and "under" the second feature includes the first feature being directly above or diagonally above the second feature, or simply indicates that the first feature is at a lower horizontal level than the second feature.
[0028] The technical solutions of the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of this application, and not all embodiments. Based on the embodiments of this application, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of this application.
[0029] like Figure 1 As shown This embodiment uses a modular medicine supply system for a mobile field medical vehicle as an application scenario. The system includes one system control cabin and three detachable modular functional medicine compartments, numbered A, B, and C, and is suitable for medicine supply at disaster relief sites. The system hardware configuration is as follows: System control compartment: It adopts an NXPi.MX6ULL processor with a main frequency of 1GHz, built-in 2GB DDR3 memory and 32GB eMMC flash memory, and integrates fuzzy PID control algorithm, LSTM load prediction model and improved ant colony algorithm solver; Data sensing modules: DS18B20 temperature sensor, measurement range -20℃~60℃, accuracy ±0.1℃; SHT30 humidity sensor, measurement range 10%RH~90%RH, accuracy ±2%RH; door magnetic status sensor; power status monitoring module, monitoring main power supply on / off and battery SOC. Modular functional pharmacy compartments: Compartment A stores Level 1 priority medicines, including emergency medicines and vaccines; Compartment B stores Level 2 priority medicines, including commonly used prescription medicines; Compartment C stores Level 3-4 priority medicines, including chronic disease medicines and excipients. Each compartment is equipped with a high-density medicine dish matrix with coordinate range X: 1-10, Y: 1-8, mechanical / electric double doors, and an ultraviolet LED sterilization module. Prescription processing module: equipped with a SCARA robotic arm with a maximum speed of 500mm / s, a maximum acceleration of 200mm / s², a positioning accuracy of ±0.05mm, a heat sealing packaging machine, and a thermal printer; Power module: Main power supply, 220V AC + backup lithium battery, capacity 100Ah, rated voltage 24V, supports full load operation for 2 hours; Communication module: Supports 4G / 5G, WiFi and CAN bus communication, with a local cache capacity of ≥16GB in offline mode.
[0030] Example 1: System Initialization and Module Topology Self-Discovery Step 1: System power-on initialization After the system is powered on, the controller automatically loads the preset parameters: Fuzzy PID initial parameters: Kp=5.0, Ki=0.1, Kd=1.0; The weighting coefficients of the improved TSP model are: α=0.5, β=0.25, γ=0.25; LSTM load prediction model: The pre-trained dataset contains 1000 sets of historical environmental data, covering different temperature, humidity, and drug collection frequency scenarios, with a prediction window Δt=5 minutes; Drug priority labels: Level 1: Emergency drugs, vaccines; Level 2: Commonly used prescription drugs; Level 3: Chronic disease drugs; Level 4: Excipients. Vulnerability coefficients of pharmaceuticals: 0.7-0.9 for glass-bottled pharmaceuticals, 0.1-0.3 for aluminum-plastic composite pharmaceuticals, and 0.8-1.0 for liquid pharmaceuticals.
[0031] Step 2: Module Topology Self-Discovery The controller periodically scans the CAN bus at 1-second intervals, identifying three modular functional medicine compartments (A, B, and C) that are already connected. It automatically generates a system module topology diagram and stores it in local flash memory. Simultaneously, it obtains the initial operating status through the status sensors of each medicine compartment: all compartment doors are closed, the most recent medication retrieval was 30 minutes ago, and compartment A is the last compartment.
[0032] Step 3: Load balancing task allocation Based on the processor load rate of each module (35% for module A, 32% for module B, and 30% for module C), the controller dynamically allocates tasks. Warehouse A: Responsible for environmental data collection, collecting data once every 1 second + local sterilization control, sterilizing once every 2 hours; Warehouse B: Responsible for inventory counting calculations, counting once every 30 minutes, plus coordinate mapping of prescription drugs; Warehouse C: Responsible for offline data caching and local log recording.
[0033] After task allocation, the load rate difference between modules is ≤15%, achieving global load balancing.
[0034] Example 2: Environmental Adaptive Regulation Process Step 1: Data Collection The system collects the following data at a frequency of 1Hz: Internal environmental parameters: Warehouse A: Temperature 21.5℃, Humidity 46%RH; Warehouse B: Temperature 22.3℃, Humidity 48%RH; Warehouse C: Temperature 23.1℃, Humidity 50%RH; External environmental parameters: temperature 35℃, humidity 82%RH, open-air environment at the disaster relief site; Medicine storage compartment status: Compartment A door is "closed", recent medication retrieval frequency is 0.5 times / hour; Compartment B door is "closed", recent medication retrieval frequency is 0.3 times / hour. Environmental control unit status: current power of semiconductor cooling chip is 60%, and the molecular sieve dehumidifier starts and stops every 60 seconds.
[0035] Step 2: Load Forecasting The collected data is input into the LSTM load forecasting model, which outputs the environmental change trend for the next 5 minutes. Internal temperature forecast: Warehouse A to 23.2℃, Warehouse B to 23.8℃, Warehouse C to 24.5℃; Internal humidity forecast: Warehouse A to 51%RH, Warehouse B to 53%RH, Warehouse C to 55%RH.
[0036] Prediction based on: heat and moisture exchange in the external high temperature and humidity environment + temporary decrease in sealing performance caused by the drug retrieval operation in Warehouse A.
[0037] Step 3: Fuzzy PID Decision Making Set the target values for the internal microenvironment of the system as follows: temperature 20℃±0.5℃, humidity 45%RH±3%RH.
[0038] Calculate the current deviation e and the rate of change of deviation ec: Temperature deviation of warehouse A e = 1.5℃, ec = 0.3℃ / min; Humidity deviation e = 1%RH, ec = 0.2%RH / min; Fuzzy reasoning: Based on the preset rule base, such as "if e is positive and ec is positive, then ΔKp is positive", output the PID parameter correction: ΔKp=+0.6, ΔKi=+0.03, ΔKd=+0.15; Corrected PID parameters: Kp=5.6, Ki=0.13, Kd=1.15.
[0039] Step 4: Execution of control commands The controller calculates the control input based on the corrected PID parameters, generates the following instructions, and sends them to the environmental control unit via the CAN bus: Semiconductor cooling chip power: Compartment A 85%, Compartment B 80%, Compartment C 75%; Molecular sieve dehumidifier start / stop cycle: 30 seconds / cycle, all compartments; Duct fan speed: 1200rpm, to enhance air circulation.
[0040] Step 5: Verification of the regulatory effect Five minutes later, the system collected environmental parameters from each warehouse: Warehouse A: Temperature 20.3℃, Humidity 44%RH; Warehouse B: Temperature 20.5℃, Humidity 46%RH; Warehouse C: Temperature 20.8℃, Humidity 47%RH; All parameters are within the target range and there is no significant oscillation. Compared with traditional switch control, the temperature fluctuation is ±1.2℃, the stability is improved by 80%, and the energy consumption is reduced by 25%.
[0041] Example 3: Dynamic Programming Process for Drug Retrieval Routes Step 1: Prescription Receipt and Parsing The prescription processing module receives the electronic prescription: "Emergency medication X, A compartment, 1 box; Prescription medication Y, B compartment, 1 box; Excipients Z, C compartment, 1 box". After parsing, it obtains the drug identifier and attributes: Drug X: Warehouse A coordinates (4, 6), vulnerability coefficient 0.8, glass vial vaccine, priority level 1; Drug Y: Warehouse B coordinates (7, 3), vulnerability coefficient 0.3, aluminum-plastic tablet, priority level 2; Drug Z: Warehouse coordinates (2, 5), vulnerability coefficient 0.1, non-woven fabric auxiliary material, priority level 4.
[0042] Step 2: Coordinate Mapping and Constraint Acquisition By using the module topology diagram and inventory database, the real-time coordinates of each medicine were confirmed to be correct, and the constraint parameters of the robotic arm were obtained. Maximum moving speed: 500 mm / s; maximum acceleration: 200 mm / s². Direction switching penalty threshold: When the steering angle is greater than 90°, the penalty coefficient is doubled.
[0043] Step 3: Improve the TSP model solution Input the robotic arm's initial coordinates (0, 0), the coordinates of each drug, the vulnerability coefficient, and the dynamic constraints into the improved ant colony algorithm solver. Set the population size to 50 and the number of iterations to 100. Optimize the objective function as follows: F=Minimize(0.5T_total+0.25P_direction+0.25*W_fragility) The optimal drug retrieval route sequence is generated after solving: (0,0) → Warehouse A (4,6) → Warehouse B (7,3) → Warehouse C (2,5) → Packaging Table (10,8) Step 4: Path Execution and Verification The robotic arm performs the drug retrieval operation according to the path sequence: When picking up medicine X, the speed on the path segment drops to 300 mm / s. Due to the high fragility coefficient, the turning angle is ≤60°, and there are no sudden stops or turns. When taking medicine Y and Z, the maximum speed should be 500 mm / s. The total drug retrieval time is 42 seconds, which is 23.6% shorter than the traditional sequential drug retrieval time (55 seconds); the number of times the robotic arm turns is 3, which is 50% less than the traditional path (6 times).
[0044] Step 5: Packaging and Reminders After the prescription medication is dispensed, the heat-sealing packaging machine automatically completes the simple packaging, the thermal printer prints the medication instructions, including the medication name, usage and dosage, and precautions, and the sound and light reminder device emits a "beep-beep" sound to remind medical staff to pick up the medication.
[0045] Example 4: Multimodal Emergency Collaboration Process Step 1: Emergency Event Trigger A power failure occurred at the rescue site, and the main power supply was interrupted. The power status monitoring module detected that the main power supply voltage dropped to 0V and immediately triggered the emergency mode, while switching to backup lithium battery power supply. The current SOC is 65%.
[0046] Step 2: Battery life estimation and priority determination Emergency management unit calculates battery life: Full-power operation life: 2 hours; After the environmental protection zone is shrunk, the subsequent flight time is 4.5 hours.
[0047] Based on the drug priority labels, the order of protection is determined as follows: Warehouse A (Level 1) > Warehouse B (Level 2) > Warehouse C (Levels 3-4).
[0048] Step 3: Shrinkage of the environmental protection area The controller sends the following instructions: Turn off the semiconductor cooling chip, dehumidifier and fan in compartment C, leaving only the ultraviolet sterilization module on, sterilizing once every 4 hours; Reduce the environmental control precision in Warehouse B: temperature 20℃±1℃, humidity 45%RH±5%RH, cooling power reduced to 50%; Maintain precise environmental control in Warehouse A: temperature 20℃±0.5℃, humidity 45%RH±3%RH, and prioritize power supply.
[0049] Step 4: Authorize Local Emergency Mode The controller sends authorization commands to all modular functional pharmacy compartments, disabling the network dependency of the electric door locks: Warehouse A and Warehouse B: Supports manual unlocking via local touchscreen, requiring an authorization password from rescue personnel; C compartment: Supports mechanical emergency unlocking via an emergency knob on the side of the compartment; The touchscreen displays an emergency message: "Main power interrupted, switched to backup battery. Core medicine environment is normal, medicine can be retrieved manually."
[0050] Step 5: Emergency Status Maintenance Two hours later, the battery SOC dropped to 30%, and the emergency management unit further reduced the coverage area. Turn off the cooling and dehumidification functions of compartment B, and maintain environmental control only in compartment A; At this time, the temperature in Warehouse A is 20.4℃ and the humidity is 44%RH, which still meets the requirements for Level 1 drug storage. The battery life is extended to 6 hours, ensuring the core needs of the rescue are met.
[0051] Example 5: Offline Data Synchronization and Learning Optimization Process Step 1: Offline Data Recording In emergency mode, if the network is interrupted, the system will activate the local caching mechanism: Operation log: Manually retrieved medicine twice, 1 box of medicine in warehouse A and 1 box of medicine in warehouse B; Record environmental data: Temperature / humidity change curve in Warehouse A, one data point every 10 seconds; Prescription execution record: 1 offline prescription, medication collection and packaging completed; Data is stored on a 32GB SD card and uses a circular buffer mechanism to ensure that critical data is not lost.
[0052] Step 2: Network Recovery and Data Synchronization After the network is restored, the system will automatically initiate bidirectional difference synchronization: Local → Cloud: Upload offline operation logs, environmental data, and prescription execution records (approximately 5MB of data). Cloud → Local: Download the updated drug information database, adding information on 2 new emergency drugs, fuzzy PID parameter optimization suggestions, and updated TSP weight coefficient values; Synchronization uses CRC32 checksum comparison, only transmits the difference data, and the synchronization time is ≤10 seconds.
[0053] Step 3: Learn to optimize execution The learning optimization unit collects system operation data from the past 7 days, including the control data from Examples 2 to 4, and uses the DQN reinforcement learning algorithm for iterative optimization: Fuzzy PID parameter optimization: Kp=5.8, Ki=0.14, Kd=1.2, resulting in an 18% reduction in environmental control deviation compared to the initial parameters; TSP weighting coefficients were optimized: α=0.55, β=0.2, γ=0.25, further improving drug retrieval efficiency by 5%; Emergency control strategy optimization: Battery SOC threshold adjusted from 30% to 25%, and B-warehouse protection time extended by 30 minutes.
[0054] Step 4: Optimization effect verification After optimization, the total dispensing time for the same prescription is reduced to 39 seconds; simulating a mains power outage, the battery life is extended to 6.5 hours, and the core drug availability rate is 100%.
[0055] Example 6: Module Expansion and Topology Update Step 1: Integrating the new module Due to increased rescue needs, a new modular functional medicine storage unit, compartment D, has been added. It stores Level 2 prescription drugs, with coordinates X: 1-10 and Y: 1-8, and is connected to the system via CAN bus.
[0056] Step 2: Topology self-discovery and update When the controller detects a new module connection, it automatically updates the system module topology, adds a D-warehouse node, and obtains its initial state.
[0057] Step 3: Task reassignment Based on the updated topology and the load rates of each module (A 32%, B 30%, C 29%, D 28%), tasks are reassigned: Warehouse D: Responsible for environmental data collection (partially transferred from Warehouse A) + inventory counting calculation (partially transferred from Warehouse B); After adjustment, the load rates of each module are: Warehouse A 29%, Warehouse B 27%, Warehouse C 29%, and Warehouse D 30%, with a load rate difference of ≤3%, achieving dynamic load balancing.
[0058] Summary of key technical parameter verification:
[0059] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of this application, and are not intended to limit them; although this application has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that modifications to the technical solutions described in the foregoing embodiments, or equivalent substitutions for some or all of the technical features, do not cause the essence of the corresponding technical solutions to deviate from the scope of the technical solutions of the embodiments of this application.
Claims
1. An intelligent control method for a modular drug supply system, characterized in that, The system includes a system control cabin and at least one detachably connected modular functional drug cartridge. The method is executed by a controller in the system control cabin and includes: The system collects internal environmental parameters, working status of each modular functional drug compartment, and external environmental data in real time. Based on fuzzy PID control algorithm and load prediction model, it dynamically adjusts the operation strategy of the environmental control unit to maintain the set target range of the internal microenvironment of the system. When a prescription instruction containing multiple types of drugs is received, the real-time coordinates of each target drug in the high-density drug dish matrix in the corresponding modular functional drug warehouse are obtained. Based on the improved traveling salesman problem model, the dynamic constraints of the robotic arm and the weights of drug attributes are integrated to generate the drug retrieval path sequence with the best time or the best energy consumption in real time. The system continuously monitors the power status and network connection status; when a main power interruption is detected, it automatically switches to battery power mode and triggers an emergency control strategy. The emergency control strategy includes at least dynamically reducing the environmental protection area according to drug priority and authorizing the modular functional drug warehouse to enter the local emergency operation mode.
2. The intelligent control method according to claim 1, characterized in that, In the environmental adaptive regulation step, the construction of the load forecasting model includes: Based on historical data, the system learns the correlation between internal temperature / humidity changes and external environmental temperature / humidity, the frequency of drug dispensing operations in each modular functional drug compartment, and the working status of the environmental control unit. Using the aforementioned correlations, the internal environmental load in the near future can be predicted; The operating strategy of the dynamically adjusted environmental control unit includes: adjusting the power of the semiconductor refrigeration chip or the start-stop cycle of the molecular sieve dehumidifier in advance based on the prediction results to achieve proactive control.
3. The intelligent control method according to claim 1, characterized in that, The optimization objective function F of the improved traveling salesman problem model is as follows: F=Minimize(α*T_total+β*P_direction+γ*W_fragility) in: α, β, and γ are adjustable weighting coefficients used to balance different optimization objectives; T_total is the total movement time, and its value is calculated based on the velocity-acceleration curve of the robotic arm moving between the coordinate points of each target drug. P_direction is a direction switching penalty term used to quantify and suppress frequent start-stop and turning actions in the robotic arm's motion trajectory. Its calculation is based on the change in the direction angle of adjacent line segments in the path. W_fragility is a weighted term for drug fragility. It weights relevant path segments based on the attribute weights of drugs in the prescription. For fragile drugs that need to be handled with care, the weight value of the corresponding path segment is increased to guide the algorithm to plan a lower speed or a smoother movement trajectory for that path segment.
4. The intelligent control method according to claim 1, characterized in that, The dynamic reduction of environmental protection areas based on drug priority includes: Obtain the priority tags of the medicines stored in each modular functional pharmacy; In battery-powered mode, based on the remaining power and estimated battery life, the environmental control supply to the modular functional pharmacy storing low-priority drugs is gradually shut down, concentrating energy to ensure the stability of the microenvironment in the area where high-priority drugs are located.
5. The intelligent control method according to claim 1, characterized in that, The method further includes: When a new modular functional drug storage unit is detected to be connected or an existing drug storage unit is removed, the system bus is automatically scanned and the system module topology is updated. Based on the updated topology and the processor load of each module, the tasks of environmental data acquisition, local sterilization control, and inventory calculation are dynamically redistributed to achieve load balancing.
6. The intelligent control method according to claim 1, characterized in that, The method further includes: During network outages, all operation logs, environmental data, and prescription execution records are recorded to a local cache. When the network connection is restored, the cached data is automatically synchronized bidirectionally with the cloud server, and the local drug information database and control algorithm parameters are updated.
7. An intelligent control system for a modular drug supply system, characterized in that, For implementing the intelligent control method according to any one of claims 1-6, the system is integrated within the system control cabin, comprising: The data sensing module is used to collect the environmental parameter set, working status, external environmental data and prescription instructions in real time; The core control module includes: An environmental control unit is configured to execute the environmental adaptive control steps. The path planning unit is configured to execute the dynamic planning steps for the drug retrieval path. The emergency management unit is configured to execute the aforementioned multimodal emergency coordination steps; The instruction execution module is used to convert the control strategy generated by the core control module into specific drive instructions and send them to the environmental control unit, the prescription processing module and the modular functional drug storage.
8. The intelligent control system according to claim 7, characterized in that, The data sensing module includes: Temperature sensors, humidity sensors, and pressure sensors deployed inside and outside the system; Status sensors deployed at the access control points of each modular functional pharmacy warehouse; The instruction interface for communicating with the prescription processing module; The power management unit provides a power status monitoring interface.
9. The intelligent control system according to claim 7, characterized in that, The core control module further includes a learning optimization unit, which is configured as follows: Continuously collect system operation data, including actual environmental control effectiveness, drug dispensing task completion time and energy consumption, and emergency event handling results; The parameters of the fuzzy PID control algorithm, the weight coefficients in the improved traveling salesman problem model, and the emergency control strategy are iteratively optimized using reinforcement learning algorithms.
10. A computer-readable storage medium having a computer program stored thereon, characterized in that, When the program is executed by the processor, it implements the intelligent control method as described in any one of claims 1 to 6.