Internet-based medicine wholesale and retail comprehensive service method and system

Through real-time data docking and intelligent prediction optimization, data silos and quality traceability problems in the pharmaceutical supply chain are solved, efficient management of drug inventory and distribution is achieved, drug quality and safety are ensured, and operating costs are reduced.

CN120525162AActive Publication Date: 2025-08-22HUNAN LONGFA PHARMACEUTICAL TECHNOLOGY CO LTD

Patent Information

Application Number
CN202511031202.7
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-07-25
Publication Date
2025-08-22
Estimated Expiration
2045-07-25

AI Technical Summary

Technical Problem

There are data silos, dilemmas in quality traceability and insufficient distribution optimization in traditional pharmaceutical supply chain management, resulting in insufficient accuracy of demand forecasting, inefficient inventory turnover efficiency, delayed emergency order response, incomplete traceability of drug quality, low capacity utilization and lag in abnormal handling.

Method used

Through the API interface, the hospital HIS system, the drug wholesale enterprise ERP system and the retail terminal POS system are connected in real time, and the LSTM neural network is used to predict drug demand, and a linear planning model is established based on logistics constraints and cost optimization, a list of replenishment suggestions is generated, the distribution path is optimized and the blockchain traceability code is generated, the temperature and humidity quality is monitored in real time, and the delivery vehicle scheduling is dynamically optimized.

Benefits of technology

Real-time monitoring and dynamic management of drug inventory status is realized, the accuracy of demand forecasting is improved, the distribution path and vehicle scheduling is optimized, the quality and safety of drugs is ensured, operating costs and losses are reduced, and the synergistic efficiency of the supply chain is improved.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120525162A_ABST
    Figure CN120525162A_ABST
Patent Text Reader

Abstract

The invention provides a medical wholesale and retail comprehensive service method and system based on the Internet, and relates to the technical field of medicines.The medical wholesale and retail comprehensive service method comprises the steps that a hospital HIS system is docked in real time through an API, and electronic prescription data are collected; the collected electronic prescription data is connected with a medicine wholesale enterprise ERP system, the inventory state, batch number and validity period information of each medicine are obtained, and inventory information is obtained. According to the invention, through real-time connection of the hospital HIS system, the drug wholesale enterprise ERP system and the retail terminal POS system, inventory information can be obtained and dynamic management can be carried out. The real-time data updating not only improves the inventory turnover rate, but also can automatically warn the medicines close to the expiration date, and reduces the loss of the expired medicines. The LSTM neural network is adopted to predict the drug demand, and the replenishment suggestion is generated in combination with the linear programming model, so that the replenishment process can be optimized while the operation cost is minimized, and sufficient and efficient inventory is ensured.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of pharmaceutical technology, and in particular to an Internet-based pharmaceutical wholesale and retail integrated service method and system. Background Art

[0002] With the rapid development of the pharmaceutical distribution industry, the traditional pharmaceutical supply chain management model faces many challenges: Data silos: The lack of effective data interoperability between hospital HIS systems, wholesale enterprise ERP systems, and retail terminal POS systems leads to inaccurate demand forecasts, low inventory turnover efficiency, and delayed response to urgent orders. Quality traceability dilemma: The paper document traceability system is subject to tampering risks, cold chain drug temperature control data records are incomplete, and the recall cycle of problematic drugs is long; Insufficient distribution optimization: static route planning, low capacity utilization, and delayed exception handling. Summary of the Invention

[0003] The technical problem to be solved by the present invention is to provide an Internet-based pharmaceutical wholesale and retail integrated service method and system, which can improve the precision of data preprocessing to ensure the accuracy and comprehensiveness of deformation monitoring.

[0004] In order to solve the above technical problems, the technical solutions of the present invention are as follows: In a first aspect, a method for providing integrated pharmaceutical wholesale and retail services based on the Internet is provided, the method comprising: Step S1: Connecting to the hospital HIS system in real time through the API interface to collect electronic prescription data; connecting the collected electronic prescription data to the pharmaceutical wholesale enterprise ERP system to obtain the inventory status, batch number and expiration date information of each drug to obtain inventory information; receiving sales data from the retail terminal POS system based on the inventory information and processing the sales data; Step S2: Use an LSTM neural network to predict drug demand and evaluate inventory health. Combined with logistics constraints and cost optimization, a linear programming model is established to generate a three-level replenishment recommendation list that includes variety, quantity, and timeliness to minimize operating costs. Step S3: Receive multiple types of orders from medical institutions, retail pharmacies, and individuals. Select drugs based on the drug demand in the order, combined with the purchase recommendation list in step S2 and the inventory information in step S1. Extract the drug physical property identification, delivery coordinates, and time-limit labels based on the data matching results. Select compliant delivery nodes and calculate the spherical distance. Construct an initial convex hull vertex sequence by polar angle sorting. Remove non-convex points to generate a minimum convex polygon path, which is then mapped into an actual delivery node sequence. Trigger order splitting based on the continuous distribution of wholesale nodes in the path. Aggregate the drug demand covered by the wholesale nodes into bulk purchase instructions, and decompose the demand for retail terminal services into terminal delivery instructions. Finally, route wholesale-level orders to wholesale enterprise nodes and retail-level orders to pharmacy nodes, generating a routing order data packet with path encoding. Step S4: Based on the routing order data packet in step S3, a unique blockchain traceability code is generated for each batch of drugs; the traceability code records the complete flow process from the manufacturer to the end consumer, and the storage temperature and humidity quality indicators are monitored in real time to obtain monitoring data; Step S5: Based on the monitoring data in step S4, select geographic information and road condition information; and optimize the delivery vehicle scheduling plan according to the road condition information.

[0005] Furthermore, in step S1, the hospital HIS system is connected in real time through the API interface to collect electronic prescription data; the collected electronic prescription data is connected to the pharmaceutical wholesale enterprise ERP system to obtain the inventory status, batch number and expiration date information of each drug to obtain inventory information; sales data from the retail terminal POS system is received based on the inventory information, and the sales data is processed, including: Connect to the hospital HIS system in real time through the API interface and receive electronic prescription data packets in real time; Perform structured parsing of prescription data packets to extract key fields, including: patient anonymized identifier, drug generic name and strength, dosage and frequency, and prescription timestamp; Establish a data channel to the pharmaceutical wholesale enterprise ERP system based on the analysis of data packets, and query and obtain the current inventory availability and distribution location, drug batch number and expiration date information, and special storage requirements in real time; Build a dynamic drug inventory database based on current inventory availability, enabling minute-by-minute updates of inventory status, automatic early warnings for near-expiry drugs, and real-time calculation of inventory turnover rates. Connect the inventory dynamic database to the retail terminal POS system data flow to perform sales record authenticity verification, drug sales temporal and spatial distribution analysis, and abnormal transaction pattern detection; Generate a drug sales feature matrix based on data streams, including regional sales heat maps, time period sales fluctuation curves, and associated sales combination patterns; Match data streams to correlate data, including mapping prescription drugs with inventory availability, correlating sales trends with inventory turnover, and optimizing regional demand and distribution networks to obtain correlated data. The associated data is output into a standardized data set, including a time-aligned unified data view, drug full-chain status indicators, and data quality assessment reports.

[0006] Furthermore, in step S2, the drug demand is predicted and the inventory health status is evaluated through the LSTM neural network. A linear programming model is established based on logistics constraints and cost optimization to generate a three-level replenishment recommendation list that includes variety, quantity, and timeliness to minimize operating costs, including: Based on sales data, a pre-trained LSTM neural network model architecture is loaded, consisting of input, hidden, and output layers. The model dynamically adjusts parameters during forecast calculations, including seasonal fluctuation factors, epidemiological impact coefficients, and regional special event corrections. Construct a multi-dimensional inventory status matrix based on the model architecture, including the current available inventory quantity and distribution location, the status of in-transit replenishment orders, and warning signs for drugs nearing their expiration dates; Calculate inventory health indicators for each node based on the inventory status matrix, including turnover rate compliance, inventory age distribution analysis, and out-of-stock risk probability; By integrating real-time inventory data and demand forecast results, and combining logistics resource status to set cost parameters, warehousing and transportation constraints, and business rules, a linear programming replenishment optimization model is constructed with the goal of minimizing total operating costs. Generate a three-level replenishment recommendation list based on the model.

[0007] Furthermore, by integrating real-time inventory data and demand forecast results, and combining the logistics resource status to set cost parameters, warehousing and transportation constraints, and business rules, a linear programming replenishment optimization model with the goal of minimizing total operating costs was constructed, including: Establish a drug data index table and load real-time inventory status data, which includes drug batch information, current available quantity and expiration date distribution in each warehouse; Receive the forecast results of drug demand by category for the next 7 days output by the demand forecast module, and compare the forecast demand with the inventory status data to obtain the supply and demand gap comparison results; Based on the comparison results, the current logistics resource status data is obtained, including the types of available transportation tools, the maximum storage capacity of each warehouse, and the load threshold of the regional distribution center; Based on the logistics resource status data, multi-dimensional cost parameters are set, including the purchase price gradient discount rule, the unit storage daily average cost coefficient, and the mileage cost benchmark value of different transportation routes; Define storage constraints based on storage capacity data, including maximum storage space limits for each warehouse, storage capacity ratio requirements for drugs in different temperature zones, and independent storage capacity thresholds for hazardous materials. Configure transport restrictions based on the type of transport vehicle, including maximum load for a single delivery, temperature control range for cold chain vehicles, and qualification requirements for special drug transport. Initialize the linear programming solution environment according to preset business rule parameters, wherein the business rule parameters include the minimum purchase order quantity, the shortest supplier delivery cycle, and the priority level of the hospital's emergency orders; Construct a decision variable matrix and define the replenishment range of each drug at each warehouse node. The range is determined by the upper limit of the supplier's supply capacity and the lower limit of the warehouse's receiving frequency. The objective function is set to minimize the total operating cost and add multi-level constraints. The total operating cost is composed of the weighted sum of procurement cost, warehousing cost and transportation cost, among which the weight coefficient of transportation cost is dynamically adjusted according to the distribution path.

