A comprehensive collaborative management system and method for hemp medicine

By introducing a deformable magnetohydrodynamic sealing mechanism, a multi-band LED array, and an AR interface into the narcotic and psychotropic drug management system, combined with biometric recognition and data analysis algorithms, the problems of insufficient drug storage security, low operational efficiency, and inaccurate inventory management have been solved, realizing intelligent and precise drug management.

CN120895195BActive Publication Date: 2026-05-29SHENZHEN RUIYIBO MEDICAL EQUIP CO LTD

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
SHENZHEN RUIYIBO MEDICAL EQUIP CO LTD
Filing Date
2025-09-09
Publication Date
2026-05-29

AI Technical Summary

Technical Problem

The existing narcotic and psychotropic drug management system has problems such as insufficient drug storage security, low operational efficiency, insufficient analysis of collaborative drug use patterns, inaccurate inventory management, and lack of intelligent management of drug retrieval process, resulting in insufficient safety, efficiency and accuracy of drug management.

Method used

It employs a deformable magnetofluid sealing mechanism, a multi-band LED array, and an AR interface combined with biometric recognition. It achieves dynamic locking by controlling the shape change of the magnetofluid through electromagnetic signals, provides guidance for drug retrieval, and combines tensor decomposition algorithm and temporal convolutional network to predict drug consumption trends, generate the optimal replenishment plan, and achieve real-time interaction through shared drug state tensors.

Benefits of technology

It improved the safety and efficiency of drug storage, ensured the accuracy and safety of drug dispensing, optimized inventory management, identified collaborative drug use patterns between departments, and enhanced the intelligence and precision of drug management.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120895195B_ABST
    Figure CN120895195B_ABST
Patent Text Reader

Abstract

The application belongs to the technical field of medical management, and discloses a comprehensive and collaborative management system and method for narcotic and psychotropic drugs, which comprises a safe storage monitoring unit, a drug taking operation unit and a drug data insight unit. The safe storage monitoring unit is used for deploying a deformable magnetic fluid sealing mechanism on the upper part of a narcotic and psychotropic drug box, and controlling the shape change of the magnetic fluid through an electromagnetic signal. When an unauthorized opening behavior is monitored, the topological structure is triggered to deform and automatically lock the drug box. The drug taking operation unit is used for providing a drug taking path guide through the AR interface of the drug box, and combining a multi-frequency LED array to indicate the target drug storage bin for drug taking. The drug data insight unit is used for collecting narcotic and psychotropic drug consumption data and narcotic and psychotropic drug prescription data from the information storage terminal of the drug storage bin, and constructing a narcotic and psychotropic drug consumption atlas through the narcotic and psychotropic drug consumption data. In the process of drug management, omnidirectional safety protection, intelligent operation, accurate analysis and optimization are realized, and the management efficiency, accuracy, safety and intelligent level of narcotic and psychotropic drugs are greatly improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of medical management technology, and more specifically, to a comprehensive collaborative management system and method for the acquisition and replenishment of narcotic and psychotropic drugs. Background Technology

[0002] Patent publication number CN119181474A discloses a management system for controlled substances. This system includes a controlled substance cabinet and a refrigerator. The cabinet stores controlled substances, while the refrigerator stores and refrigerates them. The refrigerator has an electronic lock. In response to a detected request, the cabinet verifies whether the requester has the appropriate permissions. If the requester has the appropriate permissions, it sends an unlock signal to the refrigerator. Upon receiving the unlock signal, the refrigerator unlocks its electronic lock. This controlled substance management system differentiates between room temperature and low-temperature drug storage requirements. Through the combined use of the refrigerator and cabinet, it provides suitable storage environments for different drugs, ensuring drug stability and efficacy, preventing unauthorized access and drug abuse, and contributing to improving the overall level of drug storage management in medical institutions.

[0003] The existing integrated collaborative management system and methods for the acquisition and replenishment of narcotic and psychotropic drugs mainly have the following problems:

[0004] Existing technologies may rely on traditional mechanical locks or simple electronic lock systems, which are vulnerable to unauthorized hacking or malfunctions, compromising the security of drug storage. Traditional mechanical locks suffer from mechanical wear and component aging, especially during frequent unlocking and closing operations, which may lead to locking system failure and affect the reliability of drug access. Traditional medicine storage box designs may not consider the impact of environmental factors (such as dust and moisture) on the drug storage environment, potentially leading to a decline in drug quality or expiration.

[0005] Existing technologies may fail to provide effective location and guidance mechanisms, causing operators to spend significant time locating target medication storage compartments, increasing overall retrieval time and reducing work efficiency. The lack of clear visual guidance and coding rules in existing technologies may lead to operators mistaking medications due to visual confusion. This will result in errors in medication management, affecting patient treatment outcomes and increasing the cost of correcting errors. The lack of effective visual warnings may cause operators to miss critical information, increasing the risk of human error. The absence of secure unlocking mechanisms may allow unauthorized personnel to easily open medication compartments, reducing the security and traceability of medication management. Furthermore, the failure to consider real-time updates of inventory information and expiration dates will lead to data lag in the medication management process, affecting the accuracy and timeliness of operations.

[0006] Current technologies fail to effectively extract and identify collaborative medication patterns between different departments, resulting in an inability to fully understand the drug-sharing needs between departments and consequently hindering the rational allocation of resources. They neglect departmental medication habits and future demand changes, potentially leading to inaccurate drug demand predictions and impacting the efficiency of replenishment and inventory management. Reliance on manually set rules and experience introduces subjective biases into the analysis results. The lack of scientific algorithmic support may result in inaccurate classification of collaborative medication patterns, failing to fully reflect the actual medication relationships between departments and affecting the scientific rigor and accuracy of drug management decisions. Inadequate drug allocation may fail to reduce duplicate purchases and inventory backlogs, increasing the risk of drug obsolescence. Traditional supply chain management models may not be able to adapt to real-time demand changes, leading to poor overall supply chain performance. Insufficient exploration of potential connections between data may result in inaccurate inventory and replenishment planning, further impacting drug supply and management.

[0007] In view of this, the present invention proposes a comprehensive collaborative management system and method for the extraction and replenishment of narcotic and psychotropic drugs to solve the above problems. Summary of the Invention

[0008] To overcome the aforementioned deficiencies of the prior art and to achieve the above objectives, the present invention provides the following technical solution: a comprehensive collaborative management system for the acquisition and replenishment of narcotic and psychotropic drugs, comprising:

[0009] The secure storage monitoring unit is used to deploy a deformable magnetofluid sealing mechanism on the narcotic and psychotropic drug box. It controls the shape change of the magnetofluid through electromagnetic signals. When unauthorized opening behavior is detected, it triggers the deformation of the topology structure to automatically lock the drug box.

[0010] The medicine dispensing operation unit is used to provide medicine dispensing path guidance through the AR interface of the medicine box, and to indicate the target medicine storage compartment for medicine dispensing in combination with the multi-band LED array;

[0011] The drug data insight unit is used to collect data on the consumption of controlled drugs and the prescription data of controlled drugs from the information storage terminal of the drug storage warehouse. It constructs a drug consumption map through the drug consumption data; combined with the drug prescription data, it uses tensor decomposition algorithm to extract multi-department collaborative drug use patterns, and uses temporal convolutional network to predict the department-level drug consumption trend over the next n periods.

[0012] The replenishment strategy optimization unit is used to generate the optimal replenishment plan based on the consumption pattern of narcotic and psychotropic drugs and the departmental drug consumption trend over the next n periods, using the tuna swarm optimization algorithm.

[0013] The dynamic update unit is used to write the optimal replenishment plan into the drug state tensor. By sharing the drug state tensor, real-time interaction between drug retrieval and replenishment is achieved, thus updating the drug state tensor.

[0014] Preferably, the method for automatically locking the medicine box by triggering topological deformation includes:

[0015] An annular sealing groove is designed at the contact surface between the medicine box door frame and the box body to accommodate the magnetic fluid. An electromagnetic coil is embedded in the annular sealing groove to generate a control magnetic field and trigger the liquid-solid phase transition of the magnetic fluid. The fluid range is fixed by a hydrophilic and hydrophobic coating. A hydrophilic coating is applied to the inner wall of the annular sealing groove, and a hydrophobic coating is applied to the outer wall of the annular sealing groove. A ferrite-based magnetic fluid is selected for the response. Electromagnetic coils are evenly arranged around the sealing groove. The coils are connected to an integrated microcontroller through a drive circuit. A Hall sensor is used to monitor the magnetic field strength generated by the electromagnetic coil in real time. The Hall sensor signal is transmitted to the microcontroller to calculate the actual magnetic field strength.

[0016] A preset magnetic field strength phase transition threshold is set. The actual magnetic field strength is compared with the preset magnetic field strength phase transition threshold. If the actual magnetic field strength is greater than or equal to the preset magnetic field strength phase transition threshold, the magnetic fluid is solidified, locking the medicine box. If the actual magnetic field strength is less than the preset magnetic field strength phase transition threshold, the magnetic fluid remains liquid, and the medicine box can be opened normally.

