A new tea drink sales prediction method and system based on a graph neural network

By using a graph neural network-based approach, a sales forecasting model was constructed using graph convolutional network (GCN) and long short-term memory network (LSTM). This approach solved problems such as short product lifecycles and frequent new product launches in the new tea beverage industry, achieving higher forecasting accuracy and lower inventory costs.

CN119273387BActive Publication Date: 2026-04-14GUANGZHOU YUNYI TECH CO LTD
View PDF 1 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
GUANGZHOU YUNYI TECH CO LTD
Filing Date
2024-09-24
Publication Date
2026-04-14

AI Technical Summary

Technical Problem

Existing methods for predicting sales of new tea drinks cannot effectively take into account factors such as short product lifecycles, frequent new product launches, numerous holiday activities, and the influence of commercial districts, resulting in insufficient prediction accuracy.

Method used

A graph neural network-based approach is adopted. By collecting and preprocessing historical data, spatial features are extracted using a graph convolutional network (GCN) and temporal features are extracted using a long short-term memory network (LSTM). A mapping function is constructed by combining the ReLU activation function and a fully connected layer to predict sales.

Benefits of technology

It improves the accuracy of sales forecasting for new tea drinks, enabling precise prediction of sales changes due to unforeseen events, reducing stockouts and inventory costs, and increasing store revenue.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119273387B_ABST
    Figure CN119273387B_ABST
Patent Text Reader

Abstract

The application discloses a new tea drink sales volume prediction method and system based on a graph neural network, the method uses a graph neural network, builds an algorithm model trained based on spatial features and time sequence features, and can respectively perform store sales volume prediction under different holiday, promotion activity, weather condition, store business circle and consumer crowd scenes. By constructing a graph network topology structure based on a store, a non-directional weighted graph is used to model store information data, the influence of surrounding stores on the current store is fully considered, the sales volume of each store is predicted, the problem that a conventional method cannot accurately predict due to the short commodity life cycle, old product degradation and fast commodity new product speed of the new tea drink industry is solved, the commodity out-of-stock frequency and inventory cost are reduced, and therefore, the store income is improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of sales forecasting in the new tea beverage industry, and in particular to a method and system for forecasting sales of new tea beverages based on graph neural networks. Background Technology

[0002] The new-style tea beverage industry is developing rapidly, and supply chain sales forecasting technology and procurement replenishment management have become one of the core competencies in enterprise operation and management. The data used in new-style tea beverage sales forecasting technology is diverse and highly complex, making it particularly important to improve the accuracy of sales forecasts. If the sales forecast is too high, it will lead to excessive replenishment of goods, resulting in problems such as inventory backlog, slow turnover, and insufficient working capital, which will significantly impact the operation of the enterprise. Conversely, if the sales forecast is too low, it will lead to stockouts, profit losses, and reduced customer service levels.

[0003] There are three main methods for current sales forecasting:

[0004] One method is to directly use historical sales data for forecasting using moving averages and exponential smoothing.

[0005] II. Predictive methods that utilize time series and machine learning to perform regression fitting on sales characteristic data, such as ARIMA, XGBoost, and LightGBM.

[0006] III. Methods for automatically constructing features using deep neural networks for modeling and prediction, such as RNN, LSTM, and DeepAR.

[0007] The rapid development of the service industry and customers' personalized beverage demands have led to characteristics such as short product lifecycles, frequent new product launches, numerous holiday activities, and significant business district effects in the new tea beverage market. Based on the above modeling and prediction methods, it is impossible to simultaneously consider the impact of factors such as short product lifecycles, numerous new products, numerous holiday activities, and business district POI information, thus failing to improve accuracy. Summary of the Invention

[0008] The purpose of this invention is to overcome the shortcomings and deficiencies of the existing technology and provide a new tea beverage sales prediction method based on graph neural networks. This method can effectively solve the problem of poor prediction results caused by the short product life cycle, frequent holidays and promotional activities, frequent new product launches, and obvious business district effects of the new tea beverage industry.

