A Method and Apparatus for Analyzing the Usage Behavior of a Three-Level Library Based on a Data Analysis Model

By collecting, parsing, and standardizing multi-source data, constructing time-series analysis samples and performing feature quantification processing, and combining them with a behavior classification model to generate result data packages, the shortcomings of data fusion and feature quantification in the analysis of material usage behavior in the existing three-level warehouse have been solved, thus realizing intelligent and precise inventory management.

CN122453311BActive Publication Date: 2026-11-10CHINA RESOURCES (WUHAN) INTELLIGENT TECHNOLOGY SERVICE CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202610431246.7
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2026-04-02
Publication Date
2026-11-10
Estimated Expiration
2046-04-02

AI Technical Summary

Technical Problem

Existing methods for analyzing the usage behavior of materials in three-tier warehouses have shortcomings in multi-source heterogeneous data fusion, quantitative modeling of usage behavior characteristics, classification and grading, and structured result delivery. This results in insufficient completeness of data collection on the usage of materials in hospital three-tier warehouses, making it difficult to support refined management.

Method used

Material billing and inventory data from hospital information systems and supply chain management systems are collected through data interfaces. After field parsing and format standardization, time-series analysis samples are formed by primary key association. Inventory and billing change sequences are extracted, zero-value correction and slope ratio calculations are performed to construct behavioral feature vectors, and analysis result data packages are generated and pushed to the inventory management terminal through behavioral classification model matching and threshold determination.

Benefits of technology

It has achieved automated fusion and feature quantification of multi-source heterogeneous data, improved the intelligent analysis and precise inventory management capabilities of hospital tertiary warehouse material usage behavior, and provided timely detection and precise intervention methods for abnormal usage behavior.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122453311B_ABST
    Figure CN122453311B_ABST
Patent Text Reader

Abstract

This application provides a method and apparatus for analyzing the usage behavior of a three-tiered warehouse based on a data analysis model. It constructs time-series analysis samples through multi-source data collection, field standardization, and primary key association. It then constructs behavioral feature vectors by extracting inventory and billing change sequences, filling in zero-value corrections, and calculating point-by-point slope ratios. After obtaining classification labels and level codes through behavioral classification model vector matching and segmented threshold interval comparison, the results are packaged into an analysis result data package and pushed to the inventory management terminal via a message queue. This effectively solves the shortcomings of traditional technologies in multi-source heterogeneous data fusion construction, quantitative modeling of usage behavior features, and classification and structured result push. It provides technical support for intelligent analysis and precise inventory management of hospital three-tiered warehouse material usage behavior.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of data processing, specifically to a method and apparatus for analyzing the usage behavior of a three-level library based on a data analysis model. Background Technology

[0002] Existing methods for analyzing the behavior of three-tiered warehouses have significant shortcomings. Traditional systems perform poorly in collecting multi-source heterogeneous data and constructing time-series samples. They typically rely on manual statistics or a single system data source, lacking the automated multi-source data fusion capability to simultaneously collect material billing records from the hospital information system and barcode consumption records from the supply chain management system via data interfaces, perform field parsing and format standardization on both types of records, perform primary key association by material code and department identifier to obtain paired datasets, and write them into a time-series database to form time-series analysis samples. This results in insufficient data integrity in the collection of material usage data from the hospital's three-tiered warehouse and in inadequate data foundation quality for cross-system correlation analysis, making it difficult to support subsequent refined behavior modeling.

[0003] Furthermore, existing technologies face bottlenecks in extracting inventory and billing change sequences, filling in abnormal zero values, and constructing slope behavior features. Most systems lack a systematic feature engineering capability to calculate inventory and billing change sequences node by node from time-series analysis samples, fill in zero values ​​according to preset replacement rules to obtain corrected change sequences, perform point-by-point ratio calculations to obtain slope sequences, and combine symbolic attribute encoding to encapsulate and write behavioral feature vectors into a feature storage table. This results in the dynamic ratio relationship between the consumption of materials in the three-level warehouse and billing behavior being difficult to quantify effectively, affecting the quality of input features and the accuracy of subsequent behavior classification models.

[0004] The existing system has technical shortcomings in the classification and grading of user behavior and the delivery of structured results. It lacks a complete closed-loop mechanism for behavior analysis and result delivery: inputting behavioral feature vectors into a behavior classification model to obtain classification labels; inputting the classification labels and slope sequences into a threshold determination module and comparing them with preset segmented threshold conditions to obtain level codes; encapsulating the analysis results into a data packet according to a preset message structure; and pushing the data packet to the inventory management terminal via a message queue. This hinders the hospital's inventory management personnel's ability to promptly perceive and accurately intervene in abnormal usage behavior in the tertiary warehouse. Solving these problems is of great significance for improving the intelligent supervision level of hospital material tertiary warehouse usage behavior and the ability to manage inventory with precision. Summary of the Invention

[0005] To address the problems in existing technologies, this application provides a method and apparatus for analyzing the usage behavior of three-level warehouses based on a data analysis model. This method effectively solves the shortcomings of traditional technologies in areas such as the fusion and construction of multi-source heterogeneous data, quantitative modeling of usage behavior characteristics, and classification, grading, and structured result delivery. It provides technical support for the intelligent analysis of the usage behavior of materials in hospital three-level warehouses and precise inventory management.

[0006] To solve at least one of the above problems, this application provides the following technical solution: Firstly, this application provides a three-level library usage behavior analysis method based on a data analysis model, including: Material billing records within a specified period are collected from the hospital information system through a data interface, and secondary warehouse barcode consumption records are collected from the supply chain management system. Field parsing and format standardization are performed on the material billing records and the secondary warehouse barcode consumption records to obtain structured billing data and structured inventory data. The structured billing data and the structured inventory data are associated with primary keys according to material codes and department identifiers to obtain paired datasets. The paired datasets are sorted according to the collection timestamp and written into a time series database to form a time series analysis sample. The inventory change sequence is obtained by reading the inventory values ​​of adjacent time nodes from the time series analysis sample and calculating the difference. The billing value of adjacent time nodes is also read and the difference is calculated to obtain the billing change sequence. The zero values ​​in the inventory change sequence and the billing change sequence are filled with values ​​according to a preset replacement rule to obtain a corrected change sequence. A point-by-point ratio operation is performed based on the corrected change sequence to obtain a slope sequence. The slope sequence and the corresponding symbolic attribute are encoded and encapsulated to form a behavioral feature vector and written into a feature storage table. The behavior feature vector is read from the feature storage table and input into the behavior classification model to perform vector matching to obtain a classification label. The classification label and the slope sequence are input into the threshold determination module and compared with the preset segmentation threshold condition to obtain the level code. The classification label and the level code are encapsulated according to the preset message structure to form an analysis result data packet and pushed to the inventory management terminal through the message queue.

[0007] Furthermore, it also includes: sending a query request to the hospital information system through a data interface and receiving material billing records within a specified period to obtain the original billing data stream; sending a query request to the supply chain management system through a data interface and receiving secondary warehouse barcode consumption records to obtain the original inventory data stream; performing integrity verification on the original billing data stream and the original inventory data stream and removing records with missing necessary fields to obtain a valid billing record set and a valid inventory record set. The valid billing record set is parsed to extract the resource code, department identifier, billing quantity, and billing timestamp to obtain a billing field tuple. The valid inventory record set is parsed to extract the resource code, department identifier, consumption quantity, and barcode scanning timestamp to obtain an inventory field tuple. The billing field tuple is format-mapped according to a preset data template to obtain structured billing data. The inventory field tuple is format-mapped according to a preset data template to obtain structured inventory data.

[0008] Furthermore, it also includes: extracting material codes and department identifiers from structured billing data as billing primary keys, extracting material codes and department identifiers from structured inventory data as inventory primary keys, performing equivalence matching between the billing primary keys and the inventory primary keys, and horizontally concatenating the successfully matched records to obtain a paired dataset, and marking isolated records that fail to match in the paired dataset with anomaly identifiers and classifying them into an anomaly record table; The billing timestamp and scanning timestamp are read from the paired dataset and a unified collection timestamp is generated according to a preset time alignment rule. The paired dataset is sorted in ascending order based on the unified collection timestamp to obtain an ordered paired sequence. The ordered paired sequence is used to construct a composite index based on the material code and department identifier and written into the time series database to form a time series analysis sample.