[0008] Furthermore, in step S3, multiple types of orders are received from medical institutions, retail pharmacies, and individuals; drugs are selected based on the drug requirements in the orders, combined with the purchase suggestion list in step S2 and the inventory information in step S1, including: Receive multi-type heterogeneous order data from medical institutions, retail pharmacies, and individuals, including electronic prescription orders from medical institutions, replenishment orders from retail pharmacies, and online drug purchase orders from individuals; Standardized parsing of heterogeneous order data includes mapping drug codes in orders to the national medical insurance standard coding system, parsing address text information into longitude and latitude coordinates, and categorizing delivery time requirements into three priority tags: urgent delivery, regular delivery, and scheduled delivery, to obtain standardized order data. The drug matching logic is executed based on the standardized order data, including: prioritizing the allocation of inventory batches with near-expiry dates according to the drug expiration priority rules, matching cold chain drugs with node inventory with temperature-controlled warehousing capabilities, and verifying the terminal sales qualification license status for special anesthetic drugs to obtain data matching results.

[0009] Furthermore, in step S3, a routing order data packet with path coding is generated, including: Based on the data matching results, extract the physical property classification identification of the drug, the longitude and latitude coordinates of the delivery destination, and the order time priority label; Filtering a set of available delivery nodes that meet the drug transportation conditions based on the physical property classification identifier, calculating the spherical distance from each node to the destination based on the longitude and latitude coordinates of the delivery destination, and loading real-time road network topology data; Using the timeliness priority label as a constraint, the delivery node set is mapped into two-dimensional Euclidean space coordinate points, and the convex hull algorithm is used for iterative calculation: The coordinate point set is sorted by polar angle to construct an initial convex hull vertex sequence; non-convex hull vertices are scanned point by point and eliminated to generate a minimum convex polygon boundary path; the convex polygon vertices are converted into a sequence of actual delivery path nodes based on the road network topology data; Based on the distribution path node sequence, the spatial distribution relationship between wholesale warehouses and retail terminals in the path is analyzed: When the path contains ≥3 wholesale warehouse nodes in a row, wholesale-level order splitting is triggered; when there is a dense cluster of retail terminals at the end of the path, retail-level order splitting is triggered; The order structure is reconstructed based on the splitting rules. Wholesale-level orders retain the drug demand covered by the wholesale warehouse nodes in the path and aggregate them into bulk purchase instructions. Retail-level orders extract the drug demand served by the retail terminals at the end of the path and decompose them into terminal delivery instructions. Wholesale-level orders are routed to the supply chain nodes of pharmaceutical wholesale enterprises, and retail-level orders are routed to the supply chain nodes of retail pharmacies, generating routing order data packets with path coding.

[0010] Furthermore, in step S4, based on the routing order data packet in step S3, a unique blockchain traceability code is generated for each batch of drugs; the traceability code records the complete flow process from the manufacturer to the end consumer, and monitors the storage temperature and humidity quality indicators in real time to obtain monitoring data, including: Create a digital twin of the drug based on routing order information and generate a GS1 standard traceability code for each minimum sales unit; Establish a drug-batch-order association mapping table based on the traceability code, and record the hash value of the initial manufacturer's qualification document; According to the mapping table, the entire chain of evidence is circulated, and the chain is monitored in real time to monitor the data collection network; Establish a three-level quality warning mechanism, including: Level 1 warning for environmental parameters deviating from the standard value by ±2°C, Level 2 warning for exceeding the threshold value for 30 consecutive minutes, and Level 3 warning for critical deviations that affect drug potency; Deploy automatically triggered smart contract rules based on the early warning mechanism, including validity period management, circulation control and quality traceability.

[0011] Furthermore, in step S5, based on the monitoring data in step S4, geographic information and road condition information are selected; and a delivery vehicle dispatching plan is optimized according to the road condition information, including: Integrate monitoring data into multi-dimensional road condition information in real time, including basic road network data, dynamic traffic flow and meteorological environment; Construct a spatiotemporal feature matrix based on multi-dimensional road condition information, including a road section travel time prediction model, regional distribution difficulty coefficients, and traffic control rules for special periods; Establish drug-vehicle matching rules based on the spatiotemporal feature matrix, including the configuration of dedicated refrigerated trucks for cold-chain drugs, the requirement for two-person escort for anesthetic drugs, and the load limit for large-volume drugs; Delivery urgency is calculated based on vehicle matching rules, including red channels for emergency medicines, standard delivery times for conventional medicines, and scheduled delivery for chronic disease medicines.

[0012] Second, an Internet-based integrated pharmaceutical wholesale and retail service system includes: The data acquisition module is used to connect to the hospital HIS system in real time through the API interface to collect electronic prescription data; the collected electronic prescription data is connected to the pharmaceutical wholesale enterprise ERP system to obtain the inventory status, batch number and expiration date of each drug from it to obtain inventory information; based on the inventory information, sales data from the retail terminal POS system is received and processed; The replenishment module uses an LSTM neural network to predict drug demand and assess inventory health. It then builds a linear programming model based on logistics constraints and cost optimization to generate a three-level replenishment recommendation list that includes product type, quantity, and timeliness to minimize operating costs. The distribution module is used to receive multiple types of orders from medical institutions, retail pharmacies, and individuals. It selects drugs based on the drug requirements in the order, combined with the purchase recommendation list and inventory information. Based on the data matching results, it extracts the drug's physical property identification, delivery coordinates, and time-limit labels. It selects compliant delivery nodes and calculates spherical distances. It constructs an initial convex hull vertex sequence by polar angle sorting, removes non-convex points to generate a minimum convex polygon path, and then maps it into an actual delivery node sequence. It triggers order splitting based on the continuous distribution of wholesale nodes in the path, aggregates drug requirements covered by wholesale nodes into bulk purchase instructions, and decomposes retail terminal service requirements into terminal delivery instructions. Finally, it routes wholesale-level orders to wholesale enterprise nodes and retail-level orders to pharmacy nodes, generating routing order data packets with path encoding. The monitoring module is used to generate a unique blockchain traceability code for each batch of drugs based on the routing order data packet. The traceability code records the complete flow process from the manufacturer to the end consumer, and monitors the storage temperature and humidity quality indicators in real time to obtain monitoring data. The optimization module is used to select geographic information and road condition information based on monitoring data; and optimize the distribution vehicle scheduling plan based on road condition information.

[0013] According to a third aspect, a computing device includes: one or more processors; The storage device is used to store one or more programs, and when the one or more programs are executed by the one or more processors, the one or more processors are implemented.

[0014] In a fourth aspect, a computer-readable storage medium stores a program, which implements the method when executed by a processor.

[0015] The above solution of the present invention includes at least the following beneficial effects: Through the API interface, real-time connection with the hospital HIS system, pharmaceutical wholesale enterprise ERP system and retail terminal POS system can achieve seamless flow of electronic prescriptions, inventory and sales data, avoid information lag or manual entry errors, and allow all links in the supply chain (production, wholesale, retail, medical institutions) to grasp the dynamics of drugs in real time; the integrated multi-source data provides an accurate basis for subsequent demand forecasting, inventory management, and order processing, reducing blind purchases or out-of-stock problems caused by information asymmetry.

[0016] The LSTM neural network is used to predict drug demand, combined with inventory health status assessment to avoid capital occupation and expiration losses caused by "excessive inventory" or the risk of supply interruption caused by "insufficient inventory"; a linear programming model is combined with logistics constraints and cost optimization to generate a three-level replenishment recommendation list to ensure that the replenishment variety, quantity, and timeliness match actual demand, significantly reducing the comprehensive operating costs of procurement, warehousing and logistics.

[0017] The convex hull algorithm is used to optimize delivery routes, combining drug characteristics (such as cold chain requirements), delivery distances, and timeliness requirements to ensure efficient delivery. Wholesale / retail orders are automatically split and routed to corresponding nodes, reducing manual intervention, improving order processing speed and accuracy, and shortening delivery cycles. A unique blockchain traceability code is generated for each batch of drugs, recording the entire flow from manufacturer to end consumer, ensuring "source traceability, destination traceability, and accountability," effectively preventing counterfeit and substandard drugs from entering the market. Key quality indicators such as storage temperature and humidity are monitored in real time to ensure that drugs meet quality standards during circulation (especially for temperature-sensitive drugs such as vaccines and biologics), ensuring drug safety.

[0018] By combining geographic information, road condition information, and temperature and humidity monitoring data, we dynamically optimize delivery vehicle scheduling plans, reduce delays caused by traffic congestion, ensure that medicines (especially those that are time-sensitive or require high temperature control) are delivered on time and in quality, and reduce delivery losses. Through digital management of the entire supply chain, we achieve efficient collaboration among manufacturers, wholesalers, retailers, and medical institutions, forming a "demand-oriented" flexible supply chain. BRIEF DESCRIPTION OF THE DRAWINGS

[0019] Figure 1 The present invention provides a flowchart of an Internet-based integrated pharmaceutical wholesale and retail service method.

[0020] Figure 2This is a schematic diagram of an Internet-based pharmaceutical wholesale and retail integrated service system provided by an embodiment of the present invention. DETAILED DESCRIPTION

[0021] Exemplary embodiments of the present disclosure will be described in more detail below with reference to the accompanying drawings. Although exemplary embodiments of the present disclosure are shown in the accompanying drawings, it should be understood that the present disclosure can be implemented in various forms and should not be limited by the embodiments set forth herein. Rather, these embodiments are provided to enable a more thorough understanding of the present disclosure and to fully convey the scope of the present disclosure to those skilled in the art.