[0017] Preferably, the unauthorized unpacking behavior includes unpacking behavior due to authentication failure, unpacking behavior at unusual times or frequencies, unauthorized or illegal unpacking behavior, unpacking behavior due to abnormal operation behavior, unrecorded or tampered unpacking behavior, and unpacking behavior triggered by abnormal environment.

[0018] Preferably, the method of using a multi-band LED array to indicate the target drug storage compartment for drug retrieval includes:

[0019] LED lights of different colors and flashing frequencies are preset and arranged around each medicine storage compartment. The brightness of the lights is adjustable. The information storage terminal of the medicine storage compartment determines the location of the target medicine storage compartment according to the preset medicine retrieval instructions. The AR interface and the LED array work together to guide the positioning of the target medicine storage compartment.

[0020] The preset lighting indication rules include light color coding and light flashing frequency rules; the light color coding includes green, blue, and red; green indicates the target drug storage warehouse, blue indicates path guidance, and red indicates a warning of insufficient remaining expiration date; the light flashing frequency rules include preset first flashing frequency threshold, second flashing frequency threshold, and third flashing frequency threshold; when the light flashing frequency is less than the first flashing frequency threshold, it indicates the current target drug storage warehouse; when the light flashing frequency is greater than or equal to the first flashing frequency threshold and less than or equal to the second flashing frequency threshold, it indicates the next target drug storage warehouse; when the light flashing frequency is greater than the third flashing frequency threshold, an abnormal drug inventory warning is issued.

[0021] The operator unlocks the medicine box using biometric identification and triggers a preset medication retrieval command. The information storage terminal in the medicine storage compartment illuminates the green LED light of the target medicine storage compartment according to the preset retrieval command, while the blue LED lights of adjacent medicine storage compartments provide path guidance. The operator opens the target medicine storage compartment according to the guidance and retrieves the medicine. If insufficient remaining expiration date or insufficient amount of medicine is detected, the red LED light of the target medicine storage compartment will issue a warning. The AR interface of the medicine box will simultaneously display abnormal information to remind the operator to verify. After the medication is retrieved, the LED light will turn off.

[0022] Preferably, the data on the consumption of narcotic and psychotropic drugs includes drug dispensing records, inventory change data, and operating environment data; the data on medical orders for narcotic and psychotropic drugs includes drug usage data, patient information data, source data of medical orders, and surgical scheduling data.

[0023] Preferably, the method for constructing a consumption map of narcotic and psychotropic drugs using consumption data includes:

[0024] Based on the consumption data of narcotic and psychotropic drugs, drug names, departments, drug storage warehouses, and operators are used as nodes in the narcotic and psychotropic drug consumption graph, and the drug retrieval relationships between drug names, departments, drug storage warehouses, and operators are used as edges in the narcotic and psychotropic drug consumption graph. A weighted narcotic and psychotropic drug consumption graph is constructed, where the weights in the narcotic and psychotropic drug consumption graph represent the frequency of drug consumption. Pandas is used for data cleaning and analysis, and Matplotlib is used to visualize the narcotic and psychotropic drug consumption graph.

[0025] Preferably, the method for extracting multi-departmental collaborative medication patterns using tensor decomposition algorithms includes:

[0026] Construct a third-order tensor. Define the tensor of narcotic and psychotropic drug consumption data, which includes drug type, department, and time step. The tensor element Xabp in the narcotic and psychotropic drug consumption data tensor represents the quantity of narcotic and psychotropic drug a consumed by department b at time p. Define the tensor of narcotic and psychotropic drug prescription data, which includes time step, department, and preset drug demand. The tensor element Dabp in the narcotic and psychotropic drug prescription data tensor represents the preset prescription demand of drug a by department b at time p.

[0027] The tensor elements Xabp and Dabp are weighted and fused to obtain the final analytical tensor Gabp; the influence of the consumption of narcotic and psychotropic drugs and the pre-set medical order demand on the final analytical tensor is balanced by adjusting the coefficient c.

[0028] The final analysis tensor Gabp is decomposed into the sum of R rank-1 tensors using CP decomposition. The Frobenius norm of the difference between the final analysis tensor Gabp and the decomposed final analysis tensor G′abp is divided by the Frobenius norm of the final analysis tensor Gabp to obtain the reconstruction error. A preset reconstruction error threshold is set, and the process stops when the reconstruction error is less than or equal to the preset reconstruction error threshold. The current R is selected as the decomposition rank.

[0029] Extract a three-dimensional factor matrix of narcotic drugs, departments, and time; the three-dimensional factor matrix includes a drug factor matrix, a department factor matrix, and a time factor matrix; the department factor matrix is ​​denoted as B, and the department factor matrix B is composed of different vectors, each vector representing the drug use characteristics of a department;

[0030] The cosine similarity of different departments is calculated using the department factor matrix B. A cosine similarity threshold is preset. If the cosine similarity of any pair of departments is greater than the cosine similarity threshold, the pair of departments is determined to belong to the same collaborative mode. The Louvain algorithm is used to cluster each pair of departments with calculated cosine similarity to form a multi-collaborative department group. Departments within each department group share similar medication patterns, resulting in a multi-department collaborative medication mode.

[0031] Preferably, the method for predicting the departmental drug consumption trend over the next n periods includes:

[0032] The dataset is divided into training, validation, and test sets for training and evaluating model performance. The sample set is a subset of the dataset, and each sample set includes historical data on the consumption of controlled drugs and prescription data for controlled drugs, as well as the corresponding departmental drug consumption trends over the next n periods. A drug consumption trend prediction model is built using the TensorFlow deep learning library.

[0033] The drug consumption trend prediction model includes an input layer, a temporal convolutional layer, and an output layer. The input layer of the model is used to input historical data on the consumption of controlled drugs and medical orders for controlled drugs. The output layer of the model is used to output the departmental drug consumption trend over the next n time periods. The drug consumption trend prediction model is a temporal convolutional network model.

[0034] Define the model's loss function, using the L2 regularized mean squared error loss function to measure the difference between the model's predicted values ​​and the true values; train the drug consumption trend prediction model using the training set, update the model parameters through the backpropagation algorithm to minimize the loss function; use the validation set to evaluate the performance of the drug consumption trend prediction model by calculating the accuracy.

[0035] The Adam optimization algorithm was selected as the optimizer. The model was tuned based on the performance feedback from the validation set. The model parameters were adjusted until the performance no longer improved or the preset number of iterations was reached. The performance of the model in the prediction task was evaluated using the test set. The trained drug consumption trend prediction model was used to predict the current drug consumption data and drug prescription data for narcotic drugs to obtain the department-level drug consumption trend for the next n periods.

[0036] Preferably, the method for obtaining the optimal replenishment plan includes:

[0037] The constraints for the replenishment optimization scheme are defined as follows: upper limit of single replenishment quantity Qmax, maximum supplier supply capacity Pmax, and minimum replenishment quantity Lmin. A replenishment scheme optimization problem is constructed. Each tuna individual represents a candidate replenishment scheme, with parameters including the name of the replenished drug, drug quantity, supplier name, and transportation route from the storage warehouse to the department. The search space is defined as the range of minimum and maximum replenishment quantities for each drug. The objective function is defined as the sum of inventory holding cost Cs, stockout risk Cm, and transportation cost Cv. An initial population is randomly generated within the search space, and three search mechanisms of the tuna swarm optimization algorithm are employed: random walk, tracking the optimal individual, and local predation. The algorithm stops optimizing when it reaches the maximum number of iterations, selecting the individual with the highest fitness as the optimal replenishment scheme.

[0038] A comprehensive and collaborative management method for the acquisition and replenishment of narcotic and psychotropic drugs includes:

[0039] S1. Deformable magnetic fluid sealing mechanism is deployed on the narcotic and psychotropic drug box. The shape change of the magnetic fluid is controlled by electromagnetic signal. When unauthorized opening behavior is detected, the topological structure deformation is triggered to automatically lock the drug box.

[0040] S2. Provide medication retrieval path guidance through the AR interface of the medicine box, and combine multi-band LED array to indicate the target medicine storage compartment for medication retrieval;

[0041] S3. Collect data on the consumption of narcotic and psychotropic drugs and the prescription data of narcotic and psychotropic drugs from the information storage terminal of the drug storage warehouse. Construct a narcotic and psychotropic drug consumption map through the consumption data. Combine the prescription data of narcotic and psychotropic drugs and use the tensor decomposition algorithm to extract the multi-department collaborative drug use pattern. Use the temporal convolutional network to predict the department-level drug consumption trend in the next n time period.

[0042] S4. Based on the consumption map of narcotic and psychotropic drugs and the departmental drug consumption trend over the next n periods, generate the optimal replenishment plan using the tuna swarm optimization algorithm.

[0043] S5. Write the optimal replenishment plan into the drug state tensor, and use the shared drug state tensor to perform real-time interaction between drug retrieval and replenishment, thereby updating the drug state tensor.

