AI-based sales forecasting and intelligent restocking method and system
By constructing a sales forecasting model through time series decomposition and parameter optimization, and combining it with a multi-supplier parallel replenishment mechanism, the problems of inaccurate sales forecasting and supply chain risks in existing technologies are solved, achieving more accurate inventory management and supply chain stability.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- HANGZHOU LAKESIDE NETWORK TECH CO LTD
- Filing Date
- 2026-01-22
- Publication Date
- 2026-05-12
AI Technical Summary
Existing AI-based sales forecasting and intelligent replenishment methods lack effective parameter self-optimization mechanisms, making it difficult to adapt to market fluctuations, resulting in low forecast accuracy and an inability to provide confidence interval information. This leads to inaccurate replenishment decisions and fails to effectively address the risk of supplier delivery delays, increasing the risk of stockouts.
By decomposing time series data to obtain factors influencing sales, an initial prediction model is constructed and its parameters are optimized. Confidence interval boundaries and dynamic safety stock benchmarks are calculated. Combined with a multi-supplier parallel replenishment mechanism, staggered purchase orders are generated.
It improves the accuracy of sales forecasting, dynamically adjusts replenishment quantities, reduces inventory costs, enhances supply chain stability and responsiveness, and reduces the probability of stockouts.
Smart Images

