Method for predicting fast sale product specification classification order quantity based on time sequence

Through the combination of time series-based forecasting methods and multiple models, the problem of accuracy and flexibility in forecasting order volume for fast-selling product categories is solved, and more accurate and adjustable forecast results are achieved, which is suitable for complex product requirements. .

CN118608024APending Publication Date: 2024-09-06NEW TREND INT LOGIS TECH
View PDF 0 Cites 4 Cited by

Patent Information

Application Number
CN202410633269.7
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-05-21
Publication Date
2024-09-06

AI Technical Summary

Technical Problem

When the existing technology predicts the order volume of FMCG product categories, there are problems such as inaccurate manual estimation and uncertain deep learning model results, and it is difficult to adjust, especially when the number of product specifications is large and the changes are complex.

Method used

Adopt time series-based forecasting methods, including data preprocessing, feature variable processing, time series adjustment and holiday information integration, external factor integration, model establishment and evaluation, semantic model application and cluster analysis, using ARIMA, LSTM, TFT and other models Predictions are made and ABC classifications are identified through K-means clustering.

Benefits of technology

It improves the prediction accuracy of fast-selling product classification order volume, reduces the element of luck, enhances the flexibility and adjustment ability of the model, and is suitable for complex and changing product requirements.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118608024A
    Figure CN118608024A
Patent Text Reader

Abstract

The invention discloses a method for predicting a fast sale product specification classification order quantity based on a time sequence, and the method comprises the following steps: A, data preprocessing: collecting data of each fast sale product specification in a certain time interval, and carrying out the aggregation according to a certain time frequency, the ex-warehouse frequency of each day of each fast moving consumer goods gauge in five years is collected as a time sequence; b, characteristic variable processing: data normalization is carried out to eliminate dimension influence, and time sequences of different specifications are ensured to have comparability; c, time sequence adjustment and holiday and festival information integration, wherein the time sequence adjustment is that moving average variable time sequences of different time scales are generated and are mainly used for smoothing short-term fluctuations and highlighting long-term trends. According to the method, a new method is constructed by modifying and supplementing three major aspects of a traditional prediction algorithm based on a time sequence, so that the method is better suitable for predicting the quality classification order quantity of the fast selling product.
Need to check novelty before this filing date? Find Prior Art

Description

[0001] The present invention relates to the technical field of fast-moving consumer goods classification, and specifically to a method for predicting the order quantity of fast-moving consumer goods classified by product specifications based on time series. Background Art

[0002] Fast moving consumer goods warehouses need to meet the requirements of multi-product classification storage and warehousing efficiency at the same time. They need to store a wide variety of goods and meet the warehousing efficiency of orders. In order to balance storage capacity and storage efficiency, when building a fast moving consumer goods warehouse, the warehouse is usually divided into multiple areas of different types. Some areas give priority to high-density storage and mainly store goods that are not frequently in and out of the warehouse; some areas give priority to access efficiency and mainly store goods that need to be shipped out frequently; there are also some areas in between. Considering the limitations of product quantity, single product inventory, and total regional storage space, the number of product specifications that can be stored in each area is limited. If the warehouse is limited, placing the specifications involved in more orders in the efficiency-prioritized storage area can greatly improve the overall outbound efficiency of the warehouse, increase throughput and reduce working time. Therefore, how to predict the outbound orders in the near future and sort their specifications according to the number of order lines is an important technology for the work efficiency of fast-moving consumer goods warehouses. Although the problem essentially requires all specifications to be sorted according to the predicted number of order lines, since only the sorted results need to be grouped and arranged in different warehouse areas, it is only necessary to classify the specifications according to the predicted number of order lines, which is also called specification ABC classification in the industry.

[0003] At present, two methods are usually used to perform classification: 1. Manual estimation: Based on the calculation of experienced people, the ABC classification of product specifications in the next outbound statistical period is directly determined. This method performs well when the product specifications are small and stable, so it is widely used in planned economy or areas with strong planning, such as the tobacco field; 2. Use algorithms to estimate the order and then group: With the advancement of data science, more and more warehouses have begun to adopt algorithm-based methods to predict the number of order lines and classify product specifications accordingly. These methods include: Time series analysis: Use historical sales data to predict future demand. Commonly used statistical models such as ARIMA and exponential smoothing are suitable for commodities with relatively stable demand patterns; Machine learning and deep learning algorithms: For commodities with large data volumes and complex changes, Class, machine learning models (such as XGBoost) and deep learning models (such as LSTM, N-HiTS) can provide more accurate predictions. These models can handle more complex data relationships and nonlinear patterns, so as to adapt to the changes in demand for different specifications. Time series algorithm: train the time, specifications and quantity of orders in historical data, analyze the rules and use them to predict the future. In order to improve accuracy, year-on-year and month-on-month data are usually used, and some holiday information is superimposed; deep learning method: provide as many columns as possible of the original order, and analyze the potential relationships through deep learning. The disadvantage is that the output results are uncertain and there is a certain element of luck. Moreover, due to the regression limitations of deep learning, it is not easy to make targeted adjustments when problems occur. Summary of the invention

[0004] The purpose of the present invention is to provide a method for predicting the order quantity of fast-moving consumer goods by category based on time series, so as to solve the problems raised in the above background technology.

