Intelligent supply chain management method and system for front warehouse of chain drugstore

By constructing a digital twin model and a behavior-driven prediction model, the expiration date and inventory consumption curves of drugs are matched in real time, solving the problem of dynamic linkage and abnormal early warning between drug inventory and expiration date, realizing the intelligent and compliant improvement of drug management, and reducing drug waste.

CN120875762APending Publication Date: 2025-10-31GUANGDONG YIYAO CONVENIENT DIGITAL TECHNOLOGY CO LTD
View PDF 0 Cites 10 Cited by

Patent Information

Application Number
CN202510932639.1
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-07-07
Publication Date
2025-10-31

AI Technical Summary

Technical Problem

In the existing supply chain management of pharmaceuticals in chain pharmacies' front-end warehouses, the dynamic linkage and abnormal early warning of pharmaceutical inventory quantity and expiration date make it difficult to achieve full-process traceability and dynamic monitoring at the batch and warehouse levels. This results in weak correlation and poor timeliness of inventory and expiration date data, making it impossible to identify pharmaceutical products that are about to expire and have abnormal inventory backlogs in a timely manner.

Method used

Collect expiration date information and real-time inventory quantity of each batch of drugs, construct a digital twin model, record the drug life cycle trajectory, collect and serialize key supply chain behavioral events, use life cycle mapping algorithm to pair drug expiration curves and inventory consumption curves in real time, calculate the dynamic change trend of the intersection of remaining inventory and expiration date, and analyze abnormal risks through behavior-driven prediction model to generate graded linkage early warning signals.

Benefits of technology

It enables accurate early warning and efficient visual traceability of drug inventory and expiration dates, improves the intelligence and compliance level of drug management, reduces drug waste due to expiration, and meets the requirements of drug regulatory authorities.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120875762A_ABST
    Figure CN120875762A_ABST
Patent Text Reader

Abstract

The invention provides an intelligent supply chain management method and system for a front warehouse of a chain drugstore. The method comprises the following steps: collecting full-process event data of each medicine batch, and respectively marking unique batch identification codes for different storage positions; performing data cleaning and time sequence normalization processing on the collected original data; based on drug data of different batches and storage areas, respectively constructing digital twin models, and recording a life cycle trajectory of each batch of drugs; gathering and serializing supply chain key behavior events related to each storage area; and by using a life cycle mapping algorithm, carrying out real-time pairing on the medicine validity period curve and the dynamic inventory consumption curve, and respectively calculating the dynamic change trend of the critical intersection point of the remaining inventory and the validity period for different storage areas and medicine types. According to the method, preposition, accurate early warning and efficient visual traceability of the inventory-period-of-validity linkage risk can be realized, and the intelligence and compliance level of preposition warehouse medicine management of chain drugstores can be improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of pharmacy supply chain management technology, and in particular to an intelligent supply chain management method and system for chain pharmacy front-end warehouses. Background Technology

[0002] In the current supply chain management of chain pharmacy front-end warehouses, the dynamic linkage and abnormal early warning of drug inventory quantity and expiration date has always been a core technical challenge in ensuring drug safety, reducing expiration losses, and improving inventory turnover. Existing early warning methods mainly rely on periodic inventory counts, static threshold rules, or simple comparison of inventory and expiration date fields. However, these traditional methods have certain drawbacks: on the one hand, drug inventory and expiration date information are scattered across different batches, storage locations, and business systems, lacking batch-level and warehouse-level end-to-end traceability and dynamic monitoring capabilities, resulting in weak correlation and poor timeliness of inventory and expiration date data. On the other hand, inventory consumption behavior is affected by various supply chain events such as promotions, demand fluctuations, and recalls. Current technology struggles to dynamically couple key behavioral events with inventory / expiration date risks, making it difficult to promptly identify drug varieties that are about to expire and have abnormal inventory backlogs.

[0003] Therefore, the existing drug supply chain management methods of pre-chain pharmacy warehouses need to be improved to overcome the shortcomings of existing technologies. Summary of the Invention

[0004] To overcome the problems existing in related technologies, one of the objectives of this invention is to provide an intelligent supply chain management method for pre-positioned warehouses of chain pharmacies. This method can realize the forward-looking, accurate early warning and efficient visual traceability of inventory-expiration linked risks, and can improve the intelligence and compliance level of drug management in pre-positioned warehouses of chain pharmacies.

[0005] A method for intelligent supply chain management of pre-positioned warehouses for chain pharmacies includes:

[0006] S1. Collect expiration date information, real-time inventory quantity, and full-process event data such as warehousing, transfer, and sales for each batch of medicines in multiple storage areas of the chain pharmacy's front warehouse, and mark each storage location with a unique batch identification code.

[0007] S2. Perform data cleaning and time-series normalization on the collected raw data, including removing duplicate records, correcting timestamp errors, and synchronizing validity period and inventory quantity fields to ensure data integrity and availability.

[0008] S3. Based on drug data from different batches and storage areas, construct digital twin models to record the lifecycle trajectory of each batch of drugs in the stages of procurement, warehousing, storage, allocation, and sales.

[0009] S4. Collect and serialize key supply chain behavioral events involving various warehousing areas, including the launch of promotional activities, seasonal demand fluctuations, drug recalls, etc., and perform multi-dimensional feature labeling on the event flow;

[0010] S5. Using the lifecycle mapping algorithm, the drug expiration curve and the dynamic inventory consumption curve are paired in real time, and the dynamic change trend of the remaining inventory and the critical intersection of the expiration date is calculated for different storage areas and drug types.

[0011] In a preferred embodiment of the present invention, after calculating the dynamic trend of the intersection of remaining inventory and expiration date for different storage areas and drug types, the method further includes:

[0012] S6. Input multi-dimensional behavioral event streams into the behavior-driven prediction model, and analyze the sensitivity of key events that may affect inventory turnover and expiration date consumption in the short term to abnormal risks for different drug categories and storage locations.

[0013] S7. Determine whether the current batch of drugs simultaneously meets the following conditions: its inventory is higher than the safety threshold and its expiration date is close to the expiration date, or its inventory consumption rate is lower than the historical average and its expiration date shows a shortening trend; if the conditions are met, generate a corresponding graded linkage early warning signal.

[0014] S8. Display the generated abnormal trend warning results to the operation and management end in the form of a traceability path map, clearly indicating the risk batch, related storage area and influencing behavioral events, so as to achieve traceable intervention;

[0015] S9. Based on historical early warning feedback and actual processing results, the early warning rules are adaptively trained to dynamically optimize the early warning threshold parameters under different drug types and business cycles, thereby achieving model self-calibration and performance improvement.

[0016] In a preferred embodiment of the present invention, step S1 includes:

[0017] S1.1 automatically identifies and spatially maps each independent storage area within the front warehouse of a chain pharmacy. Based on the warehouse management system interface, it obtains and records the correspondence between the physical location of each area and the system partition number in order to establish a spatial index system for subsequent data collection.

[0018] S1.2 Perform barcode or RFID scanning on each batch of incoming medicines, and generate a unique batch identification code using attributes such as batch number, time of entry, and supplier information through a batch information coding algorithm. This code is then synchronously linked to the corresponding storage area to initialize the basic data for batch-level drug traceability.

[0019] S1.3 Collect and record the expiration date information for each batch of medicines, and automatically read the expiration date field from the warehousing voucher or medicine label using the data interface protocol, and store it in a structured manner in combination with the batch identification code and storage location.

[0020] S1.4 Real-time data collection of inventory quantity changes for all batches of medicines in each storage area. Using inventory sensor interfaces or inventory management software APIs, incremental records are made for inbound and outbound operations, inventory counts, and transfers by batch and storage location, so as to achieve accurate collection of dynamic inventory quantities.

[0021] S1.5 automatically collects event data for each batch of medicines throughout its entire process (warehousing, transfer, allocation, sales, etc.), uses timestamps to mark and record relevant operators, event types and operation terminal identifiers, and realizes multi-dimensional archiving of the entire event flow;

[0022] S1.6 initially aggregates the collected expiration date, inventory quantity, and circulation event data according to the "warehouse area - batch identification code - time series" structure, providing traceable data input for subsequent data cleaning, twin modeling, and anomaly trend analysis.

[0023] In a preferred embodiment of the present invention, step S2 includes:

[0024] S2.1 performs uniqueness verification on the collected original drug batch data, using the batch identification code and storage area index as the primary key, and performs deduplication processing on event records such as warehousing, transfer, and sales to eliminate data redundancy caused by multiple collection points or repeated system uploads, ensuring the uniqueness of each event in the time series;

[0025] S2.2 performs time error correction on the timestamp field in the original event data based on a high-precision clock synchronization algorithm. It reconstructs or interpolates timestamp values ​​that are missing, ambiguous, or abnormal, so as to achieve global time-series alignment of event streams from different batches and storage areas, laying the foundation for subsequent time-series analysis.

[0026] S2.3 performs synchronous normalization processing on the validity period information and inventory quantity fields, and performs structured pairing of batch validity period and corresponding inventory quantity at the same time base, automatically filling in incomplete fields caused by inventory delays, data loss, etc.

[0027] S2.4 employs a data integrity detection algorithm to perform full-field validation on the cleaned batch-level dataset, including the reasonableness of the expiration period range, the non-negativity of the inventory quantity, and the continuity of the batch flow path. It marks the detected problematic data and outputs an anomaly report to provide a basis for manual or automatic error correction.

[0028] S2.5 standardizes and stores the high-quality, structured drug batch data processed above according to the three-dimensional index of "warehouse area - batch identification code - time series", and outputs a dataset for subsequent digital twin modeling and anomaly trend analysis, realizing the efficient transformation of raw data into analytically usable data.

[0029] In a preferred embodiment of the present invention, step S3 includes:

[0030] S3.1 For cleaned and normalized batch-level drug data, based on the three-dimensional index structure of 'warehouse area-batch identification code-time series', a unique digital twin of each batch of drugs is initialized and modeled to achieve full-cycle virtual mapping of physical drug batches;

[0031] S3.2 inputs full-process event flow data such as procurement, warehousing, storage, allocation, and sales into each digital twin, and uses event-driven modeling algorithms to dynamically update the twin's attributes, including state transition nodes, quantity changes, flow information, and validity period parameters, to achieve high-granular characterization of the life cycle trajectory.

[0032] S3.3 Based on the time-series event flow in the twin model, the process of state transition between each stage (such as warehousing, in-warehouse, transfer, and out-of-warehouse) is modeled in segments. Multi-state finite automata or Petri nets are used to accurately describe the transfer and retention characteristics of drug batches in each link of the supply chain, forming a simulateable life cycle flow path.

