Tobacco demand data prediction method and device, equipment, medium and product

By obtaining initial tobacco demand data, allocation type information and festival information, and using deep learning models to predict, the problem of low accuracy of traditional prediction methods is solved, and more accurate tobacco demand prediction is achieved.

CN120069942APending Publication Date: 2025-05-30CHINA TOBACCO ZHEJIANG IND CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202510234574.3
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-02-28
Publication Date
2025-05-30

AI Technical Summary

Technical Problem

Traditional tobacco demand prediction methods have subjective limitations and cannot fully capture the complexity and uncertainty of the market, resulting in low prediction accuracy and difficulty in meeting the company's demand for accurate demand prediction.

Method used

A tobacco demand data prediction method is adopted to predict target tobacco demand data by obtaining initial tobacco demand data, allocation type information and holiday information, and processing it using a pre-trained deep learning model.

Benefits of technology

Intelligent prediction based on initial tobacco demand data, allocation type information and holiday information is realized, and the prediction accuracy of tobacco demand data is improved, so that the prediction results can be more in line with the actual market demand.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120069942A_ABST
    Figure CN120069942A_ABST
Patent Text Reader

Abstract

The invention discloses a tobacco demand data prediction method and device, equipment, a medium and a product. The method comprises the following steps: acquiring corresponding initial tobacco demand data of a predetermined to-be-predicted tobacco category within a preset time period after the current moment; obtaining allocation type information corresponding to the to-be-predicted tobacco category and festival information corresponding to a preset time period; and processing the initial tobacco demand data, the allocation type information and the festival information according to a pre-trained tobacco demand prediction model to predict target tobacco demand data corresponding to the to-be-predicted tobacco category in a preset time period. According to the technical scheme provided by the embodiment of the invention, the effect of estimating the actual tobacco demand based on the initial tobacco demand data, the allocation type information and the festival information by using the prediction model is realized, and intelligent prediction of the demand data is realized.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of tobacco demand prediction, and particularly to a tobacco demand data prediction method, device, equipment, medium and product. Background Art

[0002] With the continuous deepening of the marketization degree of the tobacco industry, how to accurately predict the tobacco demand, and then grasp the market demand, providing a true and effective reference and basis for the operation of the entire tobacco industry is particularly important.

[0003] Traditional tobacco demand prediction methods usually rely on the experience of practitioners and are obtained by referring to historical demand data and historical sales data. However, this method has strong subjective limitations. Manual experience and subjective judgment ability will directly affect the accuracy of the prediction results, and moreover, it is impossible to fully capture the complexity and uncertainty of the market. Therefore, its prediction accuracy is often low and it is difficult to meet the enterprise's demand for accurate demand prediction. Summary of the Invention

[0004] The present invention provides a tobacco demand data prediction method, device, equipment, medium and product to achieve the effect of estimating the actual tobacco demand based on the initial tobacco demand data, allocation type information and festival information by using a prediction model, realizing the intelligent prediction of demand data.

[0005] According to one aspect of the present invention, there is provided a tobacco demand data prediction method, the method comprising:

[0006] Obtaining initial tobacco demand data corresponding to a to-be-predicted tobacco category within a preset time period after the current moment, which is pre-determined; wherein, the initial tobacco demand data includes predicted tobacco demand data corresponding to the to-be-predicted tobacco category at a plurality of preset time points; the plurality of preset time points are obtained by dividing the preset time period according to a preset time step;

[0007] Obtaining allocation type information corresponding to the to-be-predicted tobacco category and festival information corresponding to the preset time period; wherein, the allocation type information is used to represent the tobacco allocation type to which the to-be-predicted tobacco category belongs; the festival information is used to represent whether the preset time period includes a preset target festival;

[0008] Processing the initial tobacco demand data, the allocation type information and the festival information according to a pre-trained tobacco demand prediction model to predict target tobacco demand data corresponding to the to-be-predicted tobacco category within the preset time period;

[0009] Among them, the tobacco demand prediction model is obtained by training a pre-constructed deep learning model based on the predicted demand data corresponding to the sample tobacco categories in the historical time period, the allocation type information corresponding to the sample tobacco categories, the festival information corresponding to the historical time period, and the actual tobacco demand data corresponding to the sample tobacco categories in the historical time period.

[0010] According to another aspect of the present invention, there is provided a tobacco demand data prediction device, which includes:

[0011] A data acquisition module, configured to acquire the initial tobacco demand data corresponding to a to-be-predicted tobacco category to be determined in a preset time period after the current moment; wherein, the initial tobacco demand data includes the predicted tobacco demand data corresponding to the to-be-predicted tobacco category at a plurality of preset time points; the plurality of preset time points are obtained by dividing the preset time period according to a preset time step;

[0012] An information acquisition module, configured to acquire the allocation type information corresponding to the to-be-predicted tobacco category and the festival information corresponding to the preset time period; wherein, the allocation type information is used to represent the tobacco allocation type to which the to-be-predicted tobacco category belongs; the festival information is used to represent whether the preset time period includes a preset target festival;

[0013] A tobacco demand prediction module, configured to process the initial tobacco demand data, the allocation type information, and the festival information according to a pre-trained tobacco demand prediction model to predict the target tobacco demand data corresponding to the to-be-predicted tobacco category in the preset time period; wherein, the tobacco demand prediction model is obtained by training a pre-constructed deep learning model based on the predicted demand data corresponding to the sample tobacco categories in the historical time period, the allocation type information corresponding to the sample tobacco categories, the festival information corresponding to the historical time period, and the actual tobacco demand data corresponding to the sample tobacco categories in the historical time period.

[0014] According to another aspect of the present invention, there is provided an electronic device, which includes:

[0015] At least one processor; and

[0016] A memory communicatively connected to the at least one processor; wherein,

[0017] The memory stores a computer program executable by the at least one processor, and the computer program is executed by the at least one processor so that the at least one processor can execute the tobacco demand data prediction method according to any embodiment of the present invention.

[0018] According to another aspect of the present invention, there is provided a computer-readable storage medium storing computer instructions for causing a processor to implement the tobacco demand data prediction method according to any embodiment of the present invention when executed.

[0019] According to another aspect of the present invention, there is provided a computer program product including a computer program which implements the tobacco demand data prediction method according to any embodiment of the present invention when executed by a processor.

[0020] The technical solution of the embodiment of the present invention solves the problem in the related art that the complexity and uncertainty of the market cannot be fully captured, resulting in a low prediction accuracy and difficulty in meeting the enterprise's demand for accurate demand prediction. By obtaining the initial tobacco demand data corresponding to the tobacco category to be predicted within a preset time period after the current moment; further, obtaining the allocation type information corresponding to the tobacco category to be predicted and the festival information corresponding to the preset time period; and further, processing the initial tobacco demand data, the allocation type information, and the festival information according to the pre-trained tobacco demand prediction model to predict the target tobacco demand data corresponding to the tobacco category to be predicted within the preset time period, it realizes the effect of estimating the actual tobacco demand based on the initial tobacco demand data, the allocation type information, and the festival information using the prediction model, realizes the intelligent prediction of the demand data, and introduces the allocation type information and the festival information for tobacco demand prediction, making the finally obtained tobacco demand data more in line with the actual market demand and improving the prediction accuracy of the tobacco demand data.

[0021] It should be understood that the content described in this part is not intended to identify the key or important features of the embodiments of the present invention, nor is it used to limit the scope of the present invention. Other features of the present invention will become easily understood through the following description. BRIEF DESCRIPTION OF THE DRAWINGS