[0009] Another objective of this invention is to provide a new tea beverage sales prediction system based on graph neural networks.

[0010] The objective of this invention is achieved through the following technical solution:

[0011] A novel tea beverage sales prediction method based on graph neural networks includes the following steps:

[0012] S1. Data collection phase: Collect store merchandise sales data and basic store feature layer data at different historical points in time.

[0013] The basic feature layer data of the stores includes two main categories: numerical data and enumerated data.

[0014] Numerical data includes consumer age information, consumer income information, POI business district consumption level information, and POI business district latitude and longitude information, etc.

[0015] The enumerated data types include consumer education information, consumer consumption habits information, POI business district information, product category structure information, coupon information, promotional activity information, weather information, and holiday information, etc.

[0016] S2. In the preprocessing stage of store merchandise sales data, box plot technology combined with the coefficient of variation is used to detect abnormal merchandise sales data. Abnormal merchandise sales data includes abnormally high sales data, abnormally low sales data, and missing sales data.

[0017] The abnormally high sales data refers to sales data exceeding 95% of the total sales data, and the abnormally low sales data refers to sales data below 5% of the total sales data. The abnormally high and abnormally low sales data are smoothed separately, while preserving the time sequence pattern of the sales data itself.

[0018] For cases where sales data is missing, the missing values ​​in historical sales data are filled in using methods such as similar stores, similar categories, similar products, similar years, similar quarters, similar months, and similar weeks.

[0019] S3. In the preprocessing stage of the basic feature layer data of the store, for numerical data, it is binned according to the data distribution and converted into enumerated features, such as converting consumer income into three levels: high, medium and low. For enumerated data, such as weather including sunny, cloudy and rainy, it is output to the embedding layer to obtain all the preprocessed feature data. In addition, the historical sales data corresponding to all the above feature data is extracted to establish a learning sample between feature data and sales.

[0020] S4. In the prediction model training stage, a graph neural network is used to train the prediction model by passing the features output by the embedding layer through a pooling layer, a fusion layer, and a fully connected layer.

[0021] S5. Prediction phase: Using the trained model, predict sales volume at future time points.

[0022] The prediction model is a pre-trained graph neural network model. It uses historical sales volume, holidays, promotional activities, and weather conditions as the basic feature layer data, and employs a Long Short-Term Memory (LSTM) network to extract temporal features. It uses the city where the store is located, the type of business district, the target consumer group, and the attributes of new products as the basic feature layer data, and employs a Graph Convolutional Network (GCN) to extract spatial features. Combining the temporal and spatial features, it outputs a prediction of store sales at future points in time. These are the two main components of the entire graph neural network model. In addition, it includes the ReLU activation function and fully connected layers. The ReLU activation function increases the non-linear relationship between the layers of the neural network, improving the fitting accuracy for complex tasks. The fully connected layers map high-dimensional features to a low-dimensional space, improving the model's learning ability.

[0023] The prediction model is constructed as follows:

[0024] Define all stores as a network G, and use an undirected weighted graph. This describes the topology of the store network, where each store is a node, and V is the set of store nodes. N is the number of nodes, and E represents the set of edges;

[0025] Construct the feature matrix, The feature matrix used to represent the store at time node t;

[0026] The problem of predicting the sales volume of store merchandise is modeled as learning a mapping function under the constraints of a topological network G and a feature matrix X. Predicting store sales at future points in time is defined as... ;

[0027] get:

[0028] ;

[0029] Mapping function It is a graph neural network model trained using historical data, consisting of a graph convolutional neural network (GCN), a ReLU activation function layer, a long short-term memory network (LSTM), and a fully connected layer connected in sequence, which outputs the sales prediction results for future stores.

[0030] In step S2, the method of using box plot technology combined with the coefficient of variation to detect abnormal sales data is as follows:

[0031] In box plot techniques, the first quartile (Q1), second quartile (Q2), and third quartile (Q3) are equal to the values ​​corresponding to the 25th, 50th, and 75th percentiles of all values ​​in the sales data, arranged from smallest to largest. The difference between the third quartile and the first quartile is called the interquartile range (IQR). Outlier condition one: less than Q1-3. IQR or greater than Q3+3 The value of IQR;

[0032] Introducing the coefficient of variation (CV), which is equal to the standard deviation of store sales divided by the mean of store sales, and defining outlier condition two: a coefficient of variation (CV) greater than 1.5 is considered abnormal sales data;

[0033] Based on both box plot techniques and the coefficient of variation, sales data that simultaneously meet both outlier condition one and outlier condition two are considered outliers. That is, sales data that simultaneously satisfy the following conditions: sales volume 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 value imputation of the historical sales time-series data is performed as follows:

[0035] When sales data for a product at a certain point in time is missing, it is filled in using the average value based on similar stores, similar categories, similar products, similar years, similar quarters, similar months, and similar weeks.

[0036] For example, if the sales data for product 001 in store A is missing on July 29, 2022 (Friday), based on the cyclical sales characteristics of the new tea beverage industry, the average sales of this product in all Fridays of July 2022 will be used to fill the gap. If all sales data for this product in July 2022 is still missing, the average sales of all Fridays in a similar month, June 2022, will be used to fill the gap.

[0037] Similarly, for cases where data is missing for multiple months, the average of the data from the same period of the previous quarter or the same period of the previous year is used to fill the gaps; for products with a large number of missing data, the average of products in the same category is used to fill the gaps.

[0038] In step S4, the spatial features of the store's business district are extracted in the following way:

[0039] Euclidean distance is calculated using latitude and longitude, with the target store as the central node and the Euclidean distance between other stores and the central node as the first distance feature.

[0040] Based on the GDP of each city, the GDP of the cities where other stores are located is subtracted from the GDP of the city where the central node is located, and the absolute value is normalized 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 normalize the absolute value as the third distance feature.

[0042] The first, second, and third distance features are assigned certain weights, and the weights are multiplied by the first, second, and third distance features respectively and then summed to obtain the fourth distance feature.

[0043] In step S3, the binning process specifically involves: performing various binning operations on the features to be processed, performing variance analysis on the binned data and sales data, and determining the optimal binning method based on the variance analysis statistics F and p-value.

[0044] Another objective of this invention is achieved through the following technical solution:

[0045] A new tea beverage sales prediction system based on graph neural networks 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 the characteristic data of the stores; the characteristic data of the stores includes historical sales of products, consumer groups, POI business districts, new product attributes, category structure, coupon information, promotional activity information, weather information, time attributes and holiday information, etc.

[0047] The data preprocessing module uses box plot technology combined with the coefficient of variation to detect abnormal sales data and smooth it to remove outliers while preserving the inherent temporal regularity of sales. Abnormal data includes abnormally high sales figures (over 95% of total sales) and abnormally low sales figures (below 5% of total sales). Based on missing data, the module uses methods such as similar stores, similar categories, similar products, similar years, similar quarters, similar months, and similar days of the week to impute missing values ​​in historical sales data.

[0048] Numerical data and enumerated data are processed differently. For numerical data, such as consumer income and coupon value, the data needs to be binned according to its distribution and converted into enumerated features. For example, consumer income is converted into three levels: high, medium, and low. For enumerated data, such as weather (sunny, cloudy, rainy), the enumerated data is converted into embedding vectors to obtain all preprocessed feature data. In addition, the historical sales volume data corresponding to all the above feature data is extracted to establish a learning sample between feature data and sales volume.

[0049] The prediction model training module uses a graph neural network to extract spatial and temporal features of stores from the data output from the embedding layer. Then, the data is processed through a pooling layer, a fusion layer, and a fully connected layer to train the prediction model. The spatial features of the stores include spatial features such as the store's city, region, and business district. The temporal features of the stores include temporal features such as the store's historical sales volume, holidays, promotional activities, and weather data.

[0050] The prediction module uses a pre-trained model to predict store sales at future time points.