[0044] Compared with the prior art, the present invention has the following beneficial effects:

[0045] This invention utilizes the liquid-solid phase transition properties of magnetofluids to achieve dynamic locking, effectively preventing unauthorized opening and improving the security of narcotic and psychotropic drug storage. Precise magnetic field control is achieved through electromagnetic coils and Hall effect sensors, enabling programmable control of the locking and unlocking process and enhancing the level of intelligent management. Relying on magnetic field control, physical locking without mechanical structures is eliminated, reducing mechanical wear and improving the system's durability and stability. The annular sealing groove design, combined with a hydrophilic and hydrophobic coating, helps prevent external factors such as dust and moisture from affecting the drug storage environment, improving the stability of drug storage.

[0046] By using a multi-band LED array and an AR interface for collaborative guidance, operators can quickly locate the target medicine storage compartment, reducing retrieval time and improving work efficiency. Different colors and flashing frequencies of LEDs are used for coding to prevent operators from mistaking medicines due to visual confusion, improving accuracy and reducing human error. Blue LEDs provide path guidance, enabling operators to move along the optimal route, reducing unnecessary time spent during retrieval and optimizing workflow. Red LEDs, combined with flashing frequency rules, provide visual warnings for abnormal situations such as insufficient remaining expiration dates or low inventory, simultaneously displaying relevant information on the AR interface to ensure operators can promptly verify and take appropriate measures. Biometric recognition is used for unlocking the medicine box, ensuring only authorized personnel can perform retrieval operations, improving the security and traceability of medicine management. The light coding rules are intuitive and easy to understand, even for novice operators, reducing reliance on additional training and improving system usability. Combining the AR interface, information storage terminal, and LED indicator system, a human-computer interactive intelligent medicine retrieval process is achieved, improving the automation and intelligence level of medicine management.

[0047] Tensor decomposition algorithms can extract collaborative medication patterns between different departments, identify potential drug-sharing relationships, optimize the allocation of medical resources, and improve the intelligence level of drug management. By weighted fusion of historical consumption data and prescription data of narcotic and psychotropic drugs, it ensures that both departmental medication habits are considered and future demand changes are dynamically adapted, improving the accuracy of replenishment and inventory management. By calculating the cosine similarity of the departmental factor matrix and combining it with the Louvain clustering algorithm, collaborative medication department groups are automatically divided, avoiding manual rule setting and improving the objectivity and scientific nature of medication pattern analysis. After identifying collaborative medication departments, rational allocation of drugs between departments can be achieved, reducing duplicate purchases and inventory backlog, lowering the risk of drug spoilage, and improving the overall efficiency of the drug supply chain. Attached Figure Description

[0048] Figure 1This is a schematic diagram of the integrated collaborative management system for the narcotic and psychotropic drug replenishment according to the present invention;

[0049] Figure 2 This is a schematic diagram of a comprehensive and collaborative management method for the acquisition and replenishment of narcotic and psychotropic drugs according to the present invention;

[0050] Figure 3 This is a flowchart illustrating the process of retrieving medicine from a target medicine storage compartment using a multi-band LED array, as provided by the present invention. Detailed Implementation

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

[0052] Example 1

[0053] Please see Figure 1 and Figure 3 As shown, this embodiment further illustrates the integrated collaborative management system for the narcotic and psychotropic drug retrieval proposed in this invention, including:

[0054] With the continuous improvement of medical standards and the expansion of hospital scale, the management and supply of narcotic and psychotropic drugs have become an important part of hospital drug management. As drugs that have a significant impact on human health, the safety, compliance, and efficiency of their management directly affect patient treatment outcomes and the allocation of hospital drug resources. However, traditional narcotic and psychotropic drug management systems mostly rely on manual intervention and static management, which presents a series of technical problems that urgently need to be solved through intelligent and automated methods.

[0055] First, traditional narcotic and psychotropic drug management systems lack effective analysis of interdepartmental collaborative drug use patterns. Existing technologies largely rely on static data for inventory and replenishment management, failing to consider the relationships between different departments in drug sharing and collaborative use, resulting in underoptimized drug resources. For example, when certain drugs are shared across multiple departments, there may be duplicate purchases, inventory backlogs, or expired drugs, leading to resource waste and increased hospital operating costs.

[0056] Secondly, existing systems cannot dynamically adapt to changes in demand. Traditional replenishment management methods are usually based on historical consumption data or fixed demand forecasting models, which are difficult to cope with sudden and seasonal changes in demand. For example, during special periods or outbreaks of epidemics, the demand for certain medicines may rise sharply, but existing systems often cannot adjust replenishment strategies in time, leading to drug supply gaps or over-replenishment, further affecting the efficiency of the drug supply chain.

[0057] Furthermore, traditional inventory management also faces the problem of inaccuracy. Most existing technologies lack multi-dimensional inventory forecasting and intelligent scheduling mechanisms, making it impossible to accurately predict the medication needs of different departments. Therefore, inventory management often relies on manual adjustments, leading to problems such as drug stockpiling and waste due to expired drugs. It also hinders efficient inventory allocation and replenishment, increasing the hospital's inventory costs and management complexity.

[0058] In terms of inter-departmental drug dispensing, current technology relies on manual intervention and lacks a scientific collaborative dispensing mechanism, resulting in low efficiency and frequent problems such as duplicate purchases and inventory backlogs. This not only affects the overall efficiency of the drug supply chain but also reduces the accuracy and responsiveness of hospital drug management.

[0059] Furthermore, existing systems typically fail to provide real-time monitoring and intelligent decision support. Traditional narcotic and psychotropic drug management systems are mostly static, unable to dynamically adjust drug inventory and replenishment plans based on real-time data. Especially in the management of narcotic and psychotropic drugs, they fail to effectively prevent the risk of unauthorized personnel taking drugs, leading to security vulnerabilities.

[0060] In the process of drug dispensing and replenishment, existing technologies mainly rely on manual operation, lacking automated management and intelligent feedback. This makes the dispensing process prone to errors, affecting work efficiency and drug safety. Furthermore, existing systems fail to provide intelligent and accurate drug dispensing guidance, and lack effective drug dispensing monitoring mechanisms, thus increasing the risk of human error in the management process.

[0061] The existing management system for narcotic and psychotropic drugs is relatively weak in terms of storage and access security. Due to the lack of precise authorization management and real-time monitoring, unauthorized drug access can easily occur, thereby affecting the security and traceability of drug management.

[0062] In summary, existing technologies for managing narcotic and psychotropic drugs face numerous challenges, including a lack of analysis of synergistic drug use patterns, poor adaptability to changing demands, inaccurate inventory management, low efficiency in inter-departmental drug dispensing, inadequate safety management, and a lack of intelligent management of the drug dispensing process. These problems affect the intelligence, precision, safety, and efficiency of narcotic and psychotropic drug management, thus necessitating the development of a more intelligent, precise, and safe solution for managing these drugs.

[0063] To effectively address the above problems, this invention proposes a comprehensive collaborative management system for the acquisition and replenishment of narcotic and psychotropic drugs, comprising:

[0064] The secure storage monitoring unit is used to deploy a deformable magnetofluid sealing mechanism on the narcotic and psychotropic drug box. It controls the shape change of the magnetofluid through electromagnetic signals. When unauthorized opening behavior is detected, it triggers the deformation of the topology structure to automatically lock the drug box.

[0065] The medicine dispensing operation unit is used to provide medicine dispensing path guidance through the AR interface of the medicine box, and to indicate the target medicine storage compartment for medicine dispensing in combination with the multi-band LED array;

[0066] The drug data insight unit is used to collect data on the consumption of controlled drugs and the prescription data of controlled drugs from the information storage terminal of the drug storage warehouse. It constructs a drug consumption map through the drug consumption data; combined with the drug prescription data, it uses tensor decomposition algorithm to extract multi-department collaborative drug use patterns, and uses temporal convolutional network to predict the department-level drug consumption trend over the next n periods.

[0067] The replenishment strategy optimization unit is used to generate the optimal replenishment plan based on the consumption pattern of narcotic and psychotropic drugs and the departmental drug consumption trend over the next n periods, using the tuna swarm optimization algorithm.

[0068] The dynamic update unit is used to write the optimal replenishment plan into the drug state tensor. By sharing the drug state tensor, real-time interaction between drug retrieval and replenishment is achieved, thus updating the drug state tensor.

[0069] Methods for triggering automatic locking of the medicine box by topological deformation include:

[0070] Magnetofluid is a colloidal solution formed by suspending nanoscale magnetic particles (such as iron oxide) in a carrier liquid (such as oil or water). It possesses the following characteristics: it can rapidly change shape and flow under the influence of a magnetic field; it returns to a liquid state when no magnetic field is present, and is easily reconfigurable. Sealing mechanism: The morphological changes of the magnetofluid are controlled by an electromagnetic field to form a solid-state locking structure; when unauthorized opening is detected, a change in the electromagnetic field is triggered, causing the magnetofluid to quickly solidify and lock the medicine box. The principle of topological deformation is as follows: In the absence of an external magnetic field, the magnetofluid remains liquid and does not affect the opening and closing of the medicine box. Under the influence of a magnetic field, the magnetofluid forms a rigid closed structure within a specific channel, achieving locking. After the magnetic field disappears, the magnetofluid returns to its flow state, releasing the lock.