[0022] In order to more clearly illustrate the technical solutions in the embodiments of the present invention, the following will briefly introduce the drawings required for the description of the embodiments. Obviously, the following drawings are only some embodiments of the present invention, and those of ordinary skill in the art can also obtain other drawings without creative efforts based on these drawings.

[0023] Figure 1 is a flowchart of a tobacco demand data prediction method provided according to Embodiment 1 of the present invention;

[0024] Figure 2 is a flowchart of a tobacco demand data prediction method provided according to Embodiment 2 of the present invention;

[0025] Figure 3It is a schematic diagram of a model structure of the tobacco demand prediction model provided in Embodiment 2 of the present invention;

[0026] Figure 4 It is a flowchart of a method for predicting tobacco demand data provided in Embodiment 3 of the present invention;

[0027] Figure 5 It is a schematic diagram of the structure of a tobacco demand data prediction device provided in Embodiment 4 of the present invention;

[0028] Figure 6 It is a schematic diagram of the structure of an electronic device for implementing the tobacco demand data prediction method of the embodiments of the present invention. Detailed implementation manners

[0029] In order to enable those skilled in the art to better understand the solutions of the present invention, the technical solutions in the embodiments of the present invention will be clearly and completely described below in conjunction with the accompanying drawings in the embodiments of the present invention. Obviously, the described embodiments are only a part of the embodiments of the present invention, rather than all the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those of ordinary skill in the art without creative efforts shall fall within the protection scope of the present invention.

[0030] It should be noted that the terms "first", "second", etc. in the specification and claims of the present invention and the above drawings are used to distinguish similar objects, and do not necessarily need to describe a specific order or sequence. It should be understood that such data can be interchanged under appropriate circumstances so that the embodiments of the present invention described herein can be implemented in an order other than those illustrated or described herein. In addition, the terms "comprising" and "having" and any variations thereof are intended to cover non-exclusive inclusion. For example, a process, method, system, product, or device that includes a series of steps or units does not necessarily have to be limited to those steps or units clearly listed, but may include other steps or units not clearly listed or inherent to these processes, methods, products, or devices.

[0031] Embodiment 1

[0032] Figure 1 It is a flowchart of a method for predicting tobacco demand data provided in Embodiment 1 of the present invention. This embodiment is applicable to the situation of predicting the demand for tobacco to be produced. This method can be executed by a tobacco demand data prediction device, which can be implemented in the form of hardware and / or software, and the tobacco demand data prediction device can be configured in a terminal and / or a server. As Figure 1 shown, the method includes:

[0033] S110. Obtain the initial tobacco demand data corresponding to the to-be-predicted tobacco category determined in advance within a preset time period after the current moment.

[0034] Among them, the to-be-predicted tobacco category can be the tobacco category for which tobacco demand data is to be predicted. Different tobacco categories can be used to represent different tobacco flavors, tobacco tastes, tobacco product packaging, and / or tobacco specifications. The preset time period can be any time interval in the future. Exemplarily, assuming the current moment is February 8th, the preset time period after the current moment can be a three-month time interval from April to June. The initial tobacco demand data can be understood as the data obtained after a preliminary prediction of the tobacco demand data. It can be understood that tobacco demand refers to the quantity of tobacco products that consumers are willing and able to purchase at various value levels within a certain period. The initial tobacco demand data includes the predicted tobacco demand data corresponding to the to-be-predicted tobacco category at multiple preset time points; the multiple preset time points are obtained by dividing the preset time period according to a preset time step. Optionally, the preset time step can include 1 day, 1 week, or 1 month, etc. Exemplarily, continuing with the above example, assuming the preset time step is 1 week, the preset time period can be divided into the first week of April, the second week of April, the third week of April, the fourth week of April, the first week of May, the second week of May, the third week of May, the fourth week of May, the first week of June, the second week of June, the third week of June, and the fourth week of June according to the preset time step. Further, the preliminary tobacco demand data can be a sequence data composed of the predicted tobacco demand data corresponding to each of the above weeks, that is, the preliminary tobacco demand data can include the predicted tobacco demand data corresponding to the first week of April, the predicted tobacco demand data corresponding to the second week of April, the predicted tobacco demand data corresponding to the third week of April, the predicted tobacco demand data corresponding to the fourth week of April, the predicted tobacco demand data corresponding to the first week of May, the predicted tobacco demand data corresponding to the second week of May, the predicted tobacco demand data corresponding to the third week of May, the predicted tobacco demand data corresponding to the fourth week of May, the predicted tobacco demand data corresponding to the first week of June, the predicted tobacco demand data corresponding to the second week of June, the predicted tobacco demand data corresponding to the third week of June, and the predicted tobacco demand data corresponding to the fourth week of June.

[0035] It should be noted that the preliminary tobacco demand data can be the data obtained by processing historical demand data and / or historical sales data through a preset tobacco demand forecasting algorithm. The preliminary tobacco demand data can reflect the tobacco demand within a preset time period to a certain extent. However, the influencing factors (such as promotional strategies and / or holiday demands) corresponding to different preset time periods are also different. For example, different preset time periods can correspond to different promotional strategies; or, different preset time periods can include different holidays. Furthermore, the prediction accuracy of the preliminary tobacco demand data predicted based on historical demand data and / or historical sales data is relatively low. Therefore, using the preliminary tobacco demand data that can reflect the tobacco demand within a preset time period to a certain extent and has a relatively low prediction accuracy as the data basis for predicting tobacco demand data can ensure that the final target tobacco demand data can not only reflect the tobacco demand within the preset time, but also improve the prediction accuracy.

[0036] It should also be noted that the tobacco categories to be predicted obtained can be one or more. In the case of obtaining the initial tobacco demand data corresponding to multiple tobacco categories to be predicted within a preset time period after the current moment, the tobacco demand data for each tobacco category to be predicted can be predicted respectively based on the initial tobacco demand data corresponding to each tobacco category to be predicted.

[0037] S120. Obtain the allocation type information corresponding to the tobacco category to be predicted and the festival information corresponding to the preset time period.

[0038] Among them, the allocation type information is used to represent the tobacco allocation type to which the tobacco category to be predicted belongs. The tobacco allocation type refers to the classification method adopted for tobacco product allocation in the tobacco industry according to different criteria and purposes. Optionally, the tobacco allocation types include regional differential allocation, seasonal allocation, planned quota allocation, new product allocation, demand forecasting allocation, foreign allocation, etc. The allocation type information can be represented based on any form of information. Exemplarily, the form of "0" or "1" can be used to represent whether the tobacco category to be predicted belongs to any tobacco allocation type. "0" means not belonging, and "1" means belonging. Suppose the tobacco allocation types include 6 types such as regional differential allocation, seasonal allocation, planned quota allocation, new product allocation, demand forecasting allocation, and foreign allocation. The tobacco category to be predicted A belongs to regional differential allocation, seasonal allocation, and demand forecasting allocation, and does not belong to planned quota allocation, new product allocation, and foreign allocation. Further, the allocation type information corresponding to the tobacco category to be predicted A can be "110010".

[0039] Among them, the festival information is used to represent whether the preset time period includes the preset target festival. Optionally, the target festivals include Labor Day, Dragon Boat Festival, Mid-Autumn Festival, National Day, Spring Festival, etc. The festival information can be represented based on any form of information.

[0040] In this embodiment, in the case of determining the tobacco category to be predicted and the preset time period after the current moment, the allocation type information corresponding to the tobacco category to be predicted and the festival information corresponding to the preset time period can be obtained.