[0051] Meanwhile, this invention provides:

[0052] A server includes a processor and a memory, the memory storing at least one program that is loaded and executed by the processor to implement the new tea beverage sales prediction method based on graph neural networks.

[0053] A computer-readable storage medium storing at least one program that is loaded and executed by a processor to implement the graph neural network-based method for predicting the sales volume of new tea beverages.

[0054] Compared with the prior art, the present invention has the following advantages and beneficial effects:

[0055] 1. This invention utilizes graph neural networks to build an algorithm model that combines spatial and temporal features. It can predict store sales volume under various scenarios, including holidays, promotional activities, weather conditions, different store districts, and different consumer groups. This solves problems such as the short product lifecycle of new tea drinks, the degradation of older products, and the rapid pace of new product launches. Simultaneously, it constructs a store-based graph network topology and uses an undirected weighted graph to model store information data. By fully considering the graph vector features of surrounding nodes and the current node, it can accurately predict the sales volume of each store, reducing stockouts and inventory costs, and increasing store profitability.

[0056] 2. Considering the unique and unpredictable nature of events in the new tea beverage industry, which are complex characteristics not found in other industries, the technical solution provided by this invention can predict sudden events and corresponding sales. For example, events such as "the first milk tea of ​​autumn" or "the first day of school" are examples of sales forecasting methods that lack this capability.

[0057] 3. The graph neural network structure constructed in this invention can improve the accuracy of prediction by extending spatial feature learning among multiple nodes. Attached Figure Description

[0058] Figure 1 This is a flowchart of the new tea beverage sales prediction method based on graph neural networks described in this invention.

[0059] Figure 2 This is an architecture diagram of a prediction model based on graph neural networks. Detailed Implementation

[0060] For ease of understanding, the following are explanations of the technical terms used in the new tea beverage concept of this invention:

[0061] The sales forecast for new tea drinks includes holidays such as: the start of the autumn school year, the first milk tea of ​​autumn, Teacher's Day, the May Day Golden Week, the National Day Golden Week, Valentine's Day, May 20th, and Christmas.

[0062] Promotional activity data includes: start date, end date, applicable stores, applicable categories, applicable products, activity level, and activity investment.

[0063] Weather data includes: the day's highest temperature, the day's lowest temperature, weather type, wind direction, air quality, and precipitation.

[0064] Store types include: commercial street stores, subway station stores, office building stores, shopping mall stores, shopping mall off-site stores, university off-site stores, street-side stores, etc.

[0065] Store business district data includes: business district name, longitude, latitude, POI major category, POI medium category, POI minor category, province, city, district / county, detailed address, city GDP, distance from store, whether it is indoors, floor, business district rating, average spending per person, and business hours.

[0066] Product data includes: category, sales volume, price, 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, quantity issued, and applicable products.

[0069] New product attributes include: ingredients, listing date, product category, specifications, and flavor.

[0070] In particular, coupons are frequently used in the new-style tea beverage industry. Incorporating coupon information better reflects real-world business scenarios and is beneficial for model training.

[0071] Unlike other model inputs, the features input to this model are all from the nine features described above. This invention mainly considers two aspects:

[0072] On the one hand, it's worth considering that the new-style tea beverage industry, compared to other industries, has specific industry attributes that significantly impact sales. For example, weather, store location, foot traffic, and the location of competitors have a huge impact on the sales volume of new-style tea beverage stores.

[0073] On the other hand, through parameter tuning, graph neural networks have the ability to learn thousands, or even tens of thousands, of features simultaneously. Features of different dimensions allow the model to consider different factors, better approximate real-world scenarios, and improve the accuracy of model learning.

[0074] Inputting nine features and combining them to generate new features is to help the model learn better and improve prediction accuracy.

[0075] The present invention will be further described in detail below with reference to the embodiments and accompanying 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 networks is as follows:

[0077] The basic idea behind using graph neural networks to predict the sales volume of new tea beverage stores is to construct a network topology structure centered on the stores.

