Drug supervision code warehouse-out and warehouse-in collection and efficiency improvement method and system based on WMS system
By constructing a hierarchical topology diagram and state propagation rules, the problems of low efficiency and limited traceability in the existing drug regulatory code system in multi-layer packaging processing are solved, and efficient, accurate processing and dynamic state management of drug regulatory codes entering and leaving the warehouse are realized.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- BEIJING AUCHAN JUCHUANG TECH CO LTD
- Filing Date
- 2026-03-03
- Publication Date
- 2026-06-02
AI Technical Summary
Existing drug regulatory code systems are inefficient and error-prone when processing multi-layered packaging. They lack systematic modeling of the hierarchical topological relationships of packaging units, which limits traceability capabilities and affects the accuracy of drug flow tracking and risk analysis.
A method for collecting drug regulatory codes for entry and exit from the warehouse based on a WMS system is constructed. The influence domain of the regulatory code is calculated through a hierarchical topology graph, hierarchical positioning labels and traceability records are generated, status propagation rules are defined, dynamic path deduction is performed, a cross-level traceability propagation graph is constructed, and batch association of records and status synchronization are achieved.
It improves the efficiency and accuracy of drug regulatory codes entering and leaving the warehouse, supports one-click efficient processing, ensures the hierarchical semantics and readability of data, provides automated processing for dynamic management of drug status, and quickly identifies upstream and downstream nodes.
Smart Images