[0005] To achieve the above object, the present invention provides the following technical solution: a method for predicting the order quantity of fast-moving consumer goods by category based on time series, comprising the following steps: A. Data preprocessing: For each FMCG product, collect data from a certain time interval and aggregate it according to a certain time frequency. For example, collect the daily delivery frequency of each FMCG product in five years as a time series. B. Characteristic variable processing: including data normalization to eliminate the impact of dimension and ensure the comparability of time series of different specifications; C. Time series adjustment and holiday information integration: Time series adjustment is to generate moving average variable time series of different time scales, which is mainly used to smooth short-term fluctuations and highlight long-term trends. Moving averages of different time scales can reveal data characteristics of different periodicities; Holiday information integration is to incorporate public holidays, special events and lunar calendar information into the model as external variables, consider their potential impact on sales, and create a specific time series variable that will reflect the possible impact of holidays on consumer behavior. First, convert the Gregorian calendar date to the lunar calendar date, and add a new lunar calendar date field to each record in the dataset. For the lunar calendar date, only the month and day are retained, such as the fifteenth day of the first lunar month and the fifth day of the fifth lunar month, and exclude the dates of leap months, because leap months usually do not have fixed holidays or specific consumption patterns. Create a holiday identifier for each A date, whether it is the Gregorian calendar or the lunar calendar, this identifier will indicate whether the day is a specific holiday, and the category of this holiday, which is achieved in the following ways: Fixed Gregorian calendar holidays: directly mark these dates in the data, such as National Day, Women's Day, and mobile Gregorian calendar holidays: For holidays such as Father's Day that are fixed in a specific week but not fixed in date, since the prediction is usually in months, there is no need to mark the specific date, only the month in which it occurs needs to be recorded; Lunar calendar holidays: including holidays with fixed lunar calendar dates and non-fixed lunar calendar dates, for example, Spring Festival and Mid-Autumn Festival, fixed-date holidays are directly marked, and for possible date changes such as New Year's Eve, the 29th day of the twelfth lunar month or the 30th day of the twelfth lunar month, they should be marked separately so that the model can recognize and learn their impact on consumer behavior. Finally, in order to make these holiday information effectively used by time series models, holiday information needs to be encoded; D. External factor integration: Add the time series data of external factors such as macroeconomic indicators, market trends, and competitor activities, add the daily oil and electricity price time series that overlap with the time period of the FMCG specification, and perform the same data preprocessing before superimposing the promotion time series of the FMCG. If there is a promotion on that day, the variable value is 1, otherwise it is 0. As an external factor covariate, similar to the holiday time series, create a time series of promotion information, then its length is equal to the original dark beer time series, and the value is 1 only on the day when there is a promotion, otherwise it is 0; E. Model establishment and evaluation: including model selection, model training, model application steps, recursive calculation, definition of model parameters, sample division, hyperparameter adjustment and performance evaluation. The model selection is: deploy multiple models, such as ARIMA, LSTM, TFT. Each model independently predicts the delivery frequency of each commodity. The exponential smoothing model and N-HiTS model will be selected for training and evaluation comparison. Model training is: divide each time series variable including all covariates into data sets, validation sets and test sets, and divide them according to the time length in a ratio of 4:1:1. Take the latest period of time as the test set. The specific date division is: training set: January 1, 2019 to April 30, 2022, validation set: May 1, 2022 to February 28, 2023, test set: From March 1, 2023 to January 1, 2024, the parameters of the exponential smoothing model are explained as follows: Smoothing coefficient (α): This parameter controls the model's "memory" length of historical data. The larger the α value, the greater the impact of the most recent observations on the smoothing result, and the more sensitive the model is to trends. On the contrary, a smaller α value makes the model smoother and reacts more slowly to changes in historical data; the model application steps are: Initialization: Select a suitable initial smoothing value, which is the first observation in the series, or use the average of the first few observations; Select smoothing coefficient: Select an initial smoothing value, which is usually selected based on experience, or can be optimized by minimizing the forecast error, such as the mean absolute error or the mean square error; The recursive calculation is: For each new observation in the time series, use the following formula to calculate the new smoothing value, ,in is the average value at time point t, is the actual value at time point t, a is the smoothing coefficient, For time point The predicted value; Make a prediction: The predicted value of a simple exponential smoothing model is the latest smoothed value. For all future time points, the predicted value remains unchanged until new observation data is available. For the N-HiTS model, the model parameters are defined. Input length: Choosing an appropriate input length is key, which usually depends on the periodicity and seasonality of the data. For example, if the data shows obvious annual periodicity, at least one year of data may be required to capture these periodic changes. The input length is 90 days; Output length: Determine the time range for model prediction. For monthly sales forecasts, the output length can be set to 1 month; Samples are divided into: Time series sample construction: Extract continuous time windows from the entire time series data as training samples. Each sample includes a specified input length and output length. At the same time, the maximum sample size that can be sampled for each time series can be set for random sampling to prevent excessive computational consumption from excessively long time series. The maximum sample size for each time series The sample size is 200; the hyperparameters are adjusted as follows: When dealing with complex machine learning models such as N-HiTS, there are usually tools specifically designed to automate the hyperparameter search process of machine learning models, such as Optuna. Optuna is used to search for the optimal neural network structure, learning rate, batch size, and the number of samples used to calculate the gradient in one training session. Performance evaluation: The performance of different models is compared through specified loss functions, such as MSE and MAE, and evaluation criteria, such as accuracy, recall, and F1 score. RMSLE is used as the loss function and evaluation metric. RMSLE is a method for predicting the order quantity of fast-moving consumer goods based on time series. It is used to evaluate the difference between two quantities, especially when it comes to predicting the exact quantity, and both the predicted value and the actual value should be positive, such as inventory, sales, and population. RMSLE is more sensitive to prediction errors of smaller values ​​and less sensitive to prediction errors of larger values. Its formula is defined as follows: , where n is the total number of samples, is the predicted value of the ith sample, is the actual value of the ith sample, Represents the natural logarithm. In the above model, the test set is predicted and the model with lower RMSLE is used as the model for predicting new data; F. New data prediction: including new product integration and outbound volume prediction. New product integration is as follows: first, set a time limit for new product specifications, and identify newly added product specifications that have not exceeded this limit as new product specifications, which are defined as products that have been sold on the market for no more than six months. If new product specifications are involved in new data, use semantic models, such as natural language processing technology, to convert or map new product information to known product information in the training set. For example, if the name of the new product specification on the shelves is "Organic Orange Juice 500ml", and it has been on the shelves for more than 6 months, then collect the data from its listing to date according to the above data processing and training methods, add it to the training set and retrain the model. If the name of the new product specification on the shelves is "Apple Cider 500ml" and it has not been sold for more than 6 months, then use the semantic model to classify it into existing products with similar names for prediction. Outbound volume prediction is as follows: Use the selected best model to predict the outbound volume of new data, where the prediction formula of the exponential smoothing model is: ,in is the forecast value for the next period, a is a smoothing constant, between 0 and 1, is the actual observed value of the current period, is the forecast value for the current period, Represents 1 minus the smoothing constant. For the N-HiTS model, we first preprocess the existing 500ml cider data as a time series, and add the specification information of its similar specifications, namely, dark beer. Then, we input the time series into the trained model and output the predicted values ​​for the next n time points. The length m of the input time series and the output time step n need to be the same as the hyperparameter settings InputLength and OutputLength during training, respectively. The prediction is expressed as ,in Indicates at time The predicted value of f is a function defined by the model, which involves a complex neural network structure including convolutional layers, recurrent layers or fully connected layers, which will not be described here; G. Cluster analysis: Based on the predicted outbound frequency, cluster analysis is performed on the products to identify potential ABC classifications. K-means clustering is used, and the parameter K=3 is set to represent three different sales or inventory levels. H. Application of results: including decision support, model external factors, macroeconomic data, commodity prices, market competition, policy and regulatory changes and international influencing factors. Decision support is: providing decision basis based on clustering and prediction results, and then making final decisions based on supply chain decisions, inventory management and marketing strategies; macroeconomic data include GDP growth rate, consumer confidence index and retail sales data. GDP growth rate is: the overall economic growth can reflect consumer purchasing power and market demand; consumer confidence index is: reflecting consumers' confidence in the future economic situation, and high confidence may promote consumption growth; retail sales data is: directly reflecting the activity and consumption trend of the consumer goods market, commodity prices include raw material prices and energy prices. Raw material prices are: changes in the prices of raw materials such as plastics and paper may affect production costs, and then affect product prices and sales; energy prices are: oil and electricity prices, These cost changes may affect the operating costs of the entire supply chain; market competition includes the marketing activities of competing brands and the launch of new products. The marketing activities of competing brands include: such as promotions and advertising, which may affect consumers' purchasing choices; the launch of new products includes: the launch of new products by competitors may attract consumers' attention and consumption share; policy and regulatory changes include consumption tax adjustments and import and export policies. Consumption tax adjustments include: changes in tax rates may directly affect the final retail price of the product; import and export policies include: for products that rely on imported raw materials or are aimed at export markets, relevant policy changes may affect costs and pricing; international influencing factors include the global economic environment and exchange rate fluctuations. The global economic environment includes: changes in the global economic situation may affect demand in the export market; exchange rate fluctuations include: for companies that import raw materials or export products, exchange rate fluctuations may have a significant impact on costs and profits.