[0041] S130. Process the initial tobacco demand data, the allocation type information, and the festival information according to the pre-trained tobacco demand prediction model to predict the target tobacco demand data corresponding to the tobacco category to be predicted within the preset time period.

[0042] Among them, the tobacco demand prediction model can be a neural network model that takes the initial tobacco demand data, the allocation type information, and the festival information as input objects to predict the tobacco demand data based on the input objects. The tobacco demand prediction model can be a deep learning model with any model structure. The model structure of the tobacco demand prediction model is not limited here and can be customized according to actual needs. In this embodiment, the tobacco demand prediction model can be a model constructed based on a long short-term memory neural network. This model includes an embedding layer, a long short-term memory module, an attention layer, and a fully connected module, and these modules are sequentially connected in order. The tobacco demand prediction model is trained by using the predicted demand data corresponding to the sample tobacco category within the historical time period, the allocation type information corresponding to the sample tobacco category, the festival information corresponding to the historical time period, and the actual tobacco demand data corresponding to the sample tobacco category within the historical time period for the pre-constructed deep learning model. The target tobacco demand data can be understood as the finally predicted actual tobacco demand data. This actual tobacco demand data can be the tobacco demand prediction data obtained by adjusting the initial tobacco demand data based on the allocation type information and the festival information. Compared with the initial tobacco demand data, the prediction accuracy of the target tobacco demand data is relatively high and can better meet the needs of tobacco enterprises for accurate demand prediction. The target tobacco demand data includes the target demand prediction data corresponding to the tobacco category to be predicted at multiple preset time points.

[0043] In this embodiment, in the case of obtaining the initial tobacco demand data, the allocation type information, and the festival information, the initial tobacco demand data, the allocation type information, and the festival information can be input into the tobacco demand prediction model. Further, the initial tobacco demand data, the allocation type information, and the festival information can be processed in sequence based on the embedding layer, the long short-term memory module, the attention layer, and the fully connected module in the tobacco demand prediction model, and the target tobacco demand data corresponding to the tobacco category to be predicted within the preset time period can be output.

[0044] The technical solution of the embodiment of the present invention obtains the initial tobacco demand data corresponding to the tobacco category to be predicted determined in advance within a preset time period after the current moment; further, obtains the allocation type information corresponding to the tobacco category to be predicted and the festival information corresponding to the preset time period; further, processes the initial tobacco demand data, the allocation type information, and the festival information according to the pre-trained tobacco demand prediction model to predict the target tobacco demand data corresponding to the tobacco category to be predicted within the preset time period, solves the problem in the related art that the complexity and uncertainty of the market cannot be fully captured, and thus the prediction accuracy is low and it is difficult to meet the enterprise's demand for accurate demand prediction, realizes the effect of estimating the actual tobacco demand based on the initial tobacco demand data, the allocation type information, and the festival information by using the prediction model, realizes the intelligent prediction of the demand data, and introduces the allocation type information and the festival information to predict the tobacco demand, so that the finally obtained tobacco demand data can better conform to the actual demand of the market and improves the prediction accuracy of the tobacco demand data.

[0045] Embodiment 2

[0046] Figure 2 It is a flowchart of a method for predicting tobacco demand data provided by Embodiment 2 of the present invention. On the basis of the foregoing embodiment, the prediction process of the target tobacco demand data is further refined. Optionally, the tobacco demand prediction model includes an embedding layer, a long short-term memory module, an attention layer, and a fully connected module; processing the initial tobacco demand data, the allocation type information, and the festival information according to the pre-trained tobacco demand prediction model to predict the target tobacco demand data corresponding to the tobacco category to be predicted within the preset time period includes: performing vector conversion on the allocation type information and the festival information based on the embedding layer to obtain an allocation type embedding vector and a festival embedding vector; processing the allocation type embedding vector, the festival embedding vector, and the initial tobacco demand data based on the long short-term memory module to obtain a tobacco demand feature sequence; wherein, the tobacco demand feature sequence includes the tobacco demand features corresponding to the tobacco category to be predicted at multiple preset time points; weighting the tobacco demand feature sequence based on the attention layer to obtain a target feature sequence; and converting the target feature sequence based on the fully connected module to obtain the target tobacco demand data corresponding to the tobacco category to be predicted within the preset time period. The specific implementation manner thereof can refer to the technical solution of this embodiment. Among them, the same or similar technical terms as those in the above embodiment will not be described in detail here.

[0047] As Figure 2 shown, the method includes:

[0048] S210. Obtain the initial tobacco demand data corresponding to the tobacco category to be predicted determined in advance within a preset time period after the current moment.

[0049] S220. Obtain the allocation type information corresponding to the tobacco category to be predicted and the festival information corresponding to the preset time period.

[0050] S230. Perform vector conversion on the allocation type information and festival information based on the embedding layer to obtain an allocation type embedding vector and a festival embedding vector.

[0051] Among them, the embedding layer can be used to map discrete information into a low-dimensional continuous vector representation. The feature vector output by the embedding layer can be used as the input of the subsequent neural network layer, providing more representative and distinguishable features for the model, and these features help to improve the accuracy and generalization ability of the model. The allocation type embedding vector can be a low-dimensional vector representation of the allocation type information. The festival embedding vector can be a low-dimensional vector representation of the festival information.

[0052] In this embodiment, when the initial tobacco demand data, allocation type information, and festival information are input into the tobacco demand prediction model, the vector conversion of the allocation type information can be first performed based on the embedding layer to map the allocation type information into a low-dimensional continuous vector representation and output the allocation type embedding vector corresponding to the allocation type information. And the vector conversion of the festival information can be performed based on the embedding layer to map the festival information into a low-dimensional continuous vector representation and output the festival embedding vector corresponding to the festival information.

[0053] Exemplarily, 12 neurons can be set in the embedding layer, among which 8 neurons can be used to represent the allocation type embedding vector, and 4 neurons can be used to represent the festival embedding vector.

[0054] S240. Process the allocation type embedding vector, festival embedding vector, and initial tobacco demand data based on the long short-term memory module to obtain a tobacco demand feature sequence.

[0055] Among them, the long short-term memory module can effectively process sequence data, capture the long-term trend and short-term fluctuations in the time series to provide relatively accurate prediction results. In this embodiment, the long short-term memory module can include an input layer, a first bidirectional long short-term memory layer, and a second bidirectional long short-term memory layer. The tobacco demand feature sequence includes the tobacco demand features corresponding to the tobacco category to be predicted at multiple preset time points.

[0056] In this embodiment, when the allocation type embedding vector and the festival embedding vector are obtained, the allocation type embedding vector, the festival embedding vector, and the initial tobacco demand data can be input into the long short-term memory module in the tobacco demand prediction model. Furthermore, the allocation type embedding vector, the festival embedding vector, and the initial tobacco demand data can be processed in sequence based on the input layer, the first bidirectional long short-term memory layer, and the second bidirectional long short-term memory layer in the long short-term memory module to obtain a tobacco demand feature sequence.

[0057] Optionally, based on the long short-term memory module, the allocation type embedding vector, the festival embedding vector, and the initial tobacco demand data are processed to obtain a tobacco demand feature sequence, including: combining the allocation type embedding vector, the festival embedding vector, and the initial tobacco demand data through an input layer to obtain an input vector; extracting features from the input vector based on a first bidirectional long short-term memory layer to obtain a first feature sequence; performing residual processing on the first feature sequence to obtain a first residual feature; extracting features from the first feature sequence and the first residual feature based on a second bidirectional long short-term memory layer to obtain a tobacco demand feature sequence.

