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

Through real-time data docking and intelligent algorithm optimization, the 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.

CN120525162BActive Publication Date: 2025-10-17HUNAN LONGFA PHARMACEUTICAL TECHNOLOGY CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

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

AI Technical Summary

Technical Problem

Traditional pharmaceutical supply chain management suffers from data silos, quality traceability difficulties, and insufficient distribution optimization, resulting in insufficient demand forecast accuracy, inefficient inventory turnover, and delayed responses to emergency orders.

Method used

Through the API interface, it connects to the hospital HIS system, the pharmaceutical wholesale enterprise ERP system and the retail terminal POS system in real time, uses the LSTM neural network to predict drug demand, combines logistics constraints and cost optimization to establish a linear programming model, generates a replenishment recommendation list, and optimizes the delivery route through the blockchain traceability code and convex hull algorithm, monitors temperature and humidity quality indicators in real time, and optimizes the dispatch of delivery vehicles.

Benefits of technology

It realizes real-time monitoring and dynamic management of drug inventory status, improves the accuracy of demand forecasting and distribution efficiency, ensures drug quality and safety, and reduces operating costs and losses.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120525162B_ABST
    Figure CN120525162B_ABST
Patent Text Reader

Abstract

The application provides an internet-based medical wholesale and retail comprehensive service method and system, relates to the technical field of medicine, and comprises the following steps: collecting electronic prescription data by real-time docking a hospital HIS system through an API interface; and docking the collected electronic prescription data with an ERP system of a medicine wholesale enterprise to obtain the stock status, batch number and valid period information of each medicine, and obtain stock information. In the application, the stock information can be obtained and dynamically managed by real-time docking the hospital HIS system, the ERP system of the medicine wholesale enterprise and a retail terminal POS system. The real-time data updating not only improves the stock turnover rate, but also automatically warns about medicines with a near expiration date, thereby reducing the loss of expired medicines; the LSTM neural network is used to predict the demand for medicines, and a linear programming model is used to generate replenishment suggestions, so that the replenishment process can be optimized while minimizing the operating cost, and the stock can be ensured to be sufficient and efficient.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The present application relates to the technical field of medicine, in particular to a medical wholesale and retail comprehensive service method and system based on the Internet. BACKGROUND

[0002] With the rapid development of the medical circulation industry, the traditional medical supply chain management mode is facing many challenges:

[0003] Data island problem: there is a lack of effective data interconnection mechanism between hospital HIS system, wholesale enterprise ERP system and retail terminal POS system, resulting in: insufficient demand prediction accuracy, low inventory turnover efficiency and delayed emergency order response;

[0004] Quality traceability dilemma: paper document traceability system has tampering risk, cold chain medicine temperature control data record is incomplete and problem medicine recall cycle is long;

[0005] Insufficient distribution optimization: path planning is static, utilization rate of transport capacity is low and abnormal processing is lagging behind. SUMMARY

[0006] The technical problem to be solved by the present application is to provide a medical wholesale and retail comprehensive service method and system based on the Internet, which can improve the fineness of data preprocessing to ensure the accuracy and comprehensiveness of deformation monitoring.

[0007] To solve the above technical problems, the technical scheme of the present application is as follows:

[0008] In a first aspect, a medical wholesale and retail comprehensive service method based on the Internet, the method comprising:

[0009] Step S1, real-time docking with hospital HIS system through API interface, collecting electronic prescription data; docking the collected electronic prescription data with the medicine wholesale enterprise ERP system to obtain the inventory status, batch number and valid period information of each medicine, and obtaining the inventory information; receiving the sales data of the retail terminal POS system according to the inventory information, and processing the sales data;

[0010] Step S2, predicting medicine demand and evaluating inventory health status through LSTM neural network, establishing a linear programming model combining logistics constraints and cost optimization, generating a three-level restocking suggestion list containing variety, quantity and timeliness to realize minimum operation cost;

[0011] Step S3, receiving multiple types of orders from medical institutions, retail pharmacies and individuals; selecting drugs according to the drug requirements in the order, combining the purchase recommendation list in step S2 and the inventory information in step S1, extracting the physical property identifier, distribution coordinates and time limit label of the drug based on the data matching result, screening the compliance distribution node and calculating the spherical distance, constructing the initial convex hull vertex sequence through the polar angle sorting, eliminating the non-convex point to generate the minimum convex polygon path, and then mapping it to the actual distribution node sequence; according to the continuous distribution of wholesale nodes in the path, triggering order splitting, aggregating the drug requirements covered by the wholesale nodes into bulk purchase instructions, and decomposing the demand of retail terminal services into terminal distribution instructions; finally, routing the wholesale level order to the wholesale enterprise node and the retail level order to the pharmacy node to generate a routing order data packet with path encoding;

[0012] Step S4, based on the routing order data packet in step S3, generating a unique blockchain trace code for each batch of drugs; the trace code records the complete flow process from the production enterprise to the end consumer, and monitors and stores the temperature and humidity quality indicators in real time to obtain monitoring data;

[0013] Step S5, based on the monitoring data in step S4, selecting geographic information and road condition information; optimizing the distribution vehicle scheduling scheme according to the road condition information.

[0014] Further, step S1, real-time docking with the hospital HIS system through the API interface to collect electronic prescription data; docking the collected electronic prescription data with the drug wholesale enterprise ERP system to obtain the inventory status, batch number and expiration date information of each drug, and obtaining the inventory information; receiving the sales data of the retail terminal POS system according to the inventory information, and processing the sales data, including:

[0015] Real-time docking with the hospital HIS system through the API interface to receive electronic prescription data packets in real time;

[0016] Structural analysis of the prescription data packet to extract key fields, including: patient anonymized identifier, drug generic name and specification, medication dose and frequency, and prescription issuance timestamp;

[0017] According to the analysis of the data packet, a data channel of the drug wholesale enterprise ERP system is established to query and obtain the current inventory available quantity and distribution location, drug batch number and expiration date information, and special storage requirements in real time;

[0018] According to the current inventory available quantity, a dynamic drug inventory database is constructed to realize minute-level update of inventory status, automatic warning of near-expiration drugs and real-time calculation of inventory turnover rate;

[0019] The inventory dynamic database accesses the retail terminal POS system data stream to perform sales record authenticity verification, drug sales spatio-temporal distribution analysis, and abnormal transaction mode detection.

[0020] A drug sales feature matrix is generated according to the data stream, including a regional sales heat map, a time period sales fluctuation curve, and a related sales combination mode.

[0021] Data correlation matching is implemented by the data stream, including prescription drug and inventory available quantity mapping, sales trend and inventory turnover correlation, and regional demand and distribution network optimization, to obtain correlated data.

[0022] The correlated data is output to a standardized data set processing, including a time-aligned unified data view, a drug full-link state indicator, and a data quality evaluation report.

[0023] Further, in step S2, the drug demand is predicted by an LSTM neural network, and the inventory health state is evaluated, a linear programming model is established combining logistics constraints and cost optimization, a three-level replenishment suggestion list containing varieties, quantities and time limits is generated to minimize operating costs, including:

[0024] According to the sales data, a pre-trained LSTM neural network model architecture is loaded, including an input layer, a hidden layer and an output layer; when performing prediction calculation, the parameters are dynamically adjusted, including seasonal fluctuation factors, epidemiological influence coefficients and regional special event correction values.

[0025] A multi-dimensional inventory state matrix is constructed according to the model architecture, including current available inventory quantity and distribution location, in-transit replenishment order state and near-expiry drug warning identifier.

[0026] According to the inventory state matrix, the inventory health degree indicators of each node are calculated, including turnover rate compliance, inventory age distribution analysis and out-of-stock risk probability.

[0027] By integrating real-time inventory data and demand prediction results, combining logistics resource state setting cost parameters, warehouse transportation constraints and business rules, a linear programming replenishment optimization model is constructed with the goal of minimizing total operating costs.

[0028] A three-level replenishment suggestion list is generated according to the model.