[0009] Furthermore, it also includes: reading the inventory values ​​of adjacent time nodes from the time series analysis sample in the order of unified collection timestamps and calculating the difference between the subsequent value and the preceding value to obtain the inventory change amount; arranging the inventory change amount in time order to form an inventory change amount sequence; reading the billing values ​​of adjacent time nodes from the time series analysis sample in the order of unified collection timestamps and calculating the difference between the subsequent value and the preceding value to obtain the billing change amount; arranging the billing change amount in time order to form a billing change amount sequence. The zero-value position index is obtained by traversing the inventory change sequence and the billing change sequence and detecting the positions where the value is zero. The positive or negative attribute of the value at the same position in another sequence corresponding to the zero-value position index is read to obtain the sign reference value. Based on the sign reference value, the zero value is replaced with the unit value of the corresponding sign according to the preset replacement rule to obtain the corrected inventory change and the corrected billing change. The corrected inventory change and the corrected billing change are assembled to form the corrected change sequence.

[0010] Furthermore, it also includes: reading the corrected billing change and the corrected inventory change corresponding to the same time point from the corrected change sequence, performing a ratio operation with the corrected billing change as the numerator and the corrected inventory change as the denominator to obtain a slope value, and arranging the slope values ​​in chronological order to form a slope sequence. Read the positive and negative attributes of the corrected billing change and encode them as billing symbol identifiers. Read the positive and negative attributes of the corrected inventory change and encode them as inventory symbol identifiers. Combine the billing symbol identifiers and the inventory symbol identifiers to form symbol attribute codes. Concatenate each slope value in the slope sequence with the corresponding symbol attribute code according to a preset vector structure to form a behavior feature vector. Write the behavior feature vector into the feature storage table using the material code and department identifier as index keys.

[0011] Furthermore, it also includes: reading behavioral feature vectors from the feature storage table according to material codes and department identifiers; extracting symbolic attribute codes from the behavioral feature vectors and inputting them into the behavioral classification model to perform rule matching; determining the behavioral category based on the combination pattern of billing symbol identifiers and inventory symbol identifiers in the symbolic attribute codes and outputting classification labels; The slope sequence is extracted from the behavioral feature vector and the mean is calculated to obtain the average slope value. The classification label and the average slope value are input into the threshold determination module. Based on the classification label, the corresponding preset segmentation threshold condition is selected. The average slope value and the preset segmentation threshold condition are compared to determine the interval to which it belongs and the level code is output.

[0012] Furthermore, it also includes: reading the classification label and grade code and extracting the corresponding material code, department identifier and unified collection timestamp from the feature storage table as associated fields, and mapping and serializing the classification label, the grade code and the associated fields according to the preset message structure to form an analysis result data packet; The analysis result data packet is written into a message queue and labeled with message topic and priority attributes to obtain the message body to be pushed. The message queue schedules the message body to be pushed according to the priority attributes and transmits it to the inventory management terminal through the network channel to complete the push.

[0013] Secondly, this application provides a three-level library usage behavior analysis device based on a data analysis model, comprising: The sample analysis module is used to collect material billing records within a specified period from the hospital information system and secondary warehouse barcode consumption records from the supply chain management system through a data interface. It performs field parsing and format standardization on the material billing records and the secondary warehouse barcode consumption records to obtain structured billing data and structured inventory data. It performs primary key association on the structured billing data and the structured inventory data according to the material code and department identifier to obtain a paired dataset. It sorts the paired dataset according to the collection timestamp and writes it into the time series database to form a time series analysis sample. The feature processing module is used to read the inventory values ​​of adjacent time nodes from the time series analysis sample and calculate the difference to obtain the inventory change sequence; read the billing values ​​of adjacent time nodes and calculate the difference to obtain the billing change sequence; perform numerical filling on the zero values ​​in the inventory change sequence and the billing change sequence according to a preset replacement rule to obtain a corrected change sequence; perform point-by-point ratio calculation based on the corrected change sequence to obtain a slope sequence; encapsulate the slope sequence and the corresponding symbolic attribute encoding to form a behavioral feature vector and write it into the feature storage table. The behavior analysis module is used to read behavior feature vectors from the feature storage table and input them into the behavior classification model to perform vector matching to obtain classification labels. The classification labels and the slope sequence are input into the threshold determination module and compared with the preset segmentation threshold conditions to obtain the level code. The classification labels and the level code are encapsulated according to the preset message structure to form an analysis result data packet and pushed to the inventory management terminal through the message queue.

[0014] Thirdly, this application provides an electronic device, including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor executes the program to implement the steps of the three-level library usage behavior analysis method based on the data analysis model.

[0015] Fourthly, this application provides a computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the steps of the three-level library usage behavior analysis method based on the data analysis model.

[0016] Fifthly, this application provides a computer program product, including a computer program / instruction that, when executed by a processor, implements the steps of the three-level library usage behavior analysis method based on the data analysis model.

[0017] As can be seen from the above technical solution, this application provides a method and device for analyzing the usage behavior of three-level warehouses based on a data analysis model. It constructs time-series analysis samples through multi-source data collection, field standardization, and primary key association. It then constructs behavioral feature vectors by extracting inventory and billing change sequences, filling in zero-value corrections, and calculating point-by-point slope ratios. After obtaining classification labels and level codes through behavioral classification model vector matching and segmented threshold interval comparison, the results are packaged into an analysis result data package and pushed to the inventory management terminal via a message queue. This effectively solves the shortcomings of traditional technologies in multi-source heterogeneous data fusion construction, quantitative modeling of usage behavior features, and classification and structured result push, providing technical support for intelligent analysis and precise inventory management of hospital three-level warehouse material usage behavior. Attached Figure Description

[0018] To more clearly illustrate the technical solutions in the embodiments of this application or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are some embodiments of this application. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.

[0019] Figure 1 This is a flowchart illustrating the behavior analysis method used in the three-level library based on the data analysis model in this application embodiment; Figure 2 This is a structural diagram of the three-level library usage behavior analysis device based on a data analysis model in an embodiment of this application. Detailed Implementation

[0020] To make the objectives, technical solutions, and advantages of the embodiments of this application clearer, the technical solutions of the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of this application, not all embodiments. Based on the embodiments of this application, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of this application.

[0021] The acquisition, storage, use, and processing of data in this application comply with relevant laws and regulations.

[0022] In view of the problems existing in the prior art, this application provides a method and device for analyzing the usage behavior of three-level warehouses based on a data analysis model. It constructs time-series analysis samples through multi-source data collection, field standardization, and primary key association. It then constructs behavioral feature vectors by extracting inventory and billing change sequences, filling in zero-value corrections, and calculating point-by-point slope ratios. After obtaining classification labels and level codes through behavioral classification model vector matching and segmented threshold interval comparison, the results are packaged into an analysis result data package and pushed to the inventory management terminal via a message queue. This effectively solves the shortcomings of traditional technologies in multi-source heterogeneous data fusion construction, quantitative modeling of usage behavior features, and classification and structured result push, providing technical support for intelligent analysis and precise inventory management of hospital three-level warehouse material usage behavior.

[0023] To effectively address the shortcomings of traditional technologies in areas such as multi-source heterogeneous data fusion and construction, quantitative modeling of usage behavior characteristics, and classification, grading, and structured result delivery, and to provide technical support for intelligent analysis and precise inventory management of hospital tertiary warehouse material usage behavior, this application provides an embodiment of a tertiary warehouse usage behavior analysis method based on a data analysis model. See [link to implementation details]. Figure 1 The three-level library usage behavior analysis method based on the data analysis model specifically includes the following: Step S101: Collect material billing records within a specified period from the hospital information system and secondary warehouse barcode consumption records from the supply chain management system through the data interface. Perform field parsing and format standardization on the material billing records and the secondary warehouse barcode consumption records to obtain structured billing data and structured inventory data. Perform primary key association on the structured billing data and the structured inventory data according to the material code and department identifier to obtain a paired dataset. Sort the paired dataset according to the collection timestamp and write it into the time series database to form a time series analysis sample. This embodiment sends a query request to the hospital information system via a data interface, and after specifying the start and end time boundaries of the query period, receives all material billing records within that period to obtain the original billing data stream. Simultaneously, it sends a query request to the supply chain management system via the data interface, and receives the secondary warehouse's barcode scanning consumption records to obtain the original inventory data stream. The original billing data stream includes cost registration information generated during the clinical use of low-value consumables, and the original inventory data stream includes barcode scanning confirmation information when the department's tertiary warehouse requisitions materials from the secondary warehouse.