[0006] Preferably, in step A, for example, the frequency of shipment of the product specification "Kaiserdom dark beer 500mL" from January 1, 2019 to January 1, 2024 is collected and used as a time series with days as the time unit. There are n such time series, where n is the total number of product specifications in the record. In step B, when predicting the shipment of goods, the model may overemphasize features with large values, such as the time series of tens of thousands of rolls of paper towels shipped out in one day, rather than equally important features, such as the time series of expensive electrical appliances, which may have a maximum daily shipment of ten. Therefore, the time series of each product specification is normalized. After normalization, the contribution of each feature to the model is balanced, and their impact on the prediction results can be evaluated more fairly. The data is normalized using the MinMaxScaler method. In this formula, x represents the original data point, min(x) is the minimum value in the entire time series data set, max(x) is the maximum value in the time series data set, and This formula scales each data point x to a value between 0 and 1. Scaling the data to any other range [max(x), min(x)] can be further expanded to: Static covariate time series: For each product specification time series, add a fixed static covariate that does not change with time, usually the name and category of the product specification. For the time series "Kaiserdom Dark Beer 500mL", add its product specification name and category "flavored beverage" as its static covariate that does not change with time.

[0007] Preferably, in step C, a 7-day, 14-day and 30-day moving average variable time series are added as covariates of the learning model, wherein the 7-day moving average is: The 7-day moving average is usually used to observe trends within a week. For the dark beer time series, another time series of equal length is generated, wherein the value of each point is the value of the original dark beer sequence at this point and the average of the previous six days. If it is less than 7 days, the value of the original sequence itself is taken, and the moving average is not used. In this way, the newly generated time series is a 7-day moving average time series, and the following 14-day and 30-day moving average sequences are the same; the 14-day moving average is: The 14-day moving average provides an average effect of two weeks of data, which is helpful to observe trend changes on a longer time scale, which can help analyze the half-month effect or changes in consumption patterns before and after salary payment; the 30-day moving average is: The 30-day moving average covers about a month, which helps to smooth monthly cyclical fluctuations, such as differences in consumption behavior at the beginning and end of the month, which is of great value for monthly reporting and analysis; set is a data point at time t, then the moving average for n days is: is the moving average at time point t, n is the size of the moving average window, indicating the number of days considered when calculating the average, It is the data point that goes back i days from the current time point t. A common method for predicting the order volume of fast-moving consumer goods based on time series is to use unique hot encoding to create a binary variable for each holiday or holiday category. 1 indicates that it is a holiday, and 0 indicates that it is not. For example, in this holiday time series, its length is the same as the original dark beer time series, both from 2019 to 2024, but its values ​​are 0 and 1. Only on the date of the holiday, the value of 1 indicates that this day is a holiday. In this way, each date will have a holiday feature vector, and the model can learn the impact of holidays on sales or consumption behavior based on these feature vectors.

[0008] Preferably, in step F, the specific operations are as follows: A typical choice is to use a pre-trained word embedding model, such as Word2Vec, GloVe or FastText. These models can convert words, which are keywords in product descriptions, into dense vector representations. These vectors capture the semantic information of the words, that is, semantically similar words will be mapped to close positions in the vector space. Suppose we have a new product specification, which is described as "Organic Cider 500ml". In order to classify this new product specification into the trained prediction model, follow the following steps: Text preprocessing: Perform standard text preprocessing on each product specification name in the model, including the new product specification, including lowercase, removal of stop words and punctuation; Feature extraction Take: Use a word embedding model, such as FastText, to transform the preprocessed text above, and convert each word into an embedding vector. For example, "Organic cider 500ml" is converted into a 100-dimensional vector [0.12, 0.23, -0.09, 0.45, ..., 0.21], and "dark beer 500ml" is converted into [0.11, 0.22, -0.09, 0.45, ..., 0.21]. Next, use cosine similarity to calculate the similarity between the embedding vectors of the new specification and each of the original specifications to find the most similar specification. Cosine similarity is usually used to calculate the cosine angle between two vectors. Its value ranges from -1, completely different, to 1, exactly the same. The calculation formula of cosine similarity is: ,Model integration: Finally, it is concluded that the vector with the cosine value closest to the embedding vector of cider is dark beer 500ml, so cider is classified as dark beer for prediction.