[0029] Further, by integrating real-time inventory data and demand prediction results, combining logistics resource state setting cost parameters, warehouse transportation constraints and business rules, a linear programming replenishment optimization model is constructed with the goal of minimizing total operating costs, including:

[0030] A drug data index table is established and real-time inventory state data is loaded, which includes drug batch information, current available quantity and effective period distribution of each warehouse.

[0031] Receiving the future 7-day category drug demand prediction results output by the demand prediction module, and comparing the predicted demand with the inventory state data to obtain a comparison result;

[0032] According to the comparison result, the current logistics resource state data is obtained, including the available transportation tool type, the maximum storage capacity of each warehouse, and the load threshold of the regional distribution center;

[0033] Based on the logistics resource state data, set multi-dimensional cost parameters, including purchase unit price gradient discount rules, unit storage daily cost coefficient, and mileage cost benchmark value of different transportation paths;

[0034] According to the storage capacity data, define the storage constraint conditions, including the maximum storage space limit of each warehouse, the storage capacity ratio requirement of different temperature zone drugs, and the independent warehouse capacity threshold of dangerous goods;

[0035] Based on the transportation tool type, configure the transportation restriction conditions, including the maximum single distribution load, the cold chain vehicle temperature control range, and the special drug transportation qualification permission requirement;

[0036] According to the preset business rule parameters, initialize the linear programming solution environment, and the business rule parameters include the minimum purchase order quantity, the shortest supplier delivery period, and the hospital emergency order priority level;

[0037] Construct a decision variable matrix and define the replenishment value range of each drug in each warehouse node, which is determined by the upper limit of supplier supply capacity and the lower limit of warehouse receiving frequency;

[0038] Set the objective function to minimize the total operating cost, and add multi-level constraint conditions, and the total operating cost is composed of the weighted sum of purchase cost, storage cost and transportation cost, wherein the transportation cost is dynamically adjusted according to the distribution path weight coefficient.

[0039] Further, step S3, receiving multiple types of orders from medical institutions, retail pharmacies and individuals; according to the drug demand in the order, combining the purchase suggestion list in step S2 and the inventory information in step S1, selecting drugs, including:

[0040] Receiving multiple types of heterogeneous order data from medical institutions, retail pharmacies and individuals, the order data including electronic prescription orders of medical institutions, replenishment orders of retail pharmacies and online drug purchase orders of individuals;

[0041] Standardized analysis and processing of heterogeneous order data, including: mapping the drug codes in the order to the national medical insurance standard coding system, parsing the address text information into latitude and longitude geographic coordinates, and classifying the delivery time requirement into three priority labels: emergency delivery, regular delivery and appointment delivery, to obtain standardized order data;

[0042] Performing drug matching logic based on standardized order data, including: according to the drug expiration date priority rule, preferentially allocating near-expiration inventory batches, matching cold-chain drug nodes with temperature-controlled storage capabilities, and verifying terminal sales qualification license status for narcotic special drugs, to obtain data matching results.

[0043] Further, in step S3, a route order data packet with path encoding is generated, including:

[0044] Based on the data matching results, the physical property classification identifier of the drug, the latitude and longitude coordinates of the delivery destination, and the order time limit priority label are extracted;

[0045] According to the physical property classification identifier, filter the available delivery node set that meets the drug transportation conditions, calculate the spherical distance from each node to the destination combined with the latitude and longitude coordinates of the delivery destination, and load real-time road network topology data;

[0046] Taking the time limit priority label as a constraint condition, mapping the delivery node set to a two-dimensional Euclidean space coordinate point, and executing a convex hull algorithm to iteratively calculate:

[0047] Sort the coordinate point set by polar angle and construct an initial convex hull vertex sequence; scan point by point and remove non-convex vertices to generate a minimum convex polygon boundary path; convert the convex polygon vertices to actual delivery path node sequences according to the road network topology data;

[0048] Based on the delivery path node sequence, analyze the spatial distribution relationship between the wholesale warehouse and the retail terminal in the path:

[0049] When the path continuously contains ≥3 wholesale warehouse nodes, trigger wholesale order splitting; when there is a dense cluster of retail terminals at the end of the path, trigger retail order splitting;

[0050] According to the splitting rule, reconstruct the order structure, the wholesale order retains the drug demand covered by the wholesale warehouse nodes in the path, and is aggregated into bulk purchase instructions; the retail order extracts the drug demand served by the retail terminal at the end of the path, and is decomposed into terminal delivery instructions;

[0051] Route the wholesale order to the drug wholesaler supply chain node, and route the retail order to the retail pharmacy supply chain node to generate a route order data packet with path encoding.

[0052] Further, in step S4, based on the route 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 production enterprise to the terminal consumer, and real-time monitors and stores temperature and humidity quality indicators to obtain monitoring data, including:

[0053] Based on the routing order information, a digital twin of the medicine is created, and a GS1 standard traceability code is generated for each minimum sales unit;

[0054] According to the traceability code, a mapping table of medicine-batch-order is established, and the initial production enterprise qualification file hash value is recorded;

[0055] According to the mapping table, the whole chain of circulation is stored, and the link is monitored in real time, and the monitoring data is collected through the network;

[0056] A three-level quality early warning mechanism is set, including: the first level warning is that the environmental parameter deviates from the standard value ±2℃, the second level warning is that the threshold is exceeded for 30 minutes in succession, and the third level warning is that the key deviates from the standard value affecting the potency of the medicine;

[0057] According to the early warning mechanism, an automatically triggered smart contract rule is deployed, including validity period management, circulation control and quality traceability.

[0058] Further, in step S5, based on the monitoring data in step S4, geographical information and traffic information are selected; and according to the traffic information, a distribution vehicle scheduling scheme is optimized, including:

[0059] The monitoring data is connected to multi-dimensional traffic information in real time, including basic road network data, dynamic traffic flow and meteorological environment;

[0060] According to the multi-dimensional traffic information, a space-time feature matrix is constructed, including a road section travel time prediction model, a regional distribution difficulty coefficient and a special time period traffic control rule;

[0061] According to the space-time feature matrix, a medicine-vehicle matching rule is established, including cold chain medicine special refrigerated vehicle configuration, narcotic drug double escort requirement and large volume medicine load limit;

[0062] According to the vehicle matching rule, the distribution urgency is calculated, including emergency medicine red channel, conventional medicine standard time limit and chronic disease medicine appointment distribution.

[0063] In the second aspect, an internet-based medical wholesale and retail comprehensive service system comprises:

[0064] A data acquisition module is used to connect a hospital HIS system in real time through an API interface to collect electronic prescription data; the collected electronic prescription data is connected to a medicine wholesale enterprise ERP system to obtain the inventory status, batch number and expiration date information of each medicine, and obtain inventory information; sales data of a retail terminal POS system is received according to the inventory information, and the sales data is processed;

[0065] The replenishment module is used for predicting drug demand and evaluating inventory health status through an LSTM neural network, establishing a linear programming model in combination with logistics constraints and cost optimization, and generating a three-level replenishment suggestion list containing varieties, quantities and time limits to realize minimum operation cost;

[0066] The distribution module is used for receiving multi-type orders from medical institutions, retail pharmacies and individuals, selecting drugs according to drug demand in the orders in combination with the purchase suggestion list and inventory information, extracting drug physical property identifiers, distribution coordinates and time limit labels based on data matching results, screening compliant distribution nodes and calculating spherical distance, constructing an initial convex hull vertex sequence through polar angle sorting, generating a minimum convex polygon path by eliminating non-convex points, and then mapping the path into an actual distribution node sequence; according to the continuous distribution of wholesale nodes in the path, triggering order splitting, aggregating drug demand covered by the wholesale nodes into bulk purchase instructions, and decomposing demand served by retail terminals into terminal distribution instructions; finally, routing wholesale-level orders to wholesale enterprise nodes and retail-level orders to pharmacy nodes to generate routing order data packets with path encoding;

[0067] The monitoring module is used for generating 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 production enterprise to the terminal consumer, and real-time monitoring and storage of temperature and humidity quality indicators are obtained to obtain monitoring data.

