A user demand prediction and inventory optimization method based on deep learning
By constructing a demand forecasting feature matrix and an improved TiDE forecasting model, the problem of insufficient correlation between user demand forecasting and inventory optimization was solved. This enabled the reliability verification of demand forecasting results and dynamic adjustment of inventory status, improving the efficiency and accuracy of inventory management and reducing inventory risks.
Patent Information
- Application Number
- CN202610799745.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2026-06-04
- Publication Date
- 2026-08-25
AI Technical Summary
Existing technologies fail to fully reflect the correlation between changes in user behavior, changes in inventory status, and factors affecting replenishment cycles in user demand forecasting and inventory optimization. They lack verification of the reliability of demand forecast results and cannot dynamically adjust inventory control methods, which can easily lead to increased risks of inventory backlog or stockouts.
A demand forecasting feature matrix integrating user behavior, demand characteristics, and inventory status is constructed. An improved forward TiDE forecasting model and an improved reverse TiDE forecasting model are adopted to establish a two-way forecasting mechanism for demand evolution and inventory response patterns. The demand forecasting interval is constructed through trajectory consistency verification, and the upper and lower limits of inventory are dynamically determined in combination with risk assessment, so as to achieve closed-loop collaborative control of demand forecasting, inventory optimization, and model self-updating.
It significantly improves the accuracy of demand forecasting and the efficiency of inventory management, enhances the ability to express the correlation between changes in user behavior and changes in product demand, improves the credibility and stability of demand forecasting results, dynamically matches the range of inventory constraints with the characteristics of demand fluctuations, and reduces inventory risk.
Smart Images