[0009] Preferably, in step G, category A is high-sales / high-importance commodities, category B is medium-sales / importance commodities, and category C is low-sales / low-importance commodities.

[0010] Preferably, in step H, the final K-means clustering result is that 40% of all product specifications are Class A, and 30% are Class B / C. However, due to inventory area reasons, the first 30% can be selected as Class A, 40% as Class B, and the last 30% as Class C in the order of predicted outbound volume. The external factors of the model can introduce multiple external factors closely related to the Chinese market environment and economic activities, which may have a direct or indirect impact on the market demand for fast-moving consumer goods.

[0011] Compared with the prior art, the present invention has the following beneficial effects: The present invention constructs a new method by modifying and supplementing the traditional time series-based prediction algorithm in three major aspects, making it better suitable for predicting the order volume of fast-moving consumer goods by category. BRIEF DESCRIPTION OF THE DRAWINGS

[0012] Figure 1 It is a schematic diagram of the process of the present invention. DETAILED DESCRIPTION

[0013] The following will be combined with the drawings in the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.

[0014] See also Figure 1 The method for predicting the order quantity of fast-moving consumer goods by category based on time series includes the following steps: A. Data preprocessing: This step is to prepare data for subsequent modeling and analysis to ensure data quality and consistency. For each FMCG product, data for a certain time period is collected and aggregated at a certain time frequency. For example, the daily delivery frequency of each FMCG product in five years is collected as a time series. B. Characteristic variable processing: including data normalization to eliminate the impact of dimension and ensure the comparability of time series of different specifications; C. Time series adjustment and holiday information integration: Time series adjustment is to generate moving average variable time series of different time scales, which is mainly used to smooth short-term fluctuations and highlight long-term trends. Moving averages of different time scales can reveal data characteristics of different periodicities; Holiday information integration is to incorporate public holidays, special events and lunar calendar information into the model as external variables, consider their potential impact on sales, and create a specific time series variable that will reflect the possible impact of holidays on consumer behavior. First, convert the Gregorian calendar date to the lunar calendar date, and add a new lunar calendar date field to each record in the dataset. For the lunar calendar date, only the month and day are retained, such as the fifteenth day of the first lunar month and the fifth day of the fifth lunar month, and exclude the dates of leap months, because leap months usually do not have fixed holidays or specific consumption patterns. Create a holiday identifier for each A date, whether it is the Gregorian calendar or the lunar calendar, this identifier will indicate whether the day is a specific holiday, and the category of this holiday, which is achieved in the following ways: Fixed Gregorian calendar holidays: directly mark these dates in the data, such as National Day, Women's Day, and mobile Gregorian calendar holidays: For holidays such as Father's Day that are fixed in a specific week but not fixed in date, since the prediction is usually in months, there is no need to mark the specific date, only the month in which it occurs needs to be recorded; Lunar calendar holidays: including holidays with fixed lunar calendar dates and non-fixed lunar calendar dates, for example, Spring Festival and Mid-Autumn Festival, fixed-date holidays are directly marked, and for possible date changes such as New Year's Eve, the 29th day of the twelfth lunar month or the 30th day of the twelfth lunar month, they should be marked separately so that the model can recognize and learn their impact on consumer behavior. Finally, in order to make these holiday information effectively used by time series models, holiday information needs to be encoded; D. External factor integration: Add the time series data of external factors such as macroeconomic indicators, market trends, and competitor activities, add the daily oil and electricity price time series that overlap with the time period of the FMCG specification, and perform the same data preprocessing before superimposing the promotion time series of the FMCG. If there is a promotion on that day, the variable value is 1, otherwise it is 0. As an external factor covariate, similar to the holiday time series, create a time series of promotion information, then its length is equal to the original dark beer time series, and the value is 1 only on the day when there is a promotion, otherwise it is 0; E. Model establishment and evaluation: Using the preprocessed data, apply a variety of time series models for predictive analysis, including model selection, model training, model application steps, recursive calculation, definition of model parameters, sample division, hyperparameter adjustment and performance evaluation. The model selection is: deploy multiple models, such as ARIMA, LSTM, TFT, each model independently predicts the delivery frequency of each commodity, and selects the exponential smoothing model and N-HiTS model for training and evaluation comparison; model training is: divide each time series variable including all covariates into data sets, validation sets and test sets, and divide them according to the time length in a ratio of 4:1:1, and take the latest period of time as the test set. The specific date division is: training set: January 1, 2019 to April 30, 2022, validation set: May 1, 2022 to 2 February 28, 2023, test set: March 1, 2023 to January 1, 2024, the parameters of the exponential smoothing model are explained as follows: Smoothing coefficient (α): This parameter controls the model's "memory" length of historical data. The larger the α value, the greater the impact of the most recent observations on the smoothing result, and the more sensitive the model is to trends. On the contrary, a smaller α value makes the model smoother and reacts more slowly to changes in historical data; the model application steps are: Initialization: Select a suitable initial smoothing value, which is the first observation in the series, or use the average of the first few observations; Select smoothing coefficient: Select an initial smoothing value, which is usually selected based on experience, or can be optimized by minimizing prediction errors, such as mean absolute error or mean square error; The recursive calculation is: For each new observation in the time series, use the following formula to calculate a new smoothing value, ,in is the average value at time point t, is the actual value at time point t, a is the smoothing coefficient, For time point The predicted value; Make a prediction: The predicted value of a simple exponential smoothing model is the latest smoothed value. For all future time points, the predicted value remains unchanged until new observation data is available. For the N-HiTS model, the model parameters are defined. Input length: Choosing an appropriate input length is key, which usually depends on the periodicity and seasonality of the data. For example, if the data shows obvious annual periodicity, at least one year of data may be required to capture these periodic changes. The input length is 90 days; Output length: Determine the time range for model prediction. For monthly sales forecasts, the output length can be set to 1 month; Samples are divided into: Time series sample construction: Extract continuous time windows from the entire time series data as training samples. Each sample includes a specified input length and output length. At the same time, the maximum sample size that can be sampled for each time series can be set for random sampling to prevent excessive computational consumption from excessively long time series. The maximum sample size for each time series The sample size is 200; the hyperparameters are adjusted as follows: When dealing with complex machine learning models such as N-HiTS, there are usually tools specifically designed to automate the hyperparameter search process of machine learning models, such as Optuna. Optuna is used to search for the optimal neural network structure, learning rate, batch size, and the number of samples used to calculate the gradient in one training session. Performance evaluation: The performance of different models is compared through specified loss functions, such as MSE and MAE, and evaluation criteria, such as accuracy, recall, and F1 score. RMSLE is used as the loss function and evaluation metric. RMSLE is a method for predicting the order quantity of fast-moving consumer goods based on time series. It is used to evaluate the difference between two quantities, especially when it comes to predicting the exact quantity, and both the predicted value and the actual value should be positive, such as inventory, sales, and population. RMSLE is more sensitive to prediction errors of smaller values ​​and less sensitive to prediction errors of larger values. Its formula is defined as follows: , where n is the total number of samples, is the predicted value of the ith sample, is the actual value of the ith sample, Represents the natural logarithm. In the above model, the test set is predicted and the model with lower RMSLE is used as the model for predicting new data; F. New data prediction: Select the optimal model based on the model evaluation results and apply it to new data, including new product specifications integration and outbound volume prediction. The integration of new product specifications is as follows: First, set a time limit for new product specifications, and identify newly added product specifications that have not exceeded this limit as new product specifications, which are defined as products that have been sold on the market for no more than six months. If new product specifications are involved in new data, use semantic models, such as natural language processing technology, to convert or map new product information to known product information in the training set. For example, if the name of the new product specification on the shelves is "Organic Orange Juice 500ml", and it has been on the shelves for more than 6 months, then collect the data from its listing to date according to the above data processing and training methods, add it to the training set and retrain the model. If the name of the new product specification on the shelves is "Apple Cider 500ml" and it has not been on sale for more than 6 months, then use the semantic model to classify it into existing products with similar names for prediction. Outbound volume prediction is as follows: Use the selected optimal model to predict the outbound volume of new data, where the prediction formula of the exponential smoothing model is: ,in is the forecast value for the next period, a is a smoothing constant, between 0 and 1, is the actual observed value of the current period, is the forecast value for the current period, It represents 1 minus the smoothing constant, which partially reflects the weighting of historical data. For the N-HiTS model, the existing 500ml cider data is first preprocessed as a time series, and the specification and category information of its similar specifications, namely dark beer, is added. Then, the time series is input into the trained model, and the predicted values ​​for the next n time points are output. The length m of the input time series and the output time step n need to be the same as the hyperparameter settings InputLength and OutputLength during training, respectively. The prediction is expressed as ,in Indicates at time The predicted value of f is a function defined by the model, which involves a complex neural network structure including convolutional layers, recurrent layers or fully connected layers, which will not be described here; G. Cluster analysis: Further analyze and classify the forecast results. Based on the predicted delivery frequency, cluster analysis is performed on the products to identify potential ABC classifications. K-means clustering is used, and the parameter K=3 is set to represent three different sales or inventory levels. H. Application of results: including decision support, model external factors, macroeconomic data, commodity prices, market competition, policy and regulatory changes and international influencing factors. Decision support is: providing decision basis based on clustering and prediction results, and then making final decisions based on supply chain decisions, inventory management and marketing strategies; macroeconomic data include GDP growth rate, consumer confidence index and retail sales data. GDP growth rate is: the overall economic growth can reflect consumer purchasing power and market demand; consumer confidence index is: reflecting consumers' confidence in the future economic situation, and high confidence may promote consumption growth; retail sales data is: directly reflecting the activity and consumption trend of the consumer goods market, commodity prices include raw material prices and energy prices. Raw material prices are: changes in the prices of raw materials such as plastics and paper may affect production costs, and then affect product prices and sales; energy prices are: oil and electricity prices, These cost changes may affect the operating costs of the entire supply chain; market competition includes the marketing activities of competing brands and the launch of new products. The marketing activities of competing brands include: such as promotions and advertising, which may affect consumers' purchasing choices; the launch of new products includes: the launch of new products by competitors may attract consumers' attention and consumption share; policy and regulatory changes include consumption tax adjustments and import and export policies. Consumption tax adjustments include: changes in tax rates may directly affect the final retail price of the product; import and export policies include: for products that rely on imported raw materials or are aimed at export markets, relevant policy changes may affect costs and pricing; international influencing factors include the global economic environment and exchange rate fluctuations. The global economic environment includes: changes in the global economic situation may affect demand in the export market; exchange rate fluctuations include: for companies that import raw materials or export products, exchange rate fluctuations may have a significant impact on costs and profits.

[0015] In step A, for example, the daily outbound frequency of the product specification "Kaiserdom dark beer 500mL" from January 1, 2019 to January 1, 2024 is collected and used as a time series with days as the time unit. There are n such time series, where n is the total number of product specifications in the record. In step B, when predicting the outbound volume of goods, the model may overemphasize features with large values, such as the time series of tens of thousands of rolls of paper towels shipped out in one day, rather than equally important features, such as the time series of expensive electrical appliances, which may have a maximum daily outbound volume of ten. Therefore, the time series of each product specification is normalized. After normalization, the contribution of each feature to the model is balanced, and their impact on the prediction results can be evaluated more fairly. At the same time, unnormalized data will make the gradient descent process in the training process of the deep learning model progress at inconsistent speeds in different directions, thereby affecting the overall optimization efficiency. The MinMaxScaler method is used to normalize the data. In this formula, x represents the original data point, min(x) is the minimum value in the entire time series data set, max(x) is the maximum value in the time series data set, and This formula scales each data point x to a value between 0 and 1. Scaling the data to any other range [max(x), min(x)] can be further expanded to: Static covariate time series: For each product specification time series, add a fixed static covariate that does not change with time, usually the name and category of the product specification. For the time series "Kaiserdom Dark Beer 500mL", add its product specification name and category "flavored beverage" as its static covariate that does not change with time.

[0016] In step C, add 7-day, 14-day and 30-day moving average variable time series as covariates of the learning model, where the 7-day moving average is: The 7-day moving average is usually used to observe trends within a week and is suitable for eliminating fluctuations between weekdays and weekends. This is particularly useful for industries such as retail that are greatly affected by weekends and specific weekdays. For the dark beer time series, generate another time series of equal length, in which the value of each point is the value of the original dark beer sequence at this point and the average of the previous six days. If it is less than 7 days, take the value of the original sequence itself, and do not use the moving average. In this way, the newly generated time series is a 7-day moving average time series. The same is true for the following 14-day and 30-day moving average series; the 14-day moving average is: The 14-day moving average provides It provides the average effect of two weeks of data, which helps to observe trend changes on a longer time scale, which can help analyze the half-month effect or changes in consumption patterns before and after salary payments; the 30-day moving average is: the 30-day moving average covers about a month, which helps to smooth monthly cyclical fluctuations, such as differences in consumption behavior at the beginning and end of the month, which is of great value for monthly reporting and analysis; the moving average is a mathematical method for predicting the order volume of fast-moving consumer goods based on time series. It is used to analyze a time series set of data points. The basic idea is to smooth the time series by creating a series of averages, which are calculated from different subsets of the original time series, thereby reducing the impact of random changes and showing the trend and cyclical changes of the data more clearly. is a data point at time t, then the moving average for n days is: , is the moving average at time point t, n is the size of the moving average window, indicating the number of days considered when calculating the average, It is the data point that goes back i days from the current time point t. A common method for predicting the order volume of fast-moving consumer goods based on time series is to use unique hot encoding to create a binary variable for each holiday or holiday category. 1 indicates that it is a holiday, and 0 indicates that it is not. For example, in this holiday time series, its length is the same as the original dark beer time series, both from 2019 to 2024, but its values ​​are 0 and 1. Only on the date of the holiday, the value of 1 indicates that this day is a holiday. In this way, each date will have a holiday feature vector, and the model can learn the impact of holidays on sales or consumption behavior based on these feature vectors.

[0017] In step F, the specific operations are as follows: A typical choice is to use a pre-trained word embedding model, such as Word2Vec, GloVe or FastText. These models can convert words, which are keywords in product descriptions, into dense vector representations. These vectors capture the semantic information of the words, that is, semantically similar words will be mapped to close positions in the vector space. Suppose we have a new product specification, which is described as "Organic Cider 500ml". In order to classify this new product specification into the trained prediction model, follow the steps below: Text preprocessing: Perform standard text preprocessing on each product specification name in the model, including the new product specification, including lowercase, removal of stop words and punctuation; Feature extraction: Use Use a word embedding model, such as FastText, to transform the preprocessed text and convert each word into an embedding vector. For example, "Organic cider 500ml" is converted into a 100-dimensional vector [0.12, 0.23, -0.09, 0.45, ..., 0.21], and "dark beer 500ml" is converted into [0.11, 0.22, -0.09, 0.45, ..., 0.21]. Next, use cosine similarity to calculate the similarity between the embedding vectors of the new specification and each of the original specifications to find the most similar specification. Cosine similarity is usually used to calculate the cosine angle between two vectors. Its value ranges from -1, completely different, to 1, exactly the same. The calculation formula of cosine similarity is: ; Model integration: Finally, the vector with the cosine value closest to the embedding vector of cider is dark beer 500ml, so cider is classified as dark beer for prediction.

[0018] In step G, category A is high-sales / high-importance products, category B is medium-sales / importance products, and category C is low-sales / low-importance products.

[0019] In step H, the final K-means clustering result is that 40% of all product specifications are Class A, and 30% are Class B / C. However, due to inventory area reasons, the first 30% can be selected as Class A, 40% as Class B, and the last 30% as Class C in the order of predicted outbound volume. The external factors of the model can introduce multiple external factors closely related to the Chinese market environment and economic activities, which may have a direct or indirect impact on the demand of the fast-moving consumer goods market.

[0020] Although embodiments of the present invention have been shown and described, it will be appreciated by those skilled in the art that various changes, modifications, substitutions and variations may be made to the embodiments without departing from the principles and spirit of the present invention, and that the scope of the present invention is defined by the appended claims and their equivalents.

Claims

1. A method for predicting the order quantity of fast-moving consumer goods by category based on time series, characterized by: The following steps are involved: A. Data preprocessing: For each FMCG product, collect data from a certain time interval and aggregate it according to a certain time frequency. For example, collect the daily delivery frequency of each FMCG product in five years as a time series. B. Characteristic variable processing: including data normalization to eliminate the impact of dimension and ensure the comparability of time series of different specifications; C. Time series adjustment and holiday information integration: Time series adjustment is to generate moving average variable time series of different time scales, which is mainly used to smooth short-term fluctuations and highlight long-term trends. Moving averages of different time scales can reveal data characteristics of different periodicities; Holiday information integration is to incorporate public holidays, special events and lunar calendar information into the model as external variables, consider their potential impact on sales, and create a specific time series variable that will reflect the possible impact of holidays on consumer behavior. First, convert the Gregorian calendar date to the lunar calendar date, and add a new lunar calendar date field to each record in the dataset. For the lunar calendar date, only the month and day are retained, such as the fifteenth day of the first lunar month and the fifth day of the fifth lunar month, and exclude the dates of leap months, because leap months usually do not have fixed holidays or specific consumption patterns. Create a holiday identifier for each A date, whether it is the Gregorian calendar or the lunar calendar, this identifier will indicate whether the day is a specific holiday, and the category of this holiday, which is achieved in the following ways: Fixed Gregorian calendar holidays: directly mark these dates in the data, such as National Day, Women's Day, and mobile Gregorian calendar holidays: For holidays such as Father's Day that are fixed in a specific week but not fixed in date, since the prediction is usually in months, there is no need to mark the specific date, only the month in which it occurs needs to be recorded; Lunar calendar holidays: including holidays with fixed lunar calendar dates and non-fixed lunar calendar dates, for example, Spring Festival and Mid-Autumn Festival, fixed-date holidays are directly marked, and for possible date changes such as New Year's Eve, the 29th day of the twelfth lunar month or the 30th day of the twelfth lunar month, they should be marked separately so that the model can recognize and learn their impact on consumer behavior. Finally, in order to make these holiday information effectively used by time series models, holiday information needs to be encoded; D. External factor integration: Add the time series data of external factors such as macroeconomic indicators, market trends, and competitor activities, add the daily oil and electricity price time series that overlap with the time period of the FMCG specification, and perform the same data preprocessing before superimposing the promotion time series of the FMCG. If there is a promotion on that day, the variable value is 1, otherwise it is 0. As an external factor covariate, similar to the holiday time series, create a time series of promotion information, then its length is equal to the original dark beer time series, and the value is 1 only on the day when there is a promotion, otherwise it is 0; E. Model establishment and evaluation: including model selection, model training, model application steps, recursive calculation, definition of model parameters, sample division, hyperparameter adjustment and performance evaluation. The model selection is: deploy multiple models, such as ARIMA, LSTM, TFT. Each model independently predicts the delivery frequency of each commodity. The exponential smoothing model and N-HiTS model will be selected for training and evaluation comparison. Model training is: divide each time series variable including all covariates into data sets, validation sets and test sets, and divide them according to the time length in a ratio of 4:1:

1. Take the latest period of time as the test set. The specific date division is: training set: January 1, 2019 to April 30, 2022, validation set: May 1, 2022 to February 28, 2023, test set: From March 1, 2023 to January 1, 2024, the parameters of the exponential smoothing model are explained as follows: Smoothing coefficient (α): This parameter controls the length of the model's "memory" of historical data. The larger the α value, the greater the impact of the most recent observations on the smoothing result, and the more sensitive the model is to trends. On the contrary, a smaller α value makes the model smoother and reacts more slowly to changes in historical data; the model application steps are: Initialization: Select a suitable initial smoothing value, which is the first observation in the series, or use the average of the first few observations; Select smoothing coefficient: Select an initial smoothing value, which is usually selected based on experience, or can be optimized by minimizing the forecast error, such as the mean absolute error or the mean square error; The recursive calculation is: For each new observation in the time series, use the following formula to calculate the new smoothing value, in is the average value at time point t, is the actual value at time point t, a is the smoothing coefficient, For time point Forecast value; Make forecast: The forecast value of a simple exponential smoothing model is the latest smoothed value. For all future time points, the forecast value remains unchanged until new observation data is available. For the N-HiTS model, define the model parameters. Input length: Selecting an appropriate input length is key, which usually depends on the cyclical and seasonal characteristics of the data. For example, if the data shows obvious annual cyclicality, at least one year of data may be required to capture these cyclical changes. The input length is 90 days; Output length: Determine the time range for model prediction. For monthly sales forecasts, the output length can be set to 1 month; The samples are divided into: Time series sample construction: continuous time windows are extracted from the entire time series data as training samples. Each sample includes a specified input length and output length. At the same time, the maximum sample size that can be sampled for each time series can be set for random sampling to prevent excessive computational consumption from excessively long time series. The maximum sample size for each time series is 200; Hyperparameter adjustment: When dealing with complex machine learning models such as N-HiTS, there are usually tools specifically designed to automate the hyperparameter search process of machine learning models, such as Optuna. Use Optuna to search for the optimal neural network structure, learning rate, batch size, The number of samples used to calculate the gradient in one training session is a hyperparameter; Performance evaluation: Compare the performance of different models through specified loss functions, such as MSE, MAE, and evaluation criteria, such as accuracy, recall, and F1 score. Use RMSLE as the loss function and evaluation metric. RMSLE is a method for predicting the order quantity of fast-moving consumer goods based on time series. It is used to evaluate the difference between two quantities, especially when it comes to predicting the exact quantity, and both the predicted value and the actual value should be positive, such as inventory, sales, and population. RMSLE is more sensitive to smaller prediction errors and less sensitive to larger prediction errors. Its formula is defined as follows: , where n is the total number of samples, is the predicted value of the ith sample, is the actual value of the ith sample, Represents the natural logarithm. In the above model, the test set is predicted and the model with lower RMSLE is used as the model for predicting new data; F. New data prediction: including new product integration and outbound volume prediction. New product integration is as follows: first, set a time limit for new product specifications, and identify newly added product specifications that have not exceeded this limit as new product specifications, which are defined as products that have been sold on the market for no more than six months. If new product specifications are involved in new data, use semantic models, such as natural language processing technology, to convert or map new product information to known product information in the training set. For example, if the name of the new product specification on the shelves is "Organic Orange Juice 500ml", and it has been on the shelves for more than 6 months, then collect the data from its listing to date according to the above data processing and training methods, add it to the training set and retrain the model. If the name of the new product specification on the shelves is "Apple Cider 500ml" and it has not been sold for more than 6 months, then use the semantic model to classify it into existing products with similar names for prediction. Outbound volume prediction is as follows: Use the selected best model to predict the outbound volume of new data, where the prediction formula of the exponential smoothing model is: ,in is the forecast value for the next period, a is a smoothing constant, between 0 and 1, is the actual observed value of the current period, is the forecast value for the current period, Represents 1 minus the smoothing constant. For the N-HiTS model, we first preprocess the existing 500ml cider data as a time series, and add the specification information of its similar specifications, namely, dark beer. Then, we input the time series into the trained model and output the predicted values ​​for the next n time points. The length m of the input time series and the output time step n need to be the same as the hyperparameter settings InputLength and OutputLength during training, respectively. The prediction is expressed as ,in Indicates at time The predicted value of f is a function defined by the model, which involves a complex neural network structure including convolutional layers, recurrent layers or fully connected layers, which will not be described here; G. Cluster analysis: Based on the predicted outbound frequency, cluster analysis is performed on the products to identify potential ABC classifications. K-means clustering is used, and the parameter K=3 is set to represent three different sales or inventory levels. H. Application of results: including decision support, model external factors, macroeconomic data, commodity prices, market competition, policy and regulatory changes and international influencing factors. Decision support is: providing decision basis based on clustering and prediction results, and then making final decisions based on supply chain decisions, inventory management and marketing strategies; macroeconomic data include GDP growth rate, consumer confidence index and retail sales data. GDP growth rate is: the overall economic growth can reflect consumer purchasing power and market demand; consumer confidence index is: reflecting consumers' confidence in the future economic situation, and high confidence may promote consumption growth; retail sales data is: directly reflecting the activity and consumption trend of the consumer goods market, commodity prices include raw material prices and energy prices. Raw material prices are: changes in the prices of raw materials such as plastics and paper may affect production costs, and then affect product prices and sales; energy prices are: oil and electricity prices, These cost changes may affect the operating costs of the entire supply chain; market competition includes the marketing activities of competing brands and the launch of new products. The marketing activities of competing brands include: such as promotions and advertising, which may affect consumers' purchasing choices; the launch of new products includes: the launch of new products by competitors may attract consumers' attention and consumption share; policy and regulatory changes include consumption tax adjustments and import and export policies. Consumption tax adjustments include: changes in tax rates may directly affect the final retail price of the product; import and export policies include: for products that rely on imported raw materials or are aimed at export markets, relevant policy changes may affect costs and pricing; international influencing factors include the global economic environment and exchange rate fluctuations. The global economic environment includes: changes in the global economic situation may affect demand in the export market; exchange rate fluctuations include: for companies that import raw materials or export products, exchange rate fluctuations may have a significant impact on costs and profits.