[0071] An annular sealing groove is designed at the contact surface between the medicine box door frame and the box body to accommodate the magnetic fluid. An electromagnetic coil is embedded in the annular sealing groove to generate a control magnetic field and trigger the liquid-solid phase transition of the magnetic fluid. The fluid range is fixed by a hydrophilic-hydrophobic coating. A hydrophilic coating is applied to the inner wall of the annular sealing groove to ensure uniform adhesion of the magnetic fluid, and a hydrophobic coating is applied to the outer side of the annular sealing groove to prevent magnetic fluid leakage. Ferrite-based magnetic fluid is selected for the response. Electromagnetic coils are evenly arranged around the sealing groove. The coils are connected to an integrated microcontroller through a drive circuit. A Hall sensor is used to monitor the magnetic field strength generated by the electromagnetic coil in real time. The Hall sensor signal is transmitted to the microcontroller to calculate the actual magnetic field strength.

[0072] A preset magnetic field strength phase transition threshold is set. Under a specific magnetic field strength, the magnetic fluid will undergo a phase transition from liquid to solid. This critical magnetic field strength is called the phase transition threshold. The actual magnetic field strength is compared with the preset magnetic field strength phase transition threshold. If the actual magnetic field strength is greater than or equal to the preset magnetic field strength phase transition threshold, the magnetic fluid is solidified, locking the medicine box. If the actual magnetic field strength is less than the preset magnetic field strength phase transition threshold, the magnetic fluid remains liquid, and the medicine box can be opened normally.

[0073] Specific methods for setting the phase transition threshold of the magnetic field strength:

[0074] Step 1: Determine the critical point (Hc) of the magnetohydrodynamic phase transition;

[0075] Experimental equipment:

[0076] An electromagnetic coil with adjustable magnetic field strength;

[0077] Magnetofluid samples;

[0078] Flowability testing devices (such as viscometers).

[0079] Experimental steps:

[0080] The magnetic fluid sample was placed at the center of an electromagnetic coil, and the magnetic field strength was gradually increased. The changes in the fluidity of the magnetic fluid were observed, and the critical point (Hc) of the phase transition from liquid to solid was recorded.

[0081] Step 2: Determine the preset magnetic field strength phase transition threshold;

[0082] The magnetic field strength phase transition threshold is: Ha = k × Hc; where Ha is the magnetic field strength phase transition threshold; k is the safety factor, which, according to expert experience, ranges from 1.1 to 1.3. For example, if the phase transition critical point of the magnetohydrodynamic fluid is measured to be Hc = 100 A / m, then the preset magnetic field strength phase transition threshold can be set as: Ha = 1.2 × 100 = 120 A / m.

[0083] Step 3: Configure the electromagnetic control method;

[0084] Coil parameter design: Calculate the required number of coil turns and current intensity based on the preset magnetic field strength phase transition threshold: H=(N˙I) / L; where H is the magnetic field strength; L is the coil length; N is the required number of coil turns; I is the current intensity; set the preset magnetic field strength phase transition threshold to Ha in the microcontroller.

[0085] Unauthorized opening of boxes includes opening of boxes when authentication fails, opening of boxes at unusual times or frequencies, opening of boxes by force or illegal means, opening of boxes by abnormal operation, opening of boxes without logging or with altered records, and opening of boxes triggered by abnormal environment.

[0086] Unboxing failures are manifested when the operator fails to pass biometric identification (such as vein pattern recognition, dynamic gesture verification) or password verification and attempts to open the box using forged or stolen identity information.

[0087] Unusual opening times or frequencies are manifested as frequent attempts to open the box during non-normal working hours (such as late at night or holidays); or multiple attempts to open the box within a short period of time, exceeding the normal preset operating frequency.

[0088] Violent sabotage or illegal opening of the medicine box is manifested in the use of tools (such as crowbars and screwdrivers) to violently damage the lock or outer shell of the medicine box, and in an attempt to bypass the electronic lock through electromagnetic interference, signal shielding and other means.

[0089] Abnormal operation behavior in the unpacking process manifests as the medication retrieval action not conforming to the preset pattern (such as abnormal medication quantity or disordered medication retrieval order); or failure to follow system guidance during medication retrieval (such as failure to operate according to the AR navigation path).

[0090] Unrecorded or altered opening operations are manifested as opening operations not being recorded through the Integrated Collaborative Management System for the Acquisition and Replacement of Narcotic and Psychotropic Drugs or altering the operation log.

[0091] The opening behavior triggered by environmental anomalies manifests as attempting to open the medicine cabinet when the temperature and humidity exceed the preset threshold or the vibration exceeds the preset threshold; or attempting to open the medicine cabinet when the power supply is interrupted or the network connection is abnormal.

[0092] It should be noted that the main purpose of this method is to improve the security of medicine cabinets and prevent unauthorized opening, abnormal medication removal, and medication safety deterioration under special conditions. Specifically, this technology addresses the problem in the following ways:

[0093] Risks of unauthorized opening of medicine cabinets: Traditional mechanical locks are easily damaged, while electronic locks may be susceptible to electromagnetic interference or hacker attacks.

[0094] Prevention of illegal or abnormal medication access: Traditional medicine cabinet locking methods usually rely on passwords or biometric technology, but these methods may be vulnerable to identity fraud, violent damage, or electromagnetic interference.

[0095] Ensuring medicine safety in special environments: Traditional locking methods may fail in some special environments (such as abnormal temperature and humidity, power outages, vibrations, etc.).

[0096] The innovative aspects of the methodology layout include the following:

[0097] By controlling the morphological changes of a magnetofluid using an electromagnetic field, it can transform from a liquid to a solid state under specific conditions, thus forming a robust, sealed structure at the contact surface between the medicine box door frame and the box body. The magnetofluid reverts to a liquid state when the magnetic field is absent, enabling dynamic control of the medicine box's opening and closing, providing enhanced safety and more reliable protection.

[0098] This technology uses a Hall sensor to monitor the magnetic field strength in real time and accurately calculates the phase transition threshold of the magnetofluid, ensuring that the medicine box will only be locked under specific conditions. By presetting the phase transition threshold, it can be ensured that the magnetofluid will not erroneously trigger the locking mechanism due to environmental changes or misoperation.

[0099] By employing biometrics, behavioral analysis, and environmental monitoring technologies, the system can intelligently identify unauthorized opening of the medicine box and automatically trigger a locking mechanism based on abnormal patterns. For example, the system monitors the operator's identity verification, medication retrieval behavior, opening time and frequency, as well as the environmental conditions of the medicine box, to prevent illegal or abnormal operations.

[0100] Advantages compared to existing technologies:

[0101] Compared to traditional electronic locks, magnetohydrodynamic locking technology offers higher physical security because it forms a rigid, sealed structure that prevents physical damage or bypassing. Even under electromagnetic interference or violent attack, the medicine cabinet remains sealed.

[0102] By comprehensively applying technologies such as biometric identification, behavioral analysis, and environmental monitoring, it is possible to more accurately identify and prevent illegal or abnormal opening of packages. This is more protective than relying solely on passwords or fingerprint recognition because the system can intelligently judge and respond to various abnormal situations.

[0103] Through electromagnetic field control, magnetohydrodynamic fluids can switch between liquid and solid states under different magnetic field strengths. This dynamically adjustable characteristic allows the medicine box to respond flexibly according to environmental and operational needs. This enables the medicine box to adapt itself to various special situations, providing better safety assurance.

[0104] The present invention addresses the problems raised in the background section of this invention, which states that existing technologies may rely on traditional mechanical locks or simple electronic lock systems, which are susceptible to unauthorized hacking or malfunctions, resulting in ineffective security for drug storage; traditional mechanical locks suffer from mechanical wear and component aging, especially during frequent unlocking and locking operations, which may lead to locking system failure and affect the reliability of drug access; and traditional medicine storage box designs may not consider the impact of environmental factors (such as dust, moisture, etc.) on the drug storage environment, which may lead to drug quality degradation or expiration.

[0105] The method of using multi-band LED arrays to indicate the target drug storage compartment for drug retrieval includes:

[0106] The system features preset LEDs of different colors and flashing frequencies, including multi-band LEDs: RGB LEDs are used, supporting multiple color displays (such as red, green, and blue); and different flashing frequencies (such as constant light, slow flashing, and fast flashing). LEDs are arranged around each medicine storage compartment, with adjustable brightness. The information storage terminal for each medicine storage compartment determines its location based on preset retrieval instructions, and uses an AR interface in conjunction with the LED array to pinpoint the location of the target medicine storage compartment.