[0068] The optimization module is used for selecting geographic information and road condition information based on the monitoring data; and optimizing the distribution vehicle scheduling scheme according to the road condition information.

[0069] In a third aspect, a computing device includes:

[0070] One or more processors;

[0071] A storage device for storing one or more programs, when the one or more programs are executed by the one or more processors, so that the one or more processors implement.

[0072] In a fourth aspect, a computer readable storage medium stores a program, which is executed by a processor to implement the method.

[0073] The above-mentioned scheme of the present application at least has the following beneficial effects:

[0074] Real-time docking with hospital HIS system, pharmaceutical wholesale enterprise ERP system and retail terminal POS system through API interface, realizing seamless circulation of electronic prescription, inventory and sales data, avoiding information lag or manual input error, so that each link of the supply chain (production, wholesale, retail, medical institutions) can master the real-time drug dynamics; The integrated multi-source data provides accurate basis for subsequent demand prediction, inventory management and order processing, reducing the problem of blind purchase or out-of-stock caused by information asymmetry.

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

[0076] The convex hull algorithm is used to optimize the distribution path, combined with the characteristics of the drugs (such as cold chain demand), distribution distance and timeliness requirements to ensure the efficiency of distribution; The wholesale / retail order is automatically split and routed to the corresponding node to reduce manual intervention, improve order processing speed and accuracy, and shorten the distribution cycle; A unique blockchain traceability code is generated for each batch of drugs to record the complete flow process from the production enterprise to the end consumer, realizing "traceable origin, traceable destination, and accountable responsibility", effectively preventing fake and inferior drugs from entering the market; Real-time monitoring of storage temperature and humidity and other key quality indicators ensures that the drugs meet the quality standards during the flow process (especially for temperature-sensitive drugs such as vaccines and biological agents), ensuring drug safety.

[0077] Combined with geographic information, traffic information and temperature and humidity monitoring data, the distribution vehicle scheduling scheme is dynamically optimized to reduce the delay caused by traffic congestion and ensure that the drugs (especially time-sensitive or temperature-sensitive drugs) are delivered on time and in quality, reducing distribution loss; Through full-chain digital management, efficient collaboration between production enterprises, wholesalers, retailers and medical institutions is achieved, forming a "demand-oriented" flexible supply chain. BRIEF DESCRIPTION OF DRAWINGS

[0078] Figure 1 is a flowchart of an internet-based medical wholesale and retail integrated service method provided by an embodiment of the present application.

[0079] Figure 2 is a schematic diagram of an internet-based medical wholesale and retail integrated service system provided by an embodiment of the present application. DETAILED DESCRIPTION

[0080] Exemplary embodiments of the present disclosure will be described in greater detail below with reference to the accompanying drawings. While exemplary embodiments of the present disclosure are shown in the drawings, it is understood that the present disclosure can be embodied in various forms and should not be limited by the embodiments set forth herein. Rather, these embodiments are provided so that the present disclosure can be thoroughly understood, and the scope of the present disclosure can be accurately conveyed to those skilled in the art.

[0081] As Figure 1 shown, an embodiment of the present application proposes an Internet-based pharmaceutical wholesale and retail integrated service method, which comprises the following steps:

[0082] Step S1, real-time docking with the hospital HIS system through the API interface to collect electronic prescription data; docking the collected electronic prescription data with the pharmaceutical wholesale enterprise ERP system to obtain the inventory status, batch number and expiration date information of each drug, and obtain the inventory information; receiving the sales data of the retail terminal POS system according to the inventory information, and processing the sales data;

[0083] Step S2, predicting drug demand and evaluating inventory health status through LSTM neural network, combining logistics constraints and cost optimization to establish a linear programming model, generating a three-level replenishment suggestion list containing variety, quantity and time limit to realize minimum operation cost;

[0084] Step S3, receiving multiple types of orders from medical institutions, retail pharmacies and individuals; selecting drugs according to the drug demand in the order, combining the purchase suggestion list in step S2 and the inventory information in step S1, extracting the physical property identifier, distribution coordinates and time limit label of the drug based on the data matching result, screening the compliance distribution node and calculating the spherical distance, constructing the initial convex hull vertex sequence through polar angle sorting, eliminating non-convex points to generate the minimum convex polygon path, and then mapping it to the actual distribution node sequence; according to the continuous distribution of wholesale nodes in the path, triggering order splitting, aggregating the drug demand covered by the wholesale nodes into bulk purchase instructions, and decomposing the demand served by the retail terminal into terminal distribution instructions; finally, routing the wholesale level order to the wholesale enterprise node and the retail level order to the pharmacy node to generate a routing order data packet with path encoding;

[0085] Step S4, based on the routing order data packet in step S3, generating a unique blockchain traceability code for each batch of drugs; recording the complete flow process from the production enterprise to the end consumer in the traceability code, and monitoring the storage temperature and humidity quality indicators in real time to obtain monitoring data;

[0086] Step S5, based on the monitoring data in step S4, selecting geographic information and road condition information; optimizing the distribution vehicle scheduling scheme according to the road condition information.

[0087] In the embodiments of the present application, by real-time docking the hospital HIS system and the drug wholesale enterprise ERP system, the drug inventory, batch number and expiration date information can be dynamically obtained, helping the enterprise to real-time master the inventory status of the drug, thereby reducing the inventory backlog and shortage; using the LSTM neural network to predict the drug demand, and combining the inventory information to perform inventory health assessment, which helps to identify potential drug shortage problems in advance, and generates an optimized replenishment list through the linear programming model, thereby reducing the operating cost; the convex hull algorithm is used to optimize the distribution path, and the drug characteristics (such as cold chain demand), distribution distance and time limit are combined to ensure the efficiency of the distribution; the wholesale / retail order is automatically split and routed to the corresponding node, reducing manual intervention, improving the order processing speed and accuracy, and shortening the distribution cycle; a unique blockchain traceability code is generated for each batch of drugs, recording the complete flow process from the production enterprise to the end consumer, realizing “traceable origin, traceable destination, and accountable responsibility”, effectively preventing fake and inferior drugs from flowing into the market; the key quality indicators such as storage temperature and humidity are monitored in real time to ensure that the drug meets the quality standards during the flow process (especially for temperature-sensitive drugs such as vaccines and biological agents), thereby ensuring drug safety.

[0088] In a preferred embodiment of the present application, in step S1, the electronic prescription data is collected by real-time docking the hospital HIS system through the API interface; the collected electronic prescription data is docked with the drug wholesale enterprise ERP system to obtain the inventory status, batch number and expiration date information of each drug, thereby obtaining the inventory information; the sales data of the retail terminal POS system is received according to the inventory information, and the sales data is processed, including:

[0089] The electronic prescription data packet is received in real time through the API interface to dock the hospital HIS system; specifically, the received electronic prescription data packet is first parsed to convert the data into a unified format; the electronic prescription data is verified; according to the drug name and dosage form, the interface with the drug wholesale enterprise ERP system is called to query the current inventory information of the drug; the inventory quantity, batch number and expiration date information are obtained and compared with the demand in the electronic prescription; according to the comparison result, the system predicts the demand quantity of the drug through the LSTM neural network to obtain the prediction result; combining the prediction result, the inventory information and the drug batch number and expiration date, a replenishment suggestion list is generated;

[0090] The prescription data packet is structurally parsed to extract key fields, including: patient anonymized identifier, drug generic name and specification, medication dosage and frequency, and prescription issuance timestamp; specifically including: parsing the received prescription data in JSON or XML format, identifying various fields therein, such as patient information, drug information, and prescription issuance time; verifying and checking the parsed data, verification including: verifying the validity of the patient anonymized identifier, verifying whether the drug generic name and specification exist in the drug database, verifying whether the medication dosage and frequency are within a reasonable range, and verifying whether the prescription issuance timestamp is within a valid time range;