[0022] like Figure 1 As shown, an embodiment of the present invention provides an Internet-based integrated pharmaceutical wholesale and retail service method, the method comprising the following steps: Step S1: Connecting to the hospital HIS system in real time through the API interface to collect electronic prescription data; connecting the collected electronic prescription data to the pharmaceutical wholesale enterprise ERP system to obtain the inventory status, batch number and expiration date information of each drug to obtain inventory information; receiving sales data from the retail terminal POS system based on the inventory information and processing the sales data; Step S2: Use an LSTM neural network to predict drug demand and evaluate inventory health. Combined with logistics constraints and cost optimization, a linear programming model is established to generate a three-level replenishment recommendation list that includes variety, quantity, and timeliness to minimize operating costs. Step S3: Receive multiple types of orders from medical institutions, retail pharmacies, and individuals. Select drugs based on the drug demand in the order, combined with the purchase recommendation list in step S2 and the inventory information in step S1. Extract the drug physical property identification, delivery coordinates, and time-limit labels based on the data matching results. Select compliant delivery nodes and calculate the spherical distance. Construct an initial convex hull vertex sequence by polar angle sorting. Remove non-convex points to generate a minimum convex polygon path, which is then mapped into an actual delivery node sequence. Trigger order splitting based on the continuous distribution of wholesale nodes in the path. Aggregate the drug demand covered by the wholesale nodes into bulk purchase instructions, and decompose the demand for retail terminal services into terminal delivery instructions. Finally, route wholesale-level orders to wholesale enterprise nodes and retail-level orders to pharmacy nodes, generating a routing order data packet with path encoding. Step S4: Based on the routing order data packet in step S3, a unique blockchain traceability code is generated for each batch of drugs; the traceability code records the complete flow process from the manufacturer to the end consumer, and the storage temperature and humidity quality indicators are monitored in real time to obtain monitoring data; Step S5: Based on the monitoring data in step S4, select geographic information and road condition information; and optimize the delivery vehicle scheduling plan according to the road condition information.

[0023] In an embodiment of the present invention, by real-time connection between the hospital's HIS system and the pharmaceutical wholesaler's ERP system, drug inventory, batch number, and expiration date information can be dynamically obtained, helping companies to understand drug inventory status in real time, thereby reducing inventory backlogs and stock-outs. An LSTM neural network is used to predict drug demand and, combined with inventory information, to conduct inventory health assessments, helping to identify potential drug shortages in advance. An optimized replenishment list is generated using a linear programming model, reducing operating costs. A convex hull algorithm is used to optimize delivery routes, taking into account drug characteristics (such as cold chain requirements), delivery distance, and timeliness requirements to ensure efficient delivery. Wholesale / retail orders are automatically split and routed to corresponding nodes, reducing manual intervention, improving order processing speed and accuracy, and shortening delivery cycles. A unique blockchain traceability code is generated for each batch of drugs, recording the entire distribution process from manufacturer to end consumer, ensuring "source traceability, destination traceability, and accountability," effectively preventing counterfeit and substandard drugs from entering the market. Real-time monitoring of key quality indicators such as storage temperature and humidity ensures that drugs meet quality standards during distribution (especially for temperature-sensitive drugs such as vaccines and biologics), ensuring drug safety.

[0024] In a preferred embodiment of the present invention, step S1 is to connect to the hospital HIS system in real time through the API interface to collect electronic prescription data; connect the collected electronic prescription data to the pharmaceutical wholesale enterprise ERP system to obtain the inventory status, batch number and expiration date information of each drug to obtain inventory information; receive sales data from the retail terminal POS system based on the inventory information, and process the sales data, including: The system connects to the hospital's HIS system in real time through an API interface to receive electronic prescription data packets in real time. Specifically, the system parses the received electronic prescription data packets and converts the data into a unified format. The electronic prescription data is then verified. Based on the drug name and dosage form, the system calls the interface with the pharmaceutical wholesaler's ERP system to query current drug inventory information. The inventory quantity, batch number, and expiration date are obtained and compared with the demand in the electronic prescription. Based on the comparison results, the system uses an LSTM neural network to predict drug demand to obtain a forecast. The forecast results, inventory information, and the drug batch number and expiration date are combined to generate a replenishment recommendation list. Perform structured parsing of prescription data packets to extract key fields, including: patient anonymized identifier, drug generic name and strength, dosage and frequency, and prescription issuance timestamp; specifically, perform JSON or XML parsing of received prescription data to identify individual fields, such as patient information, drug information, and prescription issuance time; perform validation and inspection of the parsed data, including: verifying the validity of the patient anonymized identifier, verifying that the drug generic name and strength exist in the drug database, verifying that the dosage and frequency are within a reasonable range, and verifying that the prescription issuance timestamp is within a valid time range; Establish a data channel for the pharmaceutical wholesale enterprise ERP system based on the analysis of data packets, and query and obtain the current inventory availability and distribution location, drug batch number and expiration date information and special storage requirements in real time; specifically include: receiving data packets from various business links of the pharmaceutical wholesale enterprise; checking the format of the data packet to determine whether it complies with the established data format specifications; parsing the data packet into a data structure and identifying the key information fields therein; validating the parsed data to check whether the required fields exist and comply with the specified format and value range; mapping valid data to corresponding fields and objects according to the data model and business logic within the ERP system; using the mapped data, query the current inventory availability in the inventory module of the ERP system; based on the results of the inventory availability query, obtain the distribution information of the drug in different storage locations; extract the special storage requirement information of the drug from the mapped data; format and output the integrated inventory availability, distribution location, drug batch number and expiration date information according to the requirements of the ERP system; A dynamic drug inventory database is constructed based on the current available inventory, enabling minute-by-minute updates of inventory status, automatic alerts for near-expiration drugs, and real-time calculation of inventory turnover rates. This includes: receiving current inventory availability data aggregated from each link, along with associated drug batch numbers, expiration dates, distribution locations, and storage requirements; setting a scheduled database task to trigger a data update every minute; automatically scanning the expiration date information for all drug batches in the dynamic inventory database after updating the inventory status every minute; and, after completing inventory status updates and near-expiration alerts, calculating the drug inventory turnover rate in real time based on historical inbound and outbound data and the current available inventory. Connect the inventory dynamic database to the data stream of the retail terminal POS system to verify the authenticity of sales records, analyze the spatiotemporal distribution of drug sales, and detect abnormal transaction patterns. This includes establishing a real-time data interface with the retail terminal POS system to pull or receive sales data streams at a minute-by-minute frequency, including transaction time, drug ID, batch number, quantity, amount, customer ID, and terminal location code fields; cleansing, encrypting, and desensitizing the data; checking whether the drug ID and batch number in the sales record exist in the inventory dynamic database; verifying whether the sales quantity is less than the available inventory of the corresponding batch; and marking records of sales that occur despite insufficient inventory as "abnormal oversold." Generate a drug sales feature matrix based on the data stream, including a regional sales heat map, a time period sales fluctuation curve, and an associated sales combination model; specifically, filter out valid sales records from the data stream connected to the retail terminal POS system, including transaction time, drug ID, sales quantity, sales amount, and terminal location information; perform data deduplication and gap filling processing; divide the terminal location information into regions; count the total sales volume, sales amount, and sales frequency indicators of various types of drugs in each region, and sort and grade the sales heat of different regions based on the statistical results, with high-heat regions marked in red, low-heat regions marked in blue, and medium-heat regions marked in yellow; present the regional sales heat information in the form of a heat map, intuitively showing the distribution of drug sales heat in each region, and forming a regional sales heat map; Data streams are linked and matched, including mapping prescription drugs with available inventory, linking sales trends with inventory turnover, and optimizing regional demand and distribution networks to obtain linked data. Specifically, this involves extracting data on all prescription drugs from the drug management system, including inventory quantity, drug type, and drug specification information for each drug; combining drug sales data with market demand forecasts; establishing a mapping relationship between inventory and drug sales by comparing inventory quantity and drug demand; after mapping drugs to inventory, analyzing the impact of sales trends on inventory turnover; extracting sales trend patterns by analyzing historical sales data; and analyzing regional demand and distribution network optimization based on sales trends and inventory turnover. The associated data is output as a standardized data set, including a time-aligned unified data view, full-chain drug status indicators and a data quality assessment report; specifically, it includes: converting timestamps from different sources in the associated data into a unified format; clarifying the key status indicators of the entire chain of drugs from procurement, inventory management, sales to distribution; extracting relevant data from the time-aligned unified data view and calculating it according to the pre-defined indicator calculation method; summarizing the calculated indicators and displaying the status of the entire drug chain in the form of tables or visual charts; determining the key indicators for evaluating data quality, including data integrity, accuracy, consistency and timeliness.

[0025] In an embodiment of the present invention, real-time connection is achieved through an API interface between the hospital HIS system, the pharmaceutical wholesale enterprise ERP system, and the retail terminal POS system, breaking down the data barriers between different business systems and enabling real-time transmission and sharing of electronic prescription data, inventory data, and sales data. A dynamic database is established based on inventory information to achieve automatic early warning of near-expiration drugs and real-time calculation of inventory turnover rates, helping pharmaceutical wholesalers to timely grasp inventory status, rationally arrange procurement and replenishment plans, reduce drug expiration losses, and improve the efficiency of inventory capital utilization. The generated drug sales feature matrix covers regional sales heat maps, time period sales fluctuation curves, and related sales combination pattern information, which can deeply explore the patterns and trends behind sales data. Data association matching enables in-depth correlation analysis between prescription drugs and inventory availability, sales trends and inventory turnover, and regional demand and distribution networks, providing enterprises with scientific decision-making basis. The output of standardized data sets provides a unified time-aligned data view, full-chain drug status indicators, and data quality assessment reports. This not only facilitates data sharing and analysis among various departments within the enterprise, but also provides a transparent and standardized data interface for external regulatory agencies to meet compliance requirements.