[0024] An integrity check is performed on the original billing data stream, verifying the completeness of the four essential fields—material code, department identifier, billing quantity, and billing timestamp—in each record. Records lacking any of these essential fields are removed to obtain a valid set of billing records. The same integrity check is performed on the original inventory data stream, verifying the completeness of the four essential fields: material code, department identifier, consumption quantity, and barcode scanning timestamp. Missing records are removed to obtain a valid set of inventory records.

[0025] Based on the set of valid billing records, this embodiment performs field parsing to extract structured data elements. Each valid billing record is read individually, and the boundaries of each field are located according to a preset field separator. The following four items are extracted sequentially to form a billing field tuple: resource code, department identifier, billing quantity, and billing timestamp. The same field parsing operation is performed on the set of valid inventory records to extract the following four items: resource code, department identifier, consumption quantity, and barcode scanning timestamp to form an inventory field tuple.

[0026] Accordingly, this embodiment maps the billing field tuples to a preset data template. The preset data template defines the standard data type and storage format for each field, uniformly converting the billing timestamp to a standard date and time format and the billing quantity to an integer value format, thus obtaining structured billing data. The inventory field tuples are also mapped to the same preset data template to obtain structured inventory data.

[0027] After the structured billing data and the structured inventory data are generated, this embodiment performs primary key association to establish the correspondence between the two types of data. The material code and department identifier are extracted from the structured billing data to form the billing primary key, and the material code and department identifier are extracted from the structured inventory data to form the inventory primary key. The billing primary key and the inventory primary key are then matched for equality. If a match is successful, the corresponding billing record and inventory record are horizontally concatenated to obtain a paired dataset. Isolated records that fail to match are marked as anomalies and added to an anomaly record table for subsequent verification.

[0028] Time alignment processing is performed on the paired dataset. The billing timestamp and barcode scanning timestamp are read from each paired record, and a unified collection timestamp is generated according to a preset time alignment rule. This preset time alignment rule uses the later of the two timestamps as the unified collection timestamp, ensuring that paired records reflect billing and inventory consumption behavior within the same business period. The paired dataset is then sorted in ascending order based on the unified collection timestamp to obtain an ordered paired sequence.

[0029] In this embodiment, the ordered paired sequences are used to construct a composite index based on material codes and department identifiers, and then written into a time-series database to form a time-series analysis sample. The time-series analysis sample uses the composite index to support rapid retrieval by specific material or department dimension, and uses a unified collection timestamp to support sequential reading in chronological order. The time-series analysis sample serves as the data input source for subsequent step S102, where adjacent time node values ​​are read and the inventory change sequence and billing change sequence are calculated.

[0030] Step S102: Read the inventory values ​​of adjacent time nodes from the time series analysis sample and calculate the difference to obtain the inventory change sequence; read the billing values ​​of adjacent time nodes and calculate the difference to obtain the billing change sequence; fill the zero values ​​in the inventory change sequence and the billing change sequence according to a preset replacement rule to obtain the corrected change sequence; perform point-by-point ratio calculation based on the corrected change sequence to obtain the slope sequence; encapsulate the slope sequence and the corresponding symbolic attribute encoding to form a behavioral feature vector and write it into the feature storage table. In this embodiment, the inventory value sequence is read from the time-series analysis sample output in step S101 according to the unified collection timestamp order. The inventory values ​​of two adjacent time nodes are selected, and the inventory value of the preceding time node is subtracted from the inventory value of the subsequent time node to obtain the inventory change for that time interval. The above difference calculation is repeated along the time axis for all adjacent time node pairs, and the inventory change for each time interval is arranged in chronological order to form an inventory change sequence.

[0031] Based on the aforementioned time-series analysis sample, this embodiment reads the billing value sequence and calculates the changes in the same manner. Billing values ​​from two adjacent time points are selected, and the billing value of the preceding time point is subtracted from the billing value of the subsequent time point to obtain the billing change for that time interval. All adjacent time point pairs are traversed along the time axis, and the billing changes for each time interval are arranged in chronological order to form a billing change sequence. The inventory change sequence reflects the increase / decrease trend of tertiary inventory in each time interval, and the billing change sequence reflects the increase / decrease trend of clinical billing behavior in each time interval.

[0032] Accordingly, this embodiment performs zero-value detection and value filling on the inventory change sequence and the billing change sequence. The values ​​at each position in both sequences are traversed, and positions with zero values ​​are detected and their indices are recorded. For positions in the inventory change sequence where a zero value appears, the positive or negative attribute of the value at the same position in the billing change sequence is read as a sign reference value. If the sign reference value is positive, the zero value is replaced with a positive unit value; if the sign reference value is negative, the zero value is replaced with a negative unit value. For positions in the billing change sequence where a zero value appears, the same rule is applied, referencing the positive or negative attribute of the value at the same position in the inventory change sequence. When both sequences are zero at the same position, both zero values ​​are replaced with positive unit values. The above processing yields the corrected inventory change and the corrected billing change, which are then assembled to form the corrected change sequence.

[0033] After the corrected change sequence is generated, this embodiment performs a point-by-point ratio calculation to quantify the proportional relationship between the two types of changes. The corrected billing change and corrected inventory change corresponding to the same time node are read from the corrected change sequence. A division operation is performed with the corrected billing change as the numerator and the corrected inventory change as the denominator to obtain the slope value for that time node. This ratio calculation is repeated for all time nodes, and the slope values ​​for each time node are arranged in chronological order to form a slope sequence. Each value in the slope sequence represents the relative proportion of the billing change rate to the inventory change rate within the corresponding time interval.

[0034] Based on the slope sequence, this embodiment extracts symbolic attributes and performs encoding and encapsulation. The positive and negative attributes of the corrected billing change corresponding to each time node are read, with positive attributes encoded as a first billing symbol identifier and negative attributes encoded as a second billing symbol identifier. Similarly, the positive and negative attributes of the corrected inventory change corresponding to each time node are read, with positive attributes encoded as a first inventory symbol identifier and negative attributes encoded as a second inventory symbol identifier. The billing symbol identifier and the inventory symbol identifier are combined to form a symbolic attribute code, which represents the combination pattern of the change direction of billing behavior and inventory behavior at that time node.

[0035] In this embodiment, the slope values ​​in the slope sequence and their corresponding symbolic attribute codes are concatenated according to a preset vector structure to form a behavioral feature vector. The behavioral feature vector uses slope values ​​to represent the proportion of change and symbolic attribute codes to represent the combination of change directions; together, they characterize the dynamic features of the three-level library usage behavior. The behavioral feature vector is written into a feature storage table using material codes and department identifiers as index keys. This feature storage table serves as the data source for vector matching in the subsequent step S103, which is input into the behavioral classification model.

[0036] Step S103: Read the behavioral feature vector from the feature storage table and input it into the behavioral classification model to perform vector matching to obtain a classification label. Input the classification label and the slope sequence into the threshold determination module and perform interval comparison with the preset segmentation threshold condition to obtain the level code. Encapsulate the classification label and the level code according to the preset message structure to form an analysis result data packet and push it to the inventory management terminal through the message queue.

[0037] In this embodiment, behavioral feature vectors are read from the feature storage table output in step S102, based on material codes and department identifiers. Symbolic attribute codes are extracted from the behavioral feature vectors, and these codes include combination patterns of billing symbol identifiers and inventory symbol identifiers. The symbolic attribute codes are then input into a behavioral classification model for rule matching. The behavioral classification model categorizes behaviors based on four combination patterns of billing symbol identifiers and inventory symbol identifiers.

[0038] Specifically, when the billing symbol is positive and the inventory symbol is negative, it indicates that the billing value increases while the inventory value decreases. The behavior classification model outputs a first category label corresponding to the inventory improvement category. When the billing symbol is negative and the inventory symbol is positive, it indicates that the billing value decreases while the inventory value increases. The behavior classification model outputs a second category label corresponding to the inventory waste category. When both the billing and inventory symbols are positive or both are negative, it indicates that their changes are in the same direction. The behavior classification model outputs a third category label corresponding to the undetermined category, which needs to be further determined based on the slope value.

[0039] After the classification labels are generated, this embodiment performs refined level determination by inputting them into the slope sequence threshold determination module. The slope sequence is extracted from the behavioral feature vector, and the arithmetic mean of all slope values ​​is calculated to obtain the average slope value. The threshold determination module selects corresponding preset segmentation threshold conditions based on the classification labels. For the first and second classification labels, the corresponding level codes are directly output; for the third classification label, the average slope value is compared with the preset segmentation threshold conditions over an interval.