[0058] Among them, the input layer can be used to receive and combine the allocation type embedding vector, the festival embedding vector, and the initial tobacco demand data. That is to say, the allocation type embedding vector, the festival embedding vector, and the initial tobacco demand data are combined into a unified vector representation in the input layer. The first bidirectional long short-term memory layer can be used to capture past and future context information so that the model can understand the pattern of time series data. The second bidirectional long short-term memory layer can be used to extract and learn high-level features, patterns, and long-term dependencies in time series data.

[0059] In a specific implementation, when the allocation type embedding vector, the festival embedding vector, and the initial tobacco demand data are input into the long short-term memory module of the tobacco demand prediction model, first, the allocation type embedding vector, the festival embedding vector, and the initial tobacco demand data can be combined through the input layer to form a unified vector representation and obtain an input vector. Further, features can be extracted from the input vector based on the first bidirectional long short-term memory layer to obtain a first feature sequence. Then, residual processing can be performed on the first feature sequence to obtain a first residual feature. Further, features can be extracted from the first feature sequence and the first residual feature based on the second bidirectional long short-term memory layer, and the extracted features can be feature fused, and the fused features are used as the tobacco demand feature sequence.

[0060] S250. Weight the tobacco demand feature sequence based on the attention layer to obtain a target feature sequence.

[0061] Among them, the attention layer can assign higher attention weights to important information, highlight key features, and strengthen the model's representation of these features. In this embodiment, when the tobacco demand feature sequence includes the tobacco demand features corresponding to the to-be-predicted tobacco category at multiple preset time points, the attention layer can assign attention weights to the tobacco demand features corresponding to each preset time point to highlight the tobacco demand features corresponding to important preset time points. The attention layer can help improve the model's ability to understand and analyze data, help the model ignore unimportant information, reduce the processing of redundant data, and thus improve the performance of the model.

[0062] In this embodiment, after obtaining the tobacco demand feature sequence, attention weights can be assigned to the tobacco demand features corresponding to each preset time point in the tobacco demand feature sequence based on the attention layer. Further, for each preset time point, the tobacco demand feature corresponding to the preset time point and its corresponding attention weight can be weighted to obtain the target demand feature corresponding to the preset time point. Further, the sequence composed of the target demand features corresponding to multiple preset time points can be used as the target feature sequence.

[0063] S260. Based on the fully connected module, transform the target feature sequence to obtain the target tobacco demand data corresponding to the to-be-predicted tobacco category within a preset time period.

[0064] Among them, the fully connected module is used to perform feature integration and feature mapping on the extracted features to complete tasks such as classification, regression, and numerical prediction. In other words, the fully connected module can be used to transform the output of the attention layer into the final predicted value. In this embodiment, the fully connected module can include a first fully connected layer, a second fully connected layer, and an output layer.

[0065] In this embodiment, after obtaining the target feature sequence, the target feature sequence can be sequentially subjected to feature transformation based on the first fully connected layer, the second fully connected layer, and the output layer in the fully connected module to obtain the target tobacco demand data corresponding to the to-be-predicted tobacco category within a preset time period.

[0066] Optionally, based on the fully connected module, transforming the target feature sequence to obtain the target tobacco demand data corresponding to the to-be-predicted tobacco category within a preset time period includes: performing a non-linear transformation on the target feature sequence based on the first fully connected layer to obtain a first to-be-processed feature sequence; performing a transformation on the first to-be-processed feature sequence based on the second fully connected layer to obtain a second to-be-processed feature sequence; and performing a transformation on the second to-be-processed feature sequence based on the output layer to obtain the target tobacco demand data corresponding to the to-be-predicted tobacco category within a preset time period.

[0067] In this embodiment, the first fully connected layer can perform a non-linear transformation on the feature sequence using the ReLU activation function. The second fully connected layer can perform a non-linear transformation on the feature sequence using the ReLU activation function. The output layer can perform a linear transformation on the feature sequence using the linear activation function.

[0068] In a specific implementation, after obtaining the target feature sequence, the first fully connected layer can perform a non-linear transformation on the target feature sequence using the ReLU activation function, and use the transformed feature as the first feature sequence to be processed. Further, the second fully connected layer can perform a non-linear transformation on the first feature sequence to be processed using the ReLU activation function, and use the transformed feature as the second feature sequence to be processed. Further, the output layer can perform a linear transformation on the second feature sequence to be processed using the linear activation function to obtain the target tobacco demand data corresponding to the tobacco category to be predicted within a preset time period.

[0069] Exemplarily, Figure 3 is a schematic diagram of a model structure of the tobacco demand prediction model provided by an embodiment of the present invention. As Figure 3 shown, the model structure of the tobacco demand prediction model can include an embedding layer, a long short-term memory module, an attention layer, and a fully connected module. The long short-term memory module includes an input layer, a first bidirectional long short-term memory layer, and a second bidirectional long short-term memory layer, and there is a residual connection between the first bidirectional long short-term memory layer and the second bidirectional long short-term memory layer. The fully connected module includes a first fully connected layer, a second fully connected layer, and an output layer. The model parameters of the tobacco demand prediction model can include: 12 neurons are set in the embedding layer; 13 neurons are set in the input layer; 3 forward long short-term memory neurons and 3 backward long short-term memory neurons are set in the first bidirectional long short-term memory layer; 3 forward long short-term memory neurons and 3 backward long short-term memory neurons are set in the second bidirectional long short-term memory layer; 3 neurons are set in the attention layer, and the Bahdanau attention (additive attention) mechanism is used; 4 neurons are set in the first fully connected layer, and the ReLU activation function is used; 2 neurons are set in the second fully connected layer, and the ReLU activation function is used; 1 neuron is set in the output layer, and the linear activation function is used.

[0070] In the technical solution of the embodiment of the present invention, through vector conversion of transfer type information and festival information based on an embedding layer, a transfer type embedding vector and a festival embedding vector are obtained; further, based on a long short-term memory module, the transfer type embedding vector, the festival embedding vector, and the initial tobacco demand data are processed to obtain a tobacco demand feature sequence; further, based on an attention layer, the tobacco demand feature sequence is weighted to obtain a target feature sequence; further, based on a fully connected module, the target feature sequence is converted to obtain the target tobacco demand data corresponding to the to-be-predicted tobacco category within a preset time period, achieving the effect of processing the initial tobacco demand data, transfer type information, and festival information based on a neural network model and obtaining the target tobacco demand data. Furthermore, a prediction model constructed based on a long short-term memory neural network is used for tobacco demand prediction, improving the prediction accuracy and prediction efficiency of tobacco demand data.

[0071] Embodiment III

[0072] Figure 4 FIG. is a flowchart of a method for predicting tobacco demand data provided in Embodiment III of the present invention. On the basis of the foregoing embodiments, before applying the tobacco demand prediction model, a pre-constructed deep learning model may be trained based on training sample data to obtain the tobacco demand prediction model. The specific implementation manner may refer to the technical solution of this embodiment. Among them, the same or similar technical terms as those in the above embodiments will not be described in detail here.

[0073] As Figure 4 shown, the method includes:

[0074] S310. Train to obtain a tobacco demand prediction model.

[0075] It should be noted that before applying the tobacco demand prediction model provided in this embodiment, a pre-constructed deep learning model may be trained in a supervised or unsupervised manner. Before training the deep learning model, multiple training sample data may be constructed to train the model based on the multiple training sample data. To improve the prediction accuracy of the tobacco demand prediction model, as many and rich training samples as possible may be constructed.