[0091] A drug wholesaler ERP system data channel is established according to the parsing of the data packet, and the current inventory available quantity and distribution location, drug batch number and expiration date information, and special storage requirements are queried and obtained in real time; specifically including: receiving data packets from various business links of the drug wholesaler; performing format checking on the data packet to determine whether it conforms to the established data format specification; parsing the data packet into a data structure to identify the key information fields therein; performing validity verification on the parsed data to check whether the mandatory fields exist and conform to the specified format and value range; mapping the valid data to the corresponding fields and objects according to the data model and business logic within the ERP system; using the mapped data to query the current inventory available quantity in the inventory module of the ERP system; according to the result of the inventory available quantity query, obtaining the distribution information of the drug in different storage locations; extracting the special storage requirement information of the drug from the mapped data; formatting the integrated inventory available quantity, distribution location, drug batch number, and expiration date information according to the requirements of the ERP system for output;

[0092] A drug inventory dynamic database is constructed according to the current inventory available quantity, achieving minute-level update of inventory status, automatic warning of near-expiration drugs, and real-time calculation of inventory turnover rate; specifically including: receiving the current inventory available quantity data aggregated from various links, as well as the associated drug batch number, expiration date, distribution location, and storage requirement information; setting a timed task for the database, triggering a data update operation every minute; after updating the inventory status every minute, automatically scanning the expiration date information of all drug batches in the inventory dynamic database; after completing the inventory status update and near-expiration warning, calculating the inventory turnover rate of the drug in real time according to the historical warehouse-in and warehouse-out data in the inventory dynamic database and the current inventory available quantity;

[0093] The inventory dynamic database accesses the retail terminal POS system data stream to perform sales record authenticity verification, drug sales spatiotemporal distribution analysis, and abnormal transaction mode detection; specifically including: establishing a real-time data interface with the retail terminal POS system, pulling or receiving sales data stream at a minute-level frequency, including transaction time, drug ID, batch number, quantity, amount, customer ID, and terminal location coding field; cleaning, 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 the records of inventory shortage but sales as "abnormal overselling";

[0094] According to the data stream, a drug sales feature matrix is generated, including regional sales heat map, time period sales fluctuation curve, and associated sales combination mode; specifically including: screening valid sales records from the data stream accessed by the retail terminal POS system, including transaction time, drug ID, sales quantity, sales amount, and terminal location information; de-duplicating and supplementing the data; dividing the terminal location information into regions; calculating the total sales, sales amount, and sales frequency of each type of drug in each region, and sorting and classifying the sales heat of different regions according to the statistical results, with high heat regions marked in red, low heat regions marked in blue, and medium heat regions marked in yellow; presenting the regional sales heat information in the form of a heat map to visually display the drug sales heat distribution in each region, forming a regional sales heat map;

[0095] The data stream is correlated and matched to obtain associated data, including prescription drugs and inventory available quantity mapping, sales trend and inventory turnover correlation, and regional demand and distribution network optimization; specifically including: extracting all prescription drug data from the drug management system, including inventory quantity, drug type, and drug specification information for each drug; combining drug sales data and market demand forecasting; establishing a mapping relationship between inventory and drug sales by comparing inventory quantity and drug demand; after completing the mapping of drugs and inventory, analyzing the impact of sales trend on inventory turnover; extracting the sales trend mode by analyzing historical sales data; based on sales trend and inventory turnover, analyzing regional demand and distribution network optimization;

[0096] 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.

[0097] 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.

[0098] 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:

[0099] According to the sales data, load the pre-trained LSTM neural network model architecture, including the input layer, hidden layer and output layer; dynamically adjust the parameters when performing prediction calculation, including seasonal fluctuation factor, epidemiological influence coefficient and regional special event correction value; specifically including: loading sales data from data warehouse or real-time database; receiving sales data, converting data into a format that can be processed by neural networks; dynamically adjusting sales trends according to historical sales data and seasonal factors; sales in different regions may be affected by specific events; after the model architecture and parameter adjustment are completed, the cloud processor performs prediction calculation of the LSTM neural network; the model receives preprocessed sales data through the input layer and trains and calculates through the dynamically adjusted hidden layer;

[0100] According to the model architecture, a multi-dimensional inventory state matrix is constructed, including current available inventory quantity and distribution location, in-transit replenishment order status and near-expiration drug warning identifier; specifically including: extracting current available inventory quantity and corresponding drug distribution location information from the inventory dynamic database, including warehouse name and shelf number detailed location data; cleaning the extracted data to remove duplicate, incorrect or invalid data records; taking drug ID as the core identifier, establishing the basic framework of the multi-dimensional inventory state matrix; 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 related data of in-transit replenishment order into the corresponding column of the matrix according to the drug ID; according to the near-expiration drug data, accurately filling the near-expiration drug warning identifier into the "near-expiration drug warning identifier" column of the corresponding drug row in the matrix;

[0101] According to the inventory state matrix, calculate the inventory health index of each node, including turnover rate compliance, age distribution analysis and out-of-stock risk probability; specifically including: extracting the current available inventory quantity of each drug in each node and the sales quantity data in the past period from the inventory state matrix; determining the storage time and current time of each batch of drugs of each drug in each node according to the inventory state matrix, and calculating the age of each batch of drugs; obtaining the current available inventory quantity, in-transit replenishment order quantity and expected arrival time of each drug in each node from the inventory state matrix, and combining historical sales data to predict the sales demand in the future period;

[0102] By integrating real-time inventory data and demand prediction results, combined with the state of logistics resources, set cost parameters, warehouse transportation constraints and business rules, a linear programming replenishment optimization model is constructed to minimize the total operating cost as the goal; Specifically including: integrating data from different sources, including real-time inventory data and demand prediction results; Real-time inventory data comes from the warehouse management system, reflecting the current inventory level, inventory cycle and commodity storage situation; Preprocess these data, set relevant cost parameters according to the actual situation. These cost parameters include: reflect the cost of storing products in the warehouse, calculate the cost according to the transportation distance, logistics mode, transportation volume and other factors, and the potential sales loss caused by stockout, and the increase of storage and management cost caused by excess; According to the characteristics of the supply chain, set reasonable replenishment cycle and replenishment quantity limit, set priority replenishment rules according to the sales importance and demand volatility of different products, and different suppliers may have different distribution conditions or discount strategies; After completing data integration, cost parameter setting and constraint condition setting, the cloud processor will construct a linear programming model, the purpose is to minimize the total operating cost under the given constraint conditions;

[0103] According to the model, a three-level replenishment suggestion list is generated; Specifically including: the cloud processor obtains the optimal replenishment scheme generated by the linear programming replenishment optimization model, including the procurement quantity, allocation quantity and inventory holding quantity decision variables of each node; According to the stockout risk probability, inventory turnover rate, age and the influence degree on business, the classification standard of three-level replenishment suggestion is made; According to the classification standard, the drugs meeting the first-level suggestion condition are screened out; For these drugs, the drug name, drug ID, current inventory quantity, distribution location, expected stockout time, suggested replenishment quantity, suggested procurement supplier or allocation source node information are listed in detail; From the remaining drugs, the drugs meeting the second-level suggestion condition are screened out. The basic information, current inventory state, inventory health index situation, suggested replenishment quantity and replenishment time content of the drugs are recorded in the list; The remaining drugs meeting the three-level suggestion condition are sorted into a list.

[0104] In the embodiment of the present application, by using the LSTM neural network model, combined with seasonal fluctuations, epidemiology and regional special event dynamic parameter adjustment, the demand change trend of drugs can be accurately captured; A multi-dimensional inventory state matrix is constructed and the inventory health index is calculated, which can comprehensively and dynamically master the inventory status. Through the analysis of turnover rate, age distribution and stockout risk probability, enterprises can timely find potential problems in inventory management, such as unsold drug backlog and key drug stockout; Based on the demand prediction and inventory health evaluation results, combined with the logistics constraints and cost optimization, a linear programming model is constructed, which can consider the factors of procurement cost, warehouse cost and transportation cost, and generate a scientific and reasonable three-level replenishment suggestion list; The linear programming model integrates real-time inventory data, demand prediction results, logistics resource state multi-dimensional information, and also takes into account warehouse transportation constraints and business rules.