Figure CN122134252A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to warehouse management technology, and more particularly to a method and system for improving the efficiency of drug regulatory code entry and exit data collection based on a WMS system. Background Technology
[0002] In the field of pharmaceutical supply chain management, particularly in inbound and outbound operations involving drug regulatory codes, existing practices primarily rely on the direct scanning and recording of individual or batch drug regulatory codes. Systems typically treat each regulatory code as an independent entity, collecting them one by one or reading them in batches using scanning devices, and then directly binding them to specific inbound and outbound documents. For drugs with multiple layers of packaging, such as bottles forming boxes, and boxes forming cartons, while conventional systems record regulatory codes at different packaging levels, they often lack systematic modeling and utilization of the inherent nested relationships between these codes. During inbound and outbound operations, operators need to manually select or scan the corresponding regulatory code based on the packaging level, and the system performs linear, one-to-one association recording. In subsequent traceability queries, the system typically retrieves results based on directly associated records, such as searching for a list of related regulatory codes by document number, or reverse-searching for the document to which a regulatory code belongs, resulting in a relatively singular and static traceability dimension.
[0003] Because the system fails to explicitly construct and store the hierarchical topology between packaging units, it is inefficient and error-prone when handling inbound and outbound operations involving multiple layers of packaging. For example, when an entire case of medicine needs to be shipped out, operators may need to scan the box code, or scan all the box codes and even bottle codes one by one. The system cannot automatically and accurately infer all its subordinate sub-codes from a high-level code, nor can it efficiently handle inbound and outbound situations involving only some levels of codes. This increases operational complexity and affects warehousing efficiency. More importantly, in the drug flow traceability stage, the lack of effective utilization of the hierarchical relationships between codes limits traceability capabilities. When it is necessary to query the complete flow of a specific batch of medicine, or analyze the upstream or downstream scope that a problem node may affect, the existing system struggles to quickly and clearly display the associated paths and state propagation impacts across multiple layers of packaging. The traceability results are often discrete, unstructured sets of data points, failing to intuitively present the hierarchical flow and state evolution of medicines in the supply chain network, affecting the depth of supervision and the accuracy of risk analysis. Summary of the Invention
[0004] This invention provides a method and system for improving the efficiency of drug regulatory code entry and exit data collection based on a WMS system, which can solve the problems in the prior art.
[0005] A first aspect of this invention provides a method for improving the efficiency of drug regulatory code entry and exit data collection based on a WMS system, comprising:
[0006] Collect drug regulatory codes and their corresponding packaging level identifiers, and construct a hierarchical topology graph reflecting the nesting relationship of packaging units based on the packaging level identifiers; obtain the target regulatory code of the operation object, and calculate the influence domain of the target regulatory code by bidirectionally traversing the parent-child path according to the hierarchical topology graph;
[0007] All regulatory codes within the influence domain are batch-associated with the operation attributes of inbound and outbound operations, and a hierarchical positioning tag is generated for each regulatory code within the influence domain. Based on the hierarchical positioning tag, the path coordinates and depth information of the corresponding regulatory code in the hierarchical topology map are identified to form a set of traceability records with hierarchical semantics.
[0008] Establish a traceability state propagation rule, which defines the logic of how the state change propagates along the hierarchical topology to adjacent levels when a regulatory code at a certain level changes state, and the decay mechanism of the state identifier during the propagation process.
[0009] Based on the hierarchical positioning tags and the tracing status propagation rules, dynamic path deduction is performed along the hierarchical topology graph to identify all associated nodes that have an influence relationship with the queried object, construct a cross-level tracing propagation graph, and output the flow evolution sequence.
[0010] Based on the packaging level identifier, a hierarchical topology diagram reflecting the nesting relationship of packaging units is constructed; the target regulatory code of the operation object is obtained, and the influence domain of the target regulatory code is calculated by bidirectional traversal along the parent-child path according to the hierarchical topology diagram, including:
[0011] Locate the current node containing the target regulatory code in the hierarchical topology graph, and extract the topological coordinates of the current node in the hierarchical topology graph;
[0012] Based on the topological coordinates, the hierarchical topology graph is recursively traversed upwards along the parent path. During the traversal, the hierarchical distance between each ancestor node and the current node is calculated, and the uplink propagation weight is assigned to the upper-level regulatory code carried in the ancestor node according to the hierarchical distance, forming an uplink influence set carrying the uplink propagation weight.
[0013] Based on the topological coordinates, the system recursively traverses downwards along the sub-paths of the hierarchical topology graph. During the traversal, the hierarchical distance between each descendant node and the current node is calculated, and the lower-level regulatory code carried in the descendant node is assigned a downlink propagation weight according to the hierarchical distance, thus forming a downlink influence set carrying the downlink propagation weight.
[0014] The uplink impact set, the downlink impact set, and the target regulatory code are aggregated, and the impact priority of each regulatory code within the impact domain is determined according to the uplink propagation weight and the downlink propagation weight, forming an impact domain with hierarchical impact strength.
[0015] Batch associate and record all regulatory codes within the influence domain with the operational attributes of inbound and outbound operations, and generate hierarchical positioning tags for each regulatory code within the influence domain, including:
[0016] Obtain the operation attributes of inbound and outbound operations, wherein the operation attributes include operation timestamp, operation type identifier, and operation execution subject identifier;
[0017] Traverse all regulatory codes within the influence domain, establish an association record structure for each regulatory code, and bind and map the regulatory code with the operation timestamp, the operation type identifier, and the operation execution entity identifier according to the association record structure;
[0018] For each regulatory code within the influence domain, extract the current node identifier corresponding to the regulatory code in the hierarchical topology graph from the associated record structure, and backtrack the complete path chain of the corresponding regulatory code from the root node to the current node in the hierarchical topology graph based on the current node identifier;
[0019] The hierarchical index of each node in the complete path chain is parsed, and the hierarchical indexes are arranged sequentially according to the traversal order from the root node to the current node to construct a path coordinate vector representing the hierarchical relationship between nodes.
[0020] The total number of nodes in the complete path chain is calculated based on the path coordinate vector. The total number is used as the depth information of the corresponding regulatory code in the hierarchical topology map. The path coordinate vector and the depth information are encapsulated into a hierarchical positioning tag.
[0021] Based on the path coordinates and depth information of the regulatory code corresponding to the hierarchical positioning tag in the hierarchical topology map, a set of traceability records with hierarchical semantics is formed, including:
[0022] Extract the path coordinate vector of the corresponding regulatory code from the hierarchical positioning label, analyze the successor relationship between the hierarchical numbers in the path coordinate vector, and construct a hierarchical evolution sequence that reflects the corresponding regulatory code from the root node to the current node in the hierarchical topology graph.
[0023] The depth information of the corresponding regulatory code is extracted from the hierarchical positioning label, the hierarchical level of the corresponding regulatory code in the hierarchical topology is determined based on the depth information, and a hierarchical semantic identifier is assigned to the corresponding regulatory code according to the hierarchical level.
[0024] The hierarchical evolution sequence is associated and bound with the hierarchical semantic identifier to generate a semantic tracing record containing path tracing information and role positioning information;
[0025] The semantic traceability records corresponding to all regulatory codes within the affected domain are aggregated. Based on the hierarchical evolution sequence of each regulatory code, a hierarchical inclusion relationship between the records is constructed. The semantic traceability records with hierarchical inclusion relationships are organized into a tree structure to form a set of traceability records with hierarchical semantics.
[0026] The semantic traceability records corresponding to all regulatory codes within the affected domain are aggregated. A hierarchical inclusion relationship is constructed between records based on the hierarchical evolution sequence of each regulatory code. The semantic traceability records with hierarchical inclusion relationships are organized into a tree structure, including:
[0027] Collect semantic traceability records corresponding to all regulatory codes within the influence domain, extract the hierarchical evolution sequence carried by each semantic traceability record, perform topological hash encoding on the hierarchical evolution sequence, and jointly map the identifier of each level node in the hierarchical evolution sequence and its position information in the path into a hash vector;
[0028] Traverse the semantic traceability records within the influence domain, extract the hash vectors of any two records, and determine the path inclusion relationship of the corresponding records by calculating the vector inclusion degree of the hash vectors. When the vector inclusion degree exceeds the inclusion determination threshold, determine one record as the including record and the other record as the included record.
[0029] The difference in vector dimension between the hash vectors of the containing record and the contained record is calculated as the hierarchical span. The hierarchical propagation coefficient is calculated using a nonlinear decay function based on the hierarchical span. A parent-child hierarchical inclusion relationship is established between the containing record and the contained record based on the hierarchical propagation coefficient.
[0030] Based on the parent-child hierarchical inclusion relationship, tree node identifiers are assigned to the semantic traceability records, and directed edges of the tree node identifiers are constructed according to the parent-child hierarchical inclusion relationship;
[0031] The semantic traceability record with the smallest hash vector dimension is identified as the root node of the tree structure. The remaining semantic traceability records are then sequentially attached to their parent nodes according to the pointing relationship of the directed edges, forming a tree structure with propagation constraints between nodes.
[0032] Based on the hierarchical positioning tags and the tracing status propagation rules, dynamic path deduction is performed along the hierarchical topology graph to identify all associated nodes that have an impact relationship with the queried object. A cross-level tracing propagation graph is constructed, and the flow evolution sequence is output, including:
[0033] Obtain the initial node corresponding to the query object in the hierarchical topology graph, extract the hierarchical positioning label of the initial node, and perform topological coordinate calibration on the initial node based on the hierarchical positioning label;
[0034] Starting from the initial node, a path traversal is performed along the edge connection relationship of the hierarchical topology graph. For each candidate node traversed, its hierarchical positioning label is extracted and topological coordinates are calibrated. The topological coordinates of the candidate node and the topological coordinates of the initial node are substituted into the tracing state propagation rule to determine the influence relationship.
[0035] For the candidate nodes that are determined to have an influence relationship, they are marked as associated nodes and the path sequence from the initial node to the associated node is recorded. The hierarchical positioning labels of each node in the path sequence are extracted to form a hierarchical propagation chain. The segmented propagation attenuation coefficient is calculated based on the hierarchical span between adjacent nodes in the hierarchical propagation chain. The segmented propagation attenuation coefficients are concatenated and multiplied to obtain the path propagation weight.
[0036] By summing up the initial node and all the associated nodes, a directed propagation edge is constructed from the initial node to each associated node based on each path sequence, forming a cross-level tracing propagation graph;
[0037] The initial node and each associated node are sorted according to the propagation weight of the path, and the flow direction evolution sequence is output by combining the hierarchical propagation chain corresponding to each node.
[0038] By summing the initial node and all the associated nodes, and constructing directed propagation edges from the initial node to each associated node based on each path sequence, a cross-level tracing propagation graph is formed, including:
[0039] Collect the initial node and all associated nodes, assign a unique node identifier to each node, and extract the path sequence corresponding to each associated node;
[0040] For each path sequence, the hierarchical positioning labels of each node in the path sequence are extracted, the hierarchical span between adjacent nodes in the path sequence is calculated based on the hierarchical positioning labels, the hierarchical spans of each node are accumulated and summed to obtain the total path span of the path sequence, and the path propagation weight corresponding to the path sequence is calculated based on the total path span.
[0041] Based on the starting node identifier and ending node identifier of each path sequence, a directed propagation edge is constructed from the node identifier of the initial node to the node identifier of the corresponding associated node;
[0042] The initial node and all associated nodes are used as a graph node set, and all directed propagation edges are used as a graph edge set. A cross-level tracing propagation graph is constructed based on the graph node set and the graph edge set.
[0043] A second aspect of this invention provides a drug regulatory code entry and exit data collection efficiency improvement system based on a WMS system, comprising:
[0044] The data collection and construction unit is used to collect drug regulatory codes and their corresponding packaging level identifiers, and construct a hierarchical topology graph reflecting the nesting relationship of packaging units based on the packaging level identifiers; obtain the target regulatory code of the operation object, and calculate the influence domain of the target regulatory code by bidirectionally traversing the parent-child path according to the hierarchical topology graph;
[0045] The batch association unit is used to batch associate and record all regulatory codes within the influence domain with the operation attributes of inbound and outbound operations, and generate a hierarchical positioning tag for each regulatory code within the influence domain. Based on the hierarchical positioning tag, the corresponding regulatory code is identified by the path coordinates and depth information in the hierarchical topology map to form a set of traceability records with hierarchical semantics.
[0046] A state propagation unit is used to establish traceability state propagation rules. The traceability state propagation rules define the logic of propagating the state change to adjacent levels along the hierarchical topology when a regulatory code at a certain level undergoes a state change, as well as the attenuation mechanism of the state identifier during the propagation process.
[0047] The dynamic deduction unit is used to perform dynamic path deduction along the hierarchical topology map based on the hierarchical positioning tags and the traceability state propagation rules, identify all related nodes that have an influence relationship with the query object, construct a cross-level traceability propagation map, and output the flow direction evolution sequence.
[0048] A third aspect of the present invention provides an electronic device, comprising:
[0049] processor;
[0050] Memory used to store processor-executable instructions;
[0051] The processor is configured to invoke instructions stored in the memory to execute the aforementioned method.
[0052] A fourth aspect of the present invention provides a computer-readable storage medium having stored thereon computer program instructions that, when executed by a processor, implement the aforementioned method.
[0053] The beneficial effects of this application are as follows:
[0054] This method significantly improves the efficiency and accuracy of drug regulatory code entry and exit data collection. By constructing a hierarchical topology diagram reflecting the nested relationships of packaging units, the system can intuitively depict the physical structure of drug packaging, providing a precise data foundation for subsequent batch operations and status traceability. Based on this topology diagram, bidirectional traversal calculation of the target regulatory code's influence domain ensures the completeness and efficiency of determining the associated range, avoiding omissions or errors caused by traditional code-by-code scanning or manual judgment.
[0055] By batch-associating all regulatory codes within the affected domain with inbound and outbound operation attributes, a "one-click" efficient processing of grouped drug units is achieved, greatly reducing data entry time and operational complexity. The hierarchical positioning tags generated for each regulatory code not only record its specific location and depth within the packaging layer but also endow the data with clear hierarchical semantics. This allows subsequent traceability queries to directly understand the inclusion and contained relationships between codes, improving data readability and analytical value.
[0056] The defined traceability status propagation rules clarify the transmission logic and attenuation mechanism of status changes between packaging levels. This provides an automated and standardized processing basis for the dynamic management of key information such as drug expiration date, inventory status, and distribution, ensuring consistent updates of status information across complex packaging relationships. Dynamic path deduction based on hierarchical positioning tags and propagation rules can quickly and accurately identify all upstream and downstream nodes related to any query object. Attached Figure Description
[0057] Figure 1 This is a flowchart illustrating the method for improving the efficiency of drug regulatory code entry and exit data collection based on a WMS system, as described in an embodiment of the present invention.
[0058] Figure 2 This is a flowchart illustrating the drug regulatory code traceability weight calculation and status propagation process in an embodiment of the present invention. Detailed Implementation
[0059] To make the objectives, technical solutions, and advantages of the embodiments of the present invention clearer, the technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.
[0060] The technical solution of the present invention will be described in detail below with reference to specific embodiments. These specific embodiments can be combined with each other, and the same or similar concepts or processes may not be described again in some embodiments.
[0061] Figure 1 This is a flowchart illustrating the method for improving the efficiency of drug regulatory code entry and exit data collection based on a WMS system, as described in this embodiment of the invention. Figure 1 As shown, the method includes:
[0062] Collect drug regulatory codes and their corresponding packaging level identifiers, and construct a hierarchical topology graph reflecting the nesting relationship of packaging units based on the packaging level identifiers; obtain the target regulatory code of the operation object, and calculate the influence domain of the target regulatory code by bidirectionally traversing the parent-child path according to the hierarchical topology graph;
[0063] All regulatory codes within the influence domain are batch-associated with the operation attributes of inbound and outbound operations, and a hierarchical positioning tag is generated for each regulatory code within the influence domain. Based on the hierarchical positioning tag, the path coordinates and depth information of the corresponding regulatory code in the hierarchical topology map are identified to form a set of traceability records with hierarchical semantics.
[0064] Establish a traceability state propagation rule, which defines the logic of how the state change propagates along the hierarchical topology to adjacent levels when a regulatory code at a certain level changes state, and the decay mechanism of the state identifier during the propagation process.
[0065] Based on the hierarchical positioning tags and the tracing status propagation rules, dynamic path deduction is performed along the hierarchical topology graph to identify all associated nodes that have an influence relationship with the queried object, construct a cross-level tracing propagation graph, and output the flow evolution sequence.
[0066] In one optional implementation, obtaining the target regulatory code of the operation object and calculating the influence domain of the target regulatory code by bidirectional traversal along the parent-child path according to the hierarchical topology graph includes:
[0067] Locate the current node containing the target regulatory code in the hierarchical topology graph, and extract the topological coordinates of the current node in the hierarchical topology graph;
[0068] Based on the topological coordinates, the hierarchical topology graph is recursively traversed upwards along the parent path. During the traversal, the hierarchical distance between each ancestor node and the current node is calculated, and the uplink propagation weight is assigned to the upper-level regulatory code carried in the ancestor node according to the hierarchical distance, forming an uplink influence set carrying the uplink propagation weight.
[0069] Based on the topological coordinates, the system recursively traverses downwards along the sub-paths of the hierarchical topology graph. During the traversal, the hierarchical distance between each descendant node and the current node is calculated, and the lower-level regulatory code carried in the descendant node is assigned a downlink propagation weight according to the hierarchical distance, thus forming a downlink influence set carrying the downlink propagation weight.
[0070] The uplink impact set, the downlink impact set, and the target regulatory code are aggregated, and the impact priority of each regulatory code within the impact domain is determined according to the uplink propagation weight and the downlink propagation weight, forming an impact domain with hierarchical impact strength.
[0071] After collecting the drug regulatory codes, the packaging level identifiers attached to each code are first parsed. These identifiers can be numerical level numbers, such as "1" for the smallest sales unit, "2" for medium packaging, and "3" for the largest box, or character identifiers like "UNIT," "BOX," and "CASE." After parsing, a hierarchical topology graph is constructed based on the inclusion relationships between the packaging level identifiers. This topology graph uses a tree structure for storage, with each node corresponding to a regulatory code, and nodes linked through parent-child pointers. For example, a large box node's child nodes point to all its included medium packaging nodes, and the medium packaging nodes in turn point to their included smallest unit nodes. Each node in the topology graph stores not only the regulatory code itself but also its topological coordinates, which consist of the level depth and the index of its position within the same level.
[0072] When an inbound / outbound operation instruction is received, the target supervision code of the operation object is obtained. Suppose the operator scans the supervision code of a medium-sized packaging box, the system quickly locates the current node corresponding to the supervision code in the hierarchical topology map through hash index, and reads its topological coordinates, for example, the coordinates are "level 2 - position 5".
[0073] Perform a recursive upward traversal of the parent path, starting from the current node, visiting its parent node pointer, and obtaining the ancestral code. Calculate the hierarchical distance between the current node and its parent node, which is equal to the parent node's hierarchical depth minus the current node's hierarchical depth. If the hierarchical distance is 1, it indicates a direct parent-child relationship, and the parent's ancestral code is assigned an uplink propagation weight of 0.9; if the hierarchical distance is 2, it is assigned a weight of 0.7. Continue recursively upwards until the root node is reached. During the traversal, the ancestral codes and their weights of all ancestral nodes are collected into the uplink influence set.
[0074] Simultaneously, perform a downward recursive traversal of the sub-path, starting from the current node, visiting all its child node pointers, and obtaining the regulatory code of the next-level wrapper. Calculate the hierarchical distance between the current node and each child node, which is equal to the child node's hierarchical depth minus the current node's hierarchical depth. If the hierarchical distance is 1, assign a downpropagation weight of 0.85 to the child's regulatory code; if the hierarchical distance is 2, assign a weight of 0.6. Recursively visit the child nodes of the child nodes until a leaf node is reached. Collect the regulatory codes and their weights of all descendant nodes into the downpropagation influence set.
[0075] The aggregation phase merges the target regulatory code itself, the uplink influence set, and the downlink influence set. The target regulatory code itself has an influence priority of 1.0. Regulatory codes in the uplink influence set have their priorities determined by their uplink propagation weights, and regulatory codes in the downlink influence set have their priorities determined by their downlink propagation weights. For example, if the uplink set contains a large box regulatory code with a weight of 0.9, and the downlink set contains a minimum unit regulatory code with a weight of 0.85, then the influence priority of the large box regulatory code is 0.9, and the influence priority of the minimum unit regulatory code is 0.85 within the influence domain. Through this mechanism, regulatory codes within the influence domain are assigned hierarchical influence strengths according to their close association with the target regulatory code, forming a complete influence domain structure. This influence domain is then used for batch recording of inbound and outbound operations, ensuring that the status of relevant packaging units is updated synchronously.
[0076] In one optional implementation, all regulatory codes within the influence domain are batch-associated with the operational attributes of inbound and outbound operations, and a hierarchical positioning tag is generated for each regulatory code within the influence domain, including:
[0077] Obtain the operation attributes of inbound and outbound operations, wherein the operation attributes include operation timestamp, operation type identifier, and operation execution subject identifier;
[0078] Traverse all regulatory codes within the influence domain, establish an association record structure for each regulatory code, and bind and map the regulatory code with the operation timestamp, the operation type identifier, and the operation execution entity identifier according to the association record structure;
[0079] For each regulatory code within the influence domain, extract the current node identifier corresponding to the regulatory code in the hierarchical topology graph from the associated record structure, and backtrack the complete path chain of the corresponding regulatory code from the root node to the current node in the hierarchical topology graph based on the current node identifier;
[0080] The hierarchical index of each node in the complete path chain is parsed, and the hierarchical indexes are arranged sequentially according to the traversal order from the root node to the current node to construct a path coordinate vector representing the hierarchical relationship between nodes.
[0081] The total number of nodes in the complete path chain is calculated based on the path coordinate vector. The total number is used as the depth information of the corresponding regulatory code in the hierarchical topology map. The path coordinate vector and the depth information are encapsulated into a hierarchical positioning tag.
[0082] After identifying all regulatory codes within the affected domain, these codes need to be fully associated with the specific attributes of this inbound / outbound operation. The operation attributes are directly obtained from the WMS system's transaction log and include three core types of information: the operation timestamp records the precise time the operation occurred, typically stored in Unix timestamp format or ISO8601 standard format; the operation type identifier distinguishes different business scenarios such as inbound, outbound, return, and transfer, using a predefined enumeration value encoding; and the operation execution entity identifier records the user account or device number that triggered the operation, used to clarify responsibility.
[0083] When iterating through regulatory codes within the affected domain, a related record structure is established for each regulatory code. This related record structure is represented in the database as a row containing a regulatory code field, an operation timestamp field, an operation type identifier field, and an operation execution entity identifier field. Foreign key constraints ensure the integrity of the association with the main regulatory code table and the operation log table. The binding mapping process is completed using batch insert statements, simultaneously writing all regulatory codes within the affected domain and the current operation attributes into the related record table to ensure data consistency.
[0084] The generation of hierarchical location tags relies on structural information in the hierarchical topology graph. For a regulatory code within the influence domain, the current node identifier corresponding to that regulatory code is first extracted from the associated record structure. This identifier uniquely points to a node in the hierarchical topology graph. Then, a backtracking operation is performed in the hierarchical topology graph, traversing upwards from the current node along the parent node references until reaching the root node, forming a complete path chain. For example, when processing the regulatory code of a boxed medicine, the backtracking path sequentially passes through the box node, the associated container node, the associated pallet node, and finally reaches the batch root node.
[0085] Each node in the complete path chain is associated with a hierarchical index attribute in the hierarchical topology graph. This index identifies the packaging level at which the node belongs. Following the traversal order from the root node to the current node, the hierarchical indices of each node are extracted sequentially and arranged into a sequence, forming a path coordinate vector. Assuming a path chain contains four levels—batch layer, pallet layer, box layer, and carton layer—with corresponding hierarchical indices of 0, 1, 2, and 3 respectively, the path coordinate vector is represented as [0, 1, 2, 3]. This vector clearly describes the nested position of the regulatory code within the multi-layered packaging structure.
[0086] Depth information is obtained directly by counting the total number of nodes in the complete path chain. In the example above, the path chain contains 4 nodes, so the depth information is 4, indicating that the regulatory code is nested 4 levels away from the root node. Depth information, used in conjunction with path coordinate vectors, can quickly determine the relative position of a node in the hierarchical topology graph. Finally, the path coordinate vectors and depth information are encapsulated into hierarchical positioning tags in JSON format or a structure, stored in the extended fields of the associated record structure, providing an efficient index for subsequent state propagation and path deduction.
[0087] In one optional implementation, the set of traceability records with hierarchical semantics is formed by identifying the path coordinates and depth information of the regulatory code corresponding to the hierarchical positioning tag in the hierarchical topology map, including:
[0088] Extract the path coordinate vector of the corresponding regulatory code from the hierarchical positioning label, analyze the successor relationship between the hierarchical numbers in the path coordinate vector, and construct a hierarchical evolution sequence that reflects the corresponding regulatory code from the root node to the current node in the hierarchical topology graph.
[0089] The depth information of the corresponding regulatory code is extracted from the hierarchical positioning label, the hierarchical level of the corresponding regulatory code in the hierarchical topology is determined based on the depth information, and a hierarchical semantic identifier is assigned to the corresponding regulatory code according to the hierarchical level.
[0090] The hierarchical evolution sequence is associated and bound with the hierarchical semantic identifier to generate a semantic tracing record containing path tracing information and role positioning information;
[0091] The semantic traceability records corresponding to all regulatory codes within the affected domain are aggregated. Based on the hierarchical evolution sequence of each regulatory code, a hierarchical inclusion relationship between the records is constructed. The semantic traceability records with hierarchical inclusion relationships are organized into a tree structure to form a set of traceability records with hierarchical semantics.
[0092] After collecting the drug regulatory codes and their packaging layer identifiers, the system generates a layered positioning tag for each regulatory code within the influence domain. This tag uses a structured coding method to record the location information of the regulatory code in the layered topology map, including two core data parts: path coordinate vectors and depth information. The path coordinate vectors use a multi-segment coding structure; for example, "1-3-7" indicates that the regulatory code starts from the root node, passes through the first pallet node, the third box node under that pallet, and finally reaches the seventh bottle unit within that box. The depth information directly indicates the numerical value of the layer in which the regulatory code is located: 0 for the pallet layer, 1 for the box layer, and 2 for the bottle layer.
[0093] When parsing the path coordinate vector, the successor relationship between the sequence numbers of each level is extracted. For the path coordinate vector "1-3-7", the hierarchical evolution sequence is parsed as "pallet 1 → box 3 → bottle 7", clarifying the complete inheritance path of the regulatory code. This sequence records the nesting process of the packaging unit from largest to smallest, reflecting the actual traversal trajectory of the regulatory code in the hierarchical topology graph. When the path coordinate vector of a regulatory code is "2-5", the corresponding hierarchical evolution sequence is "pallet 2 → box 5", indicating that the regulatory code only involves two layers of packaging structure.
[0094] The hierarchical level of the regulatory code is determined based on depth information, and a corresponding hierarchical semantic identifier is assigned. A regulatory code with a depth value of 0 is marked as "pallet level", a depth value of 1 is marked as "box level", and a depth value of 2 is marked as "bottle level". This semantic identifier intuitively expresses the role of the regulatory code in the packaging system. For a certain regulatory code, when its depth information is 2 and the path coordinate vector is "1-3-7", the system assigns it the semantic identifier "bottle level", while retaining the complete hierarchical evolution sequence "pallet 1 → box 3 → bottle 7".
[0095] The hierarchical evolution sequence is associated and bound with the hierarchical semantic identifier to generate a semantic traceability record. This record structure includes fields such as the original regulatory code, path tracing information, role positioning information, and operation attributes. The path tracing information records the hierarchical evolution sequence, the role positioning information records the hierarchical semantic identifier, and the operation attributes record key information such as the timestamp of the inbound / outbound operation, the operation type, and the operator. For the regulatory code "BP001-027", its semantic traceability record includes: regulatory code "BP001-027", path tracing "pallet 1 → box 3 → bottle 7", role positioning "bottle level", and operation attribute "inbound | 2025-04-15 10:32 | operator A".
[0096] After aggregating all semantically defined traceability records corresponding to regulatory codes within the affected domain, a hierarchical inclusion relationship is constructed between records based on the hierarchical evolution sequence of each regulatory code. The parent-child hierarchical inclusion logic is identified by comparing the prefix matching relationships of path coordinate vectors. The regulatory code for path coordinate vector "1-3" includes all lower-level regulatory codes with the prefix "1-3", such as "1-3-7" and "1-3-8". The semantically defined traceability records with hierarchical inclusion relationships are organized into a tree structure, with the root node corresponding to the pallet-level regulatory code, child nodes corresponding to the box-level regulatory code, and leaf nodes corresponding to the bottle-level regulatory code. This tree structure fully preserves the nesting hierarchy of packaging units, forming a set of traceability records with hierarchical semantics, supporting subsequent cross-level traceability queries and state propagation deduction operations.
[0097] In one optional implementation, the semantic traceability records corresponding to all regulatory codes within the influence domain are aggregated, and a hierarchical inclusion relationship between records is constructed based on the hierarchical evolution sequence of each regulatory code. The semantic traceability records with hierarchical inclusion relationships are then organized into a tree structure, including:
[0098] Collect semantic traceability records corresponding to all regulatory codes within the influence domain, extract the hierarchical evolution sequence carried by each semantic traceability record, perform topological hash encoding on the hierarchical evolution sequence, and jointly map the identifier of each level node in the hierarchical evolution sequence and its position information in the path into a hash vector;
[0099] Traverse the semantic traceability records within the influence domain, extract the hash vectors of any two records, and determine the path inclusion relationship of the corresponding records by calculating the vector inclusion degree of the hash vectors. When the vector inclusion degree exceeds the inclusion determination threshold, determine one record as the including record and the other record as the included record.
[0100] The difference in vector dimension between the hash vectors of the containing record and the contained record is calculated as the hierarchical span. The hierarchical propagation coefficient is calculated using a nonlinear decay function based on the hierarchical span. A parent-child hierarchical inclusion relationship is established between the containing record and the contained record based on the hierarchical propagation coefficient.
[0101] Based on the parent-child hierarchical inclusion relationship, tree node identifiers are assigned to the semantic traceability records, and directed edges of the tree node identifiers are constructed according to the parent-child hierarchical inclusion relationship;
[0102] The semantic traceability record with the smallest hash vector dimension is identified as the root node of the tree structure. The remaining semantic traceability records are then sequentially attached to their parent nodes according to the pointing relationship of the directed edges, forming a tree structure with propagation constraints between nodes.
[0103] After collecting semantic traceability records corresponding to all regulatory codes within the affected domain, the hierarchical evolution sequence carried by each record is extracted. The hierarchical evolution sequence records the complete path information of the regulatory code from the top-level packaging unit to the current node, such as a four-level path of "pallet-box-cabinet-bottle". The extracted hierarchical evolution sequence is topologically hashed, using the unique identifier of each node in the sequence and its position index in the path as input, and mapped to a 128-bit hash vector using the MurmurHash3 algorithm. During the encoding process, the node identifier and position information are concatenated into a string to ensure that the same path generates a consistent hash value, and that the hash vectors generated by different paths are distinguishable by Hamming distance.
[0104] The semantic traceability records within the influence domain are traversed, and the corresponding hash vectors are extracted for any two records. The vector inclusion degree of the two hash vectors is calculated by performing a bitwise AND operation to count the number of common 1s, and then dividing by the total number of 1s in the compared vectors. When all the 1s in vector A appear in the set of 1s in vector B, the inclusion degree is close to 1, indicating that the path corresponding to record A is completely included by the path of record B. An inclusion determination threshold of 0.85 is set. When the calculated vector inclusion degree exceeds this threshold, the record with more 1s is determined to be the including record, and the other is the included record. This determination mechanism effectively identifies the hierarchical relationship where the "box-cabinet-bottle" path is included by the "pallet-box-cabinet-bottle" path.
[0105] Based on the hash vectors of the containing and included records, the difference in the number of 1-bit bits between them is calculated as the vector dimension difference, which reflects the hierarchical span between the two paths. This hierarchical span is then input into a nonlinear decay function. Where d is the hierarchical span and c is the hierarchical propagation coefficient. When the hierarchical span is 1, the propagation coefficient is approximately 0.74, representing the state propagation strength between adjacent levels; when the span increases to 3, the propagation coefficient decreases to 0.41, reflecting the information loss during cross-level propagation. Based on the calculated hierarchical propagation coefficient, a parent-child hierarchical inclusion relationship is established between the containing record and the included record, and the propagation coefficient is stored as an edge weight for subsequent quantitative evaluation of the state propagation strength.
[0106] Each semantic traceability record is assigned a globally unique tree node identifier, and a snowflake algorithm is used to generate a 64-bit integer identifier to ensure uniqueness in a distributed environment. Directed edges are constructed according to the established parent-child hierarchical containment relationships, with the starting point of the edge being the parent node identifier and the ending point being the child node identifier. A hierarchical propagation coefficient is attached to the edge as a weight attribute. All hash vectors are traversed, and the record with the smallest number of 1-bit values is identified. This record corresponds to the shortest hierarchical evolution sequence and represents the top-level wrapping unit, which is set as the root node of the tree structure. Starting from the root node, the remaining semantic traceability records are sequentially attached to its parent node according to the pointing relationships of the directed edges. During the attachment process, the depth attribute of the nodes is maintained, with the root node having a depth of 0, and the depth increasing by 1 for each subsequent level. In the final tree structure, there is a unique path from any node to the root node. The parent-child relationships between nodes reflect the containment constraints of the wrapping hierarchy, and the edge weights quantify the attenuation strength of state propagation between levels, providing a structured data organization form for subsequent cross-level traceability queries.
[0107] In one optional implementation, based on the hierarchical positioning tags and the tracing status propagation rules, dynamic path deduction is performed along the hierarchical topology graph to identify all associated nodes that have an influence relationship with the queried object, construct a cross-level tracing propagation graph, and output the flow evolution sequence, including:
[0108] Obtain the initial node corresponding to the query object in the hierarchical topology graph, extract the hierarchical positioning label of the initial node, and perform topological coordinate calibration on the initial node based on the hierarchical positioning label;
[0109] Starting from the initial node, a path traversal is performed along the edge connection relationship of the hierarchical topology graph. For each candidate node traversed, its hierarchical positioning label is extracted and topological coordinates are calibrated. The topological coordinates of the candidate node and the topological coordinates of the initial node are substituted into the tracing state propagation rule to determine the influence relationship.
[0110] For the candidate nodes that are determined to have an influence relationship, they are marked as associated nodes and the path sequence from the initial node to the associated node is recorded. The hierarchical positioning labels of each node in the path sequence are extracted to form a hierarchical propagation chain. The segmented propagation attenuation coefficient is calculated based on the hierarchical span between adjacent nodes in the hierarchical propagation chain. The segmented propagation attenuation coefficients are concatenated and multiplied to obtain the path propagation weight.
[0111] By summing up the initial node and all the associated nodes, a directed propagation edge is constructed from the initial node to each associated node based on each path sequence, forming a cross-level tracing propagation graph;
[0112] The initial node and each associated node are sorted according to the propagation weight of the path, and the flow direction evolution sequence is output by combining the hierarchical propagation chain corresponding to each node.
[0113] like Figure 2 As shown, the method includes:
[0114] In practical applications, when warehouse management personnel need to trace the flow of a batch of medicines, they first input the regulatory code of the medicine to be queried as the query object through the WMS system interface. After receiving the regulatory code, the system immediately locates the corresponding initial node in the constructed hierarchical topology graph. At this time, by reading the hierarchical positioning label of the initial node, the path coordinate information of the node in the topology graph can be obtained. For example, if the label is "L2-P001-D3", L2 indicates that it is in the second level, P001 is the sequence number within this level, and D3 indicates that the depth from the root node is 3. By parsing this label, the topological coordinates of the initial node are marked, and its precise position in the overall topology structure is determined.
[0115] After locating the initial node, the system initiates a path traversal mechanism. The traversal process employs a breadth-first strategy, sequentially visiting candidate nodes that have a direct or indirect wrapping relationship with the initial node along the edge connections of the hierarchical topology graph. For each candidate node encountered, the system also extracts its hierarchical location label and completes topological coordinate calibration. For example, a candidate node labeled "L1-P045-D2" indicates that the node is located at the parent level of the initial node. At this point, the topological coordinates of the candidate node and the initial node are substituted into the tracing state propagation rule for calculation. This rule determines whether an influence relationship exists by comparing the depth difference, hierarchical span, and path connectivity of the two nodes. The specific judgment logic includes: if there is a direct or indirect parent-child wrapping relationship between the two nodes, an influence relationship is considered to exist; if the candidate node was previously processed together with the initial node in the same inbound / outbound operation, an association influence exists even if they are not on the same wrapping link.
[0116] For candidate nodes identified as having an influencing relationship, the system marks them as associated nodes and records the complete path sequence from the initial node to the associated node, such as "initial node → intermediate node A → intermediate node B → associated node". The hierarchical positioning labels of each node in this path sequence are extracted to form a hierarchical propagation chain: "L2-P001-D3 → L1-P010-D2 → L1-P045-D2 → L0-P008-D1". The propagation attenuation coefficient is calculated based on the hierarchical span between adjacent nodes in the hierarchical propagation chain. The hierarchical span is defined as the absolute value of the difference in depth between adjacent nodes; the larger the hierarchical span, the smaller the attenuation coefficient. For example, the attenuation coefficient for a jump from D3 to D2 is set to 0.9, and the attenuation coefficient for a jump from D2 to D1 is 0.85. The path propagation weight of the path is obtained by concatenating and multiplying all the segment decay coefficients in the path, for example, 0.9×1.0×0.85=0.765. This weight reflects the degree of intensity decay of the state change propagation from the initial node to the associated nodes.
[0117] After completing the traversal of all paths, the system aggregates the initial node and all associated nodes, and constructs directed propagation edges based on each path sequence. The direction of the directed edges follows the state propagation direction, pointing from the initial node to each associated node, forming a tracing propagation graph with hierarchical semantics. This propagation graph is stored in the form of a graph data structure, where nodes contain information such as regulatory codes, hierarchical positioning labels, and state attributes, and edges contain attributes such as path propagation weights and propagation timestamps.
[0118] The nodes are sorted in descending order according to their propagation weights, with the initial node and all associated nodes arranged from highest to lowest propagation intensity. When outputting the flow evolution sequence, for each associated node, its corresponding hierarchical propagation chain is also displayed, clearly showing the flow trajectory and impact propagation path of the drug regulatory code between different packaging levels, providing a quantitative basis for traceability decisions.
[0119] In one optional implementation, the initial node and all associated nodes are aggregated, and directed propagation edges from the initial node to each associated node are constructed based on each path sequence to form a cross-level tracing propagation graph, including:
[0120] Collect the initial node and all associated nodes, assign a unique node identifier to each node, and extract the path sequence corresponding to each associated node;
[0121] For each path sequence, the hierarchical positioning labels of each node in the path sequence are extracted, the hierarchical span between adjacent nodes in the path sequence is calculated based on the hierarchical positioning labels, the hierarchical spans of each node are accumulated and summed to obtain the total path span of the path sequence, and the path propagation weight corresponding to the path sequence is calculated based on the total path span.
[0122] Based on the starting node identifier and ending node identifier of each path sequence, a directed propagation edge is constructed from the node identifier of the initial node to the node identifier of the corresponding associated node;
[0123] The initial node and all associated nodes are used as a graph node set, and all directed propagation edges are used as a graph edge set. A cross-level tracing propagation graph is constructed based on the graph node set and the graph edge set.
[0124] When constructing the cross-level tracing propagation graph, the identified initial node and all associated nodes are organized in a structured manner. Each node is assigned a unique node identifier, using a "level code-sequence number" encoding format. The level code reflects the node's depth position in the hierarchical topology graph, and the sequence number ensures the uniqueness of nodes within the same level. The path sequence corresponding to each associated node is extracted, recording all intermediate node identifiers traversed from the initial node to that associated node.
[0125] For each path sequence, hierarchical location labels are extracted for each node. These labels contain path coordinates and depth information. The path coordinates use a three-part structure: "hierarchical index - parent node index - current node index". The hierarchical span between adjacent nodes in the path sequence is calculated; the hierarchical span equals the absolute value of the difference in depth information between adjacent nodes. The total path span is obtained by summing the hierarchical spans of each node in the path sequence. The path propagation weights are calculated using a decay function, with weight values of [value missing]. Where D represents the total path span, and α is a preset attenuation coefficient, ranging from 0.1 to 0.3. The larger the hierarchical span of a path, the smaller its propagation weight value, reflecting the strength of the tracing relationship.
[0126] Directed propagation edges are constructed based on the start and end node identifiers of the path sequence. Each directed propagation edge is represented by a triplet structure, containing the start identifier, end identifier, and path propagation weight. When multiple path sequences exist between the same start and end point, the path with the highest propagation weight is selected as the primary propagation edge, and the remaining paths are stored as candidate propagation edges. A propagation attribute label is attached to each directed propagation edge, recording the corresponding operation type, timestamp, and status identifier, supporting subsequent traceability queries and status verification.
[0127] The initial node and all associated nodes are stored as a graph node set, which is stored using a hash table with node identifiers as keys. All directed propagation edges are stored as a graph edge set, which is stored using an adjacency list structure. Each node maintains its outgoing and incoming edge lists. A cross-level tracing propagation graph is constructed based on these node and edge sets. This graph supports rapid location by node identifier, node filtering by level depth, and edge filtering by weight threshold. The tracing propagation graph employs a hierarchical storage mechanism, storing nodes and edges at different levels separately to improve the efficiency of cross-level queries. After graph construction, topological verification is performed to detect loop structures. If loops are found, abnormal nodes are marked and warning information is output. The generated tracing propagation graph can be directly used for visualization. Node size reflects the number of associated nodes, edge thickness reflects path propagation weight, and color coding reflects operation type and status information, providing regulatory personnel with intuitive capabilities for analyzing the evolution of drug flow.
[0128] The method further includes:
[0129] In the method for improving the efficiency of drug regulatory code entry and exit data collection based on a warehouse management system, the initial node and all associated nodes are collected, a unique node identifier is assigned to each node, and the path sequence corresponding to each associated node is extracted. A node registry is established in the data layer of the WMS system. This registry includes a node identifier field, a node type field, a hierarchical positioning label field, and a status identifier field. The node identifier adopts a composite structure composed of a system timestamp, a node type code, and an incrementing sequence number to ensure global uniqueness in a distributed environment. The initial node corresponds to the mapping entity of the query object in the hierarchical topology graph, and the associated nodes correspond to entities with influencing relationships identified during path deduction. The hierarchical positioning label field stores the location information of the node in the hierarchical topology graph. This location information consists of multi-level hierarchical paths, each path containing a hierarchical number and a location index within that level.
[0130] The initial node obtained from the query object mapping is first written to the node registry. Then, all associated nodes marked during the path deduction phase are traversed, generating a node identifier for each associated node and writing it to the node registry. Simultaneously, the hierarchical positioning labels of each node are extracted from the hierarchical topology graph. The path sequence is managed by the path registry, which contains a path identifier field, a start node identifier field, an end node identifier field, and a path node sequence field. The path node sequence field stores all node identifiers traversed from the start to the end in an array structure, with array elements arranged in traversal order. The system retrieves path records from the path registry with the start node as the initial node and the end node as the associated node based on the associated node's node identifier, and reads the content of the path node sequence field.
[0131] For each path sequence, the hierarchical positioning labels of each node in the path sequence are extracted. Based on the hierarchical positioning labels, the hierarchical span between adjacent nodes in the path sequence is calculated. The total path span of the path sequence is obtained by summing the hierarchical spans. The path propagation weight corresponding to the path sequence is then calculated based on the total path span. The extraction of hierarchical positioning labels begins with the first node identifier in the path node sequence field, and the hierarchical positioning label field content corresponding to each node identifier in the node registry is read sequentially. The calculation of the hierarchical span is based on the hierarchical difference between two adjacent hierarchical positioning labels. The hierarchical positioning labels use a hierarchical path representation, and each label contains the complete path from the root level to the current level.
[0132] When the longest common level path length between two labels is L, the level path length of the preceding node is M, and the level path length of the following node is N, the level span equals M minus L plus N minus L. This calculation logic reflects the total level change required for nodes to trace back to their common ancestor level and then down to the target level. The total path span of the path sequence is obtained by summing the span values of all adjacent levels in the path sequence. The path propagation weight is calculated using an inverse proportional mapping relationship, with the baseline weight value as the numerator and the total path span plus a smoothing factor as the denominator. The baseline weight value is set to 1000, and the smoothing factor is set to 10 to avoid division by zero when the total path span is zero. When the total path span is zero, the path propagation weight is 100. When the total path span is 10, the path propagation weight is 50. This weight allocation strategy gives higher weights to paths with shorter spans, conforming to the law of propagation influence decaying with distance.
[0133] Based on the start-point and end-point node identifiers of each path sequence, a directed propagation edge is constructed from the node identifier of the initial node to the node identifier of the corresponding associated node. This directed propagation edge carries the path propagation weight for the corresponding path sequence. The directed propagation edges are managed through an edge registry, which includes fields for edge identifier, start-point node identifier, end-point node identifier, path propagation weight, and path node sequence. All path records in the path registry are traversed, and the start-point and end-point node identifiers for each path are read.
[0134] Each path corresponds to a directed propagation edge. The starting node identifier field of the edge is written with the node identifier of the initial node, and the ending node identifier field is written with the node identifier of the associated node of the path. The path propagation weight field is written with the path propagation weight value of the path calculated in the previous stage. The path node sequence field copies the path node sequence of the corresponding path in the path registry, retaining complete intermediate node information to support subsequent traceability queries. When there are multiple paths between the same pair of starting and ending nodes, multiple directed propagation edge records are generated, each edge carrying the weight and node sequence of different paths.
[0135] The initial node and all associated nodes are treated as a graph node set, and all directed propagation edges are treated as a graph edge set. A cross-level retrospective propagation graph is constructed based on these node and edge sets. Each directed propagation edge in the retrospective propagation graph quantifies the influence strength between corresponding nodes through its path propagation weight. The cross-level retrospective propagation graph is represented in memory using an adjacency list structure, which consists of a node index table and an edge list. The node index table uses node identifiers as keys, with each key corresponding to an edge list pointer and a node attribute record. The construction process loads the records of the initial node and all associated nodes from the node registry and creates an entry for each node in the node index table.
[0136] Iterate through all directed propagation edge records in the edge registry. For each edge, locate the corresponding node entry in the node index table based on the starting node identifier. Append a new element to the end of the edge list for that node. The element contains the ending node identifier, path propagation weight, and path node sequence reference. The path propagation weight is stored as an edge attribute. The query operation can directly read this weight value to evaluate the influence strength between nodes. The higher the weight value, the stronger the propagation efficiency of the corresponding path.
[0137] A second aspect of this invention provides a drug regulatory code entry and exit data collection efficiency improvement system based on a WMS system, comprising:
[0138] The data collection and construction unit is used to collect drug regulatory codes and their corresponding packaging level identifiers, and construct a hierarchical topology graph reflecting the nesting relationship of packaging units based on the packaging level identifiers; obtain the target regulatory code of the operation object, and calculate the influence domain of the target regulatory code by bidirectionally traversing the parent-child path according to the hierarchical topology graph;
[0139] The batch association unit is used to batch associate and record all regulatory codes within the influence domain with the operation attributes of inbound and outbound operations, and generate a hierarchical positioning tag for each regulatory code within the influence domain. Based on the hierarchical positioning tag, the corresponding regulatory code is identified by the path coordinates and depth information in the hierarchical topology map to form a set of traceability records with hierarchical semantics.
[0140] A state propagation unit is used to establish traceability state propagation rules. The traceability state propagation rules define the logic of propagating the state change to adjacent levels along the hierarchical topology when a regulatory code at a certain level undergoes a state change, as well as the attenuation mechanism of the state identifier during the propagation process.
[0141] The dynamic deduction unit is used to perform dynamic path deduction along the hierarchical topology map based on the hierarchical positioning tags and the traceability state propagation rules, identify all related nodes that have an influence relationship with the query object, construct a cross-level traceability propagation map, and output the flow direction evolution sequence.
[0142] A third aspect of the present invention provides an electronic device, comprising:
[0143] processor;
[0144] Memory used to store processor-executable instructions;
[0145] The processor is configured to invoke instructions stored in the memory to execute the aforementioned method.
[0146] A fourth aspect of the present invention provides a computer-readable storage medium having stored thereon computer program instructions that, when executed by a processor, implement the aforementioned method.
[0147] This invention can be a method, apparatus, system, and / or computer program product. The computer program product may include a computer-readable storage medium having computer-readable program instructions loaded thereon for performing various aspects of the invention.
[0148] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention, and not to limit them; although the present invention has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that modifications can still be made to the technical solutions described in the foregoing embodiments, or equivalent substitutions can be made to some or all of the technical features; and these modifications or substitutions do not cause the essence of the corresponding technical solutions to deviate from the scope of the technical solutions of the embodiments of the present invention.
Claims
1. A method for improving the efficiency of drug regulatory code entry and exit data collection based on a WMS system, characterized in that: include: Collect drug regulatory codes and their corresponding packaging level identifiers, and construct a hierarchical topology diagram reflecting the nesting relationship of packaging units based on the packaging level identifiers; Obtain the target regulatory code of the operation object, and calculate the influence domain of the target regulatory code by bidirectionally traversing the parent-child path according to the hierarchical topology graph; All regulatory codes within the influence domain are batch-associated with the operation attributes of inbound and outbound operations, and a hierarchical positioning tag is generated for each regulatory code within the influence domain. Based on the hierarchical positioning tag, the path coordinates and depth information of the corresponding regulatory code in the hierarchical topology map are identified to form a set of traceability records with hierarchical semantics. Establish a traceability state propagation rule, which defines the logic of how the state change propagates along the hierarchical topology to adjacent levels when a regulatory code at a certain level changes state, and the decay mechanism of the state identifier during the propagation process. Based on the hierarchical positioning tags and the tracing status propagation rules, dynamic path deduction is performed along the hierarchical topology graph to identify all associated nodes that have an influence relationship with the queried object, construct a cross-level tracing propagation graph, and output the flow evolution sequence.
2. The method according to claim 1, characterized in that, A hierarchical topology diagram reflecting the nesting relationship of packaging units is constructed based on the aforementioned packaging level identifiers; Obtain the target regulatory code of the operation object, and calculate the influence domain of the target regulatory code by bidirectional traversal along the parent-child path according to the hierarchical topology graph, including: Locate the current node containing the target regulatory code in the hierarchical topology graph, and extract the topological coordinates of the current node in the hierarchical topology graph; Based on the topological coordinates, the hierarchical topology graph is recursively traversed upwards along the parent path. During the traversal, the hierarchical distance between each ancestor node and the current node is calculated, and the uplink propagation weight is assigned to the upper-level regulatory code carried in the ancestor node according to the hierarchical distance, forming an uplink influence set carrying the uplink propagation weight. Based on the topological coordinates, the system recursively traverses downwards along the sub-paths of the hierarchical topology graph. During the traversal, the hierarchical distance between each descendant node and the current node is calculated, and the lower-level regulatory code carried in the descendant node is assigned a downlink propagation weight according to the hierarchical distance, thus forming a downlink influence set carrying the downlink propagation weight. The uplink impact set, the downlink impact set, and the target regulatory code are aggregated, and the impact priority of each regulatory code within the impact domain is determined according to the uplink propagation weight and the downlink propagation weight, forming an impact domain with hierarchical impact strength.
3. The method according to claim 1, characterized in that, Batch associate and record all regulatory codes within the influence domain with the operational attributes of inbound and outbound operations, and generate hierarchical positioning tags for each regulatory code within the influence domain, including: Obtain the operation attributes of inbound and outbound operations, wherein the operation attributes include operation timestamp, operation type identifier, and operation execution subject identifier; Traverse all regulatory codes within the influence domain, establish an association record structure for each regulatory code, and bind and map the regulatory code with the operation timestamp, the operation type identifier, and the operation execution entity identifier according to the association record structure; For each regulatory code within the influence domain, extract the current node identifier corresponding to the regulatory code in the hierarchical topology graph from the associated record structure, and backtrack the complete path chain of the corresponding regulatory code from the root node to the current node in the hierarchical topology graph based on the current node identifier; The hierarchical index of each node in the complete path chain is parsed, and the hierarchical indexes are arranged sequentially according to the traversal order from the root node to the current node to construct a path coordinate vector representing the hierarchical relationship between nodes. The total number of nodes in the complete path chain is calculated based on the path coordinate vector. The total number is used as the depth information of the corresponding regulatory code in the hierarchical topology map. The path coordinate vector and the depth information are encapsulated into a hierarchical positioning tag.
4. The method according to claim 1, characterized in that, Based on the path coordinates and depth information of the regulatory code corresponding to the hierarchical positioning tag in the hierarchical topology map, a set of traceability records with hierarchical semantics is formed, including: Extract the path coordinate vector of the corresponding regulatory code from the hierarchical positioning label, analyze the successor relationship between the hierarchical numbers in the path coordinate vector, and construct a hierarchical evolution sequence that reflects the corresponding regulatory code from the root node to the current node in the hierarchical topology graph. The depth information of the corresponding regulatory code is extracted from the hierarchical positioning label, the hierarchical level of the corresponding regulatory code in the hierarchical topology is determined based on the depth information, and a hierarchical semantic identifier is assigned to the corresponding regulatory code according to the hierarchical level. The hierarchical evolution sequence is associated and bound with the hierarchical semantic identifier to generate a semantic tracing record containing path tracing information and role positioning information; The semantic traceability records corresponding to all regulatory codes within the affected domain are aggregated. Based on the hierarchical evolution sequence of each regulatory code, a hierarchical inclusion relationship between the records is constructed. The semantic traceability records with hierarchical inclusion relationships are organized into a tree structure to form a set of traceability records with hierarchical semantics.
5. The method according to claim 4, characterized in that, The semantic traceability records corresponding to all regulatory codes within the affected domain are aggregated. A hierarchical inclusion relationship is constructed between records based on the hierarchical evolution sequence of each regulatory code. The semantic traceability records with hierarchical inclusion relationships are organized into a tree structure, including: Collect semantic traceability records corresponding to all regulatory codes within the influence domain, extract the hierarchical evolution sequence carried by each semantic traceability record, perform topological hash encoding on the hierarchical evolution sequence, and jointly map the identifier of each level node in the hierarchical evolution sequence and its position information in the path into a hash vector; Traverse the semantic traceability records within the influence domain, extract the hash vectors of any two records, and determine the path inclusion relationship of the corresponding records by calculating the vector inclusion degree of the hash vectors. When the vector inclusion degree exceeds the inclusion determination threshold, determine one record as the including record and the other record as the included record. The difference in vector dimension between the hash vectors of the containing record and the contained record is calculated as the hierarchical span. The hierarchical propagation coefficient is calculated using a nonlinear decay function based on the hierarchical span. A parent-child hierarchical inclusion relationship is established between the containing record and the contained record based on the hierarchical propagation coefficient. Based on the parent-child hierarchical inclusion relationship, tree node identifiers are assigned to the semantic traceability records, and directed edges of the tree node identifiers are constructed according to the parent-child hierarchical inclusion relationship; The semantic traceability record with the smallest hash vector dimension is identified as the root node of the tree structure. The remaining semantic traceability records are then sequentially attached to their parent nodes according to the pointing relationship of the directed edges, forming a tree structure with propagation constraints between nodes.
6. The method according to claim 1, characterized in that, Based on the hierarchical positioning tags and the tracing status propagation rules, dynamic path deduction is performed along the hierarchical topology graph to identify all associated nodes that have an impact relationship with the queried object. A cross-level tracing propagation graph is constructed, and the flow evolution sequence is output, including: Obtain the initial node corresponding to the query object in the hierarchical topology graph, extract the hierarchical positioning label of the initial node, and perform topological coordinate calibration on the initial node based on the hierarchical positioning label; Starting from the initial node, a path traversal is performed along the edge connection relationship of the hierarchical topology graph. For each candidate node traversed, its hierarchical positioning label is extracted and topological coordinates are calibrated. The topological coordinates of the candidate node and the topological coordinates of the initial node are substituted into the tracing state propagation rule to determine the influence relationship. For the candidate nodes that are determined to have an influence relationship, they are marked as associated nodes and the path sequence from the initial node to the associated node is recorded. The hierarchical positioning labels of each node in the path sequence are extracted to form a hierarchical propagation chain. The segmented propagation attenuation coefficient is calculated based on the hierarchical span between adjacent nodes in the hierarchical propagation chain. The segmented propagation attenuation coefficients are concatenated and multiplied to obtain the path propagation weight. By summing up the initial node and all the associated nodes, a directed propagation edge is constructed from the initial node to each associated node based on each path sequence, forming a cross-level tracing propagation graph; The initial node and each associated node are sorted according to the propagation weight of the path, and the flow direction evolution sequence is output by combining the hierarchical propagation chain corresponding to each node.
7. The method according to claim 6, characterized in that, By summing the initial node and all the associated nodes, and constructing directed propagation edges from the initial node to each associated node based on each path sequence, a cross-level tracing propagation graph is formed, including: Collect the initial node and all associated nodes, assign a unique node identifier to each node, and extract the path sequence corresponding to each associated node; For each path sequence, the hierarchical positioning labels of each node in the path sequence are extracted, the hierarchical span between adjacent nodes in the path sequence is calculated based on the hierarchical positioning labels, the hierarchical spans of each node are accumulated and summed to obtain the total path span of the path sequence, and the path propagation weight corresponding to the path sequence is calculated based on the total path span. Based on the starting node identifier and ending node identifier of each path sequence, a directed propagation edge is constructed from the node identifier of the initial node to the node identifier of the corresponding associated node; The initial node and all associated nodes are used as a graph node set, and all directed propagation edges are used as a graph edge set. A cross-level tracing propagation graph is constructed based on the graph node set and the graph edge set.
8. A drug regulatory code entry and exit data collection and efficiency improvement system based on WMS system, used to implement the method of any one of claims 1-7, characterized in that, include: The data collection and construction unit is used to collect drug regulatory codes and their corresponding packaging level identifiers, and to construct a hierarchical topology diagram reflecting the nesting relationship of packaging units based on the packaging level identifiers; Obtain the target regulatory code of the operation object, and calculate the influence domain of the target regulatory code by bidirectionally traversing the parent-child path according to the hierarchical topology graph; The batch association unit is used to batch associate and record all regulatory codes within the influence domain with the operation attributes of inbound and outbound operations, and generate a hierarchical positioning tag for each regulatory code within the influence domain. Based on the hierarchical positioning tag, the corresponding regulatory code is identified by the path coordinates and depth information in the hierarchical topology map to form a set of traceability records with hierarchical semantics. A state propagation unit is used to establish traceability state propagation rules. The traceability state propagation rules define the logic of propagating the state change to adjacent levels along the hierarchical topology when a regulatory code at a certain level undergoes a state change, as well as the attenuation mechanism of the state identifier during the propagation process. The dynamic deduction unit is used to perform dynamic path deduction along the hierarchical topology map based on the hierarchical positioning tags and the traceability state propagation rules, identify all related nodes that have an influence relationship with the query object, construct a cross-level traceability propagation map, and output the flow direction evolution sequence.
9. An electronic device, characterized in that, include: processor; Memory used to store processor-executable instructions; The processor is configured to invoke instructions stored in the memory to execute the method according to any one of claims 1 to 7.
10. A computer-readable storage medium having computer program instructions stored thereon, characterized in that, When the computer program instructions are executed by the processor, they implement the method described in any one of claims 1 to 7.