[0033] S3.4 integrates real-time inventory changes and expiration date attributes into the twin model, and applies a time-series data fusion algorithm to map the inventory quantity and remaining expiration date status of each batch of medicines at any time, providing structured input features for subsequent expiration date-inventory anomaly trend analysis and prediction algorithms.

[0034] S3.5 stores the constructed batch-level digital twins and their lifecycle trajectories in a multi-dimensional group according to the storage area and batch primary key, and establishes cross-regional data reference relationships to support subsequent cross-warehouse transfers, anomaly tracing, and visualization analysis, thereby enabling efficient tracking and retrieval of drug circulation information.

[0035] In a preferred embodiment of the present invention, step S4 includes:

[0036] S4.1 interfaces with the management systems of each independent warehousing area of ​​the chain pharmacy's front warehouse, and obtains the supply chain operation logs and raw data of business events involving each area in real time based on standardized APIs or message queue protocols, so as to establish a foundation for cross-warehousing area behavior event collection.

[0037] S4.2, based on a behavioral event type dictionary, performs an event classification algorithm on the collected raw operational events (including promotional campaign launches, seasonal demand fluctuations, drug recalls, price changes, emergency allocations, etc.), standardizes the encoding of events by category, scope of impact, and triggering source, and outputs a structured preliminary event list.

[0038] In a preferred embodiment of the present invention, step S5 includes:

[0039] S5.1 groups and filters batch-level drug data that has been modeled using digital twins, based on the dimensions of storage area and drug type, and extracts the remaining inventory time-series data and expiration date countdown curve data of each batch as input objects for lifecycle mapping.

[0040] S5.2 employs a sliding window time-series pairing algorithm to synchronously map the inventory change curves and expiration date reduction curves of the same batch of drugs in different time segments, and compares and analyzes the interaction characteristics of the two curves at any time to capture the relative change relationship between the inventory consumption rate and the expiration date consumption rate.

[0041] S5.3 uses a dynamic threshold determination mechanism to calculate the critical intersection of the remaining inventory and the remaining valid days for each batch of drugs in real time. It also generates a set of critical indicators for each region based on the attributes of the storage area. This is used to identify key time periods where excess inventory or delayed consumption leads to the accumulation of expiration risk.

[0042] S5.4 utilizes a multi-dimensional feature trend extraction algorithm to fit trend lines to batch-level inventory-expiration pairing results, uncovering patterns such as delayed inventory consumption, rapid approach of expiration dates, or abnormal inflection points between the two, and outputting an indicator matrix reflecting the changing trends of abnormal risks under different storage areas and drug types.

[0043] S5.5 performs time-series visualization encoding on the above dynamic trend analysis results, generating the change trajectory of the batch-level 'remaining inventory - expiration date intersection' for each storage area and drug type, providing real-time, high-granularity data input for subsequent behavior-driven prediction and linkage early warning models.

[0044] In a preferred embodiment of the present invention, step S6 includes:

[0045] S6.1 performs feature vectorization processing on the serialized multi-dimensional supply chain behavior event stream, and uses event embedding encoding or time-series window extraction algorithms to transform events such as promotions, seasonal fluctuations, and recalls into structured feature inputs to ensure that the data dimensions of the input behavior-driven prediction model are complete and the timestamps are consistent.

[0046] Based on the unique identifiers of storage area, drug category, and batch, S6.2 dynamically associates the characteristic behavioral event stream with the corresponding digital twin model. It adopts index matching and synchronization alignment algorithms to ensure that each event stream can be accurately mapped to its corresponding drug batch and physical storage location during predictive analysis, thereby achieving precise binding of event-object.

[0047] S6.3 uses structured event features and digital twin state variables as joint inputs, and utilizes short-time series prediction algorithms (such as temporal convolutional networks, LSTM, etc.) or custom behavior-driven prediction models to perform multi-scenario simulation predictions on the inventory turnover rate and expiration consumption trend of each batch of drugs within a preset time window in the future, and outputs the sensitivity probability distribution of each key event to the risk of linkage between inventory and expiration.

[0048] S6.4 performs sensitivity analysis and abnormal risk quantification on the predicted output results. It uses methods such as threshold discrimination, graded scoring or statistical significance testing to refine and stratify the abnormal inventory-expiration risk levels that may be caused by future key events under different drug categories and storage locations, providing a data foundation for the formulation of subsequent graded early warning strategies.

[0049] S6.5 compares the quantified sensitivity analysis results with the historical anomaly case database, and uses similarity measurement or model confidence adjustment mechanisms to correct and optimize potential errors or special scenarios in the prediction, outputting a high-confidence anomaly risk sensitivity index that can be used for real-time decision-making, providing structured input for subsequent automatic early warning and path traceability.

[0050] The second objective of this invention is to provide a supply chain management method, wherein the system is used to implement the intelligent supply chain management method for the pre-positioned warehouses of chain pharmacies as described above.

[0051] The beneficial effects of this invention are as follows:

[0052] This invention provides a method and system for intelligent supply chain management of pre-positioned warehouses in chain pharmacies. It collects full-process event data for each batch of medicines and marks each batch with a unique batch identification code for different storage locations. The collected raw data undergoes data cleaning and time-series normalization. Based on medicine data from different batches and storage areas, digital twin models are constructed to record the lifecycle trajectory of each batch of medicines. Key supply chain behavioral events involving each storage area are aggregated and serialized. Using a lifecycle mapping algorithm, the medicine expiration date curve is paired with the dynamic inventory consumption curve in real time, and the dynamic trend of the intersection of remaining inventory and expiration date is calculated for different storage areas and medicine types. This method, by pairing the medicine expiration date curve with the dynamic inventory consumption curve in real time and calculating the dynamic trend of the intersection of remaining inventory and expiration date, can predict the risk of inventory remaining nearing its expiration date in advance. This allows pharmacies sufficient time to take measures such as promotions and allocations to avoid medicine waste due to expiration and reduce pharmacy losses. Furthermore, based on the constructed digital twin model and the aggregated and serialized key supply chain behavioral events, the problematic medicine batch and related storage area can be accurately located, achieving efficient and visual traceability. By recording and tracing data on events throughout the entire drug supply chain, we can meet the requirements of drug regulatory authorities and ensure that the circulation and management of drugs comply with relevant regulations. Attached Figure Description

[0053] Figure 1 This is a flowchart of the intelligent supply chain management method for chain pharmacy front warehouses provided by the present invention. Detailed Implementation

[0054] Preferred embodiments of the invention will now be described in more detail with reference to the accompanying drawings. While preferred embodiments of the invention are shown in the drawings, it should be understood that the invention can be implemented in various forms and should not be limited to the embodiments set forth herein. Rather, these embodiments are provided so that the invention will be thorough and complete, and will fully convey the scope of the invention to those skilled in the art.

[0055] In the current supply chain management of chain pharmacy front-end warehouses, the dynamic linkage and abnormal early warning of drug inventory quantity and expiration date has always been a core technical challenge in ensuring drug safety, reducing expiration losses, and improving inventory turnover. Existing early warning methods mainly rely on periodic inventory counts, static threshold rules, or simple comparison of inventory and expiration date fields. However, these traditional methods have certain drawbacks: on the one hand, drug inventory and expiration date information are scattered across different batches, storage locations, and business systems, lacking batch-level and warehouse-level end-to-end traceability and dynamic monitoring capabilities, resulting in weak correlation and poor timeliness of inventory and expiration date data. On the other hand, inventory consumption behavior is affected by various supply chain events such as promotions, demand fluctuations, and recalls. Current technology struggles to dynamically couple key behavioral events with inventory / expiration date risks, making it difficult to promptly identify drug varieties that are about to expire and have abnormal inventory backlogs.

[0056] Based on this, this application provides a method for intelligent supply chain management of pre-positioned warehouses for chain pharmacies.

[0057] Example 1

[0058] like Figure 1 As shown in the figure, this embodiment provides a method for intelligent supply chain management of pre-positioned warehouses for chain pharmacies. The method includes:

[0059] S1: For multiple storage areas of a chain pharmacy's pre-positioned warehouse, collect expiration date information, real-time inventory quantity, and full-process event data (including warehousing, transfer, and sales) for each batch of medicines, and assign a unique batch identification code to each storage location. This step aims to systematically collect expiration date information, real-time inventory quantity, and full-process flow events (including warehousing, transfer, and sales) for each batch of medicines in multiple storage areas of a chain pharmacy's pre-positioned warehouse, and to uniquely identify and encode medicine batches in different storage locations. This step provides basic data support for subsequent digital twin modeling and intelligent early warning of abnormal trends, and is a prerequisite for realizing dynamic monitoring and intelligent analysis of the entire process of medicine inventory and expiration dates.

[0060] Specifically, step S1 includes:

[0061] S1.1 automatically identifies and spatially maps each independent storage area within the pre-positioned warehouse of a chain pharmacy. Based on the warehouse management system interface, it obtains and records the correspondence between the physical location of each area and the system partition number to establish a spatial index system for subsequent data collection.

[0062] For multiple independent storage areas within a chain pharmacy's front warehouse, the input conditions include: physical space layout information of the front warehouse, network topology of the management system for each storage zone, and real-time spatial identification data collected by sensors or positioning devices.

[0063] An automatic spatial identification algorithm (parameters: 3D coordinate acquisition, area boundary identification rules, positioning tag ID) is employed to achieve boundary detection and spatial contour segmentation of all independent physical areas within the pre-positioned warehouse. Furthermore, a spatial partitioning mapping method (parameters: warehouse management system API, partition number allocation strategy, physical area coordinate set) automatically assigns a unique system partition number to each spatial partition and establishes a bidirectional index relationship between physical location and system number. Further, a multi-source heterogeneous data fusion mechanism (parameters: RFID / QR code positioning tags, video surveillance area identification, environmental sensor spatial attribution) normalizes spatial identification data from different acquisition terminals, eliminating spatial overlap or omissions caused by differences in equipment accuracy, and uniformly outputs a standardized spatial partitioning mapping table. Finally, an interface data capture and event synchronization algorithm (parameters: real-time interface call frequency, exception retry mechanism) obtains the latest location changes, expansions, or mergers of each physical partition from the warehouse management system in real time, dynamically maintaining the correspondence between area and system number to ensure the consistency and timeliness of spatial indexing during subsequent batch data acquisition. Through a multi-level verification mechanism (parameters: boundary coverage detection, number uniqueness detection, and mapping consistency verification), the established spatial partition mapping results are automatically verified throughout the entire process. The system outputs a spatial index structure containing physical location coordinates, system partition numbers, and corresponding relationships, achieving high-precision and high-reliability initialization of the pre-positioned warehouse spatial index system. For example, in a pre-positioned warehouse of a chain pharmacy in a certain city, eight independent temperature-controlled storage areas are deployed, each equipped with two UWB positioning base stations and ten RFID partition tags. The system uses a three-dimensional coordinate automatic recognition algorithm to accurately obtain the boundary point set of each physical partition and assigns eight system partition numbers, A1 to A8, according to preset numbering rules. For the spatial tag data collected by UWB and RFID, the system uses a multi-source fusion algorithm to classify the original tags to the corresponding physical areas and corrects for partition overlap caused by tag drift, outputting a standardized spatial partition mapping table. By calling the warehouse management system API, the system automatically synchronizes location and number change events for each area every 5 minutes. When an area is split or merged due to business expansion, the system automatically updates the numbering relationships and verifies that all numbers are globally unique and that area boundaries do not overlap. The final output is a spatial index structure containing 8 sets of "physical area coordinates - system partition number" mappings, providing an accurate and efficient spatial positioning foundation for subsequent batch drug data collection and traceability. Application results show that this automatic spatial mapping process can complete the spatial index initialization of all 8 areas in the warehouse in less than 3 minutes, achieving a boundary coverage rate of 99.8% and 100% number uniqueness, greatly improving the data accuracy and operational efficiency of subsequent batch-level drug traceability.