2. The method for predicting the order quantity of fast-moving consumer goods by category based on time series according to claim 1 is characterized by: In step A, for example, the daily outbound frequency of the product specification "Kaiserdom dark beer 500mL" from January 1, 2019 to January 1, 2024 is collected and used as a time series with days as the time unit. There are n such time series in total, where n is the total number of product specifications in the record. In step B, when predicting the outbound quantity of goods, the model may overemphasize features with large values, such as the time series of tens of thousands of rolls of paper towels shipped out in one day, rather than equally important features, such as the time series of expensive electrical appliances, which may have a maximum daily outbound quantity of ten. Therefore, the time series of each product specification is normalized. After normalization, the contribution of each feature to the model is balanced, and their impact on the prediction results can be more fairly evaluated. The MinMaxScaler method is used to normalize the data. In this formula, x represents the original data point, min(x) is the minimum value in the entire time series data set, max(x) is the maximum value in the time series data set, and This formula scales each data point x to a value between 0 and 1. Scaling the data to any other range [max(x), min(x)] can be further expanded to: Static covariate time series: For each product specification time series, add a fixed static covariate that does not change over time, usually the name and category of the product specification. For the time series "Kaiserdom Dark Beer 500mL", add its product specification name and category "flavored beverage" as its static covariate that does not change over time.

3. The method for predicting the order quantity of fast-moving consumer goods by category based on time series according to claim 1 is characterized by: In step C, a 7-day, 14-day and 30-day moving average variable time series are added as covariates of the learning model, wherein the 7-day moving average is: The 7-day moving average is usually used to observe trends within a week. For the dark beer time series, another time series of equal length is generated, in which the value of each point is the value of the original dark beer sequence at this point and the average of the previous six days. If it is less than 7 days, the value of the original sequence itself is taken, and the moving average is not used. In this way, the newly generated time series is a 7-day moving average time series, and the following 14-day and 30-day moving average sequences are the same; the 14-day moving average is: The 14-day moving average provides an average effect of two weeks of data, which is helpful to observe trend changes on a longer time scale, which can help analyze the half-month effect or changes in consumption patterns before and after salary payment; the 30-day moving average is: The 30-day moving average covers about a month, which helps to smooth monthly cyclical fluctuations, such as differences in consumption behavior at the beginning and end of the month, which is of great value for monthly reporting and analysis; set is a data point at time t, then the moving average for n days is: , is the moving average at time point t, n is the size of the moving average window, indicating the number of days considered when calculating the average, It is the data point that goes back i days from the current time point t. A common method for predicting the order volume of fast-moving consumer goods based on time series is to use unique hot encoding to create a binary variable for each holiday or holiday category. 1 indicates that it is a holiday, and 0 indicates that it is not. For example, in this holiday time series, its length is the same as the original dark beer time series, both from 2019 to 2024, but its values ​​are 0 and 1. Only on the date of the holiday, the value of 1 indicates that this day is a holiday. In this way, each date will have a holiday feature vector, and the model can learn the impact of holidays on sales or consumption behavior based on these feature vectors.

4. The method for predicting the order quantity of fast-moving consumer goods by category based on time series according to claim 1 is characterized by: In step F, the specific operations are as follows: A typical choice is to use a pre-trained word embedding model, such as Word2Vec, GloVe or FastText. These models can convert words, which are keywords in product descriptions, into dense vector representations. These vectors capture the semantic information of words, that is, semantically similar words will be mapped to close positions in the vector space. Suppose we have a new product specification, which is described as "Organic Apple Wine 500ml". In order to classify this new product specification into the trained prediction model, follow the following steps: Text preprocessing: Perform standard text preprocessing on each product specification name in the model, including the new product specification, including lowercase, removal of stop words and punctuation; Feature extraction: Use a word embedding model, such as FastText, to transform the preprocessed text and convert each word into an embedding vector. For example, "Organic cider 500ml" is converted into a 100-dimensional vector [0.12, 0.23, -0.09, 0.45, ..., 0.21], and "dark beer 500ml" is converted into [0.11, 0.22, -0.09, 0.45, ..., 0.21]. Next, use cosine similarity to calculate the similarity between the embedding vectors of the new specification and each of the original specifications to find the most similar specification. Cosine similarity is usually used to calculate the cosine angle between two vectors. Its value ranges from -1, completely different, to 1, exactly the same. The calculation formula of cosine similarity is: ; Model integration: Finally, the vector with the cosine value closest to the embedding vector of cider is dark beer 500ml, so cider is classified as dark beer for prediction.

5. The method for predicting the order quantity of fast-moving consumer goods by category based on time series according to claim 1 is characterized by: In step G, category A is high-sales / high-importance commodities, category B is medium-sales / importance commodities, and category C is low-sales / low-importance commodities.

6. The method for predicting the order quantity of fast-moving consumer goods by product specification classification based on time series according to claim 1 is characterized by: In step H, the final K-means clustering result is that 40% of all product specifications are Class A, and 30% are Class B / C. However, due to inventory area reasons, the first 30% can be selected as Class A, 40% as Class B, and the last 30% as Class C in the order of predicted outbound volume. The external factors of the model can introduce multiple external factors closely related to the Chinese market environment and economic activities, which may have a direct or indirect impact on the demand for fast-moving consumer goods.

Citation Information

Cited By

  • Hydrogen-doped natural gas regulation and control system and method based on data analysis

    CN119846964A

  • A hydrogen-blended natural gas control system and method based on data analysis

    CN119846964B

  • Accurate drainage amount release strategy and operation suggestion analysis system

    CN120410630A

  • A method, device and related medium for correcting estimated outbound quantity of fast-moving consumer goods

    CN120525452B