Intelligent inventory dynamic optimization method and system based on AI prediction

By constructing a time-series dynamic directed graph and multi-layer graph attention propagation, and combining the LSTM model with the Heckman two-stage model, the problems of low demand forecast accuracy and stockout risk in the apparel industry's inventory management are solved, achieving efficient inventory optimization and risk constraints, and improving the supply chain's strategy optimization capabilities.

CN122175504APending Publication Date: 2026-06-09GUANGZHOU MEICHUANG SHANGYI GARMENT TECH CO LTD

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
GUANGZHOU MEICHUANG SHANGYI GARMENT TECH CO LTD
Filing Date
2026-03-03
Publication Date
2026-06-09

AI Technical Summary

Technical Problem

The apparel industry faces challenges in inventory management, including low accuracy in demand forecasting, widespread stockouts, irrational inventory allocation due to independent handling of supply chain network nodes, and a lack of effective risk constraints on replenishment decisions.

Method used

By constructing a time-series dynamic directed graph, performing multi-layer graph attention propagation, extracting inventory fluctuation and demand trend characteristics, using a long short-term memory network model and a Heckman two-stage model to correct demand forecasts, setting stockout risk constraints, and solving for the optimal replenishment quantity.

Benefits of technology

It enables highly accurate forecasting of future demand, reduces the risk of stockouts, improves inventory turnover efficiency, and enhances the ability to optimize supply chain strategies.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122175504A_ABST
    Figure CN122175504A_ABST
Patent Text Reader

Abstract

The application relates to the technical field of inventory strategy optimization, in particular to an intelligent inventory dynamic optimization method and system based on AI prediction, which comprises the following steps: collecting inventory decision data and preprocessing the inventory decision data; based on the preprocessed inventory decision data, a feature vector reflecting inventory fluctuation and demand trend is extracted through an inventory pressure conduction learning method; based on the feature vector, a long short-term memory network model is used to generate a future demand prediction value, an advance period demand distribution parameter is calculated according to the future demand prediction value, a Heckman two-stage model is used to correct the future demand prediction value, and a corrected advance period demand distribution parameter is generated based on the corrected future demand prediction value; and based on the corrected advance period demand distribution parameter, an out-of-stock event is constructed, and an out-of-stock probability is calculated. The application accurately extracts topological conduction features reflecting the inventory pressure conduction of the whole network by constructing a time sequence dynamic directed graph and performing multi-layer graph attention propagation.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of inventory strategy optimization technology, specifically to an intelligent inventory dynamic optimization method and system based on AI prediction. Background Technology

[0002] As a typical fashion-driven retail industry, the apparel industry faces more complex challenges in inventory management than other sectors. Firstly, traditional demand forecasting methods struggle to effectively capture the non-linear patterns of apparel sales, resulting in low forecast accuracy. Secondly, stockouts are common in the apparel industry; when goods are out of stock, sales data is truncated, and historical demand data fails to reflect the true potential market demand, leading to sample selection bias and further impacting the accuracy of forecasting models. Furthermore, apparel companies typically possess multi-tiered supply chain networks (including central warehouses, regional distribution centers, offline stores, and online warehouses). Existing management methods often treat each node independently, neglecting the transmission effect of inventory pressure within the supply chain network and failing to identify key bottleneck nodes and their impact on overall inventory risk, resulting in irrational inventory allocation. More significantly, existing technologies lack effective risk constraint mechanisms for replenishment decisions, making it difficult to balance stockout risk and inventory costs, and resulting in insufficient strategy optimization capabilities. Summary of the Invention

[0003] The purpose of this invention is to address the problems existing in the background technology by proposing an intelligent inventory dynamic optimization method and system based on AI prediction.

[0004] The technical solution of this invention: A smart inventory dynamic optimization method based on AI prediction, comprising: S1. Collect inventory decision data and preprocess the inventory decision data; S2. Based on the preprocessed inventory decision data, feature vectors reflecting inventory fluctuations and demand trends are extracted using the inventory pressure transmission learning method. S3. Based on the feature vector, use the long short-term memory network model to generate future demand forecasts, calculate the lead time demand distribution parameters based on the future demand forecasts, and use the Heckman two-stage model to correct the future demand forecasts. Based on the corrected future demand forecasts, generate the corrected lead time demand distribution parameters. S4. Based on the corrected lead time demand distribution parameters, construct the stockout event and calculate the stockout probability; S5. Set stockout risk constraints, solve for the optimal replenishment quantity that satisfies the stockout risk constraints, and generate purchase and inventory adjustment instructions.

[0005] As a further improvement to this technical solution, in S1, the inventory decision data includes at least historical sales data and current available inventory.

[0006] As a further improvement to this technical solution, in step S2, based on the preprocessed inventory decision data, feature vectors reflecting inventory fluctuations and demand trends are extracted using an inventory pressure transmission learning method, including the following steps: S2.1 Based on the preprocessed sales history data and current available inventory, organize the raw data of each product into a basic time series according to time steps, including the sales history data time series and inventory time series for each time step; S2.2 Calculate statistical characteristics based on the inventory time series of each product; S2.3 Extract demand trend characteristics based on historical sales data time series; S2.4 Calculate matching features based on inventory time series and sales historical data time series; S2.5 Calculate the topological transmission characteristics using the inventory pressure transmission learning method, including the pressure transmission intensity index, network sensitivity factor, and node structure bearing constraint coefficient; S2.6 Normalize the statistical features, demand trend features, matching features, and topological transmission features according to a unified dimension, and combine them into a feature vector for each product at each time step.