[0026] In a preferred embodiment of the present invention, step S2 uses an LSTM neural network to predict drug demand and evaluate inventory health. A linear programming model is established in combination with logistics constraints and cost optimization to generate a three-level replenishment recommendation list containing variety, quantity, and timeliness to minimize operating costs, including: Based on sales data, a pre-trained LSTM neural network model architecture is loaded, consisting of an input layer, hidden layer, and output layer. Parameters are dynamically adjusted during forecasting calculations, including seasonal fluctuation factors, epidemiological impact coefficients, and regional special event corrections. This includes: loading sales data from a data warehouse or real-time database; receiving sales data and converting it into a format that the neural network can process; dynamically adjusting sales trends based on historical sales data and seasonal factors; sales in different regions may be affected by specific events; after the model architecture and parameter adjustments are completed, the cloud processor executes the LSTM neural network's forecasting calculations; the model receives pre-processed sales data through the input layer and performs training and calculations on the dynamically adjusted hidden layer. A multidimensional inventory status matrix is ​​constructed based on the model architecture, including the current available inventory quantity and distribution location, the status of in-transit replenishment orders, and warning signs of near-expiry drugs. Specifically, it includes: extracting the current available inventory quantity and the distribution location information of the corresponding drugs from the inventory dynamic database, including detailed location data of warehouse names and shelf numbers; cleaning the various types of extracted data to remove duplicate, erroneous, or invalid data records; establishing the basic framework of the multidimensional inventory status matrix with the drug ID as the core identifier; filling the cleaned and sorted current available inventory quantity data into the "current available inventory quantity" column of the matrix according to the drug ID; then filling the distribution location inventory quantity data of each warehouse into the corresponding warehouse location column; filling the relevant data of in-transit replenishment orders into the corresponding columns of the matrix based on the drug ID; and accurately filling the warning signs of near-expiry drugs into the "near-expiry drug warning sign" column in the corresponding drug row in the matrix according to the near-expiry drug data. Calculate inventory health indicators for each node based on the inventory status matrix, including turnover rate compliance, inventory age distribution analysis, and out-of-stock risk probability. Specifically, extract the current available inventory and recent sales data for each drug at each node from the inventory status matrix. Based on the inventory status matrix, determine the entry and current time of different batches of each drug at each node and calculate the inventory age of each batch of drugs. Obtain the current available inventory, number of replenishment orders in transit, and estimated arrival time for each drug at each node from the inventory status matrix, and combine historical sales data to predict sales demand for a period of time. By integrating real-time inventory data with demand forecast results, and combining the logistics resource status to set cost parameters, warehousing and transportation constraints and business rules, a linear programming replenishment optimization model is constructed with the goal of minimizing total operating costs. Specifically, this includes: integrating data from different sources, including real-time inventory data and demand forecast results; real-time inventory data comes from the warehouse management system, reflecting the current inventory level, inventory cycle and commodity storage status; pre-processing this data and setting relevant cost parameters based on actual conditions. These cost parameters include: reflecting the cost of storing products in the warehouse, costs calculated based on factors such as transportation distance, logistics method, and transportation volume, and out-of-stock costs that will lead to potential sales losses, while overstocking will increase storage and management costs; setting reasonable replenishment cycles and replenishment quantity limits based on the characteristics of the supply chain; setting priority replenishment rules based on the sales importance and demand volatility of different products, and different suppliers may have different delivery conditions or discount strategies; after completing data integration, cost parameter setting and constraint setting, the cloud processor will construct a linear programming model with the goal of minimizing total operating costs under given constraints; Generate a three-level replenishment recommendation list based on the model; specifically, the following steps are performed: the cloud processor obtains the optimal replenishment plan generated by the linear programming replenishment optimization model, including the decision variables for each node's purchase quantity, transfer quantity, and inventory holding quantity; formulates the classification criteria for the three-level replenishment recommendations based on the probability of out-of-stock risk, inventory turnover rate, inventory age, and the degree of impact on the business; screens out drugs that meet the first-level recommendation criteria based on the classification criteria; lists the drug name, drug ID, current inventory quantity, distribution location, expected out-of-stock time, recommended replenishment quantity, and recommended procurement supplier or transfer source node information in detail for these drugs; and screens out drugs that meet the second-level recommendation criteria from the remaining drugs. The list records the drug's basic information, current inventory status, inventory health indicators, recommended replenishment quantity, and replenishment time; and organizes the remaining drugs that meet the third-level recommendation criteria into a list.

[0027] In an embodiment of the present invention, the LSTM neural network model is used, combined with seasonal fluctuations, epidemiology, and dynamic parameter adjustments of regional special events, to accurately capture the changing trend of drug demand; a multi-dimensional inventory status matrix is ​​constructed and the inventory health index is calculated, so that the inventory status can be comprehensively and dynamically grasped. By analyzing the turnover rate, inventory age distribution, and out-of-stock risk probability, enterprises can promptly discover potential problems in inventory management, such as the backlog of unsaleable drugs and out-of-stock of key drugs; based on the demand forecast and inventory health assessment results, a linear programming model is constructed in combination with logistics constraints and cost optimization, which can comprehensively consider multiple factors such as procurement cost, warehousing cost, and transportation cost to generate a scientific and reasonable three-level replenishment recommendation list; the linear programming model integrates real-time inventory data, demand forecast results, and multi-dimensional information on logistics resource status, while incorporating warehousing and transportation constraints and business rules.

[0028] In a preferred embodiment of the present invention, by integrating real-time inventory data and demand forecast results, and setting cost parameters, warehousing and transportation constraints, and business rules based on the logistics resource status, a linear programming replenishment optimization model is constructed with the goal of minimizing total operating costs, including: Establish a drug data index table and load real-time inventory status data, including drug batch information, current available quantity, and expiration date distribution for each warehouse. Specifically, this includes: designing the structure of the drug data index table based on business needs and data characteristics; collecting real-time inventory status data from various data sources; classifying the cleaned data by drug ID, organizing information on different batches of the same drug and inventory status data for each warehouse; loading the organized data row by row into the drug data index table; regularly or in real time monitoring changes in inventory status data, and updating the drug data index table promptly when new inventory data is available; Receive the forecast results of drug demand by category for the next 7 days output by the demand forecast module, and compare the forecast demand with the inventory status data to obtain the supply and demand gap comparison results; specifically, receive the forecast results of drug demand by category for the next 7 days output by the demand forecast module through the data interface, check the data integrity, including whether it covers all drug categories, whether the time range accurately covers the next 7 days, and whether the data format complies with the agreed specifications; extract the current available quantity data of each category of drugs from the established drug data index table, and obtain the batch information and expiration date distribution of the drugs; compare the forecast demand of each category of drugs for each day in the next 7 days with the current available quantity of the corresponding category one by one; summarize and organize the calculated supply and demand gap data according to drug category and date to form a clear comparison result table; Based on the comparison results, current logistics resource status data is obtained, including the types of available transportation tools, the maximum storage capacity of each warehouse, and the load threshold of the regional distribution center. Specifically, based on the obtained supply-demand gap comparison results, the data on which pharmaceutical categories have supply-demand gaps, as well as the size and distribution of the gaps, is identified; based on the supply-demand gap comparison results, the required logistics resource status data is determined; current logistics resource status data is obtained by interacting with the logistics management system, transportation company, and warehouse management system data sources; the obtained logistics resource status data is organized; and a logistics resource status report is generated based on the organized and verified data. Multi-dimensional cost parameters are set based on the logistics resource status data, including purchase price gradient discount rules, unit storage daily average cost coefficients and mileage cost benchmark values ​​for different transportation routes; specifically, the following are: a comprehensive analysis of the acquired logistics resource status data to clarify the distribution and characteristics of available transportation tool types, the limitations of the maximum storage capacity of each warehouse, and the current status of the load threshold of the regional distribution center; based on the historical procurement data of medicines and the quotation policy provided by the supplier, combined with the transportation capacity and storage capacity limitations of the transportation tools in the logistics resource status, a purchase price gradient discount rule is formulated; based on the type of each warehouse, actual usage and storage capacity data in the logistics resource status, a unit storage daily average cost coefficient is set; and with reference to the available transportation tool types, transportation distances and load thresholds of the regional distribution centers in the logistics resource status, the mileage cost benchmark values ​​for different transportation routes are determined; Defining storage constraints based on storage capacity data includes maximum storage space limits for each warehouse, storage capacity ratio requirements for drugs in different temperature zones, and thresholds for independent hazardous materials warehouses. Specifically, extracting the specific maximum storage space values ​​for each warehouse from acquired logistics resource status data to clarify the total warehouse area and the area of ​​each floor or section; setting strict upper storage limits for each warehouse based on the extracted maximum storage space data; developing a reasonable ratio for drug storage capacity in each temperature zone based on the storage characteristics of drugs and actual business needs, and referring to storage space data for different temperature zones; and determining thresholds for independent hazardous materials warehouses based on the nature and quantity of hazardous materials, as well as safety regulations, combined with independent hazardous materials warehouse capacity data. Transport restrictions are configured based on the type of transport vehicle, including the maximum load capacity for a single delivery, the temperature control range of cold chain vehicles, and the requirements for special drug transport qualification licenses. Specifically, this includes: extracting information on available transport vehicle types from logistics resource status data, clarifying the specific categories of ordinary trucks, refrigerated trucks, and special transport vehicles, as well as the quantity and detailed specifications of each transport vehicle; determining the maximum load capacity for a single delivery for each transport vehicle based on the specifications, models, and design parameters of different transport vehicles; for cold chain vehicles, setting a reasonable temperature control range based on the performance of their refrigeration equipment and the temperature requirements for drug storage; integrating the maximum load capacity for a single delivery, the temperature control range of cold chain vehicles, and the requirements for special drug transport qualification licenses to form a complete transport restriction system; Initializing a linear programming solution environment based on preset business rule parameters, including minimum purchase order quantity, supplier's shortest delivery cycle, and hospital emergency order priority. Specifically, the system extracts parameter information on the minimum purchase order quantity, supplier's shortest delivery cycle, and hospital emergency order priority from a preset business rule library; setting a lower limit constraint on the purchase quantity of each drug based on the extracted minimum purchase order quantity parameter; integrating the supplier's shortest delivery cycle parameter into the solution environment to establish a constraint linking the purchase order time with the expected arrival time; and setting an order processing priority mechanism within the solution environment based on the hospital emergency order priority parameter. Construct a decision variable matrix and define the range of replenishment quantities of each drug at each warehouse node, where the range is determined by the upper limit of the supplier's supply capacity and the lower limit of the warehouse's receiving frequency. Specifically, the cloud processor constructs a two-dimensional decision variable matrix based on the number of drug categories and the number of warehouse nodes. The rows of the matrix correspond to different drugs, and the columns correspond to each warehouse node. The elements in the matrix represent the replenishment quantity of each drug at the corresponding warehouse node, providing a structured data framework for subsequent replenishment decisions. The supply capacity data of each supplier for different drugs is retrieved from the supplier management system, including the maximum single supply quantity and the maximum total supply within a certain period. Combined with the operating model, storage management capabilities and historical replenishment data of each warehouse, the lower limit of the frequency of the warehouse receiving drug replenishments is analyzed. For each element in the decision variable matrix, that is, the replenishment quantity of each drug at each warehouse node, the value range is determined based on the upper limit of the supplier's supply capacity and the lower limit of the warehouse's receiving frequency. The objective function is set to minimize the total operating cost and add multi-level constraints. The total operating cost is composed of the weighted combination of procurement cost, warehousing cost and transportation cost, among which the transportation cost weight coefficient is dynamically adjusted according to the distribution path. Specifically, it includes: conducting a detailed analysis of procurement cost, warehousing cost and transportation cost. Studying historical data to understand the proportion of each cost in the total operating cost; calculating the procurement cost of each drug based on the purchase price gradient discount rule and the replenishment quantity of each drug; calculating the warehousing cost based on the unit storage average daily cost coefficient, the storage capacity of each warehouse and the storage time; calculating the transportation cost based on the mileage cost benchmark value of different transportation paths, the type of transportation tool and the replenishment quantity of each drug; and constructing the objective function of minimizing the total operating cost by weighting the procurement cost, warehousing cost and transportation cost according to the determined weights.