[0064] S1.2 Perform barcode or RFID scanning on each batch of incoming medicines, and generate a unique batch identification code using attributes such as batch number, warehousing time, and supplier information through a batch information coding algorithm. This code is then synchronously linked to the corresponding storage area to initialize the basic data for batch-level drug traceability.

[0065] The data collection targets are batches of incoming medicines within each physical area of ​​the pre-positioned warehouse, after spatial partitioning and mapping. Input data includes barcode / QR code or RFID tag signals, batch numbers, warehousing time, supplier codes, and warehouse area system numbers. Automated identification and data collection methods (parameters: high-precision barcode scanner, RFID reader / writer, batch number information parsing rules, interface protocol) are employed to collect the unique physical identifier for each batch of incoming medicines and to archive the data in a structured manner. Furthermore, through a batch information encoding algorithm (parameters: batch number string, warehousing timestamp, supplier unique ID, area system number), a weighted concatenation and hash mapping of multi-source attribute fields of the batch is performed to generate a globally unique batch identification code (BID). The specific encoding process is as follows:

[0066] BID = Hash(Prefix_{region} + BatchNo_{drug} + T_{inbound} + SUP_{supplier})

[0067] In this context, Prefix_{region} is the system number prefix for the storage region, BatchNo_{drug} is the drug batch number, T_{inbound} is the standardized inbound timestamp, and SUP_{supplier} is the supplier's unique ID.

[0068] Furthermore, through an automated data binding algorithm (parameters: spatial index table, batch identification code mapping table), a one-to-one correspondence is established between the generated BID and the corresponding warehouse area system number, realizing the digital binding of physical batches and spatial locations. Further, through an interface synchronization mechanism (parameters: warehouse management system API, real-time synchronization frequency, fault-tolerant retry strategy), the batch identification code and its associated attributes are synchronously written into the central database, forming a data foundation supporting subsequent lifecycle traceability. Through a data consistency verification mechanism (parameters: batch uniqueness detection, redundancy conflict comparison rules), the generated batch identification codes and their binding relationships are globally verified, outputting unique and traceable batch-level drug traceability initialization data. For example, in a large chain pharmacy's forward warehouse in a provincial capital city, 16 RFID readers and 12 industrial-grade barcode scanning terminals are configured. Each box of medicine is automatically scanned for its outer box QR code and inner RFID tag upon entry. The inbound processing console obtains the drug batch number (e.g., "202405A001"), inbound time (e.g., "2024-06-01 09:30:00"), and supplier code (e.g., "SUP-1739") by scanning. Based on the system partition number "C04", the batch information encoding algorithm is input. The system concatenates these attributes into "C04-202405A001-20240601093000-SUP1739" and generates a 128-bit batch identification code "BID" using SHA-256 hashing. This BID is automatically bound to partition "C04" and synchronously uploaded to the database. The entire warehouse processes over 450 drug batches daily, and the system automatically verifies that no duplicates or conflicts are found. All batches achieve a one-to-one spatial-batch-supply chain traceability relationship. The final output batch initialization data package includes BID, batch number, warehousing time, supplier ID and partition number, supporting subsequent expiration date collection and lifecycle modeling, realizing the granularity of drug traceability to the single batch / single warehouse level, with a traceability accuracy of 100%.

[0069] S1.3 Collects and records the expiration date information for each batch of medicines. It automatically reads the expiration date field from the warehousing voucher or medicine label using a data interface protocol, and stores it in a structured manner in combination with the batch identification code and storage location to support subsequent lifecycle tracking.

[0070] The input data includes a list of drug batches identified by batch identification codes, the warehouse area number corresponding to each batch, the data stream of the warehousing voucher, the data stream of the drug label, and the standardized data interface protocol parameters of the system.

[0071] An automated method for collecting expiration date fields is employed (parameters: barcode scanning interface, RFID reading protocol, OCR image recognition model, Electronic Data Interchange (EDI) interface) to automatically read the expiration date field from the warehousing voucher and physical label for each batch of medicines. Furthermore, an expiration date information parsing algorithm (parameters: standardized date format template, abnormal character correction rules, time field regular expression) is used to parse and standardize the collected raw expiration date data, outputting a YYYY-MM-DD structured date field. Further, a batch identification code and warehouse area index binding method is used (parameters: batch identification code BID, partition system number, association mapping table) to store the parsed expiration date information in a triplet structure with the unique batch identification code and its associated warehouse area number, ensuring that each expiration date data has clear spatial and batch traceability attributes. Furthermore, a high-reliability interface synchronization mechanism (parameters: interface call retry count, timeout check, breakpoint resume flag) is adopted to write the structured "batch identification code-warehouse area-expiration date" data into the central database in real time, and a multi-level verification process is set up, including field integrity detection, date logic verification, and batch uniqueness verification. Through redundancy verification and anomaly rollback mechanism (parameters: duplicate data comparison strategy, anomaly log recording), invalid or conflicting expiration date collection records are automatically identified and filtered, and the final compliant expiration date dataset is output. Through the above chain-like collection, parsing, binding, and verification process, the expiration date information of all batches of medicines in the front warehouse is transformed into high-granularity, traceable, and structured data input, providing a solid data foundation for subsequent drug lifecycle tracking and anomaly trend analysis, and realizing full-process digital control of batch-level drug expiration date information. For example, in the front warehouse system of a large chain pharmacy, 20 industrial-grade barcode scanners and 8 sets of RFID readers are configured for the warehousing process of different temperature-controlled zones. For each box of newly received medicines, the system scans the barcode / QR code signal and automatically recognizes the expiration date text on the medicine label (e.g., "Expires on: 2026-08-31"). Simultaneously, it extracts the standardized expiration date field from the electronic receipt. The system uses an OCR image recognition model to parse the date on the paper receipt, achieving an accuracy rate of 99.6%. All collected expiration date information is uniformly formatted and then structured into a triplet binding with the batch identification code "BID-20240601001" and the warehouse partition number "A03," generating the data record {BID-20240601001,A03,2026-08-31}. The automatic verification process performs a consistency comparison of multi-source collection results for the same batch. If two different dates are found within the same batch, manual review is triggered, and the latest system record is retained. The daily collection volume of expiration date data exceeds 5000 records across the entire warehouse, with an error rate of less than 0.2%.The final result is a structured dataset that meets the requirements of three-dimensional traceability of "batch-region-expiration date," providing high-quality input for subsequent twin modeling and inventory-expiration date linkage analysis. Application results show that this automated data collection and verification process achieves 100% coverage of batch-level drug expiration date traceability and improves data consistency to over 99.98%.

[0072] S1.4 collects real-time data on changes in the inventory quantity of all batches of medicines in each storage area. Using an inventory sensor interface or inventory management software API, it incrementally records operational events such as inbound / outbound, inventory count, and transfer by batch and storage location, thereby achieving accurate collection of dynamic inventory levels.

[0073] The input conditions are the batch information of medicines in each storage area after spatial partitioning mapping and batch identification code labeling, specifically including: storage area system number, unique batch identification code, basic attributes of medicines, bound expiration date data, and real-time operation event signals (such as warehousing, outbound, transfer, inventory, etc.).

[0074] A multi-channel inventory data acquisition interface method (parameters: high-precision weight sensor, intelligent shelf sensor, electronic tag quantity acquisition terminal, inventory management software API, data synchronization protocol) is adopted to achieve real-time inventory quantity acquisition for all drug batches in each storage area. Furthermore, through a batch-location mapping algorithm (parameters: batch identification code, storage area number, shelf physical location index table), the inventory change signal is precisely bound to the specific drug batch and storage space, and a timestamp is assigned to each acquisition result to achieve time-series traceability.

[0075] Furthermore, an incremental detection algorithm for inbound and outbound events (parameters: event type identifier, operation terminal ID, event timestamp) is employed to incrementally calculate the changes in inventory quantity for each batch of medicines during inbound, outbound, transfer, and inventory count operations, automatically identifying positive (increase) or negative (decrease) changes in inventory quantity. For inventory count operations, an inventory count calibration algorithm (parameters: historical inventory records, real-time collected values, error tolerance range) is used to dynamically correct historical inventory levels, ensuring that the inventory count results are consistent with the physical reality.

[0076] Furthermore, for high-frequency operation periods or concurrent inbound / outbound scenarios, a multi-threaded event queue processing mechanism (parameters: queue priority, batch lock flag, concurrent write buffer size) is adopted to ensure the integrity and real-time performance of batch-level inventory change data under different event flows. For data upload delays caused by network fluctuations or device malfunctions, a breakpoint resume and data supplementation algorithm (parameters: data packet number, maximum number of retries, data integrity check code) is used to automatically resend lost or abnormal data packets, ensuring that there is no missing inventory change data throughout the entire process.

[0077] By using dynamic inventory aggregation and structured storage algorithms (parameters: primary key of storage area, secondary index of batch identification code, and time series sharding window), the inventory change data of all batches of medicines in each storage area are archived and stored in a three-dimensional structure of "storage area-batch-time series". This provides high-granularity and traceable data support for subsequent expiration date linkage analysis and life cycle modeling, and realizes accurate collection and digital archiving of dynamic inventory.