[0105] In a preferred embodiment of the present application, by integrating real-time inventory data and demand forecasting results, combining logistics resource status, setting cost parameters, warehouse transportation constraints and business rules, a linear programming replenishment optimization model is constructed to minimize the total operating cost, including:

[0106] A drug data index table is established and real-time inventory status data is loaded, which includes drug batch information, current available quantity and expiration date distribution of each warehouse; specifically including: according to business needs and data characteristics, the structure of the drug data index table is designed; real-time inventory status data is collected from various data sources; the cleaned data is classified according to drug ID, and the batch information of the same drug and the inventory status data of each warehouse are sorted; the sorted data is loaded into the drug data index table row by row; the change of inventory status data is monitored regularly or in real time, and when there is new inventory data, the drug data index table is updated in time;

[0107] The future 7-day demand prediction results of each drug category output by the demand forecasting module are received, and the predicted demand is compared with the inventory status data to obtain the comparison results; specifically including: receiving the future 7-day demand prediction results of each drug category output by the demand forecasting module through the data interface, checking the data integrity, including whether it covers all drug categories, whether the time range accurately covers the future 7 days, and whether the data format meets the agreed specification; from the established drug data index table, the current available quantity data of each drug category is extracted, and the batch information and expiration date distribution of the drug are obtained; the future 7-day drug demand prediction of each drug category is compared with the current available quantity of the corresponding drug category one by one; the calculated supply-demand gap data is summarized according to drug category and date to form a clear comparison result table;

[0108] According to 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; specifically including: according to the obtained supply-demand gap comparison results, it is clear which drug categories have supply-demand gap, and the size and distribution of the gap; according to the supply-demand gap comparison results, the logistics resource status data to be obtained is determined; through interaction with the logistics management system, transportation company and warehouse management system data sources, the current logistics resource status data is obtained; the obtained logistics resource status data is sorted; according to the sorted and verified data, a logistics resource status report is generated;

[0109] Setting multi-dimensional cost parameters based on the logistics resource state data, including purchase unit price gradient discount rules, unit storage daily cost coefficients, and mileage cost benchmark values of different transportation paths; specifically including: comprehensively analyzing the acquired logistics resource state data to clarify the distribution and characteristics of available transportation tool types, the restriction conditions of the maximum storage capacity of each warehouse, and the current situation of the load threshold of regional distribution centers; formulating purchase unit price gradient discount rules based on the purchase history data of the drugs and the quotation policy provided by the suppliers, combined with the transportation capacity of the transportation tools and the storage capacity restrictions in the logistics resource state; setting unit storage daily cost coefficients according to the types of each warehouse, the actual usage, and the storage capacity data in the logistics resource state; referring to the available transportation tool types, transportation distances, and load thresholds of regional distribution centers in the logistics resource state, determining the mileage cost benchmark values of different transportation paths;

[0110] Defining storage constraint conditions according to the storage capacity data, including the maximum storage space restrictions of each warehouse, the storage capacity proportioning requirements of drugs in different temperature zones, and the threshold values of dangerous goods independent warehouse capacity; specifically including: extracting the specific values of the maximum storage space of each warehouse from the acquired logistics resource state data to clarify the total area of the warehouse and the area information of each floor or partition; setting strict upper limit constraints for each warehouse based on the extracted maximum storage space data; formulating reasonable storage capacity proportioning of drugs in each temperature zone by referring to the storage space data of different temperature zones, combined with the storage characteristics of the drugs and the actual business needs; determining the threshold values of dangerous goods independent warehouse capacity according to the properties, quantities, and safety regulations requirements of dangerous goods, combined with the capacity data of dangerous goods independent warehouses;

[0111] Configuring transportation restriction conditions based on the types of transportation tools, including the maximum single distribution load, the temperature control range of cold chain vehicles, and the special drug transportation qualification permission requirements; specifically including: extracting the available transportation tool type information from the logistics resource state data to clarify the specific categories of ordinary trucks, refrigerated trucks, and special transportation vehicles, as well as the detailed parameters of the quantity and specifications of each transportation tool; determining the maximum single distribution load of each transportation tool according to the specifications and design parameters of different transportation tools; setting a reasonable temperature control range for cold chain vehicles according to the performance of their refrigeration equipment and the temperature requirements of drug storage; integrating the maximum single distribution load, the temperature control range of cold chain vehicles, and the special drug transportation qualification permission requirements to form a complete transportation restriction condition system;

[0112] According to the preset business rule parameter, the linear programming solving environment is initialized, and the business rule parameter includes the minimum purchase order quantity, the shortest supply cycle of the supplier and the priority level of the hospital emergency order; Specifically, it includes: extracting the minimum purchase order quantity, the shortest supply cycle of the supplier and the priority level of the hospital emergency order parameter information from the system preset business rule library; According to the extracted minimum purchase order quantity parameter, set the lower limit constraint condition for the purchase quantity of each drug; The shortest supply cycle parameter of the supplier is integrated into the solving environment to establish the correlation constraint between the purchase order time and the expected arrival time; According to the priority parameter of the hospital emergency order, set the order processing priority mechanism in the solving environment;

[0113] A decision variable matrix is constructed and the value range of the replenishment quantity of each drug at each warehouse node is defined, which is determined by the upper limit of the supplier's supply capacity and the lower limit of the warehouse 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, the columns correspond to each warehouse node, and the elements in the matrix represent the replenishment quantity of each drug at the corresponding warehouse node, which provides a structured data framework for subsequent replenishment decision; The supply capacity data of each supplier for different drugs is called from the supplier management system, including the maximum single supply quantity and the maximum total supply quantity within a certain period; Combined with the operation mode, storage management capacity and historical replenishment data of each warehouse, the lower limit of the frequency of receiving drug replenishment of the warehouse 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 according to the upper limit of the supplier's supply capacity and the lower limit of the warehouse receiving frequency;

[0114] The target function is set to minimize the total operating cost, and a multi-level constraint condition is added, and the total operating cost is composed of the weighted sum of the purchase cost, the storage cost and the transportation cost, wherein the transportation cost is dynamically adjusted by the weight coefficient according to the distribution path; Specifically, the purchase cost, the storage cost and the transportation cost are analyzed in detail. Research historical data to understand the proportion of each cost in the total operating cost; According to the purchase unit price gradient discount rule and the replenishment quantity of each drug, the purchase cost of each drug is calculated; According to the unit storage daily cost coefficient, the storage capacity of each warehouse and the storage time, the storage cost is calculated; According to the mileage cost benchmark value of different transportation paths, the type of transportation tool and the replenishment quantity of each drug, the transportation cost is calculated; The purchase cost, the storage cost and the transportation cost are weighted and summed according to the determined weight to construct the target function of minimizing the total operating cost.

[0115] In the embodiment of the present application, the model takes minimizing the total operating cost as the goal, and incorporates the procurement, warehousing, and transportation costs into the weighted calculation, and dynamically adjusts the transportation cost weight according to the distribution path; with the comparison of real-time inventory state data and demand prediction results, the supply-demand gap is accurately identified to avoid inventory accumulation or shortage; according to the warehouse capacity, temperature zone ratio, dangerous goods storage constraint conditions, and transportation tool load, temperature control requirements, and qualification permission transportation restriction conditions, the drug replenishment quantity and storage location are reasonably planned to realize efficient allocation of inventory resources, improve the utilization rate of warehouse space and the efficiency of logistics transportation; the model integrates multi-dimensional information of logistics resource state, cost parameters, and business rules to provide a comprehensive basis for replenishment decision-making. The introduction of minimum procurement order quantity, supply cycle, and order priority business rule parameters ensures that the decision-making meets the actual business scenario requirements; strict constraints on special drug storage and transportation qualifications effectively avoid legal risks and quality and safety risks caused by illegal operations; near-expiration drug information is included in the inventory state data to optimize inventory turnover in combination with replenishment decision-making, thereby reducing drug expiration loss.