[0029] In an embodiment of the present invention, the model aims to minimize total operating costs, incorporates procurement, warehousing, and transportation costs into weighted calculations, and dynamically adjusts the weight of transportation costs based on the distribution path; by comparing real-time inventory status data with demand forecast results, it accurately identifies supply and demand gaps to avoid inventory backlogs or out-of-stock situations; based on warehouse capacity, temperature zone ratios, hazardous materials storage and warehousing constraints, as well as transportation vehicle load capacity, temperature control requirements, and licensed transportation restrictions, it rationally plans drug replenishment and storage locations to achieve efficient allocation of inventory resources, improve storage space utilization and logistics transportation efficiency; the model integrates multi-dimensional information on logistics resource status, cost parameters, and business rules to provide a comprehensive basis for replenishment decisions. The introduction of business rule parameters such as minimum purchase order quantity, delivery cycle, and order priority ensures that decisions meet the needs of actual business scenarios; strict constraints are placed on the storage and transportation qualifications of special drugs to effectively avoid legal risks and quality and safety risks caused by illegal operations; information on drugs with near-expiration dates is incorporated into inventory status data, and combined with replenishment decisions, inventory turnover is optimized to reduce expired drug losses.

[0030] In a preferred embodiment of the present invention, step S3 receives multiple types of orders from medical institutions, retail pharmacies, and individuals; and selects drugs based on the drug requirements in the orders, combined with the purchase recommendation list in step S2 and the inventory information in step S1, including: Receive multi-type heterogeneous order data from medical institutions, retail pharmacies and individuals, including electronic prescription orders from medical institutions, replenishment orders from retail pharmacies and personal online drug purchase orders; specifically, establish connections with the medical institution's information system, the retail pharmacy's management system and the personal online drug purchase platform through data interfaces, and receive electronic prescription orders, retail pharmacy replenishment orders and personal online drug purchase order data in real time; classify electronic prescription orders from medical institutions, replenishment orders from retail pharmacies and personal online drug purchase orders according to order type; further process each type of order data; clean the integrated order data, remove duplicate order records, and handle missing values ​​and anomalies; and associate orders for the same drug in different types of orders based on drug information; Standardized parsing of heterogeneous order data includes: mapping the drug codes in the order to the national medical insurance standard coding system, parsing the address text information into longitude and latitude geographic coordinates, and classifying the delivery time requirements into three priority tags: emergency delivery, regular delivery, and scheduled delivery, to obtain standardized order data. Specifically, it includes: querying and matching each drug code in the locally established drug code mapping table based on the drug information in the heterogeneous order data; calling the geocoding parsing service for the address text information in the order to convert the address text into longitude and latitude geographic coordinates; analyzing the delivery time requirements in the order and classifying the delivery time requirements into three priority tags: emergency delivery, regular delivery, and scheduled delivery according to preset classification rules; integrating the order data after drug code mapping, address text information parsing, and delivery time requirement classification to generate standardized order data; The drug matching logic is executed based on the standardized order data, including: prioritizing the allocation of inventory batches with near expiration dates according to the drug expiration date priority rules, matching cold chain drugs with node inventory with temperature-controlled warehousing capabilities, and verifying the terminal sales qualification license status for special anesthetic drugs to obtain data matching results; specifically, it includes: extracting drug demand information from the standardized order data, and retrieving the inventory status data in the drug data index table, including the expiration date information of drug batches in each warehouse; for each order, according to the drug expiration date priority rules, prioritize screening out inventory batches with near expiration dates; identify orders involving cold chain drugs in the standardized order data, and screen out warehouse node information with temperature-controlled warehousing capabilities from the inventory status data; match cold chain drug orders based on the inventory availability, temperature control range, and current load of each node. Prioritize nodes whose temperature control range meets the drug storage requirements, have sufficient inventory, and have a low load for inventory allocation.

[0031] In an embodiment of the present invention, standardized parsing is performed on heterogeneous order data from medical institutions, retail pharmacies and individuals, drug codes are uniformly mapped to the national medical insurance standard coding system, address texts are converted into latitude and longitude coordinates, and priorities are set for classification of delivery timeliness requirements; drug matching logic is executed based on standardized order data, and near-expiry inventory batches are prioritized according to drug expiration priority rules, which can effectively reduce expired drug losses and improve inventory turnover; temperature-controlled storage capacity node inventory is matched for cold chain drugs to ensure the quality and safety of drugs during storage and transportation; the terminal sales qualification license status of special anesthetic drugs is verified to avoid the risk of illegal sales; in the drug matching process, the sales qualification of special anesthetic drugs is strictly verified to eliminate illegal sales behavior at the source, comply with relevant regulations, and reduce the possibility of enterprises facing legal risks and administrative penalties; through the classification and processing of order delivery timeliness requirements, the order and resources of drug delivery can be reasonably arranged according to the priority of emergency delivery, regular delivery and scheduled delivery.

[0032] In a preferred embodiment of the present invention, in step S3, generating a routing order data packet with path coding includes: Based on the data matching results, extract the physical property classification identification of the drug, the longitude and latitude coordinates of the delivery destination, and the order time priority label; Filtering a set of available delivery nodes that meet the drug transportation conditions based on the physical property classification identifier, calculating the spherical distance from each node to the destination based on the longitude and latitude coordinates of the delivery destination, and loading real-time road network topology data; Using the timeliness priority label as a constraint, the delivery node set is mapped into two-dimensional Euclidean space coordinate points, and the convex hull algorithm is used for iterative calculation: The coordinate point set is sorted by polar angle to construct an initial convex hull vertex sequence; non-convex hull vertices are scanned point by point and eliminated to generate a minimum convex polygon boundary path; the convex polygon vertices are converted into a sequence of actual delivery path nodes based on the road network topology data; Based on the distribution path node sequence, the spatial distribution relationship between wholesale warehouses and retail terminals in the path is analyzed: When the path contains ≥3 wholesale warehouse nodes in a row, wholesale-level order splitting is triggered; when there is a dense cluster of retail terminals at the end of the path, retail-level order splitting is triggered; The order structure is reconstructed based on the splitting rules. Wholesale-level orders retain the drug demand covered by the wholesale warehouse nodes in the path and aggregate them into bulk purchase instructions. Retail-level orders extract the drug demand served by the retail terminals at the end of the path and decompose them into terminal delivery instructions. Wholesale-level orders are routed to the supply chain nodes of pharmaceutical wholesale enterprises, and retail-level orders are routed to the supply chain nodes of retail pharmacies, generating routing order data packets with path coding.

[0033] In an embodiment of the present invention, the transportation conditions of the drugs (such as "cold chain type", "normal temperature type", "fragile type", "special control type", etc.) are marked according to the drug instructions or database records; the detailed address in the order (such as the specific department of the hospital, the door number of the pharmacy, the personal address) is converted into precise latitude and longitude coordinates (such as XX°XX′ north latitude, XX°XX′ east longitude) through a geocoding tool; and according to the delivery time required by the order (such as "within 24 hours", "within 48 hours", "within 72 hours"), it is marked as "high priority", "medium priority", or "low priority".

[0034] By comparing the physical characteristics and classification identification of the drugs, nodes that meet the transportation conditions are screened from the supply chain node library (for example, for "cold chain" drugs, only warehouses / distribution centers equipped with refrigeration facilities are retained) to form a set of available distribution nodes; based on the latitude and longitude coordinates of the distribution nodes and the destination, combined with the earth's curvature parameters (such as the earth's radius), the straight-line distance (spherical distance) from each node to the destination is calculated to preliminarily determine the spatial distance between the node and the destination; synchronously access the real-time traffic system database to obtain the road network topology information between the node and the destination (such as road connection relationships, bridge / tunnel distribution, one-way and two-way lane attributes, etc.).