[0078] First, distributed processing technology is used to clean and aggregate massive amounts of data;

[0079] Obtain historical sales data for stores;

[0080] Obtain all characteristic data of the store;

[0081] Obtain all feature data of the product;

[0082] Obtain all characteristic data of the consumer group;

[0083] Obtain other data, such as weather conditions, holiday information, promotional activities, coupon information, and other feature data;

[0084] The main steps for cleaning and processing historical sales data are as follows:

[0085] Sales data can fluctuate dramatically due to promotional activities, product listings and delistings, weather conditions, and special events. These outliers need to be removed from the model's predictions. This invention uses a combination of box plots and the coefficient of variation to detect and smooth out abnormal sales data.

[0086] In box plot techniques, the first quartile (Q1), second quartile (Q2), and third quartile (Q3) are equal to the values ​​at the 25th, 50th, and 75th percentiles of the sales data, respectively, when all values ​​are arranged in ascending order. The difference between the third quartile and the first quartile is called the interquartile range (IQR). Outlier condition one: less than Q1-3. IQR or greater than Q3+3 The value of IQR.

[0087] To compensate 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 condition for outliers is defined as: CV greater than 1.5 is considered abnormal sales data.

[0088] Based on the combined use of box plot techniques and the coefficient of variation (CV), i.e., conditions 1 and 2, this invention ultimately defines outlier sales data as CV greater than 1.5 and less than Q1-3. IQR or greater than Q3+3 The value of IQR.

[0089] After detecting outliers, the abnormally high or low sales values ​​are smoothed to remove the outliers.

[0090] Imputing missing values ​​in historical sales data mainly involves the following:

[0091] Due to reasons such as stock shortages and inaccurate data, sales data may be incomplete. This invention fills in the missing sales data based on historical sales data.

[0092] When a product is missing at a certain point in time, fill in the gaps using the average value based on similar stores, similar categories, similar products, similar years, similar quarters, similar months, and similar weeks.

[0093] For example, if the sales data for product 001 in store A is missing on July 29, 2022 (Friday), based on the cyclical sales characteristics of the new tea beverage industry, the average sales of this product in all Fridays of July 2022 will be used to fill the gap. If all sales data for this product in July 2022 is still missing, the average sales of all Fridays in a similar month, June 2022, will be used to fill the gap.

[0094] Similarly, for cases where data is missing for multiple months, the average of the data from the same period of the previous quarter or the same period of the previous year is used to fill the gaps. For products with a large number of missing data points, the average of products in the same category is used to fill the gaps.

[0095] The spatial feature extraction and processing of store business district content mainly includes the following:

[0096] Euclidean distance is calculated using latitude and longitude, with the target store as the central node and the Euclidean distance between other stores and the central node as the first distance feature.

[0097] Based on the GDP of each city, the GDP of the cities where other stores are located is subtracted from the GDP of the city where the central node is located, and the absolute value is normalized 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 normalize the absolute value as the third distance feature.

[0099] The first, second, and third distance features are assigned certain weights, and the weights are multiplied by the first, second, and third distance features respectively, and then summed to obtain the fourth distance feature. Based on the fourth distance feature, the node centrality of different neighboring nodes is determined.

[0100] Compared to commonly used binning methods, this invention uses statistical measures from analysis of variance to select and judge a more reasonable binning method. For the large amount of continuous data in the new tea beverage industry that has been transformed into discrete data, a more reasonable binning method can more effectively represent continuous data.

[0101] This invention transforms all continuous data in the aforementioned input data into discrete data. In other words, the processed data is entirely discrete. Due to the characteristics of the new tea beverage industry, the data generally exhibits strong volatility and numerous anomalies. Discrete features are more robust to anomalies, improving the model's stability. It also introduces nonlinear relationships, enhancing the model's expressive power.

[0102] For discrete features such as business district type, consumer gender, occupation, and weather type, as well as discrete features transformed from continuous features by binning, they are first converted into one-hot encoding, and then embedded learning is used. Embedding learning can transform the sparse features of one-hot encoding into dense features, which improves computational efficiency.

