CN117934062A - Cigarette quantity prediction method, device, equipment and storage medium - Google Patents

Cigarette quantity prediction method, device, equipment and storage medium Download PDF

Info

Publication number
CN117934062A
CN117934062A CN202410164856.6A CN202410164856A CN117934062A CN 117934062 A CN117934062 A CN 117934062A CN 202410164856 A CN202410164856 A CN 202410164856A CN 117934062 A CN117934062 A CN 117934062A
Authority
CN
China
Prior art keywords
sequence
component sequence
model
processed
component
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202410164856.6A
Other languages
Chinese (zh)
Inventor
张瑜娟
伍祖权
温戈
黄蕾
韦清
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
China Tobacco Guangdong Industrial Co Ltd
Original Assignee
China Tobacco Guangdong Industrial Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by China Tobacco Guangdong Industrial Co Ltd filed Critical China Tobacco Guangdong Industrial Co Ltd
Priority to CN202410164856.6A priority Critical patent/CN117934062A/en
Publication of CN117934062A publication Critical patent/CN117934062A/en
Pending legal-status Critical Current

Links

Abstract

The invention discloses a cigarette quantity prediction method, a device, equipment and a storage medium. The method comprises the following steps: decomposing sequences to be decomposed comprising the number of cigarettes corresponding to a preset period based on a predetermined X12 seasonal adjustment model to obtain a seasonal component sequence to be processed and a non-seasonal component sequence to be processed; processing the cyclic trend component sequence to be processed based on the prediction model to obtain a predicted component sequence corresponding to the cyclic trend component sequence to be processed; and determining a predicted component sequence corresponding to the second component sequence based on a correspondence between the pre-created component sequence and the component sequence to be used; the predicted cigarette number is determined based on all predicted component sequences and the X12 seasonal adjustment model. The problem of low cigarette quantity prediction accuracy is solved, and the cigarette quantity prediction accuracy is improved.

Description