[0035] The longitude and latitude coordinates of the available delivery node set are converted into two-dimensional plane coordinates (ignoring the curvature of the earth and simplifying it to Euclidean space). Order priority labels are used as constraints (for example, high-priority orders must have a total path length ≤ a preset threshold). The polar angle (the angle between the line connecting the pole and the reference direction) of each node coordinate is calculated, with the destination coordinate as the pole. The nodes are sorted in ascending order of polar angle. The first three points after sorting are selected as the initial convex hull vertices to form a preliminary triangular boundary. The remaining nodes are scanned in sequence to determine whether the node is outside the current convex hull boundary. If it is outside, the convex hull vertex sequence is updated; if it is inside, the node is removed. Ultimately, a minimum convex polygon boundary containing all key nodes is generated. Combined with real-time road network topology data, the vertices (plane coordinates) of the convex polygon are mapped to specific locations in the actual road network (such as intersections and warehouse entrances and exits), forming a navigable delivery path node sequence (for example, "warehouse A → main road B → transfer station C → destination").

[0036] Node type identification: Traverse the delivery path node sequence and mark the type of each node ("wholesale warehouse" or "retail terminal"); count the number of consecutive wholesale warehouse nodes. When the consecutive number is ≥3 (for example, "Warehouse A → Warehouse B → Warehouse C" appears continuously), the path is determined to be suitable for batch delivery, triggering wholesale-level order splitting; analyze the end nodes of the path. If there are multiple retail terminals (such as pharmacy A, pharmacy B, pharmacy C) and the distance between them is ≤ a preset value (for example, within 5 kilometers), a "dense cluster of retail terminals" is formed, triggering retail-level order splitting.

[0037] Extract drug demands within the coverage area of ​​wholesale warehouse nodes (e.g., demands from Hospital X and Hospital Y covered by Warehouse A) from the original order and merge them into bulk purchase instructions (including total quantity and unified delivery time). Extract demands for dense cluster services of retail terminals (e.g., orders for individual users served by Pharmacy A and orders for community clinics served by Pharmacy B) from the original order and decompose them into delivery instructions for individual terminals (including specific drug specifications and terminal addresses). Send wholesale-level orders to the corresponding pharmaceutical wholesale enterprise supply chain system (e.g., wholesale node interface connected to the enterprise ERP), and send retail-level orders to the retail pharmacy supply chain system (e.g., retail node interface connected to the pharmacy POS). Add a path identifier to the order data packet (e.g., a code containing the path node sequence, split trigger conditions, and delivery order, such as "P3-R5-20231001-001," where P3 represents three consecutive wholesale nodes and R5 represents five retail terminal clusters), forming a routing order data packet with path coding.

[0038] The present invention combines the convex hull algorithm with road network data to ensure that the distribution path covers key nodes and has the shortest distance, while adapting to drug transportation conditions (such as cold chain) to reduce ineffective detours. It triggers splitting based on objective rules of node distribution (the number of consecutive wholesale nodes and the density of retail terminals) to avoid human subjective judgment errors and ensure that wholesale / retail orders are matched with supply chain nodes. Wholesale-level orders aggregate batch demand to reduce transportation frequency, while retail-level orders decompose terminal demand to shorten the last mile distance. The combination of the two reduces the waste of logistics resources. Order priority is used as a constraint to ensure that the path of high-efficiency orders is more compact and delays are avoided. Path encoding records the splitting logic and node information to facilitate subsequent order tracking and supply chain optimization.

[0039] In a preferred embodiment of the present invention, step S4 generates a unique blockchain traceability code for each batch of drugs based on the routing order data packet in step S3; the traceability code records the complete flow process from the manufacturer to the end consumer, and monitors the storage temperature and humidity quality indicators in real time to obtain monitoring data, including: A drug digital twin is created based on routing order information, generating a GS1 standard traceability code for each minimum sales unit. This process involves extracting complete routing order information from the order routing execution instruction set, including order number, drug name, specification, batch, quantity, shipping warehouse, delivery address, delivery route, and customer information. Based on the parsed routing order information, the cloud-based processor constructs the basic framework of the drug digital twin. Based on the drug digital twin framework, the cloud-based processor obtains detailed drug information from multiple data sources and populates it into the corresponding digital twin. Based on the key information in the drug digital twin, the cloud-based processor generates a traceability code for each minimum sales unit in accordance with GS1 standards. Establish a drug-batch-order association mapping table based on the traceability code, and record the hash value of the initial manufacturer's qualification documents; specifically, parse out the key information of drug identification, batch number, and production date from the generated GS1 standard traceability code; design the drug-batch-order association mapping table structure, including the primary key, drug identification, batch number, order number, manufacturer, production date, expiration date, sales time, and customer information; based on the information in the traceability code, associate and map drugs, batches, and orders; for each traceability code, match its corresponding drug identification, batch number, and order number to establish a corresponding relationship between the three; obtain the qualification documents of the initial drug manufacturer from the enterprise qualification database, including business license, drug production license, and GMP certification documents. Use a secure hash algorithm to calculate the contents of these qualification documents and generate a hash value; According to the mapping table, the entire chain of circulation is recorded, and the chain is monitored in real time, and the data collection network is monitored; specifically, based on the key nodes in the drug circulation chain, a distributed data collection network is deployed; based on the drug-batch-order association mapping table, a drug circulation chain record framework is constructed; real-time monitoring data from the data collection network is received, and the data is cleaned, converted and integrated to remove noise data and extract valuable information. The integrated data is associated with the circulation chain record framework, and the status changes of the drug at each link are recorded in chronological order to form a continuous and complete circulation chain record; based on preset business rules and risk indicators, the cloud processor monitors the drug circulation chain in real time; A three-level quality warning mechanism is set up, including: the first-level warning is when the environmental parameters deviate from the standard value by ±2°C, the second-level warning is when the threshold is exceeded for 30 consecutive minutes, and the third-level warning is when a critical deviation affects the potency of the drug; specifically, based on the quality standards for drug storage and transportation, the specific thresholds and trigger conditions for each level of quality warning are clarified; for environmental parameters, the first-level warning is set when the environmental parameters deviate from the standard value by ±2°C; the second-level warning is when the environmental parameters exceed the first-level warning threshold for 30 consecutive minutes; the third-level warning is when a critical parameter deviation that may directly affect the potency of the drug occurs; real-time monitoring data on environmental parameters and equipment operating status is obtained from the data collection network deployed at each node in the drug circulation; when the monitoring data shows that the environmental parameters deviate from the standard value by ±2°C for the first time, the cloud processor triggers the first-level quality warning; if, after the first-level warning is triggered, the environmental parameters continue to deviate and exceed the first-level warning threshold for 30 consecutive minutes, the cloud processor automatically upgrades the warning level to the second level; when a deviation of a key parameter that may affect the potency of the drug is detected, the cloud processor immediately triggers the third-level quality warning; Deploy automatically triggered smart contract rules based on the early warning mechanism, including expiration date management, circulation control and quality traceability; specifically, deploy expiration date management smart contracts based on drug expiration date data and early warning mechanisms; configure circulation control smart contracts in combination with quality early warning mechanisms; develop quality traceability smart contracts to deeply bind drug life cycle data with early warning events; integrate the deployed expiration date management, circulation control and quality traceability smart contracts into the blockchain platform to ensure that the contracts can be automatically executed when the early warning mechanism is triggered; deeply integrate smart contracts with the company's warehouse management system, logistics distribution system, and order management system business systems to achieve real-time data interaction and automated collaboration of business processes.

[0040] In an embodiment of the present invention, a dynamic inventory allocation mechanism implements differentiated strategies for different types of orders, automatically locks inventory for electronic prescription orders of medical institutions, and ensures the timeliness of medical medication; performs preemptive allocation for high-priority urgent orders, giving priority to meeting urgent needs; activates alternative drug rules and cross-warehouse allocation plans when inventory is insufficient to reduce out-of-stock rates; based on the drug distribution feature matrix and multi-source road condition information, orders are intelligently split according to the optimized distribution path, and orders are accurately divided into wholesale and retail levels, and dynamically allocated in combination with the load status of supply chain nodes; this operation achieves efficient matching between orders and warehouse nodes, reducing unnecessary transportation links and resource waste; the generated order routing execution instruction set covers drug picking lists, delivery task orders and logistics status notification templates, providing standardized operation guidelines for each business link; picking lists with batch expiration date information guide warehouses to accurately pick; delivery task orders with temperature control requirements ensure the standardization of the transportation process; customized notification templates meet the information needs of different customers.