[0040] Accordingly, this embodiment performs interval determination on the undetermined category corresponding to the third category label. The preset segmentation threshold condition is divided into three determination intervals. When the average slope value falls into the middle interval, a standardization level code is output, indicating that the third-level library is used relatively standardly. When the average slope value falls into the lower interval, it is determined to be a waste level code or an improvement level code based on the symbol attribute code. When the average slope value falls into the upper interval, it is determined to be an improvement level code or a waste level code based on the symbol attribute code. The level code and the category label together constitute the complete determination result of the third-level library usage behavior.

[0041] After the classification label and the grade code are determined, this embodiment performs message encapsulation to generate standardized output. The corresponding material code, department identifier, and unified collection timestamp are extracted from the feature storage table as association fields. The classification label is written to the behavior category field of the message, the grade code is written to the judgment grade field of the message, and the association fields are written to the index information field of the message. Serialization encoding is performed on the above fields according to a preset message structure to form an analysis result data packet.

[0042] In this embodiment, the analysis result data packets are written to a message queue and labeled with message topics and priority attributes to obtain the message body to be pushed. Analysis result data packets corresponding to waste level codes are labeled with higher priority attributes, while those corresponding to standardization level codes are labeled with regular priority attributes. The message queue schedules the message bodies to be pushed according to priority attributes and transmits them to the inventory management terminal via the network channel to complete the push. After receiving the analysis result data packets, the inventory management terminal displays them visually, allowing managers to formulate three-level warehouse management strategies based on classification tags and level codes.

[0043] As described above, the three-level warehouse usage behavior analysis method based on data analysis model provided in this application can construct time-series analysis samples through multi-source data collection, field standardization, and primary key association. It can construct behavioral feature vectors by combining inventory and billing change sequence extraction, zero-value correction filling, and point-by-point slope ratio calculation. After obtaining classification labels and level codes through behavioral classification model vector matching and segmented threshold interval comparison, the data is packaged into analysis result data packets and pushed to the inventory management terminal via message queue. This effectively solves the shortcomings of traditional technologies in multi-source heterogeneous data fusion construction, quantitative modeling of usage behavior features, classification and grading, and structured result push, providing technical support for intelligent analysis and accurate inventory management of hospital three-level warehouse material usage behavior.

[0044] In one embodiment of the behavior analysis method used in the three-level library based on the data analysis model in this application, the following content may also be included: Step S201: Send a query request to the hospital information system through the data interface and receive the material billing records within the specified period to obtain the original billing data stream; send a query request to the supply chain management system through the data interface and receive the secondary warehouse barcode consumption records to obtain the original inventory data stream; perform integrity verification on the original billing data stream and the original inventory data stream and remove records with missing necessary fields to obtain a valid billing record set and a valid inventory record set. Step S202: Perform field parsing on the valid billing record set and extract the material code, department identifier, billing quantity, and billing timestamp to obtain a billing field tuple. Perform field parsing on the valid inventory record set and extract the material code, department identifier, consumption quantity, and barcode scanning timestamp to obtain an inventory field tuple. Map the billing field tuple to a preset data template to obtain structured billing data. Map the inventory field tuple to a preset data template to obtain structured inventory data.

[0045] This embodiment sends a query request to the hospital information system via a data interface to obtain material billing records. The query request carries the start and end times of a specified period as query boundary parameters. The hospital information system retrieves the billing database based on these parameters and returns all material billing records within the boundary range. This embodiment receives the returned material billing records to obtain a raw billing data stream. The raw billing data stream contains registration entries generated by each clinical department when charging patients for the use of low-value consumables within the specified period.

[0046] Based on the same data interface mechanism, this embodiment sends a query request to the supply chain management system to obtain the secondary warehouse barcode consumption records. The query request also carries the start and end times of a specified period as query boundary parameters. The supply chain management system retrieves the inventory consumption database based on these parameters and returns all barcode consumption records within the boundary range. This embodiment receives the returned secondary warehouse barcode consumption records to obtain the raw inventory data stream. The raw inventory data stream contains consumption items confirmed by scanning when each department's tertiary warehouse requisitions materials from the secondary warehouse.

[0047] Accordingly, this embodiment performs integrity checks on the original billing data stream to filter out invalid records. Each record in the original billing data stream is read one by one, and the four essential fields—material code, department identifier, billing quantity, and billing timestamp—are checked to ensure they all contain valid values. If any essential field is missing or stored as an empty value, the record is determined to be invalid and removed. Records with all fields intact are retained to form a valid billing record set.

[0048] The same integrity verification process is performed on the original inventory data stream. Each record in the original inventory data stream is read one by one, and the four necessary fields—material code, department identifier, consumption quantity, and scan timestamp—are checked to ensure they all have valid values. Records missing any necessary field are removed, and records with all fields complete form a valid inventory record set. The valid billing record set and the valid inventory record set exclude incomplete data entries caused by system failures or human error.

[0049] After the set of valid billing records is generated, this embodiment performs field parsing to extract key data elements. Each record in the valid billing record set is read one by one, and the storage location and boundaries of each field in the record are located according to preset field separation rules. The contents of four fields—resource code, department identifier, billing quantity, and billing timestamp—are extracted sequentially, and the extraction results are assembled into a billing field tuple. This billing field tuple carries the core business information of a single billing record in a four-tuple structure.

[0050] The same field parsing process is performed on the valid inventory record set. Each record in the valid inventory record set is read one by one, and the contents of four fields—material code, department identifier, consumption quantity, and scan timestamp—are extracted according to the preset field separation rules. The extracted results are then assembled into an inventory field tuple. The inventory field tuple carries the core business information of a single inventory consumption record in a four-tuple structure.

[0051] In this embodiment, the billing field tuples are format-mapped according to a preset data template to unify data representation standards. The preset data template defines the standard data type and encoding format for each field, converting the billing timestamp from its original string format to a standard date and time format, converting the billing quantity from its original text format to an integer value format, and padding the material code and department identifier to a uniform code length. After format mapping, structured billing data is obtained. The inventory field tuples are then format-mapped according to the same preset data template to obtain structured inventory data. The structured billing data and the structured inventory data serve as the input source for the subsequent step S301, which performs primary key association and generates a paired dataset.

[0052] In one embodiment of the behavior analysis method used in the three-level library based on the data analysis model in this application, the following content may also be included: Step S301: Extract the material code and department identifier from the structured billing data as the billing primary key, extract the material code and department identifier from the structured inventory data as the inventory primary key, perform equivalence matching on the billing primary key and the inventory primary key, and horizontally concatenate the successfully matched records to obtain a paired dataset. Mark the isolated records that fail to match in the paired dataset with an anomaly identifier and add them to the anomaly record table. Step S302: Read the billing timestamp and scanning timestamp from the paired dataset and generate a unified collection timestamp according to the preset time alignment rules. Based on the unified collection timestamp, perform ascending sorting on the paired dataset to obtain an ordered paired sequence. Construct a composite index for the ordered paired sequence according to the material code and department identifier and write it into the time series database to form a time series analysis sample.

[0053] This embodiment extracts two fields, "Material Code" and "Department Identifier," from the structured billing data output in step S202. The Material Code and Department Identifier are concatenated using a preset connector to form a billing primary key. This billing primary key uniquely identifies a specific department's billing record for a specific material. All records in the structured billing data are traversed, and a corresponding billing primary key is generated for each record, forming a set of billing primary keys.

[0054] Based on the structured inventory data, this embodiment performs the same primary key extraction operation. The material code and department identifier fields are extracted from the structured inventory data and concatenated using the same preset connector to form the inventory primary key. The inventory primary key uniquely identifies the inventory consumption record of a specific material for a specific department. All records in the structured inventory data are traversed, and a corresponding inventory primary key is generated for each record, forming an inventory primary key set.

[0055] Accordingly, this embodiment performs an equality match between the billing primary key and the inventory primary key to establish a data association. Each billing primary key in the billing primary key set is read sequentially, and a search is performed in the inventory primary key set to determine if an inventory primary key with the same value exists. When a match is found, the structured billing data record corresponding to the billing primary key is horizontally concatenated with the structured inventory data record corresponding to the matching inventory primary key to generate a paired record containing both billing and inventory information. All successfully matched paired records are then aggregated to form a paired dataset.

[0056] For records where a match fails, this embodiment performs anomaly marking and archiving. Records that cannot find a match in the billing primary key set within the inventory primary key set are marked as billing orphaned records, and records that cannot find a match in the inventory primary key set within the billing primary key set are marked as inventory orphaned records. Anomaly identifier fields are added to the billing orphaned records and the inventory orphaned records, with the anomaly identifier value set to the corresponding orphanage type code. The marked orphaned records are written to an anomaly record table for subsequent data verification and problem tracing.

[0057] After the paired dataset is generated, this embodiment reads the timestamp field and performs time alignment processing. Each paired record in the paired dataset is read one by one, and the billing timestamp and barcode scanning timestamp are extracted. The two timestamps are compared according to a preset time alignment rule, and the later timestamp is selected as the unified collection timestamp for that paired record. The preset time alignment rule ensures that the unified collection timestamp reflects the time point when both billing and inventory consumption have occurred.

[0058] Based on the unified collection timestamp, this embodiment performs a time-series arrangement on the paired dataset. All paired records in the paired dataset are sorted in ascending order according to the value of the unified collection timestamp, with records of smaller timestamp values ​​placed first and records of larger timestamp values ​​placed last, resulting in an ordered paired sequence. This ordered paired sequence organizes the paired records in chronological order, supporting subsequent time-based serialization analysis.

[0059] This embodiment constructs a composite index based on material codes and department identifiers for the ordered paired sequences to support multi-dimensional retrieval. The material code serves as the first-level index key, and the department identifier as the second-level index key, establishing a two-level index mapping relationship for each record in the ordered paired sequence. The ordered paired sequences after constructing the composite index are written into a time-series database to form a time-series analysis sample. This time-series analysis sample serves as the data input source for subsequent step S401, where adjacent time node values ​​are read and the inventory change sequence and billing change sequence are calculated.

[0060] In one embodiment of the behavior analysis method used in the three-level library based on the data analysis model in this application, the following content may also be included: Step S401: Read the inventory values ​​of adjacent time nodes from the time series analysis sample according to the unified collection timestamp order and calculate the difference between the subsequent value and the preceding value to obtain the inventory change amount. Arrange the inventory change amount in time order to form an inventory change amount sequence. Read the billing values ​​of adjacent time nodes from the time series analysis sample according to the unified collection timestamp order and calculate the difference between the subsequent value and the preceding value to obtain the billing change amount. Arrange the billing change amount in time order to form a billing change amount sequence. Step S402: Traverse the inventory change sequence and the billing change sequence to detect the positions where the value is zero to obtain the zero value position index. Read the positive or negative attribute of the value at the same position in another sequence corresponding to the zero value position index to obtain the sign reference value. Based on the sign reference value, replace the zero value with the unit value of the corresponding sign according to the preset replacement rule to obtain the corrected inventory change and the corrected billing change. Assemble the corrected inventory change and the corrected billing change to form the corrected change sequence.

[0061] In this embodiment, inventory values ​​are read from the time-series analysis sample output in step S302 according to a unified collection timestamp order. Each paired record in the time-series analysis sample contains a consumption quantity field corresponding to that time node, and this embodiment reads the value of this field as the inventory value. Two adjacent time nodes are selected along the time axis, and the inventory value of the subsequent time node is recorded as the subsequent inventory value, and the inventory value of the preceding time node is recorded as the preceding inventory value.

[0062] Based on the subsequent inventory value and the preceding inventory value, this embodiment calculates the difference to obtain the inventory change. Subtracting the preceding inventory value from the subsequent inventory value yields the inventory change for that time interval; a positive value indicates an increase in inventory, and a negative value indicates a decrease. By traversing all adjacent time node pairs along the time axis and repeating the above difference calculation, the inventory changes for each time interval are arranged in chronological order to form an inventory change sequence. This inventory change sequence reflects the increase and decrease of inventory in the three-tier warehouse within each time interval.

[0063] Accordingly, this embodiment reads billing values ​​from the time-series analysis sample in a unified collection timestamp order. Each paired record in the time-series analysis sample contains a billing quantity field corresponding to that time node, and this embodiment reads the value of this field as the billing value. Two adjacent time nodes are selected along the time axis, and the billing value of the subsequent time node is recorded as the subsequent billing value, and the billing value of the preceding time node is recorded as the preceding billing value. The billing change for that time interval is obtained by subtracting the preceding billing value from the subsequent billing value.

[0064] The above difference calculation is performed by traversing all adjacent time nodes, and the billing changes for each time interval are arranged in chronological order to form a billing change sequence. This billing change sequence reflects the increases and decreases in material billing behavior of clinical departments within each time interval. The inventory change sequence and the billing change sequence correspond one-to-one in the time dimension, establishing a data foundation for subsequent ratio calculations.

[0065] After the inventory change sequence and the billing change sequence are generated, this embodiment iterates through both sequences to detect zero-value positions. Each value in the inventory change sequence is read position by position, and when a value is equal to zero, the sequence index of that position is recorded to form an inventory zero-value position index. Similarly, each value in the billing change sequence is read position by position, and when a value is equal to zero, the sequence index of that position is recorded to form a billing zero-value position index. The inventory zero-value position index and the billing zero-value position index are then merged to form a zero-value position index.

[0066] Based on the zero-value location index, this embodiment reads a sign reference value to determine the direction of zero-value replacement. For locations in the inventory change sequence where a zero value appears, the positive or negative attribute of the value at the same location in the billing change sequence is read as the sign reference value. When both sequences have zero values ​​at the same location, the sign reference value is set to a positive attribute.

[0067] This embodiment performs zero-value filling based on the symbol reference value according to a preset replacement rule. When the symbol reference value is positive, the zero value at the corresponding position is replaced with a positive unit value. When the symbol reference value is negative, the zero value at the corresponding position is replaced with a negative unit value. After the above replacement process, each zero value position in the inventory change sequence obtains a corrected inventory change, and each zero value position in the billing change sequence obtains a corrected billing change. The corrected inventory change is filled back into the corresponding position in the original sequence to form a corrected inventory change sequence, and the corrected billing change is filled back into the corresponding position in the original sequence to form a corrected billing change sequence. The corrected inventory change sequence and the corrected billing change sequence together constitute the corrected change sequence, which serves as the data input source for performing point-by-point ratio calculation and generating a slope sequence in the subsequent step S501.

[0068] In one embodiment of the behavior analysis method used in the three-level library based on the data analysis model in this application, the following content may also be included: Step S501: Read the corrected billing change and corrected inventory change corresponding to the same time point from the corrected change sequence, use the corrected billing change as the numerator and the corrected inventory change as the denominator to perform a ratio operation to obtain the slope value, and arrange the slope values ​​in time order to form a slope sequence. Step S502: Read the positive and negative attributes of the corrected billing change and encode them as billing symbol identifiers; read the positive and negative attributes of the corrected inventory change and encode them as inventory symbol identifiers; combine the billing symbol identifiers and the inventory symbol identifiers to form symbol attribute codes; concatenate each slope value in the slope sequence with the corresponding symbol attribute code according to a preset vector structure to form a behavior feature vector; and write the behavior feature vector into the feature storage table using the material code and department identifier as index keys.

[0069] In this embodiment, the corrected billing change and corrected inventory change corresponding to the same time node are read from the corrected change sequence output in step S402. The corrected change sequence includes two sub-sequences: the corrected inventory change sequence and the corrected billing change sequence. The two sub-sequences correspond one-to-one with a unified collection timestamp in the time dimension. The values ​​of the corresponding nodes in the corrected billing change sequence and the corrected inventory change sequence are read node by node to form a numerical pair for the ratio calculation to be performed.

[0070] Based on the aforementioned numerical pairs, this embodiment performs a ratio calculation to quantify the proportional relationship between billing changes and inventory changes. Using the corrected billing change as the numerator and the corrected inventory change as the denominator, a division operation is performed to obtain the slope value at that time point. This slope value characterizes the proportionality coefficient between the rate of billing change and the rate of inventory change within that time interval, reflecting the degree of dynamic matching between billing behavior and inventory consumption behavior.

[0071] Accordingly, this embodiment iterates through all time points and repeats the above ratio calculation. For each time point in the corrected change sequence, the corresponding corrected billing change and corrected inventory change are read and divided to obtain the slope value for that point. The slope values ​​of each time point are arranged in chronological order according to the unified collection timestamps to form a slope sequence. The slope sequence organizes the slope values ​​of each time interval in chronological order, supporting subsequent serialized analysis of the changing trends of the three-level warehouse usage behavior.