Cigarette quantity prediction method, device, equipment and storage medium
Technical Field
The invention relates to the technical field of data processing, in particular to a method, a device, equipment and a storage medium for predicting the quantity of cigarettes.
Background
For cigarette industry enterprises, the demand of the cigarette consumer market is accurately predicted, the production plan can be scientifically formulated, the production is efficiently organized, the finished cigarette products are delivered to the market on time, the demands of consumers are met, the stock backlog of the cigarettes can be reduced, the stock cost is reduced, and the fund occupation caused by excessive purchasing of material materials is avoided, so that the demand of the cigarette consumer market is accurately predicted, and the method has a vital role in promoting sustainable and healthy development of enterprise production operation.
In the related technical scheme for predicting the number of cigarettes, the prediction is performed based on the historical demand of the cigarette consumer market, but the fact that the cigarette demand belongs to time series data greatly influenced by seasons and is influenced by a plurality of factors is considered, and the method is a final result of the comprehensive effect of a plurality of complex factors, so that the accuracy of predicting the number of cigarettes is low.
Disclosure of Invention
The invention provides a method, a device, equipment and a storage medium for predicting the number of cigarettes, which are used for improving the accuracy of predicting the number of cigarettes.
According to an aspect of the present invention, there is provided a cigarette number prediction method, the method comprising:
Decomposing sequences to be decomposed comprising the number of cigarettes corresponding to a preset period based on a predetermined X12 seasonal adjustment model to obtain a seasonal component sequence to be processed and a non-seasonal component sequence to be processed; the non-seasonal component sequence to be processed comprises an irregular factor component sequence to be processed and a cyclic trend component sequence to be processed;
Processing the cyclic trend component sequence to be processed based on a prediction model to obtain a prediction component sequence corresponding to the cyclic trend component sequence to be processed, wherein the prediction model comprises an artificial intelligence model and an ARIMA model; and
Determining a predicted component sequence corresponding to a second component sequence based on a corresponding relation between a pre-created component sequence and a component sequence to be used, wherein the second component sequence comprises a seasonal component sequence to be processed and an irregular factor component sequence to be processed;
And determining the predicted cigarette number based on all the predicted component sequences and the X12 seasonal adjustment model.
Further, the X12 seasonal adjustment model comprises an addition model or a multiplication model,
Determining the X12 seasonal adjustment model includes:
carrying out data analysis on the sequence to be decomposed to obtain the seasonal fluctuation degree of the sequence to be decomposed;
determining a degree of correlation between the seasonal variation degree and the sequence to be decomposed, determining whether the degree of correlation exceeds a preset degree of correlation,
Under the condition that the correlation exceeds the preset correlation, determining the X12 seasonal adjustment model as a multiplication model; or alternatively
And under the condition that the correlation exceeds the preset correlation, determining the X12 seasonal adjustment model as an addition model.
Further, determining a correspondence between the component sequence and a component sequence to be used includes:
Determining a historical sequence to be decomposed corresponding to the sequence to be decomposed, and decomposing the historical sequence to be decomposed to obtain a historical component sequence comprising a historical seasonal component sequence and a historical irregular factor component sequence;
determining the seasonal component sequence to be processed based on the historical seasonal component sequence; and
And determining the irregular factor component sequence to be processed based on the historical irregular factor component sequence.
Further, the determining the seasonal component sequence to be processed based on the historical seasonal component sequence includes:
For the seasonal component data corresponding to the first moment in the preset period in the seasonal component sequence to be processed, determining the historical seasonal component data corresponding to the first moment in the historical period in the historical seasonal component sequence;
and updating the seasonal component data based on the historical seasonal component data to obtain the seasonal component sequence to be processed.
Further, the method further comprises:
decomposing the cyclic trend component sequence to be processed based on an HP filtering algorithm to obtain a cyclic component sequence to be processed and a trend component sequence to be processed;
Correspondingly, the processing the to-be-processed cyclic trend component sequence based on the prediction model to obtain a predicted component sequence corresponding to the to-be-processed cyclic trend component sequence, which comprises
Processing the trend component sequence to be processed based on an ARIMA model to obtain a predicted component sequence corresponding to the trend component sequence to be processed; and
And processing the cyclic component sequence to be processed based on an artificial intelligent model to obtain a predicted component sequence corresponding to the cyclic component sequence to be processed.
Further, the artificial intelligence model includes XGBoost model and LSTM model, the method further includes:
obtaining a plurality of sample data, wherein the sample data comprises a sample sequence corresponding to the number of historical cigarettes and an actual sequence corresponding to the actual number of cigarettes in a corresponding prediction duration,
Respectively decomposing the sample sequence and the actual sequence based on the X12 season adjustment model to obtain a sample component sequence corresponding to the sample sequence and an actual component sequence corresponding to the actual sequence; the component sequences comprise a seasonal component sequence, an irregular factor component sequence, a cyclic component sequence and a trend component sequence;
Training the ARIMA model, the XGBoost model and the LSTM model based on the sample component sequence to obtain a predicted component sequence corresponding to the sample component sequence;
Model parameters of the ARIMA model, the XGBoost model and the LSTM model are modified based on the predicted component sequence and the actual component sequence.
Further, the method further comprises:
And respectively determining the prediction errors of the XGBoost model and the LSTM model to screen the XGBoost model and the LSTM model based on the prediction errors so as to obtain an artificial intelligent model.
According to another aspect of the present invention, there is provided a cigarette number prediction apparatus comprising:
The season adjustment module is used for decomposing the sequences to be decomposed comprising the number of cigarettes corresponding to a preset period based on a predetermined X12 season adjustment model to obtain a sequence of seasonal components to be processed and a sequence of non-seasonal components to be processed; the non-seasonal component sequence to be processed comprises an irregular factor component sequence to be processed and a cyclic trend component sequence to be processed;
The first prediction module is used for processing the cyclic trend component sequence to be processed based on a prediction model to obtain a prediction component sequence corresponding to the cyclic trend component sequence to be processed, wherein the prediction model comprises an artificial intelligence model and an ARIMA model; and
The second prediction module is used for determining a predicted component sequence corresponding to a second component sequence based on a corresponding relation between a pre-created component sequence and a component sequence to be used, wherein the second component sequence comprises a seasonal component sequence to be processed and an irregular factor component sequence to be processed;
And the quantity determining module is used for determining the quantity of the predicted cigarettes based on all the predicted component sequences and the X12 season adjustment model.
According to another aspect of the present invention, there is provided an electronic device including:
At least one processor; and
A memory communicatively coupled to the at least one processor; wherein,
The memory stores a computer program executable by the at least one processor to enable the at least one processor to perform the cigarette number prediction method of any one of the embodiments of the present invention.
According to another aspect of the present invention, there is provided a computer readable storage medium storing computer instructions for causing a processor to execute a cigarette number prediction method according to any one of the embodiments of the present invention.
According to the technical scheme, a to-be-decomposed sequence comprising the number of cigarettes corresponding to a preset period is decomposed based on a predetermined X12 seasonal adjustment model to obtain a to-be-processed seasonal component sequence and a to-be-processed non-seasonal component sequence; the non-seasonal component sequence to be processed comprises an irregular factor component sequence to be processed and a cyclic trend component sequence to be processed; processing the cyclic trend component sequence to be processed based on a prediction model to obtain a prediction component sequence corresponding to the cyclic trend component sequence to be processed, wherein the prediction model comprises an artificial intelligence model and an ARIMA model; and determining a predicted component sequence corresponding to a second component sequence based on a corresponding relation between the pre-created component sequence and the component sequence to be used, wherein the second component sequence comprises a seasonal component sequence to be processed and an irregular factor component sequence to be processed; and determining the predicted cigarette number based on all the predicted component sequences and the X12 seasonal adjustment model. The problem of low cigarette quantity prediction accuracy is solved, and the cigarette quantity prediction accuracy is improved.
It should be understood that the description in this section is not intended to identify key or critical features of the embodiments of the invention or to delineate the scope of the invention. Other features of the present invention will become apparent from the description that follows.
Drawings
In order to more clearly illustrate the technical solutions of the embodiments of the present invention, the drawings required for the description of the embodiments will be briefly described below, and it is apparent that the drawings in the following description are only some embodiments of the present invention, and other drawings may be obtained according to these drawings without inventive effort for a person skilled in the art.
FIG. 1 is a flow chart of a method for predicting the number of cigarettes provided according to an embodiment of the invention;
FIG. 2 is a flow chart of another cigarette quantity prediction method provided in accordance with an embodiment of the present invention;
FIG. 3 is a flowchart of a specific cigarette quantity prediction method provided in accordance with an embodiment of the present invention;
FIG. 4 is a schematic diagram of a specific component sequence provided in accordance with an embodiment of the present invention;
Fig. 5 is a block diagram of a cigarette quantity predicting device according to an embodiment of the present invention;
fig. 6 is a block diagram of an electronic device according to an embodiment of the present invention.
Detailed Description
In order that those skilled in the art will better understand the present invention, a technical solution in the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings in which it is apparent that the described embodiments are only some embodiments of the present invention, not all embodiments. All other embodiments, which can be made by those skilled in the art based on the embodiments of the present invention without making any inventive effort, shall fall within the scope of the present invention.
It should be noted that the terms "first" and "second" and the like in the description and the claims of the present invention and the above drawings are used for distinguishing between similar objects and not necessarily for describing a particular sequential or chronological order. It is to be understood that the data so used may be interchanged where appropriate such that the embodiments of the invention described herein may be implemented in sequences other than those illustrated or otherwise described herein. Furthermore, the terms "comprises," "comprising," and "having," and any variations thereof, are intended to cover a non-exclusive inclusion, such that a process, method, system, article, or apparatus that comprises a list of steps or elements is not necessarily limited to those steps or elements expressly listed but may include other steps or elements not expressly listed or inherent to such process, method, article, or apparatus.
Fig. 1 is a flowchart of a method for predicting the number of cigarettes according to an embodiment of the present invention, where the embodiment may be applicable to a scenario in which the number of cigarettes is predicted, and may be executed by a cigarette number predicting device, where the cigarette number predicting device may be implemented in a form of hardware and/or software and configured in a processor of an electronic device.
As shown in fig. 1, the cigarette number prediction method includes the following steps:
S110, decomposing a sequence to be decomposed comprising the number of cigarettes corresponding to a preset period based on a predetermined X12 seasonal adjustment model to obtain a sequence of seasonal components to be processed and a sequence of non-seasonal components to be processed, wherein the sequence of non-seasonal components to be processed comprises a sequence of irregular factor components to be processed and a sequence of cyclic trend components to be processed.
The X12 seasonal adjustment model is used for decomposing time series data into a seasonal factor sequence, a random factor sequence and a long-term-influence cyclic trend factor sequence, and further, the cyclic trend factor sequence can be decomposed into a cyclic factor sequence and a trend factor sequence, wherein the trend factor reflects the long-term evolution direction of the economic phenomenon, whether the economic phenomenon rises, is leveled or falls; the cyclic factor (periodic factor) is used to reflect the periodic fluctuation of the time series persistence, for example, in the rising phase, falling phase or turning phase of the period, and the trend factor and the cyclic factor can be analyzed together without distinction; the seasonal factors are used for reflecting the periodic changes exhibited by the time series in the same season (the same quarter or the same month) of different years; the irregular factors are used to reflect errors that cannot be explained by the first three factors or changes caused by random factors, for example, the irregular factors may include unstable decisions of economic activity participants, errors of data programs or samples, and abnormal events, for example, abnormal time may include the influence of natural disasters and the like on the number of cigarettes.
Alternatively, the X12 seasonal adjustment model may include an addition model, a multiplication model, a logarithmic addition model, and a pseudo-addition model. In the addition model, the original sequence to be decomposed is formed by adding four factor component sequences, each factor is expressed by absolute quantity, the intuitiveness is good as the measurement unit of the original sequence, but the comparability among different factor variables is lacking, so that the addition model is suitable for the situation that trend factors, circulation factors and seasonal factors are mutually independent. In the multiplication model, the original sequence to be decomposed is formed by multiplying four factor component sequences, the trend factor is absolute quantity, the other factors are relative quantity, and comparability among different factor variables is enhanced, so that the multiplication model is suitable for the situation that the trend factor, the circulation factor and the seasonal factor are related. Since four major elements of time series decomposition generally have interactions, in most application scenarios, a multiplication model is used to adjust seasons.
In this embodiment, the X12 seasonal adjustment model includes an addition model or a multiplication model, and correspondingly, the X12 seasonal adjustment model is determined based on the seasonal fluctuation range of the sequence to be decomposed, for example, the seasonal fluctuation range of the sequence to be decomposed is independent of the magnitude of the original numerical value in the sequence to be decomposed, and the addition model may be selected; the degree of seasonal fluctuations in the sequence to be decomposed is related to (e.g., proportional to) the change in the original values in the sequence to be decomposed, and a multiplication model may be selected.
In a specific embodiment, determining the X12 seasonal adjustment model includes: carrying out data analysis on the sequence to be decomposed to obtain the seasonal fluctuation degree of the sequence to be decomposed; determining the correlation degree between the seasonal fluctuation degree and the sequence to be decomposed, determining whether the correlation degree exceeds a preset correlation degree, and determining the X12 seasonal adjustment model as a multiplication model under the condition that the correlation degree exceeds the preset correlation degree; or under the condition that the correlation exceeds the preset correlation, determining the X12 seasonal adjustment model as an addition model.
The season fluctuation degree can be determined by one or more statistical indexes, for example, the statistical indexes can comprise variance, standard deviation, deviation degree and the like.
Optionally, performing data analysis on the sequence to be decomposed to obtain a seasonal fluctuation degree of the sequence to be decomposed, including: and carrying out statistical analysis on the sequence to be decomposed to obtain one or more statistical indexes corresponding to the sequence to be decomposed, and taking the one or more statistical indexes as the seasonal fluctuation degree.
The correlation degree can be determined based on a correlation coefficient, and correspondingly, the method for determining the correlation degree between the seasonal fluctuation degree and the sequence to be decomposed comprises the following steps: and determining the correlation degree between the seasonal fluctuation degree and the sequence to be decomposed.
Alternatively, the X12 seasonal adjustment model may also be a hybrid model of additive multiplication, e.g., y=t×c×s+i or y=t+c×s×i, where Y represents the sequence to be decomposed, T represents the sequence of trend factor components, C represents the sequence of cyclic factor components, S represents the sequence of seasonal factor components, and I represents the sequence of irregular factor components.
Wherein the non-seasonal component sequence to be processed comprises a time sequence after the X12 seasonal adjustment model, for example, the non-seasonal component sequence to be processed may be a composite sequence of trend cyclic factors and irregular factors.
Alternatively, the preset period may be one or more times before the time period in which prediction is required, for example, if the number of cigarettes in the year is to be predicted, the sequence to be decomposed may be a time sequence composed of the number of cigarettes in the year, and each data in the sequence to be decomposed may be a time sequence of sales of cigarettes in the month in the year.
Alternatively, the sequence to be decomposed may be seasonally adjusted using related software, which is not specifically limited in this embodiment.
Specifically, based on a predetermined X12 seasonal adjustment model, carrying out seasonal adjustment on a sequence to be decomposed to obtain a seasonal component sequence to be processed corresponding to a seasonal factor and a non-seasonal component sequence to be processed after seasonal adjustment, wherein the non-seasonal component sequence to be processed after seasonal adjustment comprises an irregular factor component sequence to be processed corresponding to an irregular factor and a cyclic trend component sequence to be processed corresponding to a trend factor and a cyclic factor.
S120, processing the cyclic trend component sequence to be processed based on the prediction model to obtain a prediction component sequence corresponding to the cyclic trend component sequence to be processed.
It will be appreciated that the ARIMA model is typically used to analyze time series, and that the artificial intelligence model has a prediction function, so that the present embodiment predicts a cyclic trend component sequence to be processed based on the artificial intelligence model and the autoregressive moving average model.
The predictive models include artificial intelligence models and autoregressive moving average (ARIMA) models.
The artificial intelligence model may be a deep learning model or a machine learning model, for example, the artificial intelligence model may be a neural network model or a decision tree model.
It will be appreciated that training of the artificial intelligence model is required prior to processing the cyclic trend component sequence to be processed based on the artificial intelligence model.
In this embodiment, the artificial intelligence model includes XGBoost model and LSTM model, and correspondingly, training the artificial intelligence model includes: acquiring a plurality of sample data, wherein the sample data comprises a sample sequence corresponding to the number of historical cigarettes and an actual sequence corresponding to the number of actual cigarettes in corresponding prediction time, and respectively decomposing the sample sequence and the actual sequence based on the X12 season adjustment model to obtain a sample component sequence corresponding to the sample sequence and an actual component sequence corresponding to the actual sequence; the component sequences comprise a seasonal component sequence, an irregular factor component sequence, a cyclic component sequence and a trend component sequence; training the ARIMA model, the XGBoost model and the LSTM model based on the sample component sequence to obtain a predicted component sequence corresponding to the sample component sequence; model parameters of the ARIMA model, the XGBoost model and the LSTM model are modified based on the predicted component sequence and the actual component sequence.
The XGBoost model is an implementation based on a gradient hoist (Gradient Boosting Machines, GBMs), XGBoost has high precision, flexibility, overfitting prevention, missing value processing and good parallelization characteristics, and can be used for carrying out parallel computation by utilizing multithreading on a CPU, so that the computation efficiency and the computation precision are remarkably improved. The long-short time memory (Long Short Term Memory, LSTM) model is an improved cyclic neural network (Recurrent Neural Network, RNN), can solve the problem that the RNN cannot handle long-distance dependence, and has wide application in the time sequence prediction problem.
The actual sequence is the cigarette number data corresponding to the set period where the first moment is located, the sample sequence corresponding to the historical cigarette number is the cigarette number data corresponding to the set period before the actual sequence, for example, the actual sequence may be the actual cigarette number data of the year corresponding to the first moment, and the sample sequence is the cigarette number data of at least one year before the year corresponding to the first moment.
Optionally, based on the X12 seasonal adjustment model, the sample sequence and the actual sequence are decomposed respectively to obtain a sample component sequence corresponding to the sample sequence and an actual component sequence corresponding to the actual sequence, which includes: decomposing the sample sequence based on a predetermined X12 seasonal adjustment model to obtain a seasonal component sequence, an irregular factor component sequence, a cyclic component sequence and a trend component sequence which correspond to the sample sequence; and decomposing the actual sequence based on a predetermined X12 seasonal adjustment model to obtain a seasonal component sequence, an irregular factor component sequence, a cyclic component sequence and a trend component sequence corresponding to the actual sequence.
The predicted component sequence comprises a predicted seasonal component sequence, a predicted irregular factor component sequence, a predicted cyclic component sequence and a predicted trend component sequence, and correspondingly, training an ARIMA model, a XGBoost model and an LSTM model based on the sample component sequence to obtain the predicted component sequence corresponding to the sample component sequence comprises the following steps: for each component sequence in the sample component sequences, the component sequences are respectively input into an ARIMA model, a XGBoost model and an LSTM model to obtain a first predicted component sequence corresponding to the component sequence output by the ARIMA model, a second predicted component sequence corresponding to the component sequence output by the XGBoost model and a third predicted component sequence corresponding to the component sequence output by the LSTM model, and the first predicted component sequence, the second predicted component sequence and the third predicted component sequence are used as predicted component sequences.
In this embodiment, training the ARIMA model based on the trend component sequence, and training the XGBoost model and the LSTM model based on the cyclic component sequence, and correspondingly training the ARIMA model, XGBoost model and the LSTM model based on the sample component sequence, to obtain the predicted component sequence corresponding to the sample component sequence includes: for each trend component sequence in the sample component sequences, inputting the trend component sequence into an ARIMA model to obtain a predicted trend component sequence corresponding to the trend component sequence output by the ARIMA model; for each cyclic component sequence in the sample component sequence, the cyclic component sequence is input to a XGBoost model and an LSTM model respectively to obtain a first predicted cyclic component sequence corresponding to the cyclic component sequence output by the XGBoost model and a second predicted cyclic component sequence corresponding to the cyclic component sequence output by the LSTM model.
Optionally, modifying model parameters based on a deviation degree of a combined sequence and an actual sequence of the predicted component sequence, and correspondingly modifying model parameters of the ARIMA model, the XGBoost model and the LSTM model based on the predicted component sequence and the actual component sequence, including: determining a combined sequence corresponding to the component sequences based on a predetermined X12 seasonal adjustment model, a predicted trend component sequence, a first predicted cyclic component sequence, a second predicted cyclic component sequence and a predicted seasonal component sequence, and taking the combined sequence as a predicted component sequence; the degree of deviation between the predicted and actual component sequences is determined to modify model parameters of the XGBoost model based on the degree of deviation such that the degree of deviation is reduced.
Optionally, the correction of the model parameters based on the deviation degree of the predicted component sequence and the actual component sequence, and correspondingly, the correction of the model parameters of the ARIMA model, the XGBoost model and the LSTM model based on the predicted component sequence and the actual component sequence, includes: correcting model parameters of an ARIMA model based on the degree of deviation between a first predicted component sequence in the predicted component sequences and a first actual component sequence corresponding to the same factor as the first predicted component in the actual component sequences so as to reduce the degree of deviation; based on a second predicted component sequence in the predicted component sequences and the degree of deviation between a second actual component sequence in the actual component sequences corresponding to the same factor as the second predicted component; correcting model parameters of XGBoost models based on the degree of deviation so as to reduce the degree of deviation; and correcting model parameters of the XGBoost model based on the degree of deviation between a third predicted component sequence in the predicted component sequences and a third actual component sequence corresponding to the same factor as the third predicted component in the actual component sequences so as to reduce the degree of deviation.
Optionally, determining a loss value based on the predicted component sequence, the actual component sequence, and a preset loss function; modifying model parameters of the ARIMA model, the XGBoost model and the LSTM model based on the loss value so as to reduce the loss value; when the loss function converges, training is stopped, and an ARIMA model, a XGBoost model and an LSTM model are obtained.
It can be appreciated that due to the complex structure of the artificial intelligence model, the prediction time based on the artificial intelligence model may be longer than the prediction time of the numerical model, so that the artificial intelligence model can be screened based on the model accuracy to predict based on the model with higher accuracy.
In this embodiment, based on the model accuracy, the screening of the trained artificial intelligence model includes: and respectively determining the prediction errors of the XGBoost model and the LSTM model to screen the XGBoost model and the LSTM model based on the prediction errors so as to obtain the artificial intelligent model.
Optionally, the prediction error is determined based on a model prediction accuracy, and correspondingly, the prediction errors of the XGBoost model and the LSTM model are respectively determined, so as to screen the XGBoost model and the LSTM model based on the prediction errors, and obtaining the artificial intelligence model includes: and respectively determining the prediction accuracy of the XGBoost model and the LSTM model, and reserving the model with high prediction accuracy (or small error) as a final artificial intelligent model.
S130, determining a predicted component sequence corresponding to the second component sequence based on the corresponding relation between the pre-created component sequence and the component sequence to be used.
It will be appreciated that, on the one hand, a predicted sequence corresponding to a seasonal component sequence to be processed may be determined based on a historical seasonal component sequence, taking into account that the seasonal factor is related to the seasonal variation; on the other hand, the irregular component has no specific change rule, so the method is not suitable for model prediction, and a prediction sequence corresponding to the irregular factor component sequence to be processed can be determined based on the historical irregular component sequence.
The second component sequence comprises a seasonal component sequence to be processed and an irregular factor component sequence to be processed, and the corresponding relation between the component sequence and the component sequence to be used comprises a corresponding relation between the seasonal component sequence and the seasonal component sequence to be used and a corresponding relation between the irregular factor component sequence and the irregular factor component sequence to be used.
In this embodiment, determining the predicted component sequence corresponding to the second component sequence based on the correspondence between the pre-created component sequence and the component sequence to be used includes: determining a seasonal component sequence to be used corresponding to the seasonal component sequence to be processed based on the correspondence between the seasonal component sequence and the seasonal component sequence to be used; meanwhile, determining an irregular factor component sequence to be used corresponding to the irregular factor component sequence to be processed based on the corresponding relation between the irregular factor component sequence and the irregular factor component sequence to be used; and taking the seasonal component sequence to be used as a predicted seasonal component sequence, and taking the irregular factor component sequence to be used as a predicted irregular factor component sequence to obtain a predicted component sequence corresponding to the second component sequence.
In this embodiment, determining a correspondence between a component sequence and a component sequence to be used includes: determining a historical sequence to be decomposed corresponding to the sequence to be decomposed, and decomposing the historical sequence to be decomposed to obtain a historical component sequence comprising a historical seasonal component sequence and a historical irregular factor component sequence; determining a seasonal component sequence to be processed based on the historical seasonal component sequence; and determining a sequence of irregular factor components to be processed based on the historical sequence of irregular factor components.
The historical to-be-decomposed sequence may be a sequence of the number of cigarettes corresponding to one or more cycles preceding the preset cycle. Correspondingly, determining a historical to-be-decomposed sequence corresponding to the to-be-decomposed sequence, decomposing the historical to-be-decomposed sequence to obtain a historical component sequence comprising a historical seasonal component sequence and a historical irregular factor component sequence comprises: determining at least one period before a preset period, and taking the at least one sequence corresponding to the number of the historical cigarettes as a historical sequence to be decomposed; decomposing the historical sequence to be decomposed based on a predetermined X12 seasonal adjustment model to obtain component sequences corresponding to seasonal factors, irregular factors and trend circulation factors respectively; the component sequence corresponding to the seasonal factor is taken as a historical seasonal component sequence, and the component sequence corresponding to the irregular factor is taken as a historical irregular factor component sequence.
In this embodiment, determining the seasonal component sequence to be processed based on the historical seasonal component sequence includes: for the seasonal component data corresponding to the first moment in the preset period in the seasonal component sequence to be processed, determining historical seasonal component data corresponding to the first moment in the historical period in the historical seasonal component sequence; and updating the seasonal component data based on the historical seasonal component data to obtain a seasonal component sequence to be processed.
The duration of the preset period and the duration of the history period are the same, for example, the preset period and the history period are one year, and the history period may be the previous year of the preset period.
Correspondingly, determining the seasonal component sequence to be processed based on the historical seasonal component sequence comprises: comprising the following steps: and regarding the data of each first moment in the historical seasonal component sequence, taking the data of the first moment as the data of the same period in the seasonal component sequence to be processed so as to obtain the seasonal component sequence to be processed.
Optionally, determining the seasonal component sequence to be processed based on the statistical index of the historical seasonal component sequence, and correspondingly determining the irregular factor component sequence to be processed based on the historical irregular factor component sequence includes: for each period of data in the historical irregular component sequence, a statistical indicator (e.g., average, median, or mode) of all period of data is determined, and data for the same period in the irregular component sequence is determined based on the statistical indicator to obtain the irregular component sequence to be processed.
It should be noted that S120 and S130 may be performed simultaneously.
And S140, determining the number of the predicted cigarettes based on all the predicted component sequences and the X12 seasonal adjustment model.
It will be appreciated that the X12 seasonal adjustment model includes a relationship between the component sequence and the total sequence for each factor. Therefore, in the present embodiment, the predicted cigarette number is determined based on all the predicted component sequences and the X12 season adjustment model.
Optionally, the X12 seasonal adjustment model is an additive model, and correspondingly, determining the predicted cigarette number based on all predicted component sequences and the X12 seasonal adjustment model includes: and carrying out summation processing on all the predicted component sequences to obtain a predicted total sequence, and determining the number of predicted cigarettes in a period corresponding to each data element in the predicted total sequence.
According to the technical scheme, the artificial intelligent model is screened based on the model prediction accuracy, the prediction accuracy of the component sequence is improved, and the number accuracy of predicted cigarettes is further improved.
Fig. 2 is a flowchart of another method for predicting the number of cigarettes according to an embodiment of the present invention, where the present embodiment is applicable to a scenario in which the number of cigarettes is predicted, and the method for predicting the number of cigarettes in the present embodiment and the method for predicting the number of cigarettes in the foregoing embodiment belong to the same inventive concept, and on the basis of the foregoing embodiment, a process of decomposing a cyclic trend component sequence to be processed based on an HP filtering algorithm to obtain a cyclic component sequence to be processed and a trend component sequence to be processed is added.
As shown in fig. 2, the method for predicting the number of cigarettes comprises the following steps:
S210, decomposing a sequence to be decomposed comprising the number of cigarettes corresponding to a preset period based on a predetermined X12 seasonal adjustment model to obtain a sequence of seasonal components to be processed and a sequence of non-seasonal components to be processed, wherein the sequence of non-seasonal components to be processed comprises a sequence of irregular factor components to be processed and a sequence of cyclic trend components to be processed.
S220, decomposing the cyclic trend component sequence to be processed based on the HP filtering algorithm to obtain the cyclic component sequence to be processed and the trend component sequence to be processed, and determining a predicted component sequence corresponding to the second component sequence based on the corresponding relation between the pre-established component sequence and the component sequence to be used.
The HP filtering algorithm is an analysis method of a time series in a state space, and is used for decomposing time series data into a trend component and a cyclic period component, wherein the trend component corresponds to a long-term change trend in the time series data, and the cyclic period component corresponds to a short-term fluctuation in the time series data.
In this embodiment, decomposing the cyclic trend component sequence to be processed based on the HP filtering algorithm to obtain the cyclic component sequence to be processed and the trend component sequence to be processed includes: for a cyclic trend component sequence to be processed, the HP filtering algorithm can decompose the cyclic trend component sequence to be processed into a trend component sequence and a cyclic component sequence, wherein the trend component sequence is a solution of a target minimization problem; the trend component sequence is used as a trend component sequence to be processed, and the circulating component sequence is used as a circulating component sequence to be processed.
In this embodiment, the specific implementation of the HP filtering algorithm is not specifically limited, as long as the cyclic trend component sequence to be processed can be decomposed into a trend component sequence and a cyclic component sequence.
S230, processing the trend component sequence to be processed based on the ARIMA model to obtain a predicted component sequence corresponding to the trend component sequence to be processed.
Specifically, the trend component sequence to be processed is input into an ARIMA model trained in advance, and a predicted component sequence corresponding to the trend component sequence to be processed is obtained.
S240, processing the cyclic component sequence to be processed based on the artificial intelligent model to obtain a predicted component sequence corresponding to the cyclic component sequence to be processed.
In this embodiment, processing a cyclic component sequence to be processed based on a pre-trained artificial intelligence model to obtain a predicted component sequence corresponding to the cyclic component sequence to be processed includes: inputting the cyclic component sequence to be processed into a pre-trained artificial intelligent model to obtain a predicted component sequence corresponding to the cyclic component sequence to be processed.
It is understood that S230 and S240 may be performed simultaneously.
S250, determining the number of predicted cigarettes based on all predicted component sequences and the X12 seasonal adjustment model.
And carrying out summation processing on the predicted cyclic component sequence and the predicted trend component sequence to obtain the predicted cyclic trend component sequence so as to determine the number of predicted cigarettes based on the relation among the predicted component sequences in the seasonal adjustment model.
According to the technical scheme, the cyclic trend component sequence to be processed is decomposed based on HP filtering, so that the cyclic component sequence to be processed and the trend component sequence to be processed are obtained, trend factor components of the sequence can be better fitted, accuracy of the predicted component sequence is improved, and accuracy of predicting the number of cigarettes is further improved.
Fig. 3 is a flowchart of a specific cigarette number prediction method according to an embodiment of the present invention, and as shown in fig. 3, the cigarette number prediction method includes:
s310, decomposing a sequence to be decomposed comprising the number of cigarettes corresponding to a preset period based on a predetermined X12 seasonal adjustment model to obtain a sequence of seasonal components to be processed and a sequence of non-seasonal components to be processed, wherein the sequence of non-seasonal components to be processed comprises a sequence of irregular factor components to be processed and a sequence of cyclic trend components to be processed.
For example, the to-be-decomposed sequence (Y) of the number of cigarettes corresponding to the preset period is adjusted by using an X12 seasonal adjustment multiplication model to obtain a to-be-processed seasonal component sequence (Y Sf) and a to-be-processed non-seasonal component sequence (Y Sa), wherein the to-be-processed non-seasonal component sequence (Y S) includes a to-be-processed irregular factor component sequence (Y IR) and a to-be-processed cyclic trend component sequence (Y TC),Y=YSf×YSa,YSa=YTC×YIR).
S320, decomposing the cyclic trend component sequence to be processed based on the HP filtering algorithm to obtain the cyclic component sequence to be processed and the trend component sequence to be processed.
Illustratively, the cyclic trend component sequence to be processed (Y TC) is decomposed to obtain a cyclic component sequence to be processed (Y C) and a trend component sequence to be processed (Y T).
Further, referring to fig. 4, parameters (λ=14400) of the HP filtering algorithm are set, curves corresponding to the cyclic trend component sequence to be processed (Y TC), the cyclic component sequence to be processed (Y C) and the trend component sequence to be processed (Y T) are generated based on the HP filtering algorithm, and the curves are displayed in the same graph.
Optionally, curves corresponding to the seasonal component sequence to be processed (Y Sf), the trend component sequence to be processed (Y T), the cyclic component sequence to be processed (Y C) and the irregular component sequence to be processed (Y IR) are generated respectively, and the curves are displayed in the same graph.
S330, processing the trend component sequence to be processed based on the ARIMA model to obtain a predicted component sequence corresponding to the trend component sequence to be processed, and processing the cyclic component sequence to be processed based on the artificial intelligence model to obtain a predicted component sequence corresponding to the cyclic component sequence to be processed.
Predicting the trend component sequence (Y T) to be processed based on the ARIMA model to obtain a predicted component sequence corresponding to the trend component sequence (Y T) to be processedPredicting the cyclic component sequence (Y C) to be processed based on XGBoost model to obtain a predicted component sequence/>, corresponding to the cyclic component sequence (Y C) to be processedOr predicting the cyclic component sequence (Y C) to be processed based on the LSTM model to obtain a predicted component sequence/>, which corresponds to the cyclic component sequence (Y C) to be processed
In this embodiment, the artificial intelligence model includes XGBoost model and LSTM model, and model parameters of each prediction model are shown in table 1.
TABLE 1
S340, determining a predicted component sequence corresponding to a second component sequence based on a corresponding relation between the pre-created component sequence and the component sequence to be used, wherein the second component sequence comprises a seasonal component sequence to be processed and an irregular factor component sequence to be processed.
For the seasonal component data corresponding to each month in the current year in the seasonal component sequence (Y Sf) to be processed, determining the seasonal component data corresponding to the same month in the historical year in the historical seasonal component sequence; the historical seasonal component data is used as a predicted seasonal component sequence corresponding to the seasonal component sequence (Y Sf) to be processed
Determining the irregular component data corresponding to each month in the historical year in the historical irregular component sequence, obtaining the average value of the irregular component data corresponding to each month in the historical year, and taking the average value as the predicted irregular component sequence corresponding to the seasonal component sequence (Y IR) to be processed
It is understood that S320 and S340 may be performed simultaneously.
S350, determining the number of predicted cigarettes based on all predicted component sequences and the X12 seasonal adjustment model.
Based onCalculating each predicted component to obtain a predicted sequence/>, which corresponds to the sequence to be decomposedThe predicted sequence may include the sales of cigarettes for each of the years for which the predicted sequence is made, or may include the sales of cigarettes for each of the other time periods for which the predicted sequence is made.
Exemplary, referring to Table 2, during training, a predicted sequence is determined based on a predicted sequence of cigarette sales and a true sequence for each of the time periods (1 to 12 time periods) in which the predicted sequence is locatedAnd the true sequence.
TABLE 2
Referring to Table 3, a predicted sequence is determined based on the predicted sequence and the true sequenceAverage absolute percent error (mean absolute percent error, MAPE), average absolute error (mean absolute error, MAE) and Root Mean Square Error (RMSE) from the true sequence.
TABLE 3 Table 3
In summary, according to the technical scheme of the embodiment, prediction is performed based on the sequence subjected to the adjustment of the X12 season and the decomposition of the HP filter, and the prediction accuracy is very high regardless of the conventional ARIMA model or the artificial intelligence model, so that a reference can be provided for accurately grasping the long-term trend.
According to the technical scheme, the sequence subjected to X12 season adjustment and HP filtering decomposition is predicted, the trend factor component of the sequence can be better fitted, the accuracy of the model predicted component sequence is improved, and the accuracy of the number of predicted cigarettes is further improved.
Fig. 5 is a block diagram of a cigarette number predicting device according to an embodiment of the present invention, where the embodiment may be suitable for a scenario of predicting the number of cigarettes, and the device may be implemented in a form of hardware and/or software, and integrated into a processor of an electronic device with an application development function.
As shown in fig. 5, the cigarette number prediction apparatus includes: the season adjustment module 501 is configured to decompose a sequence to be decomposed including the number of cigarettes corresponding to a preset period based on a predetermined X12 season adjustment model, to obtain a sequence of seasonal components to be processed and a sequence of non-seasonal components to be processed; the non-seasonal component sequence to be processed comprises an irregular factor component sequence to be processed and a cyclic trend component sequence to be processed; the first prediction module 502 is configured to process the cyclic trend component sequence to be processed based on a prediction model, so as to obtain a predicted component sequence corresponding to the cyclic trend component sequence to be processed, where the prediction model includes an artificial intelligence model and an ARIMA model; and a second prediction module 503, configured to determine a predicted component sequence corresponding to a second component sequence based on a correspondence between a pre-created component sequence and a component sequence to be used, where the second component sequence includes a seasonal component sequence to be processed and an irregular factor component sequence to be processed; a quantity determination module 504 for determining a predicted cigarette quantity based on all predicted component sequences and the X12 seasonal adjustment model. The problem of low cigarette quantity prediction accuracy is solved, and the cigarette quantity prediction accuracy is improved.
Optionally, the apparatus further comprises a seasonal model determination module for:
carrying out data analysis on the sequence to be decomposed to obtain the seasonal fluctuation degree of the sequence to be decomposed;
determining a degree of correlation between the seasonal variation degree and the sequence to be decomposed, determining whether the degree of correlation exceeds a preset degree of correlation,
Under the condition that the correlation exceeds the preset correlation, determining the X12 seasonal adjustment model as a multiplication model; or alternatively
And under the condition that the correlation exceeds the preset correlation, determining the X12 seasonal adjustment model as an addition model.
Optionally, the device further includes a correspondence determining module, where the correspondence determining module is configured to:
Determining a historical sequence to be decomposed corresponding to the sequence to be decomposed, and decomposing the historical sequence to be decomposed to obtain a historical component sequence comprising a historical seasonal component sequence and a historical irregular factor component sequence;
determining the seasonal component sequence to be processed based on the historical seasonal component sequence; and
And determining the irregular factor component sequence to be processed based on the historical irregular factor component sequence.
Optionally, the correspondence determination module includes a seasonal component determination unit for:
For the seasonal component data corresponding to the first moment in the preset period in the seasonal component sequence to be processed, determining the historical seasonal component data corresponding to the first moment in the historical period in the historical seasonal component sequence;
and updating the seasonal component data based on the historical seasonal component data to obtain the seasonal component sequence to be processed.
Optionally, the apparatus further comprises a cyclic trend component module for:
decomposing the cyclic trend component sequence to be processed based on an HP filtering algorithm to obtain a cyclic component sequence to be processed and a trend component sequence to be processed;
Correspondingly, the first prediction module 502 is configured to:
processing the trend component sequence to be processed based on an ARIMA model to obtain a predicted component sequence corresponding to the trend component sequence to be processed; and
And processing the cyclic component sequence to be processed based on an artificial intelligent model to obtain a predicted component sequence corresponding to the cyclic component sequence to be processed.
Optionally, the apparatus further comprises a model training module for:
obtaining a plurality of sample data, wherein the sample data comprises a sample sequence corresponding to the number of historical cigarettes and an actual sequence corresponding to the actual number of cigarettes in a corresponding prediction duration,
Respectively decomposing the sample sequence and the actual sequence based on the X12 season adjustment model to obtain a sample component sequence corresponding to the sample sequence and an actual component sequence corresponding to the actual sequence; the component sequences comprise a seasonal component sequence, an irregular factor component sequence, a cyclic component sequence and a trend component sequence;
Training the ARIMA model, the XGBoost model and the LSTM model based on the sample component sequence to obtain a predicted component sequence corresponding to the sample component sequence;
Model parameters of the ARIMA model, the XGBoost model and the LSTM model are modified based on the predicted component sequence and the actual component sequence.
Optionally, the model training module further comprises a model screening unit, the model screening unit is used for: and respectively determining the prediction errors of the XGBoost model and the LSTM model to screen the XGBoost model and the LSTM model based on the prediction errors so as to obtain an artificial intelligent model.
The cigarette quantity predicting device provided by the embodiment of the invention can execute the cigarette quantity predicting method provided by any embodiment of the invention, and has the corresponding functional modules and beneficial effects of the executing method.
Fig. 6 is a block diagram of an electronic device according to an embodiment of the present invention. Electronic devices are intended to represent various forms of digital computers, such as laptops, desktops, workstations, personal digital assistants, servers, blade servers, mainframes, and other appropriate computers. Electronic equipment may also represent various forms of mobile devices, such as personal digital processing, cellular telephones, smartphones, wearable devices (e.g., helmets, glasses, watches, etc.), and other similar computing devices. The components shown herein, their connections and relationships, and their functions, are meant to be exemplary only, and are not meant to limit implementations of the inventions described and/or claimed herein.
As shown in fig. 6, the electronic device 10 includes at least one processor 11, and a memory, such as a Read Only Memory (ROM) 12, a Random Access Memory (RAM) 13, etc., communicatively connected to the at least one processor 11, in which the memory stores a computer program executable by the at least one processor, and the processor 11 may perform various appropriate actions and processes according to the computer program stored in the Read Only Memory (ROM) 12 or the computer program loaded from the storage unit 18 into the Random Access Memory (RAM) 13. In the RAM 13, various programs and data required for the operation of the electronic device 10 may also be stored. The processor 11, the ROM 12 and the RAM 13 are connected to each other via a bus 14. An input/output (I/O) interface 15 is also connected to bus 14.
Various components in the electronic device 10 are connected to the I/O interface 15, including: an input unit 16 such as a keyboard, a mouse, etc.; an output unit 17 such as various types of displays, speakers, and the like; a storage unit 18 such as a magnetic disk, an optical disk, or the like; and a communication unit 19 such as a network card, modem, wireless communication transceiver, etc. The communication unit 19 allows the electronic device 10 to exchange information/data with other devices via a computer network, such as the internet, and/or various telecommunication networks.
The processor 11 may be a variety of general and/or special purpose processing components having processing and computing capabilities. Some examples of processor 11 include, but are not limited to, a Central Processing Unit (CPU), a Graphics Processing Unit (GPU), various specialized Artificial Intelligence (AI) computing chips, various processors running machine learning model algorithms, digital Signal Processors (DSPs), and any suitable processor, controller, microcontroller, etc. The processor 11 performs the various methods and processes described above, such as the cigarette number prediction method.
In some embodiments, the cigarette number prediction method may be implemented as a computer program tangibly embodied on a computer-readable storage medium, such as the storage unit 18. In some embodiments, part or all of the computer program may be loaded and/or installed onto the electronic device 10 via the ROM 12 and/or the communication unit 19. When the computer program is loaded into RAM 13 and executed by processor 11, one or more steps of the cigarette number prediction method described above may be performed. Alternatively, in other embodiments, the processor 11 may be configured to perform the cigarette number prediction method in any other suitable manner (e.g., by means of firmware).
Various implementations of the systems and techniques described here above may be implemented in digital electronic circuitry, integrated circuit systems, field Programmable Gate Arrays (FPGAs), application Specific Integrated Circuits (ASICs), application Specific Standard Products (ASSPs), systems On Chip (SOCs), load programmable logic devices (CPLDs), computer hardware, firmware, software, and/or combinations thereof. These various embodiments may include: implemented in one or more computer programs, the one or more computer programs may be executed and/or interpreted on a programmable system including at least one programmable processor, which may be a special purpose or general-purpose programmable processor, that may receive data and instructions from, and transmit data and instructions to, a storage system, at least one input device, and at least one output device.
A computer program for carrying out methods of the present invention may be written in any combination of one or more programming languages. These computer programs may be provided to a processor of a general purpose computer, special purpose computer, or other programmable cigarette quantity prediction device such that the computer programs, when executed by the processor, cause the functions/operations specified in the flowchart and/or block diagram block or blocks to be performed. The computer program may execute entirely on the machine, partly on the machine, as a stand-alone software package, partly on the machine and partly on a remote machine or entirely on the remote machine or server.
In the context of the present invention, a computer-readable storage medium may be a tangible medium that can contain, or store a computer program for use by or in connection with an instruction execution system, apparatus, or device. The computer readable storage medium may include, but is not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any suitable combination of the foregoing. Alternatively, the computer readable storage medium may be a machine readable signal medium. More specific examples of a machine-readable storage medium would include an electrical connection based on one or more wires, a portable computer diskette, a hard disk, a Random Access Memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disc read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing.
To provide for interaction with a user, the systems and techniques described here can be implemented on an electronic device having: a display device (e.g., a CRT (cathode ray tube) or LCD (liquid crystal display) monitor) for displaying information to a user; and a keyboard and a pointing device (e.g., a mouse or a trackball) through which a user can provide input to the electronic device. Other kinds of devices may also be used to provide for interaction with a user; for example, feedback provided to the user may be any form of sensory feedback (e.g., visual feedback, auditory feedback, or tactile feedback); and input from the user may be received in any form, including acoustic input, speech input, or tactile input.
The systems and techniques described here can be implemented in a computing system that includes a background component (e.g., as a data server), or that includes a middleware component (e.g., an application server), or that includes a front-end component (e.g., a user computer having a graphical user interface or a web browser through which a user can interact with an implementation of the systems and techniques described here), or any combination of such background, middleware, or front-end components. The components of the system can be interconnected by any form or medium of digital data communication (e.g., a communication network). Examples of communication networks include: local Area Networks (LANs), wide Area Networks (WANs), blockchain networks, and the internet.
The computing system may include clients and servers. The client and server are typically remote from each other and typically interact through a communication network. The relationship of client and server arises by virtue of computer programs running on the respective computers and having a client-server relationship to each other. The server can be a cloud server, also called a cloud computing server or a cloud host, and is a host product in a cloud computing service system, so that the defects of high management difficulty and weak service expansibility in the traditional physical hosts and VPS service are overcome.
It should be appreciated that various forms of the flows shown above may be used to reorder, add, or delete steps. For example, the steps described in the present invention may be performed in parallel, sequentially, or in a different order, so long as the desired results of the technical solution of the present invention are achieved, and the present invention is not limited herein.
The above embodiments do not limit the scope of the present invention. It will be apparent to those skilled in the art that various modifications, combinations, sub-combinations and alternatives are possible, depending on design requirements and other factors. Any modifications, equivalent substitutions and improvements made within the spirit and principles of the present invention should be included in the scope of the present invention.