[0116] In a preferred embodiment of the present application, step S3, receiving multiple types of orders from medical institutions, retail pharmacies, and individuals; according to the drug demand in the order, combining the procurement suggestion list in step S2 and the inventory information in step S1, selecting drugs, including:

[0117] Receiving multiple types of heterogeneous order data from medical institutions, retail pharmacies, and individuals, the order data including electronic prescription orders of medical institutions, replenishment orders of retail pharmacies, and online drug purchase orders of individuals; specifically including: connecting with the information system of medical institutions, the management system of retail pharmacies, and the online drug purchase platform of individuals through data interfaces to receive electronic prescription order data, retail pharmacy replenishment order data, and individual online drug purchase order data in real time; according to the order type, classifying the electronic prescription orders of medical institutions, the replenishment orders of retail pharmacies, and the online drug purchase orders of individuals; further processing each type of order data; cleaning the integrated order data to remove duplicate order records, processing missing values and abnormalities; according to the drug information, associating the orders of the same drug in different types of orders;

[0118] The heterogeneous order data is standardized and parsed, including: mapping the drug codes in the order to the national medical insurance standard coding system, parsing the address text information into latitude and longitude geographic coordinates, and classifying the delivery time requirement into three priority labels of emergency delivery, regular delivery and appointment delivery, to obtain standardized order data; specifically including: according to the drug information in the heterogeneous order data, for each drug code, querying and matching in the locally established drug code mapping table; for the address text information in the order, calling a geographic coding parsing service to convert the address text into latitude and longitude geographic coordinates; analyzing the delivery time requirement in the order, and according to the preset classification rule, classifying the delivery time requirement into three priority labels of emergency delivery, regular delivery and appointment delivery; integrating the order data after the drug code mapping, address text information parsing and delivery time requirement classification processing, to generate standardized order data;

[0119] Based on the standardized order data, a drug matching logic is executed, including: preferentially allocating near-expiration inventory batches according to the drug expiration date priority rule, matching cold-chain drugs with node inventories with temperature control storage capabilities, and verifying the terminal sales qualification license status of narcotic special drugs, to obtain a data matching result; specifically including: extracting drug demand information from the standardized order data, while calling inventory state data in the drug data index table, including the expiration date information of each warehouse drug batch; for the drug demand in each order, according to the drug expiration date priority rule, preferentially selecting the near-expiration inventory batch; identifying orders involving cold-chain drugs in the standardized order data, and selecting warehouse node information with temperature control storage capabilities from the inventory state data; according to the inventory available quantity, temperature control range and current load of each node, the cold-chain drug orders are matched. Preferentially select the node with sufficient inventory and low load whose temperature control range is consistent with the drug storage requirement for inventory allocation.

[0120] In the embodiment of the present application, heterogeneous order data from medical institutions, retail pharmacies and individuals is standardized and parsed, drug codes are uniformly mapped to the national medical insurance standard coding system, address texts are converted to latitude and longitude coordinates, and delivery time efficiency requirements are classified and prioritized; based on the standardized order data, drug matching logic is executed, and near-expiry inventory batches are preferentially allocated according to drug expiration date priority rules, which can effectively reduce drug expiration loss and improve inventory turnover rate; for cold-chain drug matching, the temperature-controlled storage capacity node inventory is matched to ensure the quality and safety of drugs during storage and transportation; the terminal sales qualification license status of narcotic special drugs is verified to avoid illegal sales risks; during drug matching, the sales qualification of narcotic special drugs is strictly verified to prevent illegal sales from the source, comply with relevant regulations, and reduce the possibility of legal risks and administrative penalties faced by enterprises; through the classification processing of order delivery time efficiency requirements, the drug delivery sequence and resources can be reasonably arranged according to the priority of emergency delivery, regular delivery and appointment delivery.

[0121] In a preferred embodiment of the present application, in step S3, a route order data packet with path encoding is generated, including:

[0122] Based on the data matching result, the physical property classification identifier of the drug, the latitude and longitude coordinates of the delivery destination, and the order time efficiency priority label are extracted;

[0123] According to the physical property classification identifier, a set of available delivery nodes that meet the drug transportation conditions is screened, the spherical distance from each node to the destination is calculated in combination with the latitude and longitude coordinates of the delivery destination, and real-time road network topology data is loaded;

[0124] Taking the time efficiency priority label as a constraint condition, the set of delivery nodes is mapped to two-dimensional Euclidean space coordinate points, and a convex hull algorithm is iteratively calculated:

[0125] The coordinate point set is sorted by polar angle, and an initial convex hull vertex sequence is constructed; non-convex vertices are scanned and removed point by point to generate a minimum convex polygon boundary path; according to the road network topology data, the convex polygon vertices are converted to an actual delivery path node sequence;

[0126] Based on the delivery path node sequence, the spatial distribution relationship between the wholesale warehouse and the retail terminal in the path is parsed:

[0127] When the path continuously contains ≥3 wholesale warehouse nodes, 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;

[0128] According to the splitting rule, the order structure is reconstructed, the wholesale-level order retains the drug demand covered by the wholesale warehouse nodes in the path, and is aggregated as a bulk purchase instruction; the retail-level order extracts the drug demand served by the retail terminals at the end of the path, and is decomposed into terminal delivery instructions;

[0129] Route wholesale orders to the wholesale drug supply chain nodes, and route retail orders to the retail pharmacy supply chain nodes, to generate route order data packets with path encoding.

[0130] In the embodiments of the present application, according to the drug instructions or database records, the transportation conditions of the drugs are marked (such as “cold chain type”, “normal temperature type”, “fragile type”, “special control type”, etc.); the detailed address in the order (such as the specific department of a hospital, the doorplate number of a pharmacy, and the personal address) is converted into accurate latitude and longitude coordinates (such as North Latitude XX°XX', East Longitude XX°XX') through a geographic coding 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 with “high priority”, “medium priority”, and “low priority” labels.

[0131] According to the physical property classification identification of the drugs, the nodes that meet the transportation conditions (such as “cold chain type” drugs only for warehouses / distribution centers equipped with refrigeration facilities) are screened from the supply chain node library 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 curvature parameter (such as the earth radius), the straight-line distance (spherical distance) from each node to the destination is calculated to preliminarily judge the spatial distance between the node and the destination; the real-time traffic system database is simultaneously accessed to obtain the road network topology information (such as road connection relationship, bridge / tunnel distribution, one-way / two-way lane attribute, etc.) between the node and the destination.

[0132] The latitude and longitude coordinates of the set of available distribution nodes are converted into two-dimensional plane coordinates (ignoring the earth curvature and simplified as Euclidean space), and the order time limit priority label is taken as a constraint (such as high-priority orders require that the total path length be ≤ a preset threshold); taking the destination coordinate as the pole, the polar angle (the angle between the connecting line of the pole and the reference direction) of each node coordinate is calculated, and the polar angles are sorted from small to large; 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 turn to determine whether the node is outside the current convex hull boundary: if it is outside, the convex hull vertex sequence is updated, and if it is inside, the node is excluded, and finally a minimum convex polygon boundary containing all key nodes is generated; combined with the real-time road network topology data, the vertices (plane coordinates) of the convex polygon are mapped to the specific locations (such as intersections, warehouse entrances and exits) in the actual road network to form a passable distribution path node sequence (such as “warehouse A→main road B→transit station C→destination”).

[0133] Node type identification: traverse the distribution path node sequence, 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 (such as "warehouse A→ warehouse B→ warehouse C" appears continuously), determine that this section of the path is suitable for bulk distribution, trigger bulk order splitting; analyze the end node of the path, if there are multiple retail terminals (such as pharmacy A, pharmacy B, pharmacy C) and the mutual distance ≤ preset value (such as within 5 kilometers), form a "retail terminal dense cluster", trigger retail order splitting.

