The invention provides an intelligent purchase prediction and
early warning model based on traditional Chinese medicinal materials, and the key points of the technical scheme comprise the steps: S1, collecting historical
prescription data, regional seasonal climate data and
epidemic disease monitoring data of a
medical institution, and constructing an
original data set of multi-
source data fusion; s2, a
disease-syndrome-prescription-medicinal material four-layer
knowledge graph is constructed based on the
traditional Chinese medicine theory, the incidence relation and the dosage compatibility rule among the traditional Chinese medicinal materials are established, and the
knowledge graph comprises a genuine producing area mapping table and a
processing technology conversion relation; s3, performing preprocessing and
feature engineering on the
original data set, extracting
time sequence features, seasonal features and relevance features according to the
knowledge graph, and generating a model training
data set; s4, constructing a
time sequence demand prediction model based on the LSTM neural network, setting a weighted
loss function which comprises a
mean square error term, an out-of-stock penalty term and an excessive stock penalty term, and inputting the model training
data set into the demand prediction model for training, outputting a
traditional Chinese medicine demand prediction result according to the demand prediction model; s5, according to the traditional Chinese medicinal material demand prediction result, the current
inventory data and the special attribute parameters of the traditional Chinese medicinal materials, a dynamic early warning threshold value is calculated, and a third-level
stockout early warning
signal and an intelligent replenishment suggestion are generated; and S6, outputting an early warning result and a replenishment scheme, and dynamically adjusting and optimizing the prediction model according to actual consumption data.