A commodity static attribute and time series data inventory data prediction method and system
Patent Information
- Application Number
- CN202611239771.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2026-08-14
- Publication Date
- 2026-10-30
AI Technical Summary
[0005]基于此,本申请实施例提供了一种商品静态属性与时序数据的库存数据预测方法及系统,融合自注意力机制的端到端的商品库存周期预测方法,以解决传统模型对时间依赖关系捕捉不准确、预测误差大等问题,实现更高精度、更强稳定性和更广泛适应性的预测效果
[0031](1)通过多头自注意力机制并行捕获时间序列中任意时间步之间的全局依赖关系,结合位置编码与注意力加权聚合,能够精准感知淡旺季波动、节假日效应等长期时序特征,显著提升对季节性变化与短期趋势的建模能力。
Smart Images

Figure CN123014894A_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of machine learning technology, and in particular to a method and system for predicting inventory data based on static attributes and time-series data of commodities. Background Technology
[0002] As the scale of commodity trading markets continues to expand, the cycle from listing to actual transaction of goods varies significantly due to multiple factors, including brand attributes, market supply and demand, regional differences, and seasonal fluctuations. Merchants generally rely on experience-based judgment when making purchasing decisions and adjusting inventory prices, lacking objective and quantitative methods for cycle forecasting, leading to inventory backlog or low turnover efficiency.
[0003] Existing technologies mainly include rule-based or statistical model-based methods and gradient boosting tree-based machine learning methods. The former, such as linear regression, decision trees, and random forests, rely on manually constructed features and cannot effectively capture the time-series changes and seasonal cycles of the market; the latter, such as LightGBM and XGBoost, although performing well in static feature modeling, usually require compressing historical data into statistical quantities when processing time-series features, resulting in the loss of time-dependent information and making it difficult to accurately reflect seasonal changes and market fluctuations.
[0004] However, existing technologies generally suffer from the following problems: they rely heavily on the effectiveness of manually constructed features and cannot effectively utilize market time series features; they lack the ability to capture cyclical features such as peak and off-peak seasons and holidays; and their cross-modeling ability between static features and time series features is limited, resulting in low prediction accuracy. Summary of the Invention
[0005] Based on this, this application provides an inventory data prediction method and system that combines static attributes and time-series data of commodities. It integrates an end-to-end commodity inventory cycle prediction method with a self-attention mechanism to solve the problems of inaccurate capture of time dependence and large prediction errors in traditional models, thereby achieving higher accuracy, stronger stability and wider adaptability in prediction.
[0006] Firstly, a method for predicting inventory data based on static attributes and time-series data of commodities is provided, the method comprising:
[0007] S1 Data Acquisition and Preprocessing: Collect static feature data of the target object and its corresponding time series market feature data, encode categorical variables, standardize numerical variables, and construct time series feature matrix and static feature vector;
[0008] S2 Model Construction: The static feature vector is input into a multilayer perceptron sub-network to extract static feature representation. The time series feature matrix is linearly embedded and positionally encoded, then input into a stacked multilayer Transformer encoder to extract temporal feature representation. The static feature representation and the temporal feature representation are concatenated and then nonlinearly interacted through a fusion network to obtain fused features. Based on the fused features, a regression network outputs predicted values.
[0009] S3 training model: During the training process, historical samples and corresponding real labels are input, and an adaptive optimization algorithm is used for training. The training set and validation set are separated by rolling time verification.
[0010] S4 Model Inference Output: Load the trained model weights into the prediction model and place it in evaluation mode. Perform preprocessing on the input static features and time series features in the same way as in the training phase. Input the sample to be predicted into the model, and output the target prediction value after static feature encoding, time series feature attention encoding, feature fusion and regression prediction.
[0011] Optionally, the static feature vector is input into a multilayer perceptron subnetwork to extract static feature representations, including:
[0012] The static feature vector is sequentially passed through a fully connected layer with an output dimension of 128 and the ReLU activation function, a Dropout layer, and a fully connected layer with an output dimension of 64 and the ReLU activation function, to obtain a 64-dimensional static feature vector.
[0013] Optionally, the time series feature matrix is linearly embedded and positionally encoded before being input into a stacked multi-layer Transformer encoder to extract temporal feature representations, including:
[0014] The time series feature matrix is mapped to a specified dimension through a linear embedding layer, and positional encoding is superimposed to preserve the time sequence information. The matrix is then input into a stacked L-layer Transformer encoder, with each layer including a multi-head self-attention layer, a feedforward network layer, residual connections, and layer normalization operations. The time feature representation vector is obtained through average pooling or attention-weighted pooling.
[0015] Optionally, the static feature representation and the temporal feature representation are concatenated and then subjected to nonlinear interaction via a fusion network to obtain fused features, including:
[0016] The static feature representation and the temporal feature representation are concatenated and then sequentially passed through a 128-dimensional fully connected layer with ReLU activation, a BatchNorm layer, a Dropout layer, and a 64-dimensional fully connected layer with ReLU activation to obtain the fused feature vector.
[0017] Optionally, based on the fused features, a regression network outputs a predicted value, including:
[0018] The fused features are sequentially passed through a fully connected layer with a 32-dimensional output and a ReLU activation function, and then through a fully connected layer with a 1-dimensional output and a linear activation function to output the predicted value.
[0019] Optionally, training is performed by inputting historical samples and corresponding real labels, including:
[0020] HuberLoss or MAE is used as the loss function, and Adam adaptive optimization algorithm is used for parameter update. The training set and validation set are divided by rolling time validation, and early stopping or learning rate adjustment is performed based on the performance of the validation set.
[0021] Optionally, loading the trained model weights into the prediction model and outputting the target prediction value includes:
[0022] The model is placed in evaluation mode with batch normalization and random inactivation turned off. Input features are normalized, categorically encoded, and time-aligned. Samples to be predicted are input into the model in batches. Inconsistent time series lengths are filled and time masks are constructed to mask invalid time steps. After outputting the predicted values, truncation, binning, or intervalization are performed.
[0023] Secondly, an inventory data prediction system based on static attributes and time-series data of commodities is provided. This system includes:
[0024] The data acquisition and preprocessing module is used to collect static feature data of the target object and its corresponding time series market feature data, encode categorical variables, standardize numerical variables, and construct time series feature matrix and static feature vector;
[0025] A model building module is used to input the static feature vector into a multilayer perceptron sub-network to extract static feature representation, input the time series feature matrix into a stacked multilayer Transformer encoder after linear embedding and position encoding to extract temporal feature representation, concatenate the static feature representation and the temporal feature representation and then perform nonlinear interaction through a fusion network to obtain fused features, and output predicted values based on the fused features through a regression network.
[0026] The training model module is used to input historical samples and corresponding real labels during the training process, and to train using an adaptive optimization algorithm. The training set and validation set are separated by rolling time validation.
[0027] The model inference output module is used to load the trained model weights into the prediction model and put it into evaluation mode. It performs the same preprocessing on the input static features and time series features as in the training phase. The model inputs the sample to be predicted and outputs the target prediction value after static feature encoding, time series feature attention encoding, feature fusion and regression prediction.
[0028] Thirdly, an electronic device is provided, including a memory and a processor, wherein the memory stores a computer program, and the processor executes the computer program to implement any of the methods described in the first aspect above.
[0029] Fourthly, a computer-readable storage medium is provided having a computer program stored thereon, which, when executed by a processor, implements any of the methods described in the first aspect above.
[0030] The beneficial effects of the technical solutions provided in this application include at least the following:
[0031] (1) By using a multi-head self-attention mechanism to capture the global dependencies between any time steps in the time series in parallel, and combining positional encoding and attention-weighted aggregation, it can accurately perceive long-term time series characteristics such as seasonal fluctuations and holiday effects, and significantly improve the ability to model seasonal changes and short-term trends.
[0032] (2) By adopting a hierarchical independent coding of static features and time-series features and a multi-layer nonlinear fusion mechanism, the inherent attributes of commodities and market dynamic trends are jointly modeled, which significantly reduces the prediction error compared with traditional methods.
[0033] (3) The non-recursive parallel structure based on Transformer replaces the traditional recurrent neural network, supports parallel computing of time series data, and greatly improves the efficiency of model training and inference. Attached Figure Description
[0034] To more clearly illustrate the embodiments of this application or the technical solutions in the prior art, the accompanying drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings in the following description are merely exemplary, and those skilled in the art can derive other embodiments based on the provided drawings without creative effort.
[0035] Figure 1 A flowchart illustrating the steps of an inventory data prediction method based on static attributes and time-series data of a commodity, provided in an embodiment of this application;
[0036] Figure 2 A system block diagram of an inventory data prediction method based on static attributes and time-series data of commodities provided in this application embodiment;
[0037] Figure 3 This is a schematic diagram of an electronic device provided in an embodiment of this application. Detailed Implementation
[0038] To make the objectives, technical solutions, and advantages of this application clearer, the following detailed description is provided in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are merely illustrative and not intended to limit the scope of this application.
[0039] In the description of this application, the terms "comprising," "having," and any variations thereof are intended to cover non-exclusive inclusion, such as a process, method, system, product, or apparatus that includes a series of steps or units, not necessarily limited to those steps or units that are expressly listed, but may also include other steps or units that are not expressly listed but are inherent to these processes, methods, products, or apparatuses, or steps or units added based on further optimizations conceived in this application.
[0040] In the specific implementation of this application, the goods referred to can specifically refer to used cars. The current used car market is huge, and the transaction speed varies significantly depending on the model, condition, region, and time period. Used car dealers usually rely on experience to judge the sales cycle when purchasing or adjusting inventory prices, lacking objective and quantitative forecasting methods.
[0041] This application aims to provide an end-to-end used car sales cycle prediction method that can fully utilize market time series data and vehicle static features, and integrate a self-attention mechanism to solve the problems of inaccurate capture of time dependencies and large prediction errors in traditional models, thereby achieving higher accuracy, stronger stability and wider adaptability in prediction.
[0042] First, let me explain the ellipsis and key terms that appear in this application:
[0043] Used car sales cycle: refers to the length of time from when a vehicle is first listed on a used car trading platform to when it is actually sold, usually in days.
[0044] Time-series market data refers to data collected in chronological order that relates to overall changes in the used car market, including sales volume, transaction price, search popularity, and holiday markers.
[0045] Static vehicle characteristics: These refer to the fixed attributes of the target vehicle at the time of registration, such as brand, series, model, year of production, registration date, mileage, fuel type, region, and listed price.
[0046] The core of this solution is to provide an inventory data forecasting method (i.e., a method for predicting the used car sales cycle). Please refer to [link / reference]. Figure 1The document illustrates a flowchart of an inventory data prediction method based on static attributes and time-series data of a commodity, provided in an embodiment of this application. This method may include the following steps:
[0047] S1 Data Acquisition and Preprocessing: Collect static feature data of the target object and its corresponding time series market feature data, encode categorical variables, standardize numerical variables, and construct time series feature matrix and static feature vector.
[0048] In this step, static feature data and corresponding time-series market feature data of the target vehicle are collected. Static features include vehicle brand, model series, registration date, mileage, region, manufacturer's suggested retail price, listed price, mileage ranking within the same model series, vehicle age ranking, price ranking, whether the vehicle was listed on a working day, number of days it has been displayed, number of working days it has been displayed, number of non-working days it has been displayed, number of acquired customers, and number of browsing customers. Time-series features include market sales volume, average transaction price, search popularity, holiday markings, and monthly cycle encoding. Categorical variables are encoded, and numerical variables are standardized to construct a time-series feature matrix. With static feature vectors .
[0049] The S2 model is constructed as follows: static feature vectors are input into a multilayer perceptron sub-network to extract static feature representations. The time series feature matrix is linearly embedded and positionally encoded, then input into a stacked multilayer Transformer encoder to extract temporal feature representations. The static feature representations and temporal feature representations are concatenated and then nonlinearly interacted through a fusion network to obtain fused features. Based on the fused features, a regression network is used to output predicted values.
[0050] In this step, specifically, the feature extraction module consists of two parts: a static feature subnetwork and a time series subnetwork.
[0051] Static feature subnetwork: Feature mapping is performed using a multilayer perceptron (MLP) structure.
[0052] First layer: Fully connected layer, output dimension 128, activation function ReLU;
[0053] The second layer: Dropout layer, to prevent overfitting;
[0054] Third layer: Fully connected layer, output dimension 64, activation function ReLU;
[0055] The final output is a 64-dimensional static feature vector. .
[0056] Time Series Feature Subnetwork: Employs a self-attention mechanism to extract market time features. The time series matrix... Mapped to via linear embedding layer Dimension Introducing a position coding layer ,get Building upon this, an L-layer Transformer encoder is stacked, each layer comprising: a multi-head self-attention layer with 8 heads; a feedforward network layer with 4 dimensions; residual connections; and layer normalization operations. After L layers (typically L=3), the time-step output matrix HL is obtained. Average pooling or attention-weighted pooling is then used to obtain the temporal feature representation vector. .
[0057] The feature fusion part combines the temporal feature vectors. With static feature vectors splicing as a fusion feature The fusion network structure is as follows: First layer: Fully connected layer, output 128 dimensions, activation function ReLU; Second layer: BatchNorm layer; Third layer: Dropout layer (rate=0.3).
[0058] Fourth layer: Fully connected layer, outputting 64 dimensions, ReLU activation function; outputting a fused feature vector. .
[0059] The sales cycle forecasting section is based on fused features. Regression prediction is performed using a two-layer fully connected network: Layer 1: Fully connected layer, outputting 32 dimensions with ReLU activation; Layer 2: Output layer, outputting 1 dimension with a linear activation function. The model outputs predicted values. This refers to the sales cycle of the target vehicle.
[0060] S3 training model: During the training process, historical samples and corresponding real labels are input, and an adaptive optimization algorithm is used for training. The training set and validation set are separated by rolling time verification.
[0061] In this step, the preprocessed static feature vectors and time-series feature matrices of historical samples are input into the constructed model. The actual sales cycle is used as the supervision label, and HuberLoss or MAE is employed as the loss function to measure the deviation between the predicted and actual values. The Adam adaptive optimization algorithm is used for iterative parameter updates.
[0062] During training, historical samples and the actual sales cycle y are input, and the prediction result is output. HuberLoss or MAE is used as the loss function, and an adaptive optimization algorithm is used for training. The training set and validation set are separated by rolling time validation.
[0063] S4 Model Inference Output: Load the trained model weights into the prediction model and place it in evaluation mode. Perform preprocessing on the input static features and time series features in the same way as in the training phase. Input the sample to be predicted into the model, and output the target prediction value after static feature encoding, time series feature attention encoding, feature fusion and regression prediction.
[0064] In this step, firstly, the trained model weights are loaded into the prediction model, and the model is placed in evaluation mode to ensure that the inference phase is not affected by batch normalization and random deactivation mechanisms. Secondly, the input static features and time series features undergo the same preprocessing operations as in the training phase, including feature normalization, class encoding, and time alignment, to ensure the consistency of the input feature space. Subsequently, the samples to be predicted are input into the model in batches to improve inference efficiency and save computational resources; if the time series lengths are inconsistent, sequence padding is performed at the input end, and a time mask is constructed simultaneously to shield invalid time steps, ensuring that the model only performs attention calculations within the valid time range. During inference, the model extracts the static features and dynamic time series features of the vehicle through the static feature part and the time series attention encoding part, respectively, and outputs the predicted value of the sales cycle of the target vehicle after integration by a fusion network. The inference output can be further post-processed at the business level, including truncating, binning, or interval processing of the predicted values to meet different business application needs. Finally, the prediction results can be saved as a structured file or written to a database for application scenarios such as used car inventory management, inventory price adjustment decisions, and sales strategy optimization.
[0065] Additionally, in optional embodiments of this application, it may also include:
[0066] The time-series feature extraction and prediction module is replaced with a time-series survival model. By introducing a survival analysis framework, the probability of a vehicle being "sold" within different time periods is modeled. The model can dynamically update the risk function or conditional survival probability based on time-series inputs (such as the number of days on sale, exposure frequency, and changes in market conversion rates), thereby characterizing the "survival time" distribution of vehicles at different sales stages. By jointly modeling time-dependent features and censoring information of unsold samples, probabilistic predictions of the sales cycle are achieved. The improved scheme is better suited to handling issues such as unsold samples and right censoring in sales data, further enhancing the stability and business interpretability of the prediction results.
[0067] In summary, the key points of this application are:
[0068] Part 1: Hierarchical Modeling and Fusion Mechanism of Static and Temporal Features
[0069] This invention proposes a hierarchical feature modeling structure for predicting the sales cycle of used cars. It independently models the vehicle's static attributes (such as model, mileage, age, and price) and time-series features (such as market transaction volume, number of listings, and price fluctuations). Static features are extracted into high-dimensional representations using a multilayer perceptron network, while time-series features are extracted into dynamic representations that change over time using a self-attention encoding network. These two features interact through multilayer nonlinear features in a fusion module, achieving joint modeling of both inherent vehicle attributes and dynamic market features, thereby significantly improving the accuracy and stability of sales cycle prediction.
[0070] II: Time Series Feature Extraction Methods Based on Attention Mechanisms
[0071] This invention utilizes a multi-head self-attention mechanism to extract features from time-series data. Compared to traditional recurrent neural network models, the attention mechanism can capture global dependencies between different time steps in parallel. By introducing positional encoding and attention-weighted aggregation mechanisms, the model can automatically identify and focus on key time windows affecting the sales cycle (such as seasonal fluctuations and holiday effects), thereby improving the model's ability to perceive seasonal changes and short-term trends and achieving efficient expression of market dynamics.
[0072] This invention exhibits significant advantages in several aspects: by introducing a self-attention mechanism, it can effectively capture the dependencies between any time steps in a time series, significantly enhancing the modeling ability for long-term time series features such as market peak and off-peak seasons and holiday effects; by adopting a non-recursive parallel structure, it greatly improves training and inference efficiency compared to traditional recursive models such as LSTM; by fusing static features such as individual vehicle attributes with dynamic market trends through joint modeling, it further improves prediction accuracy; in addition, the model has good adaptability, and when the market environment changes, it only needs to update the input time series data without retraining the static feature part, thus efficiently responding to dynamic market changes.
[0073] In the practice of the used car business, the error percentage MAPE is about 15% compared to the traditional method of sales cycle prediction.
[0074] like Figure 2 This application also provides an inventory data prediction system based on the static attributes and time-series data of commodities, which may include:
[0075] The data acquisition and preprocessing module is used to collect static feature data of the target object and its corresponding time series market feature data, encode categorical variables, standardize numerical variables, and construct time series feature matrix and static feature vector;
[0076] A model building module is used to input the static feature vector into a multilayer perceptron sub-network to extract static feature representation, input the time series feature matrix into a stacked multilayer Transformer encoder after linear embedding and position encoding to extract temporal feature representation, concatenate the static feature representation and the temporal feature representation and then perform nonlinear interaction through a fusion network to obtain fused features, and output predicted values based on the fused features through a regression network.
[0077] The training model module is used to input historical samples and corresponding real labels during the training process, and to train using an adaptive optimization algorithm. The training set and validation set are separated by rolling time validation.
[0078] The model inference output module is used to load the trained model weights into the prediction model and put it into evaluation mode. It performs the same preprocessing on the input static features and time series features as in the training phase. The model inputs the sample to be predicted and outputs the target prediction value after static feature encoding, time series feature attention encoding, feature fusion and regression prediction.
[0079] Specific limitations regarding the inventory data forecasting system based on product static attributes and time-series data can be found in the limitations of the inventory data forecasting method based on product static attributes and time-series data mentioned above, and will not be repeated here. Each module in the aforementioned inventory data forecasting system based on product static attributes and time-series data can be implemented entirely or partially through software, hardware, or a combination thereof. These modules can be embedded in or independent of the processor in a computer device, or stored in the memory of a computer device as software, so that the processor can call and execute the corresponding operations of each module.
[0080] In one embodiment, an electronic device is provided, which may be a computer, and its internal structure diagram may be as follows: Figure 3 As shown, the electronic device includes a processor, memory, and a network interface connected via a system bus. The processor provides computing and control capabilities. The memory includes a non-volatile storage medium and internal memory. The non-volatile storage medium stores an operating system, computer programs, and a database. The internal memory provides an environment for the operation of the operating system and computer programs in the non-volatile storage medium. The database of the computer device is used for inventory data forecasting. The network interface of the computer device is used for communication with external terminals via a network connection. When the computer program is executed by the processor, it implements an inventory data forecasting method.
[0081] Those skilled in the art will understand that, Figure 3The structure shown is merely a block diagram of a portion of the structure related to the present application and does not constitute a limitation on the computer device to which the present application is applied. Specific computer devices may include more or fewer components than those shown in the figure, or combine certain components, or have different component arrangements.
[0082] In one embodiment of this application, a computer-readable storage medium is provided, on which a computer program is stored, which, when executed by a processor, implements the steps of the above-described inventory data prediction method based on static attributes and time-series data of commodities.
[0083] In one embodiment of this application, a computer program product is provided, including a computer program / instructions, which, when executed by a processor, implements the steps of the above-described inventory data prediction method based on static attributes and time-series data of goods.
[0084] The computer-readable storage medium and computer program product provided in this embodiment are similar in implementation principle and technical effect to the above method embodiments, and will not be repeated here.
[0085] Those skilled in the art will understand that all or part of the processes in the above embodiments can be implemented by a computer program instructing related hardware. The computer program can be stored in a non-volatile computer-readable storage medium. When the computer program is executed, it can include the processes of the embodiments of the above methods.
[0086] The technical features of the above embodiments can be combined in any way. For the sake of brevity, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this specification.
[0087] The embodiments described above are merely illustrative of several implementation methods of this application, and while the descriptions are relatively specific and detailed, they should not be construed as limiting the scope of the patent application. It should be noted that those skilled in the art can make various modifications and improvements without departing from the concept of this application, and these all fall within the protection scope of this application. Therefore, the protection scope of this patent application should be determined by the appended claims.
Claims
1. A method for predicting inventory data based on static attributes and time-series data of commodities, characterized in that, The method includes: S1 Data Acquisition and Preprocessing: Collect static feature data of the target object and its corresponding time series market feature data, encode categorical variables, standardize numerical variables, and construct time series feature matrix and static feature vector; S2 Model Construction: The static feature vector is input into a multilayer perceptron sub-network to extract static feature representation. The time series feature matrix is linearly embedded and positionally encoded, then input into a stacked multilayer Transformer encoder to extract temporal feature representation. The static feature representation and the temporal feature representation are concatenated and then nonlinearly interacted through a fusion network to obtain fused features. Based on the fused features, a regression network outputs predicted values. S3 training model: During the training process, historical samples and corresponding real labels are input, and an adaptive optimization algorithm is used for training. The training set and validation set are separated by rolling time verification. S4 Model Inference Output: Load the trained model weights into the prediction model and place it in evaluation mode. Perform preprocessing on the input static features and time series features in the same way as in the training phase. Input the sample to be predicted into the model, and output the target prediction value after static feature encoding, time series feature attention encoding, feature fusion and regression prediction.
2. The method according to claim 1, characterized in that, The static feature vector is input into a multilayer perceptron subnetwork to extract static feature representations, including: The static feature vector is sequentially passed through a fully connected layer with an output dimension of 128 and the ReLU activation function, a Dropout layer, and a fully connected layer with an output dimension of 64 and the ReLU activation function, to obtain a 64-dimensional static feature vector.
3. The method according to claim 1, characterized in that, The time series feature matrix is linearly embedded and positionally encoded, then input into a stacked multi-layer Transformer encoder to extract temporal feature representations, including: The time series feature matrix is mapped to a specified dimension through a linear embedding layer, and positional encoding is superimposed to preserve the time sequence information. The matrix is then input into a stacked L-layer Transformer encoder, with each layer including a multi-head self-attention layer, a feedforward network layer, residual connections, and layer normalization operations. The time feature representation vector is obtained through average pooling or attention-weighted pooling.
4. The method according to claim 1, characterized in that, The static feature representation and the temporal feature representation are concatenated and then subjected to nonlinear interaction by a fusion network to obtain fused features, including: The static feature representation and the temporal feature representation are concatenated and then sequentially passed through a 128-dimensional fully connected layer with ReLU activation, a BatchNorm layer, a Dropout layer, and a 64-dimensional fully connected layer with ReLU activation to obtain the fused feature vector.
5. The method according to claim 1, characterized in that, Based on the fusion features, a regression network outputs predicted values, including: The fused features are sequentially passed through a fully connected layer with a 32-dimensional output and a ReLU activation function, and then through a fully connected layer with a 1-dimensional output and a linear activation function to output the predicted value.
6. The method according to claim 1, characterized in that, Training is performed by inputting historical samples and their corresponding real labels, including: HuberLoss or MAE is used as the loss function, and Adam adaptive optimization algorithm is used for parameter update. The training set and validation set are divided by rolling time validation, and early stopping or learning rate adjustment is performed based on the performance of the validation set.
7. The method according to claim 1, characterized in that, Load the trained model weights into the prediction model and output the target prediction value, including: The model is placed in evaluation mode with batch normalization and random inactivation turned off. Input features are normalized, categorically encoded, and time-aligned. Samples to be predicted are input into the model in batches. Inconsistent time series lengths are filled and time masks are constructed to mask invalid time steps. After outputting the predicted values, truncation, binning, or intervalization are performed.
8. An inventory data prediction system based on static attributes and time-series data of commodities, characterized in that, The system includes: The data acquisition and preprocessing module is used to collect static feature data of the target object and its corresponding time series market feature data, encode categorical variables, standardize numerical variables, and construct time series feature matrix and static feature vector; A model building module is used to input the static feature vector into a multilayer perceptron sub-network to extract static feature representation, input the time series feature matrix into a stacked multilayer Transformer encoder after linear embedding and position encoding to extract temporal feature representation, concatenate the static feature representation and the temporal feature representation and then perform nonlinear interaction through a fusion network to obtain fused features, and output predicted values based on the fused features through a regression network. The training model module is used to input historical samples and corresponding real labels during the training process, and to train using an adaptive optimization algorithm. The training set and validation set are separated by rolling time validation. The model inference output module is used to load the trained model weights into the prediction model and put it into evaluation mode. It performs the same preprocessing on the input static features and time series features as in the training phase. The model inputs the sample to be predicted and outputs the target prediction value after static feature encoding, time series feature attention encoding, feature fusion and regression prediction.
9. An electronic device, characterized in that, It includes a memory and a processor, the memory storing a computer program that, when executed by the processor, implements the method as described in any one of claims 1 to 7.
10. A computer-readable storage medium, characterized in that, It stores a computer program that, when executed by a processor, implements the method as described in any one of claims 1 to 7.
