Sales forecasting method, device, and storage medium
Patent Information
- Application Number
- CN202610606754.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2026-04-30
- Publication Date
- 2026-10-20
AI Technical Summary
传统的销量预测方法多依赖于历史销售数据的简单统计分析或经验判断,预测结果准确性较低
[0008]本申请提供一种销量预测方法、设备及存储介质,本申请通过获取多个地区在不同历史气温下的销量数据,多个地区在不同历史天气下的销量数据,以及多个地区对应的历史销量数据;对多个地区在不同历史气温下的销量数据进行分析,以确定多个地区对应的气温阈值,以更精准地总结出气温变化对各地区的销量数据的影响规律,有助于更精准地进行销量预测;进一步地,对多个地区在不同历史天气下的销量数据进行分析,以确定各地区对应的映射关系表,以便于通过映射关系表更准确地量化各地区不同类型的天气对各地区销量的影响程度,有助于提升销量预测的准确性;更进一步地,对多个地区对应的历史销量数据进行分析,以确定各地区对应的第二系数,从而确定各地区的地区特征对销量数据的影响,进而能够更准确地进行销量预测,实现销量预测的准确性的极大提高。当需要对待预测地区地销量数据进行预测时,获取待预测地区的气温数据和天气数据,基于待预测地区的气温数据和天气数据,以及各地区对应的气温阈值、映射关系表以及第二系数,从更多维度对待预测的销量进行预测,最终,得到了待预测地区在气温数据和天气数据下与实际销量相近的预测销量数据。
Smart Images

Figure FT_1 
Figure FT_2 
Figure FT_3
Abstract
Description
Technical Field
[0001] This application relates to the field of data processing technology, and in particular to a sales forecasting method, device and storage medium. Background Technology
[0002] In today's business environment, the accuracy of sales forecasts directly impacts the smooth operation of a company's production planning and inventory management. Traditional sales forecasting methods often rely on simple statistical analysis of historical sales data or empirical judgment, resulting in relatively low accuracy.
[0003] Therefore, the question of how to improve the accuracy of sales forecasting urgently needs to be addressed. Summary of the Invention
[0004] The main objective of this application is to provide a sales forecasting method, device, and storage medium, which aims to improve the accuracy of sales forecasting.
[0005] Firstly, this application provides a sales forecasting method, including: Acquire sales data for multiple regions under different historical temperatures, sales data for multiple regions under different historical weather conditions, and historical sales data for multiple regions. Sales data for multiple regions under different historical temperatures are analyzed to determine temperature thresholds for multiple regions, wherein at least some of the regions have different temperature thresholds. The sales data of multiple regions under different historical weather conditions are analyzed to determine the mapping relationship table corresponding to each region. The mapping relationship table includes the mapping relationship between multiple weather conditions and multiple first coefficients. The first coefficients are used to characterize the degree of correlation between different weather conditions and sales data. Historical sales data for multiple regions are analyzed to determine a second coefficient for each region. The second coefficient is used to characterize the degree of correlation between different regions and sales data. Obtain temperature and weather data for the region to be predicted; Based on the temperature and weather data of the region to be predicted, as well as the temperature threshold, mapping table, and second coefficient corresponding to each region, the predicted sales data of the region to be predicted under the temperature and weather data are determined.
[0006] Secondly, this application also provides a computer device, the computer device including a processor, a memory, and a computer program stored in the memory and executable by the processor, wherein when the computer program is executed by the processor, it implements the steps of the sales forecasting method as described above.
[0007] Thirdly, this application also provides a computer-readable storage medium storing a computer program, wherein when the computer program is executed by a processor, it implements the steps of the sales forecasting method described above.
[0008] This application provides a sales forecasting method, device, and storage medium. The method involves acquiring sales data from multiple regions under different historical temperatures, sales data from multiple regions under different historical weather conditions, and corresponding historical sales data for multiple regions. Analyzing the sales data from multiple regions under different historical temperatures determines temperature thresholds for each region, allowing for a more accurate summary of the impact of temperature changes on sales data in each region, thus facilitating more precise sales forecasting. Furthermore, analyzing the sales data from multiple regions under different historical weather conditions determines a mapping table for each region, enabling a more accurate quantification of the impact of different weather types on sales in each region, further improving the accuracy of sales forecasting. Even further, analyzing the historical sales data for multiple regions determines a second coefficient for each region, thereby identifying the impact of regional characteristics on sales data, ultimately leading to more accurate sales forecasting and significantly improving the accuracy of sales forecasting. When it is necessary to predict the sales data of the region to be predicted, the temperature and weather data of the region to be predicted are obtained. Based on the temperature and weather data of the region to be predicted, as well as the temperature threshold, mapping table and second coefficient of each region, the sales to be predicted are predicted from more dimensions. Finally, the predicted sales data of the region to be predicted are close to the actual sales under the temperature and weather data. Attached Figure Description
[0009] To more clearly illustrate the technical solutions of the embodiments of this application, the drawings used in the description of the embodiments will be briefly introduced below. Obviously, the drawings described below are some embodiments of this application. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0010] Figure 1 This application provides a schematic flowchart of a sales forecasting method. Figure 2 for Figure 1 A flowchart illustrating the sub-steps of the sales forecasting method in [the context of the text]. Figure 3 This is a schematic block diagram of the structure of a computer device provided in an embodiment of this application.
[0011] The realization of the purpose, functional features and advantages of this application will be further explained in conjunction with the embodiments and with reference to the accompanying drawings. Detailed Implementation
[0012] The technical solutions of the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of this application, not all embodiments. Based on the embodiments of this application, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of this application.
[0013] The flowchart shown in the attached diagram is for illustrative purposes only and does not necessarily include all content and operations / steps, nor does it necessarily have to be performed in the order described. For example, some operations / steps can be broken down, combined, or partially merged, so the actual execution order may change depending on the actual situation.
[0014] In today's business environment, the accuracy of sales forecasting directly impacts the smooth operation of a company's production planning and inventory management. Therefore, improving the accuracy of sales forecasting is a pressing issue that needs to be addressed.
[0015] In view of this, embodiments of this application provide a sales forecasting method, device, and storage medium to improve the accuracy of sales forecasting. The sales forecasting method can be applied to terminal devices or servers. The terminal device can be an electronic device such as a mobile phone, tablet computer, laptop computer, desktop computer, personal digital assistant, or wearable device. The server can be a single server or a server cluster composed of multiple servers. The following explanation uses the application of the sales forecasting method to a server as an example.
[0016] The following detailed description of some embodiments of this application is provided in conjunction with the accompanying drawings. Unless otherwise specified, the following embodiments and features can be combined with each other.
[0017] Please refer to Figure 1 , Figure 1 This is a flowchart illustrating the steps of a sales forecasting method provided in an embodiment of this application.
[0018] like Figure 1 As shown, the sales forecasting method includes steps S101 to S106.
[0019] Step S101: Obtain sales data for multiple regions under different historical temperatures, sales data for multiple regions under different historical weather conditions, and corresponding historical sales data for multiple regions.
[0020] Product sales are typically influenced by a variety of factors. Taking air conditioning as an example, higher temperatures significantly increase user demand for air conditioning, leading to increased sales. Conversely, lower temperatures cause a significant decrease in demand and sales. Different weather types, such as sunny, rainy, and cloudy days, also affect users' willingness to go out and their product usage needs to varying degrees. Therefore, obtaining sales data from multiple regions under different historical temperatures and weather conditions can help improve the accuracy of sales forecasts.
[0021] Furthermore, taking regions A in southern China and B in northern my country as examples, there are significant differences in climate characteristics, residents' consumption habits, and lifestyles between regions A and B. Under the same temperature and weather conditions, the sales volume of the same product in the two regions often differs. Similarly, there are significant differences in population size, consumption level, and purchasing power between first-tier cities and third- and fourth-tier cities, resulting in significantly different sales bases for corresponding products. Therefore, based on sales data under different historical temperatures and weather conditions related to temperature and weather types, introducing historical sales data can help further improve the accuracy of subsequent sales forecasts.
[0022] It should be noted that the sales data obtained from multiple regions under different historical temperatures, multiple regions under different historical weather conditions, and multiple regions can be sales data collected within the same or different time ranges, preferably data obtained within the same time range. In some cases, the historical sales data for a certain region can simultaneously be sales data for a specific historical temperature and sales data for a specific historical weather condition associated with that region.
[0023] Step S102: Analyze sales data from multiple regions under different historical temperatures to determine the corresponding temperature thresholds for multiple regions.
[0024] The temperature threshold is used to characterize the sensitivity of sales in different regions to temperature changes. When the actual temperature exceeds a certain threshold, product sales will fluctuate significantly; this temperature is then defined as the temperature threshold. Different regions are influenced by their own climate conditions, residents' living habits, and other factors, resulting in varying degrees of sensitivity to temperature. Therefore, at least some regions will have different temperature thresholds. It should be noted that each region can have one or more temperature thresholds; the specific number can be determined and selected based on the actual product's sensitivity to temperature changes, and no specific limit is imposed here.
[0025] Specifically, taking iced beverages as an example, and taking regions C in the north and D in the south of my country as examples, when the temperature in region C exceeds 26℃, the sales of iced beverages in region C will increase significantly; while the temperature in region D is generally higher than usual, and residents have a better tolerance for high temperatures. When the temperature exceeds 30℃, the sales of iced beverages in region D will increase significantly. Furthermore, when the temperature exceeds 35℃, the sales of iced beverages in region D will increase significantly again. Therefore, two temperature thresholds can be determined for region D, namely 30℃ and 35℃.
[0026] Understandably, by determining the temperature thresholds for each region, we can more accurately summarize the patterns of how temperature changes affect sales data, thus helping to make more accurate sales forecasts.
[0027] In one embodiment, sales data of multiple regions under different historical temperatures are analyzed to determine the corresponding temperature thresholds for multiple regions, including: calculating the sales change rate for each region based on the sales data of multiple regions under different historical temperatures; and determining the corresponding temperature threshold for each region from multiple historical temperatures based on the sales change rate and a preset sales change threshold.
[0028] For example, if the sales change threshold is set to 15%, then when the sales change rate of adjacent temperatures is greater than 15%, the lower of the adjacent temperatures is determined as the temperature threshold.
[0029] It should be noted that, depending on the preset sales change threshold, each region may have one or more corresponding temperature thresholds. In the case of multiple thresholds, further filtering can be performed according to actual needs, such as adjusting the sales change threshold, verifying the prediction error of each temperature threshold, etc., to select a suitable temperature threshold. It should also be noted that in some cases, a temperature threshold may not be identifiable for a particular region. In this situation, the sales change threshold can be adaptively adjusted and the temperature threshold re-determined, or the default temperature threshold for that region can be used as the preset default temperature threshold.
[0030] In one embodiment, determining the temperature threshold corresponding to each region from multiple historical temperatures based on the sales change rate and a preset sales change threshold includes: determining multiple candidate temperature thresholds from multiple historical temperatures based on each sales change rate and the preset sales change threshold; calculating candidate predicted sales data corresponding to each candidate temperature threshold based on a preset fourth sales calculation formula; calculating the prediction error of each candidate temperature threshold based on the historical sales data and the candidate predicted sales data corresponding to each candidate temperature threshold; and determining at least one candidate temperature threshold as the temperature threshold corresponding to each region based on the prediction error of each candidate temperature threshold and a preset prediction error threshold.
[0031] The preset fourth sales calculation formula can be a linear regression formula, a neural network fitting formula, or other formulas that can calculate predicted sales based on the correspondence between historical temperature and historical sales; no specific restrictions are imposed here. Specifically, each sales change rate is compared with a preset sales change threshold, and the historical temperature corresponding to the sales change rate that is greater than or not less than the sales change threshold is used as a candidate temperature threshold. The prediction error of each candidate temperature threshold is compared with a preset prediction error threshold, and the candidate temperature threshold corresponding to the prediction error that is less than or not greater than the prediction error threshold is used as the temperature threshold. It should be noted that in some cases, when it is impossible to determine the candidate temperature threshold or temperature threshold based on the comparison with the corresponding threshold, the preset default candidate temperature threshold or preset default temperature threshold is used instead.
[0032] Step S103: Analyze sales data from multiple regions under different historical weather conditions to determine the corresponding mapping relationship table for each region.
[0033] The mapping table includes mapping relationships between multiple weather conditions and multiple primary coefficients. Different weather conditions can be categorized according to common standards in meteorological industries, such as sunny, cloudy, light rain, heavy rain, rainstorm, and snow. The primary coefficient corresponding to each historical weather condition in each region can be determined by the ratio of the historical average sales under the same weather condition to the historical average sales under all weather conditions in that region, to accurately represent the degree of correlation between different weather conditions and sales data.
[0034] Understandably, by using mapping tables for different regions, it is possible to more accurately quantify the impact of different types of weather on sales in those regions, thus helping to improve the accuracy of sales forecasts.
[0035] In one embodiment, sales data of multiple regions under different historical weather conditions are analyzed to determine the mapping relationship table corresponding to each region. This includes: calculating the average value of sales data of each region under different historical weather conditions to obtain the first sales data corresponding to each region; using the first sales data of each region as the dependent variable and the sales data of each region under different historical weather conditions as the independent variable to construct a linear regression equation corresponding to different historical weather conditions for each region; using the least squares method to calculate the coefficients in each linear regression equation to obtain the first coefficient corresponding to different historical weather conditions for each region; and constructing a mapping relationship table corresponding to each region based on the different historical weather conditions and the first coefficient corresponding to each historical weather condition for each region.
[0036] Similar to the process of determining the temperature threshold, the determination of the first coefficient can also be further confirmed using the prediction error to determine whether it should be retained. For example, suppose we need to predict the sales volume of a certain region on a certain day (the weather on that day is sunny). If the baseline sales volume of cold drinks in this region is 10,000, and the first coefficient corresponding to a sunny day in this region is 1.5, then the predicted sales volume for that day would be 10,000 × 1.5 = 15,000. However, the actual sales volume for that day is 20,000, and the prediction error exceeds the preset threshold (10%). Therefore, the preset default first coefficient is used as the first coefficient corresponding to a sunny day in this region.
[0037] Understandably, calculating the first coefficient through linear regression allows for a more accurate quantification of the impact of different weather conditions on sales in a region, further ensuring the accuracy of sales forecasts. Furthermore, constructing a mapping table for each region enables easier and faster matching of the corresponding first coefficient based on the weather to be predicted, thereby improving forecasting efficiency.
[0038] Step S104: Analyze the historical sales data for multiple regions to determine the second coefficient for each region.
[0039] The second coefficient characterizes the correlation between different regions and sales data. A higher coefficient indicates a greater impact of regional characteristics on sales, and vice versa. It's understandable that different regions differ in population size, consumption levels, economic development, and lifestyle habits. Even under the same temperature and weather conditions, sales in different regions can vary significantly due to regional characteristics. By analyzing historical sales data for each region, the impact of regional characteristics on sales data can be determined, thereby further improving the accuracy of sales forecasting.
[0040] In one embodiment, sales data corresponding to multiple regions are analyzed to determine a second coefficient for each region, including: calculating the average of historical sales data corresponding to each region to obtain second sales data corresponding to each region; calculating the average of historical sales data corresponding to multiple regions to obtain third sales data corresponding to multiple regions; and calculating the ratio of the second sales data to the third sales data corresponding to each region to obtain the second coefficient for each region.
[0041] For example, suppose the average historical sales data of all regions is determined to be 100,000, and the historical average sales of region A and region B are 120,000 and 90,000 respectively. Then the second coefficient corresponding to region A is 120,000 / 100,000 = 1.2, which is higher than the average. Similarly, the second coefficient corresponding to region B is 0.9, which is lower than the average.
[0042] In some embodiments, the second coefficient for each region can be determined by comparing the median of the historical sales data for each region with the median of the historical sales data for each region. For details, please refer to the example above, which will not be elaborated here.
[0043] Understandably, the second coefficient, obtained by analyzing and comparing the differences between historical sales data of various regions and historical sales data of the whole, can more accurately quantify the impact of regional characteristics on sales data and further improve the accuracy of sales forecasting.
[0044] Step S105: Obtain temperature and weather data for the region to be predicted.
[0045] It's important to emphasize that temperature data changes dynamically multiple times throughout the day. Temperatures at different times of day will influence product demand in different sales scenarios, especially when there are significant temperature differences between morning and evening. For example, sales of cold drinks during the morning rush hour are greatly affected by morning temperatures, while demand for beverages during the evening leisure period is more closely tied to the evening temperature. Therefore, when temperature fluctuations are relatively small throughout the day, the daily average temperature can be calculated and used as the primary temperature data. However, when temperature fluctuations are significant within a day, the average temperatures for the morning and afternoon can be determined separately for each half-day period, preventing the average data from masking time-specific temperature differences and ensuring the accuracy of subsequent sales forecasts. The determination of weather data for the region to be predicted follows the same principle as for temperature data and will not be elaborated upon here.
[0046] Step S106: Based on the temperature and weather data of the region to be predicted, as well as the temperature thresholds, mapping relationship tables, and second coefficients of each region, determine the predicted sales data of the region to be predicted under the temperature and weather data.
[0047] Understandably, by using temperature data, weather data, temperature thresholds, mapping tables, and the results of the second coefficient, it is possible to predict the sales volume from more dimensions, thereby greatly improving the accuracy of sales forecasting.
[0048] In one embodiment, such as Figure 2 As shown, step S106 includes sub-steps S1061 to S1064.
[0049] Sub-step S1061: Based on the temperature data of the region to be predicted and the corresponding temperature thresholds of each region, determine the sales calculation formula for the region to be predicted.
[0050] The sales calculation formula is used to calculate the predicted sales data of the region to be predicted under the temperature data. However, depending on the number of temperature thresholds corresponding to each region, there may be one or more corresponding sales calculation formulas for each region, and the sales calculation formula for the region to be predicted will also change accordingly.
[0051] In one embodiment, the temperature threshold includes a first temperature threshold and a second temperature threshold, wherein the first temperature threshold is less than the second temperature threshold. Based on the temperature data of the region to be predicted and the corresponding temperature thresholds for each region, a sales calculation formula for the region to be predicted is determined, including: comparing the temperature data of the region to be predicted with the corresponding first and second temperature thresholds for each region; if the temperature data of the region to be predicted is less than or equal to the first temperature threshold, then the sales calculation formula for the region to be predicted is determined as a first sales calculation formula, which calculates the predicted sales data of the region under the temperature data based on a preset benchmark sales volume; if the temperature data of the region to be predicted is greater than the first temperature threshold and less than or equal to the second temperature threshold, then the sales calculation formula for the region to be predicted is determined as a second sales calculation formula, which calculates the predicted sales data of the region under the temperature data based on the benchmark sales volume, temperature data, the first temperature threshold, and a preset first temperature coefficient; if the temperature data of the region to be predicted is greater than the second temperature threshold, then the sales calculation formula for the region to be predicted is determined as a third sales calculation formula, which calculates the predicted sales data of the region under the temperature data based on the benchmark sales volume, temperature data, the first temperature threshold, the second temperature threshold, the first temperature coefficient, and a preset second temperature coefficient.
[0052] The preset benchmark sales volume is used to reflect the benchmark sales level of the product, which can be determined based on the average of historical sales data in each region. The preset first temperature coefficient and second temperature coefficient are used to accurately reflect the sales growth trend in each temperature stage, which can be determined based on regression analysis of historical sales data.
[0053] For example, regions matching the region to be predicted are identified from various regions. For instance, if the region to be predicted is region A, then region A is locked from multiple regions, and its temperature threshold is obtained accordingly. Let the temperature thresholds for region A include a first temperature threshold and a second temperature threshold, T1 and T2 (T1 < T2), respectively. Based on T1 and T2, three temperature stages are defined for region A: a low-temperature stage (temperature ≤ T1), a medium-temperature stage (T1 < temperature ≤ T2), and a high-temperature stage (T2 < temperature). The sales calculation formulas for the three temperature stages are as follows: First sales volume calculation formula: S=S0; Second sales calculation formula: S=S0+A×(T-T1) Third sales calculation formula: S=S0+A×(T2-T1)+B×(T-T2); Where S represents the predicted sales volume, S0 represents the baseline sales volume, A and B represent the first and second temperature coefficients, respectively, and T represents the temperature of the region to be predicted. If the temperature data of the region to be predicted is greater than T2, then the sales volume calculation formula for the region to be predicted is determined to be the third sales volume calculation formula corresponding to the high-temperature stage.
[0054] Sub-step S1062: Based on the weather data of the region to be predicted and the mapping relationship table of each region, determine the first coefficient corresponding to the region to be predicted.
[0055] The mapping table for each region records the mapping relationships between multiple weather conditions and multiple first coefficients for each region. Therefore, by using the weather data of the region to be predicted and the mapping table, the first coefficient used to characterize the correlation between the current weather and sales data of the region to be predicted can be quickly obtained, effectively improving the efficiency of sales prediction.
[0056] It should be noted that in some cases, such as due to missing sample data during the construction of the mapping table, the mapping table may be missing data associated with a certain type of weather. In this case, the preset default first coefficient can be directly used as the first coefficient corresponding to the region to be predicted, so as to ensure the stability and continuous progress of sales forecasting for the region to be predicted.
[0057] Sub-step S1063: Determine the second coefficient corresponding to the region to be predicted from the second coefficients corresponding to each region.
[0058] The second coefficient is used to characterize the degree of correlation between different regions and sales data. The second coefficient for each region can be stored in a table similar to the mapping table mentioned above, along with the identification information of the corresponding region. Therefore, by querying the table using the identification information of the region to be predicted, the second coefficient corresponding to the region to be predicted can be obtained quickly, effectively improving the efficiency of sales prediction.
[0059] It should be noted that if the region to be predicted is a newly added region and there is no corresponding region record in the table, the average of the second coefficients of regions of the same type (such as geographically close and / or with similar economic development levels) in the table can be used as the second coefficient of the region to be predicted. Alternatively, the preset default second coefficient can be used as the second coefficient of the region to be predicted. The default second coefficient can be the median or average of the second coefficients of multiple regions.
[0060] Sub-step S1064: Based on the sales calculation formula, the first coefficient, and the second coefficient corresponding to the region to be predicted, determine the predicted sales data of the region to be predicted under temperature data and weather type data.
[0061] In this method, given that all the data in the sales calculation formula for the region to be predicted are known, the predicted sales data for the region under temperature data can be quickly calculated. Furthermore, by using a first coefficient to characterize the correlation between the region under weather type data and a second coefficient to characterize the correlation between the region itself and sales data, the predicted sales data for the region under temperature data is corrected. This fully integrates the influence of weather type and the region's own attributes on sales, making the final sales prediction result closer to the actual sales situation and greatly improving the accuracy of sales prediction.
[0062] In one embodiment, the predicted sales data of the region to be predicted under temperature data and weather type data is determined based on the sales calculation formula, the first coefficient, and the second coefficient corresponding to the region to be predicted. This includes: calculating the predicted sales data of the region to be predicted under temperature data based on the sales calculation formula corresponding to the region to be predicted; and adjusting the predicted sales data using the first coefficient and the second coefficient corresponding to the region to be predicted to obtain the predicted sales data of the region to be predicted under temperature data and weather type data.
[0063] For example, suppose we need to predict the sales volume of a certain product in location A for the next day. We know from the weather forecast that the temperature data for location A for the next day is T, and the weather type is sunny. If the sales volume calculation formula for location A is determined to be the third sales volume calculation formula S = S0 + A × (T2 - T1) + B × (T - T2), where the baseline sales volume S0, the first temperature coefficient A, the second temperature coefficient B, the first temperature threshold T1, and the second temperature threshold T2 are all known, we can directly substitute the temperature data T corresponding to location A into this third sales volume calculation formula to calculate the first predicted sales volume data S1 for location A at temperature T. Next, we calculate the product of S1 and the first coefficient corresponding to location A to obtain the second predicted sales volume data S2 for location A. Finally, we calculate the product of S2 and the second coefficient corresponding to location A to obtain the second predicted sales volume data S3 for location A. S3 is the predicted sales volume data for location A the next day when the temperature data is T and the weather type is sunny.
[0064] The sales forecasting method provided in the above embodiments acquires sales data from multiple regions under different historical temperatures, sales data from multiple regions under different historical weather conditions, and corresponding historical sales data for multiple regions. It analyzes the sales data from multiple regions under different historical temperatures to determine the corresponding temperature thresholds for each region, thereby more accurately summarizing the impact of temperature changes on sales data in each region and contributing to more accurate sales forecasting. Furthermore, it analyzes the sales data from multiple regions under different historical weather conditions to determine the corresponding mapping relationship table for each region. This allows for a more accurate quantification of the impact of different weather types on sales in each region, further improving the accuracy of sales forecasting. Even further, it analyzes the corresponding historical sales data for multiple regions to determine the corresponding second coefficient for each region, thereby determining the impact of regional characteristics on sales data and ultimately enabling more accurate sales forecasting, significantly improving the accuracy of sales forecasting. When it is necessary to predict the sales data of the region to be predicted, the temperature and weather data of the region to be predicted are obtained. Based on the temperature and weather data of the region to be predicted, as well as the temperature threshold, mapping table and second coefficient of each region, the sales to be predicted are predicted from more dimensions. Finally, the predicted sales data of the region to be predicted are similar to the actual sales data under the temperature and weather data.
[0065] This application embodiment also provides a sales forecasting device, which includes: The first acquisition module is used to acquire sales data of multiple regions under different historical temperatures, sales data of multiple regions under different historical weather conditions, and corresponding historical sales data of multiple regions. The first analysis module is used to analyze sales data of multiple regions under different historical temperatures in order to determine the corresponding temperature thresholds for multiple regions, wherein at least some regions have different corresponding temperature thresholds; The second analysis module is used to analyze sales data of multiple regions under different historical weather conditions in order to determine the corresponding mapping relationship table for each region. The mapping relationship table includes the mapping relationship between multiple weather conditions and multiple first coefficients. The first coefficient is used to characterize the degree of correlation between different weather conditions and sales data. The third analysis module is used to analyze historical sales data for multiple regions to determine the second coefficient for each region. The second coefficient is used to characterize the degree of correlation between different regions and sales data. The second acquisition module is used to acquire temperature data and weather data for the region to be predicted. The sales volume determination module is used to determine the predicted sales volume data for the region under the given temperature and weather data, as well as the corresponding temperature thresholds, mapping tables, and second coefficients for each region.
[0066] In one embodiment, the first analysis module is further configured to: Based on sales data from multiple regions at different historical temperatures, calculate the corresponding sales change rate for each region; based on the sales change rate and a preset sales change threshold, determine the corresponding temperature threshold for each region from multiple historical temperatures.
[0067] In one embodiment, the first analysis module is further configured to: Based on the sales change rate and the preset sales change threshold, multiple candidate temperature thresholds are determined from multiple historical temperatures; based on the preset fourth sales calculation formula, candidate predicted sales data corresponding to each candidate temperature threshold are calculated; based on the historical sales data and candidate predicted sales data corresponding to each candidate temperature threshold, the prediction error of each candidate temperature threshold is calculated; based on the prediction error of each candidate temperature threshold and the preset prediction error threshold, at least one candidate temperature threshold is determined from multiple candidate temperature thresholds as the temperature threshold corresponding to each region.
[0068] In one embodiment, the second analysis module is further configured to: Calculate the average sales data of each region under different historical weather conditions to obtain the first sales data for each region; use the first sales data of each region as the dependent variable and the sales data of each region under different historical weather conditions as the independent variable to construct the linear regression equations for each region under different historical weather conditions; use the least squares method to calculate the coefficients in each linear regression equation to obtain the first coefficients for each region under different historical weather conditions; based on the different historical weather conditions and the first coefficients for each historical weather condition, construct the mapping relationship table for each region.
[0069] In one embodiment, the third analysis module is also used for: Calculate the average of historical sales data for each region to obtain the second sales data for each region; calculate the average of historical sales data for multiple regions to obtain the third sales data for multiple regions; calculate the ratio of the second sales data to the third sales data for each region to obtain the second coefficient for each region.
[0070] In one embodiment, the sales determination module includes: The calculation formula determination submodule is used to determine the sales calculation formula for the region to be predicted based on the temperature data of the region to be predicted and the corresponding temperature thresholds for each region. The sales calculation formula is used to calculate the predicted sales data for the region to be predicted under the temperature data.
[0071] The first coefficient determination submodule is used to determine the first coefficient corresponding to the region to be predicted based on the weather data of the region to be predicted and the corresponding mapping table of each region.
[0072] The second coefficient determination submodule is used to determine the second coefficient corresponding to the region to be predicted from the second coefficients corresponding to each region.
[0073] The sales data prediction submodule is used to determine the predicted sales data for the region under temperature and weather type data based on the sales calculation formula, the first coefficient, and the second coefficient corresponding to the region to be predicted.
[0074] In one embodiment, the sales determination module is also used for: The temperature data of the region to be predicted is compared with the first and second temperature thresholds corresponding to each region. If the temperature data of the region to be predicted is less than or equal to the first temperature threshold, the sales calculation formula for the region to be predicted is determined as the first sales calculation formula. The first sales calculation formula calculates the predicted sales data of the region to be predicted under the temperature data based on a preset benchmark sales data. If the temperature data of the region to be predicted is greater than the first temperature threshold and less than or equal to the second temperature threshold, the sales calculation formula for the region to be predicted is determined as the second sales calculation formula. The second sales calculation formula calculates the predicted sales data of the region to be predicted under the temperature data based on the benchmark sales data, temperature data, the first temperature threshold, and a preset first temperature coefficient. If the temperature data of the region to be predicted is greater than the second temperature threshold, the sales calculation formula for the region to be predicted is determined as the third sales calculation formula. The third sales calculation formula calculates the predicted sales data of the region to be predicted under the temperature data based on the benchmark sales data, temperature data, the first temperature threshold, the second temperature threshold, the first temperature coefficient, and a preset second temperature coefficient.
[0075] In one embodiment, the sales determination module is also used for: Based on the sales calculation formula corresponding to the region to be predicted, the predicted sales data of the region to be predicted under temperature data is calculated; the predicted sales data is adjusted using the first coefficient and the second coefficient corresponding to the region to be predicted, and the predicted sales data of the region to be predicted under temperature data and weather type data is obtained.
[0076] It should be noted that those skilled in the art will understand that, for the sake of convenience and brevity, the specific working processes of the above-described device and its modules and units can be referred to the corresponding processes in the aforementioned sales forecasting method embodiments, and will not be repeated here.
[0077] The apparatus provided in the above embodiments can be implemented as a computer program, which can be used in, for example... Figure 3 It runs on the computer device shown.
[0078] Please see Figure 3 , Figure 3 This is a schematic block diagram of the structure of a computer device provided in an embodiment of this application.
[0079] like Figure 3 As shown, the computer device 300 includes a processor 301, a memory 302, and a network interface connected via a system bus 303. The memory 302 may include a storage medium and internal memory. The storage medium may be non-volatile or volatile.
[0080] The processor 301 provides computing and control capabilities to support the operation of the entire computer device 300.
[0081] The storage medium may store an operating system and a computer program. The computer program includes program instructions that, when executed, cause the processor 301 to perform any feature data processing method.
[0082] The internal memory provides an environment for the execution of computer programs stored in the storage medium. When the computer program is executed by the processor 301, the processor 301 can execute any feature data processing method.
[0083] Network interfaces are used for network communication, such as sending assigned tasks.
[0084] Those skilled in the art will understand that Figure 3 The structure shown is merely a block diagram of a portion of the structure related to the present application and does not constitute a limitation on the computer device to which the present application is applied. Specific computer devices may include more or fewer components than those shown in the figure, or combine certain components, or have different component arrangements.
[0085] It should be understood that processor 301 can be a Central Processing Unit (CPU), but it can also be other general-purpose processors, digital signal processors (DSPs), application-specific integrated circuits (ASICs), field-programmable gate arrays (FPGAs), or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. Among these, the general-purpose processor can be a microprocessor or any conventional processor.
[0086] In one embodiment, the processor is configured to run a computer program stored in memory to perform the following steps: Obtain sales data for multiple regions under different historical temperatures, sales data for multiple regions under different historical weather conditions, and corresponding historical sales data for multiple regions; Sales data from multiple regions under different historical temperatures were analyzed to determine the corresponding temperature thresholds for multiple regions, where at least some regions have different corresponding temperature thresholds; Sales data from multiple regions under different historical weather conditions were analyzed to determine the mapping relationship table for each region. The mapping relationship table includes the mapping relationship between multiple weather conditions and multiple first coefficients. The first coefficient is used to characterize the degree of correlation between different weather conditions and sales data. Historical sales data for multiple regions are analyzed to determine the second coefficient for each region. The second coefficient is used to characterize the degree of correlation between different regions and sales data. Obtain temperature and weather data for the region to be predicted; Based on the temperature and weather data of the region to be predicted, as well as the corresponding temperature thresholds, mapping tables, and second coefficients for each region, the predicted sales data for the region to be predicted under the temperature and weather data are determined.
[0087] In one embodiment, when the processor analyzes sales data from multiple regions at different historical temperatures to determine the corresponding temperature thresholds for those regions, it is used to: Based on sales data from multiple regions at different historical temperatures, calculate the corresponding sales change rate for each region; based on the sales change rate and a preset sales change threshold, determine the corresponding temperature threshold for each region from multiple historical temperatures.
[0088] In one embodiment, when the processor determines the corresponding temperature threshold for each region from multiple historical temperatures based on the sales change rate and a preset sales change threshold, it is used to: Based on the sales change rate and the preset sales change threshold, multiple candidate temperature thresholds are determined from multiple historical temperatures; based on the preset fourth sales calculation formula, candidate predicted sales data corresponding to each candidate temperature threshold are calculated; based on the historical sales data and candidate predicted sales data corresponding to each candidate temperature threshold, the prediction error of each candidate temperature threshold is calculated; based on the prediction error of each candidate temperature threshold and the preset prediction error threshold, at least one candidate temperature threshold is determined from multiple candidate temperature thresholds as the temperature threshold corresponding to each region.
[0089] In one embodiment, when the processor analyzes sales data from multiple regions under different historical weather conditions to determine the corresponding mapping table for each region, it is used to: Calculate the average sales data of each region under different historical weather conditions to obtain the first sales data for each region; use the first sales data of each region as the dependent variable and the sales data of each region under different historical weather conditions as the independent variable to construct the linear regression equations for each region under different historical weather conditions; use the least squares method to calculate the coefficients in each linear regression equation to obtain the first coefficients for each region under different historical weather conditions; based on the different historical weather conditions and the first coefficients for each historical weather condition, construct the mapping relationship table for each region.
[0090] In one embodiment, when the processor analyzes historical sales data for multiple regions to determine a second coefficient for each region, it is used to: Calculate the average of historical sales data for each region to obtain the second sales data for each region; calculate the average of historical sales data for multiple regions to obtain the third sales data for multiple regions; calculate the ratio of the second sales data to the third sales data for each region to obtain the second coefficient for each region.
[0091] In one embodiment, when the processor determines the predicted sales data for the region under the given temperature and weather data based on the region to be predicted, as well as the corresponding temperature thresholds, mapping tables, and second coefficients for each region, it performs the following: Based on the temperature data of the region to be predicted and the corresponding temperature thresholds for each region, a sales calculation formula for the region to be predicted is determined. This sales calculation formula is used to calculate the predicted sales data for the region under the given temperature data. A first coefficient for the region to be predicted is determined based on the weather data of the region to be predicted and the corresponding mapping table for each region. A second coefficient for the region to be predicted is determined from the second coefficients for each region. Based on the sales calculation formula, the first coefficient, and the second coefficient, the predicted sales data for the region to be predicted under both temperature data and weather type data is determined.
[0092] In one embodiment, the temperature threshold includes a first temperature threshold and a second temperature threshold, where the first temperature threshold is less than the second temperature threshold. When the processor implements the formula for determining the sales volume corresponding to the region to be predicted based on the temperature data of the region to be predicted and the corresponding temperature thresholds for each region, it is used to: The temperature data of the region to be predicted is compared with the first and second temperature thresholds corresponding to each region. If the temperature data of the region to be predicted is less than or equal to the first temperature threshold, the sales calculation formula for the region to be predicted is determined as the first sales calculation formula. The first sales calculation formula calculates the predicted sales data of the region to be predicted under the temperature data based on a preset benchmark sales data. If the temperature data of the region to be predicted is greater than the first temperature threshold and less than or equal to the second temperature threshold, the sales calculation formula for the region to be predicted is determined as the second sales calculation formula. The second sales calculation formula calculates the predicted sales data of the region to be predicted under the temperature data based on the benchmark sales data, temperature data, the first temperature threshold, and a preset first temperature coefficient. If the temperature data of the region to be predicted is greater than the second temperature threshold, the sales calculation formula for the region to be predicted is determined as the third sales calculation formula. The third sales calculation formula calculates the predicted sales data of the region to be predicted under the temperature data based on the benchmark sales data, temperature data, the first temperature threshold, the second temperature threshold, the first temperature coefficient, and a preset second temperature coefficient.
[0093] In one embodiment, when the processor determines the predicted sales data for the region under temperature and weather type data based on the sales calculation formula, the first coefficient, and the second coefficient corresponding to the region to be predicted, it is used to: Based on the sales calculation formula corresponding to the region to be predicted, the predicted sales data of the region to be predicted under temperature data is calculated; the predicted sales data is adjusted using the first coefficient and the second coefficient corresponding to the region to be predicted, and the predicted sales data of the region to be predicted under temperature data and weather type data is obtained.
[0094] It should be noted that those skilled in the art will understand that, for the sake of convenience and brevity, the specific working process of the computer device described above can be referred to the corresponding process in the aforementioned feature data processing method embodiments, and will not be repeated here.
[0095] This application can be used in a wide variety of general-purpose or special-purpose computer system environments or configurations. Examples include: personal computers, server computers, handheld or portable devices, tablet devices, multiprocessor systems, microprocessor-based systems, set-top boxes, programmable consumer electronics, network PCs, minicomputers, mainframe computers, and distributed computing environments including any of the above systems or devices. This application can be described in the general context of computer-executable instructions executed by a computer, such as program modules. Generally, program modules include routines, programs, objects, components, data structures, etc., that perform specific tasks or implement specific abstract data types. This application can also be practiced in distributed computing environments where tasks are performed by remote processing devices connected via a communication network. In distributed computing environments, program modules can reside in local and remote computer storage media, including storage devices.
[0096] This application also provides a computer-readable storage medium storing a computer program, which includes program instructions. When the program instructions are executed, the method implemented can be referred to various embodiments of the feature data processing method of this application.
[0097] The computer-readable storage medium can be an internal storage unit of the computer device described in the foregoing embodiments, such as a hard disk or memory of the computer device. Alternatively, it can be an external storage device of the computer device, such as a plug-in hard disk, smart media card (SMC), secure digital card (SD), flash card, etc., provided on the computer device.
[0098] It will be understood by those skilled in the art that all or some of the steps, systems, or apparatuses disclosed above, and their functional modules / units, can be implemented as software, firmware, hardware, or suitable combinations thereof. In hardware implementations, the division between functional modules / units mentioned in the above description does not necessarily correspond to the division of physical components; for example, a physical component may have multiple functions, or a function or step may be performed collaboratively by several physical components. Some or all physical components may be implemented as software executed by a processor, such as a central processing unit, digital signal processor, or microprocessor, or as hardware, or as an integrated circuit, such as an application-specific integrated circuit (ASIC). Such software may be distributed on a computer-readable medium, which may include computer storage media (or non-transitory media) and communication media (or transient media). As is known to those skilled in the art, the term computer storage media includes volatile and non-volatile, removable and non-removable media implemented in any method or technology for storing information (such as computer-readable instructions, data structures, program modules, or other data). Computer storage media include, but are not limited to, RAM, ROM, EEPROM, flash memory or other memory technologies, CD, ROM, digital versatile disc (DVD) or other optical disc storage, magnetic cartridges, magnetic tape, disk storage or other magnetic storage devices, or any other medium that can be used to store desired information and can be accessed by a computer. Furthermore, it is well known to those skilled in the art that communication media typically contain computer-readable instructions, data structures, program modules, or other data in modulated data signals such as carrier waves or other transmission mechanisms, and may include any information delivery medium.
[0099] It should be understood that the terminology used in this specification is for the purpose of describing particular embodiments only and is not intended to limit the scope of the application. As used in this specification and the appended claims, the singular forms “a,” “an,” and “the” are intended to include the plural forms unless the context clearly indicates otherwise.
[0100] It should also be understood that the term "and / or" as used in this specification and the appended claims refers to any combination and all possible combinations of one or more of the associated listed items, and includes such combinations. It should be noted that, herein, the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or system that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such a process, method, article, or system. Without further limitation, an element defined by the phrase "comprising one..." does not exclude the presence of other identical elements in the process, method, article, or system that includes that element.
[0101] The sequence numbers of the embodiments in this application are for descriptive purposes only and do not represent the superiority or inferiority of the embodiments. The above descriptions are merely specific implementations of this application, but the scope of protection of this application is not limited thereto. Any person skilled in the art can easily conceive of various equivalent modifications or substitutions within the technical scope disclosed in this application, and these modifications or substitutions should all be covered within the scope of protection of this application. Therefore, the scope of protection of this application should be determined by the scope of the claims.
Claims
1. A sales forecasting method, characterized in that, include: Acquire sales data for multiple regions under different historical temperatures, sales data for multiple regions under different historical weather conditions, and historical sales data for multiple regions. Sales data for multiple regions under different historical temperatures are analyzed to determine temperature thresholds for multiple regions, wherein at least some of the regions have different temperature thresholds. The sales data of multiple regions under different historical weather conditions are analyzed to determine the mapping relationship table corresponding to each region. The mapping relationship table includes the mapping relationship between multiple weather conditions and multiple first coefficients. The first coefficients are used to characterize the degree of correlation between different weather conditions and sales data. Historical sales data for multiple regions are analyzed to determine a second coefficient for each region. The second coefficient is used to characterize the degree of correlation between different regions and sales data. Obtain temperature and weather data for the region to be predicted; Based on the temperature and weather data of the region to be predicted, as well as the temperature threshold, mapping table, and second coefficient corresponding to each region, the predicted sales data of the region to be predicted under the temperature and weather data are determined.
2. The sales forecasting method as described in claim 1, characterized in that, The step of determining the predicted sales data for the region to be predicted based on the temperature and weather data of the region to be predicted, as well as the temperature thresholds, mapping tables, and second coefficients corresponding to each region, includes: Based on the temperature data of the region to be predicted and the corresponding temperature thresholds for each region, a sales calculation formula is determined for the region to be predicted; wherein, the sales calculation formula is used to calculate the predicted sales data for the region to be predicted under the given temperature data; and Based on the weather data of the region to be predicted and the mapping table corresponding to each region, a first coefficient corresponding to the region to be predicted is determined; and The second coefficient corresponding to the region to be predicted is determined from the second coefficients corresponding to each of the aforementioned regions; Based on the sales calculation formula corresponding to the region to be predicted, the first coefficient, and the second coefficient, the predicted sales data for the region to be predicted under the temperature data and the weather type data are determined.
3. The sales forecasting method as described in claim 2, characterized in that, The temperature threshold includes a first temperature threshold and a second temperature threshold, wherein the first temperature threshold is less than the second temperature threshold; The step of determining the sales calculation formula for the region to be predicted based on the temperature data of the region to be predicted and the corresponding temperature thresholds for each region includes: The temperature data of the region to be predicted is compared with the first temperature threshold and the second temperature threshold corresponding to each region; If the temperature data of the region to be predicted is less than or equal to the first temperature threshold, then the sales calculation formula corresponding to the region to be predicted is determined to be the first sales calculation formula. The first sales calculation formula calculates the predicted sales data of the region to be predicted under the temperature data based on the preset benchmark sales. If the temperature data of the region to be predicted is greater than the first temperature threshold and less than or equal to the second temperature threshold, then the sales calculation formula corresponding to the region to be predicted is determined to be the second sales calculation formula. The second sales calculation formula calculates the predicted sales data of the region to be predicted under the temperature data based on the benchmark sales, the temperature data, the first temperature threshold and the preset first temperature coefficient. If the temperature data of the region to be predicted is greater than the second temperature threshold, then the sales calculation formula corresponding to the region to be predicted is determined to be the third sales calculation formula. The third sales calculation formula calculates the predicted sales data of the region to be predicted under the temperature data based on the benchmark sales, the temperature data, the first temperature threshold, the second temperature threshold, the first temperature coefficient, and the preset second temperature coefficient.
4. The sales forecasting method as described in claim 2, characterized in that, The step of determining the predicted sales data for the region to be predicted under the temperature data and the weather type data based on the sales calculation formula corresponding to the region to be predicted, the first coefficient, and the second coefficient includes: Based on the sales calculation formula corresponding to the region to be predicted, calculate the predicted sales data of the region to be predicted under the temperature data; The predicted sales data is adjusted using the first coefficient and the second coefficient corresponding to the region to be predicted, to obtain the predicted sales data for the region to be predicted under the temperature data and the weather type data.
5. The sales forecasting method as described in claim 1, characterized in that, The analysis of sales data for multiple regions under different historical temperatures to determine the corresponding temperature thresholds for multiple regions includes: Based on sales data from multiple regions under different historical temperatures, calculate the sales change rate for each region. Based on the sales change rate and the preset sales change threshold, the temperature threshold corresponding to each region is determined from multiple historical temperatures.
6. The sales forecasting method as described in claim 5, characterized in that, The step of determining the temperature threshold corresponding to each region from multiple historical temperatures based on the sales change rate and a preset sales change threshold includes: Based on the sales change rate and the preset sales change threshold, multiple candidate temperature thresholds are determined from the multiple historical temperatures. Based on the preset fourth sales calculation formula, calculate the candidate predicted sales data corresponding to each of the candidate temperature thresholds; Based on the historical sales data and candidate predicted sales data corresponding to each of the candidate temperature thresholds, the prediction error of each of the candidate temperature thresholds is calculated. Based on the prediction error of each candidate temperature threshold and a preset prediction error threshold, at least one of the candidate temperature thresholds is determined as the temperature threshold corresponding to each region.
7. The sales forecasting method as described in any one of claims 1-6, characterized in that, The analysis of sales data for multiple regions under different historical weather conditions to determine the mapping relationship table corresponding to each region includes: Calculate the average sales data of each region under different historical weather conditions to obtain the first sales data corresponding to each region; Using the first sales data of each region as the dependent variable and the sales data of each region under different historical weather conditions as the independent variable, a linear regression equation corresponding to the different historical weather conditions of each region is constructed. The coefficients in each of the linear regression equations are calculated using the least squares method to obtain the first coefficients corresponding to the different historical weather conditions in each of the regions. Based on the different historical weather conditions of each region and the first coefficient corresponding to each historical weather condition, a mapping relationship table is constructed for each region.
8. The sales forecasting method as described in any one of claims 1-6, characterized in that, The analysis of sales data corresponding to multiple regions to determine the second coefficient corresponding to each region includes: Calculate the average of the historical sales data for each region to obtain the second sales data for each region. Calculate the average of historical sales data corresponding to multiple regions to obtain third sales data that is common to multiple regions; Calculate the ratio of the second sales data to the third sales data for each region to obtain the second coefficient for each region.
9. A computer device, characterized in that, The computer device includes a processor, a memory, and a computer program stored in the memory and executable by the processor, wherein when the computer program is executed by the processor, it implements the sales forecasting method as described in any one of claims 1 to 8.
10. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores a computer program, wherein when the computer program is executed by a processor, it implements the sales forecasting method as described in any one of claims 1 to 8.