[0076] Optionally, training to obtain a tobacco demand prediction model includes: obtaining multiple training sample data; wherein the training sample data includes the predicted demand data corresponding to the sample tobacco category in the historical time period, the transfer type information corresponding to the sample tobacco category, the target festival information corresponding to the historical time period, and the actual tobacco demand data corresponding to the sample tobacco category in the historical time period; training a pre-constructed deep learning model according to the multiple training sample data to obtain the tobacco demand prediction model.

[0077] Among them, the predicted demand data can be data obtained by processing historical demand data and / or historical sales data through a preset tobacco demand prediction algorithm. The actual tobacco demand data can be the tobacco demand quantity representing the actual demand situation of the sample tobacco category in the historical time period.

[0078] In this embodiment, in order to construct training sample data in a rich and diverse manner, the predicted demand data and the actual tobacco demand data corresponding to multiple sample tobacco categories in the historical time period can be obtained, and the allocation type information corresponding to each sample tobacco category and the festival information corresponding to the historical time period can be determined. Further, for each sample tobacco category, the training sample data can be constructed based on the predicted demand data, the actual tobacco demand data, the allocation type information, and the festival information corresponding to the historical time period corresponding to the sample tobacco category. Furthermore, multiple training sample data can be obtained. Further, the pre-constructed deep learning model can be trained based on the multiple training sample data to obtain a tobacco demand prediction model.

[0079] Optionally, training the pre-constructed deep learning model according to multiple training sample data to obtain a tobacco demand prediction model includes: for multiple training sample data, inputting the predicted demand data, the allocation type information, and the festival information in the current training sample data into the deep learning model to obtain model predicted demand data; determining a target loss value according to the model predicted demand data and the actual tobacco demand data in the current training sample data, and correcting the model parameters in the deep learning model based on the target loss value, and taking the convergence of the loss function in the deep learning model as the training target to obtain a tobacco demand prediction model.

[0080] Among them, the deep learning model can be a neural network model with default or initial model parameters. Optionally, the deep learning model includes an embedding layer, a long short-term memory module, an attention layer, and a fully connected module to be trained. The model predicted demand data can be the predicted tobacco demand data output by the deep learning model after predicting the predicted demand data, the allocation type information, and the festival information. The target loss value can be a value representing the degree of difference between the model output and the true output.

[0081] In this embodiment, after obtaining multiple training sample data, for the multiple training sample data, the predicted demand data, the allocation type information, and the festival information in the current training sample data can be input into the deep learning model. Further, the predicted demand data, the allocation type information, and the festival information can be processed in sequence based on the embedding layer, the long short-term memory module, the attention layer, and the fully connected module in the deep learning model, and the model predicted demand data can be output. Further, loss processing can be performed on the model predicted demand data and the actual tobacco demand data in the current training sample data according to the loss function set in the deep learning model, and a target loss value can be obtained.

[0082] In this embodiment, the loss function set in the deep learning model includes multiple ones. The model prediction model data and the actual tobacco demand data can be processed for loss through multiple loss functions to obtain the target loss value.

[0083] Optionally, determining the target loss value according to the model prediction demand data and the actual tobacco demand data in the current training sample data includes: performing loss processing on the model prediction demand data and the actual tobacco demand data according to the first loss function to obtain the first loss value; determining the second loss function according to the model prediction demand data and the actual tobacco demand data, and performing loss processing on the model prediction demand data and the actual tobacco demand data according to the second loss function to obtain the second loss value; performing loss processing on the model prediction demand data and the actual tobacco demand data according to the third loss function to obtain the third loss value; performing loss processing on the model prediction demand data and the actual tobacco demand data according to the fourth loss function to obtain the fourth loss value; adding the first loss value, the second loss value, the third loss value, and the fourth loss value to obtain the target loss value.

[0084] Among them, the first loss function can be any loss function. Optionally, it is the weighted mean absolute percentage error loss function. The second loss function can be any loss function. Optionally, it is a piecewise loss function composed of the mean square error loss function and the weighted error loss function. The third loss function can be any loss function. Optionally, it is the overage penalty loss function. The fourth loss function can be any loss function. Optionally, it is the shortage penalty loss function.

[0085] In this embodiment, the second loss function is a piecewise loss function composed of two loss functions. That is to say, under the condition of meeting the first preset condition, the second loss function can be one of these two loss functions; under the condition of meeting the second preset condition, the second loss function can be the other loss function of these two loss functions.

[0086] Optionally, determining the second loss function according to the model prediction demand data and the actual tobacco demand data includes: determining the absolute value of the difference between the model prediction demand data and the actual tobacco demand data to obtain the first value; determining the ratio between the first value and the actual tobacco demand data to obtain the second value; when the second value is not greater than the preset error threshold, using the mean square error loss function as the second loss function; when the second value is greater than the preset error threshold, using the weighted error loss function as the second loss function.

[0087] Among them, the preset error threshold can be the selection condition of the piecewise loss function. The preset error threshold can be any value. The weighted error loss function is the weighted mean absolute percentage error loss function.

[0088] In this embodiment, after obtaining the model prediction demand data, the difference between the model prediction demand data and the actual tobacco demand data can be determined, and the absolute value of the difference can be determined. The obtained absolute value is used as the first value. Further, the ratio between the first value and the actual tobacco demand data can be determined, and this ratio is used as the second value. Further, the second value can be compared with a preset error threshold. When the second value is not greater than the preset error threshold, the mean square error loss function can be used as the second loss function. When the second value is greater than the preset error threshold, the weighted error loss function can be used as the second loss function.

[0089] Exemplarily, the second loss function can be expressed based on the following formula:

[0090]

[0091] where PLF(MSE, WMAPE, θ) represents the second loss function; MSE(y pred , y true ) represents the mean square error loss function; y pred represents the model prediction demand data; y true represents the actual tobacco demand data; θ represents the preset error threshold; WMAPE(y pred , y true ) represents the weighted error loss function.

[0092] In this embodiment, after obtaining the model prediction demand data, the model prediction demand data and the actual tobacco demand data can be subjected to loss processing according to the first loss function, and a first loss value can be obtained. And, after determining the second loss function based on the model prediction demand data and the actual tobacco demand data, the model prediction demand data and the actual tobacco demand data can be subjected to loss processing according to the second loss function, and a second loss value can be obtained. And, the model prediction demand data and the actual tobacco demand data can be subjected to loss processing according to the third loss function, and a third loss value can be obtained. And, the model prediction demand data and the actual tobacco demand data can be subjected to loss processing according to the fourth loss function, and a fourth loss value can be obtained. Further, the first loss value, the second loss value, the third loss value, and the fourth loss value can be added together, and the obtained value after addition is used as the target loss value.

[0093] Exemplarily, the first loss value can be determined based on the following formula:

[0094]

[0095] where WMAPE(y pred , y true, ω) represents the first loss function; ω represents the sample weight; i represents the number of the training sample data; n represents the quantity of the training sample data.

[0096] The third loss value can be determined based on the following formula:

[0097]

[0098] where OPT(y pred , y true , α) represents the third loss function; α represents the penalty coefficient of the over - penalty term.

[0099] The fourth loss value can be determined based on the following formula:

[0100]

[0101] where SPT(y pred , y true , β) represents the fourth loss function; β represents the penalty coefficient of the out - of - stock penalty term.