[0107] The preset lighting indication rules include light color coding and light flashing frequency rules; the light color coding includes green, blue, and red; green indicates the target drug storage warehouse, blue indicates path guidance, and red indicates a warning of insufficient remaining expiration date; the light flashing frequency rules include preset first flashing frequency threshold, second flashing frequency threshold, and third flashing frequency threshold; when the light flashing frequency is less than the first flashing frequency threshold, it indicates the current target drug storage warehouse; when the light flashing frequency is greater than or equal to the first flashing frequency threshold and less than or equal to the second flashing frequency threshold, it indicates the next target drug storage warehouse; when the light flashing frequency is greater than the third flashing frequency threshold, an abnormal drug inventory warning is issued.

[0108] The operator unlocks the medicine box using biometric recognition (such as vein pattern recognition and dynamic gesture verification) and triggers a preset medication retrieval command. The information storage terminal in the medicine storage compartment illuminates the green LED light of the target medicine storage compartment according to the preset retrieval command, while the blue LED lights of adjacent medicine storage compartments provide path guidance. The operator opens the target medicine storage compartment according to the guidance and retrieves the medicine. If the remaining expiration date is insufficient or the amount of medicine retrieved is insufficient, the red LED light of the target medicine storage compartment will issue a warning. The AR interface of the medicine box will simultaneously display abnormal information to remind the operator to check. After the medication is retrieved, the LED light will turn off.

[0109] The above methods mainly address issues such as accuracy, visual guidance, and abnormal warnings during drug storage and retrieval, specifically including:

[0110] Traditional methods of drug storage and retrieval rely on manual searching and label scanning, which can easily lead to errors or delays, especially when quickly locating the target storage location in multiple drug storage warehouses.

[0111] In the management of pharmaceutical storage warehouses, unauthorized personnel may attempt to retrieve medications, or retrieve them at the wrong time and place. Traditional medication retrieval methods, relying solely on keys, passwords, or barcode scanning, are susceptible to fraud, forgetfulness, or operational errors.

[0112] Monitoring the expiration date and managing inventory of drugs usually requires manual inspection or a dedicated management system, which is prone to oversights.

[0113] The innovative aspects of the methodology layout include the following:

[0114] Traditional LED lights are generally used only to indicate status, but this method not only uses LEDs of different colors but also incorporates changes in flashing frequency to convey different information. For example, green indicates the target compartment, blue indicates route guidance, and red is a warning of low remaining shelf life. At the same time, the different flashing frequencies also create additional layers of cues, allowing operators to obtain important information more intuitively through visual changes.

[0115] In traditional drug storage and retrieval, there may be no real-time graphical guidance, and operators often have to rely on manual searching. However, by combining an AR interface, not only can LED lights guide the location of the target compartment, but augmented reality technology can also further enhance the user experience, allowing operators to find the target compartment more easily and accurately.

[0116] Biometric identification technology ensures that only authorized personnel can unlock the medicine box to retrieve medication, which is a significant improvement over traditional password or key-based unlocking methods, avoiding the risk of identity theft or unauthorized personnel opening the box.

[0117] The system uses LED lights to display real-time information on drug inventory and expiration dates. Combined with automated processing, it can issue timely warnings when drugs are nearing their expiration date or have low inventory levels, helping operators make prompt adjustments.

[0118] Advantages compared to existing technologies:

[0119] By combining LED arrays and an AR interface, the efficiency of medicine retrieval can be greatly improved. Traditional methods rely on manual searching and calculation, while this solution uses visual guidance to allow operators to quickly and accurately locate the target medicine storage compartment, reducing retrieval time.

[0120] Using biometric identification technology as an unlocking method offers higher security compared to traditional passwords or keys. Furthermore, by monitoring drug expiration dates and inventory levels in real time, it can prevent the use of expired drugs and inventory shortages, thus improving the security and reliability of drug management.

[0121] Unlike traditional alarm systems, this method provides operators with multi-layered real-time feedback through different combinations of LED light colors and flashing frequencies. Whether it's insufficient expiration date, low stock, or the correct medication retrieval route, all information is conveyed to the operator through intuitive visual signals, improving the alarm system's response speed and accuracy. Traditional medication retrieval processes can be cumbersome and even lack clear guidance; however, by combining an AR interface with an LED array, operators receive clear visual guidance, enhancing the user experience.

[0122] This invention addresses the problems raised in the background section of the invention, such as the prior art's failure to provide an effective positioning and guidance mechanism, leading to operators spending significant time searching for target drug storage compartments, increasing overall drug retrieval time, and reducing work efficiency; the lack of clear visual guidance and coding rules in existing technologies, potentially causing operators to mistakenly retrieve drugs due to visual confusion. This results in errors in drug management, affecting patient treatment outcomes and increasing the cost of correcting errors; and the lack of effective visual warnings may cause operators to miss critical information, increasing the risk of human error.

[0123] The data on the consumption of narcotic and psychotropic drugs includes drug dispensing records, inventory changes, and operating environment data; the data on medical orders for narcotic and psychotropic drugs includes drug usage data, patient information data, source of medical orders, and surgical scheduling data.

[0124] The drug dispensing record data includes the drug name, dispensing time, dispensing quantity (e.g., fentanyl injection 10mg), the identity of the dispensing operator (e.g., pharmacist A), and the purpose of dispensing (e.g., for use in the operating room); the inventory change data includes the remaining inventory after each dispensing and the drug expiration date information (e.g., remaining expiration date 30 days); the operating environment data includes the temperature and humidity at the time of dispensing.

[0125] Drug usage data includes the administration method (such as intravenous injection) and the usage time window (such as 14:00 - 16:00 on October 25, 2024); patient information data includes patient name, medical record number, and patient vital sign data (such as heart rate, blood pressure); order source data includes prescribing physician information (such as Doctor Zhang) and order review status (such as reviewed, pending review).

[0126] Operating schedule data includes the operation time, operation type (such as cardiac surgery), and the order demand for preset drugs (such as 20 mg of morphine injection).

[0127] The method for constructing a consumption map of psychotropic drugs through psychotropic drug consumption data includes:

[0128] Based on the psychotropic drug consumption data, taking the drug name, department, storage warehouse, and operator as the nodes of the psychotropic drug consumption map, and taking the drug-taking relationship between the drug name, department, storage warehouse, and operator (such as "the operating room takes 10 mg of fentanyl injection") as the edges of the psychotropic drug consumption map, constructing a weighted psychotropic drug consumption map, where the weight of the psychotropic drug consumption map represents the drug consumption frequency; using Pandas for data cleaning and analysis, and using Matplotlib to visualize the psychotropic drug consumption map.

[0129] The method for extracting the multi-department collaborative drug use pattern using the tensor decomposition algorithm includes:

[0130] Construct a third-order tensor, define the psychotropic drug consumption data tensor including drug types, departments, and time steps, and the tensor element Xabp in the psychotropic drug consumption data tensor represents the quantity of psychotropic drug a consumed by department b at time p; define the psychotropic drug order data tensor including time steps, departments, and the preset drug demand; the tensor element Dabp in the psychotropic drug order data tensor represents the preset order demand for drug a by department b at time p.

[0131] Perform weighted fusion on the tensor element Xabp and the tensor element Dabp to obtain the final analysis tensor Gabp; the final analysis tensor Gabp = c·Xabp + (1 - c)·Dabp; balance the influence of psychotropic drug consumption and preset order demand on the final analysis tensor by adjusting the coefficient c; the value range of the adjustment coefficient c is between 0 and 1. If the adjustment coefficient 0 < c < 0.5, it is judged that the psychotropic drug order data has a greater influence on the final analysis tensor; if the adjustment coefficient 0.5 < c < 1, it is judged that the psychotropic drug consumption data has a greater influence on the final analysis tensor; if the adjustment coefficient c = 0.5, it is judged that the psychotropic drug consumption data and the psychotropic drug order data have equal influence on the final analysis tensor.

[0132] The main basis for setting the adjustment coefficient c is the actual demand and the reliability of the data. Specifically, the following factors can be considered:

[0133] Data quality and reliability:

[0134] If the consumption of narcotic and psychotropic drugs can better reflect the actual needs of the department, the c value can be set to a larger value (e.g., c=0.7 or greater), with an emphasis on consumption data.

[0135] If the prescription data for controlled substances is more accurate and can better predict future demand, the c value can be set smaller (e.g., c=0.3 or less), with a greater emphasis on prescription data.

[0136] Time window selection: Here, the time window refers to the selected time range for data analysis when analyzing the consumption of narcotic and psychotropic drugs and medical orders. The size and selection of the time window directly affect the accuracy of the data analysis and the predictive effect.

[0137] If the time window used is short (e.g., a few days or weeks), the data consumed may be closer to the actual needs, in which case the value of c can be increased.

[0138] If a longer time window is used (e.g., several months or a year), the medical order data is more predictive of future needs, which can relatively reduce the value of c.

[0139] Differences between medical order data and consumption data:

[0140] In some cases, medical order data may be subject to lag or error (e.g., medical orders issued in advance may not fully meet actual needs). In such cases, c can be set to favor consumption data in order to reduce the impact of such errors.