[0134] From the original order, extract the demand for medicines in the coverage area of the wholesale warehouse node (such as the demand of hospital X and hospital Y covered by warehouse A), and merge it into bulk purchase instructions (including total quantity, unified distribution time); extract the demand served by the retail terminal dense cluster (such as individual user orders served by pharmacy A and community clinic orders served by pharmacy B) from the original order, and decompose it into distribution instructions for individual terminals (including specific medicine specifications and terminal addresses); send the bulk order to the corresponding medicine wholesale enterprise supply chain system (such as the wholesale node interface connected to the enterprise ERP), and send the retail order to the retail pharmacy supply chain system (such as the retail node interface connected to the pharmacy POS); add path identification to the order data packet (such as containing path node sequence, splitting trigger condition, and distribution order coding such as "P3-R5-20231001-001", where P3 represents 3 consecutive wholesale nodes, and R5 represents a cluster of 5 retail terminals), forming a routing order data packet with path coding.

[0135] The present application ensures that the distribution path covers the key nodes and has the shortest distance by combining the convex hull algorithm with the road network data, while adapting to the medicine transportation conditions (such as cold chain) and reducing invalid detours; based on the objective rules of node distribution (number of consecutive wholesale nodes, retail terminal density), splitting is triggered to avoid errors in artificial subjective judgment and ensure that wholesale / retail orders match the supply chain nodes; bulk demand is aggregated in bulk order to reduce transportation frequency, and terminal demand is decomposed in retail order to shorten the last mile distance, and the combination of the two reduces waste of logistics resources; with order priority as a constraint condition, the path of high-time-efficiency orders is more compact to avoid delays, and path coding records splitting logic and node information, facilitating subsequent order tracking and supply chain optimization.

[0136] In a preferred embodiment of the present application, step S4, based on the routing order data packet in step S3, a unique blockchain traceability code is generated for each batch of medicines; the traceability code records the complete flow process from the production enterprise to the terminal consumer, and real-time monitors and stores temperature and humidity quality indicators to obtain monitoring data, including:

[0137] Based on the routing order information, a drug digital twin is created, and a GS1 standard traceability code is generated for each minimum sales unit. Specifically, complete routing order information is extracted from the order routing execution instruction set, including order number, drug name, specification, batch number, quantity, shipping warehouse, delivery address, distribution path, and customer information. Based on the parsed routing order information, the cloud processor constructs the basic framework of the drug digital twin. According to the drug digital twin framework, the cloud processor obtains detailed drug information from multiple data sources and fills it into the corresponding digital twin. According to the key information in the drug digital twin, the cloud processor generates a traceability code for each minimum sales unit according to the GS1 standard.

[0138] A drug-batch-order association mapping table is established based on the traceability code, and the initial production enterprise qualification file hash value is recorded. Specifically, the drug identification, batch number, and production date key information are parsed from the generated GS1 standard traceability code. The structure of the drug-batch-order association mapping table is designed, including the primary key, drug identification, batch number, order number, production enterprise, production date, expiration date, sales time, and customer information. Based on the information in the traceability code, the drug, batch, and order are associated and mapped. For each traceability code, the corresponding drug identification, batch number, and order number are matched to establish a correspondence between them. The qualification files of the initial production enterprise of the drug are obtained from the enterprise qualification database, including the business license, drug production license, and GMP certification files. The contents of these qualification files are calculated using a secure hash algorithm to generate a hash value.

[0139] According to the mapping table, the whole chain of circulation is stored and monitored in real time, and the monitoring data is collected. Specifically, based on the key nodes in the drug circulation link, a distributed data collection network is deployed. Based on the drug-batch-order association mapping table, a drug circulation whole chain storage 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 link storage framework, and the status changes of the drug at each link are recorded in chronological order to form a continuous and complete circulation link record. Based on the pre-set business rules and risk indicators, the cloud processor monitors the drug circulation link in real time.

[0140] A three-level quality early warning mechanism is set, including: the first level early warning is that the environmental parameter deviates from the standard value ±2℃, the second level early warning is that the threshold is exceeded for 30 minutes continuously, and the third level early warning is that the key deviation affecting the potency of the drug; specifically including: according to the quality standards of drug storage and transportation, the specific threshold and trigger condition of each level of quality early warning are determined; for the environmental parameter, the first level early warning is that the environmental parameter deviates from the standard value ±2℃, the second level early warning is that the environmental parameter exceeds the first level early warning threshold for 30 minutes continuously, and the third level early warning is that the key parameter deviation that may directly affect the potency of the drug occurs; the environmental parameter and equipment operation state monitoring data are obtained in real time from the data acquisition network deployed at each node of the drug circulation; when the monitoring data shows that the environmental parameter deviates from the standard value ±2℃ for the first time, the cloud processor triggers the first level quality early warning; if the first level early warning is triggered, the environmental parameter continues to deviate and exceeds the first level early warning threshold for 30 minutes continuously, the cloud processor automatically upgrades the early warning level to the second level; when the key parameter deviation that may affect the potency of the drug is monitored, the cloud processor immediately triggers the third level quality early warning;

[0141] According to the early warning mechanism, an automatically triggered intelligent contract rule is deployed, including expiration management, circulation control and quality traceability; specifically including: based on the drug expiration data and the early warning mechanism, an expiration management intelligent contract is deployed; combined with the quality early warning mechanism, a circulation control intelligent contract is configured; a quality traceability intelligent contract is developed to deeply bind the drug full life cycle data with the early warning events; the deployed expiration management, circulation control and quality traceability intelligent contracts are integrated into the blockchain platform to ensure that the contracts can be automatically executed when the early warning mechanism is triggered; the intelligent contract is deeply integrated with the enterprise's warehouse management system, logistics distribution system and order management system business system to realize real-time interaction of data and automatic cooperation of business processes.

[0142] In the embodiment of the application, the 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 drugs; executes preemptive allocation for high-priority emergency orders to preferentially meet emergency demands; when inventory is insufficient, substitute drug rules and cross-warehouse allocation schemes are enabled to reduce out-of-stock rates; based on a drug distribution feature matrix and multi-source road condition information, orders are intelligently split into wholesale and retail levels according to optimized distribution paths, and are dynamically allocated in combination with supply chain node load states; this operation realizes efficient matching of orders and warehouse nodes, reduces unnecessary transportation links and resource waste; the generated order routing execution instruction set covers drug picking lists, distribution task sheets and logistics state notification templates to provide standardized operation guidelines for each business link; the picking list with batch expiration information guides accurate warehouse picking; the distribution task sheet with temperature control requirements ensures transportation process specifications; customized notification templates meet different customer information needs.

[0143] In a preferred embodiment of the present application, step S5, based on the monitoring data in step S4, select geographic information and road condition information; according to the road condition information, optimize the distribution vehicle scheduling scheme, including:

[0144] Real-time access of monitoring data to multi-dimensional road condition information, including basic road network data, dynamic traffic flow and meteorological environment; specifically including: establishing communication connection with the data source of the basic road network data supplier, the data platform of the traffic management department, and the meteorological service agency; cleaning the obtained basic road network data, dynamic traffic flow data and meteorological environment data; fusing the cleaned multi-dimensional road condition data to associate the basic road network data, dynamic traffic flow and meteorological environment information with the road section as the core; integrating the cleaned and fused multi-dimensional road condition data with the drug circulation monitoring data;

[0145] Constructing a space-time feature matrix according to multi-dimensional road condition information, including a road section travel time prediction model, a regional distribution difficulty coefficient and a special period traffic control rule; specifically including: extracting basic road network data, dynamic traffic flow data and meteorological environment data from the accessed multi-dimensional road condition information; training a road section travel time prediction model based on historical traffic flow data and meteorological environment data using a machine learning algorithm; taking a city region as a unit, comprehensively considering the travel time prediction results of each road section in the region, road complexity, traffic flow density and special terrain, constructing a regional distribution difficulty coefficient calculation model; collecting and sorting special period traffic control rules published by the city traffic management department, including restricted area, restricted time and forbidden vehicle type information; integrating the output results of the road section travel time prediction model, the regional distribution difficulty coefficient and the special period traffic control rule into a matrix to construct a space-time feature matrix;