[0102] In the case of obtaining the target loss value, the model parameters in the deep - learning model can be corrected according to the target loss value. Then, the convergence of the loss function in the deep - learning model can be used as the training objective, such as whether the training error is less than the preset error, or whether the error change trend tends to be stable, or whether the current number of iterations is equal to the preset number. If it is detected that the convergence condition is reached, for example, the training error of the loss function is less than the preset error or the error change trend tends to be stable, it indicates that the training of the deep - learning model is completed. At this time, the iterative training can be stopped, and the deep - learning model trained at this time can be used as the tobacco demand prediction model. If it is detected that the current convergence condition is not reached, other training sample data can be further obtained to train the deep - learning model until the training error of the loss function is within the preset range.

[0103] S320. Obtain the initial tobacco demand data corresponding to the tobacco category to be predicted within a preset time period after the current moment, which is determined in advance.

[0104] S330. Obtain the allocation type information corresponding to the tobacco category to be predicted and the festival information corresponding to the preset time period.

[0105] S340. Process the initial tobacco demand data, the allocation type information, and the festival information according to the pre - trained tobacco demand prediction model to predict the target tobacco demand data corresponding to the tobacco category to be predicted within the preset time period.

[0106] The technical solution of the embodiment of the present invention realizes the effect of training a tobacco demand prediction model capable of accurately predicting the tobacco demand based on the constructed training sample data by obtaining a plurality of training sample data; further, training a pre-constructed deep learning model according to the plurality of training sample data, effectively improving the accuracy and robustness of the model, and effectively enhancing the model performance.

[0107] Embodiment Four

[0108] Figure 5 FIG. is a schematic structural diagram of a tobacco demand data prediction device provided in Embodiment Four of the present invention. As Figure 5 shown, the device includes: a data acquisition module 410, an information acquisition module 420, and a tobacco demand prediction module 430.

[0109] Among them, the data acquisition module 410 is configured to acquire initial tobacco demand data corresponding to a preset tobacco category to be predicted within a preset time period after the current moment; wherein, the initial tobacco demand data includes predicted tobacco demand data corresponding to the tobacco category to be predicted at a plurality of preset time points; the plurality of preset time points are obtained by dividing the preset time period according to a preset time step; the information acquisition module 420 is configured to acquire allocation type information corresponding to the tobacco category to be predicted and festival information corresponding to the preset time period; wherein, the allocation type information is used to represent the tobacco allocation type to which the tobacco category to be predicted belongs; the festival information is used to represent whether the preset time period includes a preset target festival; the tobacco demand prediction module 430 is configured to process the initial tobacco demand data, the allocation type information, and the festival information according to a pre-trained tobacco demand prediction model to predict target tobacco demand data corresponding to the tobacco category to be predicted within the preset time period; wherein, the tobacco demand prediction model is trained by a pre-constructed deep learning model based on predicted demand data corresponding to a sample tobacco category within a historical time period, allocation type information corresponding to the sample tobacco category, festival information corresponding to the historical time period, and actual tobacco demand data corresponding to the sample tobacco category within the historical time period.

[0110] The technical solution of the embodiment of the present invention obtains the initial tobacco demand data corresponding to the to-be-predicted tobacco category determined in advance within a preset time period after the current moment; further, obtains the allocation type information corresponding to the to-be-predicted tobacco category and the festival information corresponding to the preset time period; further, processes the initial tobacco demand data, the allocation type information, and the festival information according to the pre-trained tobacco demand prediction model to predict the target tobacco demand data corresponding to the to-be-predicted tobacco category within the preset time period, solves the problem in the related art that the complexity and uncertainty of the market cannot be fully captured, resulting in a low prediction accuracy and being difficult to meet the enterprise's demand for accurate demand prediction, realizes the effect of estimating the actual tobacco demand based on the initial tobacco demand data, the allocation type information, and the festival information using the prediction model, realizes the intelligent prediction of demand data, introduces the allocation type information and the festival information for tobacco demand prediction, makes the finally obtained tobacco demand data more in line with the actual market demand, and improves the prediction accuracy of the tobacco demand data.

[0111] Optionally, the tobacco demand prediction model includes an embedding layer, a long short-term memory module, an attention layer, and a fully connected module;

[0112] The tobacco demand prediction module 430 includes: a vector conversion sub-module, a feature sequence determination sub-module, a feature weighting sub-module, and a tobacco demand data determination sub-module.

[0113] The vector conversion sub-module is used to perform vector conversion on the allocation type information and the festival information based on the embedding layer to obtain an allocation type embedding vector and a festival embedding vector;

[0114] The feature sequence determination sub-module is used to process the allocation type embedding vector, the festival embedding vector, and the initial tobacco demand data based on the long short-term memory module to obtain a tobacco demand feature sequence; wherein, the tobacco demand feature sequence includes the tobacco demand features corresponding to the to-be-predicted tobacco category at multiple preset time points;

[0115] The feature weighting sub-module is used to weight the tobacco demand feature sequence based on the attention layer to obtain a target feature sequence;

[0116] The tobacco demand data determination sub-module is used to convert the target feature sequence based on the fully connected module to obtain the target tobacco demand data corresponding to the to-be-predicted tobacco category within the preset time period.

[0117] Optionally, the long short-term memory module includes an input layer, a first bidirectional long short-term memory layer, and a second bidirectional long short-term memory layer; the feature sequence determination sub-module includes: a vector combination unit, a feature sequence determination unit, a residual processing unit, and a feature fusion unit.

[0118] A vector combination unit for combining vectors of the allocation type embedding vector, the festival embedding vector, and the initial tobacco demand data based on the input layer to obtain an input vector;

[0119] A feature sequence determination unit for extracting features from the input vector based on the first bidirectional long short-term memory layer to obtain a first feature sequence;

[0120] A residual processing unit for performing residual processing on the first feature sequence to obtain a first residual feature;

[0121] A feature fusion unit for extracting and fusing features of the first feature sequence and the first residual feature based on the second bidirectional long short-term memory layer to obtain a tobacco demand feature sequence.

[0122] Optionally, the fully connected module includes a first fully connected layer, a second fully connected layer, and an output layer; the tobacco demand data determination sub-module includes: a first feature conversion unit, a second feature conversion unit, and a third feature conversion unit.

[0123] A first feature conversion unit for performing non-linear conversion on the target feature sequence based on the first fully connected layer to obtain a first to-be-processed feature sequence;

[0124] A second feature conversion unit for converting the first to-be-processed feature sequence based on the second fully connected layer to obtain a second to-be-processed feature sequence;

[0125] A third feature conversion unit for converting the second to-be-processed feature sequence based on the output layer to obtain the target tobacco demand data corresponding to the to-be-predicted tobacco category within the preset time period.

[0126] Optionally, the device further includes: a model training module.

[0127] A model training module for training to obtain a tobacco demand prediction model;

[0128] The model training module includes: a sample data acquisition sub-module and a model training sub-module.

[0129] A sample data acquisition sub-module for acquiring a plurality of training sample data; wherein, the training sample data includes predicted demand data corresponding to a sample tobacco category within a historical time period, allocation type information corresponding to the sample tobacco category, target festival information corresponding to the historical time period, and actual tobacco demand data corresponding to the sample tobacco category within the historical time period;

[0130] A model training sub-module, which is used to train a pre-constructed deep learning model according to multiple pieces of the training sample data to obtain a tobacco demand prediction model.

[0131] Optionally, the model training sub-module includes: a model output data determination unit and a model parameter correction unit.

[0132] The model output data determination unit is used to input the predicted demand data, allocation type information, and festival information in the current training sample data into the deep learning model for multiple pieces of the training sample data to obtain model predicted demand data;

