A method, device and equipment for purchasing prediction of long-tail commodities

By using a sliding time window and multi-level temporal feature extraction, combined with XGBoost and LightGBM models, the accuracy and stability issues of long-tail product sales forecasting are solved, achieving high-precision forecast result storage and adaptive capabilities, thus meeting the needs of enterprise procurement management.

CN121767032BActive Publication Date: 2026-06-16FUJIAN ZHONGCHUANG AUTOLINK NETWORK TECH CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
FUJIAN ZHONGCHUANG AUTOLINK NETWORK TECH CO LTD
Filing Date
2026-03-02
Publication Date
2026-06-16

AI Technical Summary

Technical Problem

Existing technologies are unable to effectively characterize the drastic fluctuations and non-stationary characteristics of long-tail product sales sequences, resulting in low prediction accuracy, poor stability, and a lack of support for the reliability and traceability of prediction results.

Method used

The training samples are transformed using a sliding time window, multi-level temporal features are extracted, static weights are assigned, and predictions are made using the XGBoost and LightGBM models in the hybrid training framework. The prediction results and decision information are then stored in the blockchain ledger.

Benefits of technology

It significantly improves the accuracy and stability of sales forecasting for long-tail products, enables the model to adapt to distribution drift, and provides reliable data support and tamper-proof decision records.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121767032B_ABST
    Figure CN121767032B_ABST
Patent Text Reader

Abstract

The application discloses a long-tail commodity purchase prediction method, device and equipment, comprising: converting commodity historical daily sales data into multiple training samples through a sliding time window; extracting multi-level time sequence features from the historical sales sequence of each training sample to form a unified feature vector; discriminating the growth mode based on the historical sales sequence of the training sample, and assigning a static weight to each training sample according to the discrimination result; inputting the unified feature vector and the static weight into a hybrid training framework for training, dividing the multi-level time sequence features into multiple feature subsets of different scales according to time span, setting different priority for different feature subsets, obtaining a first prediction model and a second prediction model; inputting a sample to be predicted into the first prediction model and the second prediction model to obtain a first prediction value and a second prediction value respectively, and weighting and fusing the first prediction value and the second prediction value according to a determined fusion weight to obtain a sales prediction result.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of commodity sales forecasting technology, and in particular to a method, apparatus and equipment for forecasting the purchase of long-tail commodities. Background Technology

[0002] In the retail, e-commerce, and supply chain management sectors, product sales generally exhibit a significant long-tail distribution characteristic. Many long-tail products have low individual sales volumes, discontinuous sales, drastic fluctuations, and are often accompanied by periods of explosive growth. These data characteristics make it difficult for traditional procurement forecasting methods to effectively depict their true sales trends, easily leading to operational dilemmas where inventory backlog and stockout risks coexist.

[0003] Existing sales forecasting solutions mainly include: statistical model-based methods, such as moving average, exponential smoothing, and ARIMA. These methods rely heavily on data stationarity and a clear trend cycle structure, making them difficult to adapt to the large number of zero values, structural abrupt changes, and non-stationary characteristics in the sales series of long-tail products, resulting in significant prediction bias. Machine learning-based forecasting methods, including random forests, gradient boosting trees, and deep neural networks, although performing well in the forecasting of mainstream products, still face problems in long-tail scenarios, such as an extremely low sample ratio during key growth stages, the model being dominated by a large number of low-fluctuation samples, and a lag in response to sales inflection points and explosive growth.

[0004] Furthermore, corporate procurement decisions place higher demands on the reliability of forecast results. Sales forecasts not only need to be highly accurate but also meet the requirements of traceability, tamper-proofing, and accountability for post-audit. However, existing technologies mostly focus on model performance optimization and lack systematic support for the evidence preservation, auditing, and accountability tracking of forecast results in the procurement process. Summary of the Invention

[0005] In view of this, the purpose of this invention is to propose a method, apparatus and equipment for predicting the purchase of long-tail commodities, which aims to solve the problems of low prediction accuracy and poor stability caused by the imbalance of samples, violent fluctuations and sales distribution drift in existing long-tail commodity purchase prediction schemes.

[0006] To achieve the above objectives, the present invention provides a method for predicting the procurement of long-tail commodities, the method comprising:

[0007] The historical daily sales data of the product is converted into multiple training samples through a sliding time window. Each training sample consists of the daily sales of the most recent W consecutive days as the input sequence, and the cumulative sales of the H consecutive days after the end of the input sequence are used as the prediction target.

[0008] Extract multi-level time-series features, including basic sales sequence features, statistical aggregation features, volatility features, and growth acceleration features, from the historical sales sequence of each training sample to form a unified feature vector;

[0009] Growth patterns are identified based on the historical sales sequence of each training sample, and static weights are assigned to each training sample based on the identification results.

[0010] The unified feature vector and the static weights are input into the hybrid training framework for training. During the training process, the multi-level temporal features are divided into multiple feature subsets of different scales according to the time span, and different priorities are set for different feature subsets to obtain the first prediction model and the second prediction model after training.

[0011] The sample to be predicted is input into the first prediction model and the second prediction model to obtain the first prediction value and the second prediction value respectively. The first prediction value and the second prediction value are then weighted and fused according to the determined fusion weight to obtain the sales prediction result.

[0012] Preferably, the method further includes:

[0013] The sales forecast result, the feature configuration summary and model parameter summary used when generating the sales forecast result, the product identifier, the forecast time, and the procurement decision information generated based on the sales forecast result constitute a notarized data record. The hash value of the notarized data record is calculated and written into the blockchain ledger.

[0014] Preferably, the extraction of multi-level time-series features from the historical sales sequence of each training sample, including basic sales sequence features, statistical aggregation features, volatility features, and growth acceleration features, includes:

[0015] The basic sales sequence features include the raw daily sales values ​​for W consecutive days in the input sequence;

[0016] The statistical aggregation features include the cumulative sales values ​​for the past 7 days, the past 14 days, and the past 30 days;

[0017] The volatility characteristic includes the coefficient of variation of sales over the past 30 days, which is the ratio of the standard deviation of sales over the past 30 days to the mean of sales over the past 30 days.

[0018] The growth acceleration feature includes a first growth acceleration value and a second growth acceleration value, wherein the first growth acceleration value is the ratio of the total sales volume of the past 7 days to the total sales volume of the 14 days to the 8 days prior to the current time point, and the second growth acceleration value is the ratio of the first growth acceleration value to the first growth acceleration value at the previous time point.

[0019] Preferably, the step of determining the growth pattern based on the historical sales sequence of each training sample and assigning static weights to each training sample according to the determination result includes:

[0020] The historical sales sequence of the training samples is divided into an early period and a later period, according to... Calculate the total sales volume in the later period. Total sales in the previous period growth rate In the formula, ε represents the smallest positive number to prevent the denominator from being zero, and i represents the i-th training sample;

[0021] Based on the growth ratio, the growth mode of the training sample is determined, and a corresponding indicator function value is set for each training sample according to the discrimination result. The growth mode includes low base rapid growth mode, continuous accelerated growth mode and staged explosive growth mode.

[0022] The corresponding indicator function value is input into the weight function to calculate the initial weight of each training sample, and the initial weights of all training samples are normalized to obtain the static weights, wherein the weight function is expressed as:

[0023] In the formula, Let η1, η2, and η3 represent the base scaling factor, and let η1, η2, and η3 represent the corresponding weight enhancement coefficients, satisfying η1 > η2 > η3 > 0. , This represents the corresponding indicator function value, where,

[0024] If the growth pattern of the training samples is a low-radius rapid growth pattern, then the corresponding indicator function value =1, otherwise 0;

[0025] If the growth pattern of the training samples is a continuously accelerating growth pattern, then the corresponding indicator function value =1, otherwise 0;

[0026] If the growth pattern of the training samples is a phased burst growth pattern, then the corresponding indicator function value =1, otherwise 0.

[0027] Preferably, the step of dividing the multi-level temporal features into multiple feature subsets of different scales according to the time span, and setting differentiated priorities for different feature subsets, includes:

[0028] The multi-level time series features are divided into short-term feature subsets, medium-term feature subsets, and long-term feature subsets. The short-term feature subset corresponds to features on a time scale of 1-7 days, the medium-term feature subset corresponds to features on a time scale of 8-30 days, and the long-term feature subset corresponds to features on a time scale of more than 30 days.

[0029] During training, the short-term feature subset is given an initial splitting priority higher than the intermediate and long-term feature subsets. The intermediate feature subset is given a weight for use in the middle nodes of the decision tree. The long-term feature subset is restricted to splitting only in the high-level nodes of the decision tree, and a maximum splitting depth constraint is set.

[0030] Preferably, the first prediction model is an XGBoost regression tree model and the second prediction model is a LightGBM regression tree model.

[0031] Preferably, the determination of the fusion weights includes:

[0032] The validation sample is input into the first prediction model and the second prediction model to obtain the first validation prediction value and the second validation prediction value, respectively.

[0033] Based on the first verified predicted value, the second verified predicted value, and the corresponding actual sales value, the prediction deviation rate between the first prediction model and the second prediction model is calculated.

[0034] The fusion weights of the first and second prediction models in integrated prediction are dynamically adjusted based on the prediction deviation rate.

[0035] Preferably, the prediction deviation rate is calculated using a piecewise function:

[0036]

[0037] In the formula, j represents the j-th verification sample. This represents actual sales volume. This indicates a forecast of sales volume. This indicates the threshold for stable sales volume.

[0038] To achieve the above objectives, the present invention also provides a procurement forecasting device for long-tail commodities, the device comprising:

[0039] The conversion unit is used to convert historical daily sales data of a product into multiple training samples through a sliding time window. Each training sample consists of the daily sales of the most recent W consecutive days as the input sequence and the cumulative sales of the H consecutive days after the end of the input sequence as the prediction target.

[0040] The feature extraction unit is used to extract multi-level time-series features from the historical sales sequence of each training sample, including basic sales sequence features, statistical aggregation features, volatility features, and growth acceleration features, to form a unified feature vector;

[0041] The weight allocation unit is used to determine the growth pattern based on the historical sales sequence of each training sample, and to assign static weights to each training sample according to the determination result.

[0042] The training unit is used to input the unified feature vector and the static weights into the hybrid training framework for training. During the training process, the multi-level temporal features are divided into multiple feature subsets of different scales according to the time span, and different priorities are set for different feature subsets to obtain the first prediction model and the second prediction model after training.

[0043] The prediction unit is used to input the sample to be predicted into the first prediction model and the second prediction model to obtain the first prediction value and the second prediction value respectively, and to perform weighted fusion of the first prediction value and the second prediction value according to the determined fusion weight to obtain the sales prediction result.

[0044] To achieve the above objectives, the present invention also proposes a procurement forecasting device for long-tail commodities, comprising a processor, a memory, and a computer program stored in the memory, wherein the computer program is executed by the processor to implement the steps of a procurement forecasting method for long-tail commodities as described in the above embodiments.

[0045] To achieve the above objectives, the present invention also proposes a computer-readable storage medium storing a computer program that is executed by a processor to implement the steps of a long-tail commodity procurement forecasting method as described in the above embodiments.

[0046] Beneficial effects:

[0047] The above scheme, through sliding window sample construction, multi-level temporal feature extraction, static weight allocation, multi-scale differentiated training, dual-model integration, and adaptive determination of fusion weights, forms a closed loop for long-tail product procurement forecasting. It significantly improves the modeling ability for complex sales patterns such as sparse sales and drastic fluctuations. While ensuring prediction accuracy and stability, it enables the model to autonomously adapt to distribution drift, providing reliable data support for subsequent procurement decision audits.

[0048] Key data such as sales forecast results, feature configuration summaries, model parameter summaries, and procurement decision information are compiled into a notarized data record. After hashing, this record is written into the blockchain ledger. This mechanism achieves immutable recording of forecast results and decision-making basis, and verifiable auditability across nodes, without disclosing the original business data. Even if the model is retrained or the parameters are updated later, the model state at the time of forecasting can still be restored based on the on-chain summary, fundamentally meeting the rigid requirements of enterprise procurement management for accountability tracking, compliance auditing, and data credibility.

[0049] By specifically defining features such as basic sales sequences, statistical aggregation, volatility, and growth acceleration, this feature system can fully explore the multi-scale variation patterns of long-tail products within the original sales space. This allows the model to simultaneously perceive short-term fluctuations and medium-to-long-term trends, significantly improving the predictive sensitivity for sales inflection points and explosive growth phases. Furthermore, the coefficient of variation effectively characterizes the instability of sales, while the first and second growth acceleration features accurately capture the intensity of the acceleration in the transition from stable to explosive sales.

[0050] By calculating the sales growth ratio of the training samples before and after the training, and based on the discrimination results of patterns such as rapid growth from a low base, continuous accelerated growth, and phased bursts, differentiated static weights are assigned to the samples. These weights are fixed within a single training cycle and are not updated with model error feedback, thus avoiding feedback coupling between the weights and the model output. Furthermore, by giving key growth samples higher weight gains, the dominance effect of a large number of stable samples on the model is effectively suppressed, allowing the model training to focus on growth phase samples that are scarce but have important decision-making significance in long-tail products, significantly improving the fitting ability to sales inflection points and burst patterns.