[0078] For example, 24 sets of intelligent electronic shelf sensors are deployed in the front-end warehouse of a large chain pharmacy in a provincial capital city. Each set is equipped with a weight sensor with an error of less than ±1g and an RFID electronic tag scanning module. Each storage area processes more than 1200 batches of medicines for inbound, outbound, and transfer operations daily. The system automatically retrieves current inventory data for each batch in each area at a frequency of 1 minute via the API interface and adds a timestamp accurate to the second to each record. For inbound operations, after the RFID is scanned by the automatic sorting line, the system determines it as a positive increment and writes it into the inventory table; for sales outbound or transfer operations, the system identifies the electronic tag and determines it as a negative increment, deducting the corresponding batch's inventory in real time. For nighttime manual inventory checks, the system compares historical records with on-site collected values ​​using an inventory calibration algorithm. If the deviation exceeds 3%, it automatically prompts for verification and corrects the database inventory based on the latest inventory results. During peak periods, when multiple operation commands occur simultaneously in the same storage area, the system uses a multi-threaded queue processing method, and a batch locking mechanism ensures that the writing of different batches of data does not interfere with each other, with a daily concurrent data packet loss rate of less than 0.01%. All collected structured data, including "warehouse area-batch-time series-inventory quantity," is ultimately archived in the central database, and daily cumulative inventory change reports and anomaly traceability logs are output. Actual application results show that the system achieves a 99.96% accuracy rate in collecting dynamic inventory levels, with a single data collection latency of less than 1 second, effectively supporting subsequent digital twin modeling and drug expiration date-linked early warning analysis.

[0079] S1.5 automatically collects event data for each batch of drugs throughout its entire process (warehousing, transfer, allocation, sales, etc.), uses timestamps to mark and record relevant operators, event types, and operation terminal identifiers, and realizes multi-dimensional archiving of the entire event flow.

[0080] S1.6 initially aggregates the collected expiration date, inventory quantity, and circulation event data according to the "warehouse area - batch identification code - time series" structure, providing traceable data input for subsequent data cleaning, twin modeling, and anomaly trend analysis.

[0081] The input data includes a list of drug batches for each storage area, mapped by spatial partitions and identified by batch identification codes. The fields involved are the storage area system number, unique batch identification code, drug expiration date, real-time inventory quantity, and full-process event data (such as warehousing, transfer, allocation, sales, etc.) and their related timestamps.

[0082] A multidimensional structured preliminary aggregation method (parameters: warehouse area number, batch identification code, time series window) is adopted to achieve high-granular archiving of all collected drug expiration date information, inventory quantity change data and circulation event data.

[0083] Furthermore, through a hierarchical index merging algorithm (parameters: primary index storage area, secondary index batch identification code, and tertiary index time series), the original multi-source data is initially aggregated according to the three-dimensional structure of "storage area - batch identification code - time series", ensuring that all attributes and events of the same batch of drugs at different time points and in different storage areas have a one-to-one mapping relationship.

[0084] Furthermore, a dynamic attribute synchronization algorithm (parameters: expiration date field, inventory quantity field, event type, and operation terminal identifier) ​​is adopted to align the expiration date information, inventory quantity, and circulation events under the same timestamp at the field level, and placeholder marks are set for missing or abnormal fields to ensure data integrity and traceability in subsequent processing.

[0085] Furthermore, through incremental data verification and aggregation window mechanism (parameters: minimum time granularity, event concurrency tolerance range, batch uniqueness detection rules), the multi-source event data collected at high frequency within a short period of time is deduplicated and verified, eliminating data redundancy caused by system concurrency or multi-point upload, and retaining only unique event records with clear time sequence.

[0086] Through the above multi-step chain aggregation process, the expiration dates, inventory quantities, and full-process flow event data of all drug batches in each storage area are efficiently integrated into a structured three-dimensional dataset of "storage area-batch identification code-time series", which provides a high-granularity and traceable data foundation for subsequent data cleaning, digital twin modeling, and anomaly trend analysis.

[0087] For example, in a large chain pharmacy's forward warehouse, the system collects an average of 12,000 records of expiration date data, 18,000 records of inventory quantity changes, and 23,000 end-to-end flow events daily, involving 12 temperature-controlled zones and 3,500 drug batches. The system performs initial aggregation in 5-minute time windows, uses a hierarchical indexing and merging algorithm to sequentially build 12 sets of master indexes for warehouse areas, each subdivided into 3,500 batch identification codes, and then archives all events and attributes by minute-level timestamps. A dynamic attribute synchronization algorithm automatically aligns each inventory change with the corresponding expiration date field and fills in placeholders for special scenarios such as inventory delays, ensuring data continuity. An incremental verification mechanism removes approximately 320 duplicate records daily due to multiple uploads, effectively improving the uniqueness and timeliness of the aggregated dataset. The final output of the 3D structured aggregated dataset has a coverage of 100%, providing high-quality and traceable data support for subsequent high-precision twin modeling and anomaly trend analysis. Practical application shows that this aggregation process reduces the data preprocessing time of subsequent models by 35% and improves the anomaly tracing accuracy to 99.93%.

[0088] S2: Perform data cleaning and time-series normalization on the collected raw data, including removing duplicate records, correcting timestamp errors, and synchronizing the expiration date and inventory quantity fields to ensure data integrity and availability. This step is responsible for systematically cleaning and normalizing the raw drug batch data collected from various storage areas of chain pharmacy front-end warehouses. The main purpose is to eliminate redundancy, errors, and time-series inconsistencies in the raw data, and to ensure the synchronization and consistency of the drug expiration date and inventory quantity fields in the time dimension. Through this step, the integrity and availability of the data can be significantly improved, providing a high-quality, structured data input foundation for subsequent key steps such as digital twin modeling, anomaly trend analysis, and behavior-driven prediction.

[0089] S2 includes the following steps:

[0090] S2.1 performs uniqueness verification on the collected original drug batch data, using the batch identification code and storage area index as the primary key, and performs deduplication processing on event records such as warehousing, transfer, and sales to eliminate data redundancy caused by multiple collection points or repeated system uploads, ensuring the uniqueness of each event in the time series.

[0091] The input object is the original drug batch dataset after spatial partitioning mapping and batch identification code labeling, which includes fields such as storage area number, batch unique identification code, circulation event records such as warehousing / transfer / sales and their associated timestamps, expiration date and inventory quantity.

[0092] A uniqueness verification algorithm (parameters: batch identification code BID, storage area number, event type, timestamp) is used to detect the primary key constraints of all collected event records in the three-dimensional structure of "storage area-batch identification code-time series".

[0093] Furthermore, by using a multi-point acquisition redundancy identification method (parameters: event operation terminal ID, uploaded batch number, event type code), cluster comparison is performed on data of the same drug batch, the same event type, and the same timestamp uploaded from different acquisition devices or system interfaces, and suspected duplicate record sets are automatically filtered out.

[0094] Furthermore, an event content hash deduplication algorithm (parameters: complete set of event attribute fields, content hash function) is adopted. For suspected duplicate events, their attribute hash values ​​are calculated. If the hash values ​​are completely identical, only one record is retained, and the rest are marked as redundant and archived to the abnormal data pool.

[0095] Furthermore, through a time window tolerance mechanism (parameters: timestamp tolerance interval Δt, event attribute similarity threshold), for near-duplicate events caused by device upload delays or network fluctuations, among multiple records that occur within Δt and have highly similar attributes, only the earliest or most complete one is retained, and the remaining parts are included in the redundancy cleanup list.

[0096] Furthermore, through a batch-level uniqueness verification feedback mechanism (parameters: primary key integrity verification, redundant record count statistics), uniqueness statistics are performed on all events in each batch, and a verification report is output, including indicators such as data volume before and after deduplication, redundancy rate, and primary key coverage rate.

[0097] Through the above multi-level deduplication process, the redundancy of multi-point collection and the abnormality of repeated system uploads in the original batch data are thoroughly cleaned up, ensuring that each flow event such as warehousing, transfer, and sales retains only one valid record in the same batch and time sequence. This achieves high-reliability initialization of batch-level event streams and lays the foundation for subsequent time series alignment and data integrity detection.

[0098] For example, in a chain pharmacy's front-end warehouse management system, an average of 22,000 raw transaction event data entries are collected daily, involving 12 independent storage areas and 4,000 drug batches. The system employs a uniqueness verification algorithm, first using "storage area number + batch identification code + event type + timestamp" as the primary key index to perform a primary key scan on all data. Approximately 430 redundant records were detected due to duplicate uploads from RFID collection terminals and manual scanning terminals. A content hash deduplication algorithm was applied, performing SHA-256 hash comparisons on data attribute fields (such as operator ID, inventory change value, and operation terminal identifier) ​​under the same primary key, confirming 325 completely duplicate records and automatically removing them. For the remaining 105 nearly duplicate events uploaded within 2 seconds but with minor field differences, a time window tolerance mechanism of Δt = 3 seconds was applied, retaining only those with the most complete data fields, and adding the rest to the redundancy pool. The final output consisted of 21,670 unique transaction event data entries, reducing the redundancy rate to below 1.5%. The verification report shows that the primary key coverage of all batches is 100%, with no omissions or deletions, ensuring a highly accurate and reliable data foundation for subsequent time-series normalization and twin modeling. In practical applications, this deduplication process increases the anomaly tracing rate to 99.97%, greatly improving the efficiency and accuracy of data integration and intelligent analysis.

[0099] S2.2 performs time error correction on the timestamp field in the original event data based on a high-precision clock synchronization algorithm. It reconstructs or interpolates timestamp values ​​that are missing, ambiguous, or abnormal, so as to achieve global time-series alignment of event streams from different batches and storage areas, laying the foundation for subsequent time-series analysis.

[0100] The input data is the original drug batch circulation event dataset after uniqueness verification, covering storage area number, batch unique identifier, various circulation event types and their associated timestamp fields. A high-precision clock synchronization algorithm (parameters: central server standard clock, local clock deviation of each acquisition terminal, network transmission delay) is used to synchronize and correct the timestamps of all circulation event data. Furthermore, a time error detection and marking method (parameters: master clock tolerance threshold Δt, event acquisition source ID, historical calibration records) is used to automatically screen for missing, ambiguous, or abnormal timestamp fields and assign them anomaly tags. Further, for missing or ambiguous timestamp values, a time-series reconstruction or interpolation correction algorithm (parameters: event sequence context, nearest neighbor event time, interpolation strategy type) is used to reconstruct reasonable timestamps while ensuring the consistency of batch-level event order. A global time-series alignment algorithm (parameters: primary key of storage area, secondary index of batch identification code, and corrected timestamp set) is used to merge and sort event streams under different storage areas and batches, forming an unambiguous global time series and achieving unified time-series normalization of multi-source asynchronous data. Through this processing method, the timestamps of all flow events in the uniquely verified dataset are standardized and globally aligned, outputting highly consistent and complete batch-level full-process event time-series data. This provides an accurate time-series benchmark for subsequent expiration date and inventory dynamic analysis, improving the ability to identify abnormal trends early. For example, in a large chain pharmacy's front-end warehouse system, an average of 22,000 raw flow event data entries are collected daily, involving 12 storage areas and 4,000 drug batches. A high-precision NTP standard clock is configured on the central server, and the local clocks of each collection terminal are automatically synchronized once a day. All event collection terminals upload event data in real time, and the system detects that approximately 1.2% of events have missing timestamps or deviations exceeding 3 seconds. For the 650 records with missing timestamps, the system performed linear interpolation correction based on the average time of the two nearest valid records in that batch. For the 120 records with excessive deviation, the timestamps were adjusted to the standard time according to the main server calibration logs. After correction, all events were globally sorted using a three-dimensional index of "warehouse area - batch identification code - global timestamp," achieving unified alignment of the original asynchronously uploaded event streams. In the final output dataset, the timestamp field achieved 100% completeness, and all batch event streams were free of disorder and overlap, achieving high-precision and high-consistency global time-series normalization, effectively improving the prediction accuracy and anomaly response speed of subsequent inventory-expiration linkage analysis.