[0133] The model parameter correction unit is used to determine a target loss value according to the model predicted demand data and the actual tobacco demand data in the current training sample data, and correct the model parameters in the deep learning model based on the target loss value, taking the convergence of the loss function in the deep learning model as the training goal to obtain a tobacco demand prediction model.

[0134] Optionally, the model parameter correction unit includes: a first loss value determination sub-unit, a second loss value determination sub-unit, a third loss value determination sub-unit, a fourth loss value determination sub-unit, and a target loss value determination sub-unit.

[0135] The first loss value determination sub-unit is used to perform loss processing on the model predicted demand data and the actual tobacco demand data according to a first loss function to obtain a first loss value;

[0136] The second loss value determination sub-unit is used to determine a second loss function according to the model predicted demand data and the actual tobacco demand data, and perform loss processing on the model predicted demand data and the actual tobacco demand data according to the second loss function to obtain a second loss value;

[0137] The third loss value determination sub-unit is used to perform loss processing on the model predicted demand data and the actual tobacco demand data according to a third loss function to obtain a third loss value;

[0138] The fourth loss value determination sub-unit is used to perform loss processing on the model predicted demand data and the actual tobacco demand data according to a fourth loss function to obtain a fourth loss value;

[0139] The target loss value determination sub-unit is used to add the first loss value, the second loss value, the third loss value, and the fourth loss value to obtain a target loss value.

[0140] Optionally, the second loss value determination subunit is specifically configured to determine the absolute value of the difference between the model prediction demand data and the actual tobacco demand data to obtain a first value; determine the ratio between the first value and the actual tobacco demand data to obtain a second value; when the second value is not greater than a preset error threshold, use the mean square error loss function as the second loss function; when the second value is greater than the preset error threshold, use the weighted error loss function as the second loss function.

[0141] The tobacco demand data prediction device provided by the embodiments of the present invention can execute the tobacco demand data prediction method provided by any embodiment of the present invention, and has corresponding functional modules and beneficial effects for executing the method.

[0142] Embodiment Five

[0143] Figure 6 FIG. shows a schematic structural diagram of an electronic device 10 that can be used to implement the embodiments of the present invention. The electronic device is intended to represent various forms of digital computers, such as, laptop computers, desktop computers, workstations, personal digital assistants, servers, blade servers, mainframe computers, and other suitable computers. The electronic device can also represent various forms of mobile devices, such as, personal digital processing, cellular phones, smart phones, wearable devices (such as helmets, glasses, watches, etc.) and other similar computing devices. The components shown herein, their connections and relationships, and their functions are merely illustrative and are not intended to limit the implementation of the present invention described and / or claimed herein.

[0144] As Figure 6 shown, the electronic device 10 includes at least one processor 11, and a memory communicatively connected to the at least one processor 11, such as a read-only memory (ROM) 12, a random access memory (RAM) 13, etc. The memory stores a computer program executable by the at least one processor. The processor 11 can execute 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 can also be stored. The processor 11, the ROM 12, and the RAM 13 are connected to each other through a bus 14. The input / output (I / O) interface 15 is also connected to the bus 14.

[0145] Multiple 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, etc.; a storage unit 18, such as a disk, an optical disc, etc.; and a communication unit 19, such as a network card, a modem, a 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.

[0146] The processor 11 can be various general-purpose and / or special-purpose processing components with processing and computing capabilities. Some examples of the processor 11 include, but are not limited to, a central processing unit (CPU), a graphics processing unit (GPU), various dedicated artificial intelligence (AI) computing chips, various processors running machine learning model algorithms, a digital signal processor (DSP), and any suitable processor, controller, microcontroller, etc. The processor 11 executes the various methods and processes described above, such as the tobacco demand data prediction method.

[0147] In some embodiments, the tobacco demand data prediction method can be implemented as a computer program, which is tangibly contained in a computer-readable storage medium, such as the storage unit 18. In some embodiments, part or all of the computer program can 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 the RAM 13 and executed by the processor 11, one or more steps of the tobacco demand data prediction method described above can be executed. Alternatively, in other embodiments, the processor 11 can be configured to execute the tobacco demand data prediction method by any other suitable means (e.g., by means of firmware).

[0148] The various embodiments of the systems and technologies described above herein can be implemented in digital electronic circuit systems, integrated circuit systems, field-programmable gate arrays (FPGA), application-specific integrated circuits (ASIC), application-specific standard products (ASSP), systems-on-chip (SOC), complex programmable logic devices (CPLD), computer hardware, firmware, software, and / or combinations thereof. These various embodiments can include: implemented in one or more computer programs, the one or more computer programs can be executed and / or interpreted on a programmable system including at least one programmable processor, the programmable processor can be a special or general-purpose programmable processor, can receive data and instructions from a storage system, at least one input device, and at least one output device, and transmit the data and instructions to the storage system, the at least one input device, and the at least one output device.

[0149] A computer program for implementing the method of the present invention can be written in any combination of one or more programming languages. These computer programs can be provided to a processor of a general-purpose computer, a special-purpose computer, or other programmable data processing device, such that when the computer programs are executed by the processor, the functions / operations specified in the flowchart and / or block diagram are implemented. The computer programs can be executed entirely on the machine, partially on the machine, executed partially on the machine and partially on a remote machine as an independent software package, or executed entirely on a remote machine or server.

[0150] In the context of the present invention, a computer-readable storage medium can 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 can include, but is not limited to, electronic, magnetic, optical, electromagnetic, infrared, or semiconductor systems, apparatus, or devices, or any suitable combination of the foregoing. Alternatively, the computer-readable storage medium can be a machine-readable signal medium. More specific examples of the machine-readable storage medium would include an electrical connection based on one or more wires, a portable computer disk, 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.

[0151] To provide interaction with a user, the systems and techniques described herein 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 the user; and a keyboard and a pointing device (e.g., a mouse or a trackball) through which the user can provide input to the electronic device. Other kinds of devices can also be used to provide interaction with the user; for example, the feedback provided to the user can be any form of sensory feedback (e.g., visual feedback, auditory feedback, or tactile feedback); and input from the user can be received in any form (including acoustic input, voice input, or tactile input).

[0152] The systems and techniques described herein can be implemented in a computing system that includes backend components (e.g., as a data server), or a computing system that includes middleware components (e.g., an application server), or a computing system that includes frontend components (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 herein), or a computing system that includes any combination of such backend components, middleware components, or frontend components. The components of the system can be interconnected with each other by digital data communication in any form or medium (e.g., a communication network). Examples of communication networks include: local area network (LAN), wide area network (WAN), target blockchain network, and the Internet.

[0153] A computing system can include a client and a server. The client and the server are generally remote from each other and typically interact through a communication network. The client-server relationship is created by computer programs running on respective computers and having a client-server relationship with each other. The server can be a cloud server, also known as a cloud computing server or a cloud host, which is a host product in the cloud computing service system, and solves the defects of difficult management and weak business scalability existing in traditional physical hosts and VPS services.

[0154] It should be understood that the various forms of processes shown above can be used, with steps reordered, added, or deleted. For example, the steps recited in the present invention can be executed in parallel, sequentially, or in a different order, as long as the desired results of the technical solution of the present invention can be achieved, and no limitation is imposed herein.

[0155] The above specific embodiments do not constitute a limitation on the protection scope of the present invention. Those skilled in the art should understand that various modifications, combinations, sub-combinations, and substitutions can be made according to design requirements and other factors. Any modifications, equivalent substitutions, and improvements made within the spirit and principles of the present invention shall be included within the protection scope of the present invention.

Claims