Claims (10)

1.A method for predicting the number of cigarettes, comprising:
Decomposing sequences to be decomposed comprising the number of cigarettes corresponding to a preset period based on a predetermined X12 seasonal adjustment model to obtain a seasonal component sequence to be processed and a non-seasonal component sequence to be processed; the non-seasonal component sequence to be processed comprises an irregular factor component sequence to be processed and a cyclic trend component sequence to be processed;
Processing the cyclic trend component sequence to be processed based on a prediction model to obtain a prediction component sequence corresponding to the cyclic trend component sequence to be processed, wherein the prediction model comprises an artificial intelligence model and an ARIMA model; and
Determining a predicted component sequence corresponding to a second component sequence based on a corresponding relation between a pre-created component sequence and a component sequence to be used, wherein the second component sequence comprises a seasonal component sequence to be processed and an irregular factor component sequence to be processed;
And determining the predicted cigarette number based on all the predicted component sequences and the X12 seasonal adjustment model.
2. The method of claim 1, wherein the X12 seasonal adjustment model comprises an addition model or a multiplication model,
Determining the X12 seasonal adjustment model includes:
carrying out data analysis on the sequence to be decomposed to obtain the seasonal fluctuation degree of the sequence to be decomposed;
determining a degree of correlation between the seasonal variation degree and the sequence to be decomposed, determining whether the degree of correlation exceeds a preset degree of correlation,
Under the condition that the correlation exceeds the preset correlation, determining the X12 seasonal adjustment model as a multiplication model; or alternatively
And under the condition that the correlation exceeds the preset correlation, determining the X12 seasonal adjustment model as an addition model.
3. The method of claim 1, wherein determining the correspondence between the component sequence and the component sequence to be used comprises:
Determining a historical sequence to be decomposed corresponding to the sequence to be decomposed, and decomposing the historical sequence to be decomposed to obtain a historical component sequence comprising a historical seasonal component sequence and a historical irregular factor component sequence;
determining the seasonal component sequence to be processed based on the historical seasonal component sequence; and
And determining the irregular factor component sequence to be processed based on the historical irregular factor component sequence.
4. A method according to claim 3, wherein said determining said sequence of seasonal components to be processed based on said sequence of historical seasonal components comprises:
For the seasonal component data corresponding to the first moment in the preset period in the seasonal component sequence to be processed, determining the historical seasonal component data corresponding to the first moment in the historical period in the historical seasonal component sequence;
and updating the seasonal component data based on the historical seasonal component data to obtain the seasonal component sequence to be processed.
5. The method according to claim 1, wherein the method further comprises:
decomposing the cyclic trend component sequence to be processed based on an HP filtering algorithm to obtain a cyclic component sequence to be processed and a trend component sequence to be processed;
Correspondingly, the processing the to-be-processed cyclic trend component sequence based on the prediction model to obtain a predicted component sequence corresponding to the to-be-processed cyclic trend component sequence, which comprises
Processing the trend component sequence to be processed based on an ARIMA model to obtain a predicted component sequence corresponding to the trend component sequence to be processed; and
And processing the cyclic component sequence to be processed based on an artificial intelligent model to obtain a predicted component sequence corresponding to the cyclic component sequence to be processed.
6. The method of claim 1 or 5, wherein the artificial intelligence model comprises XGBoost model and LSTM model,
The method further comprises the steps of:
obtaining a plurality of sample data, wherein the sample data comprises a sample sequence corresponding to the number of historical cigarettes and an actual sequence corresponding to the actual number of cigarettes in a corresponding prediction duration,
Respectively decomposing the sample sequence and the actual sequence based on the X12 season adjustment model to obtain a sample component sequence corresponding to the sample sequence and an actual component sequence corresponding to the actual sequence; the component sequences comprise a seasonal component sequence, an irregular factor component sequence, a cyclic component sequence and a trend component sequence;
Training the ARIMA model, the XGBoost model and the LSTM model based on the sample component sequence to obtain a predicted component sequence corresponding to the sample component sequence;
Model parameters of the ARIMA model, the XGBoost model and the LSTM model are modified based on the predicted component sequence and the actual component sequence.
7. The method of claim 6, the method further comprising:
And respectively determining the prediction errors of the XGBoost model and the LSTM model to screen the XGBoost model and the LSTM model based on the prediction errors so as to obtain an artificial intelligent model.
8. A cigarette quantity prediction device, comprising:
The season adjustment module is used for decomposing the sequences to be decomposed comprising the number of cigarettes corresponding to a preset period based on a predetermined X12 season adjustment model to obtain a sequence of seasonal components to be processed and a sequence of non-seasonal components to be processed; the non-seasonal component sequence to be processed comprises an irregular factor component sequence to be processed and a cyclic trend component sequence to be processed;
The first prediction module is used for processing the cyclic trend component sequence to be processed based on a prediction model to obtain a prediction component sequence corresponding to the cyclic trend component sequence to be processed, wherein the prediction model comprises an artificial intelligence model and an ARIMA model; and
The second prediction module is used for determining a predicted component sequence corresponding to a second component sequence based on a corresponding relation between a pre-created component sequence and a component sequence to be used, wherein the second component sequence comprises a seasonal component sequence to be processed and an irregular factor component sequence to be processed;
And the quantity determining module is used for determining the quantity of the predicted cigarettes based on all the predicted component sequences and the X12 season adjustment model.
9. An electronic device, the electronic device comprising:
At least one processor; and
A memory communicatively coupled to the at least one processor; wherein,
The memory stores a computer program executable by the at least one processor to enable the at least one processor to perform the cigarette number prediction method of any one of claims 1-7.
10. A computer readable storage medium storing computer instructions for causing a processor to perform the cigarette number prediction method of any one of claims 1-7.
CN202410164856.6A 2024-02-05 2024-02-05 Cigarette quantity prediction method, device, equipment and storage medium Pending CN117934062A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202410164856.6A CN117934062A (en) 2024-02-05 2024-02-05 Cigarette quantity prediction method, device, equipment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202410164856.6A CN117934062A (en) 2024-02-05 2024-02-05 Cigarette quantity prediction method, device, equipment and storage medium

