A commodity sales forecasting method and system
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- FUJIAN YANGTENG INNOVATION INFORMATION TECHNOLOGY CO LTD
- Filing Date
- 2026-07-10
- Publication Date
- 2026-08-07
AI Technical Summary
[0004]上述方案普遍存在以下技术缺陷:第一,未能充分利用内部大量非冷启动商品历史销量序列中蕴含的通用销量变化规律;第二,对于冷启动商品自身已有的少量历史数据,缺乏有效的质量评估和自适应利用机制,要么完全弃用,要么简单堆叠;第三,从相似商品迁移信息时,缺乏对迁移方向的校验和对负向迁移的抑制;第四,预测结果缺乏可靠性的量化评估,难以判断预测值的可信程度
1、通过自监督学习从大量非冷启动商品的销量序列中提取通用的时序变化规律,并将该规律以表征形式迁移至冷启动商品,有效缓解了冷启动场景下数据稀疏导致的预测不准确问题。
Smart Images

Figure CN122529802A_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of sales forecasting technology, and more specifically, to a method and system for forecasting commodity sales. Background Technology
[0002] Product sales forecasting is a crucial aspect of supply chain management and inventory optimization. In e-commerce retail scenarios, many newly launched products face the cold start problem due to sparse or even zero historical sales data. This makes it difficult for traditional time-series-based forecasting methods and supervised learning-based forecasting models to obtain stable and reliable forecasting results due to a lack of sufficient training samples.
[0003] In existing technologies, the following approaches are mainly used for sales forecasting of cold-start products: First, based on product attribute similarity, the average sales value or historical curve of similar products is directly used as the predicted value of the target product; second, competitor information is obtained through knowledge graphs or external data sources, and a virtual historical sales sequence is constructed for cold-start products before prediction; third, a regression model is trained using product attribute features to directly predict sales.
[0004] The above-mentioned solutions generally suffer from the following technical defects: First, they fail to fully utilize the general sales change patterns contained in the historical sales sequences of a large number of non-cold start products; second, for the limited historical data already available for cold start products, there is a lack of effective quality assessment and adaptive utilization mechanisms, resulting in either complete abandonment or simple stacking; third, when migrating information from similar products, there is a lack of verification of the migration direction and suppression of negative migration; fourth, the prediction results lack a quantitative assessment of reliability, making it difficult to determine the credibility of the predicted values. Summary of the Invention
[0005] To address the aforementioned technical problems, this invention proposes a method and system for predicting commodity sales.
[0006] The technical solution of this invention is as follows: On the one hand, this invention proposes a method for predicting commodity sales, including the following steps: Obtain the historical sales sequence and product attribute information of the target product, and identify whether the target product is a cold start product based on the length of the historical sales sequence. Based on the sales sequence of non-cold start products, a temporal representation encoder is trained through self-supervised learning to obtain a temporal representation that represents the pattern of sales changes. If the target product is a cold-start product, execute the cold-start forecasting process, including: Temporal representations are extracted from the historical sales sequence of the target product using a temporal representation encoder; features are extracted from the historical sales sequence and a quality score is calculated based on the extracted features; Based on the target product attribute information, a set of similar products is determined, and a transfer representation is generated based on the temporal representation of each similar product in the set of similar products. Calculate the proportion of dynamic historical information based on the length and quality score of the target product's historical sales sequence. Based on the proportion of dynamic historical information, the time-series representation and migration representation of the target product are weighted and fused to obtain the fused representation; Based on the fusion representation, the basic sales forecast is output, and the future sales forecast of the target product is obtained by trend calibration of the basic sales forecast.
[0007] Preferably, the self-supervised learning includes a prefix segment simulation prediction task: extracting prefix segments with a length less than the cold start threshold from the complete sales sequence of non-cold start products, and training a temporal representation encoder to predict the subsequent sales trend based on the prefix segments.
[0008] Preferably, the method further includes a sales constraint correction step: obtaining sales status information of the target product, including at least one of inventory status, shelf status, and number of days available for sale; correcting the observed sales in the historical sales sequence based on the sales status information, distinguishing between low sales caused by supply constraints and insufficient actual demand, and using the corrected sales to extract time series representation and calculate quality score.
[0009] Preferably, the generation of migration representation further includes a negative migration suppression step: comparing the historical sales sequence trend of the target product with the historical trends of each similar product in the similar product set; when the consistency score is lower than a preset threshold, it is determined to be a trend conflict, and the weight of the similar products that cause the conflict is reduced when generating migration representation by using a negative migration gating coefficient.
[0010] Preferably, the trend-calibrated future sales forecast includes: generating a trend calibration value based on the characteristics of the historical sales sequence and the forecast period, and applying the trend calibration value to the basic forecast value obtained by decoding the fusion representation; wherein the magnitude of the trend calibration value decreases as the forecast period increases.
[0011] Preferably, the method further includes a hierarchical consistency calibration step: before outputting the future sales forecast value, the future sales forecast value is smoothly adjusted based on the overall sales trend or capacity constraint of the upper-level product hierarchy to which the target product belongs, so that the sales forecast of the target product is consistent with the hierarchical trend.
[0012] Preferably, the method further includes a rolling online update step: in response to the generation of new sales data for the target product, the steps of extracting time-series representation, calculating quality score, calculating the proportion of dynamic historical information and outputting predicted value are re-executed to update the prediction results; based on the updated historical sales sequence length, quality score and prediction reliability, a cold start exit coefficient is calculated; and the impact of migration representation and trend calibration on the prediction results is gradually reduced according to the cold start exit coefficient.
[0013] Preferably, the method further includes: when outputting the future sales forecast value, outputting the forecast interval and the manual review identifier; the manual review identifier is determined based on at least one of the forecast confidence level, the forecast interval width, and the hierarchical consistency calibration range.
[0014] Preferably, the method further includes: obtaining multiple cold start sales pattern prototypes based on the time series representation of non-cold start products; calculating the matching degree between the time series representation of the target product and each prototype, and selecting corresponding prediction decoding parameters or trend calibration strategies for the target product based on the matching results.
[0015] On the other hand, the present invention also provides a commodity sales forecasting system, comprising: The cold start product identification module obtains the historical sales sequence and product attribute information of the target product, and identifies whether the target product is a cold start product based on the length of the historical sales sequence. The time series representation extraction module, based on the sales sequence of non-cold start products, trains the time series representation encoder through self-supervised learning to obtain a time series representation of the sales change pattern. The cold start prediction module is used to execute the cold start prediction process, including: The temporal representation encoder extracts temporal representations from the historical sales sequence of the target product, extracts features from the historical sales sequence, and calculates quality scores based on the extracted features. Based on the target product attribute information, a set of similar products is determined, and a transfer representation is generated based on the temporal representation of each similar product in the set of similar products. Calculate the proportion of dynamic historical information based on the length and quality score of the target product's historical sales sequence. Based on the proportion of dynamic historical information, the time-series representation and migration representation of the target product are weighted and fused to obtain the fused representation; Based on the fusion representation, the basic sales forecast is output, and the future sales forecast of the target product is obtained by trend calibration of the basic sales forecast.
[0016] The present invention has the following beneficial effects: 1. By using self-supervised learning, general temporal variation patterns are extracted from the sales sequences of a large number of non-cold-start products, and these patterns are transferred to cold-start products in the form of representations, which effectively alleviates the problem of inaccurate prediction caused by data sparsity in the cold-start scenario.
[0017] 2. By extracting multidimensional features from historical sales sequences and calculating quality scores, the reliability of historical data for cold-start products can be quantitatively assessed, and their weight in prediction can be dynamically adjusted accordingly to avoid misleading prediction results due to low-quality historical data.
[0018] 3. Through the dynamic historical information proportion function, the fusion weight can be adaptively adjusted according to the historical length, data quality and external support strength, so that the prediction logic can smoothly transition from mainly relying on external factors to mainly relying on its own history as commodity data accumulates.
[0019] 4. By introducing trend consistency verification and negative migration gating mechanism during the migration process, negative migration caused by similar attributes but conflicting trends is effectively suppressed, thereby improving the reliability of migration representation.
[0020] 5. By outputting multi-dimensional prediction credibility, prediction range, and manual review indicators, it provides a quantitative risk assessment basis for business decisions, while ensuring the consistency between individual product predictions and overall business planning through hierarchical consistency calibration.
[0021] 6. Through rolling online updates and a cold start exit mechanism, the prediction results can be continuously optimized as commodity data accumulates, and a seamless switch from cold start prediction logic to regular prediction logic can be achieved. Attached Figure Description
[0022] Figure 1 This is a flowchart of the method of the present invention. Detailed Implementation
[0023] The technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.
[0024] It should be understood that the step numbers used in the text are for ease of description only and are not intended to limit the order in which the steps are performed.
[0025] It should be understood that the terminology used in this specification is for the purpose of describing particular embodiments only and is not intended to limit the invention. As used in this specification and the appended claims, the singular forms “a,” “an,” and “the” are intended to include the plural forms unless the context clearly indicates otherwise.
[0026] The terms “comprising” and “including” indicate the presence of the described feature, whole, step, operation, element and / or component, but do not exclude the presence or addition of one or more other features, wholes, steps, operations, elements, components and / or collections thereof.
[0027] The term “and / or” refers to any combination of one or more of the associated listed items, as well as all possible combinations, and includes these combinations.
[0028] Example 1: To make the objectives, technical solutions, and advantages of the present invention clearer, the technical solutions of the present invention will be clearly and completely described below in conjunction with specific embodiments of the present application and with reference to the accompanying drawings.
[0029] To solve existing technical problems, such as Figure 1 As shown, the present invention provides a method for predicting commodity sales, including the following steps: Obtain the historical sales sequence and product attribute information of the target product, and identify whether the target product is a cold start product based on the length of the historical sales sequence. In this embodiment, the historical sales sequence of target product i is obtained. ,in Let i be the number of historical sales cycles. This represents the original sales volume of product i in historical period t. Obtain the attribute vector of product i. and the time attribute vector of future cycles .
[0030] In the preferred solution, the availability status information of product i is also obtained, including its inventory status. Available for purchase Percentage of days available for sale and out-of-stock labels .
[0031] according to < Determine whether the target product is a cold start product, where This is the threshold for determining a cold start. If the condition is met, the product is determined to be a cold start product; otherwise, it is a non-cold start product. Non-cold start products enter the self-supervised training process, while cold start products enter the subsequent prediction process.
[0032] Based on the sales sequence of non-cold start products, a temporal representation encoder is trained through self-supervised learning to obtain a temporal representation that represents the pattern of sales changes. In this embodiment, the sales volume sequence of non-cold-start products is first standardized. This includes: Calculate the historical average sales volume of product i: ; in: Let be the average sales volume of product i over historical period t; Recalculate standardized sales volume: ; in: To standardize sales volume; To prevent extremely small positive numbers with a denominator of zero.
[0033] Based on a standardized sales sequence, a self-supervised learning task is constructed to train a temporal representation encoder. The self-supervised learning includes a base task and an enhancement task. The basic tasks include a masking reconstruction task and a contrastive learning task. The masking reconstruction task involves masking and reconstructing some standardized sales data, enabling the model to learn the local variation patterns of the sales sequence. The contrastive learning task enhances the temporal representation of the view by bringing different data of the same product closer together and pushing the temporal representation of different products further apart, thus distinguishing the differences in sales patterns of different products.
[0034] The total loss of self-supervised training for the basic task is expressed as: ; in Total loss during self-supervised training for basic tasks; To cover up the reconstruction loss; To compare learning loss; , These are the weights of the two losses, respectively.
[0035] The enhanced tasks include: Prefix segment simulation prediction task: Randomly extract segments with a length less than the cold-start threshold from the complete sales sequence of non-cold-start products. The short prefix fragment is used to simulate the historical sales sequence of a cold-start product. The time series representation encoder is trained to predict the standardized sales change direction or trend residual for several subsequent periods based on the short prefix fragment, so that the encoder can learn the mapping ability from short to long during the pre-training stage.
[0036] The multi-granularity consistency constraint task involves generating views of the same product's sales series at different time granularities or window scales, such as daily granularity, weekly granularity, rolling window granularity, or local segment granularity, and constraining the representation of the same product across different granularity views to maintain consistency while preserving differences in trend, fluctuation, and intermittent features. This constraint helps improve the model's transfer stability between short and long historical periods.
[0037] Prototype Alignment Task: Based on the temporal representations of a large number of historical products, several sales pattern prototypes are formed, such as stable, slow-climbing, rapid-burst, intermittent, and declining. The historical sales sequence representation of the cold-start product is soft-aligned with one or more prototypes to obtain prototype weights, which are used to constrain the cold-start product representation to fall into a reasonable sales pattern space.
[0038] When introducing the above-mentioned augmentation task, the self-supervised training objective can be summarized as follows: The total loss of self-supervised training can be summarized as follows: ; in: Total loss during self-supervised training; Simulate and predict losses for historical sales sequences; This represents a loss of consistency across multiple granularities. For prototype alignment loss; , , These are the corresponding weights. By minimizing... The time-series representation of product i is obtained. , This outputs a vector representing the sales volume variation pattern of product i. It also outputs the reconstruction error of product i. , Used for subsequent prediction confidence calculation.
[0039] The aforementioned enhancement loss is only used to improve the adaptation capability of historical sales sequences during the training phase and is not a metric that must be output separately in the subsequent prediction process.
[0040] If the target product is a cold-start product, execute the cold-start forecasting process, including: A temporal representation encoder extracts temporal representations from the historical sales sequence of the target product, extracts features from the historical sales sequence, and calculates a quality score based on the extracted features; the steps for calculating the quality score of the historical sales sequence are as follows: Extract historical sales sequence feature vectors from the historical sales sequence of the target product. . It should include at least the following: recent trend of change, initial sales ramp-up speed, degree of fluctuation between adjacent periods, proportion of zero or low sales intervals, degree of abnormal sales points and short-term acceleration.
[0041] Based on historical sales sequence feature vectors and the length of the historical sales sequence Calculate the quality score of historical sales series using a quality scoring function. : ; in: The quality score for the historical sales sequence of target product i is given, with a value ranging from 0 to 1; The larger the value, the more stable, continuous, and clear the historical sales sequence of the target product is, and the higher its reference value for subsequent sales forecasting. This is a historical sales series quality scoring function, used to calculate the historical sales series quality score based on the observed historical sales series of the target product. The number of sales cycles observed for target product i; The minimum number of sales cycles required for a historical sales series to reach a stable reference point. When the observation period is short, it indicates a lower quality score for the historical sales series; when At that time, the historical cycle length correction coefficient is set to 1. M is the number of features involved in the quality evaluation of the historical sales series. The feature vector of historical sales sequence The quality sub-score obtained from the transformation of the m-th feature ranges from 0 to 1; for positive features such as trend consistency and sales continuity, the better the feature performance, the higher the score. The larger the value, the better. For negative characteristics such as volatility, zero sales ratio, and outlier ratio, a reverse transformation is first performed to make the transformed value... A larger value also indicates a higher quality historical sales sequence. Let be the weight corresponding to the m-th quality sub-score, and ≥ 0, used to indicate the importance of different historical sales series features to the quality score; and simultaneously satisfying: >0; ensures the weighted average calculation is valid.
[0042] In the preferred scheme, the quality score of the historical sales series is calculated. Previously, it also included a sellability constraint correction step: based on the sellability status information of the target product, including inventory status. Available for purchase Percentage of days available for sale and out-of-stock labels Based on the availability of goods and services information, observed sales volumes in historical sales sequences are corrected to distinguish between low sales volumes caused by supply constraints and insufficient actual demand. The corrected sales volumes are then used to extract features from historical sales sequences and calculate quality scores. Specifically: Obtain the availability status information of the target product and calculate the effective availability coefficient based on the sales cycle: ; in: Let be the effective sellability coefficient of target product i in historical period t, with a value range of . ; Minimum marketable correction threshold; This is a function that truncates functions to their upper and lower bounds.
[0043] Calculate counterfactual demand sales based on the effective availability factor: ; in: The counterfactual demand sales volume after the availability constraint adjustment; To monitor sales; This is a reasonable upper limit of demand derived from similar or comparable goods; To prevent extremely small positive numbers with a denominator of zero.
[0044] Revised Replacement of original observation sales Entering the historical sales sequence feature vector Historical sales series quality score And the calculation of subsequent trend calibration quantities. It also serves as a reliable weight for the sample, used to reduce the impact of supply-constrained cycles on trend judgment.
[0045] Based on the target product attribute information, a set of similar products is determined, and a transfer representation is generated based on the temporal representation of each similar product in the set; specifically: Target product attribute vector Encoded into attribute representations by attribute encoder E. ; Calculate the attribute similarity between cold-start product i and non-cold-start product j: ; Select non-cold-start products with high similarity to form a similar product set. Calculate the migration weights for each similar product: ; in: For migration weights; To prevent extremely small positive numbers with a denominator of zero.
[0046] Calculate migration representation based on migration weights: ; in: For migration characterization; This represents the time sequence of non-cold-start product j.
[0047] Simultaneously, the support of similar products is calculated based on the similarity level of the similar product set and the number of valid similar products. , The value range of Si is [0,1]. The higher the Si value, the more similar products the target product can obtain.
[0048] In the preferred embodiment, a negative migration suppression step is also included: comparing the historical sales sequence trend of the target product with the historical trends of each similar product in the similar product set; when the trend conflict exceeds a preset level, reducing the weight of the conflicting similar products in generating migration representations. Specifically: Compare the historical sales trend of the target product with the sales change direction of candidate similar products at the same life cycle stage, and calculate the trend consistency score: ; in: Score the trend consistency between target product i and candidate similar product j; The first-order change of the historical sales sequence of the target product after adjustment for availability constraints; This represents the sales change sequence of candidate similar products j at the same life cycle stage; This is the correlation function.
[0049] Set the trend consistency threshold to ,when When a trend conflict is identified, the weight of the similar product in the generation of the migration representation is reduced by using a negative migration gating coefficient. The negative migration gating coefficient is calculated as follows: ; in: Let be the negative migration gating coefficient of product j to target product i; Differences in life cycle stages; Differences in channel exposure, price range, or promotional conditions; to These are non-negative weighting parameters. The more similar the attributes and the more consistent the trends between the target product i and the candidate similar product j, the higher the weighting parameter. The higher the value, the greater the difference in lifecycle or channel conditions. The lower.
[0050] Correct the migration weights using negative migration gating coefficients: ; in: The corrected migration weights; Let r be the initial migration weight for product r; Let be the negative migration gating coefficient for product r. Therefore, products with similar attributes but conflicting trends will not be directly used to enhance the prediction of the target product, reducing the risk of negative migration in cold-start scenarios.
[0051] Based on the length and quality score of the target product's historical sales sequence, the proportion of dynamic historical information is calculated; specifically: Proportion of dynamic historical information The calculation formula is: ; in: The range of values is , The larger the value, the more trust there is in the target product's historical sales volume. This is a dynamic historical information proportion function used to calculate the participation degree of the target product's own short historical sales information based on the length of the historical sales sequence, the quality of the historical sales sequence, and the support of similar products. The reference period required for a product's short-term historical sales information to reach a stable level for inclusion in the integration process; The support inhibition coefficient for similar products, with a value range of [value range missing]. .
[0052] Based on the above calculations, when the number of observed periods for a product increases and the quality score of its historical sales series is high, As the weight increases, the weight of the product's own time-series representation gradually increases; when the quality of the historical sales series is low, the abnormal fluctuations are large, and the support of similar products is high, The data is appropriately suppressed, relying more on cold-start supplementary characterization and similar product migration characterization, thereby reducing the interference of abnormally short history on prediction results. When , At that time, the product's own time sequence representation is not used.
[0053] Based on the proportion of dynamic historical information, the time-series representation and migration representation of the target product are weighted and fused to obtain a fused representation; specifically: Computational cold start supplementary characterization: ; in: To supplement the characterization of cold starts; As an attribute representation; For migration characterization; The percentage of attribute representation in supplementary representation, with a value range of [value range missing]. .
[0054] Computational fusion representation: ; in: This is a fusion representation.
[0055] In the preferred embodiment, the generation process of the fused representation also includes an adaptive calibration step for the fused representation based on historical sales sequence features, specifically: Based on the historical sales sequence feature vector and historical sales series quality score Adaptive calibration is performed on the fusion characterization to obtain the calibrated characterization: ; in: For the calibrated fusion characterization; This is a lightweight adapter function; The intensity coefficient is calibrated for the historical sales series, with a value range of [value range missing]. ; To adapt the mapping parameters; This is the normalized feature vector of the historical sales sequence.
[0056] In the preferred embodiment, after generating the fusion representation, a cold start sales pattern prototype diversion step is also included: Based on the time-series representations of a large number of non-cold-start products, K prototype cold-start sales patterns are derived through clustering algorithms. These prototypes include at least two of the following: stable, slow-climbing, rapid-burst, intermittent, and decaying. Each prototype corresponds to a set of prototype representation vectors. .
[0057] Calculate the historical sales sequence representation of the target product Representation of each prototype The similarity between them is converted into prototype attribution weights using the softmax function: ; in, The weight by which target product i belongs to the c-th prototype; For the first The prototype is represented by a vector; T is a temperature coefficient, ranging from (0, 1], which controls the smoothness of the attribution distribution. The smaller T is, the more concentrated the attribution distribution is on a single prototype; the larger T is, the more uniform the attribution distribution is.
[0058] Based on the prototype affiliation weight, select the corresponding prediction decoding parameters or trend calibration strategy for the target product. Specifically, if the target product belongs to the fast-growing prototype type, a larger maximum calibration ratio is used in the trend calibration. and a slower decay rate If it belongs to a stable prototype, then use a smaller one. and faster .
[0059] Based on the fusion representation, the basic sales forecast is output, and the future sales forecast of the target product is obtained by trend calibration of the basic sales forecast.
[0060] In this embodiment, a basic predicted value is obtained through a prediction decoder based on the fused representation and prediction period. Further, a historical sales sequence trend calibration value is generated based on historical sales sequence features and the prediction period, and this calibration value is applied to the basic predicted value; wherein the magnitude of the trend calibration value decreases as the prediction period increases. The specific steps are as follows: Calculating sales metrics: ; in: Let i be the sales volume scale of the target product i, used to restore the prediction results in the standardized space to the actual sales volume. This represents the historical average sales volume of similar product j.
[0061] Fusion representation Future period time attribute vector The prediction period k is input into the prediction decoder to obtain the basic prediction value. .
[0062] Generate historical sales series trend calibration values based on baseline forecasts: ; Among them: Predicted periodic decay term for: ; in: The historical sales sequence trend calibration value for product i in the kth prediction period is used to perform additive correction on the basic decoded prediction value. This is a historical sales series trend calibration function used to generate a predicted correction amount based on the trend signal in the historical sales series of the target product itself. The decay rate coefficient, The larger the trend calibration effect, the faster it decays. The maximum percentage for calibrating the historical sales trend of a single product, with a value range of [value range missing]. , used to limit the calibration range; The historical sales series trend direction is scored, with a value range of [value range missing]. It is obtained by weighting the trend-type features in the historical sales sequence feature vector: ; in: The trend sub-score is obtained by transforming the m-th trend category feature; for The corresponding weights; The number of trend features involved in trend calibration. The forecast value was revised upwards. The forecast value has been lowered. The base prediction value is retained when the value is 0.
[0063] Final sales forecast: .
[0064] In the preferred scheme, before outputting the final sales forecast, a hierarchical consistency calibration step is included: based on the overall sales trend or capacity constraints of the target product's parent product hierarchy, the future sales forecast is smoothly adjusted to ensure that the individual product forecast is consistent with the hierarchical trend. Specifically: Obtain the target product's parent product level, such as SPU, category, brand, or channel, and its overall predicted value or capacity constraint for a future period k. For the cold start product set under the same parent level g. Solve the following constrained optimization problem: ; ; in: The prediction confidence level for product i; and These represent the reasonable lower and upper bounds for product i in the future period k, respectively. For products with higher reliability, the basic predicted value is adjusted less during the calibration process. After calibration... This will be used as the final sales forecast. The forecast reliability is also considered. The calculation formula is: ; in: ; ; in: Support for similar products; For historical integrity; To reconstruct reliability; , , For the corresponding weights; This represents the reconstruction error.
[0065] In the preferred embodiment, when outputting the predicted value, the prediction interval and a manual review identifier are output simultaneously; the manual review identifier is determined based on at least one of the following: prediction confidence, prediction interval width, and hierarchical consistency calibration magnitude. Specifically: The predictive decoder outputs the low-order predicted values respectively. Median predicted value and high-level forecast values Calculate the relative width of the prediction interval: ; Based on prediction confidence Relative width of prediction interval Generate verification identifiers for hierarchical consistency calibration amplitude. .when Below the credibility threshold When the uncertainty threshold is exceeded, or the hierarchical consistency calibration magnitude exceeds the preset proportion, A value of 1 indicates that manual review is required; otherwise... A value of 0 indicates that the item can be directly added to the inventory plan.
[0066] In the preferred scheme, in response to new sales data for the target product, the steps of future sales forecasting and forecast reliability calculation are performed to update the forecast results. Specifically, based on the updated historical sales series length, historical sales series quality score, and forecast reliability, a cold start exit coefficient is calculated. The impact of migration representation and trend calibration on the forecast results is gradually reduced according to the cold start exit coefficient to achieve a smooth transition from cold start forecasting logic to regular forecasting logic. The formula for calculating the cold start exit coefficient is: ; in: This is the cold start exit coefficient; This is a reference number of periods required to enter a stable sales phase. When... As the value approaches 1, the influence of migration representation, historical sales sequence trend calibration, and prototype diversion on the prediction results is gradually reduced, so that the prediction logic can smoothly transition to the conventional prediction logic.
[0067] Example 2: This embodiment provides a product sales forecasting system, including: The cold start product identification module obtains the historical sales sequence and product attribute information of the target product, and identifies whether the target product is a cold start product based on the length of the historical sales sequence. The time series representation extraction module, based on the sales sequence of non-cold start products, trains the time series representation encoder through self-supervised learning to obtain a time series representation of the sales change pattern. The cold start prediction module is used to execute the cold start prediction process, including: The temporal representation encoder extracts temporal representations from the historical sales sequence of the target product, extracts features from the historical sales sequence, and calculates quality scores based on the extracted features. Based on the target product attribute information, a set of similar products is determined, and a transfer representation is generated based on the temporal representation of each similar product in the set of similar products. Calculate the proportion of dynamic historical information based on the length and quality score of the target product's historical sales sequence. Based on the proportion of dynamic historical information, the time-series representation and migration representation of the target product are weighted and fused to obtain the fused representation; Based on the fusion representation, the basic sales forecast is output, and the future sales forecast of the target product is obtained by trend calibration of the basic sales forecast.
[0068] In this application embodiment, "at least one" refers to one or more, and "more than one" refers to two or more. "And / or" describes the relationship between related objects, indicating that three relationships can exist. For example, A and / or B can represent the existence of A alone, A and B simultaneously, or B alone. A and B can be singular or plural. The character " / " generally indicates that the preceding and following related objects are in an "or" relationship. "At least one of the following" and similar expressions refer to any combination of these items, including any combination of singular or plural items. For example, at least one of a, b, and c can represent: a, b, c, a and b, a and c, b and c, or a and b and c, where a, b, and c can be single or multiple.
[0069] Those skilled in the art will recognize that the units and algorithm steps described in the embodiments disclosed herein can be implemented using electronic hardware, computer software, or a combination of electronic hardware and software. Whether these functions are implemented in hardware or software depends on the specific application and design constraints of the technical solution. Those skilled in the art can use different methods to implement the described functions for each specific application, but such implementation should not be considered beyond the scope of this application.
[0070] Those skilled in the art will understand that, for the sake of convenience and brevity, the specific working processes of the systems, devices, and units described above can be referred to the corresponding processes in the foregoing method embodiments, and will not be repeated here.
[0071] In the several embodiments provided in this application, any function, if implemented as a software functional unit and sold or used as an independent product, can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of this application, essentially, or the part that contributes to the prior art, or a portion of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute all or part of the steps of the methods described in the various embodiments of this application. The aforementioned storage medium includes various media capable of storing program code, such as USB flash drives, portable hard drives, read-only memory (ROM), random access memory (RAM), magnetic disks, or optical disks.
[0072] The above description is merely an embodiment of the present invention and does not limit the patent scope of the present invention. Any equivalent structural or procedural transformations made based on the content of the present invention's specification and drawings, or direct or indirect applications in other related technical fields, are similarly included within the patent protection scope of the present invention.
Claims
1. A method for predicting commodity sales, characterized in that, Includes the following steps: Obtain the historical sales sequence and product attribute information of the target product, and identify whether the target product is a cold start product based on the length of the historical sales sequence. Based on the sales sequence of non-cold start products, a temporal representation encoder is trained through self-supervised learning to obtain a temporal representation that represents the pattern of sales changes. If the target product is a cold-start product, execute the cold-start forecasting process, including: Temporal representations are extracted from the historical sales sequence of the target product using a temporal representation encoder; features are extracted from the historical sales sequence and a quality score is calculated based on the extracted features; Based on the target product attribute information, a set of similar products is determined, and a transfer representation is generated based on the temporal representation of each similar product in the set of similar products. Calculate the proportion of dynamic historical information based on the length and quality score of the target product's historical sales sequence. Based on the proportion of dynamic historical information, the time-series representation and migration representation of the target product are weighted and fused to obtain the fused representation; Based on the fusion representation, the basic sales forecast is output, and the future sales forecast of the target product is obtained by trend calibration of the basic sales forecast.
2. The commodity sales forecasting method according to claim 1, characterized in that: The self-supervised learning includes a prefix segment simulation prediction task: extracting prefix segments with a length less than the cold start threshold from the complete sales sequence of non-cold start products, and training a temporal representation encoder to predict the subsequent sales trend based on the prefix segments.
3. The commodity sales forecasting method according to claim 1, characterized in that: The method further includes a sales constraint correction step: obtaining sales status information of the target product, including at least one of inventory status, shelf status, and number of days available for sale; Based on the availability information, the observed sales in the historical sales series are corrected to distinguish between low sales caused by supply constraints and insufficient actual demand. The corrected sales are then used to extract time series representations and calculate quality scores.
4. The commodity sales forecasting method according to claim 1, characterized in that: The generation of migration representation also includes a negative migration suppression step: comparing the consistency of the historical sales sequence trend of the target product with the historical trends of each similar product in the similar product set; When the consistency score is lower than the preset threshold, it is judged as a trend conflict. The weight of similar products that cause the conflict is reduced when generating the migration representation by using a negative migration gating coefficient.
5. The commodity sales forecasting method according to claim 1, characterized in that: The trend-calibrated future sales forecast includes: generating a trend calibration value based on the characteristics of the historical sales sequence and the forecast period, and applying the trend calibration value to the base forecast value obtained by decoding the fusion representation; wherein the magnitude of the trend calibration value decreases as the forecast period increases.
6. The commodity sales forecasting method according to claim 5, characterized in that: The method further includes a hierarchical consistency calibration step: before outputting the future sales forecast, the future sales forecast is smoothly adjusted based on the overall sales trend or capacity constraints of the parent product level to which the target product belongs, so that the sales forecast of the target product is consistent with the hierarchical trend.
7. The commodity sales forecasting method according to claim 5, characterized in that: The method further includes a rolling online update step: in response to the generation of new sales data for the target product, the steps of extracting time-series representation, calculating quality score, calculating the proportion of dynamic historical information and outputting predicted value are re-executed to update the prediction results; Based on the updated historical sales sequence length, quality score, and prediction reliability, a cold start exit coefficient is calculated; the impact of migration characterization and trend calibration on the prediction results is gradually reduced according to the cold start exit coefficient.
8. A method for predicting commodity sales according to any one of claims 6 or 7, characterized in that: The method further includes: when outputting future sales forecast values, outputting a forecast interval and a manual review identifier; the manual review identifier is determined based on at least one of forecast confidence, forecast interval width, and hierarchical consistency calibration range.
9. The commodity sales forecasting method according to claim 1, characterized in that: The method further includes: obtaining multiple cold start sales pattern prototypes based on the time series representation of non-cold start products; calculating the matching degree between the time series representation of the target product and each prototype; and selecting corresponding prediction decoding parameters or trend calibration strategies for the target product based on the matching results.
10. A commodity sales forecasting system, characterized in that, include: The cold start product identification module obtains the historical sales sequence and product attribute information of the target product, and identifies whether the target product is a cold start product based on the length of the historical sales sequence. The time series representation extraction module, based on the sales sequence of non-cold start products, trains the time series representation encoder through self-supervised learning to obtain a time series representation of the sales change pattern. The cold start prediction module is used to execute the cold start prediction process, including: The temporal representation encoder extracts temporal representations from the historical sales sequence of the target product, extracts features from the historical sales sequence, and calculates quality scores based on the extracted features. Based on the target product attribute information, a set of similar products is determined, and a transfer representation is generated based on the temporal representation of each similar product in the set of similar products. Calculate the proportion of dynamic historical information based on the length and quality score of the target product's historical sales sequence. Based on the proportion of dynamic historical information, the time-series representation and migration representation of the target product are weighted and fused to obtain the fused representation; Based on the fusion representation, the basic sales forecast is output, and the future sales forecast of the target product is obtained by trend calibration of the basic sales forecast.