[0007] As a further improvement to this technical solution, in step S2.5, the topological transmission characteristics are calculated using the inventory pressure transmission learning method, including the following steps: S2.51. Collect historical operational data and construct a time-series dynamic directed graph based on the historical operational data. For time-series dynamic directed graphs Any two nodes and Construct dynamic adjacency matrix elements As a node To the node The intensity of inventory pressure transmission; Dynamic adjacency matrix elements It consists of static structural terms and dynamic correction terms; Based on dynamic adjacency matrix elements Generate a temporal dynamic adjacency matrix ; S2.52, Based on Temporal Dynamic Adjacency Matrix Construct the initial state vector of the node inventory; S2.53, Based on the initial state vector of node inventory, in the time-series dynamic adjacency matrix Perform multi-layer graph attention propagation under constraints; S2.54. After completing the multi-layer graph attention propagation, the final state of the nodes is obtained. And based on the final state of the node Construct topological transmission features; Among them, topological transmission characteristics include pressure transmission intensity index, network sensitivity factor, and node structure bearing constraint coefficient.

[0008] As a further improvement to this technical solution, in S2.54, based on the final state of the node... Constructing topological transmission features includes the following steps: Based on the final state of the nodes For nodes Rather than at any moment The set of neighboring nodes is used to calculate the embedding difference vectors, and the L2 norm of the embedding difference vectors is obtained to generate the basic quantities of the local topological gradient. Based on the fundamental quantities of local topological gradients, a temporal dynamic adjacency matrix is ​​introduced. and normalized weights Weighted aggregation of local topological gradient fundamental quantities is performed to construct nodes. The weighted pressure gradient magnitude; By analyzing the time-series dynamic directed graph The weighted pressure gradient magnitude of all nodes is normalized to generate the pressure transmission intensity index. Based on the pressure transmission intensity index, the final state of the node Regarding initial inventory Calculate the partial derivative to generate the network sensitivity factor; Based on dynamic adjacency matrix Calculate the nodes separately The input and output connection strengths, combined with the pressure conduction strength index and network sensitivity factor. Construct the node structure bearing constraint coefficient.

[0009] As a further improvement to this technical solution, in step S3, based on feature vectors, a long short-term memory network model is used to generate future demand forecasts, and the lead time demand distribution parameters are calculated based on the future demand forecasts, including the following steps: S3.1. Serialize the feature vectors according to the sliding time window length M to generate the input sequence, normalize the input sequence, and divide the normalized input sequence into training set, test set, and validation set. S3.2. Train the Long Short-Term Memory Network model using the training set; S3.3 Input the normalized input sequence into the trained long short-term memory network model to generate future demand prediction values; S3.4 Calculate the lead time demand distribution parameters based on the future demand forecasts, and use the Heckman two-stage model to correct the future demand forecasts. Generate the corrected lead time demand distribution parameters based on the corrected future demand forecasts.

[0010] As a further improvement to this technical solution, in step S3.4, the Heckman two-stage model is used to correct the future demand forecast, and the corrected lead time demand distribution parameters are generated based on the corrected future demand forecast, including the following steps: S3.41, For each product At each time step Construct inventory availability indicator variables; S3.42. Using inventory availability indicator variables as the modeling target variables, construct an inventory availability probability model and calculate the probability of complete sales data formation at each time step; S3.43. Calculate the inverse Mills ratio based on the standard normal distribution function value corresponding to the probability of complete sales data formation at each time step; The feature vector of each product at each time step, which is combined by step S2.6, and the inverse Mills ratio of the corresponding time step are concatenated as new features along the feature dimension to form an expanded feature vector. The long short-term memory network model is then retrained using this expanded feature vector as input. S3.44. Using the retrained Long Short-Term Memory network model, generate the corrected lead time demand distribution parameters for each future time step.

[0011] As a further improvement to this technical solution, in step S4, a stockout event is constructed based on the corrected lead time demand distribution parameters, and the stockout probability is calculated, including the following steps: S4.1. Based on the current available inventory, classify stockout events... Set to the scenario where demand exceeds available inventory during the lead time; S4.2 Calculate the stockout probability using the corrected lead time demand distribution parameters.

[0012] As a further improvement to this technical solution, in step S5, a stockout risk constraint is set, the optimal replenishment quantity that satisfies the stockout risk constraint is solved, and a purchase and inventory adjustment instruction is generated, including the following steps: S5.1 Set the maximum acceptable out-of-stock probability threshold for the product, and construct out-of-stock risk constraints based on the maximum acceptable out-of-stock probability threshold; S5.2 Under the constraint of stockout risk, establish an optimization model with the goal of minimizing the replenishment amount; S5.3 Solve the optimization model using linear programming to generate the optimal replenishment quantity under the stockout risk constraint; S5.4. Generate a replenishment instruction based on the optimal replenishment quantity obtained from the solution.

[0013] On the other hand, the present invention provides an AI-based predictive intelligent inventory dynamic optimization system, including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor executes the computer program to implement the above-mentioned AI-based predictive intelligent inventory dynamic optimization method.

[0014] Compared with the prior art, the above-mentioned technical solution of the present invention has the following beneficial technical effects: by constructing a time-series dynamic directed graph and performing multi-layer graph attention propagation, the topological transmission features reflecting the transmission of inventory pressure across the entire network are accurately extracted. The data truncation bias caused by stockouts is effectively corrected by combining the LSTM model and the Heckman two-stage model, thereby generating high-precision future demand forecasts and distribution parameters. On this basis, by quantifying the probability of stockouts and setting risk constraints to solve for the optimal replenishment quantity, closed-loop management from demand perception to decision execution is realized, significantly improving the strategy optimization capability in complex supply chain environments, effectively reducing stockout risks and improving inventory turnover efficiency. Attached Figure Description

[0015] Figure 1 This is a flowchart of the overall method of the present invention. Detailed Implementation

[0016] The technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those of ordinary skill in the art without creative effort are within the scope of protection of the present invention.