[0103] This invention introduces an embedding layer to enhance feature expressiveness and improve model efficiency. This is because real-world business scenarios often involve highly sparse data. Extremely sparse and massive matrices are difficult to compute. In contrast, dense features are easier to differentiate, which facilitates backpropagation and speeds up the model's execution.

[0104] Establish a topological network relationship between stores, stores and products, products and products, and products and consumer groups. The entire graph neural network is defined as a graph neural network G.

[0105] In a graph neural network G, an adjacency matrix A and a degree matrix D are established, and the feature matrix X is obtained at the same time.

[0106] To account for the characteristics of its own nodes, an identity matrix I is added, resulting in a new adjacency matrix. The formula is N is the node number. Let N be the identity matrix of the Nth node;

[0107] To normalize the aggregated features, the degree matrix is ​​taken. Calculate the degree matrix inverse matrix Because of the degree matrix It is a diagonal matrix, so Each element in the matrix is ​​a degree matrix. The reciprocal of the corresponding term;

[0108] Using Laplace regularization of graphs, we can guarantee the symmetry and normalization of graphs by defining... As a new adjacency matrix;

[0109] Adjacency matrix Multiplying by the feature matrix X yields the feature matrix of the neighboring nodes, thus obtaining...

[0110] ;

[0111] The formula for constructing a two-layer graph convolutional structure is:

[0112] ;

[0113] The graph convolutional structure is modeled at time t, resulting in...

[0114] ;

[0115] in, and This represents the weight matrix for layers 1 and 2, which is obtained through model training. and Indicates the activation function;

[0116] To extract time-series features from historical sales, holidays, promotions, weather, and other data, it is necessary to introduce deep neural networks to process sequential data. The most commonly used structure is the recurrent neural network (RNN). However, to avoid problems such as gradient vanishing and gradient exploding in long-term predictions, the long short-term memory (LSTM) model is more suitable because its gating mechanism can memorize as much long-term information as possible and extract long-term time-series features related to stores.

[0117] A graph neural network architecture was constructed, using a graph convolutional network (GCN) and a long short-term memory network (LSTM) to simultaneously capture spatial and temporal dependency features in store data.

[0118] definition The output of the network hidden state at time t-1 is represented by the following calculation process:

[0119] The graph convolution process at time t is described in the definition above;

[0120] W and b represent the weights and biases during the model training process, respectively;

[0121] Use respectively , , This represents the forgetting gate, input gate, and output gate, where the subscripts W and b represent the corresponding weights and biases, respectively.

[0122] ;

[0123] ;

[0124] ;

[0125] The cell state of the computational network is tanh is the activation function. and Indicates weights and biases:

[0126] ;

[0127] The network hidden state output at time t is calculated as follows: :

[0128] ;

[0129] After passing through the fully connected layer, the predicted store sales volume at time t is obtained. and For weights and biases:

[0130] ;

[0131] according to Figure 2 The prediction architecture of this invention, based on a graph neural network, is implemented as follows:

[0132] Each matrix mainly contains nine features: consumer groups, POI business districts, new product attributes, product data, coupons, promotional activities, weather conditions, time attributes, and holidays.

[0133] Compared to traditional graph neural networks, the model architecture of this invention does not pass all features through LSTM and graph convolutional network layers after the embedding layer. Instead, spatial features are fed into the graph convolutional network layer, and temporal features are fed into the LSTM layer. In the graph convolutional network layer, the convolution result is calculated according to the set convolution kernel, and a bias is added to form the final result. Considering the unreasonableness of values ​​less than 0 and the need to increase the nonlinearity of the function, a ReLU activation function is set to output the final result. In the LSTM layer, forget gates, input gates, and output gates are set to update the state.

[0134] Temporal and spatial features are loaded into different window vector matrices in the same batch. The parameters are updated through backpropagation, and the output window vector matrices are updated and then weighted and averaged to the same dimension for fusion.