[0101] S2.3 performs synchronous normalization processing on the expiration date information and inventory quantity fields. Based on the same time base, the batch expiration date and the corresponding inventory quantity at the time point are structured and matched. It automatically fills in the incomplete field phenomenon caused by inventory delay, data loss, etc., to ensure that the same batch of medicines has complete expiration date and inventory quantity data at all times.

[0102] S2.4 employs a data integrity detection algorithm to perform full-field validation on the cleaned batch-level dataset, including the rationality of the expiration period range, the non-negativity of the inventory quantity, and the continuity of the batch flow path. Problematic data detected is marked and an anomaly report is output, providing a basis for manual or automatic error correction.

[0103] S2.5 standardizes and stores the high-quality, structured drug batch data processed above according to the three-dimensional index of "warehouse area - batch identification code - time series", and outputs a dataset for subsequent digital twin modeling and anomaly trend analysis, realizing the efficient transformation of raw data into analytically usable data.

[0104] S3: Based on drug data from different batches and storage areas, construct digital twin models to record the lifecycle trajectory of each batch of drugs throughout the procurement, warehousing, storage, allocation, and sales processes. This step aims to construct digital twin models based on drug data from different batches and storage areas, recording in detail the lifecycle trajectory of each batch of drugs throughout the entire process of procurement, warehousing, storage, allocation, and sales. Through high-precision data-driven modeling, achieve a digital mapping between the physical flow of drugs and inventory dynamics, providing a traceable and simulateable digital foundation for subsequent expiration date-inventory linkage analysis, abnormal trend early warning, and intelligent intervention decisions.

[0105] S3 includes the following steps:

[0106] S3.1 For cleaned and normalized batch-level drug data, based on the three-dimensional index structure of 'warehouse area-batch identification code-time series', a unique digital twin is initialized and modeled for each batch of drugs to achieve full-cycle virtual mapping of physical drug batches.

[0107] The input is processed by step S2 and outputs a drug batch dataset with high-quality field integrity, time-series normalization, and standardized storage in a three-dimensional index structure of "warehouse area-batch identification code-time series". It includes the expiration date information, inventory quantity, circulation events and spatial location information of each drug batch.

[0108] A digital twin initialization modeling method based on a three-dimensional primary key unique index (warehouse area, batch identification code, and time series) is adopted to instantiate a corresponding digital twin object for each batch of drugs, thereby achieving an accurate one-to-one mapping between physical drug batches and virtual twin models.

[0109] Furthermore, by using a partitioned scanning algorithm, the cleaned batch data under all storage areas is traversed. Based on the uniqueness constraint of the batch identification code, the twin creation interface (parameters include batch attributes, spatial location, and initialization time) is called to dynamically generate and register a digital twin structure exclusive to that batch.

[0110] Furthermore, using an attribute mapping method (parameters: batch expiration date, warehousing time, initial inventory), the static attributes and the first time-series node of each batch of medicines are injected into the digital twin to form the lifecycle starting state, and its initial environmental context (such as the storage area, supplier source, etc.) is recorded.

[0111] Furthermore, by using a time-series initialization algorithm (parameters: event stream start node, first and last timestamps), an empty time-series event stream container is configured for each digital twin to prepare for the dynamic recording and update of subsequent lifecycle trajectories.

[0112] Through the above modeling process, high-quality drug batch data that has been cleaned and time-series aligned is transformed into traceable and scalable digital twin objects, providing a structured modeling foundation for the full-process event mapping, anomaly analysis, and behavior-driven prediction of subsequent batches of drugs, and achieving a high degree of consistency between the physical flow and virtual life cycle of drugs.

[0113] For example, in a chain pharmacy's front-end warehouse management system, five independent storage areas are configured, and digital twin initialization modeling is performed on all drug batches under each area. For storage area A, 50 valid batch data are collected. Each batch has its own batch number (e.g., B20240101), warehousing time (2024-06-01), expiration date (2025-06-01), and initial inventory quantity (100 boxes) obtained through barcode scanning. The system uses a three-dimensional primary key (A...

[0114] The system registers twin objects (B20240101, 2024-06-01) and assigns a unique virtual entity ID to each batch. Static attributes are injected into the twin objects through the attribute mapping interface; for example, the expiration date field is mapped to the twin's lifecycle start point, and the initial inventory quantity is used as the twin's first state storage node. Subsequently, the system allocates an empty event stream container for each twin to prepare for the subsequent dynamic entry of time-series events such as procurement, transfer, and sales. In practical applications, after initial modeling, the system can quickly retrieve twin instances of any batch of medicines in each storage area on the operations side, and realize full-process traceability and state simulation based on this model, providing comprehensive and high-precision data support for anomaly warning and trend analysis algorithms. Through the above process, all medicine batches achieve a one-to-one physical-virtual correspondence, and the lifecycle modeling is free of duplicate codes and omissions, effectively improving subsequent anomaly monitoring and response capabilities.

[0115] S3.2 inputs full-process event flow data such as procurement, warehousing, storage, allocation, and sales into each digital twin. Using event-driven modeling algorithms, it dynamically updates the twin's attributes, including state transition nodes, quantity changes, flow information, and validity period parameters, to achieve high-granular characterization of the life cycle trajectory.

[0116] S3.3 Based on the time-series event flow in the twin model, the state transition process between each stage (such as warehousing, in-warehouse, transfer, and out-of-warehouse) is modeled in segments. Multi-state finite automata or Petri nets are used to accurately describe the transfer and retention characteristics of drug batches in each link of the supply chain, forming a simulateable life cycle flow path.

[0117] S3.4 integrates real-time inventory changes and expiration date attributes into the twin model, and applies a time-series data fusion algorithm to map the inventory quantity and remaining expiration date status of each batch of medicines at any time, providing structured input features for subsequent expiration date-inventory anomaly trend analysis and prediction algorithms.

[0118] S3.5 stores the constructed batch-level digital twins and their lifecycle trajectories in a multi-dimensional group according to the storage area and batch primary key, and establishes cross-regional data reference relationships to support subsequent cross-warehouse transfers, anomaly tracing, and visualization analysis, thereby enabling efficient tracking and retrieval of drug circulation information.

[0119] S4: Collect and serialize key supply chain behavioral events involving various warehousing areas, including promotional campaign launches, seasonal demand fluctuations, and drug recalls, and perform multi-dimensional feature labeling on the event flow. This step is responsible for collecting and serializing key supply chain behavioral events involving various warehousing areas. By performing multi-dimensional feature labeling on behavioral events, it achieves structured, traceable, and high-granular representation of the behavioral event flow, providing multi-source heterogeneous event input support for subsequent behavior-driven anomaly risk prediction and inventory-expiration-terminal linkage early warning models. This step plays a crucial role in the overall solution by bridging the data channel between supply chain operational dynamics and inventory lifecycle analysis, and is a key link in realizing anomaly trend sensitivity analysis and proactive early warning.

[0120] S4 includes the following steps:

[0121] S4.1 interfaces with the management systems of each independent warehousing area of ​​the chain pharmacy's front warehouse, and obtains the supply chain operation logs and raw data of business events involving each area in real time based on standardized APIs or message queue protocols, so as to establish a foundation for collecting behavioral events across warehousing areas.

[0122] S4.2, based on a behavioral event type dictionary, performs event classification algorithm processing on the collected raw operational events (including promotional campaign launches, seasonal demand fluctuations, drug recalls, price changes, emergency allocations, etc.), standardizes the encoding of events by category, scope of impact, and triggering source, and outputs a structured preliminary event list.

[0123] For each type of key behavioral event, S4.3 combines metadata such as the event occurrence time, associated drug batch, storage area number, and operator identity, and uses a multi-label feature extraction algorithm to automatically label the event's temporal characteristics, impact intensity, business priority, and potential risk level, thereby achieving multi-dimensional feature labeling.

[0124] S4.4 For continuous or related behavioral events occurring within the same storage area, serialization modeling algorithms (such as sliding window aggregation or event stream compression technology) are applied to serialize event groups with high frequency, obvious interaction or causal chain relationships, generating event stream fragments with time-dependent characteristics.

[0125] Based on data security and traceability requirements, S4.5 uses blockchain hash signature or digital watermarking algorithms to uniquely trace all collected and labeled behavioral event streams, ensuring that each key event data has an immutable identity credential, providing security for subsequent anomaly analysis and accountability investigation.

[0126] S4.6 efficiently archives and stores the generated multi-dimensional characteristic and serialized behavioral event stream according to a multi-level index structure of "warehouse area-time series-event type-batch", and outputs a standardized event dataset to subsequent lifecycle mapping algorithms and behavior-driven prediction models through the data interface, thereby realizing cross-module data collaboration.

[0127] S5: Utilizing a lifecycle mapping algorithm, the drug expiration date curve is paired with the dynamic inventory consumption curve in real time. The dynamic trend of the remaining inventory and the critical intersection point of expiration is calculated for different storage areas and drug types. This step aims to use the lifecycle mapping algorithm to pair the drug expiration date curve with the dynamic inventory consumption curve in real time, and calculate the dynamic trend of the remaining inventory and the critical intersection point of expiration for different storage areas and drug types. This step enables the proactive identification of risks associated with impending drug expiration and asynchronous inventory consumption, providing a structured and timely analytical basis for subsequent abnormal trend warnings and operational decisions. It is a core step in achieving a dynamic balance between inventory turnover efficiency and drug expiration risk.

[0128] S5 includes the following steps:

[0129] S5.1 groups and filters batch-level drug data that has been modeled using digital twins, based on the dimensions of storage area and drug type, and extracts the remaining inventory time-series data and expiration date countdown curve data of each batch as input objects for lifecycle mapping.

[0130] S5.2 employs a sliding window time-series pairing algorithm to synchronously map the inventory change curves and expiration date reduction curves of the same batch of drugs in different time segments, and compares and analyzes the interaction characteristics of the two curves at any time to capture the relative change relationship between the inventory consumption rate and the expiration date consumption rate.

