Cigarette regular allocation method, device and equipment based on demand prediction deviation

By constructing a sales forecasting model that integrates holiday and sales lag characteristics, and combining historical data to determine demand ranges, the allocation volume is optimized, thus solving the problems of exogenous variables and forecasting errors in the cigarette supply chain and achieving higher allocation accuracy.

CN121998177APending Publication Date: 2026-05-08SICHUAN TOBACCO CO YIBIN CO
View PDF 0 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
SICHUAN TOBACCO CO YIBIN CO
Filing Date
2026-01-09
Publication Date
2026-05-08

AI Technical Summary

Technical Problem

Existing technologies fail to effectively account for exogenous variables and demand forecasting errors in the cigarette supply chain, resulting in low accuracy in allocation planning.

Method used

A sales forecasting model was constructed, which integrates the characteristics of holiday disturbances and sales lag, combines historical purchase, sales and inventory data to determine the demand range, and optimizes the allocation volume through an allocation optimization model.

Benefits of technology

It improves the accuracy of allocation planning, reduces prediction errors, and is suitable for large-scale application and promotion.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121998177A_ABST
    Figure CN121998177A_ABST
Patent Text Reader

Abstract

The invention discloses a cigarette regular allocation method, device and equipment based on demand prediction deviation.In a sales prediction link in demand construction, festival and holiday disturbance factors and sales lag characteristics are fused to construct a sales prediction model; therefore, the limitation of the traditional technology in the aspect of processing exogenous variables such as holiday and festival effects is broken through; secondly, aiming at a risk accumulation problem possibly caused by a prediction error, constructing a demand interval by adopting a demand construction method of a prediction value and historical purchase-sales-stock data, and determining a recommended allocation amount interval of each cigarette commodity; on the basis, compared with the traditional technology that a single demand constant value is used for predicting the feasible interval of the allocation quantity, the method has the advantages that the prediction error can be reduced; therefore, the method comprehensively considers the problem of risk accumulation of exogenous variables and prediction errors, provides a set of prediction and optimization integrated regular goods source allocation decision framework, and can ensure the accuracy of cigarette allocation.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention belongs to the field of commodity allocation technology, specifically relating to a method, apparatus, and equipment for periodic allocation of cigarettes based on demand forecasting deviation. Background Technology

[0002] In the cigarette supply chain, the allocation of goods—that is, the decision made by commercial companies to place orders with various cigarette manufacturers and arrange delivery—is a crucial link connecting the production end and the end market. It directly determines the company's supply capacity and the degree to which end-user demand is met, and also affects its own inventory level and capital occupation. However, industrial allocation decisions are simultaneously affected by multiple constraints such as uncertain lead times, demand fluctuations, heterogeneity of multiple product specifications (significant differences in demand fluctuations and replenishment lead times among different product specifications), as well as budgets, capacity, and minimum order quantities per carton, presenting a complex characteristic of multiple product specifications and multiple constraints. Therefore, how to accurately plan cigarette allocation has become an important part of inventory management and supply allocation.

[0003] In recent years, theoretical research on inventory management and supply allocation has been continuously deepened, providing strong support for enterprises to improve resource allocation efficiency in the supply chain environment. Among these efforts, facing a highly volatile market environment, some scholars have proposed a demand forecasting model based on a mixed negative binomial distribution, and established an optimization model accordingly to achieve the dual objectives of minimizing procurement costs and maximizing inventory turnover, thereby managing cigarette allocation. Meanwhile, other scholars have proposed using a BP neural network model to predict real-time tobacco inventory and have constructed an allocation and demand forecasting framework for the industrial tobacco scenario. Empirical results show that this framework significantly improves inventory turnover and supply chain response speed. Still other scholars have proposed a sales forecasting model and constructed a data-driven replenishment... The above-mentioned technologies have the following shortcomings: (1) When forecasting demand, the demand is determined based on the predicted sales volume, and the forecasting error will be too large when using the demand to forecast allocation; (2) When forecasting sales volume, the exogenous variables (such as holidays) are not considered enough, resulting in poor sales forecast accuracy, which affects the accuracy of subsequent allocation planning; Therefore, based on the above-mentioned shortcomings, how to provide a highly accurate method for regular cigarette allocation based on demand forecasting deviation has become an urgent problem to be solved. Summary of the Invention

[0004] The purpose of this invention is to provide a method, apparatus, and equipment for periodic allocation of cigarettes based on demand forecasting deviations, in order to solve the problems of low accuracy in allocation planning caused by insufficient consideration of exogenous variables and the use of demand setpoints for allocation planning in the existing technology.

[0005] To achieve the above objectives, the present invention adopts the following technical solution: Firstly, a method for periodic cigarette allocation based on demand forecasting bias is provided, including: Obtain historical sales and inventory data for cigarette products; Based on historical inventory data, a sales forecasting model is constructed, which takes the holiday disturbance characteristics of the sales cycle and the sales lag characteristics of cigarette products within the sales cycle as inputs and the predicted sales volume of cigarette products within the sales cycle as outputs. The holiday disturbance characteristics are used to characterize whether the sales cycle is in the month of the holiday, whether the next month of the month of the sales cycle contains the holiday, and the number of days between the sales cycle and the holiday. Using a sales forecasting model, the predicted sales volume of each cigarette product in several consecutive future periods starting from the target period can be determined. Based on historical inventory data and projected sales of each cigarette product, the demand range for each cigarette product within the target period is determined, and based on each demand range, the recommended allocation range for each cigarette product is determined. By utilizing the recommended allocation ranges for each cigarette product, an allocation optimization model is constructed with the goal of minimizing the ending inventory of the target period. The allocation optimization model is then solved to obtain the optimal allocation amount for each cigarette product within the target period.

[0006] Based on the aforementioned disclosure, this invention first constructs a sales forecasting model using historical inventory data of cigarette products. This model takes the holiday disturbance characteristics of the sales cycle and the sales lag characteristics of cigarette products within the sales cycle as input, and the predicted sales volume of cigarette products within the sales cycle as output. Then, based on this sales forecasting model, the predicted sales volume of each cigarette product over several consecutive future cycles starting from the target cycle is obtained. Next, based on the aforementioned historical inventory data and the predicted sales volume of each cigarette product, the demand range for each cigarette product is determined, and the recommended allocation range for each cigarette product is calculated accordingly. Then, using the recommended allocation range for each cigarette product, an allocation optimization model is constructed with the objective of minimizing ending inventory. Finally, by solving this optimization model, the optimal allocation volume for each cigarette product within the target cycle can be obtained.

[0007] Through the above design, this invention integrates holiday disturbances and sales lag characteristics in the sales forecasting stage of demand construction to build a sales forecasting model. Then, based on this model, short-term sales forecasts for various cigarette products are made. This overcomes the limitations of traditional techniques in handling exogenous variables such as holiday effects. Secondly, to address the potential risk accumulation caused by forecasting errors, this invention employs a demand construction method combining predicted values ​​and historical inventory data to construct demand ranges and determine the recommended allocation ranges for each cigarette product. Based on this, compared to traditional techniques that use a single demand value to predict feasible allocation ranges, this invention reduces forecasting errors. Therefore, this invention comprehensively considers exogenous variables and the potential risk accumulation of forecasting errors, proposing an integrated forecasting and optimization decision-making framework for periodic supply allocation. This ensures the accuracy of cigarette allocation and is therefore highly suitable for large-scale application and promotion.

[0008] In one possible design, based on historical inventory data, a sales forecasting model is constructed, taking the holiday disturbance characteristics of the sales cycle and the sales lag characteristics of cigarette products within the sales cycle as inputs, and the predicted sales volume of cigarette products within the sales cycle as the output. This model includes: Based on the historical inventory data, several sales cycles are determined, and the actual sales volume of each cigarette product within each sales cycle is determined. The holiday disturbance characteristics of each sales cycle are constructed, and the sales lag characteristics of each cigarette product in each sales cycle are constructed based on the historical purchase, sales and inventory data. By utilizing the holiday disturbance characteristics of each sales cycle and the sales lag characteristics of each cigarette product in each sales cycle, feature vectors of each cigarette product in each sales cycle are constructed. The machine learning model is trained by taking the feature vectors of each cigarette product in each sales cycle as input, the actual sales volume of each cigarette product in each sales cycle as label, and the predicted sales volume of each cigarette product in each sales cycle as output, so that the sales volume prediction model can be obtained after training.

[0009] In one possible design, the actual sales volume of each cigarette product in each historical period, wherein, based on the historical sales and inventory data, the sales lag characteristics of each cigarette product in each sales period are constructed, including: Obtain the lag order for each cigarette product; For any given sales cycle, based on the lag order, the available historical periods prior to that sales cycle for each cigarette product are determined, wherein the available historical period for any cigarette product is... ,and Let q represent any sales cycle, and q represent the lag order. From the actual sales volume of each cigarette product in each historical period, the actual sales volume corresponding to the available historical period of each cigarette product is selected. By utilizing the actual sales volume corresponding to the available historical periods of each cigarette product, the sales lag characteristics of each cigarette product within any given sales period are constructed.

[0010] In one possible design, by utilizing the holiday disturbance characteristics of each sales cycle and the sales lag characteristics of each cigarette product within each sales cycle, a feature vector for each cigarette product within each sales cycle is constructed, including: For any sales cycle, based on the lag order, determine the cycle in the historical inventory data from each historical cycle. The first historical cycle and the first Historical cycles between historical cycles; Establish the holiday disturbance characteristics corresponding to the determined historical cycles; Based on the holiday disturbance characteristics corresponding to the determined historical period and the holiday disturbance characteristics of any sales period, the lag characteristics of holidays relative to any sales period are constructed. By utilizing the lag characteristics of holidays relative to any sales cycle and the sales lag characteristics of each cigarette product within any sales cycle, a feature vector for each cigarette product within any sales cycle is constructed.

[0011] In one possible design, the historical inventory data includes: the actual sales volume of each cigarette product in each historical period, wherein, based on the historical inventory data and the predicted sales volume of each cigarette product, the demand range for each cigarette product in the target period is determined, including: For any cigarette product, based on the historical purchase, sales and inventory data, calculate the safety stock level of the cigarette product and the number of weeks the cigarette product covers relative to the target period, wherein each of the weeks covered is a period after the target period. Based on the number of coverage weeks and the predicted sales volume of any cigarette product in several consecutive future periods starting from the target period, the predicted sales volume for each coverage week is determined. The first forecast total demand is calculated using the number of weeks covered and the forecast sales for each week covered. Based on the actual sales volume of any cigarette product in each historical period, calculate the historical average weekly sales volume of any cigarette product, and calculate the second predicted total demand based on the historical average weekly sales volume and the number of covered weeks. Based on the first and second predicted total demand, the demand range for any of the cigarette products is constructed.

[0012] In one possible design, the historical inventory data also includes: the order lead time for each cigarette product at the time of each order; Specifically, based on the historical inventory data, the safety stock level for any given cigarette product and the number of weeks covered by any given cigarette product relative to the target period are calculated, including: Based on the actual sales volume of any cigarette product in each historical period, calculate the average annual sales volume and standard deviation of the sales volume of any cigarette product. Based on the average annual sales volume and the standard deviation of sales volume, the demand scale level and demand stability level of any cigarette product are determined. Using the order lead time, the demand size level, and the demand stability level for any cigarette product at each order, the average lead time and the lead time standard deviation are calculated. Based on the average lead time and the standard deviation of the lead time, the safety stock level of any cigarette product and the number of weeks the cigarette product covers relative to the target period are calculated.

[0013] In one possible design, based on various demand ranges, the recommended allocation ranges for each cigarette product are determined, including: For any cigarette product, obtain the current inventory level of that cigarette product and the planned supply level within the target period; Based on the historical purchase, sales and inventory data, calculate the safety stock level for any of the cigarette products. Based on the current inventory, the planned release quantity, the safety stock, and the demand range of any cigarette product, the upper and lower bounds of the recommended allocation range for any cigarette product are determined according to the following formula. ; In the formula, This represents the upper bound of the recommended allocation range for any of the cigarette products. This represents the upper bound of the demand range for any of the cigarette products. This indicates the planned supply volume of any of the aforementioned cigarette products. This indicates the safety stock level of any of the aforementioned cigarette products. This indicates the current inventory level of any of the cigarette products mentioned. This represents the lower bound of the recommended allocation range for any of the cigarette products. This represents the lower bound of the demand range for any of the cigarette products.

[0014] In one possible design, using the recommended allocation ranges for each cigarette product, an allocation optimization model is constructed with the objective of minimizing the ending inventory of the target period, including: The allocation optimization model is constructed according to the following formula; ; In the formula, This represents the allocation optimization model. This represents a collection of cigarette products. This represents the beginning inventory of cigarette product i in the target period. This represents the actual allocation amount of cigarette product i during the target period. For cigarette product i, the planned supply volume during the target period. This represents the penalty weighting coefficient. This represents the positive and negative deviations of the allocation quantity of cigarette supplier j from multiples of 5. This represents a set of cigarette suppliers; The constraints of the allocation optimization model are as follows: , , , , ; In the formula, , This represents the upper and lower bounds of the recommended allocation range for cigarette product i. This represents the maximum inventory of all cigarette suppliers. This represents the transfer price of cigarette product i. This indicates the upper limit of the budget for the allocation of all cigarette products. This represents the mapping between cigarette product i and the cigarette supplier. This represents the total allocation volume of cigarette supplier j. This indicates the virtual batch variable required for cigarette supplier j to output in multiples of 5.

[0015] Secondly, a cigarette periodic allocation device based on demand forecasting bias is provided, comprising: The acquisition unit is used to acquire historical purchase, sales, and inventory data for cigarette products. The model building unit is used to construct a sales forecasting model based on historical inventory data. The model takes the holiday disturbance characteristics of the sales cycle and the sales lag characteristics of cigarette products within the sales cycle as inputs and the predicted sales volume of cigarette products within the sales cycle as outputs. The holiday disturbance characteristics are used to characterize whether the sales cycle is in the month of the holiday, whether the next month of the month of the sales cycle contains the holiday, and the number of days between the sales cycle and the holiday. The sales forecasting unit is used to determine the predicted sales volume of each cigarette product over several consecutive future periods starting from the target period using a sales forecasting model. The allocation unit is used to determine the demand range of each cigarette product within the target period based on historical sales and inventory data and the predicted sales volume of each cigarette product, and to determine the recommended allocation range of each cigarette product based on the demand range. The allocation unit also utilizes the recommended allocation range for each cigarette product to construct an allocation optimization model with the goal of minimizing the ending inventory of the target period, and solves the allocation optimization model to obtain the optimal allocation amount for each cigarette product within the target period.

[0016] Thirdly, another cigarette periodic allocation device based on demand forecasting deviation is provided. Taking the device as an electronic device as an example, it includes a memory, a processor, and a transceiver that are connected in sequence. The memory is used to store a computer program, the transceiver is used to send and receive messages, and the processor is used to read the computer program and execute the cigarette periodic allocation method based on demand forecasting deviation as described in the first aspect or any possible design of the first aspect.

[0017] Fourthly, a storage medium is provided, on which instructions are stored, which, when executed on a computer, perform the periodic cigarette allocation method based on demand forecasting deviation as described in the first aspect or any possible design of the first aspect.

[0018] Fifthly, a computer program product containing instructions is provided that, when the instructions are executed on a computer, causes the computer to perform the periodic cigarette allocation method based on demand forecasting deviations as described in the first aspect or any possible design of the first aspect.

[0019] Beneficial effects: (1) In the sales forecasting stage of demand construction, this invention integrates holiday disturbance factors and sales lag characteristics to construct a sales forecasting model. Then, based on the sales forecasting model, short-term sales forecasts for each cigarette product are made. In this way, it breaks through the limitations of traditional technology in handling exogenous variables such as holiday effects. Secondly, in view of the risk accumulation problem that may be caused by forecasting errors, this invention adopts the demand construction method of forecast value + historical purchase, sales and inventory data to construct the demand range and determine the recommended allocation range for each cigarette product. Based on this, compared with the traditional technology that uses a single demand fixed value to predict the feasible range of allocation, this invention can reduce the forecasting error. Thus, this invention comprehensively considers the exogenous variables and the risk accumulation problem that may be caused by forecasting errors, and proposes a set of prediction and optimization integrated periodic supply allocation decision framework, which can ensure the accuracy of cigarette allocation and is therefore very suitable for large-scale application and promotion. Attached Figure Description

[0020] Figure 1A flowchart illustrating the steps of a periodic cigarette allocation method based on demand forecasting deviation provided in an embodiment of the present invention. Figure 2 A comparison chart of inventory fluctuation trends provided for embodiments of the present invention; Figure 3 A comparison chart of allocation amounts provided in an embodiment of the present invention; Figure 4 A comparison chart of transfer amounts provided in an embodiment of the present invention; Figure 5 This is a comparison chart of inventory turnover times provided in an embodiment of the present invention; Figure 6 A schematic diagram of a periodic cigarette allocation device based on demand forecasting deviation provided in an embodiment of the present invention; Figure 7 This is a schematic diagram of the structure of an electronic device provided in an embodiment of the present invention. Detailed Implementation

[0021] To more clearly illustrate the technical solutions in the embodiments of the present invention or the prior art, the present invention will be briefly introduced below in conjunction with the accompanying drawings and descriptions of the embodiments or the prior art. Obviously, the following description of the structure of the accompanying drawings is only some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort. It should be noted that the description of these embodiments is for the purpose of helping to understand the present invention, but does not constitute a limitation of the present invention.

[0022] It should be understood that although the terms first, second, etc., may be used herein to describe various units, these units should not be limited by these terms. These terms are only used to distinguish one unit from another. For example, a first unit may be referred to as a second unit, and similarly, a second unit may be referred to as a first unit, without departing from the scope of the exemplary embodiments of the invention.

[0023] It should be understood that the term "and / or" that may appear in this document is merely a description of the relationship between related objects, indicating that three relationships can exist. For example, A and / or B can mean: A exists alone, B exists alone, and A and B exist simultaneously. The term " / and" that may appear in this document describes another relationship between related objects, indicating that two relationships can exist. For example, A / and B can mean: A exists alone, and A and B exist alone. In addition, the character " / " that may appear in this document generally indicates that the related objects before and after it are in an "or" relationship.

[0024] Example: See Figure 1As shown in this embodiment, the method for periodic cigarette allocation based on demand forecasting bias proposes an integrated "prediction-optimization" decision-making framework for periodic supply allocation. First, based on historical inventory data, holiday disturbances and sales lag characteristics are introduced, and a multi-step rolling sales forecasting model is constructed using XGBoost to predict the sales volume of each cigarette product. Then, addressing the issue of large prediction errors for single-product specifications, the predicted sales volume is combined with the historical weekly average for each cigarette product, and the inventory coverage period is calculated based on the allocation interval and lead time to determine the demand range. Based on this, a feasible allocation range is determined. Finally, based on the feasible allocation range, a system is constructed with the goal of minimizing ending inventory. This method employs a mixed-integer programming model that considers storage capacity, budget, and industrial whole-case constraints, and uses the Gurobi solver to obtain high-quality solutions, thereby determining the optimal allocation quantity for each cigarette product. This approach overcomes the limitations of traditional techniques in handling exogenous variables such as holiday effects and solves the problem of large prediction errors, thus improving the accuracy of allocation planning. Therefore, this method is highly suitable for large-scale application and promotion. For example, this method can be run on the product allocation end, which can be, but is not limited to, a server or computer. It is understood that the aforementioned execution entity does not constitute a limitation on the embodiments of this application. Accordingly, the operation steps of this method can be, but are not limited to, the steps S1 to S5 described below.

[0025] S1. Obtain historical inventory data for cigarette products. In specific applications, historical inventory data can be, but is not limited to, weekly data, recording the inventory turnover process of each cigarette product in each cycle, including beginning inventory, transfer volume, actual sales, and ending inventory. It can also include order contract data and basic product information. The order contract data reflects the ordering behavior of commercial companies from different industrial enterprises. Fields include contract number, supplier name, specification code, product name, order quantity (cartons), contract amount (RMB), permit date, contract signing date, delivery date, and lead time for each cigarette product at each order. This information can be used to calculate the lead time distribution from order to delivery, characterizing the differences in supply response from different industries. The basic product information table records the static attributes of each specification of product, including specification code, product name, and transfer price, which can provide a basic reference for subsequent product matching, price constraints, and cost calculation.

[0026] After obtaining historical inventory data, in order to address the shortcomings of traditional technologies that do not take into account exogenous variables such as holidays, this embodiment constructs a rolling sales forecast model based on XGBoost by combining historical inventory data with holiday disturbance factors and sales lag characteristics. This model is used to forecast the sales of various cigarette products, providing basic data for subsequent demand forecasting. The construction process of the sales forecast model is shown in step S2 below.

[0027] S2. Based on historical inventory data, construct a sales forecasting model that takes the holiday disturbance characteristics of the sales cycle and the sales lag characteristics of cigarette products within the sales cycle as inputs, and the predicted sales volume of cigarette products within the sales cycle as output. The holiday disturbance characteristics are used to characterize whether the sales cycle is in the month of a holiday, whether the next month of the month of the sales cycle contains a holiday, and the number of days between the sales cycle and the holiday. In specific implementation, the sales forecasting model can be constructed using, but is not limited to, the following steps S21 to S24.

[0028] S21. Based on the historical inventory data, determine several sales cycles and the actual sales volume of each cigarette product within each sales cycle. In specific implementation, the sales cycle is a historical sample cycle, selected from various historical cycles in the historical inventory data. The actual sales volume corresponding to each selected historical cycle is used as the label data for each historical sample cycle. Thus, after selecting the historical sample cycles and their corresponding label data, the holiday disturbance characteristics and sales lag characteristics can be constructed, as shown in step S22 below.

[0029] S22. Construct holiday disturbance characteristics for each sales cycle, and based on the historical inventory data, construct sales lag characteristics for each cigarette product in each sales cycle.

[0030] In practical applications, feature engineering is a key step in building high-quality models in multi-product demand forecasting tasks. Its construction results will directly affect the accuracy and stability of the forecast results. Therefore, in order to more effectively characterize the time series features of commodity sales behavior and the impact of holiday disturbances, this embodiment constructs a multi-dimensional feature system including holiday coding, sales lag, and holiday lag.

[0031] Optionally, regarding the characteristics of holiday disturbances, it is stipulated that the main statutory holidays are New Year's Day, Spring Festival, Qingming Festival, Labor Day, Dragon Boat Festival, Mid-Autumn Festival, and National Day, among which the above holidays constitute a set. Furthermore, for any sales cycle, every holiday It possesses the following three dimensions of characteristics: The first characteristic: sales cycle Does it fall on a holiday? The month in question uses the first perturbation variable. express: ,in, This is a set of sales cycles.

[0032] The second characteristic: sales cycle Does the month following the current month include public holidays? It uses the second perturbation variable. express: .

[0033] The third characteristic: sales cycle During holidays The distance, i.e., the number of days between the two, is used... express.

[0034] In this way, the holiday disturbance characteristics of each sales cycle can be constructed through the aforementioned method.

[0035] Then, the sales lag characteristics of each cigarette product in each sales cycle can be constructed; where, to characterize the autocorrelation of product demand, the lag order is set to q, and the prediction target is assumed to be the q-th ... Zhou's cigarette products Sales volume, while product forecasts are based on the previous period (i.e., The forecast is conducted midway through the week, and because sales data depends on actual sales completion and system updates, the available data for sales-related variables is limited to the period ending in [week number missing]. Week; Thus, taking any sales cycle as an example, the sales lag characteristics are described, and the construction process is shown in the following steps S22a to S22d.

[0036] S22a. Obtain the hysteresis order of each cigarette product; in this embodiment, the hysteresis order of each cigarette product is the same, which is q, and q can be specifically set according to actual use, and is not specifically limited here.

[0037] S22b. For any sales cycle, based on the lag order, determine the available historical period of each cigarette product prior to that sales cycle, wherein the available historical period of any cigarette product is... ,and Let q represent any sales cycle, and q represent the lag order; in this embodiment, it is assumed that... If it's the fourth week of the third month, then it would be the second week, the first week, ..., the week preceding the fourth week. The week is used as the available historical period. Then, the actual sales volume of each cigarette product in each available historical period can be determined from the actual sales volume of each historical period. Based on this, the sales volume of each cigarette product in each period can be constructed. Sales lag characteristics within the country.

[0038] Optionally, the process of obtaining the actual sales volume corresponding to the historical period and the process of constructing the sales lag characteristics can be shown in steps S22c and S22d below.

[0039] S22c. From the actual sales volume of each cigarette product in each historical period, select the actual sales volume corresponding to the available historical period for each cigarette product; after obtaining the actual sales volume corresponding to the available historical period for each cigarette product, the corresponding sales lag characteristics can be constructed based on this, as shown in step S22d below. S22d. Using the actual sales volume corresponding to the available historical periods of each cigarette product, construct the sales lag characteristics of each cigarette product within any given sales period.

[0040] Optional, cigarette products During the sales cycle The sales lag characteristic within the period can be expressed as: ; In the formula, Indicates cigarette products During the sales cycle Sales lag characteristics within the country. This indicates cigarette products. Within the available historical period Actual sales within the country This indicates the transpose operation.

[0041] Thus, by constructing the holiday disturbance characteristics of each sales cycle and the sales lag characteristics of each cigarette product in each sales cycle through the aforementioned steps S22 and its sub-steps, the feature vectors of each cigarette product can be generated based on these characteristics, as shown in step S23 below.

[0042] S23. Utilize the holiday disturbance characteristics of each sales cycle and the sales lag characteristics of each cigarette product in each sales cycle to construct the feature vector of each cigarette product in each sales cycle; in specific implementation, take any sales cycle as an example to carry out the feature vector construction process, which can be, but is not limited to, the steps S23a to S23d below.

[0043] S23a. For any sales cycle, based on the lag order, determine the cycle in the historical inventory data that is in the lag period. The first historical cycle and the first The historical period between historical periods; in this embodiment, it starts from the period preceding any sales period and continues until the [number]th historical period. The historical period is used to construct the corresponding lag features of holidays based on the acquired historical period, as shown in steps S23b and S23c below.

[0044] S23b. Establish the holiday disturbance characteristics corresponding to the determined historical period; in this embodiment, the first The first historical cycle and the first The process of constructing the holiday disturbance characteristics of each historical period between historical periods can be found in step S22 above, and will not be repeated here; after establishing the holiday disturbance characteristics of each historical period, the holiday disturbance characteristic value of any sales period can be combined to construct the lag characteristic of holidays relative to any sales period. The process can be, but is not limited to, as shown in step S23c below.

[0045] S23c. Based on the holiday disturbance characteristics corresponding to the determined historical period and the holiday disturbance characteristics of any sales period, construct the lag characteristics of holidays relative to any sales period.

[0046] In this embodiment, the lag characteristic of holidays relative to any sales cycle can be represented as follows: ; In the formula, They represent the first The first historical cycle and the first The first disturbance variable of the first historical period is used to characterize the first... The first historical cycle and the first Does this historical cycle fall on a holiday? The month in which it is located, They represent the first The first historical cycle and the first The second perturbation variable of the first historical period is used to characterize the second... The first historical cycle and the first Does the month following the month in a historical cycle include holidays? ,and Then it means the first The first historical cycle and the first The number of days between a historical cycle and a holiday k.

[0047] Thus, after constructing the lag characteristics of holidays relative to any sales cycle, the feature vectors of each cigarette product can be constructed by combining the sales lag characteristics of each cigarette product, as shown in step S23d below.

[0048] S23d. Using the lag characteristics of holidays relative to any sales cycle and the sales lag characteristics of each cigarette product within any sales cycle, construct the feature vector of each cigarette product within any sales cycle.

[0049] In this embodiment, taking cigarette product i as an example, its feature vector within any sales cycle can be represented as: ; In the formula, Then, it represents the feature vector of cigarette product i within any sales cycle.

[0050] Therefore, after constructing the feature vectors of each cigarette product in each sales cycle through the aforementioned steps S23 and its sub-steps, these vectors can be used as input to the machine learning model for model training, as shown in step S24 below.

[0051] S24. Using the feature vectors of each cigarette product in each sales cycle as input, the actual sales volume of each cigarette product in each sales cycle as label, and the predicted sales volume of each cigarette product in each sales cycle as output, a machine learning model is trained to obtain the sales prediction model after training.

[0052] In practical applications, this embodiment further proposes a weekly sales forecasting framework based on XGBoost, building upon the feature system. This model aims to make rolling predictions of short-term sales for products over multiple future periods, providing accurate demand input for subsequent allocation optimization models. XGBoost, as an ensemble learning method based on a gradient boosting framework, integrates multiple CART (Classification and Regression Tree) regression trees as base learners. While ensuring model interpretability, it possesses good nonlinear modeling capabilities and robustness to sparse features, making it particularly suitable for handling high-dimensional sparse feature spaces composed of lagged features and holiday dummy variables.

[0053] The training set is constructed using the feature vectors of each cigarette product during each sales cycle and the actual sales volume of each cigarette product during each sales cycle. In the formula, express The tag data is essentially the actual sales volume of cigarette product i during any given sales period. .

[0054] Furthermore, training the XGBoost model using the aforementioned training data is achieved by minimizing the following objective function: ; In the formula, Describe the objective function. Let M be the m-th CART base learner in XGBoost, where M represents the total number of CART base learners. For inclusion and The set, For loss function, For When the input is , the model's output (i.e., the predicted sales). This represents the regularization term.

[0055] in, , For learning rate, Let m be the learner of the m-th CART base.

[0056] at the same time, In the formula, The number of leaf nodes. For the first j Leaf weight, and The coefficients are used to control model complexity and regularization, respectively.

[0057] In this way, the XGBoost model can be trained using the aforementioned method, thereby obtaining a sales prediction model.

[0058] Once the sales forecasting model is obtained, short-term sales forecasts for each cigarette product can be made based on it. The process can be, but is not limited to, the steps shown in step S3 below.

[0059] S3. Using a sales forecasting model, determine the predicted sales volume of each cigarette product over several consecutive future periods starting from the target period. In practice, since the allocation optimization problem depends on the total demand over several future periods, this embodiment uses a rolling forecasting strategy to generate demand values ​​for several consecutive future weeks. It is assumed that allocation planning needs to be carried out in the target period t, and the execution time predicted by the model is the period preceding each period t. Since week t-1 has not yet ended, its sales volume... It is not possible to obtain the value; therefore, it is necessary to use the model to predict the value first, so as to ensure that the data is complete when predicting week t+2.

[0060] Specifically, assuming t is 4, when predicting sales in week 5, it is necessary to obtain the actual sales of weeks 5-2, 5-3, ..., 5-q-1, that is, to obtain the actual sales of weeks 3, 2, up to 5-q-1. However, when making allocation plans for week 4, week 3 has not yet ended, so its corresponding actual sales are unknown. Therefore, it is necessary to first use a sales prediction model to predict the sales of week 3. That is, it is necessary to obtain the actual sales data of week 1 and all historical periods prior to week 1 to form the sales lag characteristics of cigarette products in week 3. Then, combined with the holiday disturbance characteristics, the sales of week 3 can be predicted. After obtaining the sales of week 3, the sales of week 5 can be predicted. That is, the sales lag characteristics of cigarette products in week 5 and the lag characteristics of holidays relative to week 5 can be constructed, and these can be used to form the feature vector of week 5. This vector is then input into the sales prediction model to obtain the predicted sales of week 5.

[0061] Similarly, for week 6, we need to obtain the actual sales figures for weeks 4, 3, and up to week 6-q-1. The actual sales figures for week 4 are unknown; therefore, they can also be predicted using the model. When predicting sales for week 4, which is the sales forecast for the target period, the sales lag characteristic is as follows: The lag characteristic of holidays relative to the target period is as follows: .

[0062] in, Let represent the actual sales in week t-2, week t-3, and week tq-1, respectively. Let $\mathbf{ ... The variables represent the second disturbance variable in the holiday disturbance characteristics of the target period, the second disturbance variable in the holiday disturbance characteristics of week t-1, and the second disturbance variable in the holiday disturbance characteristics of week tq, respectively. These represent the target period, the number of days between week t-1 and week tq and the holiday k, respectively.

[0063] Thus, by utilizing the sales lag characteristics of the target period and the corresponding lag characteristics of holidays, a feature vector for the target period is formed and input into the aforementioned sales forecasting model, the predicted sales volume for the target period can be obtained. Of course, the principle for sales forecasting in subsequent periods such as the 7th week is the same, and will not be elaborated here.

[0064] Based on the aforementioned step S3, after predicting the sales volume of each cigarette product over several consecutive periods starting from the target period, historical sales and inventory data can be combined to predict the demand range for each cigarette product, so as to determine the recommended allocation range for each cigarette product based on the demand range.

[0065] The calculation process for the demand range and the recommended allocation range is shown in step S4 below.

[0066] S4. Based on historical sales and inventory data and the projected sales volume of each cigarette product, determine the demand range for each cigarette product within the target period, and based on each demand range, determine the recommended allocation range for each cigarette product.

[0067] In practical implementation, the uncertainty of demand is a key factor affecting inventory matching and stockout risk in the allocation decision-making process of multi-specification goods. In order to effectively control allocation deviation and mitigate the cumulative impact of forecast error, this embodiment introduces a demand interval estimation mechanism, which uses the forecast value and the historical mean to jointly construct the upper and lower bounds of demand, providing robust interval constraint inputs for the allocation optimization model.

[0068] Optionally, taking any cigarette product as an example, the process of estimating its demand range within the target period can be illustrated, but is not limited to the steps S41 to S45 below.

[0069] In practical applications, the allocation decision adopts a periodic allocation strategy, that is, a centralized ordering operation is performed every fixed period. In order to prevent the risk of stockouts between two allocations or during the arrival of goods, the inventory after allocation must take into account the following three parts of demand: the consumption of the cycle before the next allocation after the current order, the consumption of the lead time of the arrival of the next allocation, and the risk buffer inventory caused by the volatility of the lead time. At the same time, the dimension of demand forecasting is detailed to each product specification. The weekly sales of a product specification are related to the city's market regulation. That is to say, the sales of product specifications are not entirely affected by holidays and time series, and are subject to manual regulation. Therefore, this embodiment uses a dual estimation method of forecast value and historical average to construct the upper and lower bounds of demand for the future coverage period.

[0070] Therefore, based on the aforementioned theoretical explanation, this embodiment needs to first determine the coverage period and safety stock level of any cigarette product relative to the target period, as shown in step S41 below.

[0071] S41. For any cigarette product, based on the historical inventory data, calculate the safety stock level of the cigarette product and the number of weeks the cigarette product covers relative to the target period, wherein each of the weeks covered is a period following the target period; in this embodiment, for example, but not limited to, the following steps S41a to S41d can be used to calculate the safety stock level and the number of weeks covered for the cigarette product.

[0072] S41a. Based on the actual sales volume of any cigarette product in each historical period, calculate the average annual sales volume and standard deviation of the sales volume of any cigarette product; after calculating the average annual sales volume and standard deviation of the sales volume, the demand scale and demand stability can be calculated, as shown in step S41b below.

[0073] S41b. Based on the average annual sales volume and the standard deviation of sales volume, the demand scale level and demand stability level of any cigarette product are determined. In specific applications, to characterize the importance and stability of product sales volume, this embodiment obtains the average annual sales volume and the standard deviation of sales volume of any cigarette product for ABC classification and stability division, respectively. Among them, the average annual sales volume is sorted from high to low and a frequency histogram is drawn. The cumulative contribution rate method is used for ABC classification, that is, according to the order from high to low, the cumulative sales volume is divided into three intervals to correspond to three demand scale levels, namely A, B and C. At the same time, the standard deviation of sales volume reflects the degree of fluctuation of product demand. After sorting it from low to high, K-Means clustering (divided into 2 categories) is performed. Products with a standard deviation of less than 31.33 are classified as high stability (H), and those with a standard deviation of more than 31.33 are classified as low stability (L).

[0074] After obtaining the demand scale level and demand stability level of any cigarette product, the average lead time and lead time standard deviation can be calculated by combining the order lead time of the cigarette product, as shown in step S41c below.

[0075] S41c. Using the order lead time, demand size level, and demand stability level for each order of any cigarette product, calculate the average lead time and lead time standard deviation. In practical application, this embodiment uses differentiated setting rules for the mean and standard deviation of the lead time based on ABC classification and stability level. Let any cigarette product be product i, and its lead time observation sequence be... ,in, These represent the lead time for ordering cigarette product i in the first order, the lead time for ordering the second order, and the lead time for ordering the nth order, respectively.

[0076] Among them, its average lead time is denoted as The standard deviation is The calculation formulas for both are as follows: ; ; In the formula, This represents the 70th percentile of the early observation sequence. This indicates the demand scale level for cigarette product i. This indicates the demand stability level for cigarette product i. They are respectively The 25th and 75th percentiles, and These represent the calculations of the mean and standard deviation, respectively.

[0077] Thus, according to the above formula, for Class A goods with low stability, the 70th quantile is used to estimate their average lead time to enhance robustness to extreme values; for Class C goods, considering their low sales volume and large fluctuations, the average value within the quartile interval is used as a robust estimate; and for other goods, the mean and standard deviation are directly used as lead time parameters.

[0078] Thus, after calculating the average lead time and the standard deviation of the lead time, the safety stock and the number of weeks of coverage can be calculated, as shown in step S41d below.

[0079] S41d. Calculate the safety stock level of any cigarette product and the number of weeks the cigarette product covers relative to the target period based on the average lead time and the standard deviation of the lead time.

[0080] In this embodiment, the safety stock level can be determined first based on the demand scale level and demand stability level of any cigarette product; then, the safety stock level of any cigarette product can be calculated based on the service level value and the average lead time and the lead time standard deviation.

[0081] Specifically, the calculation formula is as follows: ; In the formula, This indicates the safety stock level of any of the aforementioned cigarette products. This indicates the service level of any given cigarette product, where the demand scale level of any given cigarette product is level A and the demand stability level is high stability. The value is 0.9. When the demand scale level is A and the demand stability level is low stability, the value is 0.95; meanwhile, when the demand scale level of any cigarette product is B, The value is 0.85, when the demand scale level of any cigarette product is level C. The value is 0.8.

[0082] In this way, this setting helps to dynamically adjust the replenishment guarantee level of different products in the allocation model, taking into account both the stockout risk of high-selling products and the inventory control needs of low-selling products.

[0083] Similarly, the number of weeks covered by any cigarette product relative to the target period can be calculated using, but is not limited to, the following formula.

[0084] ; In the formula, Indicates the number of weeks of coverage. This represents the tolerance coefficient for stockout risk. This represents the fixed interval between two allocation decisions (in this embodiment, the value is 7). This indicates rounding up to the nearest integer.

[0085] After calculating the coverage weeks and safety stock of any cigarette product through the aforementioned steps S41a to S41d, the corresponding demand range can be determined by combining the predicted sales volume of the aforementioned cigarette product, as shown in the following steps S42 to S45.

[0086] S42. Based on the number of coverage weeks and the predicted sales volume of any cigarette product in several consecutive future periods starting from the target period, determine the predicted sales volume for each coverage week. In this embodiment, assuming the number of coverage weeks is 3 and the several consecutive future periods for any cigarette product starting from the target period is 5, then the predicted sales volume of the first, second, and third weeks starting from the target period is selected as the predicted sales volume for the corresponding coverage week. Of course, the above example is just an example. When the number of coverage weeks is different, the process of determining the predicted sales volume for each coverage week is the same, and will not be repeated here.

[0087] After obtaining the predicted sales for each coverage week, the first predicted total demand for any cigarette product can be calculated, as shown in step S43 below.

[0088] S43. Calculate the first predicted total demand using the number of coverage weeks and the predicted sales volume for each coverage week; in this embodiment, the first predicted total demand... Represented as: ,in, This represents the predicted sales volume for the c-th coverage week.

[0089] After obtaining the first predicted total demand, the second predicted total demand can be calculated by combining the historical weekly average vector of any cigarette product, as shown in step S44 below.

[0090] S44. Based on the actual sales volume of any cigarette product in each historical period, calculate the historical average weekly sales volume of any cigarette product, and calculate the second predicted total demand based on the historical average weekly sales volume and the number of covered weeks; in this embodiment, the second predicted total demand volume can be obtained by multiplying the historical average weekly sales volume by the number of covered weeks; then, the demand range of any cigarette product can be determined based on the predicted total demand volume, as shown in step S45 below.

[0091] S45. Based on the first and second predicted total demand, construct the demand range for any one of the cigarette products; in specific implementation, the upper and lower bounds of the demand range for any one cigarette product can be expressed as: ; In the formula, These represent the upper and lower bounds of the demand range for any given cigarette product, respectively. This represents the second forecast of total demand. This represents the first forecast of total demand.

[0092] Thus, after constructing the demand range for each cigarette product within the target period based on the aforementioned steps S41 to S45, the recommended allocation range for each cigarette product can be determined accordingly.

[0093] Here, we will take any cigarette product as an example to illustrate the calculation process of its recommended allocation range as shown in steps S46 to S48 below.

[0094] S46. For any cigarette product, obtain the current inventory level and the planned supply level within the target period. After obtaining the current inventory level and the planned supply level, the upper and lower limits of the recommended allocation range can be determined by combining the safety stock level and the demand range, as shown in steps S47 and S48 below.

[0095] S47. Calculate the safety stock level of any cigarette product based on the historical purchase, sales and inventory data; in this embodiment, the calculation process of the safety stock level can be referred to the aforementioned step S41 and its sub-steps, and will not be repeated here.

[0096] S48. Based on the current inventory, the planned release quantity, the safety stock, and the demand range of any cigarette product, determine the upper and lower bounds of the recommended allocation range for any cigarette product.

[0097] In this embodiment, for example, but not limited to, the following formula can be used to calculate the upper and lower bounds of the recommended allocation range for any cigarette product.

[0098] ; In the formula, This represents the upper bound of the recommended allocation range for any of the cigarette products. This represents the upper bound of the demand range for any of the cigarette products. This indicates the planned supply volume of any of the aforementioned cigarette products. This indicates the safety stock level of any of the aforementioned cigarette products. This indicates the current inventory level of any of the cigarette products mentioned. This represents the lower bound of the recommended allocation range for any of the cigarette products. This represents the lower bound of the demand range for any of the cigarette products.

[0099] Therefore, after calculating the recommended allocation range for each cigarette product within the target period through the aforementioned steps S41 to S48, an allocation optimization model with the goal of minimizing the end-of-period inventory can be constructed based on this. Then, by solving the model, the optimal allocation amount for each cigarette product within the target period can be obtained. The construction process of the allocation optimization model is shown in step S5 below.

[0100] S5. Using the recommended allocation range for each cigarette product, an allocation optimization model is constructed with the goal of minimizing the ending inventory of the target period. The allocation optimization model is then solved to obtain the optimal allocation amount for each cigarette product within the target period. In practical applications, this embodiment uses the recommended allocation range to construct a single-period allocation optimization model with the core objective of minimizing the ending inventory after allocation, thereby increasing inventory turnover. At the same time, the model uses a weekly decision-making rhythm, taking into account business constraints such as total volume, budget, and industrial batch size.

[0101] Optionally, the allocation optimization model can be represented as: ; In the formula, This represents the allocation optimization model. This represents a collection of cigarette products. This represents the beginning inventory of cigarette product i in the target period. This represents the actual allocation quantity of cigarette product i in the target period (which is the quantity to be determined). For cigarette product i, the planned supply volume during the target period. This represents the penalty weighting coefficient. This represents the positive and negative deviations of the allocation quantity of cigarette supplier j from multiples of 5. This represents a set of cigarette suppliers.

[0102] Meanwhile, the constraints of the allocation optimization model are: , , , , ; In the formula, , This represents the upper and lower bounds of the recommended allocation range for cigarette product i. This represents the maximum inventory of all cigarette suppliers. This represents the transfer price of cigarette product i. This indicates the upper limit of the budget for the allocation of all cigarette products. This represents the mapping between cigarette product i and the cigarette supplier. This represents the total allocation volume of cigarette supplier j. This indicates the virtual batch variable required for cigarette supplier j to output in multiples of 5.

[0103] Thus, as can be seen from the formula of the aforementioned allocation optimization model, its objective is to minimize the end-of-period inventory and batch deviation penalty in the later stage of allocation. The first constraint formula defines the allocation range of cigarette product i within the target period t; the second constraint formula defines the upper limit of the total allocation; the third formula is a budget constraint; the fourth formula calculates the total allocation of all cigarette products under cigarette supplier j; and finally, the last formula ensures that when the total industrial allocation is not divisible by 5, the deviation is mitigated. and Capture and apply a penalty term to the objective function. This maintains the integer batch rule while allowing for limited deviations when necessary, thereby improving the feasibility and flexibility of the model.

[0104] Therefore, after constructing the allocation optimization model, the model can be solved; in this embodiment, both the allocation optimization model and its constraints are linear; the decision variables include continuous variables. Non-negative continuous slack variables and and integer variables Therefore, the model belongs to Mixed Integer Linear Programming (MILP); based on this, given a bounded feasible region, MILP has finite convergence of the global optimum; specifically, the number of variables in this model is approximately The number of linear constraints is ,when Within two hundred and When the number of cases is in the tens, Gurobi can usually obtain high-quality solutions in the minutes. In this case, the Gurobi solver can be used to solve the model and obtain the optimal allocation amount of each cigarette product within the target period t.

[0105] Finally, an allocation plan can be generated based on the optimal allocation quantity of each cigarette product to achieve accurate allocation of cigarette products.

[0106] Therefore, through the detailed description of the cigarette periodic allocation method based on demand forecasting deviation in steps S1 to S5 above, this invention proposes an integrated "prediction-optimization" decision-making framework for periodic supply allocation. First, based on historical inventory data, holiday disturbances and sales lag characteristics are introduced, and a multi-step rolling sales forecasting model is constructed using XGBoost to predict the sales volume of each cigarette product. Then, to address the problem of large prediction errors for single-product specifications, based on the predicted sales volume, the historical weekly average of each cigarette product is combined, and the inventory coverage period is calculated according to the allocation interval and lead time. Based on this, a demand range is given, and then a feasible range for allocation quantity is obtained from the demand range. Finally, based on the feasible range for allocation quantity, a mixed integer programming model is constructed with the goal of minimizing ending inventory, which simultaneously considers storage capacity, budget, and industrial full-case constraints. A high-quality solution is obtained with the help of the Gurobi solver, thereby obtaining the optimal allocation quantity for each cigarette product. Thus, this invention breaks through the limitations of traditional technology in handling exogenous variables such as holiday effects and solves the problem of large prediction errors, thereby improving the accuracy of allocation planning. Therefore, it is very suitable for large-scale application and promotion.

[0107] In one possible design, the second aspect of this embodiment provides a specific example of the method described in the first aspect of the embodiment: To verify the effectiveness of the constructed multi-specification demand forecasting and periodic allocation optimization model, this embodiment uses a historical backtracking simulation method for the experiment. The data range is selected from the first week of January to the second week of May. Since the actual sales, inventory and allocation records during this period are known, two types of schemes can be constructed for comparison.

[0108] 1. Manual Solution (Baseline) The manual approach directly uses the actual allocation and inventory data from the marketing center during that period, reflecting the current business operation path that relies on experience-based judgment. Its inventory evolution and allocation decisions are based on real historical records, and therefore can serve as a benchmark.

[0109] 2. Optimization Plan (Proposed) The optimization scheme begins in the first week of January, using the actual beginning inventory as a baseline and assuming that the weekly delivery plan remains unchanged. Each week, the model first uses a forecasting framework to generate a demand forecast, and based on the demand range, uses an allocation optimization model to determine the optimal allocation quantity for the week. The updated ending inventory at this point becomes the beginning inventory for the following week, thus forming a weekly rolling optimization simulation trajectory. After five months of iteration, a completely different inventory and allocation evolution path than the manual scheme was obtained.

[0110] 3. Comparison Approach Through the above design, the manual solution represents "real historical performance," while the optimized solution reflects "the inventory and allocation dynamics that would occur if the model in this paper were used under the same demand environment." The comparison between the two not only reveals the extent of improvement of the optimized model in terms of inventory turnover efficiency and stockout control, but also demonstrates the cumulative impact of differences in allocation decisions on subsequent inventory trajectories.

[0111] 4. Analysis of experimental results.

[0112] Prediction results: To verify the effectiveness of the constructed sales forecasting framework, this embodiment selects typical product specifications for weekly forecasting and plots a comparison curve between the forecasted values ​​and actual sales. The forecast starts from the first week of March and uses a rolling method to continuously forecast sales for the next 6 weeks. From the comparison curves, the following conclusions can be drawn: the forecast curves for some product specifications can follow the fluctuation trajectory of actual sales relatively well. However, in certain specific weeks, there are significant deviations between the forecasted and actual values. This difference may be related to the management's weekly allocation strategy; that is, human factors may cause certain product specifications to be deliberately over- or under-allocated within a specific period, thus causing localized deviations in sales.

[0113] Meanwhile, Table 1 below lists the cumulative sales forecast results and error for each product specification over 6 weeks.

[0114] Table 1 shows the cumulative sales forecast results and error information.

[0115] Table 1

[0116] The results show that the predicted total volume is close to the actual total volume. For example, the predicted total volume of "Zhonghua (Hard)" was 161.38 boxes, while the actual volume was 199.64 boxes, a relatively manageable difference. The predicted volume of "Jiaozi (Wuliangye Strong Aroma Slim)" was almost identical to the actual volume. The MAPE of most of the nine product specifications remained within an acceptable range, indicating that the model has good accuracy in medium- and long-term cumulative forecasting. Overall, this forecasting framework can not only reproduce the overall fluctuation trend of sales, but also provide results that are close to the actual volume at the cumulative level. This indicates that the framework has strong demand forecasting capabilities and can provide reliable support for subsequent allocation optimization.

[0117] Allocation results: To further verify the actual effectiveness of the optimized model, this embodiment conducted a rolling allocation experiment from January to May 2025 based on the prediction results, and compared and analyzed the optimized results with the actual manual allocation situation. The results are as follows: Figure 2 As shown, Figure 2The chart shows a comparison of inventory fluctuation trends. As can be seen from the chart, optimized allocation significantly reduced inventory levels. In actual operation, beginning and ending inventories remained at a high level, and there was a significant inventory backlog in some months. However, the optimized solution, while meeting demand, shifted the overall inventory curve downward, with both beginning and ending inventories at a relatively stable and low level. This indicates that the optimized model effectively alleviated the inventory redundancy problem and improved inventory turnover efficiency.

[0118] This embodiment also provides comparison charts of allocation volume and allocation amount, which can be found in the following figures: Figure 3 and Figure 4 As shown, in the comparison between allocation volume and allocation amount, the total allocation volume of the optimized plan (52,982 boxes) is basically consistent with the actual operation (52,800 boxes), indicating that the model did not exceed the overall allocation scale constraint. However, in terms of monthly distribution, the optimization results are more balanced. For example, in January, the actual allocation volume was close to 20,000 boxes, while the optimized plan controlled it at around 15,000 boxes, avoiding inventory peaks caused by concentrated releases in the early stages. Correspondingly, the optimized allocation volume increased relatively in February and March, making the overall distribution smoother. The trend of allocation amount is consistent with the allocation volume, further illustrating the optimization model's ability to control capital occupation under budget constraints.

[0119] Finally, this embodiment also provides a comparison chart of inventory turnover times, see [link / reference]. Figure 5 As shown in the inventory turnover comparison chart, the total turnover under the optimized plan reached 13.55, while the actual turnover was only 7.24, a significant improvement. The turnover rates for each month also showed a general improvement, especially in January and March, where the optimized results were significantly better than the actual levels. This indicates that by optimizing the allocation strategy, companies can significantly improve the utilization efficiency of inventory funds while maintaining sales volume. The allocation optimization model not only remains feasible under constraints such as total volume and budget, but also significantly improves inventory levels and turnover efficiency, validating its effectiveness and value in practical applications.

[0120] Therefore, based on the aforementioned experimental analysis, the model proposed in this embodiment is closer to the characteristics of the industry in terms of depicting the complexity of actual business operations. On this basis, Gurobi is used to efficiently solve the mixed-integer linear programming model, and empirical research is conducted using real data. The main conclusions are as follows: (1) At the demand forecasting level, the XGBoost rolling forecasting framework based on holiday disturbances and lag characteristics can capture the fluctuation trend and cumulative scale of sales well. The forecast results show that the mean absolute percentage error (MAPE) of the model is within an acceptable range for most product specifications, and the predicted total is close to the actual total, indicating that the framework has high demand forecasting accuracy in the short to medium term, providing reliable data support for subsequent allocation decisions.

[0121] (2) At the level of allocation optimization, empirical results show that the optimization model significantly improves inventory levels and turnover efficiency while meeting constraints such as total volume and budget. Compared with the manual experience-based approach, the optimized approach effectively reduces inventory peaks and capital occupation pressure while maintaining a basically consistent total allocation volume, and increases the overall inventory turnover rate from 7.24 to 13.55. This result fully demonstrates the advantages of the model constructed in this paper in terms of dynamic supply and demand balance and efficient resource allocation.

[0122] (3) From a management perspective, this study shows that in the allocation management of the cigarette industry, relying solely on experience often leads to excessive inventory fluctuations and low capital utilization. In contrast, a data-driven integrated forecasting and optimization approach can improve overall operational efficiency while maintaining service levels. This approach is not only applicable to the cigarette industry but also has certain reference value for other industries with multi-specification management and supply uncertainties (such as pharmaceuticals and fast-moving consumer goods).

[0123] like Figure 6 As shown, the third aspect of this embodiment provides a hardware device for implementing the periodic cigarette allocation method based on demand forecasting deviation described in the first aspect of the embodiment, comprising: The acquisition unit is used to acquire historical purchase, sales and inventory data of cigarette products.

[0124] The model building unit is used to construct a sales forecasting model based on historical inventory data. The model takes the holiday disturbance characteristics of the sales cycle and the sales lag characteristics of cigarette products within the sales cycle as inputs and the predicted sales volume of cigarette products within the sales cycle as outputs. The holiday disturbance characteristics are used to characterize whether the sales cycle is in the month of a holiday, whether the next month of the month of the sales cycle contains a holiday, and the number of days between the sales cycle and the holiday.

[0125] The sales forecasting unit is used to determine the predicted sales volume of each cigarette product over several consecutive future periods starting from the target period, using a sales forecasting model.

[0126] The allocation unit is used to determine the demand range for each cigarette product within the target period based on historical sales and inventory data and the predicted sales volume of each cigarette product, and to determine the recommended allocation range for each cigarette product based on the demand range.

[0127] The allocation unit also utilizes the recommended allocation range for each cigarette product to construct an allocation optimization model with the goal of minimizing the ending inventory of the target period, and solves the allocation optimization model to obtain the optimal allocation amount for each cigarette product within the target period.

[0128] The working process, working details and technical effects of the device provided in this embodiment can be found in the first aspect of the embodiment, and will not be repeated here.

[0129] like Figure 7 As shown, the fourth aspect of this embodiment provides another cigarette periodic allocation device based on demand forecasting deviation. Taking the device as an electronic device as an example, it includes: a memory, a processor, and a transceiver connected in sequence. The memory is used to store a computer program, the transceiver is used to send and receive messages, and the processor is used to read the computer program and execute the cigarette periodic allocation method based on demand forecasting deviation as described in the first aspect of the embodiment.

[0130] For specific examples, the memory may include, but is not limited to, random access memory (RAM), read-only memory (ROM), flash memory, first-in-first-out (FIFO) memory, and / or first-in-last-out (FILO) memory, etc.; specifically, the processor may include one or more processing cores, such as a 4-core processor, an 8-core processor, etc. The processor may be implemented using at least one hardware form of DSP (Digital Signal Processing), FPGA (Field-Programmable Gate Array), PLA (Programmable Logic Array). The processor may also include a main processor and a coprocessor. The main processor, also known as the CPU (Central Processing Unit), is used to process data in the wake-up state; the coprocessor is a low-power processor used to process data in the standby state.

[0131] In some embodiments, the processor may integrate a GPU (Graphics Processing Unit), which is responsible for rendering and drawing the content to be displayed on the screen. For example, the processor may not be limited to microprocessors of the STM32F105 series, reduced instruction set computer (RISC) microprocessors, x86 architecture processors, or processors with integrated neural network processing units (NPUs). The transceiver may be, but is not limited to, a Wi-Fi transceiver, a Bluetooth transceiver, a General Packet Radio Service (GPRS) transceiver, a ZigBee (a low-power LAN protocol based on the IEEE 802.15.4 standard) transceiver, a 3G transceiver, a 4G transceiver, and / or a 5G transceiver. Furthermore, the device may also include, but is not limited to, a power module, a display screen, and other necessary components.

[0132] The working process, working details and technical effects of the electronic device provided in this embodiment can be found in the first aspect of the embodiment, and will not be repeated here.

[0133] The fifth aspect of this embodiment provides a storage medium that stores instructions containing the cigarette periodic allocation method based on demand forecasting deviation as described in the first aspect of the embodiment. That is, the storage medium stores instructions that, when executed on a computer, perform the cigarette periodic allocation method based on demand forecasting deviation as described in the first aspect of the embodiment.

[0134] The storage medium refers to a carrier for storing data, which may include, but is not limited to, floppy disks, optical disks, hard disks, flash memory, USB flash drives, and / or memory sticks. The computer may be a general-purpose computer, a special-purpose computer, a computer network, or other programmable devices.

[0135] The working process, working details and technical effects of the storage medium provided in this embodiment can be found in the first aspect of the embodiment, and will not be repeated here.

[0136] The sixth aspect of this embodiment provides a computer program product containing instructions that, when executed on a computer, cause the computer to perform the periodic cigarette allocation method based on demand forecasting deviation as described in the first aspect of this embodiment, wherein the computer may be a general-purpose computer, a special-purpose computer, a computer network, or other programmable device.

[0137] Finally, it should be noted that the above description is merely a preferred embodiment of the present invention and is not intended to limit the scope of protection of the present invention. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of the present invention should be included within the scope of protection of the present invention.

Claims

1. A method for periodic cigarette allocation based on demand forecasting bias, characterized in that, include: Obtain historical sales and inventory data for cigarette products; Based on historical inventory data, a sales forecasting model is constructed, which takes the holiday disturbance characteristics of the sales cycle and the sales lag characteristics of cigarette products within the sales cycle as inputs and the predicted sales volume of cigarette products within the sales cycle as outputs. The holiday disturbance characteristics are used to characterize whether the sales cycle is in the month of the holiday, whether the next month of the month of the sales cycle contains the holiday, and the number of days between the sales cycle and the holiday. Using a sales forecasting model, the predicted sales volume of each cigarette product in several consecutive future periods starting from the target period can be determined. Based on historical inventory data and projected sales of each cigarette product, the demand range for each cigarette product within the target period is determined, and based on each demand range, the recommended allocation range for each cigarette product is determined. By utilizing the recommended allocation ranges for each cigarette product, an allocation optimization model is constructed with the goal of minimizing the ending inventory of the target period. The allocation optimization model is then solved to obtain the optimal allocation amount for each cigarette product within the target period.

2. The method according to claim 1, characterized in that, Based on historical inventory data, a sales forecasting model is constructed, taking the holiday disturbance characteristics of the sales cycle and the sales lag characteristics of cigarette products within the sales cycle as inputs, and the predicted sales volume of cigarette products within the sales cycle as the output. This model includes: Based on the historical inventory data, several sales cycles are determined, and the actual sales volume of each cigarette product within each sales cycle is determined. The holiday disturbance characteristics of each sales cycle are constructed, and the sales lag characteristics of each cigarette product in each sales cycle are constructed based on the historical purchase, sales and inventory data. By utilizing the holiday disturbance characteristics of each sales cycle and the sales lag characteristics of each cigarette product in each sales cycle, feature vectors of each cigarette product in each sales cycle are constructed. The machine learning model is trained by taking the feature vectors of each cigarette product in each sales cycle as input, the actual sales volume of each cigarette product in each sales cycle as label, and the predicted sales volume of each cigarette product in each sales cycle as output, so that the sales volume prediction model can be obtained after training.

3. The method according to claim 2, characterized in that, The historical inventory data includes the actual sales volume of each cigarette product in each historical period. Based on the historical inventory data, the sales lag characteristics of each cigarette product in each sales period are constructed, including: Obtain the lag order for each cigarette product; For any given sales cycle, based on the lag order, the available historical periods prior to that sales cycle for each cigarette product are determined, wherein the available historical period for any cigarette product is... ,and Let q represent any sales cycle, and q represent the lag order. From the actual sales volume of each cigarette product in each historical period, the actual sales volume corresponding to the available historical period of each cigarette product is selected. By utilizing the actual sales volume corresponding to the available historical periods of each cigarette product, the sales lag characteristics of each cigarette product within any given sales period are constructed.

4. The method according to claim 3, characterized in that, By utilizing the holiday disturbance characteristics of each sales cycle and the sales lag characteristics of each cigarette product within each sales cycle, feature vectors for each cigarette product within each sales cycle are constructed, including: For any sales cycle, based on the lag order, determine the cycle in the historical inventory data from each historical cycle. The first historical cycle and the first Historical cycles between historical cycles; Establish the holiday disturbance characteristics corresponding to the determined historical cycles; Based on the holiday disturbance characteristics corresponding to the determined historical period and the holiday disturbance characteristics of any sales period, the lag characteristics of holidays relative to any sales period are constructed. By utilizing the lag characteristics of holidays relative to any sales cycle and the sales lag characteristics of each cigarette product within any sales cycle, a feature vector for each cigarette product within any sales cycle is constructed.

5. The method according to claim 1, characterized in that, The historical inventory data includes: the actual sales volume of each cigarette product in each historical period. Based on the historical inventory data and the projected sales volume of each cigarette product, the demand range for each cigarette product in the target period is determined, including: For any cigarette product, based on the historical purchase, sales and inventory data, calculate the safety stock level of the cigarette product and the number of weeks the cigarette product covers relative to the target period, wherein each of the weeks covered is a period after the target period. Based on the number of coverage weeks and the predicted sales volume of any cigarette product in several consecutive future periods starting from the target period, the predicted sales volume for each coverage week is determined. The first forecast total demand is calculated using the number of weeks covered and the forecast sales for each week covered. Based on the actual sales volume of any cigarette product in each historical period, calculate the historical average weekly sales volume of any cigarette product, and calculate the second predicted total demand based on the historical average weekly sales volume and the number of weeks covered. Based on the first and second predicted total demand, the demand range for any of the cigarette products is constructed.

6. The method according to claim 5, characterized in that, The historical inventory data also includes: the order lead time for each cigarette product at the time of each order; Specifically, based on the historical inventory data, the safety stock level for any given cigarette product and the number of weeks covered by any given cigarette product relative to the target period are calculated, including: Based on the actual sales volume of any cigarette product in each historical period, calculate the average annual sales volume and standard deviation of the sales volume of any cigarette product. Based on the average annual sales volume and the standard deviation of sales volume, the demand scale level and demand stability level of any cigarette product are determined. Using the order lead time, the demand size level, and the demand stability level for any cigarette product at each order, the average lead time and the lead time standard deviation are calculated. Based on the average lead time and the standard deviation of the lead time, the safety stock level of any cigarette product and the number of weeks the cigarette product covers relative to the target period are calculated.

7. The method according to claim 1, characterized in that, Based on the various demand ranges, the recommended allocation ranges for each cigarette product are determined, including: For any cigarette product, obtain the current inventory level of that cigarette product and the planned supply level within the target period; Based on the historical purchase, sales and inventory data, calculate the safety stock level for any of the cigarette products. Based on the current inventory, the planned release quantity, the safety stock, and the demand range of any cigarette product, the upper and lower bounds of the recommended allocation range for any cigarette product are determined according to the following formula. ; In the formula, This represents the upper bound of the recommended allocation range for any of the cigarette products. This represents the upper bound of the demand range for any of the cigarette products. This indicates the planned supply volume of any of the aforementioned cigarette products. This indicates the safety stock level of any of the aforementioned cigarette products. This indicates the current inventory level of any of the cigarette products mentioned. This represents the lower bound of the recommended allocation range for any of the cigarette products. This represents the lower bound of the demand range for any of the cigarette products.

8. The method according to claim 1, characterized in that, Using the recommended allocation ranges for various cigarette products, an allocation optimization model is constructed with the objective of minimizing the ending inventory level of the target period, including: The allocation optimization model is constructed according to the following formula; ; In the formula, This represents the allocation optimization model. This represents a collection of cigarette products. This represents the beginning inventory of cigarette product i in the target period. This represents the actual allocation amount of cigarette product i during the target period. For cigarette product i, the planned supply volume during the target period. This represents the penalty weighting coefficient. This represents the positive and negative deviations of the allocation quantity of cigarette supplier j from multiples of 5. This represents a set of cigarette suppliers; The constraints of the allocation optimization model are as follows: , , , , ; In the formula, , This represents the upper and lower bounds of the recommended allocation range for cigarette product i. This represents the maximum inventory of all cigarette suppliers. This represents the transfer price of cigarette product i. This indicates the upper limit of the budget for the allocation of all cigarette products. This represents the mapping between cigarette product i and the cigarette supplier. This represents the total allocation volume of cigarette supplier j. This indicates the virtual batch variable required for cigarette supplier j to output in multiples of 5.

9. A cigarette periodic allocation device based on demand forecasting bias, characterized in that, include: The acquisition unit is used to acquire historical purchase, sales, and inventory data for cigarette products. The model building unit is used to construct a sales forecasting model based on historical inventory data. The model takes the holiday disturbance characteristics of the sales cycle and the sales lag characteristics of cigarette products within the sales cycle as inputs and the predicted sales volume of cigarette products within the sales cycle as outputs. The holiday disturbance characteristics are used to characterize whether the sales cycle is in the month of the holiday, whether the next month of the month of the sales cycle contains the holiday, and the number of days between the sales cycle and the holiday. The sales forecasting unit is used to determine the predicted sales volume of each cigarette product over several consecutive future periods starting from the target period using a sales forecasting model. The allocation unit is used to determine the demand range of each cigarette product within the target period based on historical sales and inventory data and the predicted sales volume of each cigarette product, and to determine the recommended allocation range of each cigarette product based on the demand range. The allocation unit also utilizes the recommended allocation range for each cigarette product to construct an allocation optimization model with the goal of minimizing the ending inventory of the target period, and solves the allocation optimization model to obtain the optimal allocation amount for each cigarette product within the target period.

10. An electronic device, characterized in that, include: A memory, a processor, and a transceiver are sequentially connected in communication, wherein the memory is used to store computer programs, the transceiver is used to send and receive messages, and the processor is used to read the computer programs and execute the cigarette periodic allocation method based on demand forecast deviation as described in any one of claims 1 to 8.