Sales data prediction method and device, equipment, medium and product

By combining macro and micro models and utilizing the horizontal component function, trend component function and Prophet time series forecasting model, the problem of poor adaptability of sales data forecasting methods to market trends is solved, and a more accurate monthly sales data forecast is achieved.

CN120765294APending Publication Date: 2025-10-10SANY GROUP CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202510838891.6
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-06-20
Publication Date
2025-10-10

AI Technical Summary

Technical Problem

In the existing technology, sales data forecasting methods are difficult to adapt to changing market trends, resulting in low accuracy and lack of reference value for monthly sales data forecasts.

Method used

Combining the macro model and the micro model, through the annual sales forecast model and the monthly sales forecast model, using the horizontal component function, trend component function and Prophet time series forecast model, the monthly sales forecast weight is generated to achieve the fusion of annual and monthly data.

Benefits of technology

It significantly improves the accuracy and flexibility of sales data forecasts, can more accurately reflect actual market behavior, and improves the forecast accuracy of monthly sales data.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120765294A_ABST
    Figure CN120765294A_ABST
Patent Text Reader

Abstract

The embodiment of the invention provides a sales data prediction method and device, equipment, a medium and a product. The method comprises the following steps: firstly, acquiring sales data of a plurality of historical years; then, processing a pre-constructed annual sales prediction model according to the plurality of historical annual sales data to obtain first target annual sales prediction data; then, inputting each target month field of the target year into a monthly sales prediction model, and determining each target month sales prediction weight of the target year; and finally, taking a product of the first target year sales prediction data and each target month sales prediction weight of the target year as each target month sales prediction data of the target year. According to the method, the annual sales prediction and the monthly weight reconstruction model are combined, so that hierarchical modeling and refined decomposition of sales data prediction are realized, and the accuracy, flexibility and practical value of prediction are remarkably improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of data processing technology, and in particular to a sales data forecasting method, device, equipment, medium and product. Background Art

[0002] In the sales sector, accurate sales data forecasts can help companies formulate reasonable production and raw material procurement plans. They can also improve the efficiency of collaboration across the supply chain, shorten production cycles, and reduce resource waste and the high costs associated with emergency deployment. Therefore, improving the accuracy of sales data forecasts is a pressing issue.

[0003] In the existing technology, the commonly used sales data forecasting method is usually to collect historical annual sales total data, then use the corresponding forecasting model to model the annual total to predict the next year's sales total, and then distribute the next year's sales total to each month in proportion according to the historical monthly sales ratio, so as to obtain the monthly sales volume and annual sales total data for the next year.

[0004] However, the sales data forecasting methods in the prior art for forecasting monthly sales data are difficult to adapt to changing market trends, resulting in low sales data forecasting accuracy and lack of reference value. Summary of the Invention

[0005] The embodiments of the present application provide sales data forecasting methods, devices, equipment, media and products to solve the problem in the prior art that the forecasting methods for monthly sales data are difficult to adapt to changing market trends, resulting in low sales data forecasting accuracy and lack of reference value.

[0006] In a first aspect, an embodiment of the present application provides a sales data forecasting method, comprising:

[0007] Get sales data for multiple historical years;

[0008] Processing a pre-built annual sales forecast model according to the plurality of historical annual sales data to obtain first target annual sales forecast data, wherein the pre-built annual sales forecast model is a fitting function model established based on a horizontal component function and a trend component function of the annual sales data;

[0009] Input each target month field of the target year into the monthly sales forecast model to determine the sales forecast weight of each target month of the target year. The monthly sales forecast model is obtained by pre-training the Prophet time series forecast model based on each sample month field of multiple sample years and the sample monthly sales data corresponding to each sample month field of each sample year;

[0010] The product of the first target year sales forecast data and the sales forecast weights of each target month in the target year is used as the sales forecast data of each target month in the target year.

[0011] In a possible implementation, processing a pre-built annual sales forecast model based on the plurality of historical annual sales data to obtain first target annual sales forecast data includes:

[0012] Initializing the horizontal component function and the trend component function in the pre-built sales forecast model according to the first historical year sales data, respectively, to obtain a first horizontal component function value and a first trend component function value;

[0013] Iteratively update the first horizontal component function value and the first trend component function value year by year based on other historical annual sales data to obtain a second horizontal component function value and a second trend component function value;

[0014] The second level component function value and the second trend component function value are added together to obtain sales forecast data for the first target year.

[0015] In a possible implementation, the expressions of the horizontal component function and the trend component function are:

[0016]

[0017]

[0018] Among them, l t is the horizontal component function; b t is the trend component function; is the horizontal smoothing coefficient; is the trend smoothing coefficient; is the attenuation factor.

[0019] In a possible implementation, before inputting the target month fields of the target year into the monthly sales forecast model and determining the sales forecast weights of the target months of the target year, the method further includes:

[0020] Get the sample month fields of multiple sample years and the sample month sales data corresponding to the sample month fields of each sample year;

[0021] Creating a training set and a validation set based on the sample month fields of the multiple sample years and the sample month sales data corresponding to the sample month fields of each sample year;

[0022] Training the Prophet time series forecasting model based on the training set to obtain an initial monthly forecasting model;

[0023] The initial monthly forecast model is evaluated using the validation set to obtain a monthly sales forecast model.

[0024] In a possible implementation, inputting the target month fields of the target year into the monthly sales forecast model to determine the sales forecast weights of the target months of the target year includes:

[0025] Input the target month fields of the target year into the monthly forecast model to obtain sales forecast data for each target month of the target year;

[0026] The sum of the sales data of each target month in the target year is used as the sales forecast data for the second target year;

[0027] The ratio between the sales data of each target month of the target year and the sales forecast data of the second target year is determined as the sales forecast weight of each target month of the target year.

[0028] In a possible implementation, the expression of the Prophet time series prediction model is:

[0029]

[0030] in, It is the Prophet time series forecasting model; is a piecewise linear trend term; is the seasonal term of the Fourier series; is the residual term.

[0031] In a second aspect, an embodiment of the present application provides a sales data forecasting device, comprising:

[0032] Acquisition module, used to obtain sales data for multiple historical years;

[0033] a processing module, configured to process a pre-built annual sales forecast model according to the plurality of historical annual sales data to obtain first target annual sales forecast data, wherein the pre-built annual sales forecast model is a fitting function model established based on a horizontal component function and a trend component function of the annual sales data;

[0034] A determination module is used to input each target month field of the target year into a monthly sales forecast model to determine the sales forecast weight of each target month of the target year, wherein the monthly sales forecast model is obtained by pre-training a Prophet time series forecast model based on each sample month field of multiple sample years and the sample monthly sales data corresponding to each sample month field of each sample year;

[0035] The calculation module is used to take the product of the first target year sales forecast data and the sales forecast weights of each target month in the target year as the sales forecast data of each target month in the target year.

[0036] In a possible implementation manner, the processing device is specifically configured to:

[0037] Initializing the horizontal component function and the trend component function in the pre-built sales forecast model according to the first historical year sales data, respectively, to obtain a first horizontal component function value and a first trend component function value;

[0038] Iteratively update the first horizontal component function value and the first trend component function value year by year based on other historical annual sales data to obtain a second horizontal component function value and a second trend component function value;

[0039] The second level component function value and the second trend component function value are added together to obtain sales forecast data for the first target year.

[0040] In a possible implementation, the expressions of the horizontal component function and the trend component function are:

[0041]

[0042]

[0043] Among them, l t is the horizontal component function; b t is the trend component function; is the horizontal smoothing coefficient; is the trend smoothing coefficient; is the attenuation factor.

[0044] In a possible implementation, before inputting the target month fields of the target year into the monthly sales forecast model to determine the sales forecast weights of the target months of the target year, the determination module is further configured to:

[0045] Get the sample month fields of multiple sample years and the sample month sales data corresponding to the sample month fields of each sample year;

[0046] Creating a training set and a validation set based on the sample month fields of the multiple sample years and the sample month sales data corresponding to the sample month fields of each sample year;

[0047] Training the Prophet time series forecasting model based on the training set to obtain an initial monthly forecasting model;

[0048] The initial monthly forecast model is evaluated using the validation set to obtain a monthly sales forecast model.

[0049] In a possible implementation, the determining module is specifically configured to:

[0050] Input the target month fields of the target year into the monthly forecast model to obtain sales forecast data for each target month of the target year;

[0051] The sum of the sales data of each target month in the target year is used as the sales forecast data for the second target year;

[0052] The ratio between the sales data of each target month of the target year and the sales forecast data of the second target year is determined as the sales forecast weight of each target month of the target year.

[0053] In a possible implementation, the expression of the Prophet time series prediction model is:

[0054]

[0055] in, It is the Prophet time series forecasting model; is a piecewise linear trend term; is the seasonal term of the Fourier series; is the residual term.

[0056] In a third aspect, an embodiment of the present application provides an electronic device, comprising: a memory, a processor;

[0057] The memory stores computer-executable instructions;

[0058] The processor executes the computer-executable instructions stored in the memory, so that the processor executes the above first aspect and / or various possible implementations of the first aspect.

[0059] In a fourth aspect, an embodiment of the present application provides a computer-readable storage medium, in which computer-executable instructions are stored. When the computer-executable instructions are executed by a processor, they are used to implement the above first aspect and / or various possible implementations of the first aspect.

[0060] In a fifth aspect, an embodiment of the present application provides a computer program product, including a computer program, which, when executed by a processor, implements the above first aspect and / or various possible implementation methods of the first aspect.

[0061] The sales data forecasting method, apparatus, equipment, medium, and product provided in the embodiments of the present application first obtain sales data for multiple historical years; then, process a pre-built annual sales forecast model based on the sales data for multiple historical years to obtain sales forecast data for the first target year; then, input the target month fields of the target year into the monthly sales forecast model to determine the sales forecast weights for each target month of the target year; finally, the product of the first target year sales forecast data and the sales forecast weights for each target month of the target year is used as the sales forecast data for each target month of the target year. This method combines annual sales forecasting with monthly weight modeling to achieve hierarchical modeling and refined decomposition of sales data forecasting, significantly improving the accuracy, flexibility, and practical value of the forecast. BRIEF DESCRIPTION OF THE DRAWINGS

[0062] The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the present application and, together with the description, serve to explain the principles of the present application.

[0063] Figure 1 Schematic diagram of the sales data forecasting method provided in this embodiment of the application Figure 1 ;

[0064] Figure 2 Schematic diagram of the sales data forecasting method provided in this embodiment of the application Figure 2 ;

[0065] Figure 3 A schematic diagram of the structure of a sales data forecasting device provided in an embodiment of the present application;

[0066] Figure 4 A schematic diagram of the structure of an electronic device provided in an embodiment of the present application.

[0067] The above drawings illustrate specific embodiments of the present application, which will be described in more detail below. These drawings and the textual description are not intended to limit the scope of the present application in any way, but rather to illustrate the concepts of the present application to those skilled in the art by reference to specific embodiments. DETAILED DESCRIPTION

[0068] Exemplary embodiments will be described in detail herein, with examples illustrated in the accompanying drawings. In the following description, when referring to the drawings, identical numerals in different figures represent identical or similar elements, unless otherwise indicated. The embodiments described in the following exemplary embodiments are not intended to represent all embodiments consistent with the present application. Rather, they are merely examples of apparatus and methods consistent with certain aspects of the present application, as detailed in the appended claims.

[0069] In the sales sector, accurate sales data forecasts can help companies formulate reasonable production and raw material procurement plans. They can also improve the efficiency of collaboration across the supply chain, shorten production cycles, and reduce resource waste and the high costs associated with emergency deployment. Therefore, improving the accuracy of sales data forecasts is a pressing issue.

[0070] In the existing technology, the commonly used sales data forecasting method is usually to collect historical annual sales total data, then use the corresponding forecasting model to model the annual total to predict the next year's sales total, and then distribute the next year's sales total to each month in proportion according to the historical monthly sales ratio, so as to obtain the monthly sales volume and annual sales total data for the next year.

[0071] However, in the sales data forecasting methods of the existing technology for forecasting monthly sales data, the fixed monthly ratio cannot reflect actual seasonal changes (such as the early Spring Festival) and cannot adapt to the impact of promotions, festivals, and emergencies on a single month, resulting in low accuracy of sales data forecasts and no reference value.

[0072] Based on this, this application proposes a sales data forecasting method. Traditional sales data forecasting methods typically determine monthly sales data based on a fixed monthly ratio, resulting in low sales data forecasting accuracy. This application considers that if seasonality and holidays can be taken into account while accurately determining the annual sales model, the actual sales ratios of different months can be accurately obtained, thereby obtaining more accurate monthly sales data. Some macro models excel at extracting patterns of change from long-term overall sales trends and seasonal fluctuations, capturing changes in the overall level of sales data, and possessing good trend-fitting capabilities and stability, can accurately predict the overall sales scale for the coming year. Micro models (such as the Prophet forecasting model) focus on analyzing the detailed distribution characteristics between months within a year. By modeling short-term disturbances such as seasonality and holiday effects using Fourier series, they possess flexible adjustment and dynamic adaptability, and can more precisely reflect the structural changes and rhythmic distribution of monthly sales. Therefore, we combine the characteristics of both approaches. First, we use a macro model to ensure the rationality and accuracy of the total annual sales data. Then, we use a micro model to model the monthly sales data, generating monthly sales proportions or weights that reflect actual market behavior. Finally, we combine the annual total with the monthly weights to obtain monthly sales data (i.e., sales forecasts for each target month in the target year). This approach avoids the distortion caused by traditional static proportional allocation while significantly improving the timescale precision of the forecast, thereby enhancing the accuracy of sales data forecasts.

[0073] The following specific embodiments describe in detail the technical solution of the present application and how the technical solution of the present application solves the above-mentioned technical problems. The following specific embodiments can be combined with each other, and the same or similar concepts or processes may not be repeated in some embodiments. The embodiments of the present application will be described below in conjunction with the accompanying drawings.

[0074] Figure 1 Schematic diagram of the sales data forecasting method provided in this embodiment of the application Figure 1 ;like Figure 1 As shown, the method includes:

[0075] S101. Obtain sales data for multiple historical years.

[0076] It should be noted that the method provided in this application is performed by an electronic device with computing capabilities, such as a computer. The method provided in this application can be encapsulated into software, such as a data prediction platform, so that the electronic device can perform the method provided in this application.

[0077] Among them, multiple historical annual sales data are annual total sales data of at least three years, and the data format can be: year [2019, 2020, 2021, 2022, 2023]; sales data [1200, 1350, 1500, 1400, 1550].

[0078] S102: Processing a pre-built annual sales forecast model based on multiple historical annual sales data to obtain first target annual sales forecast data.

[0079] The pre-built annual sales forecast model is a fitting function model established based on the horizontal component function and the trend component function of the annual sales data.

[0080] It should be noted that the expressions of the horizontal component function and the trend component function are:

[0081]

[0082]

[0083] Among them, l t is the horizontal component function; b t is the trend component function; is the horizontal smoothing coefficient, the value range can be [0-1]; is the trend smoothing coefficient, the value range can be [0-1]; is the attenuation factor, and its value range is [0-1].

[0084] Furthermore, by iterating the above formula, the final sales forecast data for the first target year can be obtained, and the formula is:

[0085]

[0086] Among them, l t-1 is the horizontal component function; b t-1 is the trend component function; is the attenuation factor; The sales forecast data for the first target year.

[0087] In one feasible method, the horizontal component function and the trend component function in the pre-built sales forecasting model are first initialized according to the sales data of the first historical year to obtain the first horizontal component function value and the first trend component function value; then, the first horizontal component function value and the first trend component function value are iteratively updated year by year according to the sales data of other historical years to obtain the second horizontal component function value and the second trend component function value; finally, the second horizontal component function value and the second trend component function value are added to obtain the sales forecast data for the first target year.

[0088] It's important to note that the level component function represents the current stationary value or baseline of the forecast series (i.e., the average level without considering trends); the trend component function represents the rate of growth (or decline) of sales data over time. After initializing the level component function and the trend component function, they are iteratively updated annually to generate the second level component function value and the second trend component function value, which are ultimately superimposed to form the sales forecast data for the first target year.

[0089] For example, assume that there are the following five years of historical sales data: year = [2019, 2020, 2021, 2022, 2023]; sales data y = [1200, 1350, 1500, 1400, 1550]; and set the horizontal smoothing coefficient is 0.6, the trend smoothing coefficient is 0.4,

[0090] Initialize the horizontal component function and the trend component function respectively to obtain the first horizontal component function value and the first trend component function value:

[0091] The first horizontal component function value is l1=y1=1000;

[0092] The first trend component function value b1=y2-y1=1200-1000=200;

[0093] Then, the first level component function value and the first trend component function value are iteratively updated year by year using other historical annual sales data, that is:

[0094] l2=0.6×1200+0.4×(1000+0.4×200)=720+0.4×1080=1152;

[0095] b2=0.4×(1150−1000)+0.4×0.6×200=60+48=108;

[0096] By analogy, the final updated second level component function value and the second trend component function value can be obtained; finally, the second level component function value and the second trend component function value are added to obtain the sales prediction data of the first target year (i.e. 2024).

[0097] It can be understood that the annual sales prediction model can capture the growth or decline trend of sales better than simple average or moving average, thereby improving the stability of the prediction and providing a good data basis for further monthly sales prediction.

[0098] Optionally, when the obtained historical annual sales data includes specific monthly sales data, that is, the data format is: year-month [2021-01, 2021-02, …, 2023-12]; monthly sales data [1200, 1350, …, 1550]; the consideration of seasonal component can also be added, that is, the expressions of the corresponding level component function, trend component function and seasonal component function can be expressed as:

[0099]

[0100]

[0101] The final sales prediction data of the first target year is:

[0102]

[0103] wherein, l t is the level component function; b t is the trend component function; st is the seasonal component function; is the level smoothing coefficient, which can be in the range of [0-1]; is the trend smoothing coefficient, which can be in the range of [0-1]; is the decay factor, which can be in the range of [0-1]; m is the seasonal period, which is usually 12, and γ is the seasonal smoothing coefficient, which can be in the range of [0-1].

[0104] S103. Input the target month fields of the target year into the monthly sales forecast model to determine the sales forecast weight of each target month of the target year.

[0105] Among them, the monthly sales forecast model is obtained by pre-training the Prophet time series forecast model based on the sample month fields of multiple sample years and the sample month sales data corresponding to the sample month fields of each sample year.

[0106] In one feasible method, the target month fields of the target year are first input into the monthly forecast model to obtain the sales forecast data of each target month of the target year; then, the sum of the sales data of each target month of the target year is used as the sales forecast data of the second target year; finally, the ratio between the sales data of each target month of the target year and the sales forecast data of the second target year is determined as the sales forecast weight of each target month of the target year.

[0107] It should be noted that the expression of the Prophet time series forecasting model is:

[0108]

[0109] in, It is the Prophet time series forecasting model; is a piecewise linear trend term; is the seasonal term of the Fourier series; is the residual term.

[0110] For example, the target month fields of each target year are input into the pre-trained monthly sales forecast model, that is, the input data can be: [2024-01, 2024-02, ..., 2024-12], and the target month sales forecast data of each target year can be obtained: [80, 70, 90, 100, 120, 130, 150, 140, 110, 100, 90, 120]. Then, the sum of the target month sales forecast data of the target year is calculated as the second target year sales forecast data, which is 1300. Finally, the sales forecast weights of each target month in the target year are calculated, and the result is:

[0111] W1=80 / 1300=0.0615, W2=70 / 1300=0.0538,…, W12=120 / 1300=0.0923

[0112] It is understandable that by first predicting the total annual sales and then using the monthly model to generate relative weights, an effective fusion of annual and monthly forecasts is achieved, which not only improves the accuracy of the overall forecast, but also retains the seasonal variation characteristics of monthly sales, thereby improving the accuracy and practicality of sales forecasts.

[0113] S104. The product of the first target year sales forecast data and the sales forecast weights of each target month in the target year is used as the sales forecast data of each target month in the target year.

[0114] It can be understood that by combining more accurate and stable annual sales forecast data with the relative weights obtained based on the monthly model, the monthly sales forecast is calibrated and optimized, thereby effectively avoiding the cumulative error problem caused by noise or outliers in a single monthly model, and improving the coordination and accuracy of the overall quantity control and structural distribution of the sales forecast data for each month.

[0115] The sales data forecasting method, apparatus, equipment, medium, and product provided in the embodiments of the present application first obtain sales data for multiple historical years; then, process a pre-built annual sales forecast model based on the sales data for multiple historical years to obtain sales forecast data for the first target year; then, input the target month fields of the target year into the monthly sales forecast model to determine the sales forecast weights for each target month of the target year; finally, the product of the first target year sales forecast data and the sales forecast weights for each target month of the target year is used as the sales forecast data for each target month of the target year. This method combines annual sales forecasting with monthly weight modeling to achieve hierarchical modeling and refined decomposition of sales data forecasting, significantly improving the accuracy, flexibility, and practical value of the forecast.

[0116] Figure 2 Schematic diagram of the sales data forecasting method provided in this embodiment of the application Figure 2 ,like Figure 2 As shown, this embodiment Figure 1 Based on the embodiment, the training process of the monthly sales forecast model is described in detail. The method includes:

[0117] S201. Obtain sample month fields of multiple sample years and sample month sales data corresponding to each sample month field of each sample year.

[0118] It should be understood that this embodiment is mainly used to collect historical sales data and prepare the data basis for model construction.

[0119] For example, the obtained multiple sample data may be:

[0120]

[0121] It is understandable that by obtaining rich, continuous, and structured time series sample data, the integrity of the model training input can be guaranteed. In addition, external feature variables (such as whether it is a holiday, promotion activity tags, weather conditions, etc.) can be introduced to enhance the model's interpretability and prediction accuracy.

[0122] S202. Create a training set and a validation set based on the sample month fields of multiple sample years and the sample month sales data corresponding to the sample month fields of each sample year.

[0123] For example, the training set and validation set can be divided into: the training set includes the month field and corresponding sales data of each month from 2018-01 to 2022-12; the validation set includes the month field and corresponding sales data of each month from 2023-01 to 2023-12.

[0124] It can be understood that by dividing the time series sample data obtained in S201 into a training set and a validation set, data leakage can be avoided and the reliability of model evaluation can be improved.

[0125] S203. Train the Prophet time series prediction model based on the training set to obtain an initial monthly prediction model.

[0126] It is understandable that during the training process of the Prophet time series prediction model, seasonal and trend changes can be automatically modeled, that is, the Prophet model automatically decomposes the time series into trend terms, seasonal terms, and residual terms, thereby fitting the trend line to quickly obtain the initial prediction model.

[0127] S204: Use the validation set to evaluate the initial monthly forecast model to obtain a monthly sales forecast model.

[0128] It is understandable that the trained initial model is applied to the validation set (for example, 2023-01–2023-12) for prediction; thereby comparing the predicted value with the actual sales, and calculating evaluation indicators (such as Mean Absolute Error (MAE), Root Mean Square Error (RMSE), and Mean Absolute Percentage Error (MAPE)); based on the evaluation results, it is determined whether the model meets the accuracy requirements, and if necessary, parameters are adjusted (such as seasonal frequency, adding promotional items, etc.), and finally a monthly sales forecast model is obtained.

[0129] Figure 3 A schematic diagram of the structure of the sales data forecasting device provided in an embodiment of the present application; Figure 3 As shown, the device 30 includes:

[0130] Acquisition module 301, used to acquire multiple historical annual sales data;

[0131] Processing module 302, configured to process a pre-built annual sales forecast model based on a plurality of historical annual sales data to obtain first target annual sales forecast data, wherein the pre-built annual sales forecast model is a fitting function model established based on a horizontal component function and a trend component function of the annual sales data;

[0132] Determination module 303 is used to input each target month field of the target year into the monthly sales forecast model to determine the sales forecast weight of each target month of the target year. The monthly sales forecast model is obtained by pre-training the Prophet time series forecast model based on each sample month field of multiple sample years and the sample monthly sales data corresponding to each sample month field of each sample year;

[0133] The calculation module 304 is configured to multiply the first target year sales forecast data by the sales forecast weights of each target month in the target year as the sales forecast data of each target month in the target year.

[0134] In a possible implementation, the processing device 302 is specifically configured to:

[0135] Initializing the horizontal component function and the trend component function in the pre-built sales forecast model according to the first historical year sales data, respectively, to obtain a first horizontal component function value and a first trend component function value;

[0136] Iteratively update the first level component function value and the first trend component function value year by year based on other historical annual sales data to obtain the second level component function value and the second trend component function value;

[0137] The second level component function value and the second trend component function value are added together to obtain sales forecast data for the first target year.

[0138] In a possible implementation, the expressions of the horizontal component function and the trend component function are:

[0139]

[0140]

[0141] Among them, l t is the horizontal component function; b t is the trend component function; is the horizontal smoothing coefficient; is the trend smoothing coefficient; is the attenuation factor.

[0142] In one possible implementation, before inputting the target month fields of the target year into the monthly sales forecast model to determine the sales forecast weights of the target months of the target year, the determination module 303 is further configured to:

[0143] Get the sample month fields of multiple sample years and the sample month sales data corresponding to the sample month fields of each sample year;

[0144] Create training sets and validation sets based on the sample month fields of multiple sample years and the sample month sales data corresponding to the sample month fields of each sample year;

[0145] Train the Prophet time series forecasting model based on the training set to obtain the initial monthly forecasting model;

[0146] The validation set is used to evaluate the initial monthly forecast model and obtain the monthly sales forecast model.

[0147] In a possible implementation, the determination module 303 is specifically configured to:

[0148] Input the target month fields of the target year into the monthly forecast model to obtain sales forecast data for each target month of the target year;

[0149] The sum of the sales data of each target month in the target year is used as the sales forecast data for the second target year;

[0150] The ratio between the sales data of each target month in the target year and the sales forecast data of the second target year is determined as the sales forecast weight of each target month in the target year.

[0151] In one possible implementation, the Prophet time series forecasting model is expressed as:

[0152]

[0153] in, It is the Prophet time series forecasting model; is a piecewise linear trend term; is the seasonal term of the Fourier series; is the residual term.

[0154] The sales data prediction device provided in the embodiment of the present application can execute the method provided in the above method embodiment. Its implementation principle and technical effects are similar, and will not be described in detail in this embodiment.

[0155] Figure 4 This is a schematic diagram of the structure of the electronic device provided in the embodiment of the present application. Figure 4As shown, the electronic device 40 provided in this embodiment includes: at least one processor 401 and a memory 402. Optionally, the device 40 further includes a communication component 403. The processor 401, the memory 402 and the communication component 403 are connected via a bus 404.

[0156] In a specific implementation process, at least one processor 401 executes the computer-executable instructions stored in the memory 402, so that the at least one processor 401 performs the above method.

[0157] The specific implementation process of the processor 401 can be found in the above method embodiment. Its implementation principle and technical effects are similar and will not be repeated here in this embodiment.

[0158] In the above embodiments, it should be understood that the processor may be a central processing unit (CPU), other general-purpose processors, digital signal processors (DSP), application-specific integrated circuits (ASICs), etc. A general-purpose processor may be a microprocessor or any conventional processor. The steps of the method disclosed in the present invention may be directly executed by a hardware processor or by a combination of hardware and software modules within the processor.

[0159] The memory may include random access memory (RAM) and may also include non-volatile memory (NVM), such as at least one disk storage.

[0160] A bus can be an Industry Standard Architecture (ISA) bus, a Peripheral Component Interconnect (PCI) bus, or an Extended Industry Standard Architecture (EISA) bus. Buses can be categorized as address buses, data buses, and control buses. For ease of illustration, the buses in the drawings of this application are not limited to just one bus or just one type of bus.

[0161] The present application also provides a computer program product, including a computer program, which implements the above method when executed by a processor.

[0162] The present application also provides a computer-readable storage medium, in which computer-executable instructions are stored. When a processor executes the computer-executable instructions, the above method is implemented.

[0163] The readable storage medium may be implemented by any type of volatile or non-volatile memory device, or a combination thereof, such as static random access memory (SRAM), electrically erasable programmable read-only memory (EEPROM), erasable programmable read-only memory (EPROM), programmable read-only memory (PROM), read-only memory (ROM), magnetic storage, flash memory, magnetic disk, or optical disk. The readable storage medium may be any available medium that can be accessed by a general-purpose or special-purpose computer.

[0164] An exemplary readable storage medium is coupled to a processor so that the processor can read information from the readable storage medium and write information to the readable storage medium. Of course, the readable storage medium can also be an integral part of the processor. The processor and the readable storage medium can be located in an application specific integrated circuit (ASIC). Of course, the processor and the readable storage medium can also exist in the device as discrete components.

[0165] The division of units is merely a logical functional division; actual implementations may employ alternative divisions, such as combining or integrating multiple units or components into another system, or omitting or disabling certain features. Furthermore, any direct coupling or communication connection shown or discussed may be an indirect coupling or communication connection between devices or units, either through an interface, electrical, mechanical, or other means.

[0166] Units described as separate components may or may not be physically separate, and components shown as units may or may not be physical units, that is, they may be located in one place or distributed across multiple network units. Some or all of these units may be selected to achieve the purpose of this embodiment according to actual needs.

[0167] In addition, each functional unit in each embodiment of the present invention may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit.

[0168] If a function is implemented as a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present invention, or the portion that contributes to the prior art, or a portion of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions for causing a computer device (which can be a personal computer, server, or network device, etc.) to execute all or part of the steps of the various embodiments of the method of the present invention. The aforementioned storage medium includes various media that can store program code, such as USB flash drives, mobile hard drives, read-only memories (ROMs), random access memories (RAMs), magnetic disks, or optical disks.

[0169] Those skilled in the art will appreciate that all or part of the steps in the above-described method embodiments can be implemented using hardware associated with program instructions. The aforementioned program can be stored in a computer-readable storage medium. When executed, the program performs the steps of the above-described method embodiments. The aforementioned storage medium includes various media capable of storing program code, such as ROM, RAM, magnetic disks, or optical disks.

[0170] Finally, it should be noted that those skilled in the art will readily identify other embodiments of the present invention after considering the specification and practicing the invention disclosed herein. The present invention is intended to cover any variations, uses, or adaptations of the present invention that follow the general principles of the present invention and include common knowledge or customary techniques in the art not disclosed herein. The present invention is not limited to the precise structure described above and illustrated in the accompanying drawings, and various modifications and variations may be made without departing from the scope thereof. The scope of the present invention is limited solely by the appended claims.

Claims

1. A sales data forecasting method, characterized in that: include: Get sales data for multiple historical years; Processing a pre-built annual sales forecast model according to the plurality of historical annual sales data to obtain first target annual sales forecast data, wherein the pre-built annual sales forecast model is a fitting function model established based on a horizontal component function and a trend component function of the annual sales data; Input each target month field of the target year into the monthly sales forecast model to determine the sales forecast weight of each target month of the target year. The monthly sales forecast model is obtained by pre-training the Prophet time series forecast model based on each sample month field of multiple sample years and the sample monthly sales data corresponding to each sample month field of each sample year; The product of the first target year sales forecast data and the sales forecast weights of each target month in the target year is used as the sales forecast data of each target month in the target year.

2. The method according to claim 1, characterized in that The processing of the pre-built annual sales forecast model according to the plurality of historical annual sales data to obtain first target annual sales forecast data includes: Initializing the horizontal component function and the trend component function in the pre-built sales forecast model according to the first historical year sales data, respectively, to obtain a first horizontal component function value and a first trend component function value; Iteratively update the first horizontal component function value and the first trend component function value year by year based on other historical annual sales data to obtain a second horizontal component function value and a second trend component function value; The second level component function value and the second trend component function value are added together to obtain sales forecast data for the first target year.

3. The method according to claim 2, characterized in that The expressions of the horizontal component function and the trend component function are: Among them, l t is the horizontal component function; b t is the trend component function; is the horizontal smoothing coefficient; is the trend smoothing coefficient; is the attenuation factor.

4. The method according to any one of claims 1 to 3, characterized in that Before inputting the target month fields of the target year into the monthly sales forecast model and determining the sales forecast weights of the target months of the target year, the method further includes: Get the sample month fields of multiple sample years and the sample month sales data corresponding to the sample month fields of each sample year; Creating a training set and a validation set based on the sample month fields of the multiple sample years and the sample month sales data corresponding to the sample month fields of each sample year; Training the Prophet time series forecasting model based on the training set to obtain an initial monthly forecasting model; The initial monthly forecast model is evaluated using the validation set to obtain a monthly sales forecast model.

5. The method according to claim 4, characterized in that The target month fields of the target year are input into the monthly sales forecast model to determine the sales forecast weights of the target months of the target year, including: Input the target month fields of the target year into the monthly forecast model to obtain sales forecast data for each target month of the target year; The sum of the sales data of each target month in the target year is used as the sales forecast data for the second target year; The ratio between the sales data of each target month of the target year and the sales forecast data of the second target year is determined as the sales forecast weight of each target month of the target year.

6. The method according to claim 4, characterized in that The expression of the Prophet time series prediction model is: in, It is the Prophet time series forecasting model; is a piecewise linear trend term; is the seasonal term of the Fourier series; is the residual term.

7. A sales data forecasting device, characterized in that: include: Acquisition module, used to obtain sales data for multiple historical years; a processing module, configured to process a pre-built annual sales forecast model according to the plurality of historical annual sales data to obtain first target annual sales forecast data, wherein the pre-built annual sales forecast model is a fitting function model established based on a horizontal component function and a trend component function of the annual sales data; A determination module is used to input each target month field of the target year into a monthly sales forecast model to determine the sales forecast weight of each target month of the target year, wherein the monthly sales forecast model is obtained by pre-training a Prophet time series forecast model based on each sample month field of multiple sample years and the sample monthly sales data corresponding to each sample month field of each sample year; The calculation module is used to take the product of the first target year sales forecast data and the sales forecast weights of each target month in the target year as the sales forecast data of each target month in the target year.

8. An electronic device, characterized in that: include: Memory, processor; The memory stores computer-executable instructions; The processor executes the computer-executable instructions stored in the memory, so that the processor performs the method according to any one of claims 1 to 6.

9. A computer-readable storage medium, characterized in that The computer-readable storage medium stores computer-executable instructions, which are used to implement the method according to any one of claims 1 to 6 when executed by a processor.

10. A computer program product comprising a computer program, characterized in that When the computer program is executed by a processor, it is used to implement the method according to any one of claims 1 to 6.