[0131] S5.3 uses a dynamic threshold determination mechanism to calculate the critical intersection of the remaining inventory and the remaining valid days for each batch of drugs in real time. It also generates a set of critical indicators for each region based on the attributes of the storage area. This is used to identify key time periods where excess inventory or delayed consumption leads to the accumulation of expiration risk.

[0132] S5.4 utilizes a multi-dimensional feature trend extraction algorithm to fit trend lines to batch-level inventory-expiration pairing results, uncovering patterns such as delayed inventory consumption, rapid approach of expiration dates, or abnormal inflection points between the two, and outputting an indicator matrix reflecting the changing trends of abnormal risks under different storage areas and drug types.

[0133] S5.5 performs time-series visualization encoding on the above dynamic trend analysis results, generating the change trajectory of the batch-level 'remaining inventory - expiration date intersection' for each storage area and drug type, providing real-time, high-granularity data input for subsequent behavior-driven prediction and linkage early warning models.

[0134] S6: Input multi-dimensional behavioral event flows into the behavior-driven prediction model to analyze the sensitivity of key events that may affect inventory turnover and expiration date consumption in the short term to abnormal risks, targeting different drug categories and storage locations. This step aims to input the collected and serialized multi-dimensional supply chain key behavioral event flows into the behavior-driven prediction model, systematically analyze the impact sensitivity of various key events on abnormal risks of inventory turnover and expiration date consumption in the short term for different drug categories and storage locations, thereby providing accurate predictive basis for highly forward-looking abnormal trend early warning and coordinated intervention. This step builds upon the previous dynamic mapping between behavioral event flows and batch drug status in the overall technical solution, focusing on the identification and quantification of risk-sensitive intervals by intelligent prediction algorithms, and is the core link to achieve early intervention and shorten early warning latency.

[0135] S6 includes the following steps:

[0136] S6.1 performs feature vectorization processing on the serialized multi-dimensional supply chain behavior event stream, and uses event embedding encoding or time-series window extraction algorithms to transform events such as promotions, seasonal fluctuations, and recalls into structured feature inputs to ensure that the data dimensions of the input behavior-driven prediction model are complete and the timestamps are consistent.

[0137] Based on the unique identifiers of storage area, drug category, and batch, S6.2 dynamically associates the characteristic behavioral event stream with the corresponding digital twin model. It adopts index matching and synchronization alignment algorithms to ensure that each event stream can be accurately mapped to its corresponding drug batch and physical storage location during predictive analysis, thereby achieving precise binding of event-object.

[0138] S6.3 uses structured event features and digital twin state variables as joint inputs, and utilizes short-time series prediction algorithms (such as temporal convolutional networks, LSTM, etc.) or custom behavior-driven prediction models to perform multi-scenario simulation predictions on the inventory turnover rate and expiration consumption trend of each batch of drugs within a preset time window in the future, and outputs the sensitivity probability distribution of each key event to the risk of linkage between inventory and expiration.

[0139] S6.4 performs sensitivity analysis and abnormal risk quantification on the predicted output results. It uses methods such as threshold discrimination, graded scoring or statistical significance testing to refine and stratify the abnormal inventory-expiration risk levels that may be caused by future key events under different drug categories and storage locations, providing a data foundation for the formulation of subsequent graded early warning strategies.

[0140] S6.5 compares the quantified sensitivity analysis results with the historical anomaly case database, and uses similarity measurement or model confidence adjustment mechanisms to correct and optimize potential errors or special scenarios in the prediction, outputting a high-confidence anomaly risk sensitivity index that can be used for real-time decision-making, providing structured input for subsequent automatic early warning and path traceability.

[0141] S7: Determine if the current batch of medicines simultaneously meets the following conditions: its inventory is above the safety threshold and its expiration date is nearing its end, or its inventory consumption rate is lower than the historical average and its expiration date shows a shortening trend; if so, generate a corresponding tiered linkage early warning signal. This step is used to perform multi-dimensional conditional judgment on the real-time status of each batch of medicines to determine whether it simultaneously meets the combined abnormal conditions such as inventory above the safety threshold and expiration date nearing its end, or inventory consumption rate lower than the historical average and expiration date showing a shortening trend, thereby generating a tiered linkage early warning signal. This step is the core decision-making step for realizing intelligent early warning of dynamic linkage anomalies between inventory and expiration date, directly determining whether abnormal risks can be identified in advance and intervention can be triggered, significantly affecting the turnover efficiency and compliance security of medicines in the pre-positioned warehouse.

[0142] S7 includes the following steps:

[0143] S7.1 For each batch of medicine in the digital twin model, extract its remaining inventory quantity and remaining expiration days based on the current time window, and use them as input variables for anomaly detection.

[0144] S7.2 uses an inventory safety threshold determination algorithm to compare the extracted remaining inventory quantity with the preset safety inventory threshold, determine whether the batch of drugs is in a high inventory state, and output the high inventory determination result.

[0145] S7.3 uses an expiration date threshold warning algorithm to compare the remaining validity days of a batch of drugs with the near-expiration warning threshold to determine whether there is a risk of the expiration date approaching and outputs the expiration date judgment result.

[0146] S7.4 uses batch-level historical time-series inventory consumption data, applies the sliding window method or the exponentially weighted moving average algorithm to calculate the current inventory consumption rate, compares it with the historical average, and identifies abnormal states where the consumption rate is lower than the long-term average.

[0147] S7.5 uses the remaining shelf life change rate analysis method to model the decreasing trend of the shelf life of the same batch of drugs, detect whether there is a risk of accelerated shortening of shelf life or earlier critical point, and output trend change signals.

[0148] S7.6 performs multi-condition logical combination judgment on high inventory judgment results, near expiration judgment results, abnormal inventory consumption rate and expiration date decreasing trend signals, and uses a condition rule engine to identify whether the composite abnormal situation such as "high inventory and near expiration date" or "low consumption rate and shortened expiration date" is met.

[0149] Based on the severity and scope of the abnormal situation, S7.7 calls the graded linkage early warning generation module to output the corresponding level (such as general, important, and urgent) abnormal early warning signal, and marks the associated batch number, storage area and triggering conditions to the early warning message structure to realize the automated generation and distribution of early warning signals.

[0150] S8: Present the generated abnormal trend warning results to the operations management end in the form of a traceability path diagram, clearly indicating the risky batches, related storage areas, and influencing behavioral events to enable traceable intervention. This step is responsible for presenting the system-generated warning results of abnormal trends in drug expiration dates and inventory to the operations management end in a traceable and intuitive path diagram, clearly marking the involved risky batches, related storage areas, and key behavioral events affecting the anomaly. Through visualization and path tracing, not only is the understanding of the causes of anomalies and the efficiency of traceability intervention improved by operations personnel, but data support is also provided for subsequent intervention decisions, achieving transparency and efficiency in risk management.

[0151] S8 includes the following steps:

[0152] S8.1 performs structured analysis on the abnormal warning signals output by the hierarchical linkage early warning module. Based on fields such as batch identification code, warehouse area number and related behavioral events, it organizes them into standardized abnormal event data packets to support subsequent visualization processing.

[0153] S8.2 uses an abnormal event data packet and a traceability path modeling algorithm to map the lifecycle trajectory of a drug batch from its entry into the warehouse to its current state with the key behavioral event flow in a time sequence, constructing a "warehouse area-batch-event" associated path structure, and outputting the logical relationship between path nodes and edges.

[0154] S8.3 uses a visualization rendering engine to draw the flow trajectory of each batch of medicines in different storage areas, the associated abnormal behavior events and risk nodes, into a multi-dimensional path diagram according to the time sequence, so as to realize multi-level risk visualization display.

[0155] In the visualization interface, S8.4 interactively annotates each abnormal warning path, including highlighting high-risk batches, marking abnormal storage areas, and attaching detailed information on related behavioral events, so that the operations team can quickly locate the cause and scope of the abnormality.

[0156] S8.5 adds a traceable operation interface to each traceability path map, allowing operators to review historical event details, access original operation records, or trigger automatic intervention suggestions with one click based on path nodes, achieving full-link traceable closed-loop management from anomaly discovery to intervention execution.

[0157] S9: Based on historical early warning feedback and actual processing results, adaptive training is performed on the early warning rules to dynamically optimize the early warning threshold parameters under different drug types and business cycles, achieving model self-calibration and performance improvement. This step, based on historical early warning feedback and actual processing results, adaptively trains the early warning rules used in the system for detecting abnormal trends in the linkage between drug expiration dates and inventory, dynamically optimizing the early warning threshold parameters under different drug types and business cycles, achieving model self-calibration and continuous performance improvement. This step plays a core role in the overall technical solution, enabling intelligent evolution of the early warning mechanism, reducing the risk of manually setting thresholds, and adapting to the variability of business operations. It is a key link in ensuring the system's long-term, efficient, and accurate early warning of abnormal trends and improving operational response sensitivity.

[0158] S9 includes the following steps:

[0159] S9.1 collects historical early warning signals and their corresponding actual processing results. Based on a multi-dimensional index of 'drug type-storage area-batch-time window', it extracts the judgment threshold, triggering conditions, response delay, and final processing feedback for each early warning, which serves as the data basis for adaptive training.

[0160] In the main step S9, the sub-step S9.1 serves to provide high-quality training samples and parameter feedback for the subsequent adaptive training of the early warning rules. Its input consists of multi-dimensional raw data, including historical early warning signals output by the aforementioned abnormal trend early warning module, actual processing feedback from the operational end, batch drug information, warehouse area numbers, and the time window of the event.

[0161] A multi-dimensional aggregation method (parameters: drug type, storage area, batch identifier, time window) is adopted to achieve structured archiving of historical early warning signals and corresponding actual processing results.

[0162] Furthermore, through a rule parsing algorithm (parameters: warning rule ID, threshold setting, triggering condition), the judgment threshold, warning triggering condition, and associated event type used for each historical warning are extracted, thereby achieving automatic binding of rule parameters and event instances.

[0163] Furthermore, a response delay calculation method (parameters: warning trigger time, processing start time) is adopted to accurately calculate the response delay of each historical warning signal and incorporate it into a multi-dimensional aggregation table.

[0164] Furthermore, by processing feedback labeling algorithms (parameters: processing result type, compliance status, turnover improvement magnitude), the operational side can achieve standardized extraction of the actual processing feedback of each historical warning signal, including but not limited to quantitative or qualitative indicators such as whether the processing is timely, whether the anomaly is eliminated, and whether the inventory is optimized.