[0135] To avoid affecting 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 separately. The Pooling layer uses the Average function to facilitate data compression and dimensionality reduction.

[0136] The data is input into the Batch Norm and Concatenation layer for module fusion and batch standardization.

[0137] The introduction of Batch Norm and Concatenation layers can eliminate data dimensions, speed up training, and improve model accuracy.

[0138] The data is fed into a fully connected layer, and the high-dimensional feature maps are connected to the modeling results to infer future sales forecasts.

[0139] Based on experimental data testing, this invention is applicable to scenarios such as sales forecasting for regular products, new products, promotional activities, and coupon activities.

[0140] The above embodiments are preferred embodiments of the present invention, but the embodiments of the present invention are not limited to the above embodiments. Any changes, modifications, substitutions, combinations, or simplifications made without departing from the spirit and principle of the present invention shall be considered equivalent substitutions and shall be included within the protection scope of the present invention.

Claims

1. A method for predicting sales of new tea drinks based on a graph neural network, characterized in that, Includes the following steps: S1. Data collection phase: Collect store merchandise sales data and basic store feature layer data at different historical points in time. The basic feature layer data of the stores includes two main categories: numerical data and enumerated data. S2. In the preprocessing stage of store merchandise sales data, box plot technology combined with the coefficient of variation is used to detect abnormal sales data. Abnormal sales data includes abnormally high sales data, abnormally low sales data, and missing sales data. The abnormally high sales data refers to sales data above the 95th percentile, and the abnormally low sales data refers to sales data below the 5th percentile. The abnormally high and abnormally low sales data are smoothed separately to preserve the time sequence pattern of sales. In cases where sales data is missing, the missing historical sales values ​​are filled in using the methods of similar stores, similar categories, similar products, similar years, similar quarters, similar months, and similar weeks. S3. In the preprocessing stage of the basic feature layer data of the store, for numerical data, it is binned according to the data distribution and converted into enumerated features; for enumerated data, it is converted into embedding vectors to obtain all preprocessed feature data; in addition, the historical sales data corresponding to all the above feature data are extracted to establish a learning sample between feature data and sales. S4. In the prediction model training stage, a graph neural network is used to train the prediction model by passing the embedding vector through a pooling layer, a fusion layer, and a fully connected layer. In this model, after passing through the embedding layer, spatial features are fed into the graph convolutional network layer and temporal features are fed into the LSTM layer. In the LSTM layer, forget gate, input gate and output gate are set to update the state. Temporal and spatial features are loaded into different window vector matrices in the same batch. The parameters are updated through backpropagation, the different window vector matrices are updated, and they are weighted and averaged to the same dimension for fusion. The spatial characteristics of the store's business district were extracted using the following method: Euclidean distance is calculated using latitude and longitude, with the target store as the central node and the Euclidean distance between other stores and the central node as the first distance feature. Based on the GDP of each city, the GDP of the cities where other stores are located is subtracted from the GDP of the city where the central node is located, and the absolute value is normalized 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 normalize the absolute value as the third distance feature. The first, second, and third distance features are assigned certain weights, and the weights are multiplied by the first, second, and third distance features respectively and then summed to obtain the fourth distance feature; S5. Prediction phase: Using the trained model, predict sales volume at future time points.

2. The method for predicting the sales volume of new tea beverages based on graph neural networks according to claim 1, characterized in that, The prediction model is a trained graph neural network model, which uses historical sales volume of stores, holidays, promotional activities and weather conditions as the basic feature layer data, and uses a long short-term memory network LSTM to extract time-series features. Using the city where the store is located, the type of business district, the consumer group, and the attributes of new products as basic feature layer data, spatial features are extracted using a graph convolutional network (GCN). By combining temporal and spatial features as model inputs, the model outputs a prediction of store sales at future points in time.