[0051] Multi-level time-series features are divided into three subsets: short-term (1-7 days), medium-term (8-30 days), and long-term (over 30 days). Different splitting constraints are applied to these subsets during tree model training: short-term features are given the highest splitting priority to capture burst details; medium-term features have increased weights applied to mid-level nodes to characterize trend persistence; and long-term features are restricted to splitting only at high-level nodes to avoid over-smoothing of short-term patterns. This mechanism achieves implicit multi-scale feature importance allocation without introducing an additional attention network, enabling the model to simultaneously consider short-term fluctuations and long-term trends, making it particularly suitable for the dynamic sales behavior of long-tail products transitioning from stable to explosive growth.

[0052] By employing XGBoost and LightGBM gradient boosting tree models as the base models in a hybrid training framework, this type of model can efficiently capture feature combination relationships and local nonlinear trends through a multi-decision tree residual fitting mechanism. It is also less sensitive to data sparsity and sample size, has stable training, and is not prone to overfitting. Compared with deep neural networks, it is more suitable for the limited sample characteristics of long-tail product sales sequences, providing a lightweight, efficient, and practical model selection solution for enterprise daily procurement forecasting scenarios.

[0053] By calculating the prediction bias rates of the two base models separately during the validation phase and employing a piecewise function to smooth the bias in low-sales scenarios, continuous adaptive reconstruction of the model fusion weights is achieved. This method differs from the traditional discrete selection strategy based on the historical best model; instead, it dynamically adjusts the contribution ratio of the two models according to the validation bias distribution, enabling the ensemble model to respond in real-time to structural drift in the sales distribution of long-tail products. Experiments show that this mechanism can significantly reduce the prediction risk caused by distribution drift, maintain stable prediction performance in long-term operation, and greatly reduce the need for manual parameter intervention. Attached Figure Description

[0054] To more clearly illustrate the technical solutions in the embodiments of the present invention or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.

[0055] Figure 1 This is a flowchart illustrating a method for predicting the purchase of long-tail commodities according to an embodiment of the present invention.

[0056] Figure 2 This is a schematic diagram of a procurement forecasting device for long-tail commodities provided in an embodiment of the present invention.

[0057] The realization of the invention's objective, its functional characteristics, and advantages will be further explained in conjunction with the embodiments and with reference to the accompanying drawings. Detailed Implementation

[0058] To make the objectives, technical solutions, and advantages of the embodiments of the present invention clearer, the technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only a part of the embodiments of the present invention, not all of them. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention. Therefore, the following detailed description of the embodiments of the present invention provided in the accompanying drawings is not intended to limit the scope of the claimed invention, but merely to represent selected embodiments of the invention. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.

[0059] The present invention will be described in detail below with reference to the embodiments.

[0060] Reference Figure 1The diagram shows a flowchart of a procurement forecasting method for long-tail commodities according to an embodiment of the present invention. In this embodiment, the method includes:

[0061] S11 converts the historical daily sales data of the product into multiple training samples through a sliding time window. Each training sample consists of the daily sales of the most recent consecutive W days as the input sequence, and the cumulative sales of the consecutive H days after the end of the input sequence as the prediction target.

[0062] In this embodiment, the historical sales data of the products are uniformly converted into daily time series. Let the daily sales series of a certain long-tail product over continuous time be represented as: ,in Let represent the actual sales value on day t, and T represent the number of historical observation days for the current product. To ensure the temporal consistency of the model input and the effective prediction of future procurement cycles, this embodiment adopts a sliding time window sample construction method. That is, the historical window length W is set to a preset positive integer, and the prediction cycle length H is also a preset positive integer. Then, for any time index t (t≥W+1), a training sample is constructed as follows:

[0063] ,

[0064] ,

[0065] in, The input feature vector for this training sample consists of the daily sales values ​​of the most recent W consecutive days. The target value for this training sample represents the cumulative sales volume over the next H consecutive days, starting from day t. This cumulative sales volume directly corresponds to the total demand for the future procurement cycle in the enterprise's purchasing decisions, supporting subsequent procurement quantity recommendations. Furthermore, to facilitate time-dimensional analysis and validation set partitioning during model training, each sample also carries a value starting from the end date of the input sequence (i.e., day t). The predicted time label is 1 day, such as the month or week to which the end date belongs. Through the above sliding window mechanism, the original daily sales sequence of the product is transformed into multiple training samples with fixed input and output structures. Each sample fully describes the sales pattern of the product in a certain historical period and its corresponding future short-term sales total, thus providing a standardized data foundation for subsequent multi-level time series feature extraction, growth pattern discrimination and model training.

[0066] S12 extracts multi-level time-series features from the historical sales sequence of each training sample, including basic sales sequence features, statistical aggregation features, volatility features, and growth acceleration features, to form a unified feature vector.

[0067] Furthermore, in step S12, the extraction of multi-level time-series features from the historical sales sequence of each training sample, including basic sales sequence features, statistical aggregation features, volatility features, and growth acceleration features, includes:

[0068] The basic sales sequence features include the raw daily sales values ​​for W consecutive days in the input sequence;

[0069] The statistical aggregation features include the cumulative sales values ​​for the past 7 days, the past 14 days, and the past 30 days;

[0070] The volatility characteristic includes the coefficient of variation of sales over the past 30 days, which is the ratio of the standard deviation of sales over the past 30 days to the mean of sales over the past 30 days.

[0071] The growth acceleration feature includes a first growth acceleration value and a second growth acceleration value, wherein the first growth acceleration value is the ratio of the total sales volume of the past 7 days to the total sales volume of the 14 days to the 8 days prior to the current time point, and the second growth acceleration value is the ratio of the first growth acceleration value to the first growth acceleration value at the previous time point.

[0072] In this embodiment, to fully characterize the multi-scale variation patterns and dynamic evolution features of long-tail product sales, a multi-level temporal feature generation mechanism is constructed. For each training sample generated in step S11, its input sequence is used... Based on this, feature extraction is performed directly in the original sales sequence space, rather than relying on traditional trend decomposition or parametric reconstruction methods. Specifically, the extracted multi-level time-series features include:

[0073] Basic sales sequence features: The raw daily sales values ​​of W consecutive days in the input sequence are directly used as the finest-grained time-series description, i.e., the feature vector. This feature fully preserves the actual sales level for each day within the sample period.

[0074] Statistical aggregation characteristics: To capture the cumulative effect of sales at different time scales, the total sales volume over the past 7 days, 14 days, and 30 days is calculated respectively, constituting short-term, medium-term, and long-term sales aggregation characteristics, i.e. These characteristics can effectively reflect the overall scale and trend of sales over different time spans.