Figure CN121563398B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to sales management technology, and more particularly to an AI-based sales forecasting and intelligent replenishment method and system. Background Technology
[0002] In the retail and supply chain management sectors, accurate sales forecasting and efficient inventory replenishment are crucial for ensuring smooth business operations. With the rapid development of artificial intelligence (AI) technology, AI-based sales forecasting and intelligent replenishment methods have gradually become a hot research topic in the industry. Traditional sales forecasting mainly relies on statistical methods and rules of thumb, such as moving averages and exponential smoothing, while replenishment decisions are often based on fixed safety stock levels and empirical judgment.
[0003] Existing AI-based sales forecasting and intelligent replenishment methods still have some obvious defects and shortcomings. Most existing models lack effective parameter self-optimization mechanisms. When faced with market fluctuations or abnormal situations, the forecasting models have difficulty adjusting parameters in a timely manner to adapt to changes, resulting in decreased forecast accuracy and affecting the accuracy of replenishment decisions.
[0004] Existing sales forecasting methods typically only provide point estimates, lacking quantitative analysis of forecast uncertainty and failing to provide confidence interval information. This makes replenishment decisions difficult to address sales fluctuation risks, easily leading to overstocking or stockouts. Traditional replenishment systems often employ a single-supplier model, failing to fully consider the risk of supplier delivery delays. When suppliers delay delivery, alternative solutions cannot be activated in a timely manner, increasing the risk of stockouts and impacting normal sales and customer satisfaction. Summary of the Invention
[0005] This invention provides an AI-based sales forecasting and intelligent replenishment method and system, which can solve the problems in the prior art.
[0006] A first aspect of this invention provides an AI-based sales forecasting and intelligent replenishment method, comprising:
[0007] Acquire historical sales data, product feature data, and inventory status data of the target product; perform time-series decomposition on the historical sales data to obtain sales influencing factors; and construct an initial prediction model based on the sales influencing factors and product feature data.
[0008] The parameters of the initial prediction model are optimized by constructing a tree-like search space. When the prediction error exceeds the preset error threshold for N consecutive times, the model is backtracked to the optimal parameter combination to obtain the trained sales prediction model.
[0009] The product feature data is input into the trained sales prediction model to obtain the sales prediction value, and the confidence interval boundary of the sales prediction value is calculated based on the prediction deviation distribution of historical sales data.
[0010] The dynamic safety stock benchmark is calculated based on the confidence interval boundary. The difference between the sales forecast value and the current inventory level in the inventory status data is used as the basic gap. When the basic gap is lower than the dynamic safety stock benchmark, a safety compensation amount is added, and the final replenishment requirement is obtained by combining historical sales data.
[0011] Calculate the supplier's historical supply delay coefficient. When the historical supply delay coefficient exceeds the preset delay threshold, activate the multi-supplier parallel replenishment mechanism, allocate the final replenishment demand proportionally, generate multiple staggered purchase order data, and output purchase execution instructions.
[0012] Historical sales data is decomposed into time-series factors to obtain sales influencing factors. An initial prediction model is then constructed based on these sales influencing factors and product characteristic data, including:
[0013] Calculate the variance of historical sales data at different time granularities. When the ratio of variance of adjacent time granularities is less than a preset ratio threshold, it is determined to be the optimal decomposition granularity.
[0014] Historical sales data are decomposed into multiple frequency band components at the optimal decomposition granularity. The energy value of each frequency band component is calculated. The frequency band components are sorted from high to low according to the energy value. The energy ratio between adjacent frequency band components after sorting is calculated. Frequency band components with energy ratios less than a preset threshold are merged into new frequency band components.
[0015] The energy proportion of the new frequency band components is calculated as the recombination weight, and the sales impact factor is obtained by weighting the new frequency band components using the recombination weight.
[0016] Attribute features are extracted from product feature data, the correlation coefficient between attribute features and sales influencing factors is calculated, the attribute features and sales influencing factors are weighted and combined based on the correlation coefficient, a feature sample matrix is constructed, the variance contribution rate of each feature in the feature sample matrix is calculated, and features with variance contribution rates higher than a preset contribution threshold are selected to construct an optimized feature set.
[0017] The optimized feature set is mapped to input layer nodes, and the prediction time window is mapped to output layer nodes to construct the initial prediction model.
[0018] The parameters of the initial prediction model are optimized by constructing a tree-like search space. When the prediction error exceeds a preset error threshold for N consecutive times, the model backtracks to the optimal parameter combination, resulting in a fully trained sales prediction model including:
[0019] The training parameters of the initial prediction model are divided into multiple levels. The information entropy gain between adjacent levels is calculated to obtain the level dependency strength. Based on the level dependency strength, level nodes and connection relationships are constructed in the tree search space.
[0020] Starting from the root node of the hierarchical nodes, the training parameters are searched layer by layer and the prediction error is calculated. When the prediction error exceeds the preset error threshold for N consecutive times, the corresponding training parameter vectors are extracted. Kernel principal component analysis is used to calculate the nonlinear coupling degree matrix between the training parameter vectors. Based on the nonlinear coupling degree matrix, the training parameters with coupling degree exceeding the preset coupling threshold are combined into parameter coupling groups.
[0021] Create coupled child nodes under the current level node, construct an adaptive search step size matrix based on the nonlinear coupling degree matrix, and use the adaptive search step size matrix to jointly optimize the parameter coupling group;
[0022] The training parameter vector is mapped to a failure point cloud, and the principal component directions of the failure point cloud are extracted.
[0023] Backtracking in the opposite direction of the principal component direction to the training parameter combination with the smallest prediction error is used as the optimal parameter combination for further optimization until the prediction error is less than a preset error threshold, thus obtaining the trained sales prediction model.
[0024] The product feature data is input into the trained sales prediction model to obtain the sales prediction value. The confidence interval boundary of the sales prediction value is calculated based on the prediction deviation distribution of historical sales data, including:
[0025] The product feature data is input into the trained sales prediction model to obtain the sales prediction value;
[0026] Extract the prediction deviation distribution of historical sales data, construct a two-dimensional scatter distribution by combining the prediction deviation values in the prediction deviation distribution with the corresponding historical prediction values, perform kernel density estimation on the two-dimensional scatter distribution to obtain the density field distribution, identify boundary points in the density field distribution where the density gradient exceeds a preset gradient threshold, and connect the boundary points to form a deviation boundary curve.
[0027] Extract the predicted deviation value and historical predicted value corresponding to the boundary point along the deviation boundary curve. Divide the deviation boundary curve into multiple curve segments according to the numerical range of the historical predicted value. Calculate the range of the predicted deviation value on each curve segment as the fluctuation amplitude of the curve segment.
[0028] Extract the historical predicted value range corresponding to each curve segment as the predicted value interval, and establish a mapping relationship between the predicted value interval and the fluctuation amplitude of the curve segment to obtain the interval fluctuation mapping table.
[0029] Find the predicted value range to which the sales forecast value belongs in the interval fluctuation mapping table, extract the fluctuation amplitude of the curve segment corresponding to the predicted value range, and generate the confidence interval boundary with the sales forecast value as the center and the fluctuation amplitude of the curve segment as the offset.
[0030] The dynamic safety stock benchmark is calculated based on the confidence interval boundaries. The difference between the sales forecast and the current inventory level in the inventory status data is used as the basic gap. When the basic gap is lower than the dynamic safety stock benchmark, a safety compensation amount is added. The final replenishment requirement is obtained by combining historical sales data, including:
[0031] A two-layer time window is constructed based on historical sales data. The fluctuation characteristic value sequence and trend inflection point are calculated through the two-layer time window. The confidence interval boundary of the sales forecast is corrected in segments. The ratio of the corrected confidence interval boundary to the sales forecast is used as a dynamic risk factor. The dynamic safety stock benchmark is determined based on the product of the dynamic risk factor and the standard deviation of sales.
[0032] The difference between the sales forecast and the current inventory level is used to obtain the basic gap. The basic gap is combined with dynamic risk factors to construct an inventory state vector. A dynamic state transition map is constructed based on historical stockout records. The inventory state vector is input into the dynamic state transition map to obtain the evolution path of the inventory state and predict the risk level.
[0033] When the basic gap is lower than the dynamic safety stock benchmark, the inventory status vector and risk level are mapped to a multi-dimensional compensation space. In the multi-dimensional compensation space, an optimal compensation path is constructed based on historical cost-benefit data, and the safety compensation amount is calculated along the optimal compensation path.
[0034] The dynamic risk factor is used as a weighting coefficient to weight the historical sales data, and seasonal characteristics are extracted from the weighted historical sales data to obtain the seasonal adjustment amount.
[0035] The final replenishment demand is obtained by adding the basic gap, the safety compensation amount, and the seasonal adjustment amount.
[0036] A dynamic state transition graph is constructed based on historical stockout records. The inventory state vector is input into the dynamic state transition graph to obtain the evolution path of the inventory state and predict the risk level, including:
[0037] Extract inventory status data from historical out-of-stock records, group the inventory status data into time series, and connect the grouped inventory status data in chronological order to form a status evolution sequence.
[0038] Density clustering is performed on the state evolution sequence to obtain the state transition pattern. Different inventory states are marked as state nodes in the state transition pattern. The transition probability and transition duration between the state nodes are calculated. The state nodes are used as graph nodes and the transition probability and transition duration are used as the connection attributes between nodes to construct a dynamic state transition graph.
[0039] The inventory state vector is input into the dynamic state transition graph. The target node with the highest similarity to the inventory state vector is retrieved from the state nodes of the dynamic state transition graph. Starting from the target node, multiple state evolution paths are extracted along the connection attributes between nodes. The path weight is calculated based on the transition probability in the multiple state evolution paths.
[0040] Calculate the historical out-of-stock probability corresponding to each state node in the state evolution path, combine the historical out-of-stock probability with the path weight to obtain the risk evolution trend, and predict the risk level based on the risk evolution trend.
[0041] Calculate the supplier's historical delivery delay coefficient. When the historical delivery delay coefficient exceeds a preset delay threshold, activate a multi-supplier parallel replenishment mechanism to proportionally allocate the final replenishment demand, generate multiple staggered purchase order data, and output purchase execution instructions, including:
[0042] Obtain the supplier's historical supply records, perform weighted processing on the historical supply records in chronological order, extract the actual arrival time of each order minus the agreed time to obtain the time deviation, and perform exponential weighted calculation on the time deviation to obtain the historical supply delay coefficient;
[0043] When the historical supply delay coefficient exceeds the preset delay threshold, the supply data and available capacity of the candidate suppliers are extracted from the qualified supplier database;
[0044] Calculate the historical delay coefficient of the candidate suppliers and normalize it to obtain the delivery timeliness score. Calculate the supply capacity score based on the ratio of the delivery timeliness score to the available capacity of each supplier. Select multiple suppliers that meet the final replenishment needs as a replenishment supplier combination in descending order of the supply capacity score.
[0045] The final replenishment demand is allocated based on the supply capacity scores of each supplier in the replenishment supplier portfolio to obtain the order allocation quantity, and it is verified whether the order allocation quantity exceeds the available capacity limit of each supplier.
[0046] Obtain the target delivery time for the final replenishment requirement, calculate the differentiated order lead time based on the historical supply delay coefficient of each supplier, generate purchase order data including order allocation quantity and order time, and output purchase execution instructions.
[0047] A second aspect of this invention provides an AI-based sales forecasting and intelligent replenishment system, comprising:
[0048] The first unit is used to acquire historical sales data, product feature data and inventory status data of the target product, decompose the historical sales data into time series to obtain sales influencing factors, and build an initial prediction model based on the sales influencing factors and product feature data.
[0049] The second unit is used to optimize the parameters of the initial prediction model by constructing a tree-like search space. When the prediction error exceeds the preset error threshold for N consecutive times, it backtracks to the optimal parameter combination to obtain the trained sales prediction model.
[0050] The third unit is used to input product feature data into the trained sales prediction model to obtain the sales prediction value, and to calculate the confidence interval boundary of the sales prediction value based on the prediction deviation distribution of historical sales data.
[0051] The fourth unit is used to calculate the dynamic safety stock benchmark based on the confidence interval boundary. The difference between the sales forecast value and the current inventory level in the inventory status data is used as the basic gap. When the basic gap is lower than the dynamic safety stock benchmark, a safety compensation amount is added, and the final replenishment requirement is obtained by combining historical sales data.
[0052] The fifth unit is used to calculate the historical supply delay coefficient of suppliers. When the historical supply delay coefficient exceeds the preset delay threshold, a multi-supplier parallel replenishment mechanism is activated to allocate the final replenishment demand proportionally, generate multiple staggered purchase order data, and output purchase execution instructions.
[0053] A third aspect of the present invention provides an electronic device, comprising:
[0054] processor;
[0055] Memory used to store processor-executable instructions;
[0056] The processor is configured to invoke instructions stored in the memory to execute the aforementioned method.
[0057] A fourth aspect of the present invention provides a computer-readable storage medium having stored thereon computer program instructions that, when executed by a processor, implement the aforementioned method.
[0058] In this embodiment, by extracting sales influencing factors through time-series decomposition and constructing an optimized prediction model, more accurate sales forecasting is achieved, effectively reducing the prediction error rate and improving prediction accuracy. The introduction of a dynamic safety stock benchmark and confidence interval boundary calculation mechanism enables dynamic adjustment of replenishment quantities based on the uncertainty of sales forecasting, effectively balancing inventory costs and stockout risks, and improving inventory management efficiency and economic benefits. A multi-supplier parallel replenishment mechanism based on historical supply delay coefficients is designed. Through a staggered purchase order allocation strategy, it effectively addresses supply chain uncertainty risks, improves supply chain stability and responsiveness, and reduces the probability of stockouts. Attached Figure Description
[0059] Figure 1 This is a flowchart illustrating the AI-based sales forecasting and intelligent replenishment method according to an embodiment of the present invention.
[0060] Figure 2 This is a flowchart illustrating the dynamic inventory management and replenishment decision-making process according to an embodiment of the present invention. Detailed Implementation
[0061] To make the objectives, technical solutions, and advantages of the embodiments of the present invention clearer, the technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.
[0062] The technical solution of the present invention will be described in detail below with reference to specific embodiments. These specific embodiments can be combined with each other, and the same or similar concepts or processes may not be described again in some embodiments.
[0063] Figure 1 This is a flowchart illustrating the AI-based sales forecasting and intelligent replenishment method according to an embodiment of the present invention. Figure 1 As shown, the method includes:
[0064] Acquire historical sales data, product feature data, and inventory status data of the target product; perform time-series decomposition on the historical sales data to obtain sales influencing factors; and construct an initial prediction model based on the sales influencing factors and product feature data.
[0065] The parameters of the initial prediction model are optimized by constructing a tree-like search space. When the prediction error exceeds the preset error threshold for N consecutive times, the model is backtracked to the optimal parameter combination to obtain the trained sales prediction model.
[0066] The product feature data is input into the trained sales prediction model to obtain the sales prediction value, and the confidence interval boundary of the sales prediction value is calculated based on the prediction deviation distribution of historical sales data.
[0067] The dynamic safety stock benchmark is calculated based on the confidence interval boundary. The difference between the sales forecast value and the current inventory level in the inventory status data is used as the basic gap. When the basic gap is lower than the dynamic safety stock benchmark, a safety compensation amount is added, and the final replenishment requirement is obtained by combining historical sales data.
[0068] Calculate the supplier's historical supply delay coefficient. When the historical supply delay coefficient exceeds the preset delay threshold, activate the multi-supplier parallel replenishment mechanism, allocate the final replenishment demand proportionally, generate multiple staggered purchase order data, and output purchase execution instructions.
[0069] In one optional implementation, historical sales data is decomposed into time-series factors to obtain sales influencing factors. An initial prediction model is then constructed based on these sales influencing factors and product characteristic data, including:
[0070] Calculate the variance of historical sales data at different time granularities. When the ratio of variance of adjacent time granularities is less than a preset ratio threshold, it is determined to be the optimal decomposition granularity.
[0071] Historical sales data are decomposed into multiple frequency band components at the optimal decomposition granularity. The energy value of each frequency band component is calculated. The frequency band components are sorted from high to low according to the energy value. The energy ratio between adjacent frequency band components after sorting is calculated. Frequency band components with energy ratios less than a preset threshold are merged into new frequency band components.
[0072] The energy proportion of the new frequency band components is calculated as the recombination weight, and the sales impact factor is obtained by weighting the new frequency band components using the recombination weight.
[0073] Attribute features are extracted from product feature data, the correlation coefficient between attribute features and sales influencing factors is calculated, the attribute features and sales influencing factors are weighted and combined based on the correlation coefficient, a feature sample matrix is constructed, the variance contribution rate of each feature in the feature sample matrix is calculated, and features with variance contribution rates higher than a preset contribution threshold are selected to construct an optimized feature set.
[0074] The optimized feature set is mapped to input layer nodes, and the prediction time window is mapped to output layer nodes to construct the initial prediction model.
[0075] In this embodiment, the time-series decomposition of historical sales data first involves calculating the variance of fluctuations at different time granularities. Historical sales data typically includes daily sales, weekly sales, and monthly sales. When calculating the variance of fluctuations, the dispersion of sales data at each time granularity is calculated separately. For example, the variance of daily sales data for a certain fast-moving consumer goods category is 25, the variance of weekly sales data is 10, and the variance of monthly sales data is 4. The ratio of variance of fluctuations between adjacent time granularities is calculated; that is, the ratio of the variance of weekly sales to daily sales is 10 / 25 = 0.4, and the ratio of the variance of monthly sales to weekly sales is 4 / 10 = 0.4. If the preset ratio threshold is 0.5, then when the ratio is less than 0.5, it is determined as the optimal decomposition granularity. In this example, the variance ratios of weekly and monthly sales are both 0.4, which is less than the preset threshold of 0.5, so weekly can be used as the optimal decomposition granularity.
[0076] After determining the optimal decomposition granularity, historical sales data is decomposed using wavelet decomposition at that granularity. Wavelet decomposition is a signal processing technique that can decompose sales data into waveform components of different frequencies. For weekly sales data, Haar wavelets or Daubechies wavelets can be used for decomposition to obtain multiple frequency band components. For example, decomposing 52 weeks of sales data may yield three frequency bands: high-frequency, mid-frequency, and low-frequency components.
[0077] Calculate the energy value for each frequency band component, where the energy value represents the signal strength of that component. Assume the energy value of the high-frequency component is 120, the mid-frequency component is 80, and the low-frequency component is 40. After sorting by energy value from highest to lowest, we get: high-frequency component (120), mid-frequency component (80), and low-frequency component (40). Calculate the energy ratio between adjacent frequency band components after sorting: the ratio of mid-frequency component to high-frequency component is 80 / 120 = 0.67, and the ratio of low-frequency component to mid-frequency component is 40 / 80 = 0.5. If the preset threshold is 0.6, then the energy ratio of low-frequency component to mid-frequency component (0.5) is less than the preset threshold of 0.6, and the low-frequency component and mid-frequency component should be merged into a new frequency band component. After merging, we get two frequency bands: a high-frequency component and a new mid-low frequency combined component.
[0078] The energy percentage of the new frequency band components is calculated as the recombination weight. The energy value of the high-frequency component is 120, the energy value of the combined mid- and low-frequency components is 120 (80 + 40), and the total energy is 240. The energy percentage of the high-frequency component is 120 / 240 = 0.5, and the energy percentage of the combined mid- and low-frequency components is also 0.5. Using these energy percentages as recombination weights, the new frequency band components are weighted and combined to obtain the sales impact factor.
[0079] Attribute features are extracted from product feature data. These features may include product price, promotional activities, seasonal factors, holidays, etc. The correlation coefficients between these attribute features and sales volume influencing factors are calculated. For example, the correlation coefficient between product price and sales volume influencing factors is -0.7, the correlation coefficient between promotional activities and sales volume influencing factors is 0.8, and the correlation coefficient between seasonal factors and sales volume influencing factors is 0.6. Based on these correlation coefficients, the attribute features and sales volume influencing factors are weighted and combined to construct a feature sample matrix.
[0080] Calculate the variance contribution rate for each feature in the feature sample matrix. The variance contribution rate represents the explanatory power of a feature on the overall variance. Assume the variance contribution rate for product price is 0.3, for promotional activities it is 0.4, for seasonal factors it is 0.2, and for other features it is 0.1. If the preset contribution threshold is 0.15, then select features with variance contribution rates higher than 0.15, namely product price (0.3), promotional activities (0.4), and seasonal factors (0.2), to construct the optimized feature set.
[0081] The optimized feature set is mapped to input layer nodes of the neural network, with one input node for each feature. The prediction time window is mapped to output layer nodes; for example, predicting sales over the next four weeks would involve four output nodes. When building the initial prediction model, a multilayer perceptron structure can be used, containing an input layer, hidden layers, and an output layer. In this example, the input layer has three nodes (corresponding to product price, promotional activities, and seasonal factors), and the output layer has four nodes (corresponding to the predicted sales over the four weeks). The number of hidden layer nodes can be set to twice the number of input layer nodes, i.e., six nodes.
[0082] The training process of the neural network uses historical sales data as labels, and continuously adjusts the network weights through the backpropagation algorithm. During training, feature data is input into the network, compared with actual sales data, the loss function value is calculated, and then the network parameters are updated using gradient descent. The initial learning rate can be set to 0.01, and gradually decreased as the number of training epochs increases. To prevent overfitting, regularization techniques, such as L2 regularization, can be used, with the regularization coefficient set to 0.001. An early stopping condition can be set during training, stopping training when the loss on the validation set does not decrease for five consecutive epochs.
[0083] The completed initial prediction model can predict future sales based on input product characteristics, providing a basis for intelligent replenishment decisions. The prediction results can be integrated with the inventory management system to automatically generate replenishment suggestions based on predicted sales and current inventory levels.
[0084] In this embodiment, key influencing factors in sales data are accurately extracted using time-series decomposition technology. Combined with product characteristics, a predictive model is constructed, effectively capturing the cyclical fluctuations and trends in sales. By adaptively selecting the optimal time granularity and automatically merging frequency band components, the model adapts to the sales characteristics of different products, improving prediction accuracy. A feature selection mechanism based on variance contribution rate reduces model complexity and improves computational efficiency and generalization ability. This method achieves intelligent and automated sales forecasting, reduces manual intervention, lowers inventory costs, improves supply chain responsiveness, and brings significant economic benefits to enterprises.
[0085] In one optional implementation, a tree-like search space is constructed to optimize the parameters of the initial prediction model. When the prediction error exceeds a preset error threshold for N consecutive times, the model backtracks to the optimal parameter combination to obtain the trained sales prediction model, including:
[0086] The training parameters of the initial prediction model are divided into multiple levels. The information entropy gain between adjacent levels is calculated to obtain the level dependency strength. Based on the level dependency strength, level nodes and connection relationships are constructed in the tree search space.
[0087] Starting from the root node of the hierarchical nodes, the training parameters are searched layer by layer and the prediction error is calculated. When the prediction error exceeds the preset error threshold for N consecutive times, the corresponding training parameter vectors are extracted. Kernel principal component analysis is used to calculate the nonlinear coupling degree matrix between the training parameter vectors. Based on the nonlinear coupling degree matrix, the training parameters with coupling degree exceeding the preset coupling threshold are combined into parameter coupling groups.
[0088] Create coupled child nodes under the current level node, construct an adaptive search step size matrix based on the nonlinear coupling degree matrix, and use the adaptive search step size matrix to jointly optimize the parameter coupling group;
[0089] The training parameter vector is mapped to a failure point cloud, and the principal component directions of the failure point cloud are extracted.
[0090] Backtracking in the opposite direction of the principal component direction to the training parameter combination with the smallest prediction error is used as the optimal parameter combination for further optimization until the prediction error is less than a preset error threshold, thus obtaining the trained sales prediction model.
[0091] First, the parameters of the initial prediction model are hierarchically divided and their dependencies are constructed. Through adaptive search and backtracking optimization strategies, efficient and accurate model parameter tuning is achieved. The model parameters can be divided into three levels. Taking e-commerce platform product sales prediction as an example, the first level includes model type parameters (such as linear regression, random forest, gradient boosting tree, etc.); the second level includes the main hyperparameters of each model (such as tree depth, learning rate, regularization coefficient, etc.); and the third level includes feature engineering-related parameters (such as time window size, feature combination method, etc.). For each pair of adjacent levels, their information entropy gain is calculated. For example, the information entropy gain of model type on hyperparameters is 0.72, and the information entropy gain of hyperparameters on feature engineering parameters is 0.45, indicating a stronger dependency between model type and hyperparameters. Based on these dependency strength values, a tree-like search space is constructed, where levels with high information entropy gain have stronger connections.
[0092] The search process begins at the root node, i.e., the model type level. Assuming an initial gradient boosting tree is selected, different learning rates (0.01, 0.05, 0.1) and tree depths (3, 5, 7) are tested at the second level, and time window sizes (7 days, 14 days, 30 days) are tested at the third level. Each parameter combination is used to train the model and calculate the prediction error. A preset error threshold of 5% is set, and the number of consecutive judgments N is 3. When three consecutive prediction errors exceed 5% (e.g., the prediction errors for parameter combinations [gradient boosting tree, 0.01, 3, 7 days], [gradient boosting tree, 0.01, 3, 14 days], and [gradient boosting tree, 0.01, 3, 30 days] are 6.2%, 5.8%, and 6.5%, respectively), the system triggers a backtracking mechanism.
[0093] Training parameter vectors are extracted from these three sets of failed parameter combinations, and the nonlinear coupling matrix is calculated using kernel principal component analysis. Assume the calculation results show a coupling degree of 0.85 between the learning rate and tree depth, 0.32 between the time window and tree depth, and only 0.15 between the learning rate and time window. Setting a preset coupling threshold of 0.5, the learning rate and tree depth are combined into a parameter coupling group, while the time window is treated as an independent parameter.
[0094] Coupled child nodes are created under the current level node, and an adaptive search step size matrix is constructed using a nonlinear coupling degree matrix. For parameter combinations with high coupling degree, a smaller search step size is used; for parameters with low coupling degree, a larger search step size is used. For example, the search step size for the learning rate is adjusted from 0.01 to 0.005, the search step size for the tree depth is adjusted from 2 to 1, while the search step size for the time window remains at 7 days. These adaptive step sizes are used to jointly optimize the parameter coupling groups, testing new parameter combinations such as [gradient boosting tree, 0.015, 4, 14 days] and [gradient boosting tree, 0.02, 4, 14 days].
[0095] Simultaneously, these three sets of failed training parameter vectors are mapped to a 3D failed point cloud. By calculating the principal component directions of the point cloud, the direction with the greatest variation in the parameter space is determined. It is assumed that the principal component directions indicate that increasing the learning rate while decreasing the tree depth is the main factor leading to increased error. The search proceeds in the reverse direction of the principal component directions, backtracking to the parameter combination with the minimum prediction error.
[0096] In the aforementioned example, we might backtrack to the parameter combination [gradient boosting tree, 0.05, 5, 14 days], which has a prediction error of 4.8%, lower than the preset 5% threshold. At this point, this combination is taken as the optimal parameter combination, and a further refinement search is performed around it. For example, parameter combinations such as [gradient boosting tree, 0.045, 5, 14 days], [gradient boosting tree, 0.055, 5, 14 days], and [gradient boosting tree, 0.05, 4, 14 days] are tested, continuously optimizing until the parameter combination with the smallest prediction error is found.
[0097] Ultimately, the optimal parameter combination might be determined as [gradient boosting tree, 0.055, 6, 21 days], with a prediction error of 3.2%, significantly lower than the preset error threshold. At this point, the trained sales prediction model can be used for actual prediction tasks. In practical applications, this method converges to the optimal parameter combination faster than traditional grid search and random search methods. Furthermore, through parameter coupling analysis and adaptive step size adjustment, this method effectively handles the complex interactions between parameters, avoiding getting trapped in local optima.
[0098] In one optional implementation, product feature data is input into a trained sales prediction model to obtain sales prediction values. The confidence interval boundaries of the sales prediction values are calculated based on the prediction deviation distribution of historical sales data, including:
[0099] The product feature data is input into the trained sales prediction model to obtain the sales prediction value;
[0100] Extract the prediction deviation distribution of historical sales data, construct a two-dimensional scatter distribution by combining the prediction deviation values in the prediction deviation distribution with the corresponding historical prediction values, perform kernel density estimation on the two-dimensional scatter distribution to obtain the density field distribution, identify boundary points in the density field distribution where the density gradient exceeds a preset gradient threshold, and connect the boundary points to form a deviation boundary curve.
[0101] Extract the predicted deviation value and historical predicted value corresponding to the boundary point along the deviation boundary curve. Divide the deviation boundary curve into multiple curve segments according to the numerical range of the historical predicted value. Calculate the range of the predicted deviation value on each curve segment as the fluctuation amplitude of the curve segment.
[0102] Extract the historical predicted value range corresponding to each curve segment as the predicted value interval, and establish a mapping relationship between the predicted value interval and the fluctuation amplitude of the curve segment to obtain the interval fluctuation mapping table.
[0103] Find the predicted value range to which the sales forecast value belongs in the interval fluctuation mapping table, extract the fluctuation amplitude of the curve segment corresponding to the predicted value range, and generate the confidence interval boundary with the sales forecast value as the center and the fluctuation amplitude of the curve segment as the offset.
[0104] The sales forecasting model is trained based on machine learning algorithms, such as random forests, gradient boosting decision trees, or deep neural networks. Product feature data includes, but is not limited to, product price, promotional information, seasonality, and inventory status. Inputting this feature data into the trained sales forecasting model yields the corresponding sales forecast. For example, for an electronic product, its feature data includes a price of 599 yuan, promotional activities, summer new arrivals, and sufficient inventory; inputting this data into the sales forecasting model results in a predicted sales volume of 1200 units.
[0105] To assess the reliability of the forecast results, confidence intervals need to be calculated based on historical data. The system extracts the actual and predicted values of historical sales data from the database and calculates the forecast deviation. The forecast deviation equals the actual sales minus the predicted sales. For example, if the predicted sales volume for the same type of product was 1000 units in historical forecasts, and the actual sales volume was 1100 units, then the forecast deviation is 100 units. By collecting a sufficient number of historical data points, a two-dimensional scatter distribution of the forecast deviation and the corresponding historical forecast values is constructed.
[0106] For the constructed two-dimensional scattered point distribution, a density field distribution is generated using a kernel density estimation method. The kernel density estimation employs a Gaussian kernel function with adaptive bandwidth selection to obtain a smooth density estimate. In the implementation, the entire two-dimensional plane is meshed, and the kernel density estimate for each mesh point is calculated. For example, the system can divide the plane into a 100×100 mesh, calculate the kernel density estimate for each mesh point, and obtain a density field matrix.
[0107] After obtaining the density field distribution, the gradient of the density field is calculated, and points whose density gradient exceeds a preset gradient threshold are identified as boundary points. The preset gradient threshold can be set to 30% of the maximum gradient value of the density field. After identifying the boundary points through gradient calculation, the system connects these boundary points according to their positional relationships to form a closed deviation boundary curve. For example, after identifying 200 boundary points, they are connected sequentially according to the distance between them to form a closed curve surrounding the main body of the density distribution.
[0108] The predicted deviation value and historical predicted value corresponding to the boundary point are extracted along the deviation boundary curve. To handle the deviation characteristics of different predicted value intervals, the deviation boundary curve is divided into multiple curve segments according to the numerical range of historical predicted values. The division method can be to divide the historical predicted value range into several equal intervals, for example, dividing the predicted value range of 0-2000 into four intervals: 0-500, 501-1000, 1001-1500, and 1501-2000, corresponding to four curve segments on the deviation boundary curve.
[0109] For each curve segment, calculate the range of the predicted deviation values on that segment, which is the maximum deviation value minus the minimum deviation value, as the fluctuation range of that curve segment. For example, on the curve segment corresponding to the predicted value range of 501-1000, the maximum deviation value is +150 units and the minimum deviation value is -100 units, then the fluctuation range of that curve segment is 250 units.
[0110] Extract the historical predicted value range corresponding to each curve segment, establish a mapping relationship with the fluctuation range of the curve segment, and generate an interval fluctuation mapping table. The structure of the interval fluctuation mapping table includes two columns: the predicted value range and the corresponding fluctuation range. For example: the predicted value range 0-500 corresponds to a fluctuation range of 100 units; the predicted value range 501-1000 corresponds to a fluctuation range of 250 units; the predicted value range 1001-1500 corresponds to a fluctuation range of 320 units; and the predicted value range 1501-2000 corresponds to a fluctuation range of 400 units.
[0111] Once a new sales forecast is obtained, the forecast range to which the forecast value belongs is found in the range fluctuation mapping table, and the corresponding fluctuation amplitude is extracted. The upper and lower boundaries of the confidence interval are generated using the sales forecast value as the center and the fluctuation amplitude of the curve segment as the offset. For example, for an electronic product with a predicted sales volume of 1200 units, if the forecast value falls within the forecast range of 1001-1500, the corresponding fluctuation amplitude is 320 units, then the confidence interval for its sales forecast is 880-1520 units.
[0112] The preset gradient threshold and the granularity of the predicted value interval can be adjusted as needed to balance the accuracy of the confidence interval and the computational efficiency. If the predicted value interval is divided too finely, the sample size in each interval may be insufficient, affecting the reliability of the fluctuation amplitude estimation; if the division is too coarse, it will be unable to accurately capture the differences in the deviation characteristics of different predicted value intervals.
[0113] The confidence interval boundaries obtained by the above methods can provide a more reliable basis for inventory management and production planning, effectively reducing the risk of inventory backlog or stockouts caused by inaccurate sales forecasts.
[0114] like Figure 2 As shown, this embodiment illustrates the dynamic inventory management and replenishment decision-making process.
[0115] In one optional implementation, a dynamic safety stock benchmark is calculated based on the confidence interval boundary. The difference between the sales forecast and the current inventory level in the inventory status data is used as the basic gap. When the basic gap is lower than the dynamic safety stock benchmark, a safety compensation amount is added. The final replenishment requirement is obtained by combining historical sales data, including:
[0116] A two-layer time window is constructed based on historical sales data. The fluctuation characteristic value sequence and trend inflection point are calculated through the two-layer time window. The confidence interval boundary of the sales forecast is corrected in segments. The ratio of the corrected confidence interval boundary to the sales forecast is used as a dynamic risk factor. The dynamic safety stock benchmark is determined based on the product of the dynamic risk factor and the standard deviation of sales.
[0117] The difference between the sales forecast and the current inventory level is used to obtain the basic gap. The basic gap is combined with dynamic risk factors to construct an inventory state vector. A dynamic state transition map is constructed based on historical stockout records. The inventory state vector is input into the dynamic state transition map to obtain the evolution path of the inventory state and predict the risk level.
[0118] When the basic gap is lower than the dynamic safety stock benchmark, the inventory status vector and risk level are mapped to a multi-dimensional compensation space. In the multi-dimensional compensation space, an optimal compensation path is constructed based on historical cost-benefit data, and the safety compensation amount is calculated along the optimal compensation path.
[0119] The dynamic risk factor is used as a weighting coefficient to weight the historical sales data, and seasonal characteristics are extracted from the weighted historical sales data to obtain the seasonal adjustment amount.
[0120] The final replenishment demand is obtained by adding the basic gap, the safety compensation amount, and the seasonal adjustment amount.
[0121] This implementation calculates the fluctuation characteristic value sequence and trend inflection point by constructing a two-layer time window based on historical sales data. Specifically, historical sales data for product A over the past 12 months are extracted, with the inner window set to 30 days and the outer window to 90 days. For the inner window, the standard deviation of the average daily sales within the window is calculated to be 3.6 units; for the outer window, the standard deviation of the average daily sales within the window is calculated to be 5.2 units. By comparing the changes in the standard deviations of these two windows, the fluctuation characteristic value sequence is obtained as [0.69, 0.72, 0.65, 0.78, 0.81, 0.75, 0.73, 0.77, 0.83, 0.79, 0.74, 0.68]. When the fluctuation characteristic value changes from increasing to decreasing, i.e., from 0.81 to 0.75, this point is marked as the trend inflection point.
[0122] Based on the calculated fluctuation characteristic value sequence and trend inflection point, the confidence interval boundaries of the sales forecast are segmented and corrected. For example, the sales forecast for product A is 100 units / day, and the confidence interval given by the forecast model is [85, 115]. After detecting the trend inflection point, the upper boundary of the confidence interval for the next stage is increased by 5%, and the lower boundary is decreased by 3%, resulting in a corrected confidence interval of [82.45, 120.75]. The dynamic risk factor is calculated by the ratio of the corrected confidence interval boundary to the sales forecast value. The upper boundary risk factor is 1.2075, and the lower boundary risk factor is 0.8245. The dynamic safety stock benchmark is determined by multiplying the dynamic risk factor by the standard deviation of sales, i.e., the upper boundary safety stock is 1.2075 × 5.2 = 6.28 units, and the lower boundary safety stock is 0.8245 × 5.2 = 4.29 units.
[0123] The basic gap is calculated by subtracting the sales forecast from the current inventory level. Assuming the current inventory is 320 units, the sales forecast is 100 units / day, and no replenishment is expected within the next 5 days, the basic gap is 100 × 5 - 320 = -20 units, indicating a theoretical inventory surplus of 20 units. The basic gap of -20 is combined with dynamic risk factors [0.8245, 1.2075] to construct an inventory state vector [-20, 0.8245, 1.2075]. A dynamic state transition graph is constructed based on historical stockout records, recording the evolution of different inventory states. Inputting the inventory state vector into the dynamic state transition graph reveals a 25% probability that the current state will transition to a stockout state within the next 3 days, and the risk level is rated as "medium risk".
[0124] Since the basic gap of -20 is less than the dynamic safety stock baseline of 6.28 units, the inventory state vector [-20, 0.8245, 1.2075] is mapped to a three-dimensional compensation space along with the risk level "Medium Risk". In this space, the horizontal axis represents the basic gap value, the vertical axis represents the risk factor, and the depth axis represents the risk level. An optimal compensation path is constructed based on historical cost-benefit data, which represents the optimal amount of compensation to be made under different states. For the current state of commodity A, the safety compensation amount calculated along the optimal compensation path is 25 units.
[0125] The historical sales data were weighted using dynamic risk factors [0.8245, 1.2075]. Specifically, during periods of growth, the upper boundary risk factor of 1.2075 was used for weighting; during periods of decline, the lower boundary risk factor of 0.8245 was used. Analysis of the weighted historical sales data revealed that sales typically increase by approximately 15% in the second quarter of each year. Currently, we are within this seasonal cycle, therefore, the seasonal adjustment is calculated to be 100 × 15% = 15 units.
[0126] Finally, adding the basic shortage of -20 units, the safety stock of 25 units, and the seasonal adjustment of 15 units, we get the final replenishment requirement as -20 + 25 + 15 = 20 units. This means that although there is a theoretical surplus of 20 units in the current inventory, considering the safety stock requirement and seasonal factors, 20 units still need to be replenished to meet business needs.
[0127] For business scenarios with different risk appetites, the calculation method of dynamic risk factors can be adjusted. For example, for high-value, low-frequency product B, the risk weight is increased to [0.75, 1.35], the recalculated safety compensation quantity is 32 units, and the final replenishment requirement becomes 27 units; for low-value, high-frequency product C, the risk weight is decreased to [0.9, 1.1], the recalculated safety compensation quantity is 18 units, and the final replenishment requirement becomes 13 units.
[0128] This method allows for dynamic adjustments to replenishment strategies based on product characteristics, sales forecast accuracy, inventory status, and seasonal factors. It optimizes inventory costs while maintaining service levels, significantly improving the accuracy and adaptability of replenishment decisions.
[0129] In one optional implementation, a dynamic state transition graph is constructed based on historical stockout records. The inventory state vector is input into the dynamic state transition graph to obtain the evolution path of the inventory state, and the risk level is predicted, including:
[0130] Extract inventory status data from historical out-of-stock records, group the inventory status data into time series, and connect the grouped inventory status data in chronological order to form a status evolution sequence.
[0131] Density clustering is performed on the state evolution sequence to obtain the state transition pattern. Different inventory states are marked as state nodes in the state transition pattern. The transition probability and transition duration between the state nodes are calculated. The state nodes are used as graph nodes and the transition probability and transition duration are used as the connection attributes between nodes to construct a dynamic state transition graph.
[0132] The inventory state vector is input into the dynamic state transition graph. The target node with the highest similarity to the inventory state vector is retrieved from the state nodes of the dynamic state transition graph. Starting from the target node, multiple state evolution paths are extracted along the connection attributes between nodes. The path weight is calculated based on the transition probability in the multiple state evolution paths.
[0133] Calculate the historical out-of-stock probability corresponding to each state node in the state evolution path, combine the historical out-of-stock probability with the path weight to obtain the risk evolution trend, and predict the risk level based on the risk evolution trend.
[0134] This invention provides an inventory risk prediction method based on a dynamic state transition graph constructed from historical stockout records. By constructing a dynamic state transition graph, the method predicts the evolution path of inventory status and predicts the risk level based on the evolution path.
[0135] First, inventory status data is extracted from historical out-of-stock records. This data includes multi-dimensional features such as inventory quantity, sales volume, and replenishment cycle. For a specific product, inventory status data from the past 12 months is collected, including daily inventory quantity, average daily sales volume, replenishment cycle, and in-transit inventory. These features are combined to form an inventory status vector. For example, a product's status vector on a specific date might be [100, 20, 5, 30], indicating a current inventory of 100 units, average daily sales of 20 units, a replenishment cycle of 5 days, and 30 units in transit.
[0136] The inventory status data can be grouped by time, using a 7-day time window as a grouping method. For the status data within each time window, the average value is calculated as the representative status for that window. For example, the representative status for the first week is [90, 25, 5, 40], for the second week it is [70, 30, 5, 20], and so on. These representative statuses are then connected in chronological order to form a status evolution sequence.
[0137] Density clustering is performed on the resulting state evolution sequences to identify typical state transition patterns. A density-based clustering algorithm is used to cluster the inventory state vectors. By setting a clustering distance threshold of no more than 10 Euclidean distance between the vectors, similar inventory states are grouped into the same class. For example, states [90, 25, 5, 40] and [85, 28, 5, 42] are grouped into the same state node S1 because their distance is less than 10. Multiple state nodes are obtained after clustering, such as S1, S2, S3, etc.
[0138] Calculate the transition probability and transition duration between state nodes. The transition probability is calculated by statistically analyzing the frequency of transitions from one state node to another in the state sequence. For example, if state S1 occurs a total of 100 times, and transitions to S2 50 times, then the transition probability from S1 to S2 is 0.5. The transition duration is calculated as the average number of days between two state nodes; for example, the average transition time from S1 to S2 is 14 days.
[0139] Using state nodes as graph nodes, and employing transition probabilities and transition durations as connection attributes between nodes, a dynamic state transition graph is constructed. The graph contains nodes S1, S2, S3, etc. The connection attribute from S1 to S2 is [0.5, 14], indicating a transition probability of 0.5 and a transition duration of 14 days. The connection attribute from S1 to S3 is [0.3, 21], indicating a transition probability of 0.3 and a transition duration of 21 days.
[0140] Predict inventory risk using a constructed dynamic state transition graph. Input the current inventory state vector, such as [75, 27, 5, 35], and retrieve the target node in the graph with the highest similarity to the current state vector. Similarity is determined by calculating the Euclidean distance between vectors. Assuming the node most similar to the current state is S2, multiple possible state evolution paths are extracted from the graph starting from S2.
[0141] Starting from the target node, a depth-first search is used to extract evolution paths with a depth of no more than 3. For example, starting from S2, possible paths include: S2->S4->S7, S2->S5->S8, and S2->S6. For each path, a path weight is calculated based on the transition probabilities along the path. The weight of the path S2->S4->S7 is the transition probability from S2 to S4 multiplied by the transition probability from S4 to S7, i.e., 0.6 × 0.4 = 0.24.
[0142] Calculate the historical out-of-stock probability for each state node. For each state node, calculate the historical frequency of out-of-stock occurrences in that state. For example, if state S4 has occurred 200 times historically, with 60 of those occurrences resulting in an out-of-stock situation, then the historical out-of-stock probability for S4 is 0.3. The historical out-of-stock probability for state S7 is 0.7.
[0143] By combining historical out-of-stock probabilities with path weights, the risk evolution trend is obtained. For the path S2->S4->S7, the risk evolution trend is [0.15, 0.3, 0.7], indicating that the current risk is 0.15 (out-of-stock probability of S2), which may evolve to 0.3 (out-of-stock probability of S4) in the future, and may eventually reach 0.7 (out-of-stock probability of S7).
[0144] Predict risk levels based on risk evolution trends. Set risk thresholds, such as 0.2 for low risk, 0.2-0.5 for medium risk, and above 0.5 for high risk. Analyze the risk evolution trends of all possible paths. If most paths indicate that the risk will rise to the high-risk range, the predicted risk level is high; if the risk is mainly distributed in the medium range, the predicted risk level is medium; if the risk remains in the low-risk range, the predicted risk level is low.
[0145] In one optional implementation, the historical supply delay coefficient of the supplier is calculated. When the historical supply delay coefficient exceeds a preset delay threshold, a multi-supplier parallel replenishment mechanism is activated to proportionally allocate the final replenishment demand, generate multiple staggered purchase order data, and output purchase execution instructions, including:
[0146] Obtain the supplier's historical supply records, perform weighted processing on the historical supply records in chronological order, extract the actual arrival time of each order minus the agreed time to obtain the time deviation, and perform exponential weighted calculation on the time deviation to obtain the historical supply delay coefficient;
[0147] When the historical supply delay coefficient exceeds the preset delay threshold, the supply data and available capacity of the candidate suppliers are extracted from the qualified supplier database;
[0148] Calculate the historical delay coefficient of the candidate suppliers and normalize it to obtain the delivery timeliness score. Calculate the supply capacity score based on the ratio of the delivery timeliness score to the available capacity of each supplier. Select multiple suppliers that meet the final replenishment needs as a replenishment supplier combination in descending order of the supply capacity score.
[0149] The final replenishment demand is allocated based on the supply capacity scores of each supplier in the replenishment supplier portfolio to obtain the order allocation quantity, and it is verified whether the order allocation quantity exceeds the available capacity limit of each supplier.
[0150] Obtain the target delivery time for the final replenishment requirement, calculate the differentiated order lead time based on the historical supply delay coefficient of each supplier, generate purchase order data including order allocation quantity and order time, and output purchase execution instructions.
[0151] When calculating the historical delivery delay coefficient of a supplier, the supplier's historical delivery records are first obtained. These records include information such as supplier ID, order number, agreed delivery date, and actual delivery date. These records are then sorted by time series and assigned different weights according to their chronological order, with more recent delivery records receiving higher weights. For example, delivery records from the most recent month have a weight of 0.5, records from the previous 2-3 months have a weight of 0.3, and even earlier records have a weight of 0.2. The time deviation for each order is calculated, which is the number of days between the actual delivery date and the agreed delivery date. These time deviations are then exponentially weighted to obtain the historical delivery delay coefficient. Specifically, if supplier A's 10 orders from the most recent three months show 3 delivered 1 day early, 5 delivered on time, and 2 delivered 3 days late, then its weighted historical delivery delay coefficient is 0.3 days.
[0152] A preset delay threshold is set to 2 days. When the historical delivery delay coefficient of supplier A is detected to be lower than this threshold, the single-supplier mode continues to be used. When the historical delivery delay coefficient of another supplier, B, is found to be 2.5 days, exceeding the preset delay threshold, a multi-supplier parallel replenishment mechanism is activated. Information on candidate suppliers is extracted from the qualified supplier database, including supplier ID, historical delivery data, and current available capacity. Assume the system finds three candidate suppliers, C, D, and E, from the qualified supplier database, with maximum capacities of 500, 800, and 600 units respectively.
[0153] The historical delay coefficients for the three candidate suppliers were calculated to be 1.2 days, 0.8 days, and 1.5 days, respectively. These delay coefficients were then normalized to convert them into delivery timeliness scores. The normalization process used an inverse proportional calculation method; the smaller the delay coefficient, the higher the delivery timeliness score. After normalization, the delivery timeliness scores for suppliers C, D, and E were 0.83, 1.25, and 0.67, respectively. Furthermore, the available capacity of each supplier was combined to calculate a supply capacity score.
[0154] The supply capacity score is calculated as the ratio of the on-time delivery score to the available capacity, multiplied by a balancing factor of 100. The calculated supply capacity scores for suppliers C, D, and E are 166, 1000, and 402, respectively. Sorting the supply capacity scores from highest to lowest, the order is D, E, and C.
[0155] Assuming a final replenishment demand of 1500 units, this demand is allocated based on the supply capacity scores of suppliers D, E, and C. The allocation principle is to distribute order quantities according to the proportion of each supplier's supply capacity score to the total score. The total score is 1568, with suppliers D, E, and C accounting for 63.8%, 25.6%, and 10.6% of the score, respectively. Therefore, the initial allocated order quantities are 957, 384, and 159 units, respectively. The system verifies whether these allocated order quantities exceed the available capacity limits of each supplier. It finds that supplier D's allocation of 957 units exceeds its available capacity of 800 units. Therefore, D's allocation is adjusted to 800 units, and the remaining 157 units are redistributed according to the score proportions of E and C. The final order allocation quantities for D, E, and C are 800, 475, and 225 units, respectively.
[0156] The target delivery date for the final replenishment requirement is October 15th. Based on the historical supply delay coefficients of each supplier, differentiated order lead times are calculated. The order lead time equals the basic procurement cycle plus the historical supply delay coefficient multiplied by a safety factor of 1.2. Assuming a basic procurement cycle of 7 days, the order lead times for suppliers D, E, and C are 7.96 days, 8.8 days, and 8.44 days, respectively, rounded up to 8 days, 9 days, and 9 days. The system calculates the actual order dates as October 7th, October 6th, and October 6th, and generates purchase order data including order allocation and order time: Supplier D placed an order on October 7th with an order quantity of 800 units; Supplier E placed an order on October 6th with an order quantity of 475 units; and Supplier C placed an order on October 6th with an order quantity of 225 units.
[0157] The system outputs procurement execution instructions, including supplier IDs, contact information, order allocation quantities, order placement dates, and agreed delivery dates, and sends these instructions to the procurement department via the enterprise resource planning (ERP) system. The procurement department then communicates with each supplier based on these instructions to confirm order details and formally places the order on the designated date. It also monitors order execution, updates suppliers' historical supply records, and provides data support for future supplier evaluations. Through this mechanism, the company can effectively manage the risk of delayed delivery from a single supplier and ensure the timely supply of materials needed for production.
[0158] A second aspect of this invention provides an AI-based sales forecasting and intelligent replenishment system, the system comprising:
[0159] The first unit is used to acquire historical sales data, product feature data and inventory status data of the target product, decompose the historical sales data into time series to obtain sales influencing factors, and build an initial prediction model based on the sales influencing factors and product feature data.
[0160] The second unit is used to optimize the parameters of the initial prediction model by constructing a tree-like search space. When the prediction error exceeds the preset error threshold for N consecutive times, it backtracks to the optimal parameter combination to obtain the trained sales prediction model.
[0161] The third unit is used to input product feature data into the trained sales prediction model to obtain the sales prediction value, and to calculate the confidence interval boundary of the sales prediction value based on the prediction deviation distribution of historical sales data.
[0162] The fourth unit is used to calculate the dynamic safety stock benchmark based on the confidence interval boundary. The difference between the sales forecast value and the current inventory level in the inventory status data is used as the basic gap. When the basic gap is lower than the dynamic safety stock benchmark, a safety compensation amount is added, and the final replenishment requirement is obtained by combining historical sales data.
[0163] The fifth unit is used to calculate the historical supply delay coefficient of suppliers. When the historical supply delay coefficient exceeds the preset delay threshold, a multi-supplier parallel replenishment mechanism is activated to allocate the final replenishment demand proportionally, generate multiple staggered purchase order data, and output purchase execution instructions.
[0164] A third aspect of the present invention provides an electronic device, comprising:
[0165] processor;
[0166] Memory used to store processor-executable instructions;
[0167] The processor is configured to invoke instructions stored in the memory to execute the aforementioned method.
[0168] A fourth aspect of the present invention provides a computer-readable storage medium having stored thereon computer program instructions that, when executed by a processor, implement the aforementioned method.
[0169] This invention can be a method, apparatus, system, and / or computer program product. The computer program product may include a computer-readable storage medium having computer-readable program instructions loaded thereon for performing various aspects of the invention.
[0170] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention, and not to limit them; although the present invention has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that modifications can still be made to the technical solutions described in the foregoing embodiments, or equivalent substitutions can be made to some or all of the technical features; and these modifications or substitutions do not cause the essence of the corresponding technical solutions to deviate from the scope of the technical solutions of the embodiments of the present invention.
Claims
1. An AI-based sales forecasting and intelligent replenishment method, characterized in that, include: Acquire historical sales data, product feature data, and inventory status data of the target product; perform time-series decomposition on the historical sales data to obtain sales influencing factors; and construct an initial prediction model based on the sales influencing factors and product feature data. The parameters of the initial prediction model are optimized by constructing a tree-like search space. When the prediction error exceeds the preset error threshold for N consecutive times, the model is backtracked to the optimal parameter combination to obtain the trained sales prediction model. The product feature data is input into the trained sales prediction model to obtain the sales prediction value, and the confidence interval boundary of the sales prediction value is calculated based on the prediction deviation distribution of historical sales data. The dynamic safety stock benchmark is calculated based on the confidence interval boundary. The difference between the sales forecast value and the current inventory level in the inventory status data is used as the basic gap. When the basic gap is lower than the dynamic safety stock benchmark, a safety compensation amount is added, and the final replenishment requirement is obtained by combining historical sales data. Calculate the supplier's historical supply delay coefficient. When the historical supply delay coefficient exceeds the preset delay threshold, activate the multi-supplier parallel replenishment mechanism, allocate the final replenishment demand proportionally, generate multiple staggered purchase order data, and output purchase execution instructions. Historical sales data is decomposed into time-series factors to obtain sales influencing factors. An initial prediction model is then constructed based on these sales influencing factors and product characteristic data, including: Calculate the variance of historical sales data at different time granularities. When the ratio of variance of adjacent time granularities is less than a preset ratio threshold, it is determined to be the optimal decomposition granularity. Historical sales data are decomposed into multiple frequency band components at the optimal decomposition granularity. The energy value of each frequency band component is calculated. The frequency band components are sorted from high to low according to the energy value. The energy ratio between adjacent frequency band components after sorting is calculated. Frequency band components with energy ratios less than a preset threshold are merged into new frequency band components. The energy proportion of the new frequency band components is calculated as the recombination weight, and the sales impact factor is obtained by weighting the new frequency band components using the recombination weight. Attribute features are extracted from product feature data, the correlation coefficient between attribute features and sales influencing factors is calculated, the attribute features and sales influencing factors are weighted and combined based on the correlation coefficient, a feature sample matrix is constructed, the variance contribution rate of each feature in the feature sample matrix is calculated, and features with variance contribution rates higher than a preset contribution threshold are selected to construct an optimized feature set. The optimized feature set is mapped to input layer nodes, and the prediction time window is mapped to output layer nodes to construct the initial prediction model.
2. The method according to claim 1, characterized in that, The parameters of the initial prediction model are optimized by constructing a tree-like search space. When the prediction error exceeds a preset error threshold for N consecutive times, the model backtracks to the optimal parameter combination, resulting in a fully trained sales prediction model including: The training parameters of the initial prediction model are divided into multiple levels. The information entropy gain between adjacent levels is calculated to obtain the level dependency strength. Based on the level dependency strength, level nodes and connection relationships are constructed in the tree search space. Starting from the root node of the hierarchical nodes, the training parameters are searched layer by layer and the prediction error is calculated. When the prediction error exceeds the preset error threshold for N consecutive times, the corresponding training parameter vectors are extracted. Kernel principal component analysis is used to calculate the nonlinear coupling degree matrix between the training parameter vectors. Based on the nonlinear coupling degree matrix, the training parameters with coupling degree exceeding the preset coupling threshold are combined into parameter coupling groups. Create coupled child nodes under the current level node, construct an adaptive search step size matrix based on the nonlinear coupling degree matrix, and use the adaptive search step size matrix to jointly optimize the parameter coupling group; The training parameter vector is mapped to a failure point cloud, and the principal component directions of the failure point cloud are extracted. Backtracking in the opposite direction of the principal component direction to the training parameter combination with the smallest prediction error is used as the optimal parameter combination for further optimization until the prediction error is less than a preset error threshold, thus obtaining the trained sales prediction model.
3. The method according to claim 1, characterized in that, The product feature data is input into the trained sales prediction model to obtain the sales prediction value. The confidence interval boundary of the sales prediction value is calculated based on the prediction deviation distribution of historical sales data, including: The product feature data is input into the trained sales prediction model to obtain the sales prediction value; Extract the prediction deviation distribution of historical sales data, construct a two-dimensional scatter distribution by combining the prediction deviation values in the prediction deviation distribution with the corresponding historical prediction values, perform kernel density estimation on the two-dimensional scatter distribution to obtain the density field distribution, identify boundary points in the density field distribution where the density gradient exceeds a preset gradient threshold, and connect the boundary points to form a deviation boundary curve. Extract the predicted deviation value and historical predicted value corresponding to the boundary point along the deviation boundary curve. Divide the deviation boundary curve into multiple curve segments according to the numerical range of the historical predicted value. Calculate the range of the predicted deviation value on each curve segment as the fluctuation amplitude of the curve segment. Extract the historical predicted value range corresponding to each curve segment as the predicted value interval, and establish a mapping relationship between the predicted value interval and the fluctuation amplitude of the curve segment to obtain the interval fluctuation mapping table. Find the predicted value range to which the sales forecast value belongs in the interval fluctuation mapping table, extract the fluctuation amplitude of the curve segment corresponding to the predicted value range, and generate the confidence interval boundary with the sales forecast value as the center and the fluctuation amplitude of the curve segment as the offset.
4. The method according to claim 1, characterized in that, The dynamic safety stock benchmark is calculated based on the confidence interval boundaries. The difference between the sales forecast and the current inventory level in the inventory status data is used as the basic gap. When the basic gap is lower than the dynamic safety stock benchmark, a safety compensation amount is added. The final replenishment requirement is obtained by combining historical sales data, including: A two-layer time window is constructed based on historical sales data. The fluctuation characteristic value sequence and trend inflection point are calculated through the two-layer time window. The confidence interval boundary of the sales forecast is corrected in segments. The ratio of the corrected confidence interval boundary to the sales forecast is used as a dynamic risk factor. The dynamic safety stock benchmark is determined based on the product of the dynamic risk factor and the standard deviation of sales. The difference between the sales forecast and the current inventory level is used to obtain the basic gap. The basic gap is combined with dynamic risk factors to construct an inventory state vector. A dynamic state transition map is constructed based on historical stockout records. The inventory state vector is input into the dynamic state transition map to obtain the evolution path of the inventory state and predict the risk level. When the basic gap is lower than the dynamic safety stock benchmark, the inventory status vector and risk level are mapped to a multi-dimensional compensation space. In the multi-dimensional compensation space, an optimal compensation path is constructed based on historical cost-benefit data, and the safety compensation amount is calculated along the optimal compensation path. The dynamic risk factor is used as a weighting coefficient to weight the historical sales data, and seasonal characteristics are extracted from the weighted historical sales data to obtain the seasonal adjustment amount. The final replenishment demand is obtained by adding the basic gap, the safety compensation amount, and the seasonal adjustment amount.
5. The method according to claim 1, characterized in that, A dynamic state transition graph is constructed based on historical stockout records. The inventory state vector is input into the dynamic state transition graph to obtain the evolution path of the inventory state and predict the risk level, including: Extract inventory status data from historical out-of-stock records, group the inventory status data into time series, and connect the grouped inventory status data in chronological order to form a status evolution sequence. Density clustering is performed on the state evolution sequence to obtain the state transition pattern. Different inventory states are marked as state nodes in the state transition pattern. The transition probability and transition duration between the state nodes are calculated. The state nodes are used as graph nodes and the transition probability and transition duration are used as the connection attributes between nodes to construct a dynamic state transition graph. The inventory state vector is input into the dynamic state transition graph. The target node with the highest similarity to the inventory state vector is retrieved from the state nodes of the dynamic state transition graph. Starting from the target node, multiple state evolution paths are extracted along the connection attributes between nodes. The path weight is calculated based on the transition probability in the multiple state evolution paths. Calculate the historical out-of-stock probability corresponding to each state node in the state evolution path, combine the historical out-of-stock probability with the path weight to obtain the risk evolution trend, and predict the risk level based on the risk evolution trend.
6. The method according to claim 1, characterized in that, Calculate the supplier's historical delivery delay coefficient. When the historical delivery delay coefficient exceeds a preset delay threshold, activate a multi-supplier parallel replenishment mechanism to proportionally allocate the final replenishment demand, generate multiple staggered purchase order data, and output purchase execution instructions, including: Obtain the supplier's historical supply records, perform weighted processing on the historical supply records in chronological order, extract the actual arrival time of each order minus the agreed time to obtain the time deviation, and perform exponential weighted calculation on the time deviation to obtain the historical supply delay coefficient; When the historical supply delay coefficient exceeds the preset delay threshold, the supply data and available capacity of the candidate suppliers are extracted from the qualified supplier database; Calculate the historical delay coefficient of the candidate suppliers and normalize it to obtain the delivery timeliness score. Calculate the supply capacity score based on the ratio of the delivery timeliness score to the available capacity of each supplier. Select multiple suppliers that meet the final replenishment needs as a replenishment supplier combination in descending order of the supply capacity score. The final replenishment demand is allocated based on the supply capacity scores of each supplier in the replenishment supplier portfolio to obtain the order allocation quantity, and it is verified whether the order allocation quantity exceeds the available capacity limit of each supplier. Obtain the target delivery time for the final replenishment requirement, calculate the differentiated order lead time based on the historical supply delay coefficient of each supplier, generate purchase order data including order allocation quantity and order time, and output purchase execution instructions.
7. An AI-based sales forecasting and intelligent replenishment system, used to implement the method of any one of claims 1-6, characterized in that, include: The first unit is used to acquire historical sales data, product feature data and inventory status data of the target product, decompose the historical sales data into time series to obtain sales influencing factors, and build an initial prediction model based on the sales influencing factors and product feature data. The second unit is used to optimize the parameters of the initial prediction model by constructing a tree-like search space. When the prediction error exceeds the preset error threshold for N consecutive times, it backtracks to the optimal parameter combination to obtain the trained sales prediction model. The third unit is used to input product feature data into the trained sales prediction model to obtain the sales prediction value, and to calculate the confidence interval boundary of the sales prediction value based on the prediction deviation distribution of historical sales data. The fourth unit is used to calculate the dynamic safety stock benchmark based on the confidence interval boundary. The difference between the sales forecast value and the current inventory level in the inventory status data is used as the basic gap. When the basic gap is lower than the dynamic safety stock benchmark, a safety compensation amount is added, and the final replenishment requirement is obtained by combining historical sales data. The fifth unit is used to calculate the historical supply delay coefficient of suppliers. When the historical supply delay coefficient exceeds the preset delay threshold, a multi-supplier parallel replenishment mechanism is activated to allocate the final replenishment demand proportionally, generate multiple staggered purchase order data, and output purchase execution instructions.
8. An electronic device, characterized in that, include: processor; Memory used to store processor-executable instructions; The processor is configured to invoke instructions stored in the memory to execute the method according to any one of claims 1 to 6.
9. A computer-readable storage medium having computer program instructions stored thereon, characterized in that, When the computer program instructions are executed by the processor, they implement the method described in any one of claims 1 to 6.