[0141] If the quality of the medical order data is relatively high and can accurately reflect the hospital's drug demand trends, then the weight of the medical order portion can be appropriately increased.

[0142] Dynamic adjustment in practical applications: In practice, the adjustment coefficient c can be dynamically adjusted based on model training or feedback. Initially, a suitable c value can be selected based on experience or analysis of historical data. Subsequently, it is continuously adjusted through model evaluation or algorithm optimization to achieve the best predictive effect. As hospital operational data is continuously updated, the value of c can be periodically evaluated and adjusted to address changes in medical orders and consumption data across different periods.

[0143] The final analysis tensor Gabp is decomposed into the sum of R rank-1 tensors using CP decomposition. The Frobenius norm of the difference between the final analysis tensor Gabp and the decomposed final analysis tensor G′abp is divided by the Frobenius norm of the final analysis tensor Gabp to obtain the reconstruction error. A preset reconstruction error threshold is set, and the process stops when the reconstruction error is less than or equal to the preset reconstruction error threshold. The current R is selected as the decomposition rank.

[0144] Extract a three-dimensional factor matrix of narcotic drugs, departments, and time; the three-dimensional factor matrix includes a drug factor matrix, a department factor matrix, and a time factor matrix; the department factor matrix is ​​denoted as B, and the department factor matrix B is composed of different vectors, each vector representing the drug use characteristics of a department;

[0145] The cosine similarity of different departments is calculated using the department factor matrix B. A cosine similarity threshold is preset. If the cosine similarity of any pair of departments is greater than the cosine similarity threshold, the pair of departments is determined to belong to the same collaborative mode. The Louvain algorithm is used to cluster each pair of departments with calculated cosine similarity to form a multi-collaborative department group. Departments within each department group share similar medication patterns, resulting in a multi-department collaborative medication mode.

[0146] This solution primarily addresses the problem of identifying and optimizing collaborative medication use patterns across multiple departments, specifically including:

[0147] In hospital drug management, drug consumption and prescription data are typically multidimensional, involving multiple dimensions such as drugs, departments, and time. Traditional methods may suffer from insufficient analytical capabilities or low processing efficiency when handling such complex data.

[0148] Traditional drug use pattern analysis often fails to identify potential synergistic drug use patterns between departments, especially when there are differences in drug demand and consumption data between different departments.

[0149] Hospital operations and drug demand are dynamic and change rapidly; static models often cannot respond to these changes in a timely manner.

[0150] The innovative aspects of the methodology layout include the following:

[0151] The dynamic adjustment of the adjustment coefficient c is an innovative aspect of this scheme. In the initial stage, the value of c can be set based on historical data and experience, and then continuously adjusted through model evaluation and feedback. In this way, the model can optimize the prediction results according to changes in actual operation, improving the model's adaptability and accuracy, rather than relying on fixed parameter settings.

[0152] CP decomposition is employed to decompose the high-dimensional tensor of narcotic and psychotropic drug consumption and medical order data into a low-rank factor matrix. This method can effectively capture potential patterns and relationships across different departments and time dimensions. The Frobenius norm is used to evaluate the reconstruction error, ensuring the accuracy of the tensor decomposition. The optimal decomposition rank R is then selected, thus achieving efficient pattern extraction and analysis.

[0153] By calculating the cosine similarity of the departmental factor matrix, collaborative medication patterns between departments can be identified. The Louvain algorithm further clusters similar departments to form collaborative department groups. This method is more accurate than traditional manual analysis methods and can automatically discover and optimize collaborative medication patterns between departments, improving the efficiency and effectiveness of drug management.

[0154] Incorporating the time dimension into the analysis allows this method to not only reveal collaborative drug use patterns between departments but also identify trends in drug consumption and demand across different periods. This is significant for developing more flexible drug procurement and inventory management strategies.

[0155] Advantages compared to existing technologies:

[0156] By using tensor decomposition and factor matrix extraction, the efficiency of data processing can be greatly improved, and the potential correlations between multidimensional data can be explored in depth.

[0157] By calculating the cosine similarity of the department factor matrix, it is possible to automatically identify and classify departments that use medication in concert, reducing manual intervention and improving the accuracy and reliability of recognizing collaborative medication patterns.

[0158] By dynamically adjusting the adjustment coefficient c and periodically optimizing the model, this method can flexibly respond to changes in hospital operations, adapt to fluctuations in drug demand over different time periods, and improve the long-term usability of the model.

[0159] By combining multidimensional data analysis and dynamic optimization, this method can predict drug demand with higher accuracy, thereby optimizing drug procurement, dispensing, and inventory management. Compared to traditional methods, it not only reduces inventory backlog but also minimizes drug shortages, improving hospital operational efficiency.

[0160] This invention addresses the problems raised in the background section of the present invention, namely, that existing technologies fail to effectively extract and identify collaborative medication patterns between different departments, resulting in an inability to fully understand the drug sharing needs between departments and thus an inability to rationally allocate resources; and that neglecting departmental medication habits and future demand changes may lead to an inability to accurately predict drug demand, thereby affecting the efficiency of replenishment and inventory management.

[0161] Methods for predicting departmental drug consumption trends over a period of n days include:

[0162] The dataset is divided into training, validation, and test sets for training and evaluating model performance. The sample set is a subset of the dataset, and each sample set includes historical data on the consumption of controlled drugs and prescription data for controlled drugs, as well as the corresponding departmental drug consumption trends over the next n periods. A drug consumption trend prediction model is built using the TensorFlow deep learning library.

[0163] The drug consumption trend prediction model consists of an input layer, a temporal convolutional layer, and an output layer. The input layer is used to input historical data on the consumption of controlled drugs and medical orders for controlled drugs. The output layer is used to output the departmental drug consumption trend over the next n time periods. The drug consumption trend prediction model is a temporal convolutional network model.

[0164] Define the model's loss function, using the L2 regularized mean squared error loss function to measure the difference between the model's predicted values ​​and the true values; train the drug consumption trend prediction model using the training set, update the model parameters through the backpropagation algorithm to minimize the loss function; use the validation set to evaluate the performance of the drug consumption trend prediction model by calculating the accuracy.

[0165] The Adam optimization algorithm was selected as the optimizer. The model was tuned based on the performance feedback from the validation set. The model parameters were adjusted until the performance no longer improved or the preset number of iterations was reached. The performance of the model in the prediction task was evaluated using the test set. The trained drug consumption trend prediction model was used to predict the current drug consumption data and drug prescription data for narcotic drugs to obtain the department-level drug consumption trend for the next n periods.

[0166] Methods for obtaining the optimal replenishment plan include:

[0167] The constraints for the replenishment optimization scheme are defined as follows: upper limit of single replenishment quantity Qmax, maximum supplier supply capacity Pmax, and minimum replenishment quantity Lmin. A replenishment scheme optimization problem is constructed. Each tuna individual represents a candidate replenishment scheme, with parameters including the name of the replenished drug, drug quantity, supplier name, and transportation route from the storage warehouse to the department. The search space is defined as the range of minimum and maximum replenishment quantities for each drug. The objective function is defined as the sum of inventory holding cost Cs, stockout risk Cm, and transportation cost Cv. An initial population is randomly generated within the search space, and three search mechanisms of the tuna swarm optimization algorithm are employed: random walk, tracking the optimal individual, and local predation. The algorithm stops optimizing when it reaches the maximum number of iterations, selecting the individual with the highest fitness as the optimal replenishment scheme.

[0168] The optimal replenishment plan is written into the drug state tensor. Real-time interaction between drug retrieval and replenishment is achieved through sharing the drug state tensor. Methods for updating the drug state tensor include:

[0169] First, a drug state tensor is constructed to record drug type, departmental inventory, and time step information. Then, the optimal replenishment plan generated based on the tuna swarm optimization algorithm is written into the drug state tensor, updating the replenishment quantity, supplier batch, and arrival time data. During the drug retrieval process, the department calls the drug state tensor to query inventory; if inventory is sufficient, it is deducted; if insufficient, a stockout warning is triggered. During the replenishment process, warehouse management increases inventory according to the replenishment plan and updates drug batch, storage location, and expiration date information. By sharing the drug state tensor, a dynamic balance between drug retrieval and replenishment is achieved. The tensor state is automatically updated when drug retrieval, replenishment, drug expiration, or changes in demand occur, ensuring real-time synchronization of inventory information and improving the intelligence and safety of narcotic and psychotropic drug management.

[0170] The preset first flashing frequency threshold is set by the staff. Different flashing frequencies are collected through the information storage terminal of the medicine storage warehouse, and the average value of multiple flashing frequencies is taken as the preset first flashing frequency threshold. Similarly, preset second flashing frequency threshold, preset third flashing frequency threshold, preset reconstruction error threshold and preset cosine similarity threshold are set.