[0075] Volatility Characteristics: To quantify the instability of sales volume for long-tail products, a volatility measure is introduced based on the coefficient of variation of sales volume over the past 30 days. This is achieved by calculating the average sales volume over the past 30 days. and standard deviation σ 30 = Then the volatility characteristic is defined as: In the formula, ε is a very small positive number to prevent the denominator from being zero. This characteristic reflects the dispersion of sales volume; the larger the value, the more unstable the sales behavior.

[0076] Growth Acceleration Feature: To accurately depict the dynamic process of long-tail products transitioning from low-frequency, stable sales to periodic surges, a growth acceleration feature reflecting the rate of sales change was constructed. First, the first growth acceleration value is calculated, which is the ratio of the total sales of the past 7 days to the total sales of the previous 7 days (from 14 days to 8 days prior to the current time point): A ratio greater than 1 indicates an upward trend in sales, and a larger value indicates more rapid growth. Based on this, a second growth acceleration value is further calculated, which is the ratio of the current first growth acceleration value to the first growth acceleration value at the previous moment: This feature can effectively identify whether a growth trend is accelerating. A value >1 indicates that the growth momentum is further strengthening, and it is a key indicator for capturing the "inflection point" in sales and the precursor to a surge.

[0077] Finally, all the above features are concatenated to form a complete unified feature vector:

[0078] This feature vector, based on the original sales sequence, integrates multi-scale statistics, volatility measures, and growth dynamics information, preserving local details while encompassing medium- to long-term trends and abrupt change signals. Compared to existing methods that only utilize weighted trend features or single-scale time features, the multi-level time-series features constructed in this embodiment can more comprehensively and delicately depict the complex changing patterns of long-tail products at different sales stages, providing a discriminative input representation for subsequent hybrid training frameworks.

[0079] S13, based on the historical sales sequence of each training sample, the growth pattern is discriminated, and static weights are assigned to each training sample according to the discrimination result.

[0080] Furthermore, in step S13, the process of determining the growth pattern based on the historical sales sequence of each training sample and assigning static weights to each training sample according to the determination result includes:

[0081] S13-1, the historical sales sequence of the training samples is divided into an early time period and a later time period, according to... Calculate the total sales volume in the later period. Total sales in the previous period growth rate In the formula, ε represents the smallest positive number to prevent the denominator from being zero, and i represents the i-th training sample;

[0082] S13-2, Based on the growth ratio, determine the growth mode to which the training sample belongs, and set a corresponding indicator function value for each training sample according to the discrimination result. The growth mode includes low base rapid growth mode, continuous accelerated growth mode and staged explosive growth mode.

[0083] S13-3, input the corresponding indicator function value into the weight function to calculate the initial weight of each training sample, and normalize the initial weights of all training samples to obtain the static weights, wherein the weight function is expressed as:

[0084] In the formula, Let η1, η2, and η3 represent the base scaling factor, and let η1, η2, and η3 represent the corresponding weight enhancement coefficients, satisfying η1 > η2 > η3 > 0. , This represents the corresponding indicator function value, where,

[0085] If the growth pattern of the training samples is a low-radius rapid growth pattern, then the corresponding indicator function value =1, otherwise 0;

[0086] If the growth pattern of the training samples is a continuously accelerating growth pattern, then the corresponding indicator function value =1, otherwise 0;

[0087] If the growth pattern of the training samples is a phased burst growth pattern, then the corresponding indicator function value =1, otherwise 0.

[0088] In this embodiment, to address the issue of key growth samples being overwhelmed by a large number of stable, low-fluctuation samples in the training samples for long-tail products, a static sample weight allocation mechanism based on growth pattern discrimination and sales mechanism is constructed. This mechanism is completed before model training begins. Once the training sample weights are determined, they remain fixed throughout the entire single training cycle and are not updated with prediction errors or gradient information during model iteration, thereby effectively avoiding feedback coupling between the weights and the model output. For each training sample generated above, its corresponding historical sales input vector is denoted as... , where i represents the i-th training sample. First, the input sequence is divided into two consecutive segments in chronological order: an early period and a late period. The total sales volume of each segment is calculated separately, i.e.:

[0089] , Based on the sales volume of the above-mentioned segments, calculate the sales growth rate of this sample from the early to the later stages: Where ε is a very small positive number to prevent the denominator from being zero, this growth ratio It is a core quantitative indicator for judging subsequent growth patterns.

[0090] However, the growth pattern identification is based on the sales volume base, growth rate, and trend persistence to quantitatively determine the growth pattern of the training samples. The specific identification is as follows:

[0091] Low-base rapid growth mode: When the average sales volume of the training sample in the early period is less than the average historical sales volume of the product and the first threshold. ( The product of ∈ (0,1) and the growth rate Greater than the second threshold ( When >1), the training sample is determined to belong to the low-base-rate-rapid-growth mode;

[0092] Continuous Accelerated Growth Pattern: When the historical sales sequence is divided into multiple consecutive time segments, and the sales growth rate of adjacent segments shows a monotonically increasing trend, the training sample is determined to belong to the continuous accelerated growth pattern.

[0093] Phased burst pattern: when the growth rate Greater than the third threshold And the total sales in the later period Greater than the average historical sales volume of the product and the fourth threshold When the product of and is used, the training sample is determined to belong to the phased burst mode.

[0094] Based on the above discrimination results, a corresponding indicator function value is set for each training sample to characterize its growth pattern type:

[0095] If the growth pattern of the training samples is a low-radius rapid growth pattern, then the corresponding indicator function value =1, otherwise 0;

[0096] If the growth pattern of the training samples is a continuously accelerating growth pattern, then the corresponding indicator function value =1, otherwise 0;

[0097] If the growth pattern of the training samples is a phased burst growth pattern, then the corresponding indicator function value =1, otherwise 0.

[0098] The indicator function value is substituted into a predefined weighting function to calculate the initial weight for each sample. The weighting function is based on the sales growth rate. Total sales in the first phase Total sales in the later period Using these as independent variables, and by assigning differentiated weighting coefficients to different growth patterns, key growth samples are highlighted:

[0099] ;

[0100] in, The base scaling factor controls the overall weight level; η1, η2, and η3 are the weight enhancement coefficients corresponding to the three growth modes, satisfying η1>η2>η3>0, prioritizing samples with rapid growth from a low base, followed by continuously accelerating samples, and then explosive samples; for samples that are stable in the long term or have no significant changes, all indicator functions are 0, and only the base weight is retained. .

[0101] Normalization: To maintain the numerical stability of the loss function during model training, the initial weights of all training samples are normalized to obtain the final static weights used for model training. , where N is the total number of training samples. This normalized static weight remains fixed within a single training cycle and is directly used in the subsequent hybrid training framework to weight the loss contribution of each sample, thereby guiding the model to pay more attention to those key growth stage samples that have important decision-making significance, effectively improving the fitting ability to typical long-tail patterns such as sales inflection points and explosive growth.

[0102] S14, the unified feature vector and the static weights are input into the hybrid training framework for training. During the training process, the multi-level temporal features are divided into multiple feature subsets of different scales according to the time span, and different priority is set for different feature subsets to obtain the first prediction model and the second prediction model after training.

[0103] Furthermore, the first prediction model is an XGBoost regression tree model, and the second prediction model is a LightGBM regression tree model.

[0104] Furthermore, in step S14, dividing the multi-level temporal features into multiple feature subsets of different scales according to the time span, and setting differentiated priorities for different feature subsets, includes:

[0105] S14-1, the multi-level time series features are divided into short-term feature subset, medium-term feature subset and long-term feature subset, wherein the short-term feature subset corresponds to features on a time scale of 1-7 days, the medium-term feature subset corresponds to features on a time scale of 8-30 days, and the long-term feature subset corresponds to features on a time scale of more than 30 days.

[0106] S14-2, During the training process, the short-term feature subset is given an initial splitting priority higher than the intermediate feature subset and the long-term feature subset. The intermediate feature subset is given a weight for use in the middle-level nodes of the decision tree. The long-term feature subset is restricted to splitting only in the high-level nodes of the decision tree, and a maximum splitting depth constraint is set.

[0107] In this embodiment, the unified feature vector and static weights are input together into a hybrid training framework for model training. This hybrid training framework includes a first prediction model and a second prediction model. The first prediction model is an XGBoost regression tree model, and the second prediction model is a LightGBM regression tree model. Both belong to the Gradient Boosting Tree (GBDT) class of models, and their model architecture includes multiple decision trees. During training, each decision tree iteratively optimizes the prediction error by fitting the residual of the previous decision tree. The final prediction value is a weighted sum of the outputs of each decision tree. This type of model can efficiently capture the nonlinear mutation relationship and complex feature combination in long-tail sales sequences. It is also less sensitive to data sparsity and sample size, has stable training, and is not prone to overfitting. Compared with deep neural networks, it is more suitable for daily procurement prediction scenarios for enterprises.

[0108] For multi-scale hierarchical feature subset partitioning, in order to simultaneously characterize short-term fluctuations, medium-term trends, and long-term evolution within the same prediction framework, this embodiment explicitly divides the constructed multi-level time-series features into three feature subsets of different scales based on the time span corresponding to the features before model training, namely:

[0109] Short-term feature subset: Features corresponding to a time scale of 1-7 days, including the original daily sales sequence, the cumulative sales value of the past 7 days, the first growth acceleration value, etc.; This type of feature is highly sensitive to short-term disturbances such as sales bursts and temporary promotions.

[0110] Mid-term feature subset: Features corresponding to the 8-30 day time scale, including cumulative sales value in the past 14 days and the past 30 days, volatility features (coefficient of variation), etc.; these features reflect the trend stability and cyclical changes in sales.

[0111] Long-term feature subset: Features corresponding to time scales of 30 days or more, including historical comparisons, seasonal patterns, and historical growth stage features; these features are used to characterize the macro-evolutionary patterns of a product's life cycle.

[0112] However, differentiated splitting priority and constraint strategies guide the model to assign differentiated attention to information at different time scales. This embodiment applies explicit splitting priority and usage constraints to the aforementioned feature subsets during tree model training, thereby achieving an implicit multi-scale attention allocation mechanism without the need for additional parameters. This effectively avoids the overfitting risk of explicit attention structures in long-tailed sample scenarios. The specific strategy is as follows:

[0113] For short-term feature subsets, an initial splitting priority is assigned higher than that for medium- and long-term feature subsets. During the decision tree growth process, short-term features are preferentially selected as splitting nodes to fully capture local mutations and burst details in the sales sequence.

[0114] For the intermediate feature subset, a standard splitting strategy is adopted, but its weight in the middle layers of the decision tree is increased. That is, in the middle depth layers of the tree, by adjusting the feature sampling ratio or the splitting gain threshold, intermediate features are given more opportunities to participate in splitting, thereby strengthening the modeling of trend persistence and fluctuation patterns.

[0115] For long-term feature subsets, they are restricted to splitting only at high-level nodes of the decision tree, and a maximum split depth constraint is set. By prohibiting long-term features from splitting at lower levels (detail levels) of the tree, excessive smoothing and interference of macro-trend features on short-term burst patterns are avoided; at the same time, splitting at high-level nodes can introduce long-term information as a global background into the model, taking into account the overall evolution direction.

[0116] The aforementioned constraint strategies can be implemented in the native training interfaces of XGBoost and LightGBM by customizing parameters such as feature weights, feature splitting prohibition masks, and maximum depth limits, without modifying the underlying model algorithm. During training, the actual usage frequency of feature subsets in the tree structure and information gain jointly determine their implicit weights. When making predictions, the model can adaptively give more attention to key time scales (such as short-term bursts or medium-term trends) based on the specific sales stage of the input sample.

[0117] Through the aforementioned training mechanism, this embodiment trains the first prediction model (XGBoost) and the second prediction model (LightGBM) in parallel within a hybrid training framework. Both models use a unified feature vector as input and the cumulative sales volume over the next H days, as defined in step S11, as the prediction target. Normalized static weights are introduced into the loss function calculation to ensure that key growth samples receive a greater gradient contribution. After training, two base models with different inductive biases but both fully learn the long-tail sales patterns are obtained, providing a complementary model foundation for subsequent ensemble prediction and adaptive weight adjustment.

[0118] S15, input the sample to be predicted into the first prediction model and the second prediction model to obtain the first predicted value and the second predicted value respectively, and perform weighted fusion of the first predicted value and the second predicted value according to the determined fusion weight to obtain the sales prediction result.

[0119] The sample to be predicted has the same input sequence length W as the training sample.

[0120] Furthermore, in step S15, the determination of the fusion weights includes:

[0121] S15-1, Input the verification sample into the first prediction model and the second prediction model to obtain the first verification prediction value and the second verification prediction value respectively;

[0122] S15-2, Based on the first verified predicted value, the second verified predicted value and the corresponding actual sales value, calculate the prediction deviation rate between the first prediction model and the second prediction model;

[0123] S15-3, dynamically adjust the fusion weights of the first prediction model and the second prediction model in the integrated prediction based on the prediction deviation rate.

[0124] Furthermore, the prediction deviation rate is calculated using a piecewise function:

[0125]

[0126] In the formula, j represents the j-th verification sample. This represents actual sales volume. This indicates a forecast of sales volume. This indicates the threshold for stable sales volume.

[0127] In this embodiment, based on the first prediction model (XGBoost) and the second prediction model (LightGBM) that have been trained, the optimal fusion weights of the two models in the integrated prediction are first determined through the validation set, and then the actual samples to be predicted are weighted and fused to output the final sales prediction value.

[0128] To address the structural drift in the sales distribution of long-tail products over time, this embodiment introduces a validation-driven, continuously adaptive weight reconstruction mechanism. First, validation samples are selected from the validation set partitioned from the training data and input into the first and second prediction models respectively to obtain the corresponding first validation prediction values. Compared with the second verification prediction value Where j represents the j-th validation sample. This is combined with the actual sales value of that sample. The prediction bias rates of the two base models on this sample are calculated separately. To accommodate the significant differences in the sales volume of long-tail products, the prediction bias rate is defined using a piecewise function:

[0129]

[0130] in, The value is the predicted value of the corresponding model, and θ is the preset sales stability threshold. When the actual sales are lower than θ, θ is used to replace the denominator for calculation to avoid abnormally amplified deviation rate due to the small sales base, thereby ensuring the stability of weight adjustment.

[0131] The average prediction bias rates of the first and second prediction models on all validation samples in the validation set are calculated separately, and the distribution characteristics of the bias rates on samples with different growth patterns (such as rapid growth from a low base, continuous accelerated growth, and phased bursts) are further analyzed. This embodiment does not simply select the historically best model for fixed ensemble integration, but rather continuously and adaptively reconstructs the fusion weights of the two models based on the prediction bias distribution of each model in the current validation phase. Specifically, let the fusion weight of the first prediction model be λ, and the fusion weight of the second prediction model be 1. If λ is used, the weight update method is as follows: when the overall bias rate of the first prediction model on the validation set or the bias rate for a specific growth pattern is significantly lower than that of the second prediction model, the value of λ is increased; otherwise, the value of λ is decreased. This adjustment process can be performed in real time based on the validation bias statistics within the sliding window, enabling the integrated weights to smoothly respond to changes in sales distribution, rather than discrete jumps.

[0132] After the fusion weights are determined during the validation phase, for any sample to be predicted, its input sequence (with the same length W as the training sample) is input into the first prediction model and the second prediction model respectively to obtain the first predicted value f1(x). pred ) and the second predicted value f2(x pred The final sales forecast was obtained through linear weighted fusion. Where λ is the fusion weight determined after adaptive reconstruction during the validation phase. This weighted fusion mechanism effectively combines the complementary advantages of XGBoost and LightGBM gradient boosting tree models in predicting long-tail products: XGBoost is robust to local feature combinations and outliers, while LightGBM performs well in handling large-scale sparse features and efficiency. Through validation-driven continuous weight adaptation, the ensemble model can dynamically respond to changes in the sales patterns of long-tail products, smoothly switching the level of trust in each base model between periods of stable and explosive sales, thereby significantly reducing the prediction risk caused by distribution drift and providing stable and accurate sales prediction results for subsequent purchasing decisions.

[0133] In another embodiment, the method further includes:

[0134] S16, the sales forecast result, the feature configuration summary and model parameter summary used when generating the sales forecast result, the product identifier, the forecast time, and the procurement decision information generated based on the sales forecast result constitute a storage data record, the hash value of the storage data record is calculated and written into the blockchain ledger.

[0135] The feature configuration summary includes the time window length W, the number of feature dimensions, and the name of each feature. The model parameter summary includes the model type, model performance indicators, and training sample size. Both the feature configuration summary and the model parameter summary are serialized using the SHA-256 hash algorithm to generate a fixed-length fingerprint value.

[0136] The procurement decision information is calculated based on the final sales forecast and in combination with at least one of the following business constraints: safety stock threshold, minimum order quantity from suppliers, inventory turnover threshold, and capital occupation limit. The calculation results in the optimal procurement quantity, recommended procurement time, and priority identifier.

[0137] The blockchain ledger is a distributed ledger of a consortium blockchain or a private blockchain; after the hash value is written into the blockchain ledger, it is used to verify the integrity and immutability of the stored data record in the subsequent audit process, and to restore the model state when the final sales forecast value was generated based on the feature configuration summary and model parameter summary.

[0138] In this embodiment, to meet the compliance requirements of enterprise procurement management regarding the auditability, traceability, and accountability of forecast results, a blockchain-based forecast result notarization and verification mechanism is constructed. For the generated final sales forecast result, a structured notarization data record is first constructed, which includes at least the following core elements: product identifier (such as SKU code), and final sales forecast value. The features configuration summary and model parameter summary used to generate the sales forecast result, the forecast timestamp, and the procurement decision information generated based on the forecast result.

[0139] The feature configuration summary uniquely identifies the feature engineering state when generating prediction results, specifically including the sliding time window length W, the number of feature dimensions, and a list of feature names. These configuration parameters are serialized and then hashed using the SHA-256 algorithm to generate a fixed-length fingerprint value, which serves as the feature configuration summary. The model parameter summary uniquely identifies the model state when generating prediction results, specifically including the model type (XGBoost, LightGBM), model performance metrics (such as validation set mean absolute error, root mean square error), and training sample size. Similarly, these parameters are serialized and then hashed using the SHA-256 algorithm to generate a fingerprint value, which serves as the model parameter summary.

[0140] Procurement decision information is based on sales forecasts and calculated executable procurement orders derived from actual procurement business constraints. Business constraints include one or more of the following: safety stock threshold, minimum order quantity from suppliers, inventory turnover rate threshold, and capital occupation restrictions. A comprehensive optimization algorithm calculates the optimal procurement quantity, suggested procurement time, and priority identifier, generating an order that can be directly issued to the procurement system.

[0141] Integrate all the above information into a complete evidence storage data record. Its structured representation is as follows:

[0142] Perform a SHA-256 hash operation on the record to generate a unique hash fingerprint value: To avoid the privacy risks associated with uploading raw business data to the blockchain, this embodiment only uses hash values. The data is written to the blockchain ledger, while the original evidence data is stored in the enterprise's local database. The blockchain network adopts a distributed ledger architecture of consortium blockchains or private blockchains, ensuring that all participating nodes are authorized entities and that once written, it cannot be tampered with or deleted. This hash value serves as a digital fingerprint of the evidence data's integrity; any tampering with the original data will result in an inconsistent hash value, which can then be identified by the auditing system.

[0143] In procurement traceability or accountability audit scenarios, auditors can retrieve original evidence-based data records from the company's local database, recalculate their SHA-256 hash values, and compare them with the hash values ​​stored on the blockchain. If they match, it proves that the sales forecast result and procurement decision information have not been tampered with since the time of storage. Simultaneously, based on the feature configuration summary and model parameter summary in the evidence-based records, even if the original prediction model has undergone multiple retrainings or parameter iterations, auditors can still reconstruct the specific feature configuration and model version status when the prediction result was generated based on the summary fingerprint value, thereby achieving accurate reproduction of historical prediction behavior and determination of responsibility. This mechanism fundamentally solves the technical pain points of traditional procurement forecasting, such as the unreproducible forecast basis and difficulty in tracing decision-making responsibility, providing reliable evidence support throughout the entire lifecycle of long-tail product procurement decisions.

[0144] Reference Figure 2 The diagram shown is a structural schematic of a long-tail commodity procurement forecasting device provided in an embodiment of the present invention.

[0145] In this embodiment, the device 20 includes:

[0146] The conversion unit 21 is used to convert the historical daily sales data of the product into multiple training samples through a sliding time window. Each training sample consists of the daily sales of the most recent consecutive W days as the input sequence, and the cumulative sales of the consecutive H days after the end of the input sequence as the prediction target.

[0147] The feature extraction unit 22 is used to extract multi-level time-series features from the historical sales sequence of each training sample, including basic sales sequence features, statistical aggregation features, volatility features and growth acceleration features, to form a unified feature vector.

[0148] The weight allocation unit 23 is used to determine the growth pattern based on the historical sales sequence of each training sample and to assign static weights to each training sample according to the determination result.

[0149] Training unit 24 is used to input the unified feature vector and the static weight into the hybrid training framework for training. During the training process, the multi-level temporal features are divided into multiple feature subsets of different scales according to the time span, and different priorities are set for different feature subsets to obtain the first prediction model and the second prediction model after training.

[0150] The prediction unit 25 is used to input the sample to be predicted into the first prediction model and the second prediction model to obtain the first prediction value and the second prediction value respectively, and to perform weighted fusion of the first prediction value and the second prediction value according to the determined fusion weight to obtain the sales prediction result.

[0151] In another embodiment, the device 20 further includes:

[0152] The on-chain unit is used to construct a notarized data record from the sales forecast result, the feature configuration summary and model parameter summary used when generating the sales forecast result, the product identifier, the forecast time, and the procurement decision information generated based on the sales forecast result, calculate the hash value of the notarized data record, and write it into the blockchain ledger.

[0153] Each unit module of the device 20 can execute the corresponding steps in the above method embodiment, so the details of each unit module will not be elaborated here. Please refer to the description of the corresponding steps above for details.

[0154] This invention also provides a procurement forecasting device for long-tail commodities. The device includes the procurement forecasting apparatus for long-tail commodities described above, wherein the procurement forecasting apparatus for long-tail commodities can employ… Figure 2 The structure of the embodiment, correspondingly, can be executed Figure 1 The technical solutions of the method embodiments shown are similar in implementation principle and technical effect. For details, please refer to the relevant records in the above embodiments, which will not be repeated here.

[0155] The device includes: a mobile phone, digital camera, or tablet computer, or other device with a camera function; or a device with an image processing function; or a device with an image display function. The device may include components such as a memory, processor, input unit, display unit, and power supply.

[0156] The memory can be used to store software programs and modules. The processor executes various functional applications and data processing by running the software programs and modules stored in the memory. The memory can mainly include a program storage area and a data storage area. The program storage area can store the operating system, applications required for at least one function, etc.; the data storage area can store data created according to the use of the device, etc. In addition, the memory can include high-speed random access memory, and can also include non-volatile memory, such as at least one disk storage device, flash memory device, or other volatile solid-state storage device. Accordingly, the memory can also include a memory controller to provide access to the memory for the processor and input units.

[0157] The input unit can be used to receive input numerical, character, or image information, and to generate keyboard, mouse, joystick, optical, or trackball signal inputs related to user settings and function control. Specifically, in addition to a camera, the input unit of this embodiment may also include a touch-sensitive surface (e.g., a touch screen) and other input devices.

[0158] The display unit can be used to display information input by the user or information provided to the user, as well as various graphical user interfaces of the device. These graphical user interfaces can be composed of graphics, text, icons, video, and any combination thereof. The display unit may include a display panel, optionally configured as an LCD (Liquid Crystal Display), OLED (Organic Light-Emitting Diode), or other similar display panel. Furthermore, a touch-sensitive surface may cover the display panel. When the touch-sensitive surface detects a touch operation on or near it, it transmits the information to the processor to determine the type of touch event. Subsequently, the processor provides corresponding visual output on the display panel based on the type of touch event.

[0159] This invention also provides a computer-readable storage medium, which may be a computer-readable storage medium included in the memory described in the above embodiments; or it may be a standalone computer-readable storage medium not assembled into a device. The computer-readable storage medium stores at least one instruction, which is loaded and executed by a processor to implement... Figure 1 The method for forecasting the purchase of long-tail commodities is shown. The computer-readable storage medium may be a read-only memory, a hard disk, or an optical disk, etc.

[0160] This invention also provides a computer program product, including a computer program / instructions, which are loaded and executed by a processor to implement... Figure 1 This illustrates a procurement forecasting method for long-tail commodities.

[0161] It should be noted that the various embodiments in this specification are described in a progressive manner, with each embodiment focusing on the differences from other embodiments. Similar or identical parts between embodiments can be referred to interchangeably. For the device embodiments, equipment embodiments, and storage medium embodiments, since they are basically similar to the method embodiments, the descriptions are relatively simple, and relevant parts can be referred to the descriptions in the method embodiments.

[0162] Furthermore, in this document, the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such a process, method, article, or apparatus. Without further limitation, an element defined by the phrase "comprising one..." does not exclude the presence of other identical elements in the process, method, article, or apparatus that includes said element.

[0163] The foregoing description illustrates and describes preferred embodiments of the present invention. It should be understood that the present invention is not limited to the forms disclosed herein and should not be construed as excluding other embodiments. It can be used in various other combinations, modifications, and environments, and can be altered within the scope of the inventive concept by means of the foregoing teachings or techniques or knowledge in related fields. Any modifications and variations made by those skilled in the art that do not depart from the spirit and scope of the present invention should be within the protection scope of the appended claims.

Claims

1. A method for predicting the purchase of long-tail commodities, characterized in that, The method includes: The historical daily sales data of the product is converted into multiple training samples through a sliding time window. Each training sample consists of the daily sales of the most recent W consecutive days as the input sequence, and the cumulative sales of the H consecutive days after the end of the input sequence are used as the prediction target. Extract multi-level time-series features, including basic sales sequence features, statistical aggregation features, volatility features, and growth acceleration features, from the historical sales sequence of each training sample to form a unified feature vector; Growth patterns are identified based on the historical sales sequence of each training sample, and static weights are assigned to each training sample based on the identification results. The unified feature vector and the static weights are input into the hybrid training framework for training. During the training process, the multi-level temporal features are divided into multiple feature subsets of different scales according to the time span, and different priorities are set for different feature subsets to obtain the first prediction model and the second prediction model after training. The sample to be predicted is input into the first prediction model and the second prediction model to obtain the first prediction value and the second prediction value respectively. The first prediction value and the second prediction value are then weighted and fused according to the determined fusion weight to obtain the sales prediction result.

2. The procurement forecasting method for long-tail commodities according to claim 1, characterized in that, The method further includes: The sales forecast result, the feature configuration summary and model parameter summary used when generating the sales forecast result, the product identifier, the forecast time, and the procurement decision information generated based on the sales forecast result constitute a notarized data record. The hash value of the notarized data record is calculated and written into the blockchain ledger.

3. The procurement forecasting method for long-tail commodities according to claim 1, characterized in that, The extraction of multi-level time-series features from the historical sales sequences of each training sample includes basic sales sequence features, statistical aggregation features, volatility features, and growth acceleration features, including: The basic sales sequence features include the raw daily sales values ​​for W consecutive days in the input sequence; The statistical aggregation features include the cumulative sales values ​​for the past 7 days, the past 14 days, and the past 30 days; The volatility characteristic includes the coefficient of variation of sales over the past 30 days, which is the ratio of the standard deviation of sales over the past 30 days to the mean of sales over the past 30 days. The growth acceleration feature includes a first growth acceleration value and a second growth acceleration value, wherein the first growth acceleration value is the ratio of the total sales volume of the past 7 days to the total sales volume of the 14 days to the 8 days prior to the current time point, and the second growth acceleration value is the ratio of the first growth acceleration value to the first growth acceleration value at the previous time point.

4. The procurement forecasting method for long-tail commodities according to claim 1, characterized in that, The process of determining growth patterns based on the historical sales sequence of each training sample, and assigning static weights to each training sample according to the determination results, includes: The historical sales sequence of the training samples is divided into an early period and a later period, according to... Calculate the total sales volume in the later period. Total sales in the previous period growth rate In the formula, ε represents the smallest positive number to prevent the denominator from being zero, and i represents the i-th training sample; Based on the growth ratio, the growth mode of the training sample is determined, and a corresponding indicator function value is set for each training sample according to the discrimination result. The growth mode includes low base rapid growth mode, continuous accelerated growth mode and staged explosive growth mode. The corresponding indicator function value is input into the weight function to calculate the initial weight of each training sample, and the initial weights of all training samples are normalized to obtain the static weights, wherein the weight function is expressed as: In the formula, Let η1, η2, and η3 represent the base scaling factor, and let η1, η2, and η3 represent the corresponding weight enhancement coefficients, satisfying η1 > η2 > η3 > 0. , This represents the corresponding indicator function value, where, If the growth pattern of the training samples is a low-radius rapid growth pattern, then the corresponding indicator function value =1, otherwise 0; If the growth pattern of the training samples is a continuously accelerating growth pattern, then the corresponding indicator function value =1, otherwise 0; If the growth pattern of the training samples is a phased burst growth pattern, then the corresponding indicator function value =1, otherwise 0.

5. The procurement forecasting method for long-tail commodities according to claim 1, characterized in that, The step of dividing the multi-level time-series features into multiple feature subsets of different scales according to the time span, and setting differentiated priorities for different feature subsets, includes: The multi-level time series features are divided into short-term feature subsets, medium-term feature subsets, and long-term feature subsets. The short-term feature subset corresponds to features on a time scale of 1-7 days, the medium-term feature subset corresponds to features on a time scale of 8-30 days, and the long-term feature subset corresponds to features on a time scale of more than 30 days. During training, the short-term feature subset is given an initial splitting priority higher than the intermediate and long-term feature subsets. The intermediate feature subset is given a weight for use in the middle nodes of the decision tree. The long-term feature subset is restricted to splitting only in the high-level nodes of the decision tree, and a maximum splitting depth constraint is set.

6. The procurement forecasting method for long-tail commodities according to claim 1, characterized in that, The first prediction model is the XGBoost regression tree model, and the second prediction model is the LightGBM regression tree model.

7. The procurement forecasting method for long-tail commodities according to claim 1, characterized in that, The determination of the fusion weights includes: The validation sample is input into the first prediction model and the second prediction model to obtain the first validation prediction value and the second validation prediction value, respectively. Based on the first verified predicted value, the second verified predicted value, and the corresponding actual sales value, the prediction deviation rate between the first prediction model and the second prediction model is calculated. The fusion weights of the first and second prediction models in integrated prediction are dynamically adjusted based on the prediction deviation rate.

8. The procurement forecasting method for long-tail commodities according to claim 7, characterized in that, The prediction deviation rate is calculated using a piecewise function: In the formula, j represents the j-th verification sample. This represents actual sales volume. Indicates projected sales. This indicates the threshold for stable sales volume.

9. A procurement forecasting device for long-tail commodities, characterized in that, The device includes: The conversion unit is used to convert historical daily sales data of a product into multiple training samples through a sliding time window. Each training sample consists of the daily sales of the most recent W consecutive days as the input sequence and the cumulative sales of the H consecutive days after the end of the input sequence as the prediction target. The feature extraction unit is used to extract multi-level time-series features from the historical sales sequence of each training sample, including basic sales sequence features, statistical aggregation features, volatility features, and growth acceleration features, to form a unified feature vector; The weight allocation unit is used to determine the growth pattern based on the historical sales sequence of each training sample, and to assign static weights to each training sample according to the determination result. The training unit is used to input the unified feature vector and the static weights into the hybrid training framework for training. During the training process, the multi-level temporal features are divided into multiple feature subsets of different scales according to the time span, and different priorities are set for different feature subsets to obtain the first prediction model and the second prediction model after training. The prediction unit is used to input the sample to be predicted into the first prediction model and the second prediction model to obtain the first prediction value and the second prediction value respectively, and to perform weighted fusion of the first prediction value and the second prediction value according to the determined fusion weight to obtain the sales prediction result.

10. A procurement forecasting device for long-tail commodities, characterized in that, The device includes a processor, a memory, and a computer program stored in the memory, which, when executed by the processor, implements the steps of a procurement forecasting method for long-tail commodities as described in any one of claims 1 to 8.