Figure CN122636083A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the fields of deep learning and inventory optimization technology, and in particular to a deep learning-based method for user demand prediction and inventory optimization. Background Technology
[0002] With the rapid development of e-commerce, smart retail, and supply chain digitalization technologies, enterprises are increasingly demanding higher accuracy in user demand forecasting and higher efficiency in inventory management. User demand forecasting and inventory optimization have become key aspects of supply chain management. Existing technologies typically employ statistical forecasting models, machine learning models, or deep learning time-series forecasting models to analyze historical sales data and combine this with inventory status and replenishment rules to make replenishment decisions, thereby automating inventory management and controlling operational costs.
[0003] In existing technologies, most demand forecasting methods primarily rely on historical sales data to construct unidirectional forecasting models, fitting future demand trends through sales sequences. While this can improve forecast accuracy to some extent, it fails to adequately utilize the correlations between changes in user behavior, inventory status, and replenishment cycle factors, making it difficult to fully reflect the actual evolution of demand. Furthermore, existing inventory optimization methods typically separate demand forecasting from inventory decisions, directly using forecast results as the basis for inventory control. This lack of a mechanism to assess the reliability of forecast results and the inability to use inventory changes to backtest demand forecasts is problematic. In addition, most existing deep learning forecasting models focus on improving forecast accuracy, lacking the ability to collaboratively model demand change patterns and inventory response patterns, making it difficult to establish a dynamic correlation between demand forecast results and inventory status changes. Regarding inventory risk analysis, most methods use fixed safety stock or static thresholds for inventory control, failing to dynamically adjust upper and lower inventory limits based on changes in demand forecast uncertainty, easily leading to increased inventory backlog or stockout risks. For model updates, existing technologies typically use a single forecast error for unified training, lacking differentiated feedback mechanisms for demand evolution and inventory response patterns, making it difficult to continuously adapt to dynamic changes in user demand and inventory status.
[0004] Therefore, how to provide a deep learning-based method for user demand prediction and inventory optimization is a problem that urgently needs to be solved by those skilled in the art. Summary of the Invention
[0005] One objective of this invention is to propose a deep learning-based method for user demand forecasting and inventory optimization. This invention constructs a demand forecasting feature matrix that integrates user behavior, demand characteristics, inventory status, and replenishment lead time information. It introduces an improved forward TiDE forecasting model and an improved reverse TiDE forecasting model to establish a bidirectional forecasting mechanism for demand evolution and inventory response patterns, respectively. By constructing a demand forecasting interval through trajectory consistency verification and combining demand uncertainty to calculate stockout and overstock risk values, it dynamically determines upper and lower inventory limits, achieving closed-loop collaborative control of demand forecasting, inventory optimization, and model self-updating, thereby improving the accuracy of demand forecasting and the efficiency of inventory management.
[0006] A user demand prediction and inventory optimization method based on deep learning according to an embodiment of the present invention includes the following steps:
[0007] Step 1: Collect user behavior data, product sales data, inventory status data, and replenishment lead time data. Perform multi-time granularity encoding processing on the user behavior data to obtain multi-granularity user behavior embeddings.
[0008] Step 2: Perform time series decomposition on the commodity sales data to obtain trend components, periodic components, and abnormal fluctuation components, forming a demand characteristic sequence;
[0009] Step 3: Perform feature fusion on the multi-granularity user behavior embedding, demand feature sequence, inventory status data, and replenishment lead time data to construct a demand prediction feature matrix;
[0010] Step 4: Input the demand forecast feature matrix into the improved forward TiDE forecasting model to predict the demand sequence, and input the inventory status data into the improved reverse TiDE forecasting model to reverse the demand sequence, thereby obtaining the forward demand forecast sequence and the reverse demand forecast sequence.
[0011] Step 5: Perform a consistency check on the forward demand forecast sequence and the reverse demand forecast sequence, and construct a demand forecast interval based on the check results;
[0012] Step Six: Calculate the stockout risk value and overstock risk value based on the demand forecast range, inventory status data, and replenishment lead time data, and determine the dynamic inventory upper and lower limits based on the stockout risk value and overstock risk value;
[0013] Step 7: Calculate the replenishment quantity based on the dynamic inventory upper and lower limits, demand forecast range, and replenishment lead time data, and update the forward TiDE prediction model and the reverse TiDE prediction model according to actual sales data, return data, and inventory change data.
[0014] Optionally, step one specifically includes:
[0015] Collect user behavior data, product sales data, inventory status data, and replenishment lead time data. The user behavior data includes user identifier, product identifier, behavior type, behavior timestamp, and behavior frequency. The behavior types include browsing behavior, clicking behavior, favorites behavior, adding to cart behavior, purchasing behavior, and return behavior.
[0016] The user behavior data is grouped according to user identifier and product identifier, and each group of user behavior data is sorted in ascending order according to behavior timestamp to form a user-product behavior time series;
[0017] The basic time granularity is determined based on the median time interval between adjacent orders in the product sales data. The user-product behavior time series is then sliced according to the basic time granularity, three times the basic time granularity, and seven times the basic time granularity to form short-term behavior segments, medium-term behavior segments, and long-term behavior segments.
[0018] The number of behaviors corresponding to each behavior type within the short-term behavior segment, the medium-term behavior segment, and the long-term behavior segment is counted respectively. The conversion number between adjacent behavior types and the corresponding behavior time interval are calculated according to the time order of browsing behavior, clicking behavior, favorite behavior, adding to cart behavior, purchasing behavior, and returning behavior. The behavior conversion intensity value is calculated based on the conversion number and the behavior time interval.
[0019] A behavior conversion matrix is constructed based on the number of behaviors, the number of conversions, and the behavior conversion intensity value. Time decay weighting and normalization processing are performed on the behavior conversion matrix to form short-term behavior embedding, medium-term behavior embedding, and long-term behavior embedding.
[0020] The short-term behavior embedding, the medium-term behavior embedding, and the long-term behavior embedding are subjected to cascaded fusion processing to obtain multi-granularity user behavior embedding.
[0021] Optionally, step two specifically involves:
[0022] The product sales data are grouped according to product identifiers and sorted in ascending order according to sales timestamps to form a product sales time series.
[0023] The product sales time series is segmented using a sliding time window, and the mean sales volume, median sales volume, and sales volume change rate within each time window are calculated to form a local statistical series.
[0024] Long-term change extraction processing is performed on the local statistical sequence to merge sequence segments where the average sales value increases or decreases continuously within a continuous time window, forming a trend component sequence;
[0025] Calculate the autocorrelation coefficient of the commodity sales time series at different time intervals, and select the time interval with the maximum autocorrelation coefficient as the period length;
[0026] Calculate the difference between sales values corresponding to the same period position based on the period length, and construct a period component sequence based on the difference;
[0027] Subtract the trend component value and periodic component value at the corresponding time from the sales value in the product sales time series to obtain the remaining sales fluctuation value, and form an abnormal fluctuation component sequence based on the remaining sales fluctuation value.
[0028] The trend component sequence, the periodic component sequence, and the abnormal fluctuation component sequence are time-aligned and then cascaded in chronological order to form a demand feature sequence.
[0029] Optionally, step three specifically includes:
[0030] The multi-granularity user behavior embedding and the demand feature sequence are time-aligned, and a behavior demand association sequence is constructed based on the same time index.
[0031] Calculate the amount of behavioral change and the amount of demand change corresponding to each time index in the behavioral demand association sequence, and construct a behavioral demand association strength sequence based on the number of times the behavioral change and the demand change are in the same direction and the difference in the magnitude of the change.
[0032] The inventory status data is analyzed over time to extract the inventory quantity change sequence, inventory turnover sequence, and inventory fluctuation sequence.
[0033] The inventory coverage period is calculated based on the replenishment lead time data and the inventory quantity change sequence, and an inventory timeliness constraint sequence is constructed based on the inventory coverage period;
[0034] The behavioral demand correlation strength sequence, the demand feature sequence, the inventory quantity change sequence, the inventory turnover sequence, the inventory fluctuation sequence, and the inventory timeliness constraint sequence are vector-encoded to form a multi-source feature vector;
[0035] The multi-source feature vectors are cascaded and fused in chronological order to construct a demand prediction feature matrix.
[0036] Optional, the improved positive TiDE prediction model is as follows:
[0037] The improved forward TiDE prediction model includes a TiDE encoder, a demand evolution constraint module, and a TiDE decoder;
[0038] Input the demand prediction feature matrix into the TiDE encoder;
[0039] The TiDE encoder uses a multi-layer residual fully connected network to perform feature mapping on the demand prediction feature matrix to form a historical demand implicit state sequence.
[0040] Input the historical implicit state sequence of demands into the demand evolution constraint module;
[0041] The state change sequence is obtained by performing difference calculation on the state vectors corresponding to adjacent time positions in the historical demand implicit state sequence;
[0042] Construct a demand evolution trajectory based on the sign distribution and difference of change values corresponding to adjacent time positions in the state change sequence;
[0043] Calculate the demand evolution state vector corresponding to each time position based on the demand evolution trajectory;
[0044] The historical demand implicit state sequence and the demand evolution state vector are concatenated according to their corresponding time positions, and a linear mapping process is performed to form an evolution constraint implicit state sequence.
[0045] The evolutionary constraint hidden state sequence is input into the TiDE decoder;
[0046] The TiDE decoder uses a multi-layer residual fully connected network to perform time-expanded processing on the evolution constraint latent state sequence to obtain a positive demand prediction sequence.
[0047] Optionally, the improved inverse TiDE prediction model is as follows:
[0048] The improved inverse TiDE prediction model includes a TiDE encoder, an inventory response constraint module, and a TiDE decoder;
[0049] Input the inventory status data into the TiDE encoder;
[0050] The TiDE encoder uses a multi-layer residual fully connected network to perform feature mapping processing on the inventory status data, forming an inventory hidden state sequence.
[0051] Input the implicit inventory state sequence into the inventory response constraint module;
[0052] By performing difference calculation on the state vectors corresponding to adjacent time positions in the implicit inventory state sequence, an inventory change sequence can be obtained;
[0053] Construct an inventory response trajectory based on the sign distribution of changes at adjacent time positions in the inventory change sequence, the difference in changes, and the rate of inventory change.
[0054] The trajectory features corresponding to each time position in the inventory response trajectory are vector encoded to form an inventory response state vector.
[0055] The inventory response state vector is concatenated with the inventory implicit state sequence at the corresponding time position, and a linear mapping process is performed to form a response constraint implicit state sequence.
[0056] Input the implicit state sequence of the response constraints into the TiDE decoder;
[0057] The TiDE decoder uses a multi-layer residual fully connected network to perform time-expanded processing on the response constraint implicit state sequence to obtain the reverse demand prediction sequence.
[0058] Optionally, step five specifically includes:
[0059] Perform time position matching processing on the forward demand forecast sequence and the reverse demand forecast sequence;
[0060] The changes in the predicted values corresponding to adjacent time positions in the forward demand forecast sequence and the changes in the predicted values corresponding to adjacent time positions in the reverse demand forecast sequence are calculated respectively to form a forward change sequence and a reverse change sequence.
[0061] A demand evolution trajectory is constructed based on the positive change sequence, and an inventory response trajectory is constructed based on the negative change sequence;
[0062] Calculate the difference between the corresponding changes in the demand evolution trajectory and the inventory response trajectory at the same time position, as well as the consistent marker of the change direction, to form a trajectory consistency sequence;
[0063] A trajectory consistency score is calculated based on the trajectory consistency sequence, and a consistency weight sequence is formed based on the trajectory consistency score.
[0064] The positive demand forecast sequence and the negative demand forecast sequence are weighted and fused according to the consistency weight sequence to form a fused demand forecast sequence;
[0065] Demand forecast intervals are constructed based on the fused demand forecast sequence and the forecast difference between the forward demand forecast sequence and the reverse demand forecast sequence.
[0066] Optionally, step six specifically includes:
[0067] Obtain the upper and lower boundary values of the demand forecast interval, and calculate the interval width between the upper and lower boundary values to form a demand uncertainty sequence;
[0068] Perform time-series analysis on the inventory status data to extract the current inventory level, in-transit inventory level, and inventory change rate;
[0069] The replenishment lead time requirement is calculated based on the inventory change rate and the replenishment lead time data, and the replenishment lead time coverage inventory is calculated based on the current inventory, the inventory in transit, and the replenishment lead time requirement.
[0070] The difference between the upper boundary value of the demand forecast interval and the inventory covered by the replenishment lead time is calculated according to the same forecast period to form a stockout risk difference sequence.
[0071] Calculate the difference between the inventory covered by the replenishment lead time and the lower boundary value of the demand forecast interval according to the same forecast period, and form a backlog risk difference sequence.
[0072] The demand uncertainty sequence and the stockout risk difference sequence are weighted and combined to form a stockout risk value, and the demand uncertainty sequence and the backlog risk difference sequence are weighted and combined to form a backlog risk value.
[0073] The dynamic inventory lower limit and dynamic inventory upper limit are determined based on the stockout risk value, the backlog risk value, and the demand uncertainty sequence.
[0074] Optionally, step seven specifically includes:
[0075] Obtain the dynamic inventory upper limit, the dynamic inventory lower limit, and the demand forecast range;
[0076] The differences between the upper boundary value of the demand forecast interval and the upper limit of the dynamic inventory, and the differences between the lower boundary value of the demand forecast interval and the lower limit of the dynamic inventory are calculated respectively to form an inventory deviation sequence;
[0077] Based on the direction and magnitude of the changes in the inventory deviation sequence within the continuous forecast period, and combined with the replenishment lead time data, a replenishment decision trajectory is constructed.
[0078] Calculate the replenishment quantity for each forecast period based on the replenishment decision trajectory;
[0079] Collect actual sales data, return data, and inventory change data within the corresponding forecast period, and perform correlation mapping processing according to time sequence to construct an actual demand sequence;
[0080] Calculate the prediction deviation between the actual demand sequence and the forward demand forecast sequence, and the prediction deviation between the actual demand sequence and the reverse demand forecast sequence, respectively.
[0081] The demand evolution state vector in the improved positive TiDE prediction model is adjusted according to the prediction deviation.
[0082] The inventory response state vector in the improved inverse TiDE forecasting model is adjusted based on the forecast bias.
[0083] The beneficial effects of this invention are:
[0084] This invention constructs a demand forecasting feature matrix that integrates multi-granularity user behavior embeddings, demand feature sequences, inventory status data, and replenishment lead time data. Combined with the collaborative design of an improved forward TiDE forecasting model and an improved backward TiDE forecasting model, it addresses the problems of insufficient utilization of user behavior information, lack of reliability verification of demand forecasting results, and low correlation between inventory decisions and demand forecasting in existing demand forecasting methods. It proposes a multi-source feature fusion strategy based on behavior conversion intensity modeling, multi-timescale behavior encoding, and demand evolution feature extraction, significantly enhancing the ability to express the correlation between changes in user behavior and changes in product demand. In the demand forecasting stage, a demand evolution constraint module and an inventory response constraint module are introduced. By constructing demand evolution trajectories and inventory response trajectories, explicit encoding of demand change patterns and inventory change patterns is achieved. Furthermore, a bidirectional TiDE forecasting structure is used to generate forward demand forecasting sequences and backward TiDE forecasting sequences, respectively. The system generates a demand forecast sequence; in the forecast result processing stage, a trajectory consistency verification mechanism is constructed, which generates a consistency weight sequence by matching the demand evolution trajectory with the inventory response trajectory, and constructs a demand forecast interval by combining the forecast differences between the two-way forecast results, effectively improving the credibility and stability of the demand forecast results; in the inventory optimization stage, a risk assessment mechanism driven by demand uncertainty is introduced, which calculates the stockout risk value and backlog risk value based on the demand forecast interval, inventory coverage capacity, and replenishment lead time information, and dynamically determines the upper and lower limits of inventory to achieve adaptive matching between the inventory constraint range and the characteristics of demand fluctuations; finally, a replenishment decision trajectory is constructed by combining the inventory deviation sequence, and the improved forward TiDE forecast model and the improved reverse TiDE forecast model are independently updated using actual sales data, return data, and inventory change data, to achieve closed-loop collaborative control of demand forecasting, inventory optimization, and model self-updating. Attached Figure Description
[0085] The accompanying drawings are provided to further illustrate the invention and form part of the specification. They are used in conjunction with embodiments of the invention to explain the invention and do not constitute a limitation thereof. In the drawings:
[0086] Figure 1 This is a schematic diagram of the overall process of a deep learning-based user demand prediction and inventory optimization method proposed in this invention.
[0087] Figure 2This is a schematic diagram of the structure of the improved inverse TiDE prediction model in the deep learning-based user demand prediction and inventory optimization method proposed in this invention. Detailed Implementation
[0088] The present invention will now be described in further detail with reference to the accompanying drawings. These drawings are simplified schematic diagrams, illustrating only the basic structure of the invention, and therefore only show the components relevant to the invention.
[0089] refer to Figures 1-2 A deep learning-based method for user demand prediction and inventory optimization includes the following steps:
[0090] Step 1: Collect user behavior data, product sales data, inventory status data, and replenishment lead time data. Perform multi-time granularity encoding on the user behavior data to obtain multi-granularity user behavior embeddings.
[0091] Step 2: Perform time series decomposition on the commodity sales data to obtain trend components, periodic components, and abnormal fluctuation components, forming a demand characteristic sequence;
[0092] Step 3: Integrate multi-granular user behavior embeddings, demand feature sequences, inventory status data, and replenishment lead time data to construct a demand forecast feature matrix;
[0093] Step 4: Input the demand forecast feature matrix into the improved forward TiDE forecasting model to forecast the demand sequence, and input the inventory status data into the improved reverse TiDE forecasting model to reverse the demand sequence, thereby obtaining the forward demand forecast sequence and the reverse demand forecast sequence.
[0094] Step 5: Perform consistency verification on the forward demand forecast sequence and the reverse demand forecast sequence, and construct the demand forecast interval based on the verification results;
[0095] Step 6: Calculate the stockout risk value and overstock risk value based on the demand forecast range, inventory status data, and replenishment lead time data, and determine the upper and lower limits of dynamic inventory based on the stockout risk value and overstock risk value;
[0096] Step 7: Calculate the replenishment quantity based on dynamic inventory upper and lower limits, demand forecast range, and replenishment lead time data, and update the forward TiDE forecasting model and the reverse TiDE forecasting model based on actual sales data, return data, and inventory change data.
[0097] In this embodiment, step one specifically includes:
[0098] Collect user behavior data, product sales data, inventory status data, and replenishment lead time data. User behavior data includes user identifier, product identifier, behavior type, behavior timestamp, and number of behaviors. Behavior types include browsing behavior, clicking behavior, favorites behavior, adding to cart behavior, purchasing behavior, and return behavior.
[0099] User behavior data is grouped according to user ID and product ID, and each group of user behavior data is sorted in ascending order according to behavior timestamp to form a user-product behavior time series;
[0100] The basic time granularity is determined based on the median time interval between adjacent orders in the product sales data. The user-product behavior time series is then sliced according to the basic time granularity, three times the basic time granularity, and seven times the basic time granularity to form short-term behavior segments, medium-term behavior segments, and long-term behavior segments.
[0101] The number of behaviors corresponding to each behavior type within the short-term, medium-term, and long-term behavior segments is counted separately. The conversion count between adjacent behavior types and the corresponding time interval are calculated according to the time sequence of browsing, clicking, favorites, adding to cart, purchasing, and returning behaviors. The behavior conversion intensity value is calculated based on the conversion count and the time interval.
[0102] A behavior conversion matrix is constructed based on the number of behaviors, the number of conversions, and the behavior conversion intensity value. Time decay weighting and normalization are performed on the behavior conversion matrix to form short-term behavior embedding, medium-term behavior embedding, and long-term behavior embedding.
[0103] Cascaded fusion processing is performed on short-term behavior embeddings, medium-term behavior embeddings, and long-term behavior embeddings to obtain multi-granularity user behavior embeddings.
[0104] In this implementation, multi-granularity user behavior embedding calculates the number of behaviors, the number of adjacent behavior conversions, and the time interval between behaviors within short-term, medium-term, and long-term behavior segments to generate a behavior conversion intensity matrix. Time decay weighting is then used to highlight the impact of recent high-frequency behaviors. Subsequently, behavior embeddings of different time granularities are cascaded and fused to form a unified feature representation, which is used to input subsequent forward TiDE and reverse TiDE prediction models. This enables continuous encoding of user behavior information across multiple time scales and inventory risk-sensitive modeling, thereby supporting end-to-end technical implementation of demand forecasting and inventory optimization.
[0105] In this embodiment, step two specifically involves:
[0106] The product sales data are grouped according to the product identifier and sorted in ascending order according to the sales timestamp to form a product sales time series;
[0107] A sliding time window is used to segment the sales time series of goods, and the mean sales, median sales and sales change rate in each time window are calculated to form a local statistical series.
[0108] Long-term change extraction processing is performed on local statistical sequences, merging sequence segments where the average sales value increases or decreases continuously within a continuous time window to form trend component sequences;
[0109] Calculate the autocorrelation coefficient of the product sales time series at different time intervals, and select the time interval with the maximum autocorrelation coefficient as the period length.
[0110] Calculate the difference between sales values corresponding to the same period position based on the period length, and construct a period component sequence based on the difference;
[0111] Subtract the trend component value and periodic component value at the corresponding time from the sales value in the product sales time series to obtain the remaining sales fluctuation value, and form an abnormal fluctuation component sequence based on the remaining sales fluctuation value.
[0112] The trend component sequence, periodic component sequence, and abnormal fluctuation component sequence are time-aligned and then cascaded and combined in chronological order to form a demand characteristic sequence.
[0113] In this implementation, the time series decomposition process adopts an adaptive period identification mechanism. The period length is determined based on the correlation changes of the product sales time series at multiple candidate time intervals, and the extraction range of trend components and periodic components is adjusted synchronously in combination with the sales change characteristics in the local statistical sequence. For sudden increases or decreases in sales and non-periodic fluctuations caused by promotional activities, the continuous distribution characteristics of the remaining sales fluctuation values are used for identification, and the fluctuation information at the corresponding time position is retained. The trend component sequence, periodic component sequence, and abnormal fluctuation component sequence are mapped using a unified time index, so that the component values at each time point maintain a one-to-one correspondence with the original sales records, forming a required feature sequence suitable for joint training of the forward TiDE prediction model and the reverse TiDE prediction model.
[0114] In this embodiment, step three specifically includes:
[0115] Time alignment processing is performed on multi-granularity user behavior embeddings and demand feature sequences, and behavior demand association sequences are constructed based on the same time index;
[0116] Calculate the behavioral change and demand change corresponding to each time index in the behavioral demand association sequence, and construct a behavioral demand association strength sequence based on the number of times the behavioral change and demand change are in the same direction and the difference in the magnitude of change.
[0117] Perform time-series analysis on inventory status data to extract inventory quantity change sequence, inventory turnover sequence, and inventory fluctuation sequence;
[0118] The inventory coverage period is calculated based on replenishment lead time data and inventory quantity change sequence, and an inventory timeliness constraint sequence is constructed based on the inventory coverage period;
[0119] Vector encoding is performed on the behavioral demand correlation strength sequence, demand characteristic sequence, inventory quantity change sequence, inventory turnover sequence, inventory fluctuation sequence, and inventory timeliness constraint sequence to form a multi-source feature vector;
[0120] Multi-source feature vectors are cascaded and fused in chronological order to construct a demand prediction feature matrix.
[0121] In this implementation, the behavioral demand correlation strength sequence is used to characterize the dynamic correspondence between changes in user behavior and changes in product demand, and the correlation strength is continuously updated with the time index. The inventory coverage period uses the rate of change in inventory quantity and the replenishment lead time to jointly characterize the sales duration that inventory can support, and is used to constrain the construction of inventory timeliness features. During the vector encoding process, the behavioral demand correlation strength sequence, demand feature sequence, and inventory-related sequence are mapped to a unified dimension, so that features from different sources maintain a correspondence under the same time index. The cascade fusion processing organizes the feature vectors of each dimension in the order of the time index to form a demand prediction feature matrix that simultaneously contains user behavior information, demand evolution information, inventory change information, and replenishment timeliness information, providing a unified input data structure for the forward TiDE prediction model and the reverse TiDE prediction model.
[0122] In this embodiment, the improved forward TiDE prediction model is specifically as follows:
[0123] The improved forward TiDE prediction model includes a TiDE encoder, a demand evolution constraint module, and a TiDE decoder;
[0124] Input the demand forecast feature matrix into the TiDE encoder;
[0125] The TiDE encoder uses a multi-layer residual fully connected network to perform feature mapping on the demand prediction feature matrix, forming a sequence of historical demand hidden states.
[0126] Input the implicit state sequence of historical demands into the demand evolution constraint module;
[0127] The state change sequence is obtained by performing difference calculation on the state vectors corresponding to adjacent time positions in the implicit state sequence of historical demand.
[0128] Construct the demand evolution trajectory based on the sign distribution and the difference in change of the amount of change corresponding to adjacent time positions in the state change sequence;
[0129] Calculate the demand evolution state vector corresponding to each time position based on the demand evolution trajectory;
[0130] The historical demand implicit state sequence and the demand evolution state vector are concatenated according to their corresponding time positions, and a linear mapping process is performed to form the evolution constraint implicit state sequence.
[0131] Input the evolutionary constraint hidden state sequence into the TiDE decoder;
[0132] The TiDE decoder uses a multi-layer residual fully connected network to perform time-expanded processing on the evolution constraint latent state sequence to obtain a positive demand prediction sequence.
[0133] In this implementation, the demand evolution constraint module is located between the TiDE encoder and the TiDE decoder, and is used to extract the continuous change patterns in the historical demand implicit state sequence. The demand evolution trajectory reflects the evolution trend of historical demand at multiple consecutive time positions, and the trajectory features simultaneously retain information on the direction and intensity of change. The demand evolution state vector adopts a compact representation of trajectory features, enabling historical demand change patterns to participate in the subsequent prediction process. The evolution constraint implicit state sequence not only contains historical demand implicit state information, but also contains dynamic change information corresponding to the demand evolution trajectory, thus forming a constraint representation with temporal continuity. The TiDE decoder performs time-expansion processing for future prediction cycles based on the evolution constraint implicit state sequence, ensuring that the prediction results maintain the consistency of historical demand features and demand evolution features. The demand evolution constraint module works collaboratively with the original TiDE encoder and decoder structure, enhancing the ability to represent demand change trends while maintaining TiDE's multi-step prediction capabilities.
[0134] In this embodiment, the improved inverse TiDE prediction model is specifically as follows:
[0135] The improved inverse TiDE forecasting model includes a TiDE encoder, an inventory response constraint module, and a TiDE decoder;
[0136] Input the inventory status data into the TiDE encoder;
[0137] The TiDE encoder uses a multi-layer residual fully connected network to perform feature mapping on inventory status data, forming an inventory hidden state sequence.
[0138] Input the implicit state sequence of inventory into the inventory response constraint module;
[0139] By performing difference calculations on the state vectors corresponding to adjacent time positions in the inventory implicit state sequence, the inventory change sequence can be obtained;
[0140] Construct an inventory response trajectory based on the sign distribution of changes at adjacent time points in the inventory change sequence, the difference in changes, and the rate of inventory change.
[0141] The trajectory features corresponding to each time position in the inventory response trajectory are vector-encoded to form an inventory response state vector.
[0142] The inventory response state vector is concatenated with the inventory implicit state sequence at the corresponding time position, and a linear mapping process is performed to form the response constraint implicit state sequence.
[0143] Input the implicit state sequence of the response constraints into the TiDE decoder;
[0144] The TiDE decoder uses a multi-layer residual fully connected network to perform time-expanded processing on the implicit state sequence of response constraints to obtain the reverse demand prediction sequence.
[0145] In this implementation, the improved TiDE model maintains the same overall structure as the original TiDE model, both consisting of an encoder and a decoder. The encoder uses a multi-layer residual fully connected network to map the input feature matrix and form a hidden state sequence. The decoder uses a multi-layer residual fully connected network to perform time expansion on the hidden state sequence and generate a prediction sequence. Both can handle multivariate time series data and support multi-step prediction.
[0146] The improved TiDE model introduces a constraint module between the encoder and decoder. The forward TiDE uses a demand evolution constraint module, which constructs a demand evolution trajectory by analyzing the continuous change direction and magnitude of the historical implicit demand state sequence, and generates a demand evolution state vector. This vector is then jointly mapped with the historical implicit state sequence to form an evolution constraint implicit state sequence. The reverse TiDE uses an inventory response constraint module, which constructs an inventory response trajectory by analyzing the inventory change sequence and rate of change, and generates an inventory response state vector. This vector is then jointly mapped with the inventory implicit state sequence to form a response constraint implicit state sequence, thereby enhancing the model's ability to perceive demand and inventory dynamics.
[0147] The improved TiDE model, by introducing evolutionary constraints and inventory response constraints, achieves explicit encoding of demand and inventory change patterns. This enables forward forecasting to not only rely on historical demand but also reflect evolutionary trends. Conversely, backward forecasting can infer potential demand based on inventory dynamics. The two together form a two-way verification mechanism, thereby improving forecast accuracy and inventory optimization adaptability, reducing the risk of stockouts or overstocking, and providing a reliable data foundation for end-to-end inventory decisions.
[0148] In this embodiment, step five specifically includes:
[0149] Perform time position matching processing on the forward demand forecast sequence and the reverse demand forecast sequence;
[0150] Calculate the changes in the predicted values at adjacent time positions in the forward demand forecast sequence and the changes in the predicted values at adjacent time positions in the reverse demand forecast sequence to form the forward change sequence and the reverse change sequence.
[0151] Demand evolution trajectory is constructed based on the positive change sequence, and inventory response trajectory is constructed based on the negative change sequence;
[0152] Calculate the difference between the corresponding changes in the demand evolution trajectory and the inventory response trajectory at the same time location, and mark the consistent direction of change to form a trajectory consistency sequence.
[0153] The trajectory consistency score is calculated based on the trajectory consistency sequence, and a consistency weight sequence is formed based on the trajectory consistency score.
[0154] The forward demand forecast sequence and the reverse demand forecast sequence are weighted and merged according to the consistency weight sequence to form a merged demand forecast sequence.
[0155] Demand forecast intervals are constructed based on the fused demand forecast sequence and the forecast difference between the forward and reverse demand forecast sequences.
[0156] In this implementation, the trajectory consistency score is used to characterize the degree of matching between the demand evolution trajectory and the inventory response trajectory over a continuous time range. The degree of matching is dynamically updated with the forecast period. The consistency weight sequence is allocated according to the changing trend of the trajectory consistency score, so that time positions with a higher degree of trajectory matching receive a larger weight in the fusion process. The demand forecast interval uses the fused demand forecast sequence as the central sequence, and the interval boundary is determined by combining the forecast difference between the forward demand forecast sequence and the reverse demand forecast sequence. This results in time positions with larger forecast differences corresponding to wider forecast intervals, and time positions with smaller forecast differences corresponding to narrower forecast intervals, thus forming a demand forecast interval corresponding to the bidirectional forecast consistency, providing input data for the subsequent calculation of stockout risk value and backlog risk value.
[0157] In this embodiment, step six specifically includes:
[0158] Obtain the upper and lower boundary values of the demand forecast interval, and calculate the interval width between the upper and lower boundary values to form a demand uncertainty sequence;
[0159] Perform time-series analysis on inventory status data to extract current inventory, in-transit inventory, and inventory change rate;
[0160] The replenishment lead time requirement is calculated based on the inventory change rate and replenishment lead time data, and the replenishment lead time coverage inventory is calculated based on the current inventory, in-transit inventory, and replenishment lead time requirement.
[0161] Calculate the difference between the upper boundary value of the demand forecast interval and the inventory covered by the replenishment lead time for the same forecast period to form a stockout risk difference sequence;
[0162] Calculate the difference between the replenishment lead time covered inventory and the lower boundary value of the demand forecast interval according to the same forecast period, and form a backlog risk difference sequence;
[0163] The demand uncertainty series and the stockout risk difference series are weighted and combined to form the stockout risk value, and the demand uncertainty series and the backlog risk difference series are weighted and combined to form the backlog risk value.
[0164] The dynamic inventory lower limit and dynamic inventory upper limit are determined based on the stockout risk value, the backlog risk value, and the demand uncertainty sequence.
[0165] In this implementation, the demand uncertainty sequence is used to characterize the dispersion of the demand forecast interval within each forecast period. The interval width is dynamically adjusted according to the forecast difference between the forward and reverse demand forecast sequences. The replenishment lead time demand is characterized by the cumulative change in the inventory change rate within the replenishment lead time range, allowing the impact of the replenishment lead time on the inventory consumption process to participate in risk assessment. The stockout risk value and backlog risk value reflect the degree of deviation between inventory coverage capacity and the boundary of the demand forecast interval, respectively, and are adjusted synchronously with changes in demand uncertainty. The dynamic inventory lower limit and dynamic inventory upper limit are determined using a risk-driven approach, ensuring that the inventory control range corresponds to the characteristics of predicted demand fluctuations, thereby forming dynamic inventory constraints for different demand change scenarios.
[0166] In this embodiment, step seven specifically includes:
[0167] Obtain the dynamic inventory upper limit, dynamic inventory lower limit, and demand forecast range;
[0168] Calculate the difference between the upper boundary value of the demand forecast interval and the upper limit of dynamic inventory, and the difference between the lower boundary value of the demand forecast interval and the lower limit of dynamic inventory, to form an inventory deviation sequence;
[0169] Based on the direction and magnitude of changes in the inventory deviation sequence within a continuous forecast period, and combined with replenishment lead time data, a replenishment decision trajectory is constructed.
[0170] Calculate the replenishment quantity for each forecast period based on the replenishment decision trajectory;
[0171] Collect actual sales data, return data, and inventory change data within the corresponding forecast period, and perform correlation mapping processing according to time sequence to construct an actual demand sequence;
[0172] Calculate the forecast deviation between the actual demand sequence and the forward demand forecast sequence, and the forecast deviation between the actual demand sequence and the reverse demand forecast sequence, respectively.
[0173] Adjust the demand evolution state vector in the improved positive TiDE forecasting model based on the prediction deviation;
[0174] The inventory response state vector in the improved inverse TiDE forecasting model is adjusted based on the forecast bias.
[0175] In this implementation, the replenishment decision trajectory is used to characterize the changing trend of inventory deviation within a continuous forecast period. When the inventory deviation continues to increase, the replenishment priority of the corresponding forecast period is increased; when the inventory deviation continues to decrease, the replenishment priority of the corresponding forecast period is decreased. The actual demand sequence uses actual sales data, return data, and inventory change data to jointly characterize the actual demand change process. Among them, return data is used to correct the demand contribution corresponding to actual sales data, and inventory change data is used to characterize the impact of inventory consumption and replenishment. The forward TiDE forecasting model and the reverse TiDE forecasting model adopt an independent update method. The forward TiDE forecasting model adjusts the characterization parameters of the demand evolution state according to the demand forecast deviation, and the reverse TiDE forecasting model adjusts the characterization parameters of the inventory response state according to the demand forecast deviation, so that the demand evolution law and the inventory response law remain consistent with the actual business data, thereby forming a closed loop of demand forecasting, inventory optimization, and model self-updating.
[0176] Example 1: To verify the feasibility of this invention in practice, it was applied to the inventory management scenario of consumer electronics products on a large comprehensive e-commerce platform. The e-commerce platform sells multiple product categories, including mobile phones, tablets, smart wearable devices, Bluetooth headsets, and smart home devices. The platform has over 1.2 million daily active users, approximately 85,000 daily orders, and about 6,500 product SKUs. Because consumer electronics products are significantly affected by new product launches, promotional activities, holiday consumption patterns, and trending online events, user demand fluctuates frequently. Traditional demand forecasting methods based on historical sales are prone to prediction errors, leading to inventory backlogs or stockouts.
[0177] In practical applications, user behavior data, product sales data, inventory status data, and replenishment lead time data are first collected. User behavior data includes browsing behavior, click behavior, favorites behavior, add-to-cart behavior, purchase behavior, and return behavior; product sales data includes order quantity, sales records, and sales time information; inventory status data includes current inventory, in-transit inventory, and inventory change records; replenishment lead time data includes supplier production cycle, transportation cycle, and warehousing cycle. Subsequently, a user behavior time series is constructed according to user and product identifiers, and multiple time granularities are adaptively determined based on the order time intervals in the product sales data to generate short-term behavior embeddings, medium-term behavior embeddings, and long-term behavior embeddings, further forming a multi-granularity user behavior embedding.
[0178] Simultaneously, the sales data is processed through time series decomposition. The system uses a sliding time window to extract the average sales volume, median sales volume, and sales volume variation, forming a trend component sequence based on the trend of the average sales volume within a continuous time window; it identifies the period length based on the autocorrelation characteristics of the sales sequence and constructs a periodic component sequence; after deducting the trend and periodic components from the original sales data, an abnormal fluctuation component sequence is formed. Subsequently, the trend, periodic, and abnormal fluctuation components are time-aligned to form a demand feature sequence.
[0179] In the demand forecasting phase, multi-granularity user behavior embeddings, demand feature sequences, inventory status data, and replenishment lead time data are uniformly encoded to construct a demand forecasting feature matrix, which is then input into an improved forward TiDE forecasting model. The TiDE encoder uses a multi-layer residual fully connected network to extract historical demand implicit state sequences, and the demand evolution constraint module further constructs the demand evolution trajectory and generates a demand evolution state vector, thereby obtaining a forward demand forecasting sequence. Simultaneously, inventory status data is input into an improved reverse TiDE forecasting model. The inventory response constraint module analyzes inventory change patterns and rates, constructs an inventory response trajectory, forms an inventory response state vector, and outputs a reverse demand forecasting sequence.
[0180] Subsequently, consistency verification is performed on the forward and reverse demand forecast sequences. A trajectory consistency score is generated based on the degree of matching between the demand evolution trajectory and the inventory response trajectory, forming a consistency weight sequence. The consistency weight sequence is then used to fuse the bidirectional forecast results to construct a demand forecast interval. Since the demand forecast interval can reflect the uncertainty of the forecast results, it can effectively characterize the risk of future demand changes.
[0181] During the inventory optimization phase, the demand uncertainty sequence is calculated based on the upper and lower bounds of the demand forecast interval. This sequence is then combined with current inventory levels, in-transit inventory, and replenishment lead time information to calculate the replenishment lead time-covered inventory. Furthermore, stockout and overstock risk values are calculated, and the upper and lower inventory limits are dynamically determined based on these risk values. The system constructs a replenishment decision trajectory based on the degree of inventory deviation and calculates the corresponding replenishment quantity accordingly, achieving dynamic adjustment of inventory resources.
[0182] In actual operation, the platform ran continuously for 90 days, and consumer electronics products with high sales volume and significant demand fluctuations were selected as verification objects. To verify the effectiveness of the invention, it was compared with traditional moving average forecasting methods, LSTM forecasting methods, and the original TiDE forecasting method. The accuracy of demand forecasting, stockout rate, inventory turnover days, and inventory backlog rate were statistically analyzed. The experimental results are shown in Table 1.
[0183] Table 1. Comparison of the performance of different forecasting methods in the consumer electronics product inventory management scenario.
[0184] Moving average forecasting method 82.4 9.6 18.7 42.5 18.6 LSTM prediction method 88.3 7.2 15.4 36.8 15.2 Original TiDE prediction method 91.7 5.6 12.8 31.6 12.4 Method of the present invention 96.5 2.8 6.3 22.7 7.9
[0185] As shown in Table 1, the invented method achieves a demand forecast accuracy of 96.5%, which is 14.1 percentage points higher than the moving average forecasting method, 8.2 percentage points higher than the LSTM forecasting method, and 4.8 percentage points higher than the original TiDE forecasting method. Simultaneously, the invented method reduces the stockout rate to 2.8%, the inventory backlog rate to 6.3%, the average inventory turnover days to 22.7 days, and the replenishment response time to 7.9 hours.
[0186] Further analysis reveals that this invention achieves bidirectional collaborative modeling of demand and inventory change patterns by constructing a demand evolution constraint module and an inventory response constraint module. It assesses the reliability of the bidirectional forecast results through a trajectory consistency verification mechanism and utilizes the demand forecast interval in inventory risk calculation, enabling dynamic adjustment of inventory upper and lower limits based on demand fluctuations. Furthermore, through replenishment decision trajectories and a dual-model feedback update mechanism, the model continuously adapts to changes in market demand. Therefore, this invention effectively improves demand forecasting accuracy, reduces stockout and inventory backlog risks, and enhances inventory turnover and supply chain operational efficiency, validating its feasibility and effectiveness in user demand forecasting and inventory optimization scenarios.
[0187] The above description is only a preferred embodiment of the present invention, but the scope of protection of the present invention is not limited thereto. Any equivalent substitutions or modifications made by those skilled in the art within the scope of the technology disclosed in the present invention, based on the technical solution and inventive concept of the present invention, should be covered within the scope of protection of the present invention.
Claims
1. A method for user demand prediction and inventory optimization based on deep learning, characterized in that, The steps include the following: Step 1: Collect user behavior data, product sales data, inventory status data, and replenishment lead time data. Perform multi-time granularity encoding processing on the user behavior data to obtain multi-granularity user behavior embeddings. Step 2: Perform time series decomposition on the commodity sales data to obtain trend components, periodic components, and abnormal fluctuation components, forming a demand characteristic sequence; Step 3: Perform feature fusion on the multi-granularity user behavior embedding, demand feature sequence, inventory status data, and replenishment lead time data to construct a demand prediction feature matrix; Step 4: Input the demand forecast feature matrix into the improved forward TiDE forecasting model to predict the demand sequence, and input the inventory status data into the improved reverse TiDE forecasting model to reverse the demand sequence, thereby obtaining the forward demand forecast sequence and the reverse demand forecast sequence. Step 5: Perform a consistency check on the forward demand forecast sequence and the reverse demand forecast sequence, and construct a demand forecast interval based on the check results; Step Six: Calculate the stockout risk value and overstock risk value based on the demand forecast range, inventory status data, and replenishment lead time data, and determine the dynamic inventory upper and lower limits based on the stockout risk value and overstock risk value; Step 7: Calculate the replenishment quantity based on the dynamic inventory upper and lower limits, demand forecast range, and replenishment lead time data, and update the forward TiDE forecast model and the reverse TiDE forecast model.
2. The method for user demand prediction and inventory optimization based on deep learning according to claim 1, characterized in that, Step one specifically involves: Collect user behavior data, product sales data, inventory status data, and replenishment lead time data. The user behavior data includes user identifier, product identifier, behavior type, behavior timestamp, and behavior frequency. The behavior types include browsing behavior, clicking behavior, favorites behavior, adding to cart behavior, purchasing behavior, and return behavior. The user behavior data is grouped according to user identifier and product identifier, and each group of user behavior data is sorted in ascending order according to behavior timestamp to form a user-product behavior time series; The basic time granularity is determined based on the median time interval between adjacent orders in the product sales data. The user-product behavior time series is then sliced according to the basic time granularity, three times the basic time granularity, and seven times the basic time granularity to form short-term behavior segments, medium-term behavior segments, and long-term behavior segments. The number of behaviors corresponding to each behavior type within the short-term behavior segment, the medium-term behavior segment, and the long-term behavior segment is counted respectively. The conversion number between adjacent behavior types and the corresponding behavior time interval are calculated according to the time order of browsing behavior, clicking behavior, favorite behavior, adding to cart behavior, purchasing behavior, and returning behavior. The behavior conversion intensity value is calculated based on the conversion number and the behavior time interval. A behavior conversion matrix is constructed based on the number of behaviors, the number of conversions, and the behavior conversion intensity value. Time decay weighting and normalization processing are performed on the behavior conversion matrix to form short-term behavior embedding, medium-term behavior embedding, and long-term behavior embedding. The short-term behavior embedding, the medium-term behavior embedding, and the long-term behavior embedding are subjected to cascaded fusion processing to obtain multi-granularity user behavior embedding.
3. The method for user demand prediction and inventory optimization based on deep learning according to claim 1, characterized in that, Step two specifically involves: The product sales data are grouped according to product identifiers and sorted in ascending order according to sales timestamps to form a product sales time series. The product sales time series is segmented using a sliding time window, and the mean sales volume, median sales volume, and sales volume change rate within each time window are calculated to form a local statistical series. Long-term change extraction processing is performed on the local statistical sequence to merge sequence segments where the average sales value increases or decreases continuously within a continuous time window, forming a trend component sequence; Calculate the autocorrelation coefficient of the commodity sales time series at different time intervals, and select the time interval with the maximum autocorrelation coefficient as the period length; Calculate the difference between sales values corresponding to the same period position based on the period length, and construct a period component sequence based on the difference; Subtract the trend component value and periodic component value at the corresponding time from the sales value in the product sales time series to obtain the remaining sales fluctuation value, and form an abnormal fluctuation component sequence based on the remaining sales fluctuation value. The trend component sequence, the periodic component sequence, and the abnormal fluctuation component sequence are time-aligned and then cascaded in chronological order to form a demand feature sequence.
4. The method for user demand prediction and inventory optimization based on deep learning according to claim 1, characterized in that, Step three specifically involves: The multi-granularity user behavior embedding and the demand feature sequence are time-aligned, and a behavior demand association sequence is constructed based on the same time index. Calculate the amount of behavioral change and the amount of demand change corresponding to each time index in the behavioral demand association sequence, and construct a behavioral demand association strength sequence based on the number of times the behavioral change and the demand change are in the same direction and the difference in the magnitude of the change. The inventory status data is analyzed over time to extract the inventory quantity change sequence, inventory turnover sequence, and inventory fluctuation sequence. The inventory coverage period is calculated based on the replenishment lead time data and the inventory quantity change sequence, and an inventory timeliness constraint sequence is constructed based on the inventory coverage period; The behavioral demand correlation strength sequence, the demand feature sequence, the inventory quantity change sequence, the inventory turnover sequence, the inventory fluctuation sequence, and the inventory timeliness constraint sequence are vector-encoded to form a multi-source feature vector; The multi-source feature vectors are cascaded and fused in chronological order to construct a demand prediction feature matrix.
5. The method for user demand prediction and inventory optimization based on deep learning according to claim 1, characterized in that, The improved positive TiDE prediction model is specifically as follows: The improved forward TiDE prediction model includes a TiDE encoder, a demand evolution constraint module, and a TiDE decoder; Input the demand prediction feature matrix into the TiDE encoder; The TiDE encoder uses a multi-layer residual fully connected network to perform feature mapping on the demand prediction feature matrix to form a historical demand implicit state sequence. Input the historical implicit state sequence of demands into the demand evolution constraint module; The state change sequence is obtained by performing difference calculation on the state vectors corresponding to adjacent time positions in the historical demand implicit state sequence; Construct a demand evolution trajectory based on the sign distribution and difference of change values corresponding to adjacent time positions in the state change sequence; Calculate the demand evolution state vector corresponding to each time position based on the demand evolution trajectory; The historical demand implicit state sequence and the demand evolution state vector are concatenated according to their corresponding time positions, and a linear mapping process is performed to form an evolution constraint implicit state sequence. The evolutionary constraint hidden state sequence is input into the TiDE decoder; The TiDE decoder uses a multi-layer residual fully connected network to perform time-expanded processing on the evolution constraint latent state sequence to obtain a positive demand prediction sequence.
6. The method for user demand prediction and inventory optimization based on deep learning according to claim 1, characterized in that, The improved inverse TiDE prediction model is specifically as follows: The improved inverse TiDE prediction model includes a TiDE encoder, an inventory response constraint module, and a TiDE decoder; Input the inventory status data into the TiDE encoder; The TiDE encoder uses a multi-layer residual fully connected network to perform feature mapping processing on the inventory status data, forming an inventory hidden state sequence. Input the implicit inventory state sequence into the inventory response constraint module; By performing difference calculation on the state vectors corresponding to adjacent time positions in the implicit inventory state sequence, an inventory change sequence can be obtained; Construct an inventory response trajectory based on the sign distribution of changes at adjacent time positions in the inventory change sequence, the difference in changes, and the rate of inventory change. The trajectory features corresponding to each time position in the inventory response trajectory are vector encoded to form an inventory response state vector. The inventory response state vector is concatenated with the inventory implicit state sequence at the corresponding time position, and a linear mapping process is performed to form a response constraint implicit state sequence. Input the implicit state sequence of the response constraints into the TiDE decoder; The TiDE decoder uses a multi-layer residual fully connected network to perform time-expanded processing on the response constraint implicit state sequence to obtain the reverse demand prediction sequence.
7. The method for user demand prediction and inventory optimization based on deep learning according to claim 1, characterized in that, Step five specifically involves: Perform time position matching processing on the forward demand forecast sequence and the reverse demand forecast sequence; The changes in the predicted values corresponding to adjacent time positions in the forward demand forecast sequence and the changes in the predicted values corresponding to adjacent time positions in the reverse demand forecast sequence are calculated respectively to form a forward change sequence and a reverse change sequence. A demand evolution trajectory is constructed based on the positive change sequence, and an inventory response trajectory is constructed based on the negative change sequence; Calculate the difference between the corresponding changes in the demand evolution trajectory and the inventory response trajectory at the same time position, as well as the consistent marker of the change direction, to form a trajectory consistency sequence; A trajectory consistency score is calculated based on the trajectory consistency sequence, and a consistency weight sequence is formed based on the trajectory consistency score. The positive demand forecast sequence and the negative demand forecast sequence are weighted and fused according to the consistency weight sequence to form a fused demand forecast sequence; Demand forecast intervals are constructed based on the fused demand forecast sequence and the forecast difference between the forward demand forecast sequence and the reverse demand forecast sequence.
8. The method for user demand prediction and inventory optimization based on deep learning according to claim 1, characterized in that, Step six specifically involves: Obtain the upper and lower boundary values of the demand forecast interval, and calculate the interval width between the upper and lower boundary values to form a demand uncertainty sequence; Perform time-series analysis on the inventory status data to extract the current inventory level, in-transit inventory level, and inventory change rate; The replenishment lead time requirement is calculated based on the inventory change rate and the replenishment lead time data, and the replenishment lead time coverage inventory is calculated based on the current inventory, the inventory in transit, and the replenishment lead time requirement. The difference between the upper boundary value of the demand forecast interval and the inventory covered by the replenishment lead time is calculated according to the same forecast period to form a stockout risk difference sequence. Calculate the difference between the inventory covered by the replenishment lead time and the lower boundary value of the demand forecast interval according to the same forecast period, and form a backlog risk difference sequence. The demand uncertainty sequence and the stockout risk difference sequence are weighted and combined to form a stockout risk value, and the demand uncertainty sequence and the backlog risk difference sequence are weighted and combined to form a backlog risk value. The dynamic inventory lower limit and dynamic inventory upper limit are determined based on the stockout risk value, the backlog risk value, and the demand uncertainty sequence.
9. The method for user demand prediction and inventory optimization based on deep learning according to claim 1, characterized in that, Step seven specifically involves: Obtain the dynamic inventory upper limit, the dynamic inventory lower limit, and the demand forecast range; The differences between the upper boundary value of the demand forecast interval and the upper limit of the dynamic inventory, and the differences between the lower boundary value of the demand forecast interval and the lower limit of the dynamic inventory are calculated respectively to form an inventory deviation sequence; Based on the direction and magnitude of the changes in the inventory deviation sequence within the continuous forecast period, and combined with the replenishment lead time data, a replenishment decision trajectory is constructed. Calculate the replenishment quantity for each forecast period based on the replenishment decision trajectory; Collect actual sales data, return data, and inventory change data within the corresponding forecast period, and perform correlation mapping processing according to time sequence to construct an actual demand sequence; Calculate the prediction deviation between the actual demand sequence and the forward demand forecast sequence, and the prediction deviation between the actual demand sequence and the reverse demand forecast sequence, respectively. The demand evolution state vector in the improved positive TiDE prediction model is adjusted according to the prediction deviation. The inventory response state vector in the improved inverse TiDE forecasting model is adjusted based on the forecast bias.