[0146] Establishing drug-vehicle matching rules according to the space-time feature matrix, including cold chain drug special refrigerated truck configuration, narcotic drug double-person escort requirement and large-volume drug load limit; specifically including: extracting key information from the constructed space-time feature matrix, including travel time prediction of each road section at different times, regional distribution difficulty coefficient and special period traffic control rule; according to the temperature sensitivity level of the drug, screening the cold chain drug list from the drug digital twin; for cold chain drugs of different temperature sensitivity levels, formulating corresponding refrigerated truck configuration standards to clearly define the required temperature control range and humidity requirement parameters; identifying narcotic drug orders from the drug-batch-order association mapping table and extracting drug quantity and destination information in the order; according to the physical properties of the drug, screening large-volume drugs from the order information. Formulate load limit rules to clearly define the maximum load capacity and volume limit of different types of vehicles; fuse the cold chain drug refrigerated truck configuration, narcotic drug double-person escort and large-volume drug load limit rules to construct a drug-vehicle matching decision model;

[0147] The delivery urgency is calculated according to the vehicle matching rule, including the emergency medicine red channel, the standard time limit of regular medicine and the appointment delivery of chronic disease medicine; specifically, the medicine type, vehicle allocation and expected departure time information are extracted from the vehicle matching scheme, and the medicine use and customer demand attribute in the order data are called; the delivery urgency is directly given to the identified emergency medicine order; the shortest delivery time in the ideal state is calculated in combination with the link travel time prediction in the space-time feature matrix and the special period traffic control rule; for the regular medicine order, the time difference between the expected delivery time and the standard time limit is calculated according to the preset standard delivery time limit, in combination with the expected departure time after vehicle matching, the link travel time prediction and the regional delivery difficulty coefficient; different urgency levels are divided according to the size of the time difference; for the chronic disease medicine order, the expected delivery time after vehicle matching is compared with the customer's appointment delivery time.

[0148] In the embodiment of the application, the monitoring data is real-time accessed to the multi-dimensional road condition information, so that the delivery vehicle can timely obtain the basic road network data, dynamic traffic flow and meteorological environment information. This helps the vehicle to avoid congested road sections and select the optimal delivery path, thereby significantly shortening the delivery time, improving the delivery efficiency and ensuring that the medicine can be delivered to the destination on time and accurately; the space-time feature matrix is constructed according to the multi-dimensional road condition information, which contains the link travel time prediction model, the regional delivery difficulty coefficient and the special period traffic control rule, thereby providing accurate data support for the delivery decision; the enterprise can plan the delivery route in advance and reasonably arrange the delivery time according to these information, thereby avoiding the delay caused by traffic control or complex road conditions and improving the reliability and stability of the delivery; the medicine-vehicle matching rule established according to the space-time feature matrix formulates corresponding transportation requirements for different types of medicine, such as cold chain medicine special refrigerated vehicle configuration, narcotic drug double-person escort requirement and large-volume medicine load limit; this ensures the safety and quality of the medicine during transportation and avoids damage or deterioration of the medicine due to improper transportation conditions; the delivery urgency is calculated according to the vehicle matching rule, and the emergency medicine, regular medicine and chronic disease medicine are classified and managed, and different priorities are set for the red channel, standard time limit and appointment delivery; this enables the emergency medicine to be preferentially delivered, thereby ensuring the life safety of the patient; at the same time, the delivery of regular medicine and chronic disease medicine can also be reasonably arranged to meet the needs of different customers and improve customer satisfaction.

[0149] As shown in Figure 2 The embodiment of the application also provides an internet-based medical wholesale and retail comprehensive service system, which comprises:

[0150] The data acquisition module is configured to acquire electronic prescription data in real time through an API interface connected to a hospital HIS system, and to acquire the inventory status, batch number and expiration date information of each drug from the electronic prescription data and an ERP system of a drug wholesaler to obtain inventory information.

[0151] The replenishment module is configured to predict drug demand and evaluate inventory health status through an LSTM neural network, to establish a linear programming model by combining logistics constraints and cost optimization, and to generate a three-level replenishment suggestion list including the variety, quantity and time limit to minimize operating costs.

[0152] The distribution module is configured to receive multi-type orders from medical institutions, retail pharmacies and individuals, to select drugs according to the drug demand in the orders, combined with the purchase suggestion list and the inventory information, to extract the physical property identifier, distribution coordinates and time limit label of the drugs based on the data matching result, to screen compliant distribution nodes and calculate the spherical distance, to construct an initial convex hull vertex sequence through polar angle sorting, to generate a minimum convex polygon path by eliminating non-convex points, and to map the path to an actual distribution node sequence. According to the continuous distribution of the wholesale nodes in the path, the order splitting is triggered, the drug demand covered by the wholesale nodes is aggregated into bulk purchase instructions, and the demand served by the retail terminals is decomposed into terminal distribution instructions. Finally, the wholesale orders are routed to the wholesale enterprise nodes, and the retail orders are routed to the pharmacy nodes to generate a routing order data packet with path encoding.

[0153] The monitoring module is configured 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 production enterprise to the terminal consumer, and monitors the storage temperature and humidity quality indicators in real time to obtain monitoring data.

[0154] The optimization module is configured to select geographic information and road condition information based on the monitoring data, and to optimize the distribution vehicle scheduling scheme according to the road condition information.

[0155] It is explained that the system corresponds to the above method, and all implementation manners in the above method embodiment are applicable to this embodiment, and the same technical effects can be achieved.

[0156] The above is the preferred embodiment of the present application. It should be noted that for ordinary skilled persons in the art, without departing from the principles of the present application, a number of improvements and refinements can be made, which should also be considered within the scope of protection of the present application.

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, using an LSTM neural network to predict drug demand and evaluate inventory health, establishing a linear programming model in combination with logistics constraints and cost optimization, and generating a three-level replenishment recommendation list including variety, quantity, and timeliness to minimize operating costs, including: loading a pre-trained LSTM neural network model architecture based on sales data, including an input layer, a hidden layer, and an output layer; dynamically adjusting parameters when performing forecast calculations, including seasonal fluctuation factors, epidemiological impact coefficients, and regional special event correction values; constructing a multidimensional inventory status matrix based on the model architecture, including current available inventory quantity and distribution location, in-transit replenishment order status, and near-expiration drug warning signs; calculating 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 with demand forecast results, and combining logistics resource status to set cost parameters, warehousing and transportation constraints, and business rules, constructing a linear programming replenishment optimization model with the goal of minimizing total operating costs; and generating a three-level replenishment recommendation list based on the model; 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 three-level replenishment 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 retail terminal service demand into terminal delivery instructions. Finally, route the wholesale-level orders to the wholesale enterprise node and the retail-level orders to the pharmacy node, 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.

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: 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.

4. The Internet-based pharmaceutical wholesale and retail integrated service method according to claim 3, 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 three-level replenishment 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.

5. The Internet-based pharmaceutical wholesale and retail integrated service method according to claim 4, 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.

6. The Internet-based pharmaceutical wholesale and retail integrated service method according to claim 5, 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.

7. The Internet-based pharmaceutical wholesale and retail integrated service method according to claim 6, 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.

8. An Internet-based pharmaceutical wholesale and retail integrated service system, characterized by: Applied to the method according to any one of claims 1 to 7, 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. Based on the drug demand in the order, combined with the three-level replenishment recommendation list and inventory information, the module selects drugs, extracts the drug's physical property identification, delivery coordinates, and time-limit labels based on the data matching results, selects compliant delivery nodes, calculates spherical distances, 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. The module triggers order splitting based on the continuous distribution of wholesale nodes in the path, aggregates drug demand covered by the wholesale nodes into bulk purchase instructions, and decomposes retail terminal service demand into terminal delivery instructions. Finally, wholesale-level orders are routed to wholesale enterprise nodes and retail-level orders are routed 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.

9. 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 7.

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