Medicine expiration early warning method and system in medicine inventory management
By integrating multi-source data and advanced prediction models, dynamically assessing drug expiration risks is solved, the problem of single prediction models in the existing technology is solved, and the accuracy and reliability of drug expiration warning is significantly improved, providing a dynamic management mechanism for drug inventory management.
Patent Information
- Application Number
- CN202510196608.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-02-21
- Publication Date
- 2025-06-03
AI Technical Summary
The existing drug expiration warning system prediction model is single, and it is impossible to comprehensively consider the impact of multiple factors such as drug sales trends, inventory changes, and storage environment on the shelf life of the drug, resulting in insufficient accuracy and reliability of the warning results.
Dynamically assess drug expiration risk by integrating multi-source data and advanced predictive models. The specific steps include obtaining basic information of the drug based on the sensor, obtaining the sales quantity, inventory dynamic data and storage environment data of the drug history, building an expiration warning threshold prediction model, and determining whether the drug is about to expire by comprehensively analyzing the first and second predicted expiration warning thresholds.
It significantly improves the accuracy and reliability of drug expiration warnings, can more comprehensively reflect the possibility of drug expiration, provide a dynamic management mechanism for drug inventory, helping managers to flexibly adjust inventory strategies, optimize inventory structure, and avoid losses caused by drug expiration.
Smart Images

Figure CN120087887A_ABST
Abstract
Description
Technical Field
[0001] The present invention belongs to the technical field of drug inventory management, and specifically relates to a method and system for drug expiration warning in drug inventory management. Background Art
[0002] In the modern medical industry, drug inventory management is a key link to ensure the supply and quality of drugs. With the continuous expansion of the pharmaceutical market, the variety and quantity of drugs have increased sharply, and the traditional drug expiration management method has been difficult to meet the modern needs. In the past, drug inventory management mainly relied on manual experience and simple records. Medical staff usually had to track the expiration date of drugs only through memory or paper records. This method not only consumed a large amount of human and time costs, but also was extremely prone to human errors. In addition, the impact of the storage environment on drug quality was often ignored. For example, changes in environmental factors such as temperature and humidity may shorten the actual shelf life of drugs, but traditional management systems often cannot monitor and warn of these changes in a timely manner, resulting in an increased risk of drug expiration.
[0003] In recent years, with the development of Internet of Things, big data and artificial intelligence technologies, drug inventory management has gradually developed towards intelligence and refinement. However, the existing drug expiration warning systems still have limitations, mainly manifested as a single prediction model, which cannot comprehensively consider the impact of multiple factors such as drug sales dynamics, inventory changes, and storage environment on the drug shelf life. For example, when the environment is abnormal, the actual shelf life of drugs may be shortened, but the system fails to adjust the warning threshold in a timely manner, resulting in poor reliability of the warning results. Summary of the Invention
[0004] Aiming at the deficiencies of the prior art, the present invention provides a method and system for drug expiration warning in drug inventory management. By integrating multi-source data and advanced prediction models, it dynamically evaluates the drug expiration risk, solves the problems of single prediction model and lack of consideration of environmental factors in the prior art, and significantly improves the accuracy and reliability of drug expiration warning.
[0005] To achieve the above objectives, the present invention is realized through the following technical solutions: A method for drug expiration warning in drug inventory management, including the following steps: Based on sensors, obtain the basic information of drugs, and perform data transmission and integration on the obtained basic information of drugs; Obtain the daily sales quantity, inventory dynamic data of drugs in history, and the storage environment data of drugs in history. Based on the constructed expiration warning threshold prediction model, obtain the first predicted expiration warning threshold. The inventory dynamic data includes the historical daily warehousing time, historical daily warehousing quantity, historical daily outbound time, historical daily outbound quantity, and historical daily current inventory quantity; Obtain historical drug-related data to obtain the second predicted expiration warning threshold; Comprehensively analyze the first predicted expiration warning threshold and the second predicted expiration warning threshold to obtain a comprehensive expiration warning threshold; Based on the comprehensive expiration warning threshold, determine whether the drug is about to expire.
[0006] Preferably, perform data transmission and integration on the obtained basic information of the drug, which specifically includes the following steps: Send the basic information of the drug collected by the sensor to the central gateway through a wireless transmission protocol; The central gateway integrates and preliminarily processes the data from multiple sensors, assigns a unique identifier to each drug storage unit, and packs the data in a set format, preparing to upload it to the central database; After receiving the data from the central gateway, the central database determines whether the drug is being warehoused for the first time based on the basic information of the drug; If it is the first time to be warehoused, add a new record in the inventory table, recording the warehousing time, warehousing quantity, current inventory quantity, and storage location; If the drug already exists in the inventory table, update the current inventory quantity.
[0007] Preferably, the overall architecture of the expiration warning threshold prediction model adopts a hierarchical structure, including a feature extraction layer, a decision tree layer, and a support vector machine layer, where: The feature extraction layer performs data cleaning and preprocessing on the obtained daily sales quantity, inventory dynamic data, and historical storage environment data of the drug, constructs inventory feature parameters, trend feature index parameters, and environmental stability factors. The inventory feature parameters include the average inventory level and the inventory turnover rate; Integrate the constructed inventory feature parameters, trend feature index parameters, and environmental stability factors to form a comprehensive feature dataset, and determine whether the drug storage management is abnormal based on the comprehensive feature dataset; The decision tree layer constructs multiple decision trees based on random forests; The support vector machine layer uses the output result of each decision tree in the decision tree layer as the input feature of the support vector machine, and combines the original feature vector to construct a high-dimensional feature model; The kernel function of the support vector machine adopts a radial basis kernel function, and its expression is: ; In the formula, is the radial basis kernel function value between and the g-th input sample, the h-th input sample, is the kernel function parameter, and exp is the natural exponential function; Initialize the high-dimensional feature model parameters; Divide the feature dataset into a training set and a test set; Use the training set to train the high-dimensional feature model to obtain an expiration warning threshold prediction model; Use the test set to test the expiration warning threshold prediction model. Based on the test results, evaluate the accuracy performance of the expiration warning threshold prediction model, and determine whether to perform parameter optimization on the expiration warning threshold prediction model according to the accuracy performance evaluation results.
[0008] Preferably, construct multiple decision trees based on random forests, specifically including the following steps: Randomly select a part of the features from the feature dataset output by the feature extraction layer as the candidate features for splitting the current node; Analyze the information gain of each candidate feature, and select the candidate feature with the largest information gain as the splitting feature of the current node; Divide the dataset into two sub-datasets according to the selected splitting feature and the corresponding splitting threshold, and recursively construct the left and right sub-trees until the depth of the tree reaches the maximum depth.
[0009] Preferably, the calculation formula for the average inventory level is: ; In the formula, is the average inventory level of the i-th drug, is the quantity of the i-th drug warehoused for the j-th time, is the quantity of the i-th drug shipped out for the k-th time, m is the number of days within the statistical time period, j is the warehousing batch number, k is the shipping batch number, and i is the drug number; The calculation formula for the inventory turnover rate is: ; In the formula, is the inventory turnover rate of the i-th drug; The calculation formula for the trend feature index is: ; In the formula, is the trend feature index of the i-th drug, is the sales quantity of the i-th drug on the t-th day, and t is the day number; The calculation formula for the environmental stability factor is: ; In the formula, Hw is the environmental stability factor, is the average temperature, is the average humidity, is the standard deviation of temperature, is the standard deviation of humidity, is the temperature reference value, is the humidity reference value, is the weight factor stored in the database, is the weight factor stored in the database.
[0010] Preferably, to evaluate the accuracy performance of the expiration warning threshold prediction model, and determine whether to perform parameter optimization on the expiration warning threshold prediction model according to the evaluation result of the accuracy performance, which specifically includes the following steps: Obtain the model evaluation index data, and based on the model evaluation index data, obtain the accuracy performance evaluation value. The model evaluation index data includes the root mean square error value, the mean absolute error value, and the accuracy rate; Compare the accuracy performance evaluation value with the model accuracy performance threshold stored in the database. If the accuracy performance evaluation value is greater than the model accuracy performance threshold, the model accuracy performance meets the standard and can be used; If the accuracy performance evaluation value is not greater than the model accuracy performance threshold, the model accuracy performance does not meet the standard, and use the grid search method to perform parameter optimization on the expiration warning threshold prediction model; Use the optimized expiration warning threshold prediction model to predict the current inventory drugs, and obtain the first predicted expiration warning threshold of the current inventory drugs; The calculation formula for the accuracy performance evaluation value is: ; In the formula, OPE is the accuracy performance evaluation value, RMSE is the root mean square error, MAE is the mean absolute error, Zq is the accuracy rate, is the weight factor stored in the database, is the weight factor stored in the database, is the weight factor of Zq stored in the database.
[0011] Preferably, judge whether the drug storage management is abnormal based on the comprehensive feature dataset, which specifically includes the following steps: Obtain the inventory feature parameters, trend feature index parameters, and environmental stability factors; Judge whether one of the average inventory level, inventory turnover rate, and trend feature index is not within the set corresponding threshold range: If so, evaluate that the drug storage management is abnormal and perform warning processing; If not, judge whether the environmental stability factor is less than the set environmental stability factor threshold: If not less, evaluate that the drug storage management is abnormal and perform warning processing; If it is less than, perform a comprehensive analysis on the average inventory level, inventory turnover rate, trend characteristic indicators, and environmental stability factors to obtain a comprehensive characteristic index; Based on the comprehensive characteristic index, determine whether it is within the set range of the comprehensive characteristic index threshold: If it is not within the set range of the comprehensive characteristic index threshold, it is determined that the drug storage management is abnormal, and a warning is processed; If it is within the set range of the comprehensive characteristic index threshold, continue to monitor.
[0012] Preferably, the historical drug-related data includes multiple relevant parameters, and the process of obtaining the second predicted expiration warning threshold is as follows: Use Pearson correlation analysis to analyze the correlation coefficients between each relevant parameter and the drug lifespan; Compare the analyzed correlation coefficients with the correlation thresholds stored in the database. If the correlation coefficient is greater than the correlation threshold, select the relevant parameter corresponding to the correlation coefficient and record it as a key parameter; If the correlation coefficient is not greater than the correlation threshold, do not select the relevant parameter corresponding to the correlation coefficient; Record the obtained multiple key parameters as relevant key data; Import the obtained relevant key data into a multiple linear regression model, and use the least squares method to solve the regression coefficients to obtain a predicted expiration warning model; Obtain the current relevant key data, import it into the predicted expiration warning model, and obtain a reference predicted expiration warning threshold; Obtain a comprehensive correction coefficient, and combine it with the reference predicted expiration warning threshold to obtain the second predicted expiration warning threshold.
[0013] Preferably, based on the comprehensive expiration warning threshold, determine whether the drug is about to expire, including the following steps: Based on the shelf life of the drug, determine whether the drug has expired. If it has exceeded the shelf life of the drug, mark the drug as expired and give a warning prompt; If it has not exceeded the shelf life of the drug, obtain the current remaining validity period of the drug, and compare the current remaining validity period with the comprehensive expiration warning threshold: If the current remaining validity period is greater than the comprehensive expiration warning threshold, the drug has not expired, and continue to detect; If the current remaining validity period is not greater than the comprehensive expiration warning threshold, the drug is about to expire, then mark the drug as about to expire and give a warning prompt.
[0014] A drug expiration warning system in drug inventory management, which is applied to the drug expiration warning method in the above-mentioned drug inventory management, includes a data acquisition module, a data communication and transmission module, a first predicted expiration warning threshold acquisition module, a second predicted expiration warning threshold acquisition module, a drug expiration judgment module, and a data repository, where: The data acquisition module is used to obtain the basic information of drugs based on sensors, and perform data transmission and integration on the obtained basic information of drugs. The data communication and transmission module is used to receive the basic information of drugs obtained by the data acquisition module. The data communication and transmission module is respectively connected to the data acquisition module, the first predicted expiration warning threshold acquisition module, the second predicted expiration warning threshold acquisition module, the drug expiration judgment module, and the data repository. The first predicted expiration warning threshold acquisition module is used to obtain the daily sales quantity, inventory dynamic data of drug history, and storage environment data of drug history, and obtain the first predicted expiration warning threshold based on the constructed expiration warning threshold prediction model. The second predicted expiration warning threshold acquisition module is used to obtain historical drug-related data and obtain the second predicted expiration warning threshold. The drug expiration judgment module is used to comprehensively analyze the first predicted expiration warning threshold and the second predicted expiration warning threshold to obtain a comprehensive expiration warning threshold. Based on the comprehensive expiration warning threshold, judge whether the drug is about to expire. It is also used to send the judgment result of whether the drug is about to expire to the data repository through the data communication and transmission module. The data repository is used to store historical drug-related data, the daily sales quantity of drug history, and inventory dynamic data.
[0015] The present invention has the following beneficial effects: The present invention can collect information in real time and accurately, quickly summarize scattered data, is applicable to large warehouse management, facilitates inventory checking and querying, reflects the inventory status in real time, and combines the results of multiple models and environmental factors for prediction and correction, which is more reliable and accurate than single prediction, can more comprehensively reflect the possibility of drug expiration, provides a dynamic management mechanism for drug inventory, no longer simply relies on the shelf life, can timely and accurately reflect the expiration risk of drugs according to the actual situation, helps managers flexibly adjust the inventory strategy, optimize the inventory structure, improve the scientificity and refinement of inventory management, effectively avoid losses caused by drug expiration, and at the same time ensure the reasonable use of drug resources within the drug validity period. BRIEF DESCRIPTION OF THE DRAWINGS
[0016] Figure 1 It is a flow schematic diagram of the method of the present invention; Figure 2This is a schematic diagram of the modules of the system of the present invention. Specific implementation manners
[0017] The following clearly and completely describes the technical solutions in the embodiments of the present invention.
[0018] Embodiment 1: As Figure 1 shown, a method for warning of drug expiration in drug inventory management includes the following steps: obtaining the basic information of drugs based on sensors, and performing data transmission and integration on the obtained basic information of drugs.
[0019] The basic information of drugs collected by sensors is sent to the central gateway through a wireless transmission protocol; the central gateway integrates and preliminarily processes the data from multiple sensors, assigns a unique identifier to each drug storage unit, and packs the data in a set format for uploading to the central database; after receiving the data from the central gateway, the central database determines whether the drug is for the first time in storage according to the basic information of the drug; if it is for the first time in storage, a new record is added to the inventory table, recording the storage time, the storage quantity, the current inventory quantity, and the storage location; if the drug already exists in the inventory table, the current inventory quantity is updated.
[0020] The basic information of drugs includes drug information and environmental parameter data. By obtaining the drug information and environmental parameter data of drugs through sensors, real-time and accurate collection can be achieved, environmental factors affecting drug quality can be detected in a timely manner, and the effectiveness and safety of drugs can be guaranteed. Using the wireless transmission protocol and the central gateway, efficient data transmission and integration are realized, scattered information is quickly summarized, and it is applicable to large warehouse management. Assigning a unique identifier to the drug storage unit and standardizing the packed data make data management more standardized and facilitate inventory checking and querying. The central database accurately adds or updates inventory records according to the basic information of drugs, ensures the accuracy of inventory data, reflects the inventory status in real time, and provides key data support for expiration warning.
[0021] Obtain the daily sales quantity, inventory dynamic data of drug history, and storage environment data of drug history, and based on the constructed expiration warning threshold prediction model, obtain the first predicted expiration warning threshold. The inventory dynamic data includes the historical same-day storage time, the historical same-day storage quantity, the historical same-day outbound time, the historical same-day outbound quantity, and the historical same-day current inventory quantity.
[0022] The overall architecture of the expiration warning threshold prediction model adopts a hierarchical structure, including a feature extraction layer, a decision tree layer, and a support vector machine layer, where: the feature extraction layer performs data cleaning and preprocessing on the obtained daily sales quantity, inventory dynamic data, and storage environment data of drug history, constructs inventory feature parameters, trend feature index parameters, and environmental stability factors, and the inventory feature parameters include the average inventory level and the inventory turnover rate.
[0023] Integrate the constructed inventory characteristic parameters, trend characteristic index parameters, and environmental stability factors to form a comprehensive characteristic dataset, and determine whether the drug storage management is abnormal based on the comprehensive characteristic dataset; the decision tree layer constructs multiple decision trees based on the random forest; the support vector machine layer uses the output results of each decision tree in the decision tree layer as the input features of the support vector machine, and combines with the original feature vector to construct a high-dimensional feature model.
[0024] The kernel function of the support vector machine adopts the radial basis kernel function, and its expression is: ; In the formula, is the radial basis kernel function value between and the g-th input sample, the h-th input sample, is the kernel function parameter.
[0025] Initialize the high-dimensional feature model parameters; divide the characteristic dataset into a training set and a test set; use the training set to train the high-dimensional feature model to obtain an expiration warning threshold prediction model; use the test set to test the expiration warning threshold prediction model, and based on the test results, evaluate the accuracy performance of the expiration warning threshold prediction model, and determine whether to perform parameter optimization on the expiration warning threshold prediction model according to the accuracy performance evaluation results.
[0026] Take multiple input vectors (including multiple samples) and their corresponding labels (for example, the expiration warning threshold) as the training set, and use the support vector machine algorithm for training. Initialize the parameters of the support vector machine, such as the Lagrange multiplier, etc. Minimize the objective function through an optimization algorithm (such as the sequential minimal optimization algorithm SMO).
[0027] Randomly select a part of the features from the feature dataset output by the feature extraction layer as the candidate features for splitting the current node; analyze the information gain of each candidate feature, and select the candidate feature with the largest information gain as the splitting feature of the current node; divide the dataset into two sub-datasets according to the selected splitting feature and the corresponding splitting threshold, and recursively construct the left and right subtrees until the depth of the tree reaches the maximum depth.
[0028] The calculation formula for the average inventory level is: ; In the formula, is the average inventory level of the i-th drug, is the quantity of the i-th drug's j-th warehousing, is the quantity of the i-th drug out of the warehouse for the k-th time, m is the number of days in the statistical time period, j is the inbound batch number, k is the outbound batch number, and i is the drug number.
[0029] The calculation formula for inventory turnover rate is: ; In the formula, is the inventory turnover rate of the i-th drug.
[0030] The calculation formula for the trend feature index is: ; In the formula, is the trend feature index of the i-th drug, is the sales quantity of the i-th drug on the t-th day, and t is the day number.
[0031] The calculation formula for the environmental stability factor is: ; In the formula, Hw is the environmental stability factor, is the average temperature, is the average humidity, is the standard deviation of temperature, is the standard deviation of humidity, is the temperature reference value, is the humidity reference value, is stored in the database weight factor of, is stored in the database weight factor of.
[0032] In this embodiment, each weight factor is obtained from the database. A mapping set of historical calculated parameters and their corresponding weight factors is established based on historical data to obtain the current weight factor.
[0033] Obtain model evaluation index data. Based on the model evaluation index data, obtain the accurate performance evaluation value. The model evaluation index data includes root mean square error value, mean absolute error value, and accuracy rate; compare the accurate performance evaluation value with the model accurate performance threshold stored in the database. If the accurate performance evaluation value is greater than the model accurate performance threshold, the model accurate performance meets the standard and can be used; if the accurate performance evaluation value is not greater than the model accurate performance threshold, the model accurate performance does not meet the standard, and the grid search method is used to optimize the parameters of the expiration warning threshold prediction model; use the optimized expiration warning threshold prediction model to predict the current inventory drugs to obtain the first predicted expiration warning threshold of the current inventory drugs.
[0034] The calculation formula for the accurate performance evaluation value is: ; In the formula, OPE is the accurate performance evaluation value, RMSE is the root mean square error, MAE is the mean absolute error, Zq is the accuracy rate, is the weight factor of stored in the database, is the weight factor of stored in the database, is the weight factor of Zq stored in the database.
[0035] The output result of each decision tree in the decision tree layer is used as the input feature of the support vector machine. The input features of the decision tree include the average inventory level, inventory turnover rate, trend feature index parameters, and environmental stability factor. Therefore, these parameters indirectly become the input features of the support vector machine. At the same time, combined with the original feature vector including the average inventory level, inventory turnover rate, trend feature index parameters, and environmental stability factor, they are jointly used as the input of the support vector machine.
[0036] The support vector machine adopts a radial basis kernel function. Through this kernel function, the input features are mapped to a high-dimensional space to construct a high-dimensional feature model, enabling better processing and analysis of data in the high-dimensional space to achieve accurate prediction of the drug expiration warning threshold.
[0037] The average inventory level reflects the average storage volume of drugs over a period of time, helping to understand the overall scale and fluctuations of the inventory; the inventory turnover rate measures the turnover speed of the inventory, which can help judge the sales popularity and inventory management efficiency of drugs. These two parameters provide quantitative indicators for inventory management.
[0038] By calculating the trend of sales volume, the future sales trend can be predicted, making inventory management more forward-looking, preparing for replenishment or promotion in advance, and avoiding inventory backlogs or shortages. Considering the mean and standard deviation of temperature and humidity comprehensively, the impact of the storage environment on drug quality is quantified, environmental risks are detected in a timely manner, drug quality is guaranteed, and drug expiration in advance due to environmental problems is prevented.
[0039] Randomly selecting candidate features and splitting features can reduce the risk of overfitting, making the model more generalizable. At the same time, the combination of multiple decision trees enhances the stability and accuracy of the model. Using the decision tree output result and the original feature vector to construct a high-dimensional feature model can fully explore the relationship between data features and improve the prediction ability of the model. The radial basis kernel function can better handle nonlinear problems and improve the adaptability of the model.
[0040] Specifically, the process of the expiration warning threshold prediction model obtaining the first predicted expiration warning threshold is as follows: The feature extraction layer obtains relevant features, including inventory feature parameters (such as average inventory level, inventory turnover rate), trend feature index parameters (such as sales trend index), and environmental stability factors (such as fluctuations in temperature and humidity).
[0041] The decision tree layer randomly selects a part of the features from the feature set output by the feature extraction layer. This set contains inventory feature parameters (such as average inventory level, inventory turnover rate), trend feature index parameters (such as sales trend index), and environmental stability factors (such as fluctuations in temperature and humidity). These features are extracted from the historical data of the drug and reflect different aspects of the drug inventory and storage environment.
[0042] For each candidate feature, its information gain is calculated. Information gain is used to measure the importance of the feature for partitioning the data. Through the calculation of entropy and conditional entropy, information gain can help determine the ability of the feature to distinguish whether the drug is close to expiration. Entropy represents the uncertainty of the data, and conditional entropy represents the uncertainty of the data given a certain feature. For example, for inventory feature parameters, the data set is partitioned according to different inventory levels, and the entropy difference before and after the partition is calculated to obtain the information gain of the inventory feature. For environmental stability factors, the data set is partitioned according to different ranges of the storage environment (such as temperature range, humidity range), and the information gain is calculated.
[0043] Compare the information gains of different candidate features, and select the feature with the largest information gain as the splitting feature of the current node. This feature will best distinguish drugs with different expiration risks. For example, if the information gain of the environmental stability factor is the largest, then the data of the current node will be partitioned into different sub-data sets according to different situations of the storage environment (such as temperature, humidity).
[0044] Compare the information gains of different candidate features, and select the feature with the largest information gain as the splitting feature of the current node. This feature will best distinguish drugs with different expiration risks. For example, if the information gain of the environmental stability factor is the largest, then the data of the current node will be partitioned into different sub-data sets according to different situations of the storage environment (such as temperature, humidity).
[0045] The dataset is divided into left and right sub-datasets according to the selected splitting feature and the corresponding splitting threshold. Then, the above steps are recursively executed on the left and right sub-datasets until the maximum tree depth is reached or other stopping conditions are met (such as too few samples in the sub-dataset, information gain less than a certain threshold, etc.), and a complete decision tree is constructed. For example, if temperature is used as the splitting feature, the data with temperature lower than a certain threshold will be divided into the left subtree, and the data with temperature higher than the threshold will be divided into the right subtree. Then, continue to select the splitting feature and construct the subtrees for the left and right subtrees, and finally form a decision tree structure that can distinguish the drug expiration risk according to different features.
[0046] The support vector machine layer takes the output results of each decision tree in the decision tree layer as the input features of the support vector machine. The outputs of these decision trees are a hierarchical judgment result of the drug expiration risk. Integrate it with the original inventory feature parameters, trend feature index parameters, and environmental stability factors to form the input feature vector of the support vector machine. Such integration combines the decision-making information of the decision tree and the original feature information, provides richer information for the support vector machine, and helps to better predict the expiration warning threshold.
[0047] The radial basis kernel function is used to map the input feature vector to a high-dimensional space, so that the data that is linearly inseparable in the low-dimensional space becomes separable in the high-dimensional space. For example, for two input samples, one sample contains inventory features, trend features, environmental features, and the output of the decision tree, and the other sample also contains corresponding information. Calculate their similarity through the kernel function, and then map them to a high-dimensional space. It is easier to find a hyperplane in the high-dimensional space to distinguish samples with different expiration risks.
[0048] According to the above input features and kernel function, a high-dimensional feature model is constructed. The model is trained through optimization algorithms (such as gradient descent, SMO algorithm, etc.) so that the model learns the relationship between the input features and the drug expiration warning threshold. During the training process, continuously adjust the parameters of the model (such as the parameters of the kernel function etc.), minimize the loss function, and let the model find the optimal decision boundary to distinguish samples with different expiration risks.
[0049] When new inventory feature parameters, trend feature index parameters, and environmental stability factors are input, they are processed through the decision tree layer to obtain the output results of the decision tree, and then used as the input of the support vector machine together with these features. After being processed by the support vector machine layer, the final expiration warning threshold prediction result is obtained. This result can help judge whether the drug is about to expire and the expiration time under the current inventory and storage environment conditions, providing a decision-making basis for inventory management.
[0050] In summary, the decision tree layer uses feature information to partition and classify data, extracting hierarchical information from the data. The support vector machine layer combines this information with the original features, maps them to a high-dimensional space through a kernel function, constructs a high-dimensional feature model for training and prediction, and jointly achieves accurate prediction of the drug expiration warning threshold. In this process, inventory feature parameters, trend feature index parameters, and environmental stability factors run through the whole process, providing an important information source and decision-making basis for the entire prediction model.
[0051] Obtain historical drug-related data to get the second predicted expiration warning threshold.
[0052] The historical drug-related data includes multiple relevant parameters. The process of obtaining the second predicted expiration warning threshold is as follows: Use Pearson correlation analysis to analyze the correlation coefficients between each relevant parameter and the drug lifespan; Compare the obtained correlation coefficients with the correlation thresholds stored in the database. If the correlation coefficient is greater than the correlation threshold, select the relevant parameter corresponding to this correlation coefficient and record it as a key parameter; If the correlation coefficient is not greater than the correlation threshold, do not select the relevant parameter corresponding to this correlation coefficient; Record the obtained multiple key parameters as relevant key data; Import the obtained relevant key data into a multiple linear regression model, use the least squares method to solve the regression coefficients, and obtain a predicted expiration warning model; Obtain the current relevant key data, import it into the predicted expiration warning model, and obtain a reference predicted expiration warning threshold; Obtain a comprehensive correction coefficient, and combine it with the reference predicted expiration warning threshold to obtain the second predicted expiration warning threshold.
[0053] The relevant parameters include parameters related to the storage environment, including but not limited to temperature and humidity data, and may also include parameters related to the lifespan of popular products such as drug batch information and drug usage frequency.
[0054] Obtain the comprehensive correction coefficient, which specifically includes the following steps: Obtain comprehensive correction data, which includes average inventory level, inventory turnover rate, environmental stability factor, and light intensity; When and only when the average inventory level, inventory turnover rate, and light intensity are all within the corresponding set threshold ranges, and the environmental stability factor is less than the set stability threshold, the comprehensive correction coefficient is 1.
[0055] Otherwise, obtain the correction coefficient matching data set stored in the database. The correction matching data set includes several correction coefficient matching data, and the correction coefficient matching data includes matching temperature and matching humidity; Obtain the storage temperature and storage humidity of the drug in the current environment, compare the storage temperature and storage humidity with the matching temperature and matching humidity, and obtain the correction matching coefficient; Determine the comprehensive correction coefficient corresponding to the correction matching data corresponding to the smallest correction matching coefficient stored in the database.
[0056] The calculation formula for the correction matching coefficient is: ; In the formula, is the correction matching coefficient, CW is the storage temperature, CS is the storage humidity, PW is the matching temperature, and PS is the matching humidity. is the weight factor of stored in the database, is the weight factor of stored in the database, and e is the natural constant.
[0057] The calculation formula of the regression model is: ; In the formula, Y is the reference prediction expiration warning threshold, is the first key parameter, is the second key parameter, is the s-th key parameter, and s is the key parameter number. is the intercept, is the slope of the first key parameter, is the slope of the second key parameter, is the slope of the s-th key parameter.
[0058] The calculation formula of the second prediction expiration warning threshold is: ; In the formula, is the second prediction expiration warning threshold, and Xz is the comprehensive correction coefficient.
[0059] Based on the comprehensive feature dataset, determine whether the drug storage management is abnormal, which specifically includes the following steps: obtain the inventory feature parameters, trend feature index parameters, and environmental stability factor; determine whether any of the average inventory level, inventory turnover rate, and trend feature index is not within the set corresponding threshold range: if so, evaluate that the drug storage management is abnormal and perform warning processing.
[0060] If not, determine whether the environmental stability factor is less than the set environmental stability factor threshold: if not less, evaluate that the drug storage management is abnormal and perform warning processing; if less, conduct a comprehensive analysis of the average inventory level, inventory turnover rate, trend feature index, and environmental stability factor to obtain the comprehensive feature index.
[0061] Based on the comprehensive feature index, determine whether it is within the set comprehensive feature index threshold range: if not within the set comprehensive feature index threshold range, evaluate that the drug storage management is abnormal and perform warning processing; if within the set comprehensive feature index threshold range, continue to monitor.
[0062] The calculation formula of the comprehensive feature index is: ; In the formula, is the comprehensive characteristic index, is 's weight factor, of 's weight factor, of 's weight factor, of 's weight factor.
[0063] The multiple linear regression model can consider the influence of multiple key parameters on the drug shelf life, determine the regression coefficients corresponding to each parameter, quantify the degree of action of each parameter on the drug expiration time, and provide an effective mathematical model for accurately predicting the drug expiration warning time based on the current key parameters.
[0064] Based on the actual current environmental parameters, it provides a preliminary reference value based on real-time data for predicting the drug expiration time, enabling inventory managers to conduct a preliminary assessment of the drug expiration risk in combination with the actual situation. It clarifies the ideal state of drug storage and provides a benchmark for judging other complex situations. When the ideal state is not met, by comparing with the dataset of correction coefficients in the database to obtain the comprehensive correction coefficient, it can fully consider the diversity and complexity of the actual storage environment, give more accurate correction coefficients for different storage conditions, and evaluate the drug storage status more accurately.
[0065] By comprehensively analyzing the average inventory level, inventory turnover rate, trend characteristic indicators, and environmental stability factors, the comprehensive characteristic index is obtained. Then, based on this index, it is judged whether it is abnormal, considering the interaction of various factors, and accurately judging the drug storage management status. Only when the comprehensive characteristic index is within the set threshold range will the monitoring continue, improving the scientificity and reliability of the monitoring, promptly discovering abnormalities and giving warnings, and ensuring the safety of drug storage.
[0066] The second predicted expiration warning threshold combines the preliminary prediction based on the model and the correction of environmental factors, improving the accuracy of drug expiration warning, helping inventory managers arrange inventory more scientifically, avoiding losses caused by drug expiration, and at the same time ensuring the reasonable use of drug resources within the drug validity period.
[0067] By comprehensively analyzing the first predicted expiration warning threshold and the second predicted expiration warning threshold, the comprehensive expiration warning threshold is obtained; based on the comprehensive expiration warning threshold, it is judged whether the drug is about to expire.
[0068] Based on the shelf life of the drug, determine whether the drug has expired. If the drug has exceeded its shelf life, mark the drug as expired and issue a warning prompt; if the drug has not exceeded its shelf life, obtain the current remaining validity period of the drug, and compare the current remaining validity period with the comprehensive expiration warning threshold: if the current remaining validity period is greater than the comprehensive expiration warning threshold, the drug has not expired and continue the detection; if the current remaining validity period is not greater than the comprehensive expiration warning threshold, the drug is about to expire, then mark the drug as about to expire and issue a warning prompt.
[0069] The calculation formula for the comprehensive expiration warning threshold is: ; In the formula, is the comprehensive expiration warning threshold, is the first predicted expiration warning threshold, is the weight factor stored in the database, is the weight factor stored in the database.
[0070] By calculating the comprehensive expiration warning threshold through the formula, it combines the prediction results obtained from different models or methods and utilizes their respective advantages. It can more comprehensively reflect the possibility of drug expiration and is more reliable and accurate than a single prediction result.
[0071] Based on the comparison method of the comprehensive threshold and the remaining validity period, it provides a dynamic management mechanism for drug inventory. The comprehensive expiration warning threshold predicted by combining multiple factors can timely and accurately reflect the expiration risk of drugs according to the changes in the actual situation, helping managers flexibly adjust the inventory strategy, optimize the inventory structure, and improve the scientific and refined level of inventory management.
[0072] Embodiment 2: As Figure 2 shown, a drug expiration warning system in drug inventory management includes a data acquisition module, a data communication and transmission module, a first predicted expiration warning threshold acquisition module, a second predicted expiration warning threshold acquisition module, a drug expiration judgment module, and a data storage repository, where: The data acquisition module is used to acquire the basic information of the drug based on the sensor and perform data transmission and integration on the acquired basic information of the drug; The data communication and transmission module is used to receive the basic information of the drug acquired by the data acquisition module. The data communication and transmission module is respectively connected to the data acquisition module, the first predicted expiration warning threshold acquisition module, the second predicted expiration warning threshold acquisition module, the drug expiration judgment module, and the data storage repository; The first predicted expiration warning threshold acquisition module is used to acquire the daily sales quantity, inventory dynamic data of the drug history, and the storage environment data of the drug history, and obtain the first predicted expiration warning threshold based on the constructed expiration warning threshold prediction model; The second predicted expiration warning threshold acquisition module is used to acquire the historical drug-related data and obtain the second predicted expiration warning threshold; The drug expiration judgment module is used to comprehensively analyze the first predicted expiration warning threshold and the second predicted expiration warning threshold to obtain the comprehensive expiration warning threshold; Based on the comprehensive expiration warning threshold, judge whether the drug is about to expire; It is also used to send the judgment result of whether the drug is about to expire to the data repository through the data communication transmission module; The data repository is used to store the historical drug-related data, the daily sales quantity of the drug history, and the inventory dynamic data.
Claims
1. A drug expiration warning method in drug inventory management, characterized in that: The following steps are involved: Obtain basic information of drugs based on sensors, and transmit and integrate the acquired basic information of drugs; Obtain the daily sales quantity, inventory dynamic data and storage environment data of the drug history, and obtain the first predicted expiration warning threshold based on the constructed expiration warning threshold prediction model. The inventory dynamic data includes the historical day's entry time, the historical day's entry quantity, the historical day's exit time, the historical day's exit quantity and the historical day's current inventory quantity; Obtain historical drug-related data to obtain a second predicted expiration warning threshold; Comprehensively analyzing the first predicted expiration warning threshold and the second predicted expiration warning threshold to obtain a comprehensive expiration warning threshold; Based on the comprehensive expiration warning threshold, determine whether the drug is about to expire.
2. A method for early warning of drug expiration in drug inventory management according to claim 1, characterized in that: The data transmission and integration of the basic information of the acquired drugs includes the following steps: The basic information of the drug collected by the sensor is sent to the central gateway via a wireless transmission protocol; The central gateway integrates and preliminarily processes the data from multiple sensors, assigns a unique identifier to each drug storage unit, and packages the data in a set format, ready for upload to the central database; After receiving the data from the central gateway, the central database determines whether the drug is in the warehouse for the first time based on the basic information of the drug; If it is the first time to enter the warehouse, a new record will be added to the inventory table to record the entry time, entry quantity, current inventory quantity, and storage location; If the drug already exists in the inventory table, update the current inventory quantity.
3. The method for early warning of drug expiration in drug inventory management according to claim 1, characterized in that: The overall architecture of the overdue warning threshold prediction model adopts a hierarchical structure, including feature extraction layer, decision tree layer, and support vector machine layer, among which: The feature extraction layer cleans and preprocesses the daily sales quantity, inventory dynamic data, and historical storage environment data of the drug, and constructs inventory feature parameters, trend feature indicator parameters, and environmental stability factors. The inventory feature parameters include average inventory level and inventory turnover rate. Integrate the constructed inventory characteristic parameters, trend characteristic indicator parameters and environmental stability factors to form a comprehensive characteristic data set, and judge whether the drug storage management is abnormal based on the comprehensive characteristic data set; The decision tree layer builds multiple decision trees based on random forests; The support vector machine layer uses the output of each decision tree in the decision tree layer as the input feature of the support vector machine, and combines it with the original feature vector to build a high-dimensional feature model; The kernel function of the support vector machine adopts the radial basis kernel function, and its expression is: ; In the formula, for and The radial basis kernel function value between is the g-th input sample, is the hth input sample, is the kernel function parameter, exp is the natural exponential function; Initialize the high-dimensional feature model parameters; Divide the feature dataset into training set and test set; Use the training set to train the high-dimensional feature model to obtain the overdue warning threshold prediction model; The overdue warning threshold prediction model is tested using the test set. Based on the test results, the accuracy of the overdue warning threshold prediction model is evaluated. According to the accuracy performance evaluation results, it is determined whether to perform parameter optimization for the overdue warning threshold prediction model.
4. The method for early warning of drug expiration in drug inventory management according to claim 3, characterized in that: Building multiple decision trees based on random forests includes the following steps: Randomly select a part of the features from the feature data set output by the feature extraction layer as candidate features for splitting the current node; Analyze and obtain the information gain of each candidate feature, and select the candidate feature with the largest information gain as the split feature of the current node; The dataset is divided into two sub-datasets according to the selected split features and the corresponding split threshold, and the left and right subtrees are recursively constructed until the depth of the tree reaches the maximum depth.
5. The method for early warning of drug expiration in drug inventory management according to claim 3, characterized in that: The formula for calculating the average inventory level is: ; In the formula, is the average inventory level of the ith drug, is the quantity of the i-th drug entering the warehouse for the jth time, is the quantity of the i-th drug shipped out for the kth time, m is the number of days in the statistical time period, j is the incoming batch number, k is the outgoing batch number, and i is the drug number; The formula for calculating inventory turnover ratio is: ; In the formula, is the inventory turnover rate of the ith drug; The calculation formula of the trend characteristic indicator is: ; In the formula, is the trend characteristic index of the i-th drug, is the sales quantity of the i-th drug on the t-th day, where t is the day number; The calculation formula of environmental stability factor is: ; Where Hw is the environmental stability factor, is the average temperature, is the average humidity value, is the temperature standard deviation, is the humidity standard deviation, is the temperature reference value, is the humidity reference value, Stored in the database The weight factor of Stored in the database The weight factor of .
6. The method for early warning of drug expiration in drug inventory management according to claim 3, characterized in that: Evaluate the accuracy of the overdue warning threshold prediction model, and determine whether to optimize the parameters of the overdue warning threshold prediction model according to the accuracy performance evaluation result, which specifically includes the following steps: Obtain model evaluation index data, and obtain accurate performance evaluation values based on the model evaluation index data. The model evaluation index data includes root mean square error value, mean absolute error value, and accuracy rate; The accuracy performance evaluation value is compared with the model accuracy performance threshold stored in the database. If the accuracy performance evaluation value is greater than the model accuracy performance threshold, the model accuracy performance meets the standard and can be used; If the accuracy performance evaluation value is not greater than the model accuracy performance threshold, the model accuracy performance does not meet the standard, and the grid search method is used to optimize the parameters of the overdue warning threshold prediction model; Using the optimized expiration warning threshold prediction model, the current inventory drugs are predicted to obtain the first predicted expiration warning threshold of the current inventory drugs; The calculation formula for the accurate performance evaluation value is: ; Where OPE is the accuracy performance evaluation value, RMSE is the root mean square error, MAE is the mean absolute error, Zq is the accuracy, Stored in the database The weight factor of Stored in the database The weight factor of is the weight factor of Zq stored in the database.
7. The method for early warning of drug expiration in drug inventory management according to claim 3, characterized in that: Based on the comprehensive feature data set, it is determined whether the drug storage management is abnormal, which specifically includes the following steps: Obtain inventory characteristic parameters, trend characteristic indicator parameters and environmental stability factors; Determine whether there is an average inventory level, inventory turnover rate, or trend characteristic indicator that is not within the corresponding set threshold range: If there is, the drug storage management is assessed as abnormal and early warning is carried out; If it does not exist, determine whether the environmental stability factor is less than the set environmental stability factor threshold: If it is not less than, the drug storage management is assessed as abnormal and an early warning is carried out; If it is less than, then the average inventory level, inventory turnover rate, trend characteristic index and environmental stability factor are comprehensively analyzed to obtain the comprehensive characteristic index; Based on the comprehensive feature index, determine whether it is within the set comprehensive feature index threshold range: If it is not within the set comprehensive characteristic index threshold range, the drug storage management is assessed as abnormal and an early warning is carried out; If it is within the set comprehensive characteristic index threshold range, continue monitoring.
8. The method for early warning of drug expiration in drug inventory management according to claim 3, characterized in that: The historical drug-related data contains multiple related parameters, and the process of obtaining the second predicted expiration warning threshold is as follows: Pearson correlation was used to analyze the correlation coefficient between each relevant parameter and drug lifespan; The correlation coefficient obtained by the analysis is compared with the correlation threshold stored in the database. If the correlation coefficient is greater than the correlation threshold, the relevant parameter corresponding to the correlation coefficient is selected and recorded as the key parameter; If the correlation coefficient is not greater than the correlation threshold, the correlation parameter corresponding to the correlation coefficient is not selected; Record the obtained multiple key parameters as relevant key data; Import the obtained relevant key data into the multivariate linear regression model, use the least square method to solve the regression coefficient, and obtain the prediction expiration warning model; Obtain current relevant key data, import it into the forecast expiration warning model, and obtain the reference forecast expiration warning threshold; The comprehensive correction coefficient is obtained, and combined with the reference prediction expiration warning threshold, a second prediction expiration warning threshold is obtained.
9. The method for early warning of drug expiration in drug inventory management according to claim 1, characterized in that: Based on the comprehensive expiration warning threshold, judging whether the drug is about to expire includes the following steps: Based on the shelf life of the drug, determine whether the drug has expired. If the drug has exceeded the shelf life, mark the drug as expired and issue an early warning prompt; If the shelf life of the drug has not expired, the current remaining validity period of the drug is obtained and compared with the comprehensive expiration warning threshold: If the current remaining validity period is greater than the comprehensive expiration warning threshold, the drug is not expired and testing continues; If the current remaining validity period is not greater than the comprehensive expiration warning threshold, the drug is about to expire, and the drug is marked as about to expire, and a warning prompt is issued.
10. A drug expiration warning system in drug inventory management, applied to a drug expiration warning method in drug inventory management as claimed in any one of claims 1 to 9, characterized in that: It includes a data acquisition module, a data communication transmission module, a first predicted expiration warning threshold acquisition module, a second predicted expiration warning threshold acquisition module, a drug expiration judgment module and a data storage library, wherein: A data acquisition module, used to acquire basic information of drugs based on sensors, and to transmit and integrate the acquired basic information of drugs; A data communication transmission module, used for receiving the basic information of the medicine acquired by the data acquisition module, the data communication transmission module is respectively connected with the data acquisition module, the first predicted expiration warning threshold acquisition module, the second predicted expiration warning threshold acquisition module, the medicine expiration judgment module and the data storage library; A first predicted expiration warning threshold acquisition module is used to obtain the daily sales quantity, inventory dynamic data and storage environment data of the drug history, and obtain the first predicted expiration warning threshold based on the constructed expiration warning threshold prediction model; A second predicted expiration warning threshold acquisition module, used to acquire historical drug-related data to obtain a second predicted expiration warning threshold; A drug expiration judgment module, used for comprehensively analyzing the first predicted expiration warning threshold and the second predicted expiration warning threshold to obtain a comprehensive expiration warning threshold; Determine whether a drug is about to expire based on a comprehensive expiration warning threshold; It is also used to send the judgment result of whether the medicine is about to expire to the data storage library through the data communication transmission module; Data repository for storing historical drug related data, daily sales quantity of drug history, and inventory dynamics data.
Citation Information
Cited By
Hospital comprehensive monitoring analysis method and platform based on artificial intelligence
CN120412950A
Method for predicting stability of anti-tumor drug tablets based on multi-source data fusion
CN120954758A
An anti-tumor tablet stability prediction method based on multi-source data fusion
CN120954758B
Differential early warning pushing method and system based on types of chemical reagents
CN121810187A
A differential early warning pushing method and system based on differences between chemical reagent categories
CN121810187B