[0072] After the slope sequence is generated, this embodiment reads the positive or negative attribute of the corrected billing change and performs symbol encoding. The positive or negative attribute of the value at each time node in the corrected billing change sequence is detected. When the value is greater than zero, the attribute is determined to be positive; when the value is less than zero, the attribute is determined to be negative. Positive attributes are encoded as a first billing symbol identifier, and negative attributes are encoded as a second billing symbol identifier, forming the billing symbol identifier for each time node.

[0073] The same symbol encoding process is applied to the corrected inventory change. The positive or negative attribute of the value at each time point in the corrected inventory change sequence is detected. A value greater than zero is considered positive, and a value less than zero is considered negative. Positive attributes are encoded as a first inventory symbol identifier, and negative attributes are encoded as a second inventory symbol identifier, forming inventory symbol identifiers for each time point. The billing symbol identifier and inventory symbol identifier for the same time point are concatenated according to a preset combination rule to form a symbol attribute code. This symbol attribute code represents the combination pattern of the billing change direction and the inventory change direction at that time point.

[0074] In this embodiment, the slope values ​​and corresponding symbolic attribute codes in the slope sequence are concatenated according to a preset vector structure. The preset vector structure defines the arrangement and data format of the slope value field and the symbolic attribute code field within the vector. For each time node, the slope value of that node is written into the numerical field of the vector, and the symbolic attribute code of that node is written into the encoding field of the vector, forming a behavioral feature vector containing both slope and symbolic information. This behavioral feature vector, in a composite structure, carries the quantitative and directional characteristics of the three-level library usage behavior.

[0075] In this embodiment, the behavioral feature vector is written into the feature storage table using the material code and department identifier as index keys. The material code and department identifier are extracted from the original pairing records and combined to form a composite index key. The storage location is located in the feature storage table using this composite index key, and the behavioral feature vector is written to the corresponding location for persistent storage. The feature storage table serves as the data input source for the subsequent step S601, where the behavioral feature vector is read and input into the behavioral classification model for vector matching.

[0076] In one embodiment of the behavior analysis method used in the three-level library based on the data analysis model in this application, the following content may also be included: Step S601: Read the behavior feature vector from the feature storage table according to the material code and department identifier, extract the symbol attribute code from the behavior feature vector and input it into the behavior classification model to perform rule matching, determine the behavior category based on the combination pattern of billing symbol identifier and inventory symbol identifier in the symbol attribute code and output the classification label; Step S602: Extract the slope sequence from the behavior feature vector and calculate the mean to obtain the average slope value. Input the classification label and the average slope value into the threshold determination module. Select the corresponding preset segmentation threshold condition based on the classification label. Perform interval comparison between the average slope value and the preset segmentation threshold condition to determine the interval to which it belongs and output the level code.

[0077] In this embodiment, behavioral feature vectors are read from the feature storage table output in step S502, based on the material code and department identifier. The material code and department identifier to be analyzed are combined to form a composite index key. The corresponding storage location in the feature storage table is located based on this composite index key, and the behavioral feature vector is read. The behavioral feature vector includes a slope sequence field and a symbolic attribute encoding field, carrying the quantitative and directional characteristics of the material's usage behavior in the department's three-level warehouse.

[0078] Based on the behavioral feature vector, this embodiment extracts symbolic attribute codes and inputs them into a behavioral classification model for rule matching. The symbolic attribute codes are read from the encoding field of the behavioral feature vector; these codes are formed by combining billing symbol identifiers and inventory symbol identifiers. The symbolic attribute codes are then input into the behavioral classification model, which has built-in mapping rules between four combination patterns and behavioral categories.

[0079] Accordingly, the behavior classification model determines the behavior category based on the combination pattern of billing symbol identifiers and inventory symbol identifiers. When the billing symbol identifier is positive and the inventory symbol identifier is negative, it indicates that the billing quantity is continuously increasing while the inventory quantity is continuously decreasing. The behavior classification model maps this combination pattern to the inventory improvement category and outputs a first category label. When the billing symbol identifier is negative and the inventory symbol identifier is positive, it indicates that the billing quantity is continuously decreasing while the inventory quantity is continuously increasing. The behavior classification model maps this combination pattern to the inventory waste category and outputs a second category label. When both the billing symbol identifier and the inventory symbol identifier are positive or both are negative, it indicates that the direction of billing change is consistent with the direction of inventory change. The behavior classification model maps this combination pattern to an undetermined category and outputs a third category label.

[0080] After the classification labels are generated, this embodiment extracts a slope sequence from the behavioral feature vector and calculates the mean. The slope sequence, containing slope values ​​for each time point, is read from the numerical field of the behavioral feature vector. A summation operation is performed on all slope values ​​in the slope sequence, and the sum is divided by the number of slope values ​​to obtain the average slope value. This average slope value characterizes the overall level of the ratio between billing changes and inventory changes within the analysis period.

[0081] In this embodiment, the classification label and the average slope value are input into a threshold determination module to perform refined level determination. The threshold determination module selects corresponding preset segmentation threshold conditions based on the classification label. For the first and second classification labels, it directly outputs the level code corresponding to the behavior category. For the third classification label, the threshold determination module performs an interval comparison between the average slope value and the preset segmentation threshold conditions to determine the specific level.

[0082] The preset segmentation threshold condition divides the third category label into three judgment intervals. When the average slope value falls into the middle interval, it indicates that the billing change rate and the inventory change rate are basically matched, and the threshold judgment module outputs a standard level code. When the average slope value falls into the lower interval, it is determined as a waste level code or an improvement level code based on the specific values ​​of the billing symbol identifier and the inventory symbol identifier in the symbol attribute code. When the average slope value falls into the upper interval, it is also determined as an improvement level code or a waste level code based on the specific values ​​of the symbol attribute code. The category label and the level code together constitute the complete judgment result of the three-level warehouse usage behavior, serving as the data input source for the subsequent step S701 to execute message encapsulation and push to the inventory management terminal.

[0083] In one embodiment of the behavior analysis method used in the three-level library based on the data analysis model in this application, the following content may also be included: Step S701: Read the classification label and grade code, and extract the corresponding material code, department identifier and unified collection timestamp from the feature storage table as associated fields. Map the classification label, the grade code and the associated fields according to the preset message structure and perform field mapping and serialization encoding to form an analysis result data packet. Step S702: Write the analysis result data packet into the message queue and mark the message topic and priority attribute to obtain the message body to be pushed. The message queue schedules the message body to be pushed according to the priority attribute and transmits it to the inventory management terminal through the network channel to complete the push.

[0084] This embodiment reads the classification label and level code output in step S602 as the core judgment content of the analysis result. The classification label represents the category to which the three-level library usage behavior belongs, and the level code represents the severity or standardization of the behavior under the corresponding category. The corresponding material code, department identifier, and unified collection timestamp are extracted from the feature storage table based on the composite index key of the current analysis object as association fields. The association fields are used to identify the specific material, specific department, and specific analysis period corresponding to the analysis result.

[0085] Based on the classification labels, the grade codes, and the associated fields, this embodiment performs field mapping according to a preset message structure. The preset message structure defines the arrangement position of each field in the message, the field name, and the data type specifications. The material code is mapped to the material identifier field of the message, the department identifier is mapped to the department identifier field of the message, and the unified collection timestamp is mapped to the timestamp field of the message. The classification labels are mapped to the behavior category field of the message, and the grade codes are mapped to the judgment grade field of the message.

[0086] Accordingly, this embodiment performs serialization encoding on the message after field mapping is completed to generate a transmittable data format. The content of each field is converted into a byte stream according to a preset message structure. A message length identifier and a version identifier are written to the header of the byte stream, and a checksum is written to the tail of the byte stream to support integrity verification by the receiving end. After serialization encoding, an analysis result data packet is formed, which carries all the information of the analysis results in a compact binary format.

[0087] After the analysis result data packet is generated, this embodiment writes it to a message queue for asynchronous push. A message entry is created for this data packet in the message queue, and the analysis result data packet is written to the payload field of the message entry. A message topic is labeled for this message entry, and the message topic is set to "Level 3 Library Behavior Analysis Results" so that the inventory management terminal can subscribe to and receive the data according to the topic.

[0088] This embodiment uses a grading code to assign priority attributes to message entries to achieve differentiated scheduling. When the grading code corresponds to a waste level, it indicates that the analysis results reveal potential inventory management problems, and the message entry is assigned a higher priority attribute. When the grading code corresponds to a standardization level or an improvement level, the message entry is assigned a regular priority attribute. After completing the topic and priority labeling, a message body to be pushed is formed.