3. The method for predicting the sales volume of new tea beverages based on graph neural networks according to claim 1, characterized in that, The prediction model is constructed as follows: Define all stores as a network G, and construct a feature matrix at time t. , is used to represent the feature matrix of store products at time node t; The problem of predicting the sales volume of store merchandise is modeled as learning a mapping function under the constraints of a topological network G and a feature matrix X. Predicting the sales volume of a store at T future time points is defined as... ; get: ; Mapping function It is a graph neural network model trained using historical data, consisting of a graph convolutional neural network (GCN), a ReLU activation function layer, a long short-term memory network (LSTM), and a fully connected layer connected in sequence, which outputs the sales volume prediction results for future stores.

4. The method for predicting the sales volume of new tea beverages based on graph neural networks according to claim 1, characterized in that, In step S2, the abnormal sales data is detected using a combination of box plot technology and coefficient of variation, as detailed below: In box plot techniques, the first quartile (Q1), second quartile (Q2), and third quartile (Q3) are equal to the values ​​at the 25th, 50th, and 75th percentiles of the sales data, respectively, when all values ​​are arranged in ascending order. The difference between the third quartile and the first quartile is called the interquartile range (IQR). Outlier condition one: less than Q1-3. IQR or greater than Q3+3 The value of IQR; Introducing the coefficient of variation (CV), which is equal to the standard deviation of store sales divided by the mean of store sales, and defining outlier condition two: a coefficient of variation (CV) greater than 1.5 is considered abnormal sales data; Based on the combined box plot technique and coefficient of variation, sales data that simultaneously meet both outlier condition one and outlier condition two are considered outliers.

5. The method for predicting the sales volume of new tea beverages based on graph neural networks according to claim 1, characterized in that, The binning process described in step S3 specifically involves: using the features to be processed to perform various binning methods, performing variance analysis on the binned data and sales data, and determining the optimal binning method based on the variance analysis statistics F and p value.

6. A new tea beverage sales prediction system based on graph neural networks, characterized in that, The method for predicting the sales volume of new tea beverages based on graph neural networks, as described in any one of claims 1 to 5, comprises: a data acquisition module, a data preprocessing module, a prediction model training module, and a prediction module; wherein... The data acquisition module is used to collect data from stores, including historical sales, consumer groups, POI business districts, new product attributes, product category structure, coupon information, promotional activity information, weather information, and holiday information. The data preprocessing module is divided into preprocessing of product sales data and preprocessing of basic feature layer data of stores. For sales data preprocessing, box plot technology combined with coefficient of variation is used to detect abnormal sales data and smooth the abnormal sales data to remove outliers while preserving the time sequence pattern of the sales data itself. The abnormal sales data includes abnormally high sales data and abnormally low sales data. Abnormally high sales data refers to sales data exceeding 95% of the total sales data, and abnormally low sales data refers to sales data below 5% of the total sales data. Missing values ​​in historical sales data are imputed using similar stores, similar categories, similar products, similar years, similar quarters, similar months, and similar weeks to restore the true sales trend. The preprocessing of basic feature layer data for stores includes two main categories: numerical data and enumerated data. For numerical data, it needs to be binned according to the data distribution and converted into enumerated features. For enumerated data, it is converted into embedding vectors to obtain all preprocessed feature data. In addition, the historical sales data corresponding to all the above feature data is extracted to establish a learning sample between feature data and sales. The prediction model training module uses a graph neural network to extract spatial and temporal features of stores from the embedding vector data. Then, the model is trained through pooling, fusion, and fully connected layers. The spatial features of the stores include the store city, store region, and store business district. The temporal features of the stores include the store's historical sales volume, holidays, promotional activities, and weather data. The prediction module uses a pre-trained model to predict store sales at future points in time.

7. A server, characterized in that: The server includes a processor and a memory, the memory storing 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 networks as described in any one of claims 1 to 5.

8. A computer-readable storage medium, characterized in that: The 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 networks as described in any one of claims 1 to 5.

Citation Information

Patent Citations

  • Time sequence sales volume prediction method based on space-time learning and sales volume prediction model thereof

    CN117575681A