[0171] In this embodiment, dynamic locking is achieved by utilizing the liquid-solid phase transition characteristics of magnetofluids, which effectively prevents unauthorized opening and improves the security of narcotic and psychotropic drug storage. Precise magnetic field control is achieved through electromagnetic coils and Hall sensors, enabling programmable control of the locking and unlocking process and improving the level of intelligent management. Relying on magnetic field control, physical locking is not required through mechanical structures, reducing mechanical wear and improving the system's durability and stability. The annular sealing groove design combined with a hydrophilic and hydrophobic coating helps prevent external factors such as dust and moisture from affecting the drug storage environment, improving the stability of drug storage.

[0172] By using a multi-band LED array and an AR interface for collaborative guidance, operators can quickly locate the target medicine storage compartment, reducing retrieval time and improving work efficiency. Different colors and flashing frequencies of LEDs are used for coding to prevent operators from mistaking medicines due to visual confusion, improving accuracy and reducing human error. Blue LEDs provide path guidance, enabling operators to move along the optimal route, reducing unnecessary time spent during retrieval and optimizing workflow. Red LEDs, combined with flashing frequency rules, provide visual warnings for abnormal situations such as insufficient remaining expiration dates or low inventory, simultaneously displaying relevant information on the AR interface to ensure operators can promptly verify and take appropriate measures. Biometric recognition is used for unlocking the medicine box, ensuring only authorized personnel can perform retrieval operations, improving the security and traceability of medicine management. The light coding rules are intuitive and easy to understand, even for novice operators, reducing reliance on additional training and improving system usability. Combining the AR interface, information storage terminal, and LED indicator system, a human-computer interactive intelligent medicine retrieval process is achieved, improving the automation and intelligence level of medicine management.

[0173] Tensor decomposition algorithms can extract collaborative medication patterns between different departments, identify potential drug-sharing relationships, optimize the allocation of medical resources, and improve the intelligence level of drug management. By weighted fusion of historical consumption data and prescription data of narcotic and psychotropic drugs, it ensures that both departmental medication habits are considered and future demand changes are dynamically adapted, improving the accuracy of replenishment and inventory management. By calculating the cosine similarity of the departmental factor matrix and combining it with the Louvain clustering algorithm, collaborative medication department groups are automatically divided, avoiding manual rule setting and improving the objectivity and scientific nature of medication pattern analysis. After identifying collaborative medication departments, rational allocation of drugs between departments can be achieved, reducing duplicate purchases and inventory backlog, lowering the risk of drug spoilage, and improving the overall efficiency of the drug supply chain.

[0174] Example 2

[0175] Please see Figure 2 As shown, for parts not described in detail in this embodiment, please refer to the description in Embodiment 1. A comprehensive and collaborative management method for the acquisition and replenishment of narcotic and psychotropic drugs is provided, including:

[0176] S1. Deformable magnetic fluid sealing mechanism is deployed on the narcotic and psychotropic drug box. The shape change of the magnetic fluid is controlled by electromagnetic signal. When unauthorized opening behavior is detected, the topological structure deformation is triggered to automatically lock the drug box.

[0177] S2. Provide medication retrieval path guidance through the AR interface of the medicine box, and combine multi-band LED array to indicate the target medicine storage compartment for medication retrieval;

[0178] S3. Collect data on the consumption of narcotic and psychotropic drugs and the prescription data of narcotic and psychotropic drugs from the information storage terminal of the drug storage warehouse. Construct a narcotic and psychotropic drug consumption map through the consumption data. Combine the prescription data of narcotic and psychotropic drugs and use the tensor decomposition algorithm to extract the multi-department collaborative drug use pattern. Use the temporal convolutional network to predict the department-level drug consumption trend in the next n time period.

[0179] S4. Based on the consumption map of narcotic and psychotropic drugs and the departmental drug consumption trend over the next n periods, generate the optimal replenishment plan using the tuna swarm optimization algorithm.

[0180] S5. Write the optimal replenishment plan into the drug state tensor, and use the shared drug state tensor to perform real-time interaction between drug retrieval and replenishment, thereby updating the drug state tensor.

[0181] Since the electronic device described in this embodiment is the one used in implementing the integrated collaborative management system and method for the acquisition and replenishment of narcotic and psychotropic drugs in this application embodiment, those skilled in the art can understand the specific implementation methods and various variations of the electronic device in this embodiment based on the integrated collaborative management system and method for the acquisition and replenishment of narcotic and psychotropic drugs described in this application embodiment. Therefore, how the electronic device implements the method in this application embodiment will not be described in detail here. Any electronic device used by those skilled in the art in implementing the integrated collaborative management system and method for the acquisition and replenishment of narcotic and psychotropic drugs in this application embodiment falls within the scope of protection of this application.

[0182] The above formulas are all dimensionless calculations. The formulas are derived from software simulations based on a large amount of collected data to obtain the most recent real-world results. The preset parameters and thresholds in the formulas are set by those skilled in the art according to the actual situation.

[0183] The above description is merely a preferred embodiment of the present invention. The scope of protection of the present invention is not limited to the above embodiments. All technical solutions falling within the scope of the present invention's concept are within the scope of protection of the present invention. It should be noted that for those skilled in the art, any improvements and modifications made without departing from the principles of the present invention should also be considered within the scope of protection of the present invention.

Claims

1. A comprehensive collaborative management system for the acquisition and replenishment of narcotic and psychotropic drugs, characterized in that, include: The secure storage monitoring unit is used to deploy a deformable magnetofluid sealing mechanism on the narcotic and psychotropic drug box. It controls the shape change of the magnetofluid through electromagnetic signals. When unauthorized opening behavior is detected, it triggers the deformation of the topology structure to automatically lock the drug box. The medicine dispensing operation unit is used to provide medicine dispensing path guidance through the AR interface of the medicine box, and to indicate the target medicine storage compartment for medicine dispensing in combination with the multi-band LED array; The drug data insight unit is used to collect data on the consumption of controlled drugs and the prescription data of controlled drugs from the information storage terminal of the drug storage warehouse. It constructs a drug consumption map through the drug consumption data; combined with the drug prescription data, it uses tensor decomposition algorithm to extract multi-department collaborative drug use patterns, and uses temporal convolutional network to predict the department-level drug consumption trend over the next n periods. The replenishment strategy optimization unit is used to generate the optimal replenishment plan based on the consumption pattern of narcotic and psychotropic drugs and the departmental drug consumption trend over the next n periods, using the tuna swarm optimization algorithm. The dynamic update unit is used to write the optimal replenishment plan into the drug state tensor. Real-time interaction between drug retrieval and replenishment is achieved through sharing the drug state tensor, enabling updates to the drug state tensor. This includes constructing the drug state tensor to record drug type, departmental inventory, and time step information; then, writing the optimal replenishment plan generated based on the tuna swarm optimization algorithm into the drug state tensor, updating replenishment quantity, supplier batch, and arrival time data; during drug retrieval, the department calls the drug state tensor to query inventory; if inventory is sufficient, it is deducted; if insufficient, a stockout warning is triggered; during replenishment, warehouse management increases inventory according to the replenishment plan and updates drug batch, storage location, and expiration date information; and automatically updates the tensor status when drug retrieval, replenishment, drug expiration, or changes in demand occur. The method for extracting multi-departmental collaborative medication patterns using tensor decomposition algorithms includes: Construct a third-order tensor. Define the tensor of narcotic and psychotropic drug consumption data, which includes drug type, department, and time step. The tensor element Xabp in the narcotic and psychotropic drug consumption data tensor represents the quantity of narcotic and psychotropic drug a consumed by department b at time p. Define the tensor of narcotic and psychotropic drug prescription data, which includes time step, department, and preset drug demand. The tensor element Dabp in the narcotic and psychotropic drug prescription data tensor represents the preset prescription demand of drug a by department b at time p. The tensor elements Xabp and Dabp are weighted and fused to obtain the final analytical tensor Gabp; the influence of the consumption of narcotic and psychotropic drugs and the pre-set medical order demand on the final analytical tensor is balanced by adjusting the coefficient c. The final analysis tensor Gabp is decomposed into the sum of R rank-1 tensors using CP decomposition. The Frobenius norm of the difference between the final analysis tensor Gabp and the decomposed final analysis tensor G′abp is divided by the Frobenius norm of the final analysis tensor Gabp to obtain the reconstruction error. A preset reconstruction error threshold is set, and the process stops when the reconstruction error is less than or equal to the preset reconstruction error threshold. The current R is selected as the decomposition rank. Extract a three-dimensional factor matrix of narcotic drugs, departments, and time; the three-dimensional factor matrix includes a drug factor matrix, a department factor matrix, and a time factor matrix; the department factor matrix is ​​denoted as B, and the department factor matrix B is composed of different vectors, each vector representing the drug use characteristics of a department; The cosine similarity of different departments is calculated using the department factor matrix B. A cosine similarity threshold is preset. If the cosine similarity of any pair of departments is greater than the cosine similarity threshold, the pair of departments is determined to belong to the same collaborative mode. The Louvain algorithm is used to cluster each pair of departments with calculated cosine similarity to form a multi-collaborative department group. Departments within each department group share similar medication patterns, resulting in a multi-department collaborative medication mode.