[0089] The message queue schedules messages according to their priority attributes. Messages with higher priority are given priority to enter the sending queue, while messages with lower priority are queued in a first-in-first-out (FIFO) order. The message queue retrieves the message to be sent from the sending queue, establishes a communication connection with the inventory management terminal via the network channel, and transmits the message content. After receiving the transmitted data, the inventory management terminal performs deserialization and decoding to restore the analysis result data packet, extracts the classification tags, grade codes, and related fields for visualization, and provides managers with the analysis results to formulate three-level warehouse material management and replenishment strategies.

[0090] To effectively address the shortcomings of traditional technologies in areas such as multi-source heterogeneous data fusion and construction, quantitative modeling of usage behavior characteristics, and classification, grading, and structured result delivery, and to provide technical support for intelligent analysis and precise inventory management of hospital tertiary warehouse material usage behavior, this application provides an embodiment of a data analysis model-based tertiary warehouse usage behavior analysis device for implementing all or part of the aforementioned data analysis model-based tertiary warehouse usage behavior analysis method. See [link to embodiment]. Figure 2 The three-level library usage behavior analysis device based on the data analysis model specifically includes the following: The sample analysis module 10 is used to collect material billing records within a specified period from the hospital information system and secondary warehouse barcode consumption records from the supply chain management system through the data interface. It performs field parsing and format standardization on the material billing records and the secondary warehouse barcode consumption records to obtain structured billing data and structured inventory data. It performs primary key association on the structured billing data and the structured inventory data according to the material code and department identifier to obtain a paired dataset. It sorts the paired dataset according to the collection timestamp and writes it into the time series database to form a time series analysis sample. Feature processing module 20 is used to read the inventory values ​​of adjacent time nodes from the time series analysis sample and calculate the difference to obtain the inventory change sequence, read the billing values ​​of adjacent time nodes and calculate the difference to obtain the billing change sequence, fill the zero values ​​in the inventory change sequence and the billing change sequence according to a preset replacement rule to obtain a corrected change sequence, perform point-by-point ratio calculation based on the corrected change sequence to obtain a slope sequence, encapsulate the slope sequence and the corresponding symbolic attribute encoding to form a behavioral feature vector and write it into the feature storage table; The behavior analysis module 30 is used to read behavior feature vectors from the feature storage table and input them into the behavior classification model to perform vector matching to obtain classification labels. The classification labels and the slope sequence are input into the threshold determination module and compared with the preset segmentation threshold conditions to obtain the level code. The classification labels and the level code are encapsulated according to the preset message structure to form an analysis result data packet and pushed to the inventory management terminal through the message queue.

[0091] As described above, the three-level warehouse usage behavior analysis device based on the data analysis model provided in this application can construct time-series analysis samples through multi-source data collection, field standardization, and primary key association. It can construct behavioral feature vectors by combining inventory and billing change sequence extraction, zero-value correction filling, and point-by-point slope ratio calculation. After obtaining classification labels and level codes through behavioral classification model vector matching and segmented threshold interval comparison, the data is packaged into analysis result data packets and pushed to the inventory management terminal via a message queue. This effectively solves the shortcomings of traditional technologies in multi-source heterogeneous data fusion construction, quantitative modeling of usage behavior features, and classification and structured result push, providing technical support for intelligent analysis and accurate inventory management of hospital three-level warehouse material usage behavior.

[0092] This invention also provides a computer device, including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor executes the three-level library usage behavior analysis method based on a data analysis model.

[0093] This invention also provides a computer-readable storage medium storing a computer program that, when executed by a processor, implements the above-described three-level library usage behavior analysis method based on a data analysis model.

[0094] This invention also provides a computer program product, which includes a computer program that, when executed by a processor, implements the above-described three-level library usage behavior analysis method based on a data analysis model.

[0095] In this embodiment of the invention, time-series analysis samples are constructed through multi-source data collection, field standardization, and primary key association. Behavioral feature vectors are constructed by extracting inventory and billing change sequences, filling zero-value corrections, and performing point-by-point slope ratio calculations. Classification labels and grade codes are obtained through behavioral classification model vector matching and segmented threshold interval comparison, and then packaged into analysis result data packets, which are pushed to the inventory management terminal via a message queue. This effectively solves the shortcomings of traditional technologies in multi-source heterogeneous data fusion construction, behavioral feature quantification modeling, classification and grading, and structured result push, providing technical support for intelligent analysis and precise inventory management of hospital tertiary warehouse material usage behavior.