[0041] In a preferred embodiment of the present invention, step S5 selects geographic information and road condition information based on the monitoring data in step S4; and optimizes the delivery vehicle scheduling plan according to the road condition information, including: Integrate monitoring data into multi-dimensional road condition information in real time, including basic road network data, dynamic traffic flow, and meteorological environment. Specifically, this includes: establishing communication connections with basic road network data suppliers, traffic management department data platforms, and meteorological service agency data sources; cleaning and processing the acquired basic road network data, dynamic traffic flow data, and meteorological environment data; fusing the cleaned multi-dimensional road condition data, correlating basic road network data, dynamic traffic flow, and meteorological environment information with road segments as the core; and integrating the cleaned and fused multi-dimensional road condition data with drug distribution monitoring data. A spatiotemporal feature matrix is ​​constructed based on multi-dimensional road condition information, including a road section travel time prediction model, a regional distribution difficulty coefficient, and traffic control rules for special periods. Specifically, the matrix includes: extracting basic road network data, dynamic traffic flow data, and meteorological environment data from the accessed multi-dimensional road condition information; using a machine learning algorithm to train a road section travel time prediction model based on historical traffic flow data and meteorological environment data; taking an urban area as a unit, comprehensively considering the travel time prediction results of each road section in the area, road complexity, traffic flow density, and special terrain, to construct a regional distribution difficulty coefficient calculation model; collecting and organizing traffic control rules for special periods issued by urban traffic management departments, including information on restricted areas, restricted times, and prohibited vehicle types; integrating the output results of the road section travel time prediction model, the regional distribution difficulty coefficient, and traffic control rules for special periods into a matrix to construct a spatiotemporal feature matrix; Establish drug-vehicle matching rules based on the spatiotemporal feature matrix, including the configuration of special refrigerated trucks for cold-chain drugs, the requirement for two-person escort for narcotic drugs, and the load limit for large-volume drugs; specifically, extract key information from the constructed spatiotemporal feature matrix, including the travel time prediction of each road section at different times, the regional distribution difficulty coefficient, and traffic control rules during special periods; select a list of cold-chain drugs from the drug digital twin based on the temperature sensitivity level of the drugs; formulate corresponding refrigerated truck configuration standards for cold-chain drugs with different temperature sensitivity levels, and clarify the required temperature control range and humidity requirement parameters; identify narcotic drug orders from the drug-batch-order association mapping table, and extract the drug quantity and destination information in the order; select large-volume drugs from the order information based on the physical properties of the drugs. Formulate load limit rules to clarify the maximum load capacity and volume limit of different types of vehicles; integrate the configuration of refrigerated trucks for cold-chain drugs, the two-person escort for narcotic drugs, and the load limit rules for large-volume drugs to construct a drug-vehicle matching decision model; The delivery urgency is calculated based on the vehicle matching rules, including the red channel for emergency medicines, standard delivery time for conventional medicines, and scheduled delivery for chronic disease medicines. Specifically, the system extracts information on drug type, vehicle allocation, and estimated departure time from the vehicle matching plan, while retrieving drug usage and customer demand attributes from the order data. For identified emergency medicine orders, the delivery urgency is directly assigned. The shortest delivery time under ideal conditions is calculated by combining the road section travel time prediction and traffic control rules for special periods in the spatiotemporal feature matrix. For conventional medicine orders, the time difference between the estimated delivery time and the standard delivery time is calculated based on the preset standard delivery time requirements, combined with the estimated departure time after vehicle matching, the road section travel time prediction, and the regional delivery difficulty coefficient. Different urgency levels are determined based on the size of the time difference. For chronic disease medicine orders, the estimated delivery time after vehicle matching is compared with the customer's scheduled delivery time.

[0042] In an embodiment of the present invention, monitoring data is connected to multi-dimensional road condition information in real time, so that delivery vehicles can obtain basic road network data, dynamic traffic flow and meteorological environment information in a timely manner. This helps vehicles avoid congested roads and choose the best delivery route, thereby significantly shortening delivery time, improving delivery efficiency, and ensuring that medicines can be delivered to their destinations on time and accurately; a spatiotemporal feature matrix is ​​constructed based on multi-dimensional road condition information, which contains a road section travel time prediction model, regional distribution difficulty coefficient and traffic control rules for special periods, providing accurate data support for distribution decisions; companies can use this information to plan delivery routes in advance, arrange delivery times reasonably, avoid delays caused by traffic control or complex road conditions, and improve the reliability and stability of delivery; the drug-vehicle matching rules established based on the spatiotemporal feature matrix are used for different types of drugs. Corresponding transportation requirements have been formulated, such as the configuration of special refrigerated trucks for cold-chain drugs, the requirement for two-person escort for anesthetic drugs, and the load limit for large-volume drugs; this ensures the safety and quality of drugs during transportation, and avoids damage or deterioration of drugs due to improper transportation conditions; the delivery urgency is calculated according to the vehicle matching rules, and emergency drugs, routine drugs and chronic disease drugs are classified and managed, with different priorities such as red channel, standard time limit and appointment delivery set respectively; this enables emergency drugs to be delivered first and ensure the safety of patients' lives; at the same time, it can also reasonably arrange the delivery of routine drugs and chronic disease drugs to meet the needs of different customers and improve customer satisfaction.

[0043] like Figure 2 As shown, an embodiment of the present invention further provides an Internet-based pharmaceutical wholesale and retail integrated service system, comprising: The data acquisition module is used to connect to the hospital HIS system in real time through the API interface to collect electronic prescription data; the collected electronic prescription data is connected to the pharmaceutical wholesale enterprise ERP system to obtain the inventory status, batch number and expiration date of each drug from it to obtain inventory information; based on the inventory information, sales data from the retail terminal POS system is received and processed; The replenishment module uses an LSTM neural network to predict drug demand and assess inventory health. It then builds a linear programming model based on logistics constraints and cost optimization to generate a three-level replenishment recommendation list that includes product type, quantity, and timeliness to minimize operating costs. The distribution module is used to receive multiple types of orders from medical institutions, retail pharmacies, and individuals. It selects drugs based on the drug requirements in the order, combined with the purchase recommendation list and inventory information. Based on the data matching results, it extracts the drug's physical property identification, delivery coordinates, and time-limit labels. It selects compliant delivery nodes and calculates spherical distances. It constructs an initial convex hull vertex sequence by polar angle sorting, removes non-convex points to generate a minimum convex polygon path, and then maps it into an actual delivery node sequence. It triggers order splitting based on the continuous distribution of wholesale nodes in the path, aggregates drug requirements covered by wholesale nodes into bulk purchase instructions, and decomposes retail terminal service requirements into terminal delivery instructions. Finally, it routes wholesale-level orders to wholesale enterprise nodes and retail-level orders to pharmacy nodes, generating routing order data packets with path encoding. The monitoring module is used to generate a unique blockchain traceability code for each batch of drugs based on the routing order data packet. The traceability code records the complete flow process from the manufacturer to the end consumer, and monitors the storage temperature and humidity quality indicators in real time to obtain monitoring data. The optimization module is used to select geographic information and road condition information based on monitoring data; and optimize the distribution vehicle scheduling plan based on road condition information.

[0044] It should be noted that this system is a system corresponding to the above method, and all implementation methods in the above method embodiment are applicable to this embodiment and can achieve the same technical effects.

[0045] The above is a preferred embodiment of the present invention. It should be pointed out that for ordinary technicians in this technical field, several improvements and modifications can be made without departing from the principles of the present invention. These improvements and modifications should also be regarded as within the scope of protection of the present invention.

Claims

1. A comprehensive medicine wholesale and retail service method based on the Internet, characterized in that: include: Step S1: Connect to the hospital HIS system in real time through the API interface to collect electronic prescription data; Connect the collected electronic prescription data with the pharmaceutical wholesaler's ERP system to obtain the inventory status, batch number, and expiration date of each drug, thereby obtaining inventory information; Receive sales data from the retail terminal POS system based on inventory information and process the sales data; Step S2: Use an LSTM neural network to predict drug demand and evaluate inventory health. Combined with logistics constraints and cost optimization, a linear programming model is established to generate a three-level replenishment recommendation list that includes variety, quantity, and timeliness to minimize operating costs. Step S3: Receive multiple types of orders from medical institutions, retail pharmacies, and individuals. Select drugs based on the drug demand in the order, combined with the purchase recommendation list in step S2 and the inventory information in step S1. Extract the drug physical property identification, delivery coordinates, and time-limit labels based on the data matching results. Select compliant delivery nodes and calculate the spherical distance. Construct an initial convex hull vertex sequence by polar angle sorting. Remove non-convex points to generate a minimum convex polygon path, which is then mapped into an actual delivery node sequence. Trigger order splitting based on the continuous distribution of wholesale nodes in the path. Aggregate the drug demand covered by the wholesale nodes into bulk purchase instructions, and decompose the demand for retail terminal services into terminal delivery instructions. Finally, route wholesale-level orders to wholesale enterprise nodes and retail-level orders to pharmacy nodes, generating a routing order data packet with path encoding. Step S4: generating a unique blockchain traceability code for each batch of drugs based on the routing order data packet in step S3; The traceability code records the complete flow process from the manufacturer to the end consumer, and monitors the storage temperature and humidity quality indicators in real time to obtain monitoring data; Step S5, selecting geographic information and road condition information based on the monitoring data in step S4; Optimize delivery vehicle scheduling plans based on road condition information.

2. The Internet-based pharmaceutical wholesale and retail integrated service method according to claim 1, characterized in that: Step S1: Connecting to the hospital HIS system in real time through the API interface to collect electronic prescription data; connecting the collected electronic prescription data to the pharmaceutical wholesale enterprise ERP system to obtain the inventory status, batch number and expiration date information of each drug to obtain inventory information; Receive sales data from the retail terminal POS system based on inventory information and process the sales data, including: Connect to the hospital HIS system in real time through the API interface and receive electronic prescription data packets in real time; Perform structured parsing of prescription data packets to extract key fields, including: patient anonymized identifier, drug generic name and strength, dosage and frequency, and prescription timestamp; Establish a data channel to the pharmaceutical wholesaler's ERP system based on the analysis of data packets, and query and obtain the current inventory availability and distribution location, drug batch number and expiration date information, and special storage requirements in real time; Build a dynamic drug inventory database based on current inventory availability, enabling minute-by-minute updates of inventory status, automatic early warnings for near-expiry drugs, and real-time calculation of inventory turnover rates. Connect the inventory dynamic database to the retail terminal POS system data flow to perform sales record authenticity verification, drug sales temporal and spatial distribution analysis, and abnormal transaction pattern detection; Generate a drug sales feature matrix based on data streams, including regional sales heat maps, time period sales fluctuation curves, and associated sales combination patterns; Match data streams to correlate data, including mapping prescription drugs with inventory availability, correlating sales trends with inventory turnover, and optimizing regional demand and distribution networks to obtain correlated data. The associated data is output into a standardized data set, including a time-aligned unified data view, drug full-chain status indicators, and data quality assessment reports.

3. The Internet-based pharmaceutical wholesale and retail integrated service method according to claim 2, characterized in that: Step S2 uses an LSTM neural network to predict drug demand and assess inventory health. A linear programming model is established based on logistics constraints and cost optimization to generate a three-level replenishment recommendation list that includes variety, quantity, and timeliness to minimize operating costs. This includes: Based on sales data, the pre-trained LSTM neural network model architecture, consisting of input, hidden, and output layers, is loaded. The forecasting calculations are then dynamically adjusted to include seasonal fluctuation factors, epidemiological impact coefficients, and corrections for regional special events. Construct a multi-dimensional inventory status matrix based on the model architecture, including the current available inventory quantity and distribution location, the status of in-transit replenishment orders, and warning signs for drugs nearing their expiration dates; Calculate inventory health indicators for each node based on the inventory status matrix, including turnover rate compliance, inventory age distribution analysis, and out-of-stock risk probability; By integrating real-time inventory data and demand forecast results, and combining logistics resource status to set cost parameters, warehousing and transportation constraints, and business rules, a linear programming replenishment optimization model is constructed with the goal of minimizing total operating costs. Generate a three-level replenishment recommendation list based on the model.