[0165] By using an index fusion method, the above parameter data are efficiently aggregated according to a four-dimensional index of "drug type-warehouse area-batch-time window" to output a structured training dataset, which serves as the basic input for subsequent feature attribution analysis, adaptive optimization and other steps, thus realizing the efficient transformation of raw historical data into training samples that can be used for analysis.

[0166] For example, in the second quarter of 2023, a management system for a chain pharmacy's front-end warehouse collected all abnormal trend warning signals within the period of "Antibiotics - Central Warehouse A - Batch 20230315 - Early April to End of June". A multi-dimensional collection method was used to bind 58 warning signals with high inventory and near-expiration dates within this time window to their corresponding actual operational feedback. The rule parsing algorithm automatically extracted key parameters for each warning, such as the inventory safety threshold (e.g., 150 boxes), near-expiration threshold (e.g., 30 days), and triggering conditions (e.g., inventory > threshold and expiration date < threshold). The response latency calculation method accurately measured the average response time from triggering to actual processing for each warning signal as 14.7 hours, with the fastest being 2 hours and the slowest 48 hours. The processing feedback labeling algorithm categorized operational feedback into three types: "timely processing and sold out," "partial risk mitigation," and "failed to sell expired items," and quantified the increase in inventory turnover rate (e.g., an increase of 12%). Finally, the index fusion method maps the above data into the index node “Antibiotics-Central Warehouse A-Batch 20230315-2023Q2”, and outputs a set of structured sample sets containing attributes such as threshold setting, triggering conditions, response latency, and actual feedback, laying a solid data foundation for subsequent model attribution analysis and threshold adaptive optimization.

[0167] Based on the collected historical feedback data, S9.2 uses a feature attribution analysis algorithm to statistically evaluate the accuracy of various early warning rules (such as high inventory threshold, near expiration criterion, abnormal consumption rate threshold, etc.) under different drug categories and business cycles, and identifies key parameters that affect false alarms and missed alarms.

[0168] For the structured training dataset of historical early warning signals and actual processing feedback that has been fused and organized by multidimensional indexing, a feature attribution analysis algorithm (parameters: early warning rule ID, drug type, business cycle, storage area, judgment threshold, response delay, processing result label) is used to achieve statistical evaluation of the accuracy of various early warning rules under different drug categories and business cycles.

[0169] Furthermore, by using the attribution feature decomposition method (parameters: high inventory threshold, near expiration criterion, abnormal consumption rate threshold, etc.), feature decomposition is performed on each historical early warning event instance, and the correspondence between the discrimination result and each rule parameter is extracted to form a parameter-result attribution mapping matrix.

[0170] Furthermore, a confusion matrix analysis algorithm (parameters: actual result label of the warning signal, rule discrimination output) is adopted to realize the statistics of TP (true positives), FP (false positives), FN (false negatives), and TN (true negatives) of various warning rules under different drug types and business cycles, and to calculate performance indicators such as accuracy, recall, and F1 score.

[0171] Furthermore, through sensitivity and specificity evaluation algorithms (parameters: rule parameter setting range), the impact of changes in key parameters such as high inventory threshold, near expiration threshold, and abnormal consumption rate threshold on the false alarm (FP) and false alarm (FN) probabilities of early warning judgment results is quantitatively analyzed, and the parameter-false alarm / false alarm impact factor matrix is ​​output.

[0172] Furthermore, principal component analysis (parameters: feature attribution matrix, performance index) is used to identify the early warning rule parameters that have the greatest impact on false alarm rate and false negative rate under different drug types and business cycles, providing priority adjustment targets for subsequent adaptive optimization.

[0173] Through the above chain-like feature attribution analysis, the original structured training samples are transformed into multidimensional statistical evaluation data that reflects the discrimination performance of early warning rules and the sensitivity of key parameters, so as to realize the attribution of the impact of parameters such as high inventory threshold, near expiration criterion, and abnormal consumption rate threshold on false alarms and missed alarms and the identification of key parameters.

[0174] For example, in the second quarter of 2023, a feature attribution analysis algorithm was used to evaluate 58 structured sample sets of abnormal trend warnings within the period of "Antibiotics - Central Warehouse A - Batch 20230315 - Early April to End of June". First, the attribution feature decomposition method extracted parameters for each warning, including the high inventory threshold (150 boxes), the expiration date threshold (30 days), and the abnormal consumption rate threshold (10% below the historical average), and correlated them with the actual processing results. Confusion matrix analysis showed that the high inventory and near-expiration rule had a TP of 41, FP of 7, FN of 6, and TN of 4 in this period, with a precision of 0.775 and a recall of 0.872. Sensitivity assessment showed that lowering the high inventory threshold from 150 boxes to 130 boxes increased FP by 3 cases and decreased FN by 2 cases. Principal component analysis revealed that the high inventory threshold had the greatest impact on the false positive rate, while the expiration date threshold had the greatest impact on the false negative rate. Finally, a set of key parameter-performance index attribution matrices is output, providing a scientific basis for subsequent adaptive parameter optimization.

[0175] S9.3 utilizes adaptive optimization algorithms (such as Bayesian optimization, genetic algorithms, or reinforcement learning) to perform multiple rounds of simulation adjustments on early warning threshold parameters for various drugs and cycle scenarios, with historical accuracy, response latency, and business satisfaction as objective functions, to generate a set of optimal parameter suggestions.

[0176] S9.4 automatically applies the obtained optimal threshold parameters to the current early warning model through an online model update mechanism, and calls the latest optimized parameters in real time for the judgment process of newly generated abnormal trends in the future, so as to realize the dynamic adaptation of the early warning logic.

[0177] S9.5 continuously tracks the effect of the early warning output after each model parameter update, and adopts a closed-loop performance evaluation algorithm to compare the accuracy, lead time and effectiveness of business intervention of the early warning system in the historical stage with the current stage, so as to verify the effectiveness of model self-calibration and detect abnormal drift in a timely manner.

[0178] During the adaptive training process of the model, S9.6 automatically identifies and introduces new influencing factors (such as new promotional behaviors, sudden policy changes, etc.) into the parameter optimization range based on the new feature distribution of the feedback data, continuously expanding the model's ability to generalize to complex business scenarios.

[0179] The intelligent supply chain management method for chain pharmacy pre-positioned warehouses provided in this application completely overturns the traditional inventory-expiration analysis method that relies solely on static ledgers or single-field comparisons by achieving full-process digital twin modeling at the batch and warehouse area levels. Through automatic spatial partitioning identification, unique batch coding, and multi-source data fusion, it ensures high-precision collection and real-time traceability of drug circulation information throughout the entire chain, realizing an improvement in drug management granularity from the warehouse level to the batch / location level, effectively improving traceability accuracy, and laying a solid data foundation for subsequent anomaly warning and intelligent decision-making.

[0180] By pairing the drug expiration curve with the dynamic inventory consumption curve in real time and calculating the dynamic trend of the intersection of remaining inventory and expiration date, the risk of remaining inventory approaching its expiration date can be predicted in advance, giving pharmacies ample time to take measures such as promotions and allocations to avoid drug waste due to expiration.

[0181] By collecting and serializing key supply chain behavioral events (such as promotional launches, seasonal fluctuations, and recalls), a behavior-driven prediction model is constructed, incorporating the sensitivity of these events to inventory consumption and shelf-life risks into the predictive analysis. This method overcomes the limitations of traditional static threshold-based early warning systems, which cannot cope with sudden market changes and complex business scenarios. In dynamic scenarios such as peak promotional periods, new product launches, or emergency allocations, it can achieve real-time quantification and accurate prediction of risk trends, significantly reducing false alarms and missed alarms.

[0182] Example 2

[0183] This embodiment provides an intelligent supply chain management system for chain pharmacy front-end warehouses. This system is used to implement the intelligent supply chain management method for chain pharmacy front-end warehouses as described above. The system enables proactive and accurate early warning of inventory-expiration date linked risks, as well as efficient and visualized traceability, thereby improving the intelligence and compliance level of drug management in chain pharmacy front-end warehouses.

[0184] The supply chain management system of this application includes a data acquisition and labeling module, a data processing module, a digital twin model construction module, a key behavioral event set and serialization module, and a dynamic trend calculation and early warning module.

[0185] The data acquisition and labeling module is equipped with hardware devices such as temperature and humidity sensors, RFID readers, and barcode scanners, as well as corresponding software data receiving units. The data processing module includes a data cleaning submodule and a time-series normalization submodule. The data cleaning submodule can filter the acquired raw data, removing abnormal data caused by equipment failure, signal interference, etc., such as removing values ​​that are false alarms from temperature and humidity sensors and are outside the reasonable range.

[0186] The digital twin model building module is based on the standardized data output by the data processing module. This module uses 3D modeling technology and real-time data mapping algorithm to build a digital twin model for each pre-positioning warehouse and each batch of drugs.

[0187] The key behavioral event set and serialization module connects to the inventory management system, procurement system, and sales system of each forward warehouse through interfaces to obtain key supply chain behavioral events involving each warehousing area in real time, including drug procurement, warehousing, outbound, inventory counting, returns and exchanges, etc.

[0188] The dynamic trend calculation and early warning module incorporates a lifecycle mapping algorithm, enabling real-time pairing of drug expiration curves with dynamic inventory consumption curves. By receiving inventory change data and drug expiration information from a digital twin model, it plots the curves of both and calculates the dynamic trend of remaining inventory and the critical intersection point of expiration for different storage areas and drug types.

[0189] Unless otherwise specifically stated, the relative arrangement, numerical expressions, and values ​​of the components and steps set forth in these embodiments do not limit the scope of this application. Any specific values ​​in all examples shown and discussed herein should be interpreted as merely exemplary and not as limitations. Therefore, other examples of exemplary embodiments may have different values. It should be noted that similar reference numerals and letters in the following figures denote similar items; therefore, once an item is defined in one figure, it need not be further discussed in subsequent figures.

[0190] It should be understood that spatial relative terms are intended to encompass different orientations of a device in use or operation, in addition to the orientation described in the figures. For example, if a device in the figures is inverted, a device described as "above" or "on top of" other devices or structures will subsequently be positioned as "below" or "under" other devices or structures. Thus, the exemplary term "above" can include both "above" and "below". The device may also be positioned in other different ways (rotated 90 degrees or in other orientations), and the spatial relative descriptions used herein will be interpreted accordingly.

[0191] Furthermore, it should be noted that the use of terms such as "first" and "second" to define components is merely for the purpose of distinguishing the corresponding components. Unless otherwise stated, the above terms have no special meaning and therefore cannot be construed as limiting the scope of protection of this application.

[0192] The above description is merely a preferred embodiment of the present invention and is not intended to limit the invention. Various modifications and variations can be made to the present invention by those skilled in the art. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of the present invention should be included within the scope of protection of the present invention.

Claims