[0096] Those skilled in the art will understand that embodiments of the present invention can be provided as methods, systems, or computer program products. Therefore, the present invention can take the form of a completely hardware embodiment, a completely software embodiment, or an embodiment combining software and hardware aspects. Furthermore, the present invention can take the form of a computer program product embodied on one or more computer-usable storage media (including, but not limited to, disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.

[0097] This invention is described with reference to flowchart illustrations and / or block diagrams of methods, apparatus (systems), and computer program products according to embodiments of the invention. It will be understood that each block of the flowchart illustrations and / or block diagrams, and combinations of blocks in the flowchart illustrations and / or block diagrams, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, special-purpose computer, embedded processor, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, generate instructions for implementing the flowchart illustrations and / or block diagrams. Figure 1 One or more processes and / or boxes Figure 1 A device that provides the functions specified in one or more boxes.

[0098] These computer program instructions may also be stored in a computer-readable storage medium that can direct a computer or other programmable data processing device to function in a particular manner, such that the instructions stored in the computer-readable storage medium produce an article of manufacture including instruction means, which are implemented in a process Figure 1 One or more processes and / or boxes Figure 1 The function specified in one or more boxes.

[0099] These computer program instructions may also be loaded onto a computer or other programmable data processing equipment to cause a series of operational steps to be performed on the computer or other programmable equipment to produce a computer-implemented process, thereby providing instructions that execute on the computer or other programmable equipment for implementing the process. Figure 1 One or more processes and / or boxes Figure 1 The steps of the function specified in one or more boxes.

[0100] The specific embodiments described above further illustrate the purpose, technical solution, and beneficial effects of the present invention. It should be understood that the above descriptions are merely specific embodiments of the present invention and are not intended to limit the scope of protection of the present invention. 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 three-level library usage behavior analysis method based on a data analysis model, characterized in that, The method includes: Material billing records within a specified period are collected from the hospital information system through a data interface, and secondary warehouse barcode consumption records are collected from the supply chain management system. Field parsing and format standardization are performed on the material billing records and the secondary warehouse barcode consumption records to obtain structured billing data and structured inventory data. The structured billing data and the structured inventory data are associated with primary keys according to material codes and department identifiers to obtain paired datasets. The paired datasets are sorted according to the collection timestamp and written into a time series database to form a time series analysis sample. The process involves reading inventory values ​​from adjacent time points in the time-series analysis sample and calculating the difference to obtain an inventory change sequence; reading billing values ​​from adjacent time points and calculating the difference to obtain a billing change sequence; filling the zero values ​​in the inventory change sequence and the billing change sequence according to a preset replacement rule to obtain a corrected change sequence; performing point-by-point ratio calculations on the corrected change sequence to obtain a slope sequence; and encoding and encapsulating the slope sequence with the corresponding symbolic attribute to form a behavioral feature vector and writing it into a feature storage table. This includes: reading the corrected billing change and the corrected inventory change corresponding to the same time point from the corrected change sequence; and... The revised billing change is used as the numerator, and the revised inventory change is used as the denominator to perform a ratio operation to obtain a slope value. The slope values ​​are arranged in chronological order to form a slope sequence. The positive and negative attributes of the revised billing change are read and encoded as billing symbol identifiers. The positive and negative attributes of the revised inventory change are read and encoded as inventory symbol identifiers. The billing symbol identifiers and the inventory symbol identifiers are combined to form a symbol attribute code. Each slope value in the slope sequence and its corresponding symbol attribute code are concatenated with the corresponding symbol attribute code according to a preset vector structure to form a behavioral feature vector. The behavioral feature vector is written into a feature storage table using material code and department identifier as index keys. The process involves: reading behavioral feature vectors from the feature storage table and inputting them into a behavior classification model to perform vector matching and obtain classification labels; inputting the classification labels and slope sequences into a threshold determination module and performing interval comparison with preset segmentation threshold conditions to obtain a level code; reading behavioral feature vectors from the feature storage table according to material codes and department identifiers; extracting symbol attribute codes from the behavioral feature vectors and inputting them into a behavior classification model to perform rule matching; determining the behavior category based on the combination pattern of billing symbol identifiers and inventory symbol identifiers in the symbol attribute codes and outputting classification labels; extracting slope sequences from the behavioral feature vectors and calculating the mean to obtain an average slope value; inputting the classification labels and the average slope value into a threshold determination module; selecting corresponding preset segmentation threshold conditions based on the classification labels; performing interval comparison between the average slope value and the preset segmentation threshold conditions to determine the interval to which the average slope value belongs and outputting a level code. The classification labels and grade codes are encapsulated according to a preset message structure to form an analysis result data packet, which is then pushed to the inventory management terminal via a message queue.

2. The three-level library usage behavior analysis method based on a data analysis model according to claim 1, characterized in that, The process involves collecting material billing records from the hospital information system within a specified period via a data interface and collecting secondary warehouse barcode consumption records from the supply chain management system. Field parsing and format standardization are then performed on the material billing records and the secondary warehouse barcode consumption records to obtain structured billing data and structured inventory data, including: The system sends a query request to the hospital information system through a data interface and receives material billing records within a specified period to obtain the original billing data stream. The system also sends a query request to the supply chain management system through a data interface and receives secondary warehouse barcode consumption records to obtain the original inventory data stream. The system performs integrity checks on the original billing data stream and the original inventory data stream and removes records that are missing necessary fields to obtain a valid billing record set and a valid inventory record set. The valid billing record set is parsed to extract the resource code, department identifier, billing quantity, and billing timestamp to obtain a billing field tuple. The valid inventory record set is parsed to extract the resource code, department identifier, consumption quantity, and barcode scanning timestamp to obtain an inventory field tuple. The billing field tuple is format-mapped according to a preset data template to obtain structured billing data. The inventory field tuple is format-mapped according to a preset data template to obtain structured inventory data.

3. The three-level library usage behavior analysis method based on a data analysis model according to claim 1, characterized in that, The process involves associating the structured billing data and the structured inventory data using material codes and department identifiers as primary keys to obtain paired datasets. These paired datasets are then sorted by collection timestamps and written into a time-series database to form a time-series analysis sample. This includes: Material codes and department identifiers are extracted from structured billing data as billing primary keys, and material codes and department identifiers are extracted from structured inventory data as inventory primary keys. The billing primary keys and the inventory primary keys are matched for equality, and the records that match successfully are horizontally concatenated to obtain a paired dataset. Isolated records that fail to match in the paired dataset are marked with anomaly identifiers and added to the anomaly record table. The billing timestamp and scanning timestamp are read from the paired dataset and a unified collection timestamp is generated according to a preset time alignment rule. The paired dataset is sorted in ascending order based on the unified collection timestamp to obtain an ordered paired sequence. The ordered paired sequence is used to construct a composite index based on the material code and department identifier and written into the time series database to form a time series analysis sample.

4. The three-level library usage behavior analysis method based on a data analysis model according to claim 1, characterized in that, The process of reading inventory values ​​from adjacent time points in the time-series analysis sample and calculating the difference to obtain an inventory change sequence, reading billing values ​​from adjacent time points and calculating the difference to obtain a billing change sequence, and filling the zero values ​​in the inventory change sequence and the billing change sequence according to a preset replacement rule to obtain a corrected change sequence includes: Inventory values ​​at adjacent time nodes are read from the time series analysis sample according to the unified collection timestamp order, and the difference between the subsequent value and the preceding value is calculated to obtain the inventory change. The inventory change is arranged in time order to form an inventory change sequence. Billing values ​​at adjacent time nodes are read from the time series analysis sample according to the unified collection timestamp order, and the difference between the subsequent value and the preceding value is calculated to obtain the billing change. The billing change is arranged in time order to form a billing change sequence. The zero-value position index is obtained by traversing the inventory change sequence and the billing change sequence and detecting the positions where the value is zero. The positive or negative attribute of the value at the same position in another sequence corresponding to the zero-value position index is read to obtain the sign reference value. Based on the sign reference value, the zero value is replaced with the unit value of the corresponding sign according to the preset replacement rule to obtain the corrected inventory change and the corrected billing change. The corrected inventory change and the corrected billing change are assembled to form the corrected change sequence.

5. The three-level library usage behavior analysis method based on a data analysis model according to claim 1, characterized in that, The step of encapsulating the classification label and the grade code according to a preset message structure to form an analysis result data packet and pushing it to the inventory management terminal via a message queue includes: Read the classification label and grade code, and extract the corresponding material code, department identifier and unified collection timestamp from the feature storage table as associated fields. Then, perform field mapping and serialization encoding of the classification label, the grade code and the associated fields according to the preset message structure to form an analysis result data packet. The analysis result data packet is written into a message queue and labeled with message topic and priority attributes to obtain the message body to be pushed. The message queue schedules the message body to be pushed according to the priority attributes and transmits it to the inventory management terminal through the network channel to complete the push.

6. A three-level library usage behavior analysis device based on a data analysis model, characterized in that, The device includes: The sample analysis module is used to collect material billing records within a specified period from the hospital information system and secondary warehouse barcode consumption records from the supply chain management system through a data interface. It performs field parsing and format standardization on the material billing records and the secondary warehouse barcode consumption records to obtain structured billing data and structured inventory data. It performs primary key association on the structured billing data and the structured inventory data according to the material code and department identifier to obtain a paired dataset. It sorts the paired dataset according to the collection timestamp and writes it into the time series database to form a time series analysis sample. The feature processing module is used to read inventory values ​​at adjacent time points from the time series analysis sample and calculate the difference to obtain an inventory change sequence; read billing values ​​at adjacent time points and calculate the difference to obtain a billing change sequence; fill the zero values ​​in the inventory change sequence and the billing change sequence according to a preset replacement rule to obtain a corrected change sequence; perform point-by-point ratio calculation based on the corrected change sequence to obtain a slope sequence; encapsulate the slope sequence and the corresponding symbolic attribute encoding to form a behavioral feature vector and write it into a feature storage table. This includes: reading the corrected billing change and the corrected inventory change corresponding to the same time point from the corrected change sequence. The method involves taking the corrected billing change as the numerator and the corrected inventory change as the denominator, performing a ratio operation to obtain a slope value, and arranging the slope values ​​in chronological order to form a slope sequence. The method also involves reading the positive and negative attributes of the corrected billing change and encoding them as billing symbol identifiers, reading the positive and negative attributes of the corrected inventory change and encoding them as inventory symbol identifiers, combining the billing symbol identifiers and the inventory symbol identifiers to form a symbol attribute code, concatenating each slope value in the slope sequence with its corresponding symbol attribute code according to a preset vector structure to form a behavioral feature vector, and writing the behavioral feature vector into a feature storage table using material codes and department identifiers as index keys. The behavior analysis module is used to read behavior feature vectors from the feature storage table and input them into the behavior classification model to perform vector matching to obtain classification labels. The classification labels and slope sequences are then input into a threshold determination module and compared with preset segmentation threshold conditions to obtain a level code. This includes: reading behavior feature vectors from the feature storage table according to material codes and department identifiers; extracting symbol attribute codes from the behavior feature vectors and inputting them into the behavior classification model to perform rule matching; determining the behavior category and outputting a classification label based on the combination pattern of billing symbol identifiers and inventory symbol identifiers in the symbol attribute codes; extracting a slope sequence from the behavior feature vectors and calculating the mean to obtain an average slope value; inputting the classification label and the average slope value into the threshold determination module; selecting corresponding preset segmentation threshold conditions based on the classification labels; performing an interval comparison between the average slope value and the preset segmentation threshold conditions to determine the interval to which the value belongs and outputting a level code; and encapsulating the classification labels and the level code according to a preset message structure to form an analysis result data packet and pushing it to the inventory management terminal via a message queue.

7. An electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that, When the processor executes the program, it implements the steps of the three-level library behavior analysis method based on the data analysis model as described in any one of claims 1 to 5.

8. A computer-readable storage medium having a computer program stored thereon, characterized in that, When executed by a processor, the computer program implements the steps of the three-level library using the behavior analysis method based on the data analysis model as described in any one of claims 1 to 5.

Citation Information

Patent Citations

  • Hospital comprehensive monitoring analysis method and platform based on artificial intelligence

    CN120412950A

  • Research and application of hospital medicine consumable consumption automatic analysis and prediction algorithm based on AI and big data technology

    CN121709177A