2. The integrated collaborative management system for the acquisition and replenishment of narcotic and psychotropic drugs according to claim 1, characterized in that, The method for triggering automatic locking of the medicine box by topological deformation includes: An annular sealing groove is designed at the contact surface between the medicine box door frame and the box body to accommodate the magnetic fluid. An electromagnetic coil is embedded in the annular sealing groove to generate a control magnetic field and trigger the liquid-solid phase transition of the magnetic fluid. The fluid range is fixed by a hydrophilic and hydrophobic coating. A hydrophilic coating is applied to the inner wall of the annular sealing groove, and a hydrophobic coating is applied to the outer wall of the annular sealing groove. A ferrite-based magnetic fluid is selected for the response. Electromagnetic coils are evenly arranged around the sealing groove. The coils are connected to an integrated microcontroller through a drive circuit. A Hall sensor is used to monitor the magnetic field strength generated by the electromagnetic coil in real time. The Hall sensor signal is transmitted to the microcontroller to calculate the actual magnetic field strength. A preset magnetic field strength phase transition threshold is set. The actual magnetic field strength is compared with the preset magnetic field strength phase transition threshold. If the actual magnetic field strength is greater than or equal to the preset magnetic field strength phase transition threshold, the magnetic fluid is solidified, locking the medicine box. If the actual magnetic field strength is less than the preset magnetic field strength phase transition threshold, the magnetic fluid remains liquid, and the medicine box can be opened normally.

3. The integrated collaborative management system for the acquisition and replenishment of narcotic and psychotropic drugs according to claim 2, characterized in that, The unauthorized opening behaviors include opening behaviors that fail to authenticate, opening behaviors at unusual times or frequencies, opening behaviors involving violent destruction or illegal opening behaviors, opening behaviors involving abnormal operation behaviors, opening behaviors that are not recorded or have been tampered with, and opening behaviors triggered by abnormal environments.

4. The integrated collaborative management system for the acquisition and replenishment of narcotic and psychotropic drugs according to claim 3, characterized in that, The method of using a multi-band LED array to indicate the target drug storage compartment for drug retrieval includes: LED lights of different colors and flashing frequencies are preset and arranged around each medicine storage compartment. The brightness of the lights is adjustable. The information storage terminal of the medicine storage compartment determines the location of the target medicine storage compartment according to the preset medicine retrieval instructions. The AR interface and the LED array work together to guide the positioning of the target medicine storage compartment. The preset lighting indication rules include light color coding and light flashing frequency rules; the light color coding includes green, blue, and red; green indicates the target drug storage warehouse, blue indicates path guidance, and red indicates a warning of insufficient remaining expiration date; the light flashing frequency rules include preset first flashing frequency threshold, second flashing frequency threshold, and third flashing frequency threshold; when the light flashing frequency is less than the first flashing frequency threshold, it indicates the current target drug storage warehouse; when the light flashing frequency is greater than or equal to the first flashing frequency threshold and less than or equal to the second flashing frequency threshold, it indicates the next target drug storage warehouse; when the light flashing frequency is greater than the third flashing frequency threshold, an abnormal drug inventory warning is issued. The operator unlocks the medicine box using biometric identification and triggers a preset medication retrieval command. The information storage terminal in the medicine storage compartment illuminates the green LED light of the target medicine storage compartment according to the preset retrieval command, while the blue LED lights of adjacent medicine storage compartments provide path guidance. The operator opens the target medicine storage compartment according to the guidance and retrieves the medicine. If insufficient remaining expiration date or insufficient amount of medicine is detected, the red LED light of the target medicine storage compartment will issue a warning. The AR interface of the medicine box will simultaneously display abnormal information to remind the operator to verify. After the medication is retrieved, the LED light will turn off.

5. The integrated collaborative management system for the acquisition and replenishment of narcotic and psychotropic drugs according to claim 4, characterized in that, The data on the consumption of narcotic and psychotropic drugs includes drug dispensing records, inventory changes, and operating environment data; the data on medical orders for narcotic and psychotropic drugs includes drug usage data, patient information data, source data of medical orders, and surgical scheduling data.

6. The integrated collaborative management system for the acquisition and replenishment of narcotic and psychotropic drugs according to claim 5, characterized in that, The method for constructing a consumption map of narcotic and psychotropic drugs using consumption data includes: Based on the consumption data of narcotic and psychotropic drugs, drug names, departments, drug storage warehouses, and operators are used as nodes in the narcotic and psychotropic drug consumption graph, and the drug retrieval relationships between drug names, departments, drug storage warehouses, and operators are used as edges in the narcotic and psychotropic drug consumption graph. A weighted narcotic and psychotropic drug consumption graph is constructed, where the weights in the narcotic and psychotropic drug consumption graph represent the frequency of drug consumption. Pandas is used for data cleaning and analysis, and Matplotlib is used to visualize the narcotic and psychotropic drug consumption graph.

7. The integrated collaborative management system for the narcotic and psychotropic drug replenishment according to claim 6, characterized in that, The method for predicting the consumption trend of departmental drugs over the next n periods includes: The dataset is divided into training, validation, and test sets for training and evaluating model performance. The sample set is a subset of the dataset, and each sample set includes historical data on the consumption of controlled drugs and prescription data for controlled drugs, as well as the corresponding departmental drug consumption trends over the next n periods. A drug consumption trend prediction model is built using the TensorFlow deep learning library. The drug consumption trend prediction model includes an input layer, a temporal convolutional layer, and an output layer. The input layer of the model is used to input historical data on the consumption of controlled drugs and medical orders for controlled drugs. The output layer of the model is used to output the departmental drug consumption trend over the next n time periods. The drug consumption trend prediction model is a temporal convolutional network model. Define the model's loss function, using the L2 regularized mean squared error loss function to measure the difference between the model's predicted values ​​and the true values; train the drug consumption trend prediction model using the training set, update the model parameters through the backpropagation algorithm to minimize the loss function; use the validation set to evaluate the performance of the drug consumption trend prediction model by calculating the accuracy. The Adam optimization algorithm was selected as the optimizer. The model was tuned based on the performance feedback from the validation set. The model parameters were adjusted until the performance no longer improved or the preset number of iterations was reached. The performance of the model in the prediction task was evaluated using the test set. The trained drug consumption trend prediction model was used to predict the current drug consumption data and drug prescription data for narcotic drugs to obtain the department-level drug consumption trend for the next n periods.

8. The integrated collaborative management system for the acquisition and replenishment of narcotic and psychotropic drugs according to claim 7, characterized in that, The method for obtaining the optimal replenishment plan includes: The constraints for the replenishment optimization scheme are defined as follows: upper limit of single replenishment quantity Qmax, maximum supplier supply capacity Pmax, and minimum replenishment quantity Lmin. A replenishment scheme optimization problem is constructed. Each tuna individual represents a candidate replenishment scheme, with parameters including the name of the replenished drug, drug quantity, supplier name, and transportation route from the storage warehouse to the department. The search space is defined as the range of minimum and maximum replenishment quantities for each drug. The objective function is defined as the sum of inventory holding cost Cs, stockout risk Cm, and transportation cost Cv. An initial population is randomly generated within the search space, and three search mechanisms of the tuna swarm optimization algorithm are employed: random walk, tracking the optimal individual, and local predation. The algorithm stops optimizing when it reaches the maximum number of iterations, selecting the individual with the highest fitness as the optimal replenishment scheme.

9. A method for comprehensive and collaborative management of the acquisition and replenishment of narcotic and psychotropic drugs, applied to the comprehensive and collaborative management system for the acquisition and replenishment of narcotic and psychotropic drugs as described in any one of claims 1 to 8, characterized in that, include: S1. Deformable magnetic fluid sealing mechanism is deployed on the narcotic and psychotropic drug box. The shape change of the magnetic fluid is controlled by electromagnetic signal. When unauthorized opening behavior is detected, the topological structure deformation is triggered to automatically lock the drug box. S2. Provide medication retrieval path guidance through the AR interface of the medicine box, and combine multi-band LED array to indicate the target medicine storage compartment for medication retrieval; S3. Collect data on the consumption of narcotic and psychotropic drugs and the prescription data of narcotic and psychotropic drugs from the information storage terminal of the drug storage warehouse. Construct a narcotic and psychotropic drug consumption map through the consumption data. Combine the prescription data of narcotic and psychotropic drugs and use the tensor decomposition algorithm to extract the multi-department collaborative drug use pattern. Use the temporal convolutional network to predict the department-level drug consumption trend in the next n time period. S4. Based on the consumption map of narcotic and psychotropic drugs and the departmental drug consumption trend over the next n periods, generate the optimal replenishment plan using the tuna swarm optimization algorithm. S5. Write the optimal replenishment plan into the drug state tensor, and use the shared drug state tensor to perform real-time interaction between drug retrieval and replenishment, thereby updating the drug state tensor.