4. The Internet-based pharmaceutical wholesale and retail integrated service method according to claim 3, characterized in that: By integrating real-time inventory data and demand forecast results, and combining logistics resource status to set cost parameters, warehousing and transportation constraints, and business rules, a linear programming replenishment optimization model is constructed with the goal of minimizing total operating costs, including: Establish a drug data index table and load real-time inventory status data, which includes drug batch information, current available quantity and expiration date distribution in each warehouse; Receive the forecast results of drug demand by category for the next 7 days output by the demand forecast module, and compare the forecast demand with the inventory status data to obtain the supply and demand gap comparison results; Based on the comparison results, the current logistics resource status data is obtained, including the types of available transportation tools, the maximum storage capacity of each warehouse, and the load threshold of the regional distribution center; Based on the logistics resource status data, multi-dimensional cost parameters are set, including the purchase price gradient discount rule, the unit storage daily average cost coefficient, and the mileage cost benchmark value of different transportation routes; Define storage constraints based on storage capacity data, including maximum storage space limits for each warehouse, storage capacity ratio requirements for drugs in different temperature zones, and independent storage capacity thresholds for hazardous materials. Configure transport restrictions based on the type of transport vehicle, including maximum load for a single delivery, temperature control range for cold chain vehicles, and qualification requirements for special drug transport. Initialize the linear programming solution environment according to preset business rule parameters, wherein the business rule parameters include the minimum purchase order quantity, the shortest supplier delivery cycle, and the priority level of the hospital's emergency orders; Construct a decision variable matrix and define the replenishment range of each drug at each warehouse node. The range is determined by the upper limit of the supplier's supply capacity and the lower limit of the warehouse's receiving frequency. The objective function is set to minimize the total operating cost and add multi-level constraints. The total operating cost is composed of the weighted sum of procurement cost, warehousing cost and transportation cost, among which the weight coefficient of transportation cost is dynamically adjusted according to the distribution path.

5. The Internet-based pharmaceutical wholesale and retail integrated service method according to claim 4, characterized in that: Step S3: Receive multiple types of orders from medical institutions, retail pharmacies, and individuals; select drugs based on the drug requirements in the orders, combined with the purchase recommendation list in step S2 and the inventory information in step S1, including: Receive multi-type heterogeneous order data from medical institutions, retail pharmacies, and individuals, including electronic prescription orders from medical institutions, replenishment orders from retail pharmacies, and online drug purchase orders from individuals; Standardized parsing of heterogeneous order data includes mapping drug codes in orders to the national medical insurance standard coding system, parsing address text information into longitude and latitude coordinates, and categorizing delivery time requirements into three priority tags: urgent delivery, regular delivery, and scheduled delivery, to obtain standardized order data. The drug matching logic is executed based on the standardized order data, including: prioritizing the allocation of inventory batches with near-expiry dates according to the drug expiration priority rules, matching cold chain drugs with node inventory with temperature-controlled warehousing capabilities, and verifying the terminal sales qualification license status for special anesthetic drugs to obtain data matching results.

6. The Internet-based pharmaceutical wholesale and retail integrated service method according to claim 5, characterized in that: In step S3, a routing order data packet with path coding is generated, including: Based on the data matching results, extract the physical property classification identification of the drug, the longitude and latitude coordinates of the delivery destination, and the order time priority label; Filtering a set of available delivery nodes that meet the drug transportation conditions based on the physical property classification identifier, calculating the spherical distance from each node to the destination based on the longitude and latitude coordinates of the delivery destination, and loading real-time road network topology data; Using the timeliness priority label as a constraint, the delivery node set is mapped into two-dimensional Euclidean space coordinate points, and the convex hull algorithm is used for iterative calculation: The coordinate point set is sorted by polar angle to construct an initial convex hull vertex sequence; non-convex hull vertices are scanned point by point and eliminated to generate a minimum convex polygon boundary path; the convex polygon vertices are converted into a sequence of actual delivery path nodes based on the road network topology data; Based on the distribution path node sequence, the spatial distribution relationship between wholesale warehouses and retail terminals in the path is analyzed: When the path contains ≥3 wholesale warehouse nodes in a row, wholesale-level order splitting is triggered; when there is a dense cluster of retail terminals at the end of the path, retail-level order splitting is triggered; The order structure is reconstructed based on the splitting rules. Wholesale-level orders retain the drug demand covered by the wholesale warehouse nodes in the path and aggregate them into bulk purchase instructions. Retail-level orders extract the drug demand served by the retail terminals at the end of the path and decompose them into terminal delivery instructions. Wholesale-level orders are routed to the supply chain nodes of pharmaceutical wholesale enterprises, and retail-level orders are routed to the supply chain nodes of retail pharmacies, generating routing order data packets with path coding.

7. The Internet-based pharmaceutical wholesale and retail integrated service method according to claim 6, characterized in that: Step S4: generating a unique blockchain traceability code for each batch of drugs based on the routing order data packet in step S3; The traceability code records the entire flow process from the manufacturer to the end consumer, and monitors the storage temperature and humidity quality indicators in real time to obtain monitoring data, including: Create a digital twin of the drug based on routing order information and generate a GS1 standard traceability code for each minimum sales unit; Establish a drug-batch-order association mapping table based on the traceability code, and record the hash value of the initial manufacturer's qualification document; According to the mapping table, the entire chain of evidence is circulated, and the chain is monitored in real time to monitor the data collection network; Establish a three-level quality warning mechanism, including: Level 1 warning for environmental parameters deviating from the standard value by ±2°C, Level 2 warning for exceeding the threshold value for 30 consecutive minutes, and Level 3 warning for critical deviations that affect drug potency; Deploy automatically triggered smart contract rules based on the early warning mechanism, including validity period management, circulation control and quality traceability.

8. The Internet-based pharmaceutical wholesale and retail integrated service method according to claim 7, characterized in that: Step S5, selecting geographic information and road condition information based on the monitoring data in step S4; Optimize delivery vehicle dispatching plans based on road conditions, including: Integrate monitoring data into multi-dimensional road condition information in real time, including basic road network data, dynamic traffic flow and meteorological environment; Construct a spatiotemporal feature matrix based on multi-dimensional road condition information, including a road section travel time prediction model, regional distribution difficulty coefficients, and traffic control rules for special periods; Establish drug-vehicle matching rules based on the spatiotemporal feature matrix, including the configuration of dedicated refrigerated trucks for cold-chain drugs, the requirement for two-person escort for anesthetic drugs, and the load limit for large-volume drugs; Delivery urgency is calculated based on vehicle matching rules, including red channels for emergency medicines, standard delivery times for conventional medicines, and scheduled delivery for chronic disease medicines.

9. An Internet-based pharmaceutical wholesale and retail integrated service system, characterized in that: Applied to the method according to any one of claims 1 to 8, comprising: The data acquisition module is used to connect to the hospital HIS system in real time through the API interface to collect electronic prescription data; the collected electronic prescription data is connected to the pharmaceutical wholesale enterprise ERP system to obtain the inventory status, batch number and expiration date of each drug from it to obtain inventory information; based on the inventory information, sales data from the retail terminal POS system is received and processed; The replenishment module uses an LSTM neural network to predict drug demand and assess inventory health. It then builds a linear programming model based on logistics constraints and cost optimization to generate a three-level replenishment recommendation list that includes product type, quantity, and timeliness to minimize operating costs. The distribution module is used to receive multiple types of orders from medical institutions, retail pharmacies, and individuals. It selects drugs based on the drug requirements in the order, combined with the purchase recommendation list and inventory information. Based on the data matching results, it extracts the drug's physical property identification, delivery coordinates, and time-limit labels. It selects compliant delivery nodes and calculates spherical distances. It constructs an initial convex hull vertex sequence by polar angle sorting, removes non-convex points to generate a minimum convex polygon path, and then maps it into an actual delivery node sequence. It triggers order splitting based on the continuous distribution of wholesale nodes in the path, aggregates drug requirements covered by wholesale nodes into bulk purchase instructions, and decomposes retail terminal service requirements into terminal delivery instructions. Finally, it routes wholesale-level orders to wholesale enterprise nodes and retail-level orders to pharmacy nodes, generating routing order data packets with path encoding. The monitoring module is used to generate a unique blockchain traceability code for each batch of drugs based on the routing order data packet. The traceability code records the complete flow process from the manufacturer to the end consumer, and monitors the storage temperature and humidity quality indicators in real time to obtain monitoring data. The optimization module is used to select geographic information and road condition information based on monitoring data; and optimize the distribution vehicle scheduling plan based on road condition information.

10. A computing device, characterized in that include: one or more processors; A storage device for storing one or more programs, wherein when the one or more programs are executed by the one or more processors, the one or more processors implement the method according to any one of claims 1 to 8.

Citation Information

Patent Citations

  • Hospital drug delivery method based on push-and-pull combination of dashboard

    CN103927642A

  • Article replenishment method and device and storage medium

    CN113762701A

  • Medicinal material replenishment method and device, electronic equipment and computer readable medium

    CN119274763A

  • Drug replenishment method and device, electronic equipment and storage medium

    CN119539691A

  • Medical drug management system and optimization method

    CN119993410A

Cited By

  • Vaccine management method, system and equipment based on block chain and medium

    CN120725560A

  • Drug sales management method based on artificial intelligence

    CN120931329A

  • A medicine sales management method based on artificial intelligence

    CN120931329B

  • Real-time processing system of instant retail service platform based on multi-source heterogeneous data

    CN121073611A

  • Data management system and method based on large model

    CN121146674A