[0017] Example 1: Please refer to Figure 1 As shown, this embodiment provides an intelligent inventory dynamic optimization method based on AI prediction, including the following steps: S1. Collect inventory decision data and preprocess the inventory decision data (perform time alignment, outlier removal, missing value imputation, and sliding window construction). Inventory decision data should include at least historical sales data and current available inventory; In this embodiment, the sales history data includes sales data from offline stores and sales data from the online mall. The sales data from offline stores comes from retail verification forms, which are automatically generated and saved when a POS transaction is completed. The sales data from the online mall comes from online sales orders (including online pre-sale orders), which are automatically generated and saved when a transaction is completed, forming complete sales history data that includes dimensions such as time, product, quantity, and channel. The collection of current available inventory data is mainly achieved by querying the available quantity of each product in all warehouses and stores.

[0018] S2. Based on the preprocessed inventory decision data, feature vectors reflecting inventory fluctuations and demand trends are extracted using the inventory pressure transmission learning method. The process, based on preprocessed inventory decision data, involves extracting feature vectors reflecting inventory fluctuations and demand trends using an inventory pressure transmission learning method. This includes the following steps: S2.1 Based on the preprocessed sales history data and current available inventory, organize the raw data of each product into a basic time series according to time steps, including the sales history data time series and inventory time series for each time step; S2.2 Calculate statistical characteristics based on the inventory time series of each commodity, such as average inventory level, inventory variance, maximum inventory change amplitude, minimum inventory change amplitude, and inventory change rate, to characterize inventory fluctuations over time. Specifically, the inventory time series of the commodity is processed step by step. First, the average inventory level is calculated as the series mean; then, the inventory variance is calculated to measure the inventory fluctuation amplitude; subsequently, the maximum and minimum values ​​of adjacent inventory changes in the time series are obtained to characterize extreme inventory fluctuations; finally, the inventory change rate is calculated for each time step, and the mean, variance, maximum change, minimum change, and change rate are vectorized and combined to form the commodity's inventory statistical characteristic vector. S2.3. Based on the time series of historical sales data, extract demand trend features, including the average sales volume within the sliding window and the year-on-year and month-on-month growth rates, reflecting the short-term and long-term trends of commodity sales. Specifically, for each commodity's historical sales series, perform sliding window processing in chronological order. First, calculate the average sales volume within the window to reflect the short-term demand level; then calculate the year-on-year and month-on-month growth rates to characterize the demand change trend; simultaneously, calculate the sliding standard deviation to reflect the demand fluctuation range; finally, combine the average sales volume, year-on-year and month-on-month growth rates, and fluctuation range to form a demand trend feature vector. S2.4. Based on inventory time series and sales historical data time series, calculate matching features, including indicators such as inventory consumption rate, replenishment frequency, and stockout rate, to reflect the matching relationship between inventory level and demand. Specifically, for each product, pair the inventory series and sales series according to time steps. First, calculate the inventory consumption rate (calculated by dividing the actual sales volume of each time step by the available inventory at that time step) to characterize the inventory consumption speed. Second, calculate the replenishment frequency (calculated by the ratio of the number of time steps in which replenishment occurs within a given time window to the window length) to reflect the inventory replenishment rhythm. Then, calculate the stockout rate (calculated by the ratio of the number of time steps in which inventory is insufficient to meet sales demand within a given time window to the total number of time steps in the window) to measure the situation where inventory fails to meet demand. Finally, normalize and combine indicators such as inventory consumption rate, replenishment frequency, and stockout rate to form a matching feature vector for the product. S2.5 Calculate the topology transmission characteristics using the inventory pressure transmission learning method, including at least the pressure transmission intensity index, network sensitivity factor, and node structure bearing constraint coefficient; In this embodiment, the inventory pressure transmission learning method is a topological feature extraction technique based on graph neural networks (GNNs). Its core is to simulate the pressure transmission relationship between different nodes (such as warehouses and stores) in an inventory network by constructing a time-series dynamic directed graph. This method first dynamically generates an adjacency matrix using historical operational data (such as replenishment frequency, delivery distance, and emergency replenishment index) to quantify the intensity of inventory impact between nodes over time. Then, through a multi-layer graph attention propagation mechanism, under the constraint of the dynamic adjacency matrix, it aggregates and updates the node's own inventory state (such as inventory quantity, change, and replenishment quantity) with the states of neighboring nodes. Finally, this method extracts topological transmission features (such as pressure transmission intensity index, network sensitivity factor, and node structural bearing capacity constraint coefficient) from the learned node final states, which can quantify the node's relative transmission ability, sensitivity to inventory disturbances, and structural bearing capacity during the network-wide pressure diffusion process. This method addresses the specific problem of traditional inventory optimization neglecting the complex interrelationships and risk transmission mechanisms between nodes. In real-world supply chains, stockouts or inventory buildup at one node often propagate to other nodes through replenishment and allocation operations, creating a chain reaction. Existing technologies (such as traditional statistical models or LSTM models based solely on single time series) typically treat each node as an independent entity for demand forecasting and inventory optimization, failing to capture this networked dynamic impact and thus struggling to prevent global stockout risks caused by localized pressure transmission. Its core advantage lies in achieving a leap from "independent node forecasting" to "networked risk transmission perception": by modeling the real-time pressure transmission intensity between inventory nodes through a dynamic graph structure and utilizing graph attention mechanisms to learn the amplification effect of this transmission on node states, it can accurately identify "critical bottleneck nodes" that lead to risk diffusion in the network. This allows inventory optimization strategies to consider not only their own demand but also the supply pressure from upstream suppliers, demand fluctuations from downstream stores, and the allocation capabilities between warehouses at the same level, thereby formulating more robust and globally coordinated replenishment plans while meeting stockout risk constraints. Furthermore, the topological transmission characteristics are calculated using the inventory pressure transmission learning method, including the following steps: S2.51. Collect historical operational data (including at least historical basic inventory information and historical replenishment data for each warehouse or store), and construct a time-series dynamic directed graph based on the historical operational data. ; Each warehouse or store is represented as a time-series dynamic directed graph. One of the nodes Node set Representing each warehouse or store, edge collection Indicates time The impact of inventory on the following; For time-series dynamic directed graphs Any two nodes and Construct dynamic adjacency matrix elements As a node To the node The intensity of inventory pressure transmission (i.e., through quantitative nodes) Inventory changes or replenishment pressure on nodes The potential impact of inventory status represents the strength of inventory pressure propagation along that edge, providing a basis for subsequent graph attention propagation calculations of node states and topological propagation characteristics. Dynamic adjacency matrix elements It consists of static structural terms and dynamic correction terms; Specifically, the static structure term is used to characterize the long-term stable replenishment and delivery relationships between nodes, including normalized historical replenishment frequency. (Reflecting nodes) To the node Historical supply dependence, normalized historical replenishment frequency Specifically: by nodes To the node The total number of successful executions of replenishment requests or transfer instructions is typically divided by the maximum number of replenishments occurring among all nodes in the entire network during that time period, or divided by the number of nodes, to eliminate the impact of volume differences caused by variations in business volume across different nodes. The total number of replenishments, thus compressing the original frequency to a uniform dimension range of [0,1] or similar, forming a dimensionless normalized frequency, and standardized delivery distance costs. (Reflecting the damping effect of logistics, standardized delivery distance cost) Specifically: Obtaining nodes With nodes The actual geographical distance (e.g., road transport mileage) or standard logistics transport time (e.g., average delivery days) between them. Subsequently, to eliminate the differences between different distance units and integrate them with indicators such as frequency, standardization is required. A common method is to divide this distance by the maximum distance between all connected node pairs in the entire network, thus mapping the original distance to the [0,1] interval. (The larger the value, the higher the logistics cost or the longer the response time); the dynamic correction term is used to characterize the degree of disturbance to the structural relationship caused by short-term inventory pressure changes, defining the time window. Emergency replenishment index within ( (Time step) is used to quantify the amplifying effect of recent abnormal replenishment or inventory alerts on the strength of inventory transmission (Emergency Replenishment Index). Specifically, within the time window (For example, within the past 7 days) statistical nodes To the node All replenishment events initiated that are considered "urgent" are identified. These events can be defined by order tags (such as expedited orders, direct delivery orders), orders with promised response times shorter than the standard, or automatic replenishment orders triggered by inventory alerts. The number of urgent events occurring within the window is aggregated, and may be weighted by the urgency level of the events themselves (such as expedited level), ultimately forming an index representing the intensity of short-term pressure pulses. ); Based on this, the static structural terms and dynamic correction terms are weighted and merged to construct the time. Dynamic adjacency matrix elements : ; in, For static structure weights, As the damping weight for logistics, To dynamically adjust the weights, , , The values ​​of are all in the range [0, 10], and were determined through expert experience. This is a logistic mapping function used to compress edge weights to... The interval is used to obtain a stable probabilistic transmission strength matrix that can be used for subsequent graph propagation calculations; this realizes the transformation of the inventory impact relationship from "structural connection" to "dynamic connection of structure and state coupling", providing a basic topological representation for subsequent inventory pressure transmission learning; Based on dynamic adjacency matrix elements Generate a temporal dynamic adjacency matrix Specifically: pair all nodes In time The dynamic adjacency matrix elements obtained by the following calculation Arrange the corresponding positions in the matrix according to the node index, that is, the first... Line number Column assignment value Subsequently, nodes in the matrix that have no edges or do not participate in propagation are assigned a value of zero to ensure the sparsity and structural integrity of the matrix, and a temporal dynamic adjacency matrix is ​​generated. The generated temporal dynamic adjacency matrix As an input constraint for graph attention propagation, a unified representation of the dynamic change of inventory pressure transmission intensity between nodes over time is realized, thereby constructing a time-series dynamic adjacency matrix that reflects the coupling of the inventory status and structural relationship of the entire network; S2.52, Based on Temporal Dynamic Adjacency Matrix Construct the initial state vector of the node's inventory (used to characterize the node's inventory pressure ground state at the current moment): ; In the formula, For nodes In time The initial state vector is used to represent the inventory base state information of the node. For nodes In the previous time step Actual inventory levels For nodes Inventory change at the previous time step For nodes The replenishment amount or inventory replenishment amount in the previous time step; S2.53, Based on the initial state vector of node inventory, in the time-series dynamic adjacency matrix Perform multi-layer graph attention propagation under constraints; In the time-series dynamic adjacency matrix The specific implementation of multi-layer graph attention propagation under constraints is as follows: Calculate attention score: ; After normalization, we get: ; The node status has been updated to: ; In the formula, For the first Nodes in layer graph attention propagation For neighboring nodes Attention score This is a linear rectified activation function used to perform nonlinear mapping on the result of a linear transformation. For the first The learnable weight vector in the layered graph attention mechanism is used to calculate the attention score. For the first The learnable feature transformation weight matrix of the layer is used to linearly map the node state. For the first Layer nodes The state vector, For the first Layer nodes The state vector, For the first Layer nodes For nodes Normalized attention weights Indicates a node All nodes The attention scores are normalized so that the sum of all weights is 1. It is a non-linear activation function (ReLU). For the first Layer nodes The updated state vector; S2.54, After completing the attention propagation of the multi-layer graph (i.e. After layer propagation, the final state of the node is obtained. And based on the final state of the node Construct topological transmission characteristics to quantify the stress load and sensitivity of nodes in the network; Among them, the topological transmission characteristics include the pressure transmission intensity index, the network sensitivity factor, and the node structure bearing constraint coefficient; The pressure transmission strength index quantifies the relative transmission capacity and influence of nodes during the diffusion of inventory pressure across the entire network. By weighted aggregation of the embedding modulus values ​​of nodes and their neighbors and global normalization, this index identifies nodes that act as "pressure amplifiers" or "critical transmission hubs" in the network, providing a quantitative basis for determining the extent to which inventory fluctuations at a particular node will disrupt the overall network state. The network sensitivity factor characterizes the state amplification effect of small changes in a node's own inventory after propagation through the graph structure. Calculated by taking the partial derivative of the node's final state with respect to the initial inventory, this index captures the nonlinear response strength of inventory disturbances after propagation through multiple layers of graph attention, thus establishing a sensitivity mapping relationship between local inventory changes and the global topological response. The node structural carrying capacity constraint coefficient comprehensively characterizes the structural carrying capacity and diversion capacity of nodes during inventory risk propagation. By integrating the node's pressure transmission strength index, network sensitivity factor, and the ingress and egress connection strength of the dynamic adjacency matrix, this index identifies bottleneck nodes whose critical structural positions and high sensitivity amplify stockout risks, providing decision support for differentiated replenishment strategies and risk control. Based on the final state of the nodes Constructing topological transmission features includes the following steps: Based on the final state of the nodes For nodes Rather than at any moment The set of neighboring nodes Calculate the embedding difference vectors respectively (In the formula, For nodes (final state), and obtain the embedding difference vector. 2-norm Generate the fundamental quantities of local topological gradients (i.e. ); Based on the fundamental quantities of local topological gradients, a temporal dynamic adjacency matrix is ​​introduced. and normalized weights Weighted aggregation of local topological gradient fundamental quantities is performed to construct nodes. Weighted pressure gradient magnitude In this embodiment, the temporal dynamic adjacency matrix The system already contains information on the strength of inventory pressure transmission between nodes (including at least replenishment frequency and delivery distance costs), while the normalized weights... The influence of neighbors is then further normalized. Through this weighted aggregation, the final weighted pressure gradient magnitude is obtained. It not only reflects the degree of deviation of a node's own state, but also incorporates the actual and dynamically changing transmission relationship between the node and its neighbors; that is, if a node... If a node has a large state difference with a neighbor with high transmission strength, then this difference will be amplified, meaning that the node will contribute more to the transmission of pressure in the real network. By analyzing the time-series dynamic directed graph The weighted pressure gradient magnitudes of all nodes are normalized to generate a pressure conduction intensity index. (In the formula, For time-series dynamic directed graphs All node indexes, For nodes The weighted pressure gradient magnitude, (A very small positive number, used to prevent the denominator from being zero), used to measure the relative transmission capacity and influence of a node in the process of pressure diffusion across the entire network, so that local structural pressure can be mapped to the global transmission contribution. Based on the pressure transmission intensity index, the final state of the node Regarding initial inventory Calculate the partial derivative to generate the network sensitivity factor. (In the formula, (as a partial derivative symbol) is used to characterize the state amplification effect produced by small changes in node inventory after propagation in the graph structure, thereby establishing the mapping relationship between inventory disturbance and topological response; Based on dynamic adjacency matrix Calculate the nodes separately Ingress connection strength (In the formula, For time Next node Pointing to node (Dynamic adjacency matrix elements) and outgoing connection strength ( For time Next node Pointing to node (dynamic adjacency matrix elements), combined with the pressure transmission intensity index With network sensitivity factor Construct the node structure bearing constraint coefficient It is used to comprehensively characterize the structural carrying capacity and diversion capacity of nodes in the propagation of inventory risk, thereby identifying key bottleneck nodes that lead to the amplification of stockout risk. S2.6 Normalize or standardize the statistical features, demand trend features, matching features, and topological transmission features according to a unified dimension, and combine them into a feature vector for each product at each time step.

[0019] S3. Based on the feature vector, use the Long Short-Term Memory Network (LSTM) model to generate future demand forecasts, calculate the lead time demand distribution parameters based on the future demand forecasts, and use the Heckman two-stage model to correct the future demand forecasts. Based on the corrected future demand forecasts, generate the corrected lead time demand distribution parameters. The process involves generating future demand forecasts using a long short-term memory network model based on feature vectors, and then calculating the lead time demand distribution parameters based on these forecasts. This includes the following steps: S3.1. Serialize the feature vectors according to the sliding time window length M to generate the input sequence, normalize the input sequence, and divide the normalized input sequence into training set, test set, and validation set. S3.2. The Long Short-Term Memory (LSTM) network model is trained using the training set. Specifically, the normalized feature time series is constructed as input samples and corresponding real demand value labels using a sliding window, and then input into the model in batches. Subsequently, the predicted demand value output by the model is calculated through forward propagation. Then, a loss function is constructed based on the error between the predicted value and the real value, and the error is backpropagated to calculate the gradients of the weight parameters and bias parameters of each layer. On this basis, gradient descent or adaptive optimization algorithms are used to iteratively update the model parameters. After each round of training, the model performance is evaluated using the validation set, and the learning rate is adjusted or an early stopping strategy is implemented based on the validation error. After multiple rounds of iterative training until the loss function converges or the preset training termination condition is met, a converged LSTM network model is obtained for subsequent demand prediction. The Long Short-Term Memory (LSTM) network model includes an input layer, at least one LSTM hidden layer, and an output layer. The input layer receives a multi-dimensional feature time series constructed according to a sliding time window, with one feature vector input at each time step. The LSTM hidden layer consists of memory units and a gating structure, including an input gate, a forget gate, and an output gate. Through the gating mechanism, it selectively retains, updates, and outputs historical information, thereby modeling long-term dependencies and short-term fluctuations. The output layer linearly maps the state of the hidden layer at the final time step or at each time step to generate future demand forecasts, enabling the prediction of demand levels and their changing trends. S3.3 Input the normalized input sequence into the trained long short-term memory network model to generate future demand prediction values; S3.4 Calculate the lead time demand distribution parameters based on future demand forecasts (based on a trained Long Short-Term Memory (LSTM) network model, generate a demand forecast sequence for several consecutive future time steps starting from the current time step, and determine the replenishment lead time length; then, sum the forecast demand values ​​for each time step within the lead time range to obtain the forecast mean of the total lead time demand; simultaneously, based on the demand fluctuation information output by the model or the statistical results of historical forecast residuals, calculate the variance of the forecast demand for each time step and the covariance between time steps; on this basis, sum the variances of each time step within the lead time and add the covariance term to obtain the variance of the total lead time demand; finally, use the lead time demand mean and the lead time demand variance as the lead time demand distribution parameters), and use the Heckman two-stage model to correct the future demand forecasts, generating corrected lead time demand distribution parameters that reflect the actual potential demand in the market based on the corrected future demand forecasts. In this embodiment, the Heckman two-stage model is divided into two stages: the first stage establishes the selection equation (Probit model) to predict the probability of the sample being observed; the second stage calculates a correction term called the inverse Mills ratio and adds it as an additional variable to the original result equation, thereby correcting the bias caused by the non-random missing data and restoring the parameters that reflect the true situation of the population. The use of the Heckman two-stage model to correct future demand forecasts addresses the core data bias issue of demand data being truncated by inventory in historical sales data. In real-world scenarios, when goods are out of stock, unmet customer demand cannot be recorded, causing historical data to only reflect "sales when goods are in stock," while missing "demand when goods are out of stock"—a typical example of sample selection bias. Existing technologies (such as LSTM models trained directly on historical sales data) can "learn" this bias, misjudging zero sales during out-of-stock periods as zero demand, thus systematically underestimating true demand. This underestimation, especially at frequently out-of-stock points, creates a vicious cycle where the more out-of-stock the market, the more conservative the forecasts become, leading to insufficient replenishment. Its core advantage lies in achieving a cognitive leap from "observed sales" to "potential demand": by constructing an inventory availability probability model to calculate the inverse Mills ratio and using it as a correction feature to retrain the LSTM model, this method can remove the "masking effect" of inventory constraints on sales records, restore the real market signals that are covered by stockouts, and make the subsequently calculated lead time demand distribution parameters closer to the real market demand, thereby providing a more accurate decision-making basis for stockout risk constraints. Furthermore, a two-stage Heckman model is used to correct the future demand forecasts. Based on the corrected future demand forecasts, corrected lead time demand distribution parameters are generated, including the following steps: S3.41, For each product At each time step Construct inventory availability indicator variables (Inventory availability indicator) This is used to quantify the state of historical sales data being truncated by inventory, thus providing a basis for identifying sample selection bias in the Heckman two-stage model: by distinguishing between "observable sales when in stock" and "unobservable demand when out of stock"). If the beginning inventory at that time step is greater than 0 (sales data is fully observed); If the beginning inventory at that time step is equal to 0 (sales data is truncated due to stock shortages); S3.42, Using inventory availability as an indicator variable To model the target variable, an inventory availability probability model is constructed to calculate the probability that sales data at each time step is complete (this quantifies the probability that sales data at each time step can be fully observed, thus providing a basis for subsequently calculating the inverse Mills ratio (as a correction factor) to correct for demand data truncation bias caused by stockouts): This formula is a probabilistic prediction model in Probit form, where It is the target variable that the model wants to explain, and These are the characteristic variables used to explain the objective; in, For goods The probability that inventory is available at each time step (sufficient inventory, sales are not constrained by stockouts), i.e., the probability that complete sales data is generated at each time step. These are exogenous variables that affect inventory availability (such as historical inventory levels, replenishment cycles, etc.). This is a parameter vector used to characterize the strength of the influence of each feature variable on the probability of inventory availability; S3.43. Calculate the inverse Mills ratio based on the standard normal distribution function value corresponding to the probability of complete sales data formation at each time step. : ; in, It is the standard normal probability density function. The cumulative distribution function of the standard normal distribution; For each product at each time step, the feature vector formed by combining features from step S2.6 is concatenated with the inverse Mills ratio of the corresponding time step as a new feature along the feature dimension to form an expanded feature vector. This expanded feature vector is then used as input to retrain or fine-tune the original Long Short-Term Memory (LSTM) network model. This involves aligning the new features (such as corrected demand forecasts and related statistical features) with the original demand, inventory, and time features along the time dimension to construct a unified-length multi-dimensional time series input tensor, which is then re-normalized. Secondly, the network structure of the original LSM network model remains unchanged, or the input layer dimension is adjusted according to the feature dimension change, and the model parameters are initialized (either by fine-tuning the original LSM network model parameters or by re-randomizing them). Subsequently, the expanded feature sequence... The model is divided into training samples and labels using a sliding window and input into the model in batches for forward propagation to obtain the demand prediction output. Next, a loss function (mean squared error (MSE) loss function) is constructed based on the error between the predicted value and the actual demand. The gradient is calculated using the backpropagation algorithm, and the model weight parameters are updated using the SGD optimization algorithm. After each iteration, the model's performance on metrics such as mean error, volatility characterization, and lead time cumulative error is evaluated using a validation set. The learning rate is adjusted or an early stopping strategy is implemented if necessary. Finally, after the loss function converges or the validation performance stabilizes, a Long Short-Term Memory (LSTM) network model trained based on extended feature vectors is obtained (used to more accurately predict future demand and its distribution characteristics), enabling the model to predict both the mean of future demand and the uncertainty of demand fluctuations. The predicted value output by the trained Long Short-Term Memory (LSTM) network model is the corrected demand forecast, reflecting the potential market demand before it is truncated under inventory constraints. This is formalized as a linear structure. ; in, This is the adjusted demand forecast (i.e., the adjusted future demand forecast). Inverse Mills ratio weights, For the feature vector weights, The feature vector formed by combining S2 and 6, For residual terms; In S3.43, by introducing the inverse Mills ratio and retraining the long short-term memory network model, the long short-term memory network model is able to correct sample selection bias, that is, to correct the future demand forecast. S3.44. Using the retrained Long Short-Term Memory network model, generate the corrected lead time demand distribution parameters for each future time step: ; ; in, To determine the lead time for replenishment, This is the corrected mean of lead time demand. This is the corrected lead time demand variance. For the goods In the future Forecast values ​​of demand at any given time. For variance operators, For covariance operators, For the prediction step within the lead time, For mathematical expectation operators; This demand forecast distribution has eliminated the effects of sample selection bias and reflects the true market demand that has not been truncated by inventory.

[0020] S4. Based on the corrected lead time demand distribution parameters, construct the stockout event and calculate the stockout probability; The process of constructing a stockout event and calculating the stockout probability includes the following steps: S4.1. Based on the current available inventory, classify stockout events... Set up for the scenario where demand exceeds available inventory during the lead time: ; In the formula, For goods The cumulative demand during the lead time (total demand can be predicted or corrected before inventory constraints). For goods At time step Available inventory is the current available inventory minus the allocated or locked inventory. S4.2 Calculate the stockout probability using the corrected lead time demand distribution parameters. In the formula, For goods The cumulative distribution function of demand distribution during lead time is used to calculate the probability that demand will not exceed a certain inventory level.

[0021] S5. Set stockout risk constraints, solve for the optimal replenishment quantity that satisfies the stockout risk constraints, and generate purchase and inventory adjustment instructions; The process involves setting stockout risk constraints, determining the optimal replenishment quantity that satisfies these constraints, and generating purchase and inventory adjustment instructions. This includes the following steps: S5.1 Set the maximum acceptable out-of-stock probability threshold for a product. And construct stockout risk constraints based on the maximum acceptable stockout probability threshold. In the formula, For goods At time step The replenishment quantity decision variable is the inventory quantity to be ordered or transferred. The probability that the available inventory after replenishment is still insufficient to meet the actual demand within the lead time; S5.2 Under the constraint of stockout risk, establish an optimization model with the objective of minimizing replenishment quantity. (In the formula, (Minimum replenishment quantity to meet stockout risk constraints). S5.3 Solve the optimization model using linear programming to generate the optimal replenishment quantity under stockout risk constraints. Specifically, use linear programming methods (such as interior-point method) to calculate the optimal replenishment quantity for each item under constraints. (First, define the replenishment quantity for each item as a decision variable and transform the stockout risk constraints into linear or approximately linear inequality constraints, ensuring that the inventory after replenishment ensures that the stockout probability does not exceed a set threshold. Then, input the minimum replenishment quantity as the objective function into the linear programming solver. The interior-point method iteratively approximates the optimal solution from within the feasible region, adjusting the search direction and step size according to the constraints in each iteration to ensure that the updated solution satisfies the stockout risk constraints. As the iteration progresses, the solver continuously optimizes the replenishment quantity combination until the convergence condition is met or the objective function reaches its minimum value, finally outputting the optimal replenishment quantity for each item under constraints.) Finally, output the optimal replenishment quantity obtained from the solution to the inventory management system to generate replenishment instructions and update planned inventory, realizing dynamic inventory optimization under stockout risk constraints. S5.4. Based on the optimal replenishment quantity obtained from the solution, generate standard replenishment instructions. Specifically: First, match the optimal replenishment quantity of each product with the corresponding product number, estimated arrival time, and supplier information (such as code and contact information) to form the basic data for replenishment instructions. Then, organize the replenishment instructions according to the format specified by the inventory management system, including necessary information such as product number, order quantity, estimated arrival time, and supplier code. Next, upload the replenishment instructions to the inventory management system and simultaneously update the planned inventory level and safety stock parameters in the system to reflect the inventory status after replenishment. Finally, send inventory adjustment notifications to the warehouse and distribution channels according to the instructions generated by the system, realizing closed-loop management of replenishment execution and dynamic optimization of inventory structure.

[0022] Example 2: This example provides an AI-based predictive intelligent inventory dynamic optimization system, including a memory, a processor, and a computer program stored in the memory and executable on the processor. The processor executes the computer program to implement the AI-based predictive intelligent inventory dynamic optimization method described in Example 1 above.

[0023] The embodiments of the present invention have been described in detail above with reference to the accompanying drawings. However, the present invention is not limited thereto. Various changes can be made within the scope of knowledge possessed by those skilled in the art without departing from the spirit of the present invention.

Claims

1. An intelligent inventory dynamic optimization method based on AI prediction, characterized in that, include: S1. Collect inventory decision data and preprocess the inventory decision data; S2. Based on the preprocessed inventory decision data, feature vectors reflecting inventory fluctuations and demand trends are extracted using the inventory pressure transmission learning method. S3. Based on the feature vector, use the long short-term memory network model to generate future demand forecasts, calculate the lead time demand distribution parameters based on the future demand forecasts, and use the Heckman two-stage model to correct the future demand forecasts. Based on the corrected future demand forecasts, generate the corrected lead time demand distribution parameters. S4. Based on the corrected lead time demand distribution parameters, construct the stockout event and calculate the stockout probability; S5. Set stockout risk constraints, solve for the optimal replenishment quantity that satisfies the stockout risk constraints, and generate purchase and inventory adjustment instructions.

2. The AI-based predictive intelligent inventory dynamic optimization method according to claim 1, characterized in that, In S1, the inventory decision data includes at least historical sales data and current available inventory.

3. The AI-based predictive intelligent inventory dynamic optimization method according to claim 2, characterized in that, In step S2, based on the preprocessed inventory decision data, feature vectors reflecting inventory fluctuations and demand trends are extracted using an inventory pressure transmission learning method, including the following steps: S2.1 Based on the preprocessed sales history data and current available inventory, organize the raw data of each product into a basic time series according to time steps, including the sales history data time series and inventory time series for each time step; S2.2 Calculate statistical characteristics based on the inventory time series of each product; S2.3 Extract demand trend characteristics based on historical sales data time series; S2.4 Calculate matching features based on inventory time series and sales historical data time series; S2.5 Calculate the topological transmission characteristics using the inventory pressure transmission learning method, including the pressure transmission intensity index, network sensitivity factor, and node structure bearing constraint coefficient; S2.6 Normalize the statistical features, demand trend features, matching features, and topological transmission features according to a unified dimension, and combine them into a feature vector for each product at each time step.

4. The AI-based predictive intelligent inventory dynamic optimization method according to claim 3, characterized in that, In step S2.5, the topological transmission characteristics are calculated using the inventory pressure transmission learning method, including the following steps: S2.

51. Collect historical operational data and construct a time-series dynamic directed graph based on the historical operational data. For time-series dynamic directed graphs Any two nodes and Construct dynamic adjacency matrix elements As a node To the node The intensity of inventory pressure transmission; Dynamic adjacency matrix elements It consists of static structural terms and dynamic correction terms; Based on dynamic adjacency matrix elements Generate a temporal dynamic adjacency matrix ; S2.52, Based on Temporal Dynamic Adjacency Matrix Construct the initial state vector of the node inventory; S2.53, Based on the initial state vector of node inventory, in the time-series dynamic adjacency matrix Perform multi-layer graph attention propagation under constraints; S2.

54. After completing the multi-layer graph attention propagation, the final state of the nodes is obtained. And based on the final state of the node Construct topological transmission features; Among them, topological transmission characteristics include pressure transmission intensity index, network sensitivity factor, and node structure bearing constraint coefficient.

5. The AI-based predictive intelligent inventory dynamic optimization method according to claim 4, characterized in that, In S2.54, based on the final state of the node Constructing topological transmission features includes the following steps: Based on the final state of the nodes For nodes Rather than at any moment The set of neighboring nodes is used to calculate the embedding difference vectors, and the L2 norm of the embedding difference vectors is obtained to generate the basic quantities of the local topological gradient. Based on the fundamental quantities of local topological gradients, a temporal dynamic adjacency matrix is ​​introduced. and normalized weights Weighted aggregation of local topological gradient fundamental quantities is performed to construct nodes. The weighted pressure gradient magnitude; By analyzing the time-series dynamic directed graph The weighted pressure gradient magnitude of all nodes is normalized to generate the pressure transmission intensity index. Based on the pressure transmission intensity index, the final state of the node Regarding initial inventory Calculate the partial derivative to generate the network sensitivity factor; Based on dynamic adjacency matrix Calculate the nodes separately The input and output connection strengths, combined with the pressure conduction strength index and network sensitivity factor. Construct the node structure bearing constraint coefficient.

6. The intelligent inventory dynamic optimization method based on AI prediction according to claim 1, characterized in that, In step S3, future demand forecasts are generated using a long short-term memory network model based on feature vectors, and lead time demand distribution parameters are calculated based on these forecasts, including the following steps: S3.

1. Serialize the feature vectors according to the sliding time window length M to generate the input sequence, normalize the input sequence, and divide the normalized input sequence into training set, test set, and validation set. S3.

2. Train the Long Short-Term Memory Network model using the training set; S3.3 Input the normalized input sequence into the trained long short-term memory network model to generate future demand prediction values; S3.4 Calculate the lead time demand distribution parameters based on the future demand forecasts, and use the Heckman two-stage model to correct the future demand forecasts. Generate the corrected lead time demand distribution parameters based on the corrected future demand forecasts.

7. The AI-based predictive intelligent inventory dynamic optimization method according to claim 6, characterized in that, In step S3.4, the Heckman two-stage model is used to correct the future demand forecasts, and the corrected lead time demand distribution parameters are generated based on the corrected future demand forecasts, including the following steps: S3.41, For each product At each time step Construct inventory availability indicator variables; S3.

42. Using inventory availability indicator variables as the modeling target variables, construct an inventory availability probability model and calculate the probability of complete sales data formation at each time step; S3.

43. Calculate the inverse Mills ratio based on the standard normal distribution function value corresponding to the probability of complete sales data formation at each time step; The feature vector of each product at each time step, which is combined by step S2.6, and the inverse Mills ratio of the corresponding time step are concatenated as new features along the feature dimension to form an expanded feature vector. The long short-term memory network model is then retrained using this expanded feature vector as input. S3.

44. Using the retrained Long Short-Term Memory network model, generate the corrected lead time demand distribution parameters for each future time step.

8. The intelligent inventory dynamic optimization method based on AI prediction according to claim 1, characterized in that, In step S4, based on the corrected lead time demand distribution parameters, a stockout event is constructed, and the stockout probability is calculated, including the following steps: S4.1 Based on the current available inventory, set the stockout event to occur when demand exceeds available inventory during the lead time; S4.2 Calculate the stockout probability using the corrected lead time demand distribution parameters.

9. The intelligent inventory dynamic optimization method based on AI prediction according to claim 1, characterized in that, In step S5, a stockout risk constraint is set, the optimal replenishment quantity that satisfies the stockout risk constraint is solved, and purchase and inventory adjustment instructions are generated, including the following steps: S5.1 Set the maximum acceptable out-of-stock probability threshold for the product, and construct out-of-stock risk constraints based on the maximum acceptable out-of-stock probability threshold; S5.2 Under the constraint of stockout risk, establish an optimization model with the goal of minimizing the replenishment amount; S5.3 Solve the optimization model using linear programming to generate the optimal replenishment quantity under the stockout risk constraint; S5.

4. Generate a replenishment instruction based on the optimal replenishment quantity obtained from the solution.

10. An AI-based predictive intelligent inventory dynamic optimization system, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that: The processor executes a computer program to implement the AI-based predictive intelligent inventory dynamic optimization method as described in any one of claims 1-9.