New tea drink sales volume prediction method and system based on graph neural network
Through the graph neural network combined with the graph convolution network and the long-term and short-term memory network, a new tea beverage sales prediction model is built, which solves the problem that the existing technology cannot effectively consider the complex characteristics of the new tea beverage industry, and achieves more accurate sales forecasting and cost control.
Patent Information
- Application Number
- CN202411329147.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-09-24
- Publication Date
- 2025-01-07
- Estimated Expiration
- 2044-09-24
AI Technical Summary
The existing new tea beverage sales forecast method cannot effectively consider factors such as short product life cycle, many new products, many holiday activities and business district effects, resulting in poor prediction results.
Using a graph neural network-based method, the store topology structure is constructed by combining graph convolution networks and long-term memory networks, and the characteristics of historical sales volume, holidays, promotional activities, weather conditions are used to predict, and time series and spatial characteristics are combined. Output future sales.
It improves the accuracy of new tea beverage sales forecasts, can accurately predict sales volumes of each store, reduce out-of-stock and inventory costs, and adapt to the complex characteristics of the new tea beverage industry, including the predictive ability of emergencies.
Smart Images

Figure CN119273387A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of sales forecasting in the new tea beverage industry, and in particular to a new tea beverage sales forecasting method and system based on a graph neural network. Background Art
[0002] The new tea beverage industry is developing rapidly, and the sales forecasting technology and procurement replenishment management of the supply chain have become one of the core competitiveness of enterprise operation management. The data used in the new tea beverage sales forecasting technology is diverse and highly complex, so it is particularly important to improve the accuracy of sales forecasts. If the sales forecast value is too high, it will cause excessive replenishment of goods, resulting in inventory backlogs, slow turnover, insufficient working capital and other problems, which will have a great impact on the operation of the enterprise; if the sales forecast value is too low, it will cause problems such as shortage of goods, loss of profits, and reduced customer service levels.
[0003] There are three main methods for current sales forecasting:
[0004] 1. Directly use historical sales data for moving average and exponential smoothing forecasting methods.
[0005] 2. Prediction methods that use time series and machine learning to perform regression fitting on sales feature data, such as ARIMA, XGBoost, and LightGBM.
[0006] 3. Methods that use deep neural networks to automatically construct features for modeling and prediction, such as RNN, LSTM, and DeepAR.
[0007] The rapid development of the service industry and customers' personalized demand for beverages have resulted in new tea beverages having characteristics such as short life cycle, frequent new products, numerous holiday activities and obvious business district effects. Based on the above modeling and prediction method, it is impossible to simultaneously consider the impact of factors such as short life cycle, many new products, many holiday activities and business district POI information, and thus it is impossible to improve the accuracy. Summary of the invention
[0008] The purpose of the present invention is to overcome the shortcomings and deficiencies of the prior art and to provide a new tea beverage sales prediction method based on graph neural network, which can well solve the problem of poor prediction effect caused by industry characteristics such as short life cycle of new tea beverages, many holidays and promotional activities, frequent new product launches, and obvious business district effect.
[0009] Another object of the present invention is to provide a new tea beverage sales prediction system based on graph neural network.
[0010] The purpose of the present invention is achieved through the following technical solutions:
[0011] A new tea beverage sales prediction method based on graph neural network includes the following steps:
[0012] S1, data collection stage, collects store product sales data and store basic feature layer data at different historical time points;
[0013] The basic feature layer data of the store includes two categories: numerical type data and enumeration type data;
[0014] Numerical data includes age information of consumers, income information of consumers, consumption level information of POI business districts, and latitude and longitude information of POI business districts, etc.
[0015] Enumeration type data includes educational background information of consumers, consumption habits of consumers, POI business district information, category structure information, coupon information, promotional activity information, weather conditions information, and holiday information, etc.
[0016] S2. In the preprocessing stage of store product sales data, the abnormal sales data of products are detected by combining the box plot technology with the coefficient of variation. The abnormal sales data of products include abnormally high sales data, abnormally low sales data and missing sales data.
[0017] The abnormally high sales data refers to the sales data exceeding 95% thereof, and the abnormally low sales data refers to the sales data below 5% thereof. The abnormally high sales data and the abnormally low sales data are smoothed respectively, while retaining the temporal regularity of the sales sequence itself;
[0018] In the case of missing sales data, similar stores, similar categories, similar products, similar years, similar quarters, similar months, and similar weeks are used to fill in the missing values of historical sales data;
[0019] S3, during the preprocessing phase of the store basic feature layer data, for numerical data, bucket processing is performed according to the data distribution, and it is converted into enumeration features, such as converting the consumer group income into three levels of high, medium and low; for enumeration data, such as weather including sunny, cloudy, rainy, etc., it is output to the Embedding layer to obtain all the preprocessed feature data; in addition, the historical sales volume data corresponding to all the above feature data are taken out to establish a learning sample between feature data and sales volume;
[0020] S4, prediction model training stage, using graph neural network, the features output by the embedding layer are passed through the pooling layer, fusion layer, and fully connected layer to train the prediction model;
[0021] S5: Prediction stage: Use the trained model to predict sales volume at future time nodes.
[0022] The prediction model is a trained graph neural network model, which uses the store's historical sales volume, holidays, promotional activities, and weather conditions as the basic feature layer data, and uses the long short-term memory network LSTM to extract time series features; uses the city where the store is located, the type of business district, the consumer group, the attributes of new products, etc. as the basic feature layer data, and uses the graph convolution network GCN to extract spatial features; combines the time series features with the spatial features to output the predicted results of store sales at future time points. These are the two main components of the entire graph neural network model. In addition, it also includes the activation function ReLU and the fully connected layer. The role of the activation function ReLU is to increase the nonlinear relationship between the layers of the neural network and improve the accuracy of fitting complex tasks. The role of the fully connected layer is to map high-dimensional features to low-dimensional space and improve the learning ability of the model.
[0023] The prediction model is constructed as follows:
[0024] All stores are defined as a network G, and an undirected weighted graph G = (V, E) is used to describe the topological structure of the store network. Each store is a node, V is the set of store nodes, V = {v1, v2, ..., v N}, N is the number of nodes, and E represents the set of edges;
[0025] Construct the feature matrix, X t It is used to represent the feature matrix of the store at time node t;
[0026] The sales volume prediction problem of store products is modeled as learning the mapping function f under the constraints of the topological network G and the feature matrix X to predict the sales volume of the store at the future time node, defined as y t+1 ;
[0027] get:
[0028] [y t+1 ] = f(G; (X t ,));
[0029] The mapping function f is a graph neural network model trained using historical data, including a graph convolutional neural network GCN, an activation function ReLU layer, a long short-term memory network LSTM and a fully connected layer connected in sequence, which outputs future store sales forecasts.
[0030] In step S2, the abnormal sales data is detected by combining the box plot technique with the coefficient of variation, as follows:
[0031] In the box plot technique, the first quartile Q1, the second quartile Q2 and the third quartile Q3 are respectively equal to the values corresponding to the 25th, 50th and 75th percentiles of all the values in the sales data arranged from small to large; the gap between the third quartile and the first quartile is also called the interquartile range IQR; define the outlier condition 1: a value less than Q1-3*IQR or greater than Q3+3*IQR;
[0032] The coefficient of variation CV is introduced. The coefficient of variation CV is equal to the standard deviation of store sales divided by the mean of store sales. The second abnormal value condition is defined: the coefficient of variation CV greater than 1.5 is abnormal sales data;
[0033] Combining the box plot technology and the coefficient of variation, the sales data that meets both the outlier condition 1 and the outlier condition 2 are outliers. That is, the sales data simultaneously meets the following conditions: the sales data is less than Q1-3*IQR or greater than Q3+3*IQR, and its coefficient of variation CV is greater than 1.5.
[0034] In step S2, the missing values of the time series data of historical sales are filled as follows:
[0035] When the sales data of a product at a certain point in time is missing, use the average value of similar stores, similar categories, similar products, similar years, similar quarters, similar months, and similar weeks to fill in the gaps;
[0036] For example, if the sales data of product 001 of store A on July 29, 2022 (Friday) is missing, according to the cyclical sales characteristics of the new tea beverage industry, the average sales of this product in this store on all Fridays in July 2022 is used to fill it. If all sales data of this product in July 2022 is still missing, the average sales of all Fridays in the similar month of June 2022 is used to fill it.
[0037] Similarly, for cases where data for multiple months are missing, the average data for the same period of the previous quarter or the previous year will be used to fill the gap; for products with a large amount of missing data, the average data for products in the same category will be used to fill the gap.
[0038] In step S4, the spatial features of the store business district are extracted in the following manner:
[0039] The Euclidean distance is calculated using longitude and latitude, where the target store is taken as the central node and the Euclidean distance between other stores and the central node is taken as the first distance feature;
[0040] According to the GDP of each city in the National Bureau of Statistics, the GDP of the city where other stores are located is subtracted from the GDP of the city where the central node is located, and the absolute value is taken for normalization as the second distance feature;
[0041] Subtract the GDP of the business district where other stores are located from the GDP of the business district where the central node is located and take the absolute value for normalization as the third distance feature;
[0042] Assign certain weights to the first, second and third distance features, multiply the weights by them respectively and add them up to get the fourth distance feature.
[0043] In step S3, the bucketing process is specifically as follows: performing a variety of different bucketing operations on the features to be processed, performing variance analysis on the bucketed data and the sales data, and determining the best bucketing method based on the statistics F and p-value of the variance analysis.
[0044] Another object of the present invention is achieved by the following technical solutions:
[0045] A new tea beverage sales prediction system based on graph neural network includes a data acquisition module, a data preprocessing module, a prediction model training module and a prediction module; wherein,
[0046] The data acquisition module is used to collect characteristic data of the store; the characteristic data of the store includes historical sales volume of goods, consumer groups, POI business district, new product attributes, category structure, coupon information, promotional activity information, weather condition information, time attributes and holiday information, etc.;
[0047] The data preprocessing module uses a box plot technique combined with the coefficient of variation to detect abnormal sales data, and smoothes the abnormal sales data to remove abnormal points while retaining the time series law of the sales itself; the abnormal data includes abnormally high sales data and abnormally low sales data, abnormally high sales data refers to sales data exceeding 95% of it, and abnormally low sales data refers to sales data below 5% of it; according to the missing data, similar stores, similar categories, similar products, similar years, similar quarters, similar months, and similar weeks are used to fill the missing values of historical sales data;
[0048] Numerical data and enumeration data. For numerical data, such as consumer income, coupon denomination, etc., this type of data needs to be bucketed according to data distribution and converted into enumeration features, such as consumer income converted into three levels of high, medium and low. For enumeration data, such as weather including sunny, cloudy, rainy, etc., the enumeration data is converted into Embedding embedding vectors to obtain all feature data after preprocessing. In addition, the historical commodity sales data corresponding to all the above feature data are taken out to establish learning samples between feature data and sales.
[0049] The prediction model training module uses a graph neural network to extract the spatial and temporal features of the store from the data output by the Embedding layer, and then trains the prediction model through the pooling layer, fusion layer, and fully connected layer; the spatial features of the store include spatial features such as the store city, store area, and store business district; the temporal features of the store include temporal features such as the store's historical sales volume, holidays, promotional activities, and weather data;
[0050] The prediction module uses the trained model to predict store sales at future time points;
[0051] At the same time, the present invention provides:
[0052] A server comprises a processor and a memory, wherein the memory stores at least one program, and the program is loaded and executed by the processor to implement the new tea beverage sales prediction method based on graph neural network.
[0053] A computer-readable storage medium stores at least one program, which is loaded and executed by a processor to implement the new tea beverage sales prediction method based on graph neural network.
[0054] Compared with the prior art, the present invention has the following advantages and beneficial effects:
[0055] 1. The present invention uses graph neural networks to build algorithm models of spatial features and temporal features, which can predict store sales in scenarios such as holidays, promotional activities, weather conditions, different store business districts, and different consumer groups, solving the problems of short life cycle of new tea beverages, degradation of old products, and fast speed of new products. At the same time, it constructs a store-based graph network topology structure, uses an undirected weighted graph to model store information data, and fully refers to the graph vector features of surrounding nodes and current nodes. It can accurately predict the sales volume of each store, reduce product shortages and inventory costs, and increase store profits.
[0056] 2. Considering the uniqueness and suddenness of new tea beverage industry activities and other complex characteristics not found in other industries, the technical solution provided by the present invention can predict sudden events and corresponding sales, such as "the first cup of milk tea in autumn" and "the first day of school", which is a capability that other sales prediction methods do not have.
[0057] 3. The graph neural network structure constructed by the present invention can perform extended learning of spatial features between multiple nodes to improve the accuracy of prediction. BRIEF DESCRIPTION OF THE DRAWINGS
[0058] Figure 1 This is a flow chart of the new tea beverage sales prediction method based on graph neural network described in the present invention.
[0059] Figure 2 This is an architecture diagram of the prediction model based on graph neural network. DETAILED DESCRIPTION
[0060] For ease of understanding, the following is an explanation of the professional terms involved in the new tea drink of the present invention:
[0061] In the new tea beverage sales forecast, holidays include: the first day of school in autumn, the first cup of milk tea in autumn, Teacher's Day, May Day Golden Week, National Day Golden Week, Valentine's Day, 520, Christmas, etc.
[0062] Promotion activity data includes: start date, end date, applicable stores, applicable categories, applicable products, activity level, and activity investment.
[0063] Weather data includes: maximum temperature of the day, minimum temperature of the day, weather type, wind direction, air quality, and precipitation.
[0064] Store types include: commercial street stores, subway entrance stores, office building stores, stores inside shopping malls, stores outside shopping malls, stores outside universities, street stores, etc.
[0065] Store business district data include: business district name, longitude, latitude, POI major category, POI medium category, POI minor category, province, city, district, county, detailed address, city GDP, distance from the store, whether it is indoors, floor, business district rating, per capita consumption, and business hours.
[0066] Product data includes: category, sales volume, price, category, and brand.
[0067] Consumer demographic data includes: taste, education, age, occupation, gender, preferences, and income.
[0068] Coupon information includes: applicable stores, discount type, expiration date, redemption rate, distribution channel, distribution quantity, and applicable products.
[0069] New product attributes include: materials contained, shelf time, product category, specifications, and taste.
[0070] Among them, since coupons are frequently used in the new tea beverage industry, introducing coupon information is more in line with real business scenarios and is conducive to model training.
[0071] Different from other model inputs, the features of this model input are all the contents of the nine features described above. The present invention mainly considers two aspects:
[0072] On the one hand, compared with other industries, the new tea beverage industry has specific industry attributes that have a more obvious impact on sales, such as weather, store location, customer flow, and competitor locations, which have a huge impact on the sales of new tea beverage stores.
[0073] On the other hand, through parameter adjustment, graph neural networks have the ability to learn thousands or even tens of thousands of features at the same time. Features of different dimensions allow the model to consider different factors, better fit the real scene, and improve the accuracy of model learning.
[0074] Inputting nine features and combining them to generate new features is to enable the model to learn better and improve the accuracy of prediction.
[0075] The present invention is further described in detail below in conjunction with embodiments and drawings, but the embodiments of the present invention are not limited thereto.
[0076] like Figure 1 ,The process of the new tea beverage sales prediction method based on graph neural network is as follows:
[0077] The basic idea of using graph neural networks to predict the sales volume of new tea beverage stores is to build a network topology structure centered on the store;
[0078] First, distributed processing technology is used to clean and aggregate massive amounts of data;
[0079] Get historical store sales data;
[0080] Get all the characteristic data of the store;
[0081] Get all the characteristic data of the product;
[0082] Obtain all characteristic data of consumer groups;
[0083] Obtain other data, such as weather conditions, holiday information, promotional activities, coupon information and other characteristic data;
[0084] The historical sales data is cleaned and processed. The main operations are as follows:
[0085] Due to promotional activities, product removal, climate, special events, etc., sales data may rise or fall suddenly. The influence of these outliers needs to be eliminated in model prediction. The present invention uses a technical method combining box plot and coefficient of variation to detect abnormal sales data and smooth it.
[0086] In the box plot technique, the first quartile Q1, the second quartile Q2, and the third quartile Q3 are respectively equal to the values corresponding to the 25th, 50th, and 75th percentiles of all the values in the sales data arranged from small to large. The gap between the third quartile and the first quartile is also called the interquartile range IQR. Definition of outlier condition 1: less than Q1-3*IQR or greater than Q3+3*IQR.
[0087] In order to make up for the shortcomings of box plot detection, the coefficient of variation (CV) is introduced. CV is equal to the standard deviation divided by the mean. The second outlier condition is defined: CV greater than 1.5 indicates abnormal sales data.
[0088] Combining the box plot technology and the coefficient of variation, i.e., condition 1 and condition 2, the present invention finally defines the abnormal value of sales data as a value whose CV is greater than 1.5 and is less than Q1-3*IQR or greater than Q3+3*IQR.
[0089] After outliers are detected, the abnormally high or low sales values are smoothed to remove the outliers.
[0090] Fill missing values in historical sales data, mainly as follows:
[0091] Due to out-of-stock, inaccurate data and other reasons, sales data may be missing. The present invention fills in the missing sales data based on historical sales data.
[0092] When a product is missing at a certain point in time, it is filled in using the average value of similar stores, similar categories, similar products, similar years, similar quarters, similar months, and similar weeks.
[0093] For example, if the sales data of product 001 of store A on July 29, 2022 (Friday) is missing, according to the cyclical sales characteristics of the new tea beverage industry, the average sales of this product in this store on all Fridays in July 2022 is used to fill it. If all sales data of this product in July 2022 is still missing, the average sales of all Fridays in the similar month of June 2022 is used to fill it.
[0094] Similarly, if data for multiple months are missing, the average data of the same period of the previous quarter or the same period of the previous year will be used to fill the gap. For products with a large amount of missing data, the average data of products in the same category will be used to fill the gap.
[0095] The spatial feature extraction and processing of store business district content are mainly as follows:
[0096] The Euclidean distance is calculated using longitude and latitude, where the target store is taken as the central node and the Euclidean distance between other stores and the central node is taken as the first distance feature;
[0097] According to the GDP of each city in the National Bureau of Statistics, the GDP of the city where other stores are located is subtracted from the GDP of the city where the central node is located, and the absolute value is taken for normalization as the second distance feature;
[0098] Subtract the GDP of the business district where other stores are located from the GDP of the business district where the central node is located and take the absolute value for normalization as the third distance feature;
[0099] The first, second and third distance features are given certain weights, and the first, second and third distance features are multiplied by the weights and accumulated to obtain the fourth distance feature. Based on the fourth distance feature, the node centrality of different neighboring nodes is determined.
[0100] Compared with the commonly used bucketing method, the present invention selects and judges based on the statistics of variance analysis, which is a more reasonable bucketing method. For the new tea beverage industry, a large amount of continuous data is converted into discrete data, and a more reasonable bucketing method can more effectively express continuous data.
[0101] The present invention converts all continuous data in the above input data into discrete data. In other words, all the data after processing are discrete data. Due to the characteristics of the new tea beverage industry, the data generally has strong volatility and more abnormalities. Discrete features have strong robustness against abnormal data and improve the stability of the model. At the same time, nonlinear relationships are also introduced to improve the expressive power of the model.
[0102] For discrete features such as business district type, consumer gender, occupation, weather type, and discrete features converted from continuous features by bucketing, they are first converted into one-hot encoding and then embedded learning is used. Embedding embedding learning can convert sparse features of one-hot encoding into dense features, thereby improving computational efficiency.
[0103] The present invention introduces the embedding layer to enhance the expressiveness of features on the one hand, and improve the model operation efficiency on the other hand. It comes from real business scenarios, where the data is very sparse. Very sparse and huge matrices are difficult to calculate. In contrast, dense features are easier to derive, which is conducive to model back propagation and speeds up operation.
[0104] Establish the topological network relationship between stores and stores, stores and products, products and products, and products and consumer groups. The entire graph neural network is defined as the graph neural network G;
[0105] In the graph neural network G, establish an adjacency matrix A, a degree matrix D, and obtain the feature matrix X;
[0106] In order to consider the characteristics of its own nodes, an identity matrix I is added to obtain a new adjacency matrix The formula is N is the node number, I N is the identity matrix of the Nth node;
[0107] In order to normalize the aggregated features, take the degree matrix Calculate degree matrix The inverse matrix Because the degree matrix is a diagonal matrix, so Each element in is the degree matrix The reciprocal of the corresponding term in ;
[0108] Using the Laplace regularization of the graph to ensure the symmetry and normalization of the graph, define as the new adjacency matrix;
[0109] The adjacency matrix Multiplying with the feature matrix X, we get the feature matrix of the neighboring nodes, and we get
[0110]
[0111] Construct a two-layer graph convolution structure, the formula is:
[0112]
[0113] The graph convolution structure is modeled at time t, and we get
[0114]
[0115] Among them, W (0) With W (1) Represents the weight matrix of the first and second layers. The weight matrix is learned by model training. σ and ReLU represent activation functions.
[0116] In order to obtain time series features from historical sales, holidays, promotions, weather and other data, it is necessary to introduce a deep neural network that processes sequence data. The most commonly used is the recurrent neural network (RNN) structure. However, in order to avoid problems such as gradient vanishing and gradient exploding in long-term predictions, it is more appropriate to use the long short-term memory model (LSTM), because its gating mechanism can memorize as much long-term information as possible and extract long-term time series features related to stores.
[0117] We built a graph neural network architecture, using graph convolutional networks (GCNs) and long short-term memory (LSTMs) to simultaneously capture spatial and temporal dependency features in store data.
[0118] Define h t-1 Represents the hidden state output of the network at time t-1. The specific calculation process is as follows:
[0119] f(X t , A) represents the graph convolution process at time t, refer to the definition above;
[0120] W and b represent the weight and bias of the model training process, respectively;
[0121] Use q t ,i t ,ot represents forget gate, input gate, and output gate, and the W and b subscripts represent the corresponding weights and biases, respectively.
[0122] q t =σ(W q [f(X t ,A),h t-1 ]+b q );
[0123] i t =σ(W i [f(X t ,A),h t-1 ]+b i );
[0124] o t =σ(W o [f(X t ,A),h t-1 ]+b o );
[0125] The cell state of the computation network is c t , tanh is the activation function, W c and b c Represent weights and biases:
[0126] c t =q t *c t-1 +i t *tanh(W c [f(X t ,A),h t-1 ]+b c );
[0127] Calculate the network hidden state output at time t as h t :
[0128] h t =o t *tanh(c t );
[0129] After the fully connected layer, we get the store sales forecast result at time t, W y and b y For weights and biases:
[0130] y t =W y *h t +b y ;
[0131] according to Figure 2The prediction architecture of the present invention is implemented based on the graph neural network as follows:
[0132] Each matrix mainly includes nine major features: consumer groups, POI business districts, new product attributes, product data, coupons, promotional activities, weather conditions, time attributes, and holidays.
[0133] Compared with traditional graph neural networks, the model architecture of the present invention does not pass all features through the LSTM layer and the graph convolutional network layer after the Embedding layer. Instead, the spatial features flow into the graph convolutional network layer, and the temporal features flow into the LSTM layer. In the graph convolutional network layer, the convolution result is calculated according to the set convolution kernel, and the bias is added to form the result. Considering the irrationality of values less than 0 and the nonlinear relationship of the increase function, the ReLU activation function is set to output the final result. In the LSTM layer, the forget gate, input gate, output gate, etc. are set to update the state.
[0134] The temporal features and spatial features are loaded into different window vector matrices of the same batch, and the parameters are updated through back propagation to update the output of different window vector matrices, and then weighted averaged to the same dimension for fusion.
[0135] In order not to affect the nonlinear relationship between the LSTM layer and the graph convolutional network layer, the final results of the LSTM layer and the graph convolutional network layer are input into the Pooling layer respectively. The Pooling layer uses the Average function to compress and reduce the dimension of the data.
[0136] The data is input into the Batch Norm and Concatenation layer for module fusion and batch normalization. The introduction of the BatchNorm and Concatenation layer can eliminate the data dimension, speed up the training speed, and improve the model accuracy.
[0137] The data is input into the fully connected layer, and the high-dimensional feature map is connected to the modeling results to infer the future sales forecast results.
[0138] After testing with experimental data, the present invention is applicable to scenarios such as conventional product sales forecasting, new product sales forecasting, promotional activity sales forecasting, and coupon activity sales forecasting.
[0139] The above embodiments are preferred implementation modes of the present invention, but the implementation modes of the present invention are not limited to the above embodiments. Any other changes, modifications, substitutions, combinations, and simplifications that do not deviate from the spirit and principles of the present invention should be equivalent replacement methods and are included in the protection scope of the present invention.
Claims
1. A new tea beverage sales prediction method based on graph neural network, comprising the following steps: S1, data collection stage, collects store product sales data and store basic feature layer data at different historical time points; The store basic feature layer data includes two categories: numerical type data and enumeration type data; S2. In the preprocessing stage of store product sales data, the abnormal sales data are detected by combining the box plot technology with the coefficient of variation. The abnormal sales data include abnormally high sales data, abnormally low sales data and missing sales data. The abnormally high sales data refers to sales data exceeding the 95% percentile, and the abnormally low sales data refers to sales data below the 5% percentile. The abnormally high and abnormally low sales data are smoothed respectively to retain the time series regularity of the sales itself; In the case of missing sales data, similar stores, similar categories, similar products, similar years, similar quarters, similar months, and similar weeks are used to fill in the missing values of historical sales; S3: In the preprocessing stage of store basic feature layer data, for numerical data, bucket processing is performed according to data distribution and converted into enumeration type features; for enumeration type data, it is converted into Embedding embedding vectors to obtain all feature data after preprocessing; in addition, the historical sales data corresponding to all the above feature data are taken out to establish learning samples between feature data and sales; S4, prediction model training phase, using graph neural network, embedding vectors are passed through pooling layer, fusion layer, and fully connected layer to train the prediction model; S5: Prediction stage: Use the trained model to predict sales volume at future time nodes.
2. According to the new tea beverage sales prediction method based on graph neural network in claim 1, the prediction model is a trained graph neural network model, which takes the store's historical sales volume, holidays, promotional activities, and weather conditions as the basic feature layer data, and uses the long short-term memory network LSTM to extract time series features; takes the city where the store is located, the type of business district, the consumer group, the attributes of new products, etc. as the basic feature layer data, and uses the graph convolutional network GCN to extract spatial features; combines time series features and spatial features as model input, and outputs the predicted results of store sales at future time points.
3. According to the new tea beverage sales prediction method based on graph neural network according to claim 1, the prediction model is constructed as follows: Define all stores as a network G and construct the feature matrix X at time t t , used to represent the feature matrix of store products at time node t; The sales volume prediction problem of store products is modeled as learning the mapping function f under the constraints of the topological network G and the feature matrix X to predict the sales volume of the store at T time nodes in the future, defined as y t+1 ,y t+2 ,...,y t+T ; get: [y t+1 ,y t+2 ,…,y t+T ]=f(G;(X t-n ,…,X t-1 ,X t ,)); The mapping function f is a graph neural network model trained using historical data, including a graph convolutional neural network GCN, an activation function ReLU layer, a long short-term memory network LSTM, and a fully connected layer connected in sequence, which outputs future store sales forecasts.
4. According to the new tea beverage sales prediction method based on graph neural network in claim 1, in step S2, the abnormal sales data is detected by combining the box plot technology with the coefficient of variation, as follows: In the box plot technique, the first quartile Q1, the second quartile Q2 and the third quartile Q3 are respectively equal to the corresponding values of the 25th, 50th and 75th percentiles of all the values in the sales data arranged from small to large; the gap between the third quartile and the first quartile is also called the interquartile range IQR; define the outlier condition 1: a value less than Q1-3*IQR or greater than Q3+3*IQR; The coefficient of variation CV is introduced. The coefficient of variation CV is equal to the standard deviation of store sales divided by the mean of store sales. The second abnormal value condition is defined: the coefficient of variation CV greater than 1.5 is abnormal sales data; Combining the box plot technique and the coefficient of variation, the sales data that meets both outlier condition one and outlier condition two are outliers.
5. According to the new tea beverage sales prediction method based on graph neural network according to claim 1, in step S4, the spatial features of the store business district are extracted in the following manner: The Euclidean distance is calculated by longitude and latitude, where the target store is taken as the central node and the Euclidean distance between other stores and the central node is taken as the first distance feature; According to the GDP of each city in the National Bureau of Statistics, the GDP of the city where other stores are located is subtracted from the GDP of the city where the central node is located, and the absolute value is taken for normalization as the second distance feature; Subtract the GDP of the business district where other stores are located from the GDP of the business district where the central node is located and take the absolute value for normalization as the third distance feature; Assign certain weights to the first, second and third distance features, multiply the weights by them respectively and add them up to get the fourth distance feature.
6. According to the new tea beverage sales prediction method based on graph neural network according to claim 1, the bucketing processing in step S3 is specifically: using the features to be processed to perform a variety of different bucketing methods, performing variance analysis on the bucketed data and the sales data, and determining the best bucketing method based on the statistics F and p-value of the variance analysis.
7. A new tea beverage sales prediction system based on graph neural network, which includes: Data acquisition module, data preprocessing module, prediction model training module and prediction module; among them, The data acquisition module is used to collect store data, including historical sales, consumer groups, POI business districts, new product attributes, category structure, coupon information, promotional activities information, weather conditions information, holiday information and other dimensions; The data preprocessing module is divided into the preprocessing of commodity sales data and the preprocessing of the basic feature layer data of the store. For the preprocessing of sales data, the box plot technology is used in combination with the coefficient of variation to detect abnormal sales data, and the abnormal sales data is smoothed to remove abnormal points while retaining the time series law of the sales data itself; the abnormal data includes abnormally high sales data and abnormally low sales data, the abnormally high sales data refers to sales data exceeding 95% of it, and the abnormally low sales data refers to sales data below 5% of it; similar stores, similar categories, similar products, similar years, similar quarters, similar months, and similar weeks are used to fill missing values in historical sales data to restore the trend of real sales; The basic feature layer data of the store is preprocessed, which includes two categories: numerical data and enumeration data. For numerical data, this type of data needs to be bucketed according to the data distribution and converted into enumeration features; for enumeration data, the enumeration data is converted into Embedding embedding vectors to obtain all the feature data after preprocessing; in addition, the historical sales data corresponding to all the above feature data are taken out to establish learning samples between feature data and sales; The prediction model training module uses graph neural networks to extract the spatial and temporal features of stores from the Embedding vector data, and then trains the prediction model through the pooling layer, fusion layer, and fully connected layer; the spatial features of the store include spatial features such as the store city, store area, and store business district; the temporal features of the store include temporal features such as the store's historical sales volume, holidays, promotional activities, and weather data; The prediction module uses the trained model to predict store sales at future time nodes.
8. A server, characterized in that: The server includes a processor and a memory, wherein the memory stores at least one program, and the program is loaded and executed by the processor to implement the new tea beverage sales prediction method based on graph neural network as described in any one of claims 1 to 6.
9. A computer-readable storage medium, characterized in that: The storage medium stores at least one program, which is loaded and executed by the processor to implement the new tea beverage sales prediction method based on graph neural network as described in any one of claims 1 to 6.
Citation Information
Patent Citations
Method and system of predicting dynamic commodity sales
CN108876421A
Training method of sales volume prediction model, sales volume prediction method and related device
CN113888235A
Commodity sales volume prediction method and system based on graph neural network
CN116645135A
Time sequence sales volume prediction method based on space-time learning and sales volume prediction model thereof
CN117575681A
Statistical interquartile range-based commodity inventory risk early warning method and system, and computer readable storage medium
WO2021052031A1
Cited By
Data organization and time sequence prediction method and device based on space-time mapping knowledge domain
CN121524558A
Data organization and time series prediction method and apparatus based on spatiotemporal knowledge graph
CN121524558B