A commodity sales forecasting system and method based on hierarchical modeling
Through the commodity sales forecasting system based on hierarchical modeling, the problems of inaccurate judgment of access standards and inadequate granularity stratification and aggregation in the prior art are solved, and more accurate and reliable commodity sales forecasts are achieved.
Patent Information
- Application Number
- CN202210782212.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-07-04
- Publication Date
- 2025-06-20
- Estimated Expiration
- 2042-07-04
AI Technical Summary
In the prior art, there are problems in the prediction of commodity sales, the judgment of access standards is not rigorous and the granularity stratified aggregation is not fine, resulting in insufficient accuracy and reliability of the prediction results.
A product sales prediction system based on hierarchical modeling is adopted to achieve the prediction of product volume by obtaining product sales historical data, judging whether the data meets the access standards, performing granular hierarchical aggregation and constructing a multi-level prediction model.
It improves the accuracy and reliability of product sales forecasts, can process sales historical data of different products more effectively, and provides more accurate prediction results.
Smart Images

Figure CN115147153B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of commodity quantity prediction, and particularly to a commodity sales prediction system and method based on hierarchical modeling. Background Art
[0002] Sales volume prediction can be regarded as a time series prediction problem, that is, predicting the sales volume in a later period through the sales volume in a previous period. Patent Application No. 2022102528670, titled "A Commodity Sales Volume Prediction Method, System, Device and Storage Medium", discloses that according to the analysis of the prediction vector, the sales volume distribution of each commodity is obtained; by sampling the sales volume distribution and taking the median, the predicted sales volume of each commodity in the next period is obtained; again, according to the predicted sales volume and the actual sales volume of each commodity in each historical period, the prediction result is optimized to obtain the corresponding sales volume prediction model; then, the preset external feature vector corresponding to each commodity in the period to be predicted and the actual sales volume of each commodity in the previous period of the period to be predicted are obtained; finally, the preset external feature vector and the actual sales volume are input into the sales volume prediction model to obtain the corresponding sales volume prediction result. Summary of the Invention
[0003] The present invention aims to at least solve the technical problems existing in the prior art, and particularly innovatively proposes a commodity sales prediction system and method based on hierarchical modeling.
[0004] To achieve the above object of the present invention, the present invention provides a commodity sales prediction system based on hierarchical modeling, including: a commodity sales historical data acquisition module, an admission standard judgment module, a granularity hierarchical aggregation module, and a commodity quantity prediction module. The commodity quantity prediction module includes a commodity quantity first prediction module and a commodity quantity second prediction module;
[0005] The data output end of the commodity sales historical data acquisition module is connected to the data input end of the admission standard judgment module. The first data output end of the admission standard judgment module is connected to the data input end of the granularity hierarchical aggregation module. The data output end of the granularity hierarchical aggregation module is connected to the data input end of the commodity quantity first prediction module. The second data output end of the admission standard judgment module is connected to the data input end of the commodity quantity second prediction module;
[0006] The commodity sales historical data acquisition module is used to acquire commodity sales historical data;
[0007] The admission standard judgment module is used to judge whether the acquired commodity sales historical data meets the admission standard according to the commodity sales historical data acquired by the commodity sales historical data acquisition module:
[0008] If the acquired commodity sales historical data meets the admission standard, it enters the granularity hierarchical aggregation module;
[0009] If the obtained historical sales data of the commodity does not meet the access standard, it enters the second commodity quantity prediction module;
[0010] The granularity hierarchical aggregation module is used to perform granularity layering on the historical sales data of the commodity from top to bottom, and aggregate to obtain the historical sales data of each layer;
[0011] The first commodity quantity prediction module is used to import the historical sales data of each layer obtained from the granularity hierarchical aggregation module into the constructed model to obtain the predicted commodity quantity of each level;
[0012] The second commodity quantity prediction module is used to import the historical sales data of the commodity into the share allocation to obtain the predicted commodity quantity.
[0013] The present invention also discloses a commodity sales prediction method based on hierarchical modeling, including the following steps:
[0014] S1. Obtain the historical sales data of the commodity;
[0015] S2. According to the historical sales data of the commodity obtained in step S1, judge whether the obtained historical sales data of the commodity meets the access standard:
[0016] If the obtained historical sales data of the commodity meets the access standard, execute S3 - S5;
[0017] If the obtained historical sales data of the commodity does not meet the access standard, execute step S6;
[0018] S3. Perform granularity layering on the historical sales data of the commodity from top to bottom, and aggregate to obtain the historical sales data of each layer;
[0019] S4. Import the historical sales data of each layer obtained in step S3 into the constructed model to obtain the predicted commodity quantity of each level;
[0020] S5. Import the historical sales data of the l n layer obtained in step S4 into the share allocation to obtain the predicted commodity quantity of the l n+1 layer.
[0021] S6. Import the historical sales data of the commodity into the share allocation to obtain the predicted commodity quantity.
[0022] In a preferred embodiment of the present invention, judging whether the obtained historical sales data of the commodity meets the access standard in step S2 includes one or any combination of the following:
[0023] Criterion 1: The average monthly sales volume is greater than the set monthly sales volume threshold, or the average quarterly sales volume is greater than the set quarterly sales volume threshold, or the average annual sales volume is greater than the set annual sales volume threshold;
[0024] Standard Two: The sales volume is continuous within a recent period of time, and this period of time is one of the year, quarter, or month.
[0025] Or / and in step S4, building the model includes Model One and Model Two.
[0026] Model One:
[0027] y t = β0 + β1y t-1 + β2y t-2 + … + β p y t-p + ∈ t + α1ε t-1 + α2ε t-2 + … + α q ε t-q ,
[0028] where y t-1 ~y t-p represents p lag terms of the autoregressive model.
[0029] β1~β p represents the correlation coefficients of the autoregressive model.
[0030] p is the order of the autoregressive model.
[0031] q is the order of the moving average model.
[0032] ε t-1 ~ε t-q represents q lag terms of the moving average model.
[0033] α1~α q represents the correlation coefficients of the moving average model.
[0034] β0 represents the constant term.
[0035] ∈ t represents the random error term.
[0036] Model Two:
[0037] Y t = A0 + A1Y t-1 + A2Y t-2 + A3Y t-3 + … + A p Y t-p + e t ,
[0038] where,
[0039]
[0040] Among them, A0 represents an N×1 order constant column vector;
[0041] A1 to A p represent an N×M order parameter matrix;
[0042] e t represents an N×1 order random error column vector;
[0043] Y t-1 to Y t-p represent an N×1 order time series column vector.
[0044] In a preferred embodiment of the present invention, the method for selecting the optimal model is as follows:
[0045] S31. Import the historical sales data of goods obtained in step S3 into Model 1 to obtain the output result data 1;
[0046] S32. Import the historical sales data of goods obtained in step S3 into Model 2 to obtain the output result data 2;
[0047] S33. Select the evaluation index, and the model with the optimal evaluation index is the model finally used for prediction.
[0048] In a preferred embodiment of the present invention, for the historical time series {A1, A2, A3, A4, A5, A6, A7, A8, …, Ak - 1}, predict the sales volume in the future {Ak} cycle; the data selection method includes one of the following:
[0049] Method 1: Directly take the values of Ah, …, Ak - 3, Ak - 2, Ak - 1 from {A1, A2, A3, A4, A5, A6, A7, A8, …, Ak - 1}; h takes 1 or 2 or 3 or …… k - 3;
[0050] Method 2: Directly take the values of … Ak - 3H, Ak - 2H, Ak - H from {A1, A2, A3, A4, A5, A6, A7, A8, …, Ak - 1} at intervals; H takes 2 or 3 or 4 or …….
[0051] In a preferred embodiment of the present invention, correct the predicted commodity value, and the correction method includes Method 1 or / and Method 2:
[0052] Method 1:
[0053] Prediction difference
[0054] Among them, hat represents the predicted value;
[0055] l represents the number of model layers;
[0056] M represents the total number of lower-layer models included in the upper-layer model l;
[0057] represents the predicted value of the upper-layer model l;
[0058] represents the predicted value of the i-th model included in the upper-layer model l;
[0059] Split share
[0060] where i represents the i-th model;
[0061] M represents the total number of lower-layer models included in the upper-layer model l;
[0062] l represents the number of layers;
[0063] hat represents the predicted value;
[0064] represents the prediction error of the i-th model included in the upper-layer model l;
[0065] represents the actual value of the i-th model included in the upper-layer model l;
[0066] represents the predicted value of the i-th model included in the upper-layer model l;
[0067] Correction value
[0068] where i represents the i-th model;
[0069] l represents the number of layers;
[0070] s i represents the split share of the i-th model included in the upper-layer model l;
[0071] ε hat represents the prediction difference of the models included in the upper-layer model l;
[0072] Corrected predicted value y' hat,i = y hat,i + V i ,
[0073] where y hat,i represents the predicted value of the i-th model included in the upper-layer model l;
[0074] V i represents the correction value of the i-th model included in the upper-layer model l;
[0075] Method 2:
[0076] Step 1: Obtain the predicted sales volume of the upper-layer model l in the t-th period
[0077] Step 2: According to claim 5, obtain the actual sales volume sequence of the previous k periods of the upper-layer model l before the t-th period
[0078] Step 3: Combine Step 1 and Step 2 to obtain the sales volume sequence related to the upper-layer model l
[0079] Step 4: Use the sequence in Step 3 as a control variable and place it into the i-th lower-layer model included in the upper-layer model l, and use a multivariate time series model to predict the sales volume of this model
[0080] In a preferred embodiment of the present invention, the method for determining the optimal sharing ratio in Step S5 includes Method 1 and Method 2:
[0081] Method 1: Use the average value of the historical sales volume ratios in the most recent T months as the sharing share;
[0082]
[0083] Wherein, M represents the number of shares;
[0084] i represents the i-th of the number of shares;
[0085] f i represents the share value;
[0086] y i represents the sharing share of the i-th sharing object;
[0087] yi,t represents the sales volume corresponding to the i-th sharing object at t = 1, 2, 3,..., T respectively;
[0088] yt represents the total sales volume of the i-th sharing object in the most recent T months;
[0089] Method 2: Use the weighted average value of the historical sales volume shares in the most recent T months as the sharing share;
[0090]
[0091] Wherein, M represents the number of shares;
[0092] i represents the i-th of the number of shares;
[0093] f i represents the share value;
[0094] T represents the number of months of data used;
[0095] Let \(y_{i,t}\) represent the sales volume corresponding to the \(i\)-th allocation object at times \(t = 1, 2, 3, \cdots, T\).
[0096] Let \(y_t\) represent the total sales volume of the \(i\)-th allocation object in the most recent \(T\) months.
[0097] \(a\) t represents the weight for share allocation of the \(i\)-th allocation object at times \(t = 1, 2, 3, \cdots, T\).
[0098] Method selection: By comparing the mean square error, select the method with a smaller MSE.
[0099] In a preferred embodiment of the present invention, \(y\) i \(=\) \(y\) l \(*\) \(f\) i l+1
[0100] where \(i\) represents the \(i\)-th allocation object included in the upper-layer model \(l\);
[0101] \(y\) i represents the allocation prediction value of the \(i\)-th allocation object included in the upper-layer model \(l\);
[0102] \(y\) l represents the prediction value of the upper-layer model \(l\);
[0103] \(f\) i l+1 represents the allocation share of the \(i\)-th allocation object included in the upper-layer model \(l\).
[0104] In a preferred embodiment of the present invention, in step S6, the allocation steps follow:
[0105] Step 1: Aggregate the historical sales data of all non-modeling points upward;
[0106] Step 2: Use the method of claim 3 for the data from the previous step to obtain the predicted sales volume data;
[0107] Step 3: Use the method of claim 8 for the predicted sales volume from the previous step to obtain the allocated predicted sales volume.
[0108] In summary, due to the adoption of the above technical solution, the present invention can predict the quantity of goods based on historical commodity sales data.
[0109] The additional aspects and advantages of the present invention will be partially given in the following description, partially become apparent from the following description, or be understood through the practice of the present invention. BRIEF DESCRIPTION OF THE DRAWINGS
[0110] The above and / or additional aspects and advantages of the present invention will become apparent and be readily understood from the description of the embodiments in conjunction with the following drawings, where:
[0111] Figure 1 This is a schematic block diagram of the connection of the present invention. Detailed implementation manners
[0112] The embodiments of the present invention will be described in detail below. The examples of the embodiments are shown in the drawings, wherein the same or similar reference numerals denote the same or similar elements or elements having the same or similar functions throughout. The embodiments described below by referring to the drawings are exemplary and are only used to explain the present invention and should not be construed as a limitation to the present invention.
[0113] The present invention discloses a commodity sales prediction system based on hierarchical modeling, as Figure 1 shown, including: a commodity sales historical data acquisition module, an admission standard judgment module, a granularity hierarchical aggregation module, and a commodity quantity prediction module. The commodity quantity prediction module includes a first commodity quantity prediction module and a second commodity quantity prediction module;
[0114] The data output end of the commodity sales historical data acquisition module is connected to the data input end of the admission standard judgment module. The first data output end of the admission standard judgment module is connected to the data input end of the granularity hierarchical aggregation module. The data output end of the granularity hierarchical aggregation module is connected to the data input end of the first commodity quantity prediction module. The second data output end of the admission standard judgment module is connected to the data input end of the second commodity quantity prediction module;
[0115] The commodity sales historical data acquisition module is used to acquire commodity sales historical data;
[0116] The admission standard judgment module is used to judge whether the acquired commodity sales historical data meets the admission standard according to the commodity sales historical data acquired by the commodity sales historical data acquisition module:
[0117] If the acquired commodity sales historical data meets the admission standard, it enters the granularity hierarchical aggregation module;
[0118] If the acquired commodity sales historical data does not meet the admission standard, it enters the second commodity quantity prediction module;
[0119] The granularity hierarchical aggregation module is used to perform granularity layering on the commodity sales historical data from top to bottom and aggregate to obtain the sales historical data of each layer;
[0120] The first commodity quantity prediction module is used to import the sales historical data of each layer obtained in the granularity hierarchical aggregation module into the constructed model to obtain the predicted commodity quantity of each level;
[0121] The second commodity quantity prediction module is used to import the commodity sales historical data into the share allocation to obtain the predicted commodity quantity.
[0122] The present invention also discloses a commodity sales prediction method based on hierarchical modeling, including the following steps:
[0123] S1. Obtain fine-grained historical commodity sales data;
[0124] S2. According to the historical commodity sales data obtained in step S1, determine whether the obtained historical commodity sales data meets the admission criteria:
[0125] If the obtained historical commodity sales data meets the admission criteria, execute S3-S5;
[0126] If the obtained historical commodity sales data does not meet the admission criteria, execute step S6;
[0127] S3. Granularity-stratify the historical commodity sales data that meets the admission criteria from top to bottom, and aggregate to obtain the historical sales data of each level of l 1 ,l 2 ,l 3 ,…,l n Among them, l 1 represents the first layer, which is also the top layer, l 2 represents the second layer, l 3 represents the third layer, l n represents the nth layer, l n+1 represents the (n + 1)th layer; the (n + 1)th layer is also the bottom layer.
[0128] S4. Import the historical sales data of l 1 ,l 2 ,l 3 ,…,l n obtained in step S3 into the constructed model to obtain the predicted commodity quantities of each level;
[0129] S5. Import the historical sales data of the l n layer obtained in step S4 into share allocation to obtain the predicted commodity quantity of the l n+1 layer.
[0130] S6. Import the historical commodity sales data that does not meet the admission criteria in step S2 into share allocation to obtain the predicted commodity quantity.
[0131] In a preferred embodiment of the present invention, determining whether the obtained historical commodity sales data meets the admission criteria in step S2 includes one or any combination of the following:
[0132] Criterion 1: The average monthly sales volume is greater than the set monthly sales volume threshold, or the average quarterly sales volume is greater than the set quarterly sales volume threshold, or the average annual sales volume is greater than the set annual sales volume threshold;
[0133] Standard Two: The sales volume is continuous within a recent period, and this period is one of the year, quarter, or month.
[0134] In a preferred embodiment of the present invention, in step S3, the method of particle size stratification is as follows:
[0135] S31, l 1 is the top layer, with only one model
[0136] S32, l 2 is the second layer, divided into 3 to 10 models, such as the models included are represented by ; The model determination method, for example, dividing urban agglomerations, does not have to be divided according to simple geographical or regional factors, and can be obtained by clustering factors such as urban level, GDP scale / growth rate, population size, and number of stores, ensuring similarity in more dimensions within the model;
[0137] S33, on the basis of l 2 subdivide downwards by l 3 layers, such as the models included are represented by ; For example, when dividing the exclusive store group, factors such as the location of the exclusive store, opening time, and turnover can be considered for clustering.
[0138] S34, on the basis of l 3 subdivide downwards by l 4 layers, such as the models included are represented by ;
[0139] S35, it can be increased downwards layer by layer according to the above steps to the l n th layer.
[0140] In a preferred embodiment of the present invention, in step S4, the constructed model includes Model One and Model Two;
[0141] Model One: ARMA model
[0142] y t = β0 + β1y t-1 + β2y t-2 +…+ β p y t-p + ∈ t + α1ε t-1 + α2ε t-2 +…+ α q ε t-q ,
[0143] where, yt-1 ~y t-p represent the p lag terms of the autoregressive model;
[0144] β1~β p represent the correlation coefficients of the autoregressive model;
[0145] p is the order of the autoregressive model;
[0146] q is the order of the moving average model;
[0147] ε t-1 ~ε t-q represent the q lag terms of the moving average model;
[0148] α1~α q represent the correlation coefficients of the moving average model;
[0149] β0 represents the constant term;
[0150] ∈ t represents the random error term.
[0151] When the time series does not meet the stationary condition, the ARIMA model is formed by combining ARMA and differencing methods; when the ARIMA model considers seasonal factors, the SARIMA model is adopted;
[0152] Model 2: VAR model
[0153] Y t = A0 + A1Y t-1 + A2Y t-2 + A3Y t-3 +…+ A p Y t-p + e t ,
[0154] where,
[0155]
[0156] where, A0 represents an N×1 order constant column vector;
[0157] A1~A p represent an N×M order parameter matrix;
[0158] e t represents an N×1 order random error column vector;
[0159] Y t-1 ~Y t-p represent an N×1 order time series column vector;
[0160] Model 1 and Model 2 are common time series prediction methods. In application, other sales prediction methods can be added according to actual needs to form an algorithm library.
[0161] Common evaluation indicators for the algorithm library to select the optimal model include:
[0162] There are Mean Absolute Error (MAE), Mean Absolute Percentage Error (MAPE), Mean Squared Error (MSE), Root Mean Squared Error (RMSE), Mean Squared Logarithmic Error (MSLE), Median Absolute Error (MedAE), and R-squared. The evaluation can be carried out by selecting a single indicator or a combination of multiple indicators according to the focus of attention.
[0163] In a preferred embodiment of the present invention, the method for selecting the optimal model is as follows:
[0164] S31: Import the historical sales data of the commodity obtained in step S3 into Model 1 to obtain the output result data 1;
[0165] S32: Import the historical sales data of the commodity obtained in step S3 into Model 2 to obtain the output result data 2;
[0166] S33: Similarly, if other methods in the algorithm library are also used, import the historical sales data of the commodity obtained in S3 into the corresponding model to obtain the output result data N;
[0167] S34: Select the evaluation indicator, and judge the model result with the best evaluation indicator among the N output results. This model is the final model used for prediction;
[0168] In a preferred embodiment of the present invention, for the historical time series {A1, A2, A3, A4, A5, A6, A7, A8, …, Ak-1}, predict the sales volume in the future {Ak} cycle; the data selection methods include one of the following:
[0169] Method 1: Continuously take the values of Ah, …, Ak-3, Ak-2, Ak-1 directly from {A1, A2, A3, A4, A5, A6, A7, A8, …, Ak-1}; h takes 1 or 2 or 3 or …… k-3;
[0170] Method 2: Take the values of … Ak-3H, Ak-2H, Ak-H directly from {A1, A2, A3, A4, A5, A6, A7, A8, …, Ak-1} at intervals; H takes 2 or 3 or 4 or …….
[0171] In a preferred embodiment of the present invention, to correct the predicted commodity value, the correction methods include:
[0172] Method 1: All models in the algorithm library can be used
[0173] Prediction difference
[0174] where hat represents the predicted value;
[0175] l represents the number of model layers;
[0176] M represents the total number of lower-layer models contained in the upper-layer model l;
[0177] represents the predicted value of the upper-layer model l;
[0178] represents the predicted value of the i-th model contained in the upper-layer model l;
[0179] Split share
[0180] where i represents the i-th model;
[0181] M represents the total number of lower-layer models contained in the upper-layer model l;
[0182] l represents the number of layers;
[0183] hat represents the predicted value;
[0184] represents the prediction error of the i-th model contained in the upper-layer model l;
[0185] represents the actual value of the i-th model contained in the upper-layer model l;
[0186] represents the predicted value of the i-th model contained in the upper-layer model l;
[0187] Correction value
[0188] where i represents the i-th model;
[0189] l represents the number of layers;
[0190] s i represents the split share of the i-th model contained in the upper-layer model l;
[0191] ε hat represents the prediction difference of the models contained in the upper-layer model l;
[0192] Corrected predicted value y' hat,i = y hat,i + V i ,
[0193] where y hat,iIt represents the predicted value of the i-th model included in the upper-layer model l;
[0194] V i It represents the corrected value of the i-th model included in the upper-layer model l.
[0195] Method 2: Only applicable to the multi-variable models in the algorithm library, such as the VAR model
[0196] Step 1: Obtain the predicted sales volume of the upper-layer model l in the t-th period
[0197] Step 2: According to Claim 5, obtain the k-period actual sales volume sequence of the upper-layer model l before the t-th period
[0198] Step 3: Combine Step 1 and Step 2 to obtain the sales volume sequence related to the upper-layer model l
[0199] Step 4: Use the sequence in Step 3 as a control variable and place it into the i-th lower-layer model included in the upper-layer model l, and use the multi-variable time series model to predict the sales volume of this model
[0200] In a preferred embodiment of the present invention, the method for determining the optimal sharing ratio in Step S5 is:
[0201] Method 1: Use the average value of the historical sales volume ratios in the most recent T months as the sharing share;
[0202]
[0203] Wherein, M represents the number of shares;
[0204] i represents the i-th of the number of shares;
[0205] f i represents the share value;
[0206] y i represents the sharing share of the i-th sharing object;
[0207] yi,t represents the sales volume corresponding to the i-th sharing object at t = 1, 2, 3,..., T respectively;
[0208] yt represents the total sales volume of the i-th sharing object in the most recent T months;
[0209] Method 2: Use the weighted average value of the historical sales volume shares in the most recent T months as the sharing share;
[0210]
[0211] Wherein, M represents the number of shares;
[0212] i represents the i-th of the apportionment quantities;
[0213] f i represents the share value;
[0214] T represents the quantity of monthly usage data;
[0215] yi,t represents the sales volume corresponding to the i-th apportionment object at t = 1, 2, 3, …, T respectively;
[0216] yt represents the total sales volume of the i-th apportionment object in the most recent T months;
[0217] a t represents the weight of the share allocation of the i-th apportionment object at t = 1, 2, 3, …, T;
[0218] Method selection: By comparing the mean square error situations, select the method with a smaller MSE.
[0219] In a preferred embodiment of the present invention, y i = y l * f i l+1
[0220] wherein, i represents the i-th apportionment object included in the upper model l;
[0221] y i represents the apportionment prediction value of the i-th apportionment object included in the upper model l;
[0222] y l represents the prediction value of the upper model l;
[0223] f i l+1 represents the apportionment share of the i-th apportionment object included in the upper model l.
[0224] In a preferred embodiment of the present invention, in step S6, the apportionment steps follow:
[0225] Step 1: Aggregate upward the historical sales data of all non-modeling points;
[0226] Step 2: Use the method of claim 3 for the data in the previous step to obtain the predicted sales volume data;
[0227] Step 3: Use the method of claim 8 for the predicted sales volume in the previous step to obtain the apportioned predicted sales volume.
[0228] Although embodiments of the present invention have been shown and described, those of ordinary skill in the art can understand that various changes, modifications, substitutions, and variations can be made to these embodiments without departing from the principles and spirit of the present invention. The scope of the present invention is defined by the claims and their equivalents.
Claims
1. A commodity sales forecasting system based on hierarchical modeling, characterized in that, Including: A module for obtaining historical data of commodity sales, a module for judging access standards, a module for granularity hierarchical aggregation, and a module for predicting commodity quantity. The module for predicting commodity quantity includes a first module for predicting commodity quantity and a second module for predicting commodity quantity. The data output end of the module for obtaining historical data of commodity sales is connected to the data input end of the module for judging access standards. The first data output end of the module for judging access standards is connected to the data input end of the module for granularity hierarchical aggregation. The data output end of the module for granularity hierarchical aggregation is connected to the data input end of the first module for predicting commodity quantity. The second data output end of the module for judging access standards is connected to the data input end of the second module for predicting commodity quantity. The module for obtaining historical data of commodity sales is used to obtain historical data of commodity sales. The module for judging access standards is used to judge whether the obtained historical data of commodity sales meets the access standards according to the historical data of commodity sales obtained by the module for obtaining historical data of commodity sales: If the obtained historical data of commodity sales meets the access standards, it enters the module for granularity hierarchical aggregation. If the obtained historical data of commodity sales does not meet the access standards, it enters the second module for predicting commodity quantity. The module for granularity hierarchical aggregation is used to perform granularity hierarchical aggregation on the historical data of commodity sales from top to bottom to aggregate the historical sales data of each layer. The first module for predicting commodity quantity is used to import the historical sales data of each layer obtained from the module for granularity hierarchical aggregation into the constructed model to obtain the predicted commodity quantity of each level. Among them, the method for selecting the optimal model is: S31. Import the historical data of commodity sales obtained in step S3 into Model 1 to obtain output result data 1. Model 1 is: y t = β0 + β1y t-1 + β2y t-2 + … + β p y t-p + ∈ t + α1ε t-1 + α2ε t-2 + … + α q ε t-q , where y t-1 ~ y t-p represent the p lag terms of the autoregressive model; β1 to β p represent the correlation coefficients of the autoregressive model; p is the order of the autoregressive model. q is the order of the moving average model. ε t-1 ~ε t-q represent q lag terms of the moving average model; α1 to α q represent the correlation coefficients of the moving average model; β0 represents the constant term. ∈ t represents the random error term; S32. Import the historical data of commodity sales obtained in step S3 into Model 2 to obtain output result data 2. Model 2 is: Y t = A0 + A1Y t-1 + A2Y t-2 + A3Y t-3 +…+ A p Y t-p + e t , Among them, Among them, A0 represents an N×1 order constant column vector. A1~A p represents an N×M order parameter matrix; e t denotes an N×1 order random error column vector; Y t-1 ~Y t-p represents an N×1 order time series column vector; S33. Select evaluation indicators. The model with the optimal evaluation indicators is the final model used for prediction. The evaluation indicators include mean absolute error (MAE), mean absolute percentage error (MAPE), mean square error (MSE), root mean square error (RMSE), mean square logarithmic error (MSLE), median absolute error (MedAE), and goodness of fit (R squared). According to the focus, select a single indicator or a combination of multiple indicators for evaluation. The second module for predicting commodity quantity is used to import the historical data of commodity sales into the apportionment share to obtain the predicted commodity quantity. Correct the predicted commodity quantity. The correction methods include Method 1 or / and Method 2. Method 1: Predicted difference Among them, hat represents the predicted value. l represents the number of model layers. M represents the total number of lower-level models included in the upper-level model l. Represents the predicted value of the upper-layer model l; Represents the predicted value of the i-th model contained in the upper-layer model l; Split share Among them, i represents the i-th model. M represents the total number of lower-level models included in the upper-level model l. l represents the number of layers. hat represents the predicted value. Denote the prediction error of the i-th model included in the upper-layer model l; Represents the actual value of the i-th model included in the upper-layer model l; Represents the predicted value of the i-th model included in the upper-layer model l; Correction value Among them, i represents the i-th model. l represents the number of layers. s i Represents the splitting share of the i-th model included in the upper-layer model l; ε hat represents the prediction difference of the models included in the upper-layer model l; Corrected predicted value where y hat,i represents the predicted value of the i-th model included in the upper-layer model l; Denote the correction value of the i-th model included in the upper-layer model l; Method 2: Step 1: Obtain the predicted sales volume of the upper-layer model l at the t-th period Step 2: Obtain the actual sales volume sequence of the previous k periods before the t-th period of the upper-layer model l Step 3: Combine Steps 1 and 2 to obtain the sales volume sequence related to the upper-layer model l Step 4: Use the sequence in Step 3 as a control variable and place it into the i-th lower-layer model included in the upper-layer model l, and use a multivariate time series model to predict the sales volume of this model. The methods for determining the optimal apportionment ratio include Method 1 and Method 2: Method 1: Use the average value of the historical sales proportion in the recent T months as the apportionment share. Among them, M represents the apportionment quantity. i represents the i-th of the apportionment quantity. f i represents a share value; y i represents the sharing ratio of the i-th sharing object; Let \(y_{i,t}\) represent the sales volume corresponding to the \(i\)-th allocation object at times \(t = 1, 2, 3, \cdots, T\). Let \(y_t\) represent the total sales volume of the \(i\)-th allocation object in the most recent \(T\) months. Method 2: Use the weighted average of the historical sales shares in the most recent \(T\) months as the allocation share. Among them, \(M\) represents the number of allocations. \(i\) represents the \(i\)-th of the number of allocations. f i represents a share value; \(T\) represents the number of months of data used. Let \(y_{i,t}\) represent the sales volume corresponding to the \(i\)-th allocation object at times \(t = 1, 2, 3, \cdots, T\). Let \(y_t\) represent the total sales volume of the \(i\)-th allocation object in the most recent \(T\) months. a t Denote the weight of the i-th sharing object for share allocation at moments t = 1, 2, 3, ..., T; Method selection: By comparing the mean squared error, select the method with a smaller MSE.
2. A commodity sales prediction method based on hierarchical modeling, characterized in that It includes the following steps: S1. Obtain the historical sales data of the commodity. S2. According to the historical sales data of the commodity obtained in step S1, judge whether the obtained historical sales data of the commodity meets the access standard: If the obtained historical sales data of the commodity meets the access standard, then proceed to the next step. If the obtained historical sales data of the commodity does not meet the access standard, then execute step S5. S3. Stratify the historical sales data of the commodity from top to bottom in terms of granularity, and aggregate to obtain the historical sales data of each layer. S4. Import the historical sales data of each layer obtained in step S3 into the constructed model to obtain the predicted commodity quantities at each level. The method for selecting the optimal model is: S31. Import the historical sales data of the commodity obtained in step S3 into Model 1 to obtain the output result data 1; Model 1 is: y t = β0 + β1y t-1 + β2y t-2 + … + β p y t-p + ∈ t + α1ε t-1 + α2ε t-2 + … + α q ε t-q , where y t-1 ~ y t-p represent the p lag terms of the autoregressive model; β1 to β p represent the correlation coefficients of the autoregressive model; \(p\) is the order of the autoregressive model. \(q\) is the order of the moving average model. ε t-1 ~ε t-q represent q lag terms of the moving average model; α1 to α q represent the correlation coefficients of the moving average model; \(\beta_0\) represents the constant term. ∈ t represents the random error term; S32. Import the historical sales data of the commodity obtained in step S3 into Model 2 to obtain the output result data 2; Model 2 is: Y t = A0 + A1Y t-1 + A2Y t-2 + A3Y t-3 + … + A p Y t-p + e t , Among them, Among them, \(A_0\) represents an \(N\times1\) order constant column vector. A1 to A p represents an N×M order parameter matrix; e t represents an N×1 order random error column vector; Y t-1 ~Y t-p represents an N×1 order time series column vector; S33. Select the evaluation index, and the model with the optimal evaluation index is the final model used for prediction. The evaluation indexes include the mean absolute error MAE, the mean absolute percentage error MAPE, the mean squared error MSE, the root mean squared error RMSE, the mean squared error logarithm MSLE, the median absolute error MedAE, and the goodness of fit \(R^2\); according to the focus of attention, select a single index or a combination of multiple indexes for evaluation. S5. Import the historical sales data of the commodity into the allocation share to obtain the predicted commodity quantity; correct the predicted commodity quantity, and the correction methods include Method 1 or / and Method 2: Method 1: Predicted difference Among them, \(\hat{}\) represents the predicted value. \(l\) represents the number of model layers. \(M\) represents the total number of lower-level models included in the upper-level model \(l\). Denote the predicted value of the upper-layer model l; Represents the predicted value of the i-th model included in the upper-layer model l; Split share Among them, \(i\) represents the \(i\)-th model. \(M\) represents the total number of lower-level models included in the upper-level model \(l\). \(l\) represents the number of layers. \(\hat{}\) represents the predicted value. Denote the prediction error of the i-th model included in the upper-layer model l; Represents the actual value of the i-th model included in the upper-layer model l; Represents the predicted value of the i-th model included in the upper-layer model l; Correction value Among them, \(i\) represents the \(i\)-th model. \(l\) represents the number of layers. s i Represents the splitting share of the i-th model included in the upper-layer model l; ε hat represents the prediction difference of the models included in the upper-layer model l; Corrected predicted value Among them, y hat,i represents the predicted value of the i-th model included in the upper-layer model l; Represents the correction value of the i-th model included in the upper-layer model l; Method 2: Step 1: Obtain the predicted sales volume of the upper-layer model l at the t-th period Step 2: Obtain the actual sales volume sequence of the upper-layer model l for the k periods before the t-th period Step 3: Combine Steps 1 and 2 to obtain the sales volume sequence related to the upper-layer model l Step 4: Use the sequence in Step 3 as a control variable and place it into the i-th lower-layer model included in the upper-layer model l, and use the multivariate time series model to predict the sales volume of this model The methods for determining the optimal allocation ratio include Method 1 and Method 2: Method 1: Use the average of the historical sales ratios in the most recent \(T\) months as the allocation share. Among them, \(M\) represents the number of allocations. \(i\) represents the \(i\)-th of the number of allocations. f i represents a share value; y i represents the sharing ratio of the i-th sharing object; Let \(y_{i,t}\) represent the sales volume corresponding to the \(i\)-th allocation object at times \(t = 1, 2, 3, \cdots, T\). yt represents the total sales volume of the i-th allocation object in the most recent T months; Method 2: Use the weighted average of the historical sales shares in the most recent T months as the allocation share; where M represents the number of allocations; i represents the i-th of the number of allocations; f i represents a share value; T represents the number of months of data used; yi,t represents the sales volume corresponding to the i-th allocation object at t = 1, 2, 3,..., T respectively; yt represents the total sales volume of the i-th allocation object in the most recent T months; a t Indicates the weight of the share allocation of the i-th sharing object at times t = 1, 2, 3,..., T; Method selection: By comparing the mean square error, select the method with a smaller MSE.
3. The method for predicting commodity sales based on hierarchical modeling according to claim 2, wherein It also includes importing the sales historical data of layer l obtained in step S4 into the apportioned share to obtain the predicted quantity of goods for layer l. n n+1 4. The method for predicting commodity sales based on hierarchical modeling according to claim 2, wherein Judging whether the obtained historical sales data of the commodity in step S2 meets the admission criteria includes one or any combination of the following: Criterion 1: The average monthly sales volume is greater than the set monthly sales volume threshold, or the average quarterly sales volume is greater than the set quarterly sales volume threshold, or the average annual sales volume is greater than the set annual sales volume threshold; Criterion 2: The sales volume is continuous within a recent time period, and the time period is one of year, quarter, and month.
5. The method for predicting commodity sales based on hierarchical modeling according to claim 2, wherein Historical time series {A1, A2, A3, A4, A5, A6, A7, A8,..., Ak-1}, predict the sales volume in the future {Ak} period; The data selection method includes one of the following: Method 1: Directly take the values of Ah,..., Ak-3, Ak-2, Ak-1 continuously from {A1, A2, A3, A4, A5, A6, A7, A8,..., Ak-1}; h takes 1 or 2 or 3 or... k-3; Method 2: Directly take the values of... Ak-3H, Ak-2H, Ak-H at intervals from {A1, A2, A3, A4, A5, A6, A7, A8,..., Ak-1}; H takes 2 or 3 or 4 or...
6. The method for predicting commodity sales based on hierarchical modeling according to claim 2, wherein The final allocation prediction value is: where i represents the i-th allocation object included in the upper-level model l; Represents the sharing prediction value of the i-th sharing object included in the upper-layer model l; y l represents the predicted value of the upper-layer model l; f i l+1 represents the sharing share of the i-th sharing object included in the upper-layer model l.
7. The method for predicting commodity sales based on hierarchical modeling according to claim 2, wherein The allocation steps follow: Step 1: Aggregate the historical sales data of all non-modeling points upward; Step 2: Use the method described in claim 3 for the data in the previous step to obtain the predicted sales volume data; Step 3: Use the method described in claim 6 for the predicted sales volume in the previous step to obtain the allocated predicted sales volume.
Citation Information
Patent Citations
Method for improving the robustness of sales forecasts
CN109034905A