1. A method for intelligent supply chain management of pre-positioned warehouses in chain pharmacies, characterized in that, include: S1. Collect full-process event data for each batch of medicine in multiple storage areas of the chain pharmacy's front warehouse, and mark each storage location with a unique batch identification code. S2. Perform data cleaning and time-series normalization on the collected raw data; S3. Based on drug data from different batches and storage areas, construct digital twin models to record the lifecycle trajectory of each batch of drugs; S4. Collect and serialize key supply chain behavioral events involving each warehousing area; S5. Using the lifecycle mapping algorithm, the drug expiration curve and the dynamic inventory consumption curve are paired in real time, and the dynamic change trend of the remaining inventory and the critical intersection of the expiration date is calculated for different storage areas and drug types.

2. The intelligent supply chain management method for pre-positioned warehouses of chain pharmacies according to claim 1, characterized in that: After calculating the dynamic trend of the intersection of remaining inventory and expiration date for different storage areas and drug types, the method further includes: S6. Input multi-dimensional behavioral event streams into the behavior-driven prediction model, and analyze the sensitivity of key events that may affect inventory turnover and expiration date consumption in the short term to abnormal risks for different drug categories and storage locations. S7. Determine whether the current batch of drugs simultaneously meets the following conditions: the inventory is higher than the safety threshold and the expiration date is close to the expiration date, or the inventory consumption rate is lower than the historical average and the expiration date shows a shortening trend; if the conditions are met, generate a corresponding graded linkage early warning signal. S8. Display the generated abnormal trend warning results to the operation and management end in the form of a traceability path map, indicating the risk batch, related storage area and influencing behavioral events, so as to achieve traceable intervention; S9. Based on historical early warning feedback and actual processing results, the early warning rules are adaptively trained to dynamically optimize the early warning threshold parameters under different drug types and business cycles, thereby achieving model self-calibration and performance improvement.

3. The intelligent supply chain management method for chain pharmacy front-end warehouses according to claim 1, characterized in that: Step S1 includes: S1.1 automatically identifies and spatially maps each independent storage area within the front warehouse of a chain pharmacy. Based on the warehouse management system interface, it obtains and records the correspondence between the physical location of each area and the system partition number. S1.2 Perform barcode or RFID scanning on each batch of incoming medicines, and generate a unique batch identification code using attributes such as batch number, time of entry, and supplier information through a batch information coding algorithm. This code is then synchronously linked to the corresponding storage area to initialize the basic data for batch-level drug traceability. S1.3 Collect and record the expiration date information for each batch of medicines, and automatically read the expiration date field from the warehousing voucher or medicine label using the data interface protocol, and store it in a structured manner in combination with the batch identification code and storage location. S1.4 Real-time data collection of inventory quantity changes for all batches of medicines in each storage area. Using inventory sensor interfaces or inventory management software APIs, incremental records are made for inbound and outbound operations, inventory counts, and transfers by batch and storage location, so as to achieve accurate collection of dynamic inventory quantities. S1.5 automatically collects event data for each batch of drugs throughout its entire process, uses timestamps to mark and record relevant operators, event types and operation terminal identifiers, and realizes multi-dimensional archiving of the entire event flow; S1.6 initially aggregates the collected expiration date, inventory quantity, and circulation event data according to the "warehouse area - batch identification code - time series" structure, providing traceable data input for subsequent data cleaning, twin modeling, and anomaly trend analysis.

4. The intelligent supply chain management method for pre-positioned warehouses of chain pharmacies according to claim 1, characterized in that: Step S2 includes: S2.1 Perform uniqueness verification on the collected original drug batch data, and use batch identification code and storage area index for deduplication; S2.2 performs time error correction on the timestamp field in the original event data based on a high-precision clock synchronization algorithm, and reconstructs or interpolates timestamp values ​​that are missing, ambiguous or abnormal. S2.3 performs synchronous normalization processing on the expiration date information and inventory quantity fields, and performs structured pairing of batch expiration date and corresponding inventory quantity at the same time base, automatically filling in incomplete field phenomena. S2.4 employs a data integrity detection algorithm to perform full-field validation on the cleaned batch-level dataset, including the reasonableness of the expiration period range, the non-negativity of the inventory quantity, and the continuity of the batch flow path. It marks the detected problematic data and outputs an anomaly report to provide a basis for manual or automatic error correction. S2.5 standardizes and stores the high-quality, structured drug batch data processed above according to the three-dimensional index of "warehouse area - batch identification code - time series", and outputs a dataset for subsequent digital twin modeling and anomaly trend analysis, realizing the efficient transformation of raw data into data usable for analysis.

5. The intelligent supply chain management method for chain pharmacy front-end warehouses according to claim 1, characterized in that: Step S3 includes: S3.1 For cleaned and normalized batch-level drug data, based on the three-dimensional index structure of 'warehouse area-batch identification code-time series', a digital twin initialization model is created for each batch of drugs to be uniquely identified. S3.2 Input the entire process of procurement, warehousing, storage, allocation and sales event flow data for each digital twin, and use event-driven modeling algorithm to dynamically update the twin attributes, including state transition nodes, quantity changes, flow information and validity period parameters, to achieve high-granular characterization of the life cycle trajectory. S3.3 Based on the temporal event flow in the twin model, the process of state transition between each stage is segmented and modeled to describe the transfer and retention characteristics of drug batches in each link of the supply chain, forming a life cycle flow path that can be simulated. S3.4 integrates real-time inventory changes and expiration date attributes into the twin model, and applies a time-series data fusion algorithm to map the inventory quantity and remaining expiration date status of each batch of medicines at any time, providing structured input features for subsequent expiration date-inventory anomaly trend analysis and prediction algorithms. S3.5 stores the constructed batch-level digital twins and their lifecycle trajectories in a multi-dimensional group according to the storage region and batch primary key, and establishes cross-regional data reference relationships.

6. The intelligent supply chain management method for pre-positioned warehouses of chain pharmacies according to claim 1, characterized in that: Step S4 includes: S4.1 interfaces with the management systems of each independent storage area of ​​the chain pharmacy's front warehouse, and obtains supply chain operation logs and raw data of business events in each area in real time based on standardized APIs or message queue protocols. S4.2 Based on the behavioral event type dictionary, the collected raw operation events are processed by an event classification algorithm, and the events are standardized and encoded according to category, scope of influence and triggering source, and a structured preliminary event list is output. For each type of key behavioral event, S4.3 combines metadata such as the event occurrence time, associated drug batch, storage area number, and operator identity, and uses a multi-label feature extraction algorithm to automatically label the event's temporal characteristics, impact intensity, business priority, and potential risk level, thereby achieving multi-dimensional feature labeling. S4.4 For continuous or related behavioral events occurring within the same storage area, a serialization modeling algorithm is applied to serialize event groups with high frequency, obvious interaction or causal chain relationships, generating event stream fragments with time-dependent characteristics. Based on data security and traceability requirements, S4.5 uses blockchain hash signature or digital watermarking algorithms to uniquely trace all collected and labeled behavioral event streams. S4.6 efficiently archives and stores the generated multi-dimensional characteristic and serialized behavioral event stream according to a multi-level index structure of "warehouse area-time series-event type-batch", and outputs a standardized event dataset to subsequent lifecycle mapping algorithms and behavior-driven prediction models through data interfaces, thereby achieving cross-module data collaboration.

7. The intelligent supply chain management method for pre-positioned warehouses of chain pharmacies according to claim 1, characterized in that: Step S5 includes: S5.1 groups and filters batch-level drug data that has been modeled by digital twins based on storage area and drug type, and extracts the remaining inventory time series data and expiration date countdown curve data of each batch as input objects for lifecycle mapping. S5.2 uses a sliding window time-series pairing algorithm to synchronously map the inventory change curve and the expiration date reduction curve of the same batch of drugs in different time segments, and compare and analyze the interaction characteristics of the two curves at any time. S5.3 is based on a dynamic threshold determination mechanism. It calculates the critical intersection of the remaining inventory and the remaining valid days for each batch of drugs in real time, and generates a set of critical indicators for each region in combination with the attributes of the storage area. This is used to identify the key time period when excess inventory or delayed consumption leads to the accumulation of expiration risk. S5.4 uses a multi-dimensional feature trend extraction algorithm to fit trend lines to batch-level inventory-expiration date pairing results and outputs an index matrix that reflects the trend of abnormal risk changes under different storage areas and drug types. S5.5 performs time-series visualization encoding on the above dynamic trend analysis results, generating the change trajectory of the batch-level 'remaining inventory - expiration date intersection' for each storage area and drug type, providing real-time, high-granularity data input for subsequent behavior-driven prediction and linkage early warning models.

8. The intelligent supply chain management method for pre-positioned warehouses of chain pharmacies according to claim 1, characterized in that: Step S6 includes: S6.1 performs feature vectorization processing on the serialized multi-dimensional supply chain behavior event stream, and uses event embedding encoding or time-series window extraction algorithms to transform promotion, seasonal fluctuation and recall type events into structured feature inputs; S6.2 dynamically associates the characteristic behavioral event streams with the corresponding digital twin models based on the storage area, drug category, and batch unique identifier. It adopts index matching and synchronization alignment algorithms to ensure that each event stream can be accurately mapped to its corresponding drug batch and physical storage location during predictive analysis, thereby achieving precise binding of events and objects. S6.3 uses structured event features and digital twin state variables as joint inputs, and uses short time series prediction algorithms or custom behavior-driven prediction models to perform multi-scenario simulation predictions on the inventory turnover rate and expiration consumption trend of each batch of drugs within a preset time window in the future, and outputs the sensitivity probability distribution of each key event to the risk of linkage between inventory and expiration. S6.4 performs sensitivity analysis and abnormal risk quantification on the predicted output results, and refines and stratifies the abnormal inventory-expiration risk levels that may be caused by future key events under different drug categories and storage locations, providing a data foundation for the formulation of subsequent graded early warning strategies; S6.5 compares the quantified sensitivity analysis results with the historical anomaly case database, and uses similarity measurement or model confidence adjustment mechanisms to correct and optimize potential errors or special scenarios in the prediction, outputting a high-confidence anomaly risk sensitivity index that can be used for real-time decision-making, providing structured input for subsequent automatic early warning and path traceability.

9. A supply chain management method, characterized in that: The system is used to implement the intelligent supply chain management method for the front-end warehouses of chain pharmacies as described in any one of claims 1-8.

Citation Information

Cited By

  • Operation risk management method and system

    CN121258223A

  • Drug inventory management method and system

    CN121279925A

  • Method and system for managing drug inventory

    CN121279925B

  • Ship full life cycle electronic file construction and traceability system

    CN121581818A

  • Ship lifecycle electronic file construction and tracing system

    CN121581818B