1. A tobacco demand data prediction method, characterized in that: include: Acquire the initial tobacco demand data corresponding to the predetermined tobacco category to be predicted within a preset time period after the current moment; wherein the initial tobacco demand data includes the predicted tobacco demand data corresponding to the tobacco category to be predicted at multiple preset time points; the multiple preset time points are obtained by dividing the preset time period according to a preset time step; Acquire the allocation type information corresponding to the tobacco category to be predicted and the holiday information corresponding to the preset time period; wherein the allocation type information is used to characterize the tobacco allocation type to which the tobacco category to be predicted belongs; and the holiday information is used to characterize whether the preset time period includes a preset target holiday; The initial tobacco demand data, the allocation type information, and the holiday information are processed according to the pre-trained tobacco demand prediction model to predict the target tobacco demand data corresponding to the tobacco category to be predicted within the preset time period; Among them, the tobacco demand prediction model is obtained by training a pre-constructed deep learning model based on the predicted demand data corresponding to the sample tobacco category in the historical time period, the allocation type information corresponding to the sample tobacco category, the festival information corresponding to the historical time period and the actual tobacco demand data corresponding to the sample tobacco category in the historical time period.

2. The tobacco demand data prediction method according to claim 1, characterized in that: The tobacco demand prediction model includes an embedding layer, a long short-term memory module, an attention layer and a fully connected module; The pre-trained tobacco demand prediction model is used to process the initial tobacco demand data, the allocation type information, and the holiday information to predict the target tobacco demand data corresponding to the tobacco category to be predicted within the preset time period, including: Performing vector conversion on the transfer type information and the holiday information based on the embedding layer to obtain a transfer type embedding vector and a holiday embedding vector; The allocation type embedding vector, the festival embedding vector and the initial tobacco demand data are processed based on the long short-term memory module to obtain a tobacco demand feature sequence; wherein the tobacco demand feature sequence includes tobacco demand features corresponding to the tobacco category to be predicted at multiple preset time points; Weighting the tobacco demand feature sequence based on the attention layer to obtain a target feature sequence; The target feature sequence is converted based on the fully connected module to obtain the target tobacco demand data corresponding to the tobacco category to be predicted within the preset time period.

3. The tobacco demand data prediction method according to claim 2, characterized in that: The long short-term memory module includes an input layer, a first bidirectional long short-term memory layer, and a second bidirectional long short-term memory layer; the long short-term memory module is used to process the allocation type embedding vector, the festival embedding vector, and the initial tobacco demand data to obtain a tobacco demand feature sequence, including: Based on the input layer, the allocation type embedding vector, the festival embedding vector and the initial tobacco demand data are vector-combined to obtain an input vector; Performing feature extraction on the input vector based on the first bidirectional long short-term memory layer to obtain a first feature sequence; Performing residual processing on the first feature sequence to obtain a first residual feature; Based on the second bidirectional long short-term memory layer, feature extraction and fusion are performed on the first feature sequence and the first residual feature to obtain a tobacco demand feature sequence.

4. The tobacco demand data prediction method according to claim 2, characterized in that: The fully connected module includes a first fully connected layer, a second fully connected layer and an output layer; the target feature sequence is converted based on the fully connected module to obtain the target tobacco demand data corresponding to the tobacco category to be predicted within the preset time period, including: Performing nonlinear transformation on the target feature sequence based on the first fully connected layer to obtain a first feature sequence to be processed; Converting the first feature sequence to be processed based on the second fully connected layer to obtain a second feature sequence to be processed; The second feature sequence to be processed is converted based on the output layer to obtain target tobacco demand data corresponding to the tobacco category to be predicted within the preset time period.

5. The tobacco demand data prediction method according to claim 1, characterized in that: Also includes: The tobacco demand prediction model is obtained through training; The training to obtain a tobacco demand prediction model includes: Acquire multiple training sample data; wherein the training sample data includes predicted demand data corresponding to the sample tobacco category in a historical time period, allocation type information corresponding to the sample tobacco category, target holiday information corresponding to the historical time period, and actual tobacco demand data corresponding to the sample tobacco category in the historical time period; The pre-constructed deep learning model is trained according to the plurality of training sample data to obtain a tobacco demand prediction model.

6. The tobacco demand data prediction method according to claim 5, characterized in that: The pre-built deep learning model is trained according to the plurality of training sample data to obtain a tobacco demand prediction model, including: For the plurality of training sample data, the predicted demand data, the transfer type information and the holiday information in the current training sample data are input into the deep learning model to obtain the model predicted demand data; According to the model predicted demand data and the actual tobacco demand data in the current training sample data, a target loss value is determined, and the model parameters in the deep learning model are corrected based on the target loss value. The convergence of the loss function in the deep learning model is used as the training goal to obtain a tobacco demand prediction model.

7. The tobacco demand data prediction method according to claim 6, characterized in that: The step of determining a target loss value according to the model predicted demand data and the actual tobacco demand data in the current training sample data includes: Performing loss processing on the model predicted demand data and the actual tobacco demand data according to a first loss function to obtain a first loss value; Determining a second loss function according to the model predicted demand data and the actual tobacco demand data, and performing loss processing on the model predicted demand data and the actual tobacco demand data according to the second loss function to obtain a second loss value; Performing loss processing on the model predicted demand data and the actual tobacco demand data according to a third loss function to obtain a third loss value; Performing loss processing on the model predicted demand data and the actual tobacco demand data according to a fourth loss function to obtain a fourth loss value; The first loss value, the second loss value, the third loss value, and the fourth loss value are added to obtain a target loss value.

8. The tobacco demand data prediction method according to claim 6, characterized in that: The determining of the second loss function according to the model predicted demand data and the actual tobacco demand data comprises: Determine the absolute value of the difference between the model predicted demand data and the actual tobacco demand data to obtain a first value; Determine a ratio between the first value and the actual tobacco demand data to obtain a second value; When the second value is not greater than a preset error threshold, using a mean square error loss function as a second loss function; When the second value is greater than the preset error threshold, the weighted error loss function is used as the second loss function.

9. A tobacco demand data prediction device, characterized in that: include: A data acquisition module, used to acquire the initial tobacco demand data corresponding to the predetermined tobacco category to be predicted within a preset time period after the current moment; wherein the initial tobacco demand data includes the predicted tobacco demand data corresponding to the tobacco category to be predicted at multiple preset time points; the multiple preset time points are obtained by dividing the preset time period according to a preset time step; An information acquisition module, used to acquire the allocation type information corresponding to the tobacco category to be predicted and the holiday information corresponding to the preset time period; wherein the allocation type information is used to characterize the tobacco allocation type to which the tobacco category to be predicted belongs; and the holiday information is used to characterize whether the preset time period includes a preset target holiday; A tobacco demand prediction module is used to process the initial tobacco demand data, the allocation type information, and the holiday information according to a pre-trained tobacco demand prediction model to predict the target tobacco demand data corresponding to the tobacco category to be predicted within the preset time period; wherein the tobacco demand prediction model is obtained by training a pre-constructed deep learning model based on the predicted demand data corresponding to the sample tobacco category within the historical time period, the allocation type information corresponding to the sample tobacco category, the holiday information corresponding to the historical time period, and the actual tobacco demand data corresponding to the sample tobacco category within the historical time period.

10. An electronic device, characterized in that: The electronic device comprises: at least one processor; and a memory communicatively connected to the at least one processor; wherein, The memory stores a computer program executable by the at least one processor, and the computer program is executed by the at least one processor so that the at least one processor can perform the tobacco demand data prediction method according to any one of claims 1 to 8.