Publications (1)

Publication Number Publication Date
CN117934062A true CN117934062A (en) 2024-04-26

Family

ID=90754094

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202410164856.6A Pending CN117934062A (en) 2024-02-05 2024-02-05 Cigarette quantity prediction method, device, equipment and storage medium

Country Status (1)

Country Link
CN (1) CN117934062A (en)

Similar Documents

Publication Publication Date Title
CN115775110A (en) Service quality assessment method and device
CN115146853A (en) Method, device and equipment for determining carbon consumption based on electrical carbon factor and storage medium
CN114170002A (en) Method and device for predicting access frequency
CN115202847A (en) Task scheduling method and device
CN115759751A (en) Enterprise risk prediction method and device, storage medium, electronic equipment and product
CN110826196B (en) Industrial equipment operation data processing method and device
CN112785057A (en) Component prediction method, device, equipment and storage medium based on exponential smoothing
CN116957640A (en) Product sales prediction method and system
CN117934062A (en) Cigarette quantity prediction method, device, equipment and storage medium
CN114999665A (en) Data processing method and device, electronic equipment and storage medium
CN114399101A (en) TCN-BIGRU-based gas load prediction method and device
CN112418833A (en) Method and device for predicting price change trend of digital currency
CN117094452B (en) Drought state prediction method, and training method and device of drought state prediction model
CN115292384A (en) Electricity consumption data generation method and electricity consumption data generation device
CN115146997A (en) Evaluation method and device based on power data, electronic equipment and storage medium
CN116911466A (en) Method, device, equipment and medium for determining park construction degree
CN117934137A (en) Bad asset recovery prediction method, device and equipment based on model fusion
CN117808545A (en) Attention mechanism-based multitasking method, device, equipment and medium
CN114971695A (en) Industry trend prediction method, apparatus, device, medium, and program product
CN116205321A (en) Method, device, equipment and storage medium for determining carbon consumption
CN116881857A (en) Product recommendation method, device, equipment and medium
CN115858621A (en) User behavior prediction method and device, electronic equipment and storage medium
CN116340702A (en) Option implicit fluctuation rate determination method, device, equipment and storage medium
CN116128651A (en) Transaction amount abnormality detection method, device, equipment and storage medium
CN115858291A (en) System index detection method and device, electronic equipment and storage medium thereof

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination