Movatterモバイル変換


[0]ホーム

URL:


CN115423538A - New product sales data prediction method and device, storage medium, electronic equipment - Google Patents

New product sales data prediction method and device, storage medium, electronic equipment
Download PDF

Info

Publication number
CN115423538A
CN115423538ACN202211362770.1ACN202211362770ACN115423538ACN 115423538 ACN115423538 ACN 115423538ACN 202211362770 ACN202211362770 ACN 202211362770ACN 115423538 ACN115423538 ACN 115423538A
Authority
CN
China
Prior art keywords
data
sales data
sales
product
new product
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202211362770.1A
Other languages
Chinese (zh)
Inventor
许先才
李世祥
吴建龙
庞超
熊磊
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Shenzhen Yunintegral Technology Co ltd
Original Assignee
Shenzhen Yunintegral Technology Co ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Shenzhen Yunintegral Technology Co ltdfiledCriticalShenzhen Yunintegral Technology Co ltd
Priority to CN202211362770.1ApriorityCriticalpatent/CN115423538A/en
Publication of CN115423538ApublicationCriticalpatent/CN115423538A/en
Pendinglegal-statusCriticalCurrent

Links

Images

Classifications

Landscapes

Abstract

The invention discloses a method and a device for predicting new product sales data, a storage medium and electronic equipment, wherein the method comprises the following steps: determining a related product set of a target new product, wherein the related product set comprises a plurality of related products related to the target new product; acquiring first sales data of the associated product set in a first historical time period and acquiring second sales data of the target new product in a second historical time period, wherein the first historical time period is greater than the second historical time period; training an initial prediction model of the target new product by adopting the first sales data and the second sales data to obtain a target prediction model; and predicting third sales data of the target new product in a future period of time by using the target prediction model. According to the method and the device, the technical problem that the new product sales data cannot be accurately predicted by adopting a prediction model in the related technology is solved, and the accuracy and the reliability of the new product sales prediction are improved.

Description

Translated fromChinese
新品销量数据的预测方法及装置、存储介质、电子设备Method and device, storage medium, and electronic equipment for predicting new product sales data

技术领域technical field

本发明涉及人工智能领域,具体而言,涉及一种新品销量数据的预测方法及装置、存储介质、电子设备。The present invention relates to the field of artificial intelligence, in particular to a method and device for predicting new product sales data, a storage medium, and electronic equipment.

背景技术Background technique

相关技术中,在电子商务等领域,由于市场需求的变化、生产技术的发展、行业竞争的加剧,各品牌面临着产品推陈出新的需求。同时,为了合理地制定采购、生产、储存和营销等相关计划,品牌需要对新品的销量进行预估,从而为经营决策提供数据支撑。因此,新品销量的预测对企业而言具有重要的意义。它不仅可以帮助企业制定更合理的销售计划,减少出现新品断货或滞销的现象,也可以帮助企业合理进行生产和采购规划,从而综合性地提升企业利润。然而,新品上市初期销售数据较少,给建模带来很大难度,很多模型无法基于这么少的数据进行建模。而依赖人工进行新品销量预测的方法又容易出现个人经验偏差。Among related technologies, in e-commerce and other fields, due to changes in market demand, development of production technology, and intensified competition in the industry, brands are faced with the need to introduce new products from old ones. At the same time, in order to reasonably formulate relevant plans such as procurement, production, storage and marketing, brands need to estimate the sales of new products, so as to provide data support for business decisions. Therefore, the forecast of new product sales is of great significance to enterprises. It can not only help companies formulate more reasonable sales plans, reduce the phenomenon of new products being out of stock or unsalable, but also help companies make reasonable production and procurement plans, thereby comprehensively improving corporate profits. However, the lack of sales data at the initial stage of new product launch brings great difficulty to modeling, and many models cannot be modeled based on such a small amount of data. However, the method of relying on manual forecasting of new product sales is prone to personal experience bias.

相关技术中,如果仅基于新品自身数据建模,则难以有效建模。由于618、双11等大促期商品的销量常常是平销期的成百上千倍,如果仅仅基于新品上市初期几个月平销期的短期数据,则无法预测出618、双11等大促期的销量。同时,如果基于新品未满一年的数据进行建模,缺乏历史年度的数据,则难以学习到年度增长趋势等内在隐含的长期规律。In related technologies, it is difficult to model effectively if the model is only based on the data of the new product itself. Since the sales of products during big promotional periods such as 6.18 and Double 11 are often hundreds or even thousands of times that of the flat-selling period, if only based on the short-term data of the flat-selling period in the first few months of the new product launch, it is impossible to predict the sales of 6.18, Double 11 and other big promotions. Promotional sales. At the same time, if the modeling is based on the data of new products less than one year old, and there is a lack of historical year data, it will be difficult to learn inherent long-term laws such as annual growth trends.

相关技术中的预测新品销量的方法基于相似品的历史销量数据对新品销量进行预测,基于常规时间序列机器学习算法先预测出相似品的未来销量,再根据新品跟相似品的相似度,计算出各个相似品的权重,并且对这些权重进行归一化,使得所有相似品的权重之和为1,之后,再对相似品的销量的预测值进行加权求和。这类方法的特点是,新品的销量数据不参与模型的训练,仅根据归一化后的相似度,通过相似品预测值的线性组合产生新品的预测值,从而难以拟合新品和相似品之间的差异点。例如,如果相似品选取的数量较少,那么可以用于组合的预测值就少,拟合能力有限,极端情形下,如果只选择一个相似品,那么无论它与新品相似度是高或低,它的权重都是1,新品的预测值永远跟这个相似品的预测值相同。另一方面,如果相似度不高的商品数量过多,那么由于组合的相似品预测值本身就跟新品存在较大偏差,组合进来之后,会带来更多的误差。The method for predicting the sales of new products in the related art is based on the historical sales data of similar products to predict the sales of new products. Based on the conventional time series machine learning algorithm, the future sales of similar products are first predicted, and then according to the similarity between the new product and similar products, calculate The weights of each similar product are normalized, so that the sum of the weights of all similar products is 1, and then the weighted sum of the predicted sales of similar products is performed. The characteristic of this type of method is that the sales data of new products does not participate in the training of the model, and only based on the normalized similarity, the predicted value of the new product is generated through the linear combination of the predicted values of similar products, so it is difficult to fit the relationship between new products and similar products. difference between. For example, if the number of similar products selected is small, then there are few predictive values that can be used for combination, and the fitting ability is limited. In extreme cases, if only one similar product is selected, no matter whether it is high or low similar to the new product, Its weight is 1, and the predicted value of the new product will always be the same as the predicted value of this similar product. On the other hand, if there are too many products with low similarity, the predicted value of the combined similar product itself has a large deviation from the new product, and the combination will bring more errors.

针对相关技术中存在的上述问题,目前尚未发现有效的解决方案。Aiming at the above-mentioned problems existing in related technologies, no effective solution has been found yet.

发明内容Contents of the invention

本发明实施例提供了一种新品销量数据的预测方法及装置、存储介质、电子设备。Embodiments of the present invention provide a method and device for predicting new product sales data, a storage medium, and electronic equipment.

根据本申请实施例的一个方面,提供了一种新品销量数据的预测方法,包括:确定目标新品的关联产品集合,其中,所述关联产品集合包括与所述目标新品相关的多个关联产品;获取所述关联产品集合在第一历史时段的第一销量数据,以及获取所述目标新品在第二历史时段的第二销量数据,其中,所述第一历史时段大于所述第二历史时段;采用所述第一销量数据和所述第二销量数据训练所述目标新品的初始预测模型,得到目标预测模型;采用所述目标预测模型预测所述目标新品在未来一段时间的第三销量数据。According to an aspect of an embodiment of the present application, a method for predicting new product sales data is provided, including: determining a set of associated products of a target new product, wherein the set of associated products includes a plurality of associated products related to the target new product; Obtaining the first sales data of the associated product set in the first historical period, and obtaining the second sales data of the target new product in the second historical period, wherein the first historical period is greater than the second historical period; Using the first sales data and the second sales data to train an initial prediction model of the target new product to obtain a target prediction model; using the target prediction model to predict third sales data of the target new product in a period of time in the future.

进一步,采用所述第一销量数据和所述第二销量数据训练所述目标新品的初始预测模型,得到目标预测模型包括:计算所述第一销量数据与所述第二销量数据的相似度,其中,所述第一销量数据包括多个子销量数据,每个子销量数据对应一个关联产品;在所述第一销量数据中选择相似度最高的目标子销量数据;将所述目标子销量数据确定为第一样本数据,训练所述目标新品的初始预测模型,得到中间预测模型;将所述第二销量数据确定为第二样本数据,训练所述中间预测模型,得到目标预测模型。Further, using the first sales data and the second sales data to train the initial prediction model of the target new product, and obtaining the target prediction model includes: calculating the similarity between the first sales data and the second sales data, Wherein, the first sales data includes a plurality of sub-sales data, and each sub-sales data corresponds to an associated product; the target sub-sales data with the highest similarity is selected in the first sales data; and the target sub-sales data is determined as The first sample data is used to train the initial prediction model of the target new product to obtain an intermediate prediction model; the second sales data is determined as the second sample data, and the intermediate prediction model is trained to obtain a target prediction model.

进一步,计算所述第一销量数据与所述第二销量数据的相似度包括: 针对所述第一销量数据中的每个子销量数据,在所述子销量数据与所述第二销量数据中截取相同时间长度的多对数据序列;采用以下公式计算所述子销量数据与所述第二销量数据的相似度P:Further, calculating the similarity between the first sales data and the second sales data includes: For each sub-sales data in the first sales data, intercepting the sub-sales data and the second sales data Multiple pairs of data sequences of the same time length; the similarity P between the sub-sales data and the second sales data is calculated using the following formula:

Figure 595491DEST_PATH_IMAGE001
Figure 595491DEST_PATH_IMAGE001

其中,Xi为子销量数据的第一数据序列,Yi为所述第二销量数据的第二数据序列,

Figure 542718DEST_PATH_IMAGE002
为所有第一数据序列的均值,
Figure DEST_PATH_IMAGE003
为所有第二数据序列的均值,i∈[1,n],n为大于1的正整数。Wherein , Xi is the first data sequence of the sub-sales data, andYi is the second data sequence of the second sales data,
Figure 542718DEST_PATH_IMAGE002
is the mean of all the first data series,
Figure DEST_PATH_IMAGE003
is the mean value of all second data sequences, i∈[1,n], n is a positive integer greater than 1.

进一步,在所述子销量数据与所述第二销量数据中截取相同时间长度的多对数据序列包括:基于业务需求确定单位序列长度;解析所述第二销量数据的时间分布区间,在所述子销量数据截取与所述时间分布区间对应的销量数据片段;以所述单位序列长度为分割单位,将所述第二销量数据分割为多个相同时间长度的第二数据序列,以及将所述销量数据片段分割为相同时间长度的第一数据序列。Further, intercepting multiple pairs of data sequences of the same time length from the sub-sales data and the second sales data includes: determining the unit sequence length based on business requirements; analyzing the time distribution interval of the second sales data, in the The sub-sales data intercepts the sales data segment corresponding to the time distribution interval; the second sales data is divided into a plurality of second data sequences of the same time length by taking the unit sequence length as the division unit, and the The sales data segment is divided into first data sequences of the same time length.

进一步,将所述第二销量数据确定为第二样本数据,训练所述中间预测模型,得到目标预测模型包括:采用所述第二销量数据构建样本数据集,其中,所述样本数据集包括:所述第二销量数据;将所述样本数据集拆分为验证数据和训练数据;采用所述验证数据和所述训练数据对所述中间预测模型的参数进行微调,得到目标预测模型。Further, determining the second sales data as the second sample data, training the intermediate prediction model, and obtaining the target prediction model includes: using the second sales data to construct a sample data set, wherein the sample data set includes: The second sales data; splitting the sample data set into verification data and training data; using the verification data and the training data to fine-tune the parameters of the intermediate prediction model to obtain a target prediction model.

进一步,在获取所述关联产品集合在第一历史时段的第一销量数据之后,所述方法还包括:计算所述关联产品集合中每个关联产品的第一销量数据的数据量;针对每个关联产品,判断对应的第一销量数据的数据量是否大于预设阈值;若第一销量数据的数据量大于预设阈值,保留对应的第一销量数据;若第一销量数据的数据量小于或等于预设阈值,删除对应的第一销量数据。Further, after acquiring the first sales data of the associated product set in the first historical period, the method further includes: calculating the data volume of the first sales data of each associated product in the associated product set; Associating products, judging whether the data volume of the corresponding first sales data is greater than the preset threshold; if the data volume of the first sales data is greater than the preset threshold, retain the corresponding first sales data; if the data volume of the first sales data is less than or is equal to the preset threshold, and the corresponding first sales volume data is deleted.

进一步,确定目标新品的关联产品集合包括:确定所述目标新品所在的商品店铺,将所述商品店铺的全店产品确定为所述目标新品的第一关联产品;确定所述目标新品所在的产品线,将所述产品线的全线产品确定为所述目标新品的第二关联产品,其中,每个产品线中多个商品的销售对象和销售途径相同;确定所述目标新品的相似商品,将所述相似商品确定为所述目标新品的第三关联产品,其中,所述相似商品与所述目标新品的销售价格或产品功能相似;其中,所述关联产品集合包括所述第一关联产品,所述第二关联产品,所述第三关联产品。Further, determining the associated product set of the target new product includes: determining the commodity store where the target new product is located, determining the entire store product of the commodity store as the first associated product of the target new product; determining the product line where the target new product is located , determining the full-line product of the product line as the second associated product of the target new product, wherein the sales objects and sales channels of multiple commodities in each product line are the same; determining similar commodities of the target new product, and The similar product is determined as the third related product of the target new product, wherein the similar product is similar to the target new product in sales price or product function; wherein the related product set includes the first related product, and The second associated product and the third associated product.

根据本申请实施例的另一个方面,还提供了一种新品销量数据的预测装置,包括:确定模块,用于确定目标新品的关联产品集合,其中,所述关联产品集合包括与所述目标新品相关的多个关联产品;获取模块,用于获取所述关联产品集合在第一历史时段的第一销量数据,以及获取所述目标新品在第二历史时段的第二销量数据,其中,所述第一历史时段大于所述第二历史时段;训练模块,用于采用所述第一销量数据和所述第二销量数据训练所述目标新品的初始预测模型,得到目标预测模型;预测模块,用于采用所述目标预测模型预测所述目标新品在未来一段时间的第三销量数据。According to another aspect of the embodiment of the present application, there is also provided an apparatus for predicting new product sales data, including: a determining module, configured to determine a set of associated products of a target new product, wherein the set of associated products includes A plurality of related related products; an acquisition module, configured to acquire the first sales data of the set of related products in the first historical period, and obtain the second sales data of the target new product in the second historical period, wherein the The first historical period is greater than the second historical period; the training module is used to use the first sales data and the second sales data to train the initial prediction model of the target new product to obtain a target prediction model; the prediction module uses The third sales data of the target new product in a future period is predicted by using the target prediction model.

进一步,所述训练模块包括:计算单元,用于计算所述第一销量数据与所述第二销量数据的相似度,其中,所述第一销量数据包括多个子销量数据,每个子销量数据对应一个关联产品;选择单元,用于在所述第一销量数据中选择相似度最高的目标子销量数据;第一训练单元,用于将所述目标子销量数据确定为第一样本数据,训练所述目标新品的初始预测模型,得到中间预测模型;第二训练单元,用于将所述第二销量数据确定为第二样本数据,训练所述中间预测模型,得到目标预测模型。Further, the training module includes: a calculation unit, configured to calculate the similarity between the first sales data and the second sales data, wherein the first sales data includes a plurality of sub-sales data, and each sub-sales data corresponds to A related product; a selection unit, used to select the target sub-sales data with the highest similarity in the first sales data; a first training unit, used to determine the target sub-sales data as the first sample data, and train The initial prediction model of the target new product is used to obtain an intermediate prediction model; the second training unit is configured to determine the second sales data as second sample data, and train the intermediate prediction model to obtain a target prediction model.

进一步,所述计算单元包括: 截取子单元,用于针对所述第一销量数据中的每个子销量数据,在所述子销量数据与所述第二销量数据中截取相同时间长度的多对数据序列;计算子单元,用于采用以下公式计算所述子销量数据与所述第二销量数据的相似度P:Further, the calculation unit includes: an intercepting subunit, configured to, for each sub-sales data in the first sales data, intercept multiple pairs of data of the same time length in the sub-sales data and the second sales data Sequence; a calculation subunit, configured to calculate the similarity P between the sub-sales data and the second sales data by using the following formula:

Figure 717347DEST_PATH_IMAGE001
Figure 717347DEST_PATH_IMAGE001

其中,Xi为子销量数据的第一数据序列,Yi为所述第二销量数据的第二数据序列,

Figure 786934DEST_PATH_IMAGE002
为所有第一数据序列的均值,
Figure 437228DEST_PATH_IMAGE004
为所有第二数据序列的均值,i∈[1,n],n为大于1的正整数。Wherein , Xi is the first data sequence of the sub-sales data, andYi is the second data sequence of the second sales data,
Figure 786934DEST_PATH_IMAGE002
is the mean of all the first data series,
Figure 437228DEST_PATH_IMAGE004
is the mean value of all second data sequences, i∈[1,n], n is a positive integer greater than 1.

进一步,所述截取子单元还用于包括:基于业务需求确定单位序列长度;解析所述第二销量数据的时间分布区间,在所述子销量数据截取与所述时间分布区间对应的销量数据片段;以所述单位序列长度为分割单位,将所述第二销量数据分割为多个相同时间长度的第二数据序列,以及将所述销量数据片段分割为相同时间长度的第一数据序列。Further, the intercepting subunit is further configured to include: determining the unit sequence length based on business requirements; analyzing the time distribution interval of the second sales data, and intercepting sales data segments corresponding to the time distribution interval from the sub sales data ; Taking the length of the unit sequence as the division unit, dividing the second sales data into a plurality of second data sequences of the same time length, and dividing the sales data fragments into first data sequences of the same time length.

进一步,所述第二训练单元包括:构建子单元,用于采用所述第二销量数据构建样本数据集,其中,所述样本数据集包括:所述第二销量数据;拆分子单元,用于将所述样本数据集拆分为验证数据和训练数据;微调子单元,用于采用所述验证数据和所述训练数据对所述中间预测模型的参数进行微调,得到目标预测模型。Further, the second training unit includes: a constructing subunit for constructing a sample data set using the second sales data, wherein the sample data set includes: the second sales data; splitting subunits for The sample data set is split into verification data and training data; a fine-tuning subunit is configured to use the verification data and the training data to fine-tune the parameters of the intermediate prediction model to obtain a target prediction model.

进一步,所述装置还包括:计算模块,用于在所述获取模块获取所述关联产品集合在第一历史时段的第一销量数据之后,计算所述关联产品集合中每个关联产品的第一销量数据的数据量;判断模块,用于针对每个关联产品,判断对应的第一销量数据的数据量是否大于预设阈值;处理模块,用于若第一销量数据的数据量大于预设阈值,保留对应的第一销量数据;若第一销量数据的数据量小于或等于预设阈值,删除对应的第一销量数据。Further, the device further includes: a calculation module, configured to calculate the first sales volume of each associated product in the associated product set after the acquisition module acquires the first sales data of the associated product set in the first historical period. The data volume of the sales data; the judging module, for each associated product, judging whether the data volume of the corresponding first sales data is greater than the preset threshold; the processing module, used for if the data volume of the first sales data is greater than the preset threshold , keep the corresponding first sales data; if the data volume of the first sales data is less than or equal to the preset threshold, delete the corresponding first sales data.

进一步,所述确定模块包括:第一确定单元,用于确定所述目标新品所在的商品店铺,将所述商品店铺的全店产品确定为所述目标新品的第一关联产品;第二确定单元,用于确定所述目标新品所在的产品线,将所述产品线的全线产品确定为所述目标新品的第二关联产品,其中,每个产品线中多个商品的销售对象和销售途径相同;第三确定单元,用于确定所述目标新品的相似商品,将所述相似商品确定为所述目标新品的第三关联产品,其中,所述相似商品与所述目标新品的销售价格或产品功能相似;其中,所述关联产品集合包括所述第一关联产品,所述第二关联产品,所述第三关联产品。Further, the determining module includes: a first determining unit, configured to determine the commodity store where the target new product is located, and determine the entire store product of the commodity store as the first associated product of the target new product; a second determining unit, It is used to determine the product line where the target new product is located, and determine the entire product line of the product line as the second associated product of the target new product, wherein the sales objects and sales channels of multiple commodities in each product line are the same; The third determining unit is used to determine similar products of the target new product, and determine the similar product as the third related product of the target new product, wherein the sales price or product function of the similar product is the same as that of the target new product similar; wherein, the associated product set includes the first associated product, the second associated product, and the third associated product.

根据本申请实施例的另一方面,还提供了一种存储介质,该存储介质包括存储的程序,程序运行时执行上述的步骤。According to another aspect of the embodiments of the present application, a storage medium is further provided, the storage medium includes a stored program, and the above steps are executed when the program runs.

根据本申请实施例的另一方面,还提供了一种电子设备,包括处理器、通信接口、存储器和通信总线,其中,处理器,通信接口,存储器通过通信总线完成相互间的通信;其中:存储器,用于存放计算机程序;处理器,用于通过运行存储器上所存放的程序来执行上述方法中的步骤。According to another aspect of the embodiment of the present application, there is also provided an electronic device, including a processor, a communication interface, a memory, and a communication bus, wherein, the processor, the communication interface, and the memory complete mutual communication through the communication bus; wherein: The memory is used to store computer programs; the processor is used to execute the steps in the above method by running the programs stored in the memory.

本申请实施例还提供了一种包含指令的计算机程序产品,当其在计算机上运行时,使得计算机执行上述方法中的步骤。The embodiment of the present application also provides a computer program product containing instructions, which, when run on a computer, causes the computer to execute the steps in the above method.

通过本发明,确定目标新品的关联产品集合,其中,关联产品集合包括与目标新品相关的多个关联产品,获取关联产品集合在第一历史时段的第一销量数据,以及获取目标新品在第二历史时段的第二销量数据,其中,第一历史时段大于第二历史时段,采用第一销量数据和第二销量数据训练目标新品的初始预测模型,得到目标预测模型,采用所述目标预测模型预测所述目标新品在未来一段时间的第三销量数据,采用第一销量数据进行协助训练解决样本量不足的问题,采用第二销量数据拟合关联产品与目标新品之间的差异,兼顾整体和细节,可以训练得到更准确的目标预测模型,基于迁移学习的方式,将关联商品的销量数据与新品的销量数据结合起来,共同训练预测模型,解决了新品销量预测过程中面临的数据量少、建模难度大、预测精确度低、可靠性弱等痛点,解决了相关技术中不能采用预测模型准确预测新品销量数据的技术问题,提升新品销量预测的精确度和可靠性。Through the present invention, the related product set of the target new product is determined, wherein the related product set includes a plurality of related products related to the target new product, the first sales data of the related product set in the first historical period is acquired, and the target new product is acquired in the second The second sales data in the historical period, wherein the first historical period is greater than the second historical period, using the first sales data and the second sales data to train the initial prediction model of the target new product to obtain a target prediction model, using the target prediction model to predict For the third sales data of the target new product in the future, the first sales data is used to assist in training to solve the problem of insufficient sample size, and the second sales data is used to fit the difference between the related product and the target new product, taking into account the whole and details , can be trained to obtain a more accurate target prediction model. Based on the method of transfer learning, the sales data of related products and new products are combined to jointly train the prediction model, which solves the problems faced in the process of new product sales prediction. The pain points such as difficult modeling, low prediction accuracy, and weak reliability solve the technical problem that the prediction model cannot be used to accurately predict new product sales data in related technologies, and improve the accuracy and reliability of new product sales prediction.

附图说明Description of drawings

此处所说明的附图用来提供对本发明的进一步理解,构成本申请的一部分,本发明的示意性实施例及其说明用于解释本发明,并不构成对本发明的不当限定。在附图中:The accompanying drawings described here are used to provide a further understanding of the present invention and constitute a part of the application. The schematic embodiments of the present invention and their descriptions are used to explain the present invention and do not constitute improper limitations to the present invention. In the attached picture:

图1是本发明实施例的一种服务器的硬件结构框图;Fig. 1 is a hardware structural block diagram of a kind of server of the embodiment of the present invention;

图2是根据本发明实施例的一种新品销量数据的预测方法的流程图;Fig. 2 is a flow chart of a method for predicting new product sales data according to an embodiment of the present invention;

图3是本发明实施例的完整流程图;Fig. 3 is the complete flowchart of the embodiment of the present invention;

图4是根据本发明实施例的一种新品销量数据的预测装置的结构框图;4 is a structural block diagram of a device for predicting new product sales data according to an embodiment of the present invention;

图5是实施本发明实施例的一种电子设备的结构框图。Fig. 5 is a structural block diagram of an electronic device implementing an embodiment of the present invention.

具体实施方式detailed description

为了使本技术领域的人员更好地理解本申请方案,下面将结合本申请实施例中的附图,对本申请实施例中的技术方案进行清楚、完整地描述,显然,所描述的实施例仅仅是本申请一部分的实施例,而不是全部的实施例。基于本申请中的实施例,本领域普通技术人员在没有做出创造性劳动前提下所获得的所有其他实施例,都应当属于本申请保护的范围。需要说明的是,在不冲突的情况下,本申请中的实施例及实施例中的特征可以相互组合。In order to enable those skilled in the art to better understand the solution of the present application, the technical solution in the embodiment of the application will be clearly and completely described below in conjunction with the accompanying drawings in the embodiment of the application. Obviously, the described embodiment is only It is an embodiment of a part of the application, but not all of the embodiments. Based on the embodiments in this application, all other embodiments obtained by persons of ordinary skill in the art without creative efforts shall fall within the scope of protection of this application. It should be noted that, in the case of no conflict, the embodiments in the present application and the features in the embodiments can be combined with each other.

需要说明的是,本申请的说明书和权利要求书及上述附图中的术语“第一”、“第二”等是用于区别类似的对象,而不必用于描述特定的顺序或先后次序。应该理解这样使用的数据在适当情况下可以互换,以便这里描述的本申请的实施例能够以除了在这里图示或描述的那些以外的顺序实施。此外,术语“包括”和“具有”以及他们的任何变形,意图在于覆盖不排他的包含,例如,包含了一系列步骤或单元的过程、方法、产品或设备不必限于清楚地列出的那些步骤或单元,而是可包括没有清楚地列出的或对于这些过程、方法、产品或设备固有的其它步骤或单元。It should be noted that the terms "first" and "second" in the description and claims of the present application and the above drawings are used to distinguish similar objects, but not necessarily used to describe a specific sequence or sequence. It is to be understood that the data so used are interchangeable under appropriate circumstances such that the embodiments of the application described herein can be practiced in sequences other than those illustrated or described herein. Furthermore, the terms "comprising" and "having", as well as any variations thereof, are intended to cover a non-exclusive inclusion, for example, a process, method, product or apparatus comprising a series of steps or elements need not be limited to those steps explicitly listed or units, but may include other steps or units not explicitly listed or inherent to the process, method, product or apparatus.

实施例1Example 1

本申请实施例一所提供的方法实施例可以在服务器、计算机、手机、或者类似的运算装置中执行。以运行在服务器上为例,图1是本发明实施例的一种服务器的硬件结构框图。如图1所示,服务器可以包括一个或多个(图1中仅示出一个)处理器102(处理器102可以包括但不限于微处理器MCU或可编程逻辑器件FPGA等的处理装置)和用于存储数据的存储器104,可选地,上述服务器还可以包括用于通信功能的传输设备106以及输入输出设备108。本领域普通技术人员可以理解,图1所示的结构仅为示意,其并不对上述服务器的结构建成限定。例如,服务器还可包括比图1中所示更多或者更少的组件,或者具有与图1所示不同的配置。The method embodiment provided in Embodiment 1 of the present application may be executed in a server, a computer, a mobile phone, or a similar computing device. Taking running on a server as an example, FIG. 1 is a block diagram of a hardware structure of a server according to an embodiment of the present invention. As shown in FIG. 1, the server may include one or more (only one is shown in FIG. 1) processors 102 (processors 102 may include but not limited to processing devices such as microprocessors MCUs or programmable logic devices FPGAs) and Amemory 104 for storing data. Optionally, the server may further include atransmission device 106 and an input and output device 108 for communication functions. Those skilled in the art can understand that the structure shown in FIG. 1 is only for illustration, and it does not limit the structure of the above server. For example, the server may also include more or fewer components than shown in FIG. 1 , or have a different configuration than that shown in FIG. 1 .

存储器104可用于存储服务器程序,例如,应用软件的软件程序以及模块,如本发明实施例中的一种新品销量数据的预测方法对应的服务器程序,处理器102通过运行存储在存储器104内的服务器程序,从而执行各种功能应用以及数据处理,即实现上述的方法。存储器104可包括高速随机存储器,还可包括非易失性存储器,如一个或者多个磁性存储装置、闪存、或者其他非易失性固态存储器。在一些实例中,存储器104可进一步包括相对于处理器102远程设置的存储器,这些远程存储器可以通过网络连接至服务器。上述网络的实例包括但不限于互联网、企业内部网、局域网、移动通信网及其组合。Thememory 104 can be used to store server programs, for example, software programs and modules of application software, such as a server program corresponding to a method for predicting new product sales data in the embodiment of the present invention, and the processor 102 runs the server stored in thememory 104. program, so as to execute various functional applications and data processing, that is, to realize the above-mentioned method. Thememory 104 may include high-speed random access memory, and may also include non-volatile memory, such as one or more magnetic storage devices, flash memory, or other non-volatile solid-state memory. In some instances, thememory 104 may further include memory located remotely from the processor 102, and these remote memories may be connected to a server through a network. Examples of the aforementioned networks include, but are not limited to, the Internet, intranets, local area networks, mobile communication networks, and combinations thereof.

传输设备106用于经由一个网络接收或者发送数据。上述的网络具体实例可包括服务器的通信供应商提供的无线网络。在一个实例中,传输设备106包括一个网络适配器(Network Interface Controller,简称为NIC),其可通过基站与其他网络设备相连从而可与互联网进行通讯。在一个实例中,传输设备106可以为射频(Radio Frequency,简称为RF)模块,其用于通过无线方式与互联网进行通讯。Transmission device 106 is used to receive or transmit data via a network. The specific example of the above network may include a wireless network provided by the communication provider of the server. In an example, thetransmission device 106 includes a network adapter (Network Interface Controller, NIC for short), which can be connected to other network devices through a base station so as to communicate with the Internet. In an example, thetransmission device 106 may be a radio frequency (Radio Frequency, RF for short) module, which is used to communicate with the Internet in a wireless manner.

在本实施例中提供了一种新品销量数据的预测方法,图2是根据本发明实施例的一种新品销量数据的预测方法的流程图,如图2所示,该流程包括如下步骤:In this embodiment, a method for predicting new product sales data is provided. FIG. 2 is a flow chart of a method for predicting new product sales data according to an embodiment of the present invention. As shown in FIG. 2 , the process includes the following steps:

步骤S202,确定目标新品的关联产品集合,其中,关联产品集合包括与目标新品相关的多个关联产品;Step S202, determining a set of related products of the target new product, wherein the set of related products includes a plurality of related products related to the target new product;

在本实施例中的关联产品可以是所在店铺的产品、所在产品线的产品、相似品等。The associated products in this embodiment may be products of the store, products of the product line, similar products, and the like.

步骤S204,获取关联产品集合在第一历史时段的第一销量数据,以及获取目标新品在第二历史时段的第二销量数据,其中,第一历史时段大于第二历史时段;Step S204, obtaining the first sales data of the associated product set in the first historical period, and obtaining the second sales data of the target new product in the second historical period, wherein the first historical period is greater than the second historical period;

由于目标新品上线或者上市时间较短,而关联产品的上线或者上市时间较长,因此获取第一销量数据的时段可以大于第二销量数据,如第二历史时段为一个月,则第一历史时段可以为6个月,12个月,24个月等。Since the target new product goes online or goes on the market for a short time, while the associated product goes online or goes on the market for a long time, the time period for obtaining the first sales data can be greater than the second sales data. For example, if the second historical period is one month, then the first historical period It can be 6 months, 12 months, 24 months etc.

本实施例的销量数据可以是销售的数量,金额等数据,可以以天,周,月,季度等为时间单位进行统计,多个连续时间的数据形成数据序列,如每天统计一次销售数据,一个月包括30条数据序列。The sales volume data of this embodiment can be data such as sales quantity, amount, can take day, week, month, quarter etc. as the time unit to carry out statistics, and the data of a plurality of continuous times forms a data sequence, such as once a day statistics sales data, one Month includes 30 data series.

步骤S206,采用第一销量数据和第二销量数据训练目标新品的初始预测模型,得到目标预测模型;Step S206, using the first sales data and the second sales data to train the initial prediction model of the target new product to obtain the target prediction model;

本实施例采用第一销量数据和第二销量数据两类数据训练初始预测模型,采用第一销量数据进行协助训练解决样本量不足的问题,采用第二销量数据拟合关联产品与目标新品之间的差异,兼顾整体和细节,可以训练得到更准确的目标预测模型。In this embodiment, the first sales data and the second sales data are used to train the initial prediction model, the first sales data is used to assist training to solve the problem of insufficient sample size, and the second sales data is used to fit the relationship between the associated product and the target new product. The difference, taking into account the overall and details, can be trained to get a more accurate target prediction model.

基于数据量更丰富的第一销量数据对模型进行预训练,基于第二销量数据对模型进行微调,微调时,仅对模型进行小幅度调整,如:仅训练模型中部分结构(例如:模型的输出层)的参数,冻结其他部分的参数,或者在训练过程中设置较小的学习率、迭代次数等。The model is pre-trained based on the first sales data with more abundant data, and the model is fine-tuned based on the second sales data. When fine-tuning, only a small adjustment is made to the model, such as: only training part of the structure of the model (for example: the model's output layer), freeze the parameters of other parts, or set a smaller learning rate, number of iterations, etc. during the training process.

步骤S208,采用目标预测模型预测目标新品在未来一段时间的第三销量数据。Step S208, using the target prediction model to predict the third sales volume data of the target new product in a period of time in the future.

可以将第一销量数据作为目标预测模型的输入数据,将目标预测模型的输出确定为未来一段时间(可以是一个或者多个时间周期,以月为周期,可以是未来1月,未来2月等)的第三销量数据。The first sales data can be used as the input data of the target forecasting model, and the output of the target forecasting model can be determined as a period of time in the future (it can be one or more time periods, the cycle is monthly, it can be the next January, the next February, etc. ) of the third sales data.

通过上述步骤,确定目标新品的关联产品集合,其中,关联产品集合包括与目标新品相关的多个关联产品,获取关联产品集合在第一历史时段的第一销量数据,以及获取目标新品在第二历史时段的第二销量数据,其中,第一历史时段大于第二历史时段,采用第一销量数据和第二销量数据训练目标新品的初始预测模型,得到目标预测模型,采用第一销量数据和目标预测模型预测目标新品在未来一段时间的第三销量数据,采用第一销量数据进行协助训练解决样本量不足的问题,采用第二销量数据拟合关联产品与目标新品之间的差异,兼顾整体和细节,可以训练得到更准确的目标预测模型,基于迁移学习的方式,将关联商品的销量数据与新品的销量数据结合起来,共同训练预测模型,解决了新品销量预测过程中面临的数据量少、建模难度大、预测精确度低、可靠性弱等痛点,解决了相关技术中不能采用预测模型准确预测新品销量数据的技术问题,提升新品销量预测的精确度和可靠性。Through the above steps, the associated product set of the target new product is determined, wherein the associated product set includes a plurality of associated products related to the target new product, the first sales data of the associated product set in the first historical period is obtained, and the target new product is obtained in the second The second sales data in the historical period, wherein the first historical period is greater than the second historical period, use the first sales data and the second sales data to train the initial prediction model of the target new product, obtain the target prediction model, use the first sales data and the target The prediction model predicts the third sales data of the target new product in the future, uses the first sales data to assist training to solve the problem of insufficient sample size, and uses the second sales data to fit the difference between the related product and the target new product, taking into account the overall and The details can be trained to obtain a more accurate target prediction model. Based on the method of transfer learning, the sales data of related products and new product sales data are combined to jointly train the prediction model, which solves the problem of small amount of data and problems faced in the process of new product sales prediction. Pain points such as difficult modeling, low prediction accuracy, and weak reliability solve the technical problem that the prediction model cannot be used to accurately predict new product sales data in related technologies, and improve the accuracy and reliability of new product sales prediction.

在本实施例中,确定目标新品的关联产品集合包括:确定目标新品所在的商品店铺,将商品店铺的全店产品确定为目标新品的第一关联产品;确定目标新品所在的产品线,将产品线的全线产品确定为目标新品的第二关联产品,其中,每个产品线中多个商品的销售对象和销售途径相同;确定目标新品的相似商品,将相似商品确定为目标新品的第三关联产品,其中,相似商品与目标新品的销售价格或产品功能相似;其中,关联产品集合包括第一关联产品,第二关联产品,第三关联产品。In this embodiment, determining the associated product set of the target new product includes: determining the commodity store where the target new product is located, determining the entire store product of the commodity store as the first associated product of the target new product; determining the product line where the target new product is located, and dividing the product line The entire line of products of the target new product is determined as the second related product of the target new product, among which, the sales objects and sales channels of multiple products in each product line are the same; the similar products of the target new product are determined, and the similar products are determined as the third related product of the target new product , wherein the sales price or product function of the similar product is similar to the target new product; wherein, the set of related products includes a first related product, a second related product, and a third related product.

本实施例的相似商品与目标新品的销售价格或产品功能相似,是指相似商品与目标新品的销售价格的差值小于预设阈值,相似商品与目标新品的产品功能的重合度大于预设阈值。The sales price or product function of the similar product in this embodiment is similar to the target new product, which means that the difference between the sales price of the similar product and the target new product is less than the preset threshold, and the coincidence degree of the product functions of the similar product and the target new product is greater than the preset threshold .

以目标新品为美白水乳A为例,美白水乳A在A品牌化妆品店铺(实体店,线上店等)销售,A店铺还销售多款护肤精华、面膜、洗面奶、防晒霜等产品,A店铺所有产品为第一关联产品,美白水乳A所在的产品线还包括保湿水乳、抗老水乳等水乳产品,这些水乳集合为第二关联产品,美白水乳的相似商品为美白精华、美白面膜等同样具有美白功能的产品,这些产品为第三关联产品,三种关联产品共同组成美白水乳A的关联产品集合。Taking the target new product as whitening lotion A as an example, whitening lotion A is sold in brand A cosmetics store (physical store, online store, etc.), and store A also sells a variety of skin care essence, facial mask, facial cleanser, sunscreen and other products. All the products in store A are the first related products. The product line of whitening lotion A also includes moisturizing lotion, anti-aging lotion and other lotion products. These lotions are combined as the second related product. The similar products of whitening lotion are Whitening essence, whitening mask and other products that also have whitening function, these products are the third related products, and the three related products together form the related product set of whitening lotion A.

本实施例的目标预测模型是基于机器学习的时间序列预测模型,在训练之前,还可以先构建初始预测模型,包括:采用基于机器学习的时间序列预测算法,构建时间序列预测模型结构,对模型的参数进行初始化;该模型可以通过机器学习中的优化算法调整参数,即根据数据集和目标函数进行参数调整,从而使得模型在接收数据集的输入数据后,预测值与数据集中的评估数据更接近,并且具备调整学习率、参数保存、加载等功能。The target forecasting model of this embodiment is a time series forecasting model based on machine learning. Before training, an initial forecasting model can also be constructed, including: using a time series forecasting algorithm based on machine learning to construct a time series forecasting model structure. The parameters of the model can be initialized; the model can adjust the parameters through the optimization algorithm in machine learning, that is, adjust the parameters according to the data set and the objective function, so that after the model receives the input data of the data set, the predicted value and the evaluation data in the data set are more accurate. It is close, and has the functions of adjusting learning rate, parameter saving, loading and so on.

在本实施例的一个实施方式中,采用第一销量数据和第二销量数据训练目标新品的初始预测模型,得到目标预测模型包括:In one implementation of this embodiment, the initial prediction model of the target new product is trained by using the first sales data and the second sales data, and the target prediction model obtained includes:

S11,计算第一销量数据与第二销量数据的相似度,其中,第一销量数据包括多个子销量数据,每个子销量数据对应一个关联产品;S11. Calculate the similarity between the first sales data and the second sales data, wherein the first sales data includes multiple sub-sales data, and each sub-sales data corresponds to an associated product;

在一个实施方式中,计算第一销量数据与第二销量数据的相似度包括: 针对第一销量数据中的每个子销量数据,在子销量数据与第二销量数据中截取相同时间长度的多对数据序列;采用以下公式计算子销量数据与第二销量数据的相似度P:In one embodiment, calculating the similarity between the first sales data and the second sales data includes: For each sub-sales data in the first sales data, intercepting multiple pairs of the same time length from the sub-sales data and the second sales data Data sequence; use the following formula to calculate the similarity P between the sub-sales data and the second sales data:

Figure 250463DEST_PATH_IMAGE005
Figure 250463DEST_PATH_IMAGE005

其中,Xi为子销量数据的第一数据序列,Yi为第二销量数据的第二数据序列,

Figure 748440DEST_PATH_IMAGE006
为所有第一数据序列的均值,
Figure 316825DEST_PATH_IMAGE004
为所有第二数据序列的均值,i∈[1,n],n为大于1的正整数。Wherein, Xi is the first data sequence of the sub-sales data, andY is the second datasequence of the second sales data,
Figure 748440DEST_PATH_IMAGE006
is the mean of all the first data series,
Figure 316825DEST_PATH_IMAGE004
is the mean value of all second data sequences, i∈[1,n], n is a positive integer greater than 1.

例如,基于获取到的一年以上的店铺全店、新品所在产线、新品相似品的销量数据,仅选取每份数据中新品上市后的销量数据,用于与新品上市后销量数据的进行相似度计算,目标新品上市后的销量数据序列记为X1,X2…Xn,同期用于相似度计算的第二销量数据的数据序列为Y1,Y2…YnFor example, based on the sales data of the whole store, the production line of the new product, and similar products of the new product obtained for more than one year, only the sales data of the new product after the launch of each data is selected for similarity with the sales data of the new product after the launch For calculation, the sales data sequence of the target new product after launch is denoted as X1 , X2 ... Xn , and the data sequence of the second sales data used for similarity calculation in the same period is Y1 , Y2 ... Yn .

在本实施例中,相似度的值范围在 -1 和 1 之间,其中 -1 完全不同,1 完全相似,基于相似度的值对多个子销量数据进行排序并选择相似度最高的目标子销量数据。采用本实施例的公式计算的相似度,与两个序列的量级上的差异没有直接关联,而是关注于两个序列增减趋势的相关性。例如,两种产品的销量量级不同,但是都在大促期增长,在平销期下降,这就构成了相似性,两个产品销量的增长或减少的趋势越相似,则经本公式计算得到的相似度越高。除此之外,还实施例的方案还可以采用余弦相似度,欧氏距离等计算相似度。In this embodiment, the value range of the similarity is between -1 and 1, wherein -1 is completely different, and 1 is completely similar. Based on the value of the similarity, the multiple sub-sales data are sorted and the target sub-sales with the highest similarity is selected data. The similarity calculated by the formula of this embodiment is not directly related to the difference in magnitude between the two sequences, but focuses on the correlation between the increasing and decreasing trends of the two sequences. For example, the sales volume of two products is different, but they both increase during the big promotion period and decrease during the flat sales period, which constitutes similarity. The more similar the growth or decrease trend of the sales volume of the two products, the more similar the sales volume is, the calculated by this formula The higher the similarity is obtained. In addition, the solution of the embodiment can also use cosine similarity, Euclidean distance, etc. to calculate the similarity.

在一个示例中,在子销量数据与第二销量数据中截取相同时间长度的多对数据序列包括:基于业务需求确定单位序列长度;解析第二销量数据的时间分布区间,在子销量数据截取与时间分布区间对应的销量数据片段;以单位序列长度为分割单位,将第二销量数据分割为多个相同时间长度的第二数据序列,以及将所述销量数据片段分割为相同时间长度的第一数据序列。In an example, intercepting multiple pairs of data sequences of the same time length in the sub-sales data and the second sales data includes: determining the unit sequence length based on business requirements; analyzing the time distribution interval of the second sales data, and intercepting the sub-sales data and The sales data segment corresponding to the time distribution interval; the second sales data is divided into a plurality of second data sequences of the same time length by taking the unit sequence length as the division unit, and the sales data segment is divided into first data sequences of the same time length. data sequence.

单位序列长度通常是根据业务需求确定,如一天、一周、一个月等。The unit sequence length is usually determined according to business requirements, such as one day, one week, one month, etc.

在本实施例中,第二销量数据包括数据1~数据212,对应时间为2022年2月1号~2022年8月31号,子销量数据包括数据1~数据1826,对应时间为2022年8月31号之前的5年,为了保证数据序列的数量满足一定的条件,以及为了满足相似度算式的计算条件,数据序列的数量和最小长度必然大于门限值,例如,数量需要大于M,最小长度大于N天,在这个示例中,第二销量数据的时间分布长度为6个月,单位序列长度为1天,在子销量数据的数据1~数据1826中截取在2022年2月1号~2022年8月31号产生的销量数据,作为销量数据片段,即该序列的最后212个数据,按照单位序列长度分割,得到第一数据序列。这两个长度序列用于上述相似度计算。In this embodiment, the second sales data includes data 1 to data 212, and the corresponding time is from February 1, 2022 to August 31, 2022, and the sub-sales data includes data 1 to data 1826, and the corresponding time is August 2022 In the 5 years before May 31st, in order to ensure that the number of data sequences meets certain conditions and to meet the calculation conditions of the similarity calculation formula, the number and minimum length of data sequences must be greater than the threshold value, for example, the number needs to be greater than M, and the minimum The length is greater than N days. In this example, the time distribution length of the second sales data is 6 months, and the unit sequence length is 1 day. It is intercepted from February 1, 2022 to data 1 to data 1826 of the sub-sales data. The sales data generated on August 31, 2022, as the sales data fragment, that is, the last 212 data of the sequence, is divided according to the unit sequence length to obtain the first data sequence. These two length sequences are used for the above similarity calculation.

采用本实施例的方案,在保证数据量的前提下,可以确保第一数据序列与第二数据序列对齐,从而保证相似度的值是同一时间维度的值,可以提高相似度的参考性。By adopting the solution of this embodiment, under the premise of ensuring the amount of data, it can ensure that the first data sequence is aligned with the second data sequence, thereby ensuring that the value of the similarity is the value of the same time dimension, and the reference of the similarity can be improved.

S12,在第一销量数据中选择相似度最高的目标子销量数据;S12, selecting the target sub-sales data with the highest similarity from the first sales data;

在本实施例的一个实施方式中,若第一销量数据的子销量数据与二销量数据的相似度均高于预设值,则可以对第一销量数据的所有子销量数据进行融合,以增加样本数据的数据量。融合方式包括:对第一销量数据的所有子销量数据,分别进行缩放,每个类型的子销量数据转换成均值为0、方差为1的序列,然后计算多个序列在同一时间点的均值,将多个序列转化为一个序列,将多维销量数据转换为一维的值,将转换后的销量数据确定为第一样本数据;或者是采用多个子销量数据均作为第一样本数据,分别训练所述目标新品的初始预测模型,得到多个中间预测模型,然后计算多个中间预测模型中的每项模型系数的均值,得到最终的模型系数。In an implementation of this embodiment, if the similarity between the sub-sales data of the first sales data and the second sales data is higher than the preset value, all sub-sales data of the first sales data can be fused to increase The data volume of the sample data. The fusion method includes: respectively scaling all sub-sales data of the first sales data, converting each type of sub-sales data into a sequence with a mean value of 0 and a variance of 1, and then calculating the mean value of multiple sequences at the same time point, Convert multiple sequences into one sequence, convert multi-dimensional sales data into one-dimensional values, and determine the converted sales data as the first sample data; or use multiple sub-sales data as the first sample data, respectively Training the initial prediction model of the target new product to obtain multiple intermediate prediction models, and then calculating the mean value of each model coefficient in the multiple intermediate prediction models to obtain the final model coefficient.

S13,将目标子销量数据确定为第一样本数据,训练所述目标新品的初始预测模型,得到中间预测模型;S13. Determine the target sub-sales data as the first sample data, train the initial forecast model of the target new product, and obtain an intermediate forecast model;

通过筛选出的与新品销量相似度最高的一组历史销量数据,即目标子销量数据,构建用于模型训练和评估的数据集,基于该数据集对构建好的初始模型进行训练,训练过程中,调整模型参数使得数据集上的评估效果达到最优,训练后,保存模型参数,得到中间预测模型。By filtering out a set of historical sales data with the highest similarity with new product sales, that is, the target sub-sales data, a data set for model training and evaluation is constructed, and the constructed initial model is trained based on the data set. During the training process , adjust the model parameters to make the evaluation effect on the data set optimal. After training, save the model parameters to obtain the intermediate prediction model.

S14,将第二销量数据确定为第二样本数据,训练中间预测模型,得到目标预测模型。S14. Determine the second sales data as the second sample data, train an intermediate prediction model, and obtain a target prediction model.

基于需要预测的目标新品的短期销量数据,构建数据集,选取数据集中一定比例的数据用于模型的评估,加载先前已保存的模型,基于该数据集对模型的参数进行微调,使得新品的预测准确度得以提升,保存微调后的模型,得到目标预测模型。Based on the short-term sales data of the target new product that needs to be predicted, construct a data set, select a certain proportion of data in the data set for model evaluation, load the previously saved model, and fine-tune the parameters of the model based on the data set to make the prediction of new products The accuracy is improved, the fine-tuned model is saved, and the target prediction model is obtained.

可选的,将第二销量数据确定为第二样本数据,训练中间预测模型,得到目标预测模型包括:采用第二销量数据构建样本数据集,其中,所述样本数据集包括:第二销量数据;将样本数据集拆分出验证数据和训练数据;采用所述验证数据和所述训练数据对所述中间预测模型的参数进行微调,得到目标预测模型。Optionally, determining the second sales data as the second sample data, training the intermediate prediction model, and obtaining the target prediction model includes: using the second sales data to construct a sample data set, wherein the sample data set includes: the second sales data ; splitting the sample data set into verification data and training data; using the verification data and the training data to fine-tune the parameters of the intermediate prediction model to obtain a target prediction model.

首先基于训练数据构造为输入数据和输出数据,采用输入数据和输出数据继续训练中间预测模型,基于验证数据构建输入数据和输出数据,用于检验模型的预测能力,经模型训练,直到模型损失函数度量的预测值与真实值之间的差值小于预设损失值,或经多轮迭代后损失函数不再有明显下降。其中,目标函数和损失函数可以相同或者不同。Firstly, based on the training data, the input data and output data are constructed, and the intermediate prediction model is continued to be trained using the input data and output data, and the input data and output data are constructed based on the verification data, which is used to test the predictive ability of the model. After model training, until the model loss function The difference between the predicted value of the metric and the real value is smaller than the preset loss value, or the loss function does not decrease significantly after multiple rounds of iterations. Wherein, the objective function and the loss function can be the same or different.

在本实施例的另一方面,还可以将所述目标子销量数据和第二销量数据确定为第二样本数据,训练所述中间预测模型,得到目标预测模型,包括:基于所述新品关联产品集合对应的目标子销量数据构建模型的输入数据,基于新品对应的第二销量数据构建模型输出数据,微调中间预测模型,得到目标预测模型,由于第二销量数据是目标新品的真实的数据,因此采用该数据进行训练,可以得到更精确的模型参数。In another aspect of this embodiment, the target sub-sales data and the second sales data may also be determined as the second sample data, and the intermediate prediction model is trained to obtain the target prediction model, including: Set the input data of the corresponding target sub-sales data to build the model, build the model output data based on the second sales data corresponding to the new product, and fine-tune the intermediate prediction model to obtain the target prediction model. Since the second sales data is the real data of the target new product, therefore Using this data for training, more accurate model parameters can be obtained.

在本实施例的一个实施方式中,在获取关联产品集合在第一历史时段的第一销量数据之后,还包括:计算关联产品集合中每个关联产品的第一销量数据的数据量;针对每个关联产品,判断对应的第一销量数据的数据量是否大于预设阈值;若第一销量数据的数据量大于预设阈值,保留对应的第一销量数据;若第一销量数据的数据量小于或等于预设阈值,删除对应的第一销量数据。In an implementation of this embodiment, after obtaining the first sales data of the associated product set in the first historical period, it further includes: calculating the data volume of the first sales data of each associated product in the associated product set; For an associated product, determine whether the data volume of the corresponding first sales data is greater than the preset threshold; if the data volume of the first sales data is greater than the preset threshold, keep the corresponding first sales data; if the data volume of the first sales data is less than or is equal to the preset threshold, and the corresponding first sales volume data is deleted.

获取店铺全店、新品所在产线、新品相似品的历史销量数据,这三份数据通常选取历史多年长期销量,如5年、7年等,便于模型学习整体发展规律,以便后续模型将这些规律迁移到新品中。Obtain the historical sales data of the whole store, the production line of the new product, and the similar products of the new product. These three data usually select the long-term sales of many years in history, such as 5 years, 7 years, etc., so that the model can learn the overall development law, so that the follow-up model can migrate these laws into new products.

本实施例的方案解决了店铺新品发售初期,由于积累数据较少,无法直接用时间序列算法进行有效建模的问题。在增加了店铺及相似品的历史销量数据之后,基于迁移学习的方式,将店铺和相似品的数据与新品的数据结合起来,共同训练预测模型,提升新品销量预测的精确度和可靠性。The solution of this embodiment solves the problem that in the initial stage of the store’s new product launch, due to the small amount of accumulated data, it is impossible to directly use the time series algorithm for effective modeling. After adding the historical sales data of stores and similar products, based on the method of transfer learning, the data of stores and similar products are combined with the data of new products to jointly train the prediction model to improve the accuracy and reliability of new product sales forecasts.

在本实施例的一个实施场景中,各个功能通过模块实现,下面对本实施例的功能模块进行说明:In an implementation scenario of this embodiment, various functions are realized by modules, and the functional modules of this embodiment are described below:

店铺数据获取模块:用于读取店铺全店、新品所在产线、新品相似品、新品的销量数据;Store data acquisition module: used to read the sales data of the whole store, the production line of new products, similar products of new products, and new products;

模型预训练模块:基于长期的店铺全店、新品所在产线、相似品销量数据对模型进行预训练。Model pre-training module: pre-train the model based on the long-term data of the whole store, the production line of the new product, and the sales volume of similar products.

模型迁移学习模块:是基于预训练好的模型,用新品近期的销量数据对模型参数进行微调。Model transfer learning module: Based on the pre-trained model, the model parameters are fine-tuned with the recent sales data of new products.

模型预测模块:基于通过上述模块训练好的模型,用于新品未来一段时间的销量数据预测。Model prediction module: Based on the model trained by the above modules, it is used to predict the sales data of new products for a period of time in the future.

图3是本发明实施例的完整流程图,包括:Fig. 3 is a complete flowchart of the embodiment of the present invention, including:

步骤一 :采用基于机器学习的时间序列预测算法,构建时间序列预测模型结构,对模型的参数进行初始化;该模型可以通过机器学习中的优化算法调整参数,即根据数据集和目标函数进行参数调整,从而使得模型在接收数据集的输入数据后,预测值与数据集中的评估数据更接近的功能,并且具备调整学习率、参数保存、加载等功能;Step 1: Use the time series prediction algorithm based on machine learning to construct the time series prediction model structure and initialize the parameters of the model; the model can adjust the parameters through the optimization algorithm in machine learning, that is, adjust the parameters according to the data set and the objective function , so that after the model receives the input data of the data set, the predicted value is closer to the evaluation data in the data set, and has the functions of adjusting the learning rate, parameter saving, loading, etc.;

步骤二 :获取店铺全店、新品所在产线、新品相似品的历史销量数据,其中,新品相似品由功效、定价等产品特征相似确定。这三份数据通常选取历史多年长期销量,如5年、7年等,便于模型学习整体发展规律,以便后续模型将这些规律迁移到新品中,如果数据不满一年,由于数据量跟新品相差不大,可以带来的信息量有限,可以舍弃,如果三份数据均不满一年,则较难达到良好效果,可以终止计算;Step 2: Obtain the historical sales data of the entire store, the production line of the new product, and similar products of the new product. Among them, the similar product of the new product is determined by the similarity of product features such as efficacy and pricing. These three sets of data usually select years of long-term sales in history, such as 5 years, 7 years, etc., so that the model can learn the overall development law, so that the follow-up model can migrate these laws to new products. Large, the amount of information that can be brought is limited and can be discarded. If the three data sets are less than one year old, it is difficult to achieve good results and the calculation can be terminated;

步骤三 :基于步骤二获取到的一年以上的店铺全店、新品所在产线、新品相似品的销量数据,仅选取每份数据中新品上市后的销量数据,用于与新品上市后销量数据的相似度计算;Step 3: Based on the sales data of the whole store, the production line of the new product, and similar products of the new product obtained in step 2, only the sales data of the new product after the launch of each data is selected for comparison with the sales data of the new product after the launch Calculation of similarity;

计算新品数据与符合步骤二所述条件的店铺全店、新品所在产线、新品相似品数据的销量相似度后,选取与新品销量相似度计算结果最高的序列,将其对应的完整历年销量数据用于模型预训练。After calculating the sales similarity between the new product data and the data of the entire store, the production line where the new product is located, and the data of similar products of the new product that meet the conditions described in step 2, select the sequence with the highest similarity calculation result with the new product sales, and use its corresponding complete historical sales data with for model pre-training.

步骤四 :基于步骤三筛选出的与新品销量相似度最高的一组历年销量数据,构建用于模型训练和评估的数据集,基于该数据集对步骤一中构建好的模型进行训练,训练过程中,调整模型参数使得数据集上的评估效果达到最优,训练后,保存模型参数;Step 4: Based on a set of historical sales data with the highest similarity to new product sales selected in step 3, build a data set for model training and evaluation, and train the model built in step 1 based on the data set. The training process In , adjust the model parameters to make the evaluation effect on the data set optimal, and save the model parameters after training;

步骤五 :基于需要预测的新品的近期销量数据,构建数据集,选取数据集中一定比例的数据用于模型的评估,加载先前已保存的模型,基于该数据集对模型的参数进行微调,使得新品的预测准确度得以提升,保存微调后的模型;Step 5: Based on the recent sales data of new products that need to be predicted, construct a data set, select a certain proportion of data in the data set for model evaluation, load the previously saved model, and fine-tune the parameters of the model based on the data set to make the new product The prediction accuracy of is improved, and the fine-tuned model is saved;

步骤六 :基于上述步骤得到的模型,可以随时进行加载,读取该新品的近期销量数据,作为模型的输入,从而计算出新品未来一段时间的预测值。Step 6: Based on the model obtained in the above steps, it can be loaded at any time, read the recent sales data of the new product, and use it as the input of the model to calculate the forecast value of the new product for a period of time in the future.

在本实施例中,构建的模型可以学习到店铺全店或相似品整体年度增长率、季度增长率等内在的长期规律,基于这些长期规律,可以基于新品上市不足一年的短期销量数据,对未来一年的整体销量进行预估;In this embodiment, the constructed model can learn the inherent long-term laws of the store or the overall annual growth rate and quarterly growth rate of similar products. Estimate the overall sales volume for one year;

算法模型还可以学习到618、双11等大促期与平销期的销量比值规律以及未来发展趋势,这些长期规律是仅基于新品上市短期的平销期数据学习不到的。基于模型学习到的这些规律,可以在新品上市初期仅在平销期销售一段时间的情况下,对新品首次大促期的销量预测提供支撑;The algorithm model can also learn the sales ratio law and future development trend of 618, Double 11 and other big promotion periods and flat sales periods. These long-term laws cannot be learned based on the short-term flat sales period data of new products. Based on these rules learned by the model, it can provide support for the sales forecast of the first big promotion period of the new product when the new product is only sold for a period of time during the flat sales period at the beginning of the launch;

基于新品近期的销量数据,模型可以学习到新品销量在上市初期占全店或全产线销量的比重,以及这个比重的月度增长率等短期趋势,并且进一步为未来营销和生产提供参考依据。如果新品占全店或全产线的比例呈逐渐增长趋势,则该品有望成为店铺或产线爆款产品,如果新品占比逐渐走低,则在产品定位或售价等方面可能需要调整;Based on recent sales data of new products, the model can learn short-term trends such as the proportion of new product sales in the store or production line sales in the initial stage of launch, as well as the monthly growth rate of this proportion, and further provide reference for future marketing and production. If the proportion of new products in the entire store or production line is gradually increasing, the product is expected to become a popular product in the store or production line. If the proportion of new products gradually decreases, product positioning or selling prices may need to be adjusted;

基于店铺全店、新品所在产线或新品相似品的长期销量数据和新品的短期销量数据相结合,共同用于模型训练,可以提高模型的拟合和预测能力,共同预测出新品在未来一段时期内的销量趋势。Based on the combination of the long-term sales data of the entire store, the production line of the new product, or the short-term sales data of the new product and the short-term sales data of the new product, it can be used for model training, which can improve the fitting and prediction capabilities of the model, and jointly predict the new product in the future. sales trends.

本实施例的方案提供了一种基于迁移学习的店铺新品销量预测方法和装置,基于店铺全店、新品所在产线或相似产品的长期历史销量数据预训练机器学习模型,基于新品近期一年内短期的销量数据对模型参数进行微调,预测出新品未来的销量趋势。可以使模型学习到店铺中新品相关产品销量的年度、季度等方面的历史规律和发展趋势,同时也能学习到新品自身近期的销量特性,从而将品牌的整体销量规律和新品自身的情况相结合,基于这些数据共同预测出新品未来的销量。The scheme of this embodiment provides a method and device for predicting the sales volume of new products in stores based on transfer learning. The machine learning model is pre-trained based on the long-term historical sales data of the entire store, the production line where the new product is located, or similar products. The sales data fine-tunes the model parameters to predict the future sales trend of new products. The model can learn the historical rules and development trends of the sales volume of new products related products in the store, such as annual and quarterly, and also learn the recent sales characteristics of the new products themselves, so as to combine the overall sales rules of the brand with the situation of the new products themselves. , based on these data to jointly predict the future sales of new products.

本实施例的方案可以更好地结合新品和店铺其他商品的销售数据,建模方法更为完备,可以解决现有技术中仅基于新品自身销售数据难以有效建模、基于相似品预测值加权的方法难以拟合新品和相似品之间的差异点、拟合能力有限、精度不高的问题。可以有效地提高店铺新品销量预测的精准度和可靠性,解决了新品销量预测过程中面临的数据量少、建模难度大、预测精确度低、可靠性弱等痛点,为企业新品生产和销售等各环节的决策提供了有效依据。The scheme of this embodiment can better combine the sales data of new products and other products in the store, and the modeling method is more complete, which can solve the problems in the prior art that it is difficult to model effectively only based on the sales data of new products itself, and weighting based on the predicted value of similar products The method is difficult to fit the differences between new products and similar products, the fitting ability is limited, and the accuracy is not high. It can effectively improve the accuracy and reliability of new product sales forecasting in stores, and solve the pain points faced in the process of new product sales forecasting, such as small amount of data, difficult modeling, low forecasting accuracy, and weak reliability, and provide new products for enterprises. Production and sales It provides an effective basis for decision-making in various links.

通过以上的实施方式的描述,本领域的技术人员可以清楚地了解到根据上述实施例的方法可借助软件加必需的通用硬件平台的方式来实现,当然也可以通过硬件,但很多情况下前者是更佳的实施方式。基于这样的理解,本发明的技术方案本质上或者说对现有技术做出贡献的部分可以以软件产品的形式体现出来,该计算机软件产品存储在一个存储介质(如ROM/RAM、磁碟、光盘)中,包括若干指令用以使得一台终端设备(可以是手机,计算机,服务器,或者网络设备等)执行本发明各个实施例所述的方法。Through the description of the above embodiments, those skilled in the art can clearly understand that the method according to the above embodiments can be implemented by means of software plus a necessary general-purpose hardware platform, and of course also by hardware, but in many cases the former is better implementation. Based on this understanding, the essence of the technical solution of the present invention or the part that contributes to the prior art can be embodied in the form of software products, and the computer software products are stored in a storage medium (such as ROM/RAM, disk, CD) contains several instructions to enable a terminal device (which may be a mobile phone, computer, server, or network device, etc.) to execute the methods described in various embodiments of the present invention.

实施例2Example 2

在本实施例中还提供了一种新品销量数据的预测装置,用于实现上述实施例及优选实施方式,已经进行过说明的不再赘述。如以下所使用的,术语“模块”可以实现预定功能的软件和/或硬件的组合。尽管以下实施例所描述的装置较佳地以软件来实现,但是硬件,或者软件和硬件的组合的实现也是可能并被构想的。In this embodiment, a device for predicting sales data of new products is also provided, which is used to implement the above embodiments and preferred implementation modes, and what has been explained will not be repeated here. As used below, the term "module" may be a combination of software and/or hardware that realizes a predetermined function. Although the devices described in the following embodiments are preferably implemented in software, implementations in hardware, or a combination of software and hardware are also possible and contemplated.

图4是根据本发明实施例的一种新品销量数据的预测装置的结构框图,如图4所示,该装置包括:确定模块40,获取模块42,训练模块44,预测模块46,其中,Fig. 4 is a structural block diagram of a device for predicting new product sales data according to an embodiment of the present invention. As shown in Fig. 4 , the device includes: a determination module 40, an acquisition module 42, a training module 44, and a prediction module 46, wherein,

确定模块40,用于确定目标新品的关联产品集合,其中,所述关联产品集合包括与所述目标新品相关的多个关联产品;A determining module 40, configured to determine a set of related products of the target new product, wherein the set of related products includes a plurality of related products related to the target new product;

获取模块42,用于获取所述关联产品集合在第一历史时段的第一销量数据,以及获取所述目标新品在第二历史时段的第二销量数据,其中,所述第一历史时段大于所述第二历史时段;An acquisition module 42, configured to acquire the first sales data of the associated product set in the first historical period, and acquire the second sales data of the target new product in the second historical period, wherein the first historical period is greater than the the second historical period;

训练模块44,用于采用所述第一销量数据和所述第二销量数据训练所述目标新品的初始预测模型,得到目标预测模型;A training module 44, configured to use the first sales data and the second sales data to train the initial prediction model of the target new product to obtain a target prediction model;

预测模块46,用于采用所述目标预测模型预测所述目标新品在未来一段时间的第三销量数据。The prediction module 46 is configured to use the target prediction model to predict the third sales volume data of the target new product in a period of time in the future.

可选的,所述训练模块包括:计算单元,用于计算所述第一销量数据与所述第二销量数据的相似度,其中,所述第一销量数据包括多个子销量数据,每个子销量数据对应一个关联产品;选择单元,用于在所述第一销量数据中选择相似度最高的目标子销量数据;第一训练单元,用于将所述目标子销量数据确定为第一样本数据,训练所述目标新品的初始预测模型,得到中间预测模型;第二训练单元,用于将所述第二销量数据确定为第二样本数据,训练所述中间预测模型,得到目标预测模型。Optionally, the training module includes: a calculation unit, configured to calculate the similarity between the first sales data and the second sales data, wherein the first sales data includes a plurality of sub-sales data, and each sub-sales The data corresponds to an associated product; the selection unit is used to select the target sub-sales data with the highest similarity in the first sales data; the first training unit is used to determine the target sub-sales data as the first sample data , train the initial prediction model of the target new product to obtain an intermediate prediction model; the second training unit is configured to determine the second sales data as second sample data, train the intermediate prediction model, and obtain a target prediction model.

可选的,所述计算单元包括: 截取子单元,用于针对所述第一销量数据中的每个子销量数据,在所述子销量数据与所述第二销量数据中截取相同时间长度的多对数据序列;计算子单元,用于采用以下公式计算所述子销量数据与所述第二销量数据的相似度P:Optionally, the calculation unit includes: an intercepting subunit, configured to, for each sub-sales data in the first sales data, intercept multiple data of the same time length from the sub-sales data and the second sales data. For the data sequence; a calculation subunit, used to calculate the similarity P between the sub-sales data and the second sales data by using the following formula:

Figure 1884DEST_PATH_IMAGE005
Figure 1884DEST_PATH_IMAGE005

其中,Xi为子销量数据的第一数据序列,Yi为所述第二销量数据的第二数据序列,

Figure 556493DEST_PATH_IMAGE007
为所有第一数据序列的均值,
Figure 908977DEST_PATH_IMAGE004
为所有第二数据序列的均值,i∈[1,n],n为大于1的正整数。Wherein , Xi is the first data sequence of the sub-sales data, andYi is the second data sequence of the second sales data,
Figure 556493DEST_PATH_IMAGE007
is the mean of all the first data series,
Figure 908977DEST_PATH_IMAGE004
is the mean value of all second data sequences, i∈[1,n], n is a positive integer greater than 1.

可选的,所述截取子单元还用于包括:基于业务需求确定单位序列长度;解析所述第二销量数据的时间分布区间,在所述子销量数据截取与所述时间分布区间对应的销量数据片段;以所述单位序列长度为分割单位,将所述第二销量数据分割为多个相同时间长度的第二数据序列,以及将所述销量数据片段分割为相同时间长度的第一数据序列。Optionally, the intercepting subunit is further configured to include: determining the unit sequence length based on business requirements; analyzing the time distribution interval of the second sales data, and intercepting the sales volume corresponding to the time distribution interval from the sub sales data Data fragments; using the unit sequence length as the division unit, divide the second sales data into multiple second data sequences of the same time length, and divide the sales data fragments into first data sequences of the same time length .

可选的,所述第二训练单元包括:构建子单元,用于采用所述第二销量数据构建样本数据集,其中,所述样本数据集包括:所述第二销量数据;拆分子单元,用于将所述样本数据集拆分为验证数据和训练数据;微调子单元,用于采用所述验证数据和所述训练数据对所述中间预测模型的参数进行微调,得到目标预测模型。Optionally, the second training unit includes: a construction subunit, configured to use the second sales data to construct a sample data set, wherein the sample data set includes: the second sales data; split subunits, for splitting the sample data set into verification data and training data; a fine-tuning subunit for fine-tuning the parameters of the intermediate prediction model by using the verification data and the training data to obtain a target prediction model.

可选的,所述装置还包括:计算模块,用于在所述获取模块获取所述关联产品集合在第一历史时段的第一销量数据之后,计算所述关联产品集合中每个关联产品的第一销量数据的数据量;判断模块,用于针对每个关联产品,判断对应的第一销量数据的数据量是否大于预设阈值;处理模块,用于若第一销量数据的数据量大于预设阈值,保留对应的第一销量数据;若第一销量数据的数据量小于或等于预设阈值,删除对应的第一销量数据。Optionally, the device further includes: a calculation module, configured to calculate the sales volume of each associated product in the associated product set after the acquiring module acquires the first sales data of the associated product set in the first historical period. The data volume of the first sales data; the judging module, for each associated product, judging whether the data volume of the corresponding first sales data is greater than a preset threshold; the processing module, used for if the data volume of the first sales data is greater than the preset A threshold is set, and the corresponding first sales data is retained; if the data volume of the first sales data is less than or equal to the preset threshold, the corresponding first sales data is deleted.

可选的,所述确定模块包括:第一确定单元,用于确定所述目标新品所在的商品店铺,将所述商品店铺的全店产品确定为所述目标新品的第一关联产品;第二确定单元,用于确定所述目标新品所在的产品线,将所述产品线的全线产品确定为所述目标新品的第二关联产品,其中,每个产品线中多个商品的销售对象和销售途径相同;第三确定单元,用于确定所述目标新品的相似商品,将所述相似商品确定为所述目标新品的第三关联产品,其中,所述相似商品与所述目标新品的销售价格或产品功能相似;其中,所述关联产品集合包括所述第一关联产品,所述第二关联产品,所述第三关联产品。Optionally, the determining module includes: a first determining unit, configured to determine the commodity store where the target new product is located, and determine the entire store product of the commodity store as the first associated product of the target new product; A unit, configured to determine the product line where the target new product is located, and determine the entire product line of the product line as the second associated product of the target new product, wherein the sales objects and sales channels of multiple commodities in each product line the same; the third determining unit is used to determine similar commodities of the target new product, and determine the similar commodity as the third related product of the target new product, wherein the sales price of the similar commodity and the target new product or The product functions are similar; wherein, the associated product set includes the first associated product, the second associated product, and the third associated product.

需要说明的是,上述各个模块是可以通过软件或硬件来实现的,对于后者,可以通过以下方式实现,但不限于此:上述模块均位于同一处理器中;或者,上述各个模块以任意组合的形式分别位于不同的处理器中。It should be noted that the above-mentioned modules can be realized by software or hardware. For the latter, it can be realized by the following methods, but not limited to this: the above-mentioned modules are all located in the same processor; or, the above-mentioned modules can be combined in any combination The forms of are located in different processors.

实施例3Example 3

本发明的实施例还提供了一种存储介质,该存储介质中存储有计算机程序,其中,该计算机程序被设置为运行时执行上述任一项方法实施例中的步骤。An embodiment of the present invention also provides a storage medium, in which a computer program is stored, wherein the computer program is set to execute the steps in any one of the above method embodiments when running.

可选地,在本实施例中,上述存储介质可以被设置为存储用于执行以下步骤的计算机程序:Optionally, in this embodiment, the above-mentioned storage medium may be configured to store a computer program for performing the following steps:

S1,确定目标新品的关联产品集合,其中,所述关联产品集合包括与所述目标新品相关的多个关联产品;S1. Determine a set of related products of the target new product, wherein the set of related products includes a plurality of related products related to the target new product;

S2,获取所述关联产品集合在第一历史时段的第一销量数据,以及获取所述目标新品在第二历史时段的第二销量数据,其中,所述第一历史时段大于所述第二历史时段;S2. Obtain the first sales data of the associated product set in the first historical period, and obtain the second sales data of the target new product in the second historical period, wherein the first historical period is greater than the second historical period time period;

S3,采用所述第一销量数据和所述第二销量数据训练所述目标新品的初始预测模型,得到目标预测模型;S3. Using the first sales data and the second sales data to train an initial prediction model of the target new product to obtain a target prediction model;

S4,采用所述目标预测模型预测所述目标新品在未来一段时间的第三销量数据。S4. Using the target prediction model to predict third sales data of the target new product in a future period of time.

可选地,在本实施例中,上述存储介质可以包括但不限于:U盘、只读存储器(Read-Only Memory,简称为ROM)、随机存取存储器(Random Access Memory,简称为RAM)、移动硬盘、磁碟或者光盘等各种可以存储计算机程序的介质。Optionally, in this embodiment, the above-mentioned storage medium may include but not limited to: U disk, read-only memory (Read-Only Memory, ROM for short), random access memory (Random Access Memory, RAM for short), Various media that can store computer programs, such as removable hard disks, magnetic disks, or optical disks.

本发明的实施例还提供了一种电子设备,包括存储器和处理器,该存储器中存储有计算机程序,该处理器被设置为运行计算机程序以执行上述任一项方法实施例中的步骤。An embodiment of the present invention also provides an electronic device, including a memory and a processor, where a computer program is stored in the memory, and the processor is configured to run the computer program to perform the steps in any one of the above method embodiments.

可选地,上述电子设备还可以包括传输设备以及输入输出设备,其中,该传输设备和上述处理器连接,该输入输出设备和上述处理器连接。Optionally, the above-mentioned electronic device may further include a transmission device and an input-output device, wherein the transmission device is connected to the above-mentioned processor, and the input-output device is connected to the above-mentioned processor.

可选地,在本实施例中,上述处理器可以被设置为通过计算机程序执行以下步骤:Optionally, in this embodiment, the above-mentioned processor may be configured to execute the following steps through a computer program:

S1,确定目标新品的关联产品集合,其中,所述关联产品集合包括与所述目标新品相关的多个关联产品;S1. Determine a set of related products of the target new product, wherein the set of related products includes a plurality of related products related to the target new product;

S2,获取所述关联产品集合在第一历史时段的第一销量数据,以及获取所述目标新品在第二历史时段的第二销量数据,其中,所述第一历史时段大于所述第二历史时段;S2. Obtain the first sales data of the associated product set in the first historical period, and obtain the second sales data of the target new product in the second historical period, wherein the first historical period is greater than the second historical period time period;

S3,采用所述第一销量数据和所述第二销量数据训练所述目标新品的初始预测模型,得到目标预测模型;S3. Using the first sales data and the second sales data to train an initial prediction model of the target new product to obtain a target prediction model;

S4,采用所述目标预测模型预测所述目标新品在未来一段时间的第三销量数据。S4. Using the target prediction model to predict third sales data of the target new product in a future period of time.

可选地,本实施例中的具体示例可以参考上述实施例及可选实施方式中所描述的示例,本实施例在此不再赘述。Optionally, for specific examples in this embodiment, reference may be made to the examples described in the foregoing embodiments and optional implementation manners, and details are not repeated in this embodiment.

图5是本发明实施例的一种电子设备的结构图,如图5所示,包括处理器51、通信接口52、存储器53和通信总线54,其中,处理器51,通信接口52,存储器53通过通信总线54完成相互间的通信,存储器53,用于存放计算机程序;处理器51,用于执行存储器53上所存放的程序。FIG. 5 is a structural diagram of an electronic device according to an embodiment of the present invention. As shown in FIG. 5 , it includes aprocessor 51, acommunication interface 52, amemory 53 and acommunication bus 54, wherein theprocessor 51, thecommunication interface 52, and thememory 53 The mutual communication is completed through thecommunication bus 54 , thememory 53 is used for storing computer programs; theprocessor 51 is used for executing the programs stored in thememory 53 .

上述本申请实施例序号仅仅为了描述,不代表实施例的优劣。The serial numbers of the above embodiments of the present application are for description only, and do not represent the advantages and disadvantages of the embodiments.

在本申请的上述实施例中,对各个实施例的描述都各有侧重,某个实施例中没有详述的部分,可以参见其他实施例的相关描述。In the above-mentioned embodiments of the present application, the descriptions of each embodiment have their own emphases, and for parts not described in detail in a certain embodiment, reference may be made to relevant descriptions of other embodiments.

在本申请所提供的几个实施例中,应该理解到,所揭露的技术内容,可通过其它的方式实现。其中,以上所描述的装置实施例仅仅是示意性的,例如所述单元的划分,仅仅为一种逻辑功能划分,实际实现时可以有另外的划分方式,例如多个单元或组件可以结合或者可以集成到另一个系统,或一些特征可以忽略,或不执行。另一点,所显示或讨论的相互之间的耦合或直接耦合或通信连接可以是通过一些接口,单元或模块的间接耦合或通信连接,可以是电性或其它的形式。In the several embodiments provided in this application, it should be understood that the disclosed technical content can be realized in other ways. Wherein, the device embodiments described above are only illustrative, for example, the division of the units is only a logical function division, and there may be other division methods in actual implementation, for example, multiple units or components can be combined or can be Integrate into another system, or some features may be ignored, or not implemented. In another point, the mutual coupling or direct coupling or communication connection shown or discussed may be through some interfaces, and the indirect coupling or communication connection of units or modules may be in electrical or other forms.

所述作为分离部件说明的单元可以是或者也可以不是物理上分开的,作为单元显示的部件可以是或者也可以不是物理单元,即可以位于一个地方,或者也可以分布到多个网络单元上。可以根据实际的需要选择其中的部分或者全部单元来实现本实施例方案的目的。The units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place, or may be distributed to multiple network units. Part or all of the units can be selected according to actual needs to achieve the purpose of the solution of this embodiment.

另外,在本申请各个实施例中的各功能单元可以集成在一个处理单元中,也可以是各个单元单独物理存在,也可以两个或两个以上单元集成在一个单元中。上述集成的单元既可以采用硬件的形式实现,也可以采用软件功能单元的形式实现。In addition, each functional unit in each embodiment of the present application may be integrated into one processing unit, each unit may exist separately physically, or two or more units may be integrated into one unit. The above-mentioned integrated units can be implemented in the form of hardware or in the form of software functional units.

所述集成的单元如果以软件功能单元的形式实现并作为独立的产品销售或使用时,可以存储在一个计算机可读取存储介质中。基于这样的理解,本申请的技术方案本质上或者说对现有技术做出贡献的部分或者该技术方案的全部或部分可以以软件产品的形式体现出来,该计算机软件产品存储在一个存储介质中,包括若干指令用以使得一台计算机设备(可为个人计算机、服务器或者网络设备等)执行本申请各个实施例所述方法的全部或部分步骤。而前述的存储介质包括:U盘、只读存储器(ROM,Read-Only Memory)、随机存取存储器(RAM,Random Access Memory)、移动硬盘、磁碟或者光盘等各种可以存储程序代码的介质。If the integrated unit is realized in the form of a software function 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 application is essentially or part of the contribution to the prior art or all or part of the technical solution can be embodied in the form of a software product, and the computer software product is stored in a storage medium , including several instructions for enabling a computer device (which may be a personal computer, server or network device, etc.) to execute all or part of the steps of the methods described in the various embodiments of the present application. The aforementioned storage media include: U disk, read-only memory (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory), mobile hard disk, magnetic disk or optical disk and other media that can store program codes. .

以上所述仅是本申请的优选实施方式,应当指出,对于本技术领域的普通技术人员来说,在不脱离本申请原理的前提下,还可以做出若干改进和润饰,这些改进和润饰也应视为本申请的保护范围。The above description is only the preferred embodiment of the present application. It should be pointed out that for those of ordinary skill in the art, without departing from the principle of the present application, some improvements and modifications can also be made. These improvements and modifications are also It should be regarded as the protection scope of this application.

Claims (10)

Translated fromChinese
1.一种新品销量数据的预测方法,其特征在于,包括:1. A method for predicting sales volume data of new products, comprising:确定目标新品的关联产品集合,其中,所述关联产品集合包括与所述目标新品相关的多个关联产品;determining a set of related products of the target new product, wherein the set of related products includes a plurality of related products related to the target new product;获取所述关联产品集合在第一历史时段的第一销量数据,以及获取所述目标新品在第二历史时段的第二销量数据,其中,所述第一历史时段大于所述第二历史时段;Obtaining the first sales data of the associated product set in the first historical period, and obtaining the second sales data of the target new product in the second historical period, wherein the first historical period is greater than the second historical period;采用所述第一销量数据和所述第二销量数据训练所述目标新品的初始预测模型,得到目标预测模型;using the first sales data and the second sales data to train an initial prediction model of the target new product to obtain a target prediction model;采用所述目标预测模型预测所述目标新品在未来一段时间的第三销量数据。Using the target prediction model to predict the third sales volume data of the target new product in a period of time in the future.2.根据权利要求1所述的方法,其特征在于,采用所述第一销量数据和所述第二销量数据训练所述目标新品的初始预测模型,得到目标预测模型包括:2. The method according to claim 1, wherein the initial prediction model of the target new product is trained by using the first sales data and the second sales data, and obtaining the target prediction model includes:计算所述第一销量数据与所述第二销量数据的相似度,其中,所述第一销量数据包括多个子销量数据,每个子销量数据对应一个关联产品;calculating the similarity between the first sales data and the second sales data, wherein the first sales data includes a plurality of sub-sales data, and each sub-sales data corresponds to an associated product;在所述第一销量数据中选择相似度最高的目标子销量数据;Selecting the target sub-sales data with the highest similarity among the first sales data;将所述目标子销量数据确定为第一样本数据,训练所述目标新品的初始预测模型,得到中间预测模型;Determining the target sub-sales data as the first sample data, training the initial forecast model of the target new product, and obtaining an intermediate forecast model;将所述第二销量数据确定为第二样本数据,训练所述中间预测模型,得到目标预测模型。The second sales data is determined as second sample data, and the intermediate prediction model is trained to obtain a target prediction model.3.根据权利要求2所述的方法,其特征在于,计算所述第一销量数据与所述第二销量数据的相似度包括:3. The method according to claim 2, wherein calculating the similarity between the first sales data and the second sales data comprises:针对所述第一销量数据中的每个子销量数据,在所述子销量数据与所述第二销量数据中截取相同时间长度的多对数据序列;For each sub-sales data in the first sales data, intercept multiple pairs of data sequences of the same time length from the sub-sales data and the second sales data;采用以下公式计算所述子销量数据与所述第二销量数据的相似度P:The similarity P between the sub-sales data and the second sales data is calculated by using the following formula:
Figure 544114DEST_PATH_IMAGE001
Figure 544114DEST_PATH_IMAGE001
其中,Xi为子销量数据的第一数据序列,Yi为所述第二销量数据的第二数据序列,
Figure 801920DEST_PATH_IMAGE002
为所有第一数据序列的均值,
Figure 231764DEST_PATH_IMAGE003
为所有第二数据序列的均值,i∈[1,n],n为大于1的正整数。
Wherein , Xi is the first data sequence of the sub-sales data, andYi is the second data sequence of the second sales data,
Figure 801920DEST_PATH_IMAGE002
is the mean of all the first data series,
Figure 231764DEST_PATH_IMAGE003
is the mean value of all second data sequences, i∈[1,n], n is a positive integer greater than 1.
4.根据权利要求3所述的方法,其特征在于,在所述子销量数据与所述第二销量数据中截取相同时间长度的多对数据序列包括:4. The method according to claim 3, wherein intercepting multiple pairs of data sequences of the same time length from the sub-sales data and the second sales data comprises:基于业务需求确定单位序列长度;Determine the unit sequence length based on business requirements;解析所述第二销量数据的时间分布区间,在所述子销量数据截取与所述时间分布区间对应的销量数据片段;Analyzing the time distribution interval of the second sales data, and intercepting sales data segments corresponding to the time distribution interval from the sub-sales data;以所述单位序列长度为分割单位,将所述第二销量数据分割为多个相同时间长度的第二数据序列,以及将所述销量数据片段分割为相同时间长度的第一数据序列。Taking the unit sequence length as a division unit, the second sales data is divided into a plurality of second data sequences of the same time length, and the sales volume data fragments are divided into first data sequences of the same time length.5.根据权利要求2所述的方法,其特征在于,将所述第二销量数据确定为第二样本数据,训练所述中间预测模型,得到目标预测模型包括:5. The method according to claim 2, wherein determining the second sales data as the second sample data, training the intermediate prediction model, and obtaining the target prediction model include:采用所述第二销量数据构建样本数据集,其中,所述样本数据集包括:所述第二销量数据;Constructing a sample data set by using the second sales data, wherein the sample data set includes: the second sales data;将所述样本数据集拆分为验证数据和训练数据;splitting the sample data set into validation data and training data;采用所述验证数据和所述训练数据对所述中间预测模型的参数进行微调,得到目标预测模型。Fine-tuning the parameters of the intermediate prediction model by using the verification data and the training data to obtain a target prediction model.6.根据权利要求1所述的方法,其特征在于,在获取所述关联产品集合在第一历史时段的第一销量数据之后,所述方法还包括:6. The method according to claim 1, characterized in that, after obtaining the first sales data of the associated product set in the first historical period, the method further comprises:计算所述关联产品集合中每个关联产品的第一销量数据的数据量;Calculating the data volume of the first sales data of each associated product in the associated product set;针对每个关联产品,判断对应的第一销量数据的数据量是否大于预设阈值;For each associated product, determine whether the data volume of the corresponding first sales volume data is greater than a preset threshold;若第一销量数据的数据量大于预设阈值,保留对应的第一销量数据;若第一销量数据的数据量小于或等于预设阈值,删除对应的第一销量数据。If the data volume of the first sales data is greater than the preset threshold, the corresponding first sales data is retained; if the data volume of the first sales data is less than or equal to the preset threshold, the corresponding first sales data is deleted.7.根据权利要求1所述的方法,其特征在于,确定目标新品的关联产品集合包括:7. The method according to claim 1, wherein determining the associated product set of the target new product comprises:确定所述目标新品所在的商品店铺,将所述商品店铺的全店产品确定为所述目标新品的第一关联产品;Determine the commodity store where the target new product is located, and determine the entire store product of the commodity store as the first associated product of the target new product;确定所述目标新品所在的产品线,将所述产品线的全线产品确定为所述目标新品的第二关联产品,其中,每个产品线中多个商品的销售对象和销售途径相同;Determine the product line where the target new product is located, and determine the full line of products of the product line as the second associated product of the target new product, wherein the sales objects and sales channels of multiple commodities in each product line are the same;确定所述目标新品的相似商品,将所述相似商品确定为所述目标新品的第三关联产品,其中,所述相似商品与所述目标新品的销售价格或产品功能相似;Determining similar commodities of the target new product, and determining the similar commodity as a third related product of the target new product, wherein the similar commodity is similar in sales price or product function to the target new product;其中,所述关联产品集合包括所述第一关联产品,所述第二关联产品,所述第三关联产品。Wherein, the associated product set includes the first associated product, the second associated product, and the third associated product.8.一种新品销量数据的预测装置,其特征在于,包括:8. A forecasting device for new product sales data, characterized in that it comprises:确定模块,用于确定目标新品的关联产品集合,其中,所述关联产品集合包括与所述目标新品相关的多个关联产品;A determining module, configured to determine a set of associated products of a target new product, wherein the set of associated products includes a plurality of associated products related to the target new product;获取模块,用于获取所述关联产品集合在第一历史时段的第一销量数据,以及获取所述目标新品在第二历史时段的第二销量数据,其中,所述第一历史时段大于所述第二历史时段;An acquisition module, configured to acquire first sales data of the associated product set in a first historical period, and acquire second sales data of the target new product in a second historical period, wherein the first historical period is greater than the Second historical period;训练模块,用于采用所述第一销量数据和所述第二销量数据训练所述目标新品的初始预测模型,得到目标预测模型;A training module, configured to use the first sales data and the second sales data to train the initial prediction model of the target new product to obtain a target prediction model;预测模块,用于采用所述目标预测模型预测所述目标新品在未来一段时间的第三销量数据。A forecasting module, configured to use the target forecasting model to predict the third sales volume data of the target new product in a period of time in the future.9.一种存储介质,其特征在于,所述存储介质包括存储的程序,其中,所述程序运行时执行上述权利要求1至7中任一项所述的方法的步骤。9. A storage medium, characterized in that the storage medium includes a stored program, wherein the steps of the method according to any one of claims 1 to 7 are executed when the program is running.10.一种电子设备,包括处理器、通信接口、存储器和通信总线,其中,处理器,通信接口,存储器通过通信总线完成相互间的通信;其中:10. An electronic device, comprising a processor, a communication interface, a memory, and a communication bus, wherein the processor, the communication interface, and the memory complete mutual communication through the communication bus; wherein:存储器,用于存放计算机程序;memory for storing computer programs;处理器,用于通过运行存储器上所存放的程序来执行权利要求1至7中任一项所述的方法的步骤。A processor configured to execute the steps of the method according to any one of claims 1 to 7 by running a program stored in the memory.
CN202211362770.1A2022-11-022022-11-02 New product sales data prediction method and device, storage medium, electronic equipmentPendingCN115423538A (en)

Priority Applications (1)

Application NumberPriority DateFiling DateTitle
CN202211362770.1ACN115423538A (en)2022-11-022022-11-02 New product sales data prediction method and device, storage medium, electronic equipment

Applications Claiming Priority (1)

Application NumberPriority DateFiling DateTitle
CN202211362770.1ACN115423538A (en)2022-11-022022-11-02 New product sales data prediction method and device, storage medium, electronic equipment

Publications (1)

Publication NumberPublication Date
CN115423538Atrue CN115423538A (en)2022-12-02

Family

ID=84207310

Family Applications (1)

Application NumberTitlePriority DateFiling Date
CN202211362770.1APendingCN115423538A (en)2022-11-022022-11-02 New product sales data prediction method and device, storage medium, electronic equipment

Country Status (1)

CountryLink
CN (1)CN115423538A (en)

Cited By (4)

* Cited by examiner, † Cited by third party
Publication numberPriority datePublication dateAssigneeTitle
CN115829629A (en)*2022-12-162023-03-21广州飞狮数字科技有限公司Method and device for determining smooth and sluggish pin state
CN117196695A (en)*2023-11-032023-12-08中国民航信息网络股份有限公司Target product sales data prediction method and device
CN118396658A (en)*2024-06-262024-07-26浙江口碑网络技术有限公司Sales prediction method, sales prediction device, electronic equipment, storage medium and program product
CN118505274A (en)*2024-06-132024-08-16北京法伯宏业科技发展有限公司Data trend prediction system based on AI analysis

Citations (6)

* Cited by examiner, † Cited by third party
Publication numberPriority datePublication dateAssigneeTitle
CA2961596A1 (en)*2016-03-222017-09-22Wal-Mart Stores, Inc.Event-based sales prediction
CN111445134A (en)*2020-03-262020-07-24珠海随变科技有限公司Commodity sales prediction method, commodity sales prediction apparatus, computer device, and storage medium
CN111652657A (en)*2020-06-102020-09-11创新奇智(南京)科技有限公司Commodity sales prediction method and device, electronic equipment and readable storage medium
CN112330358A (en)*2020-10-222021-02-05北京明略昭辉科技有限公司Method and apparatus for product sales prediction, storage medium, and electronic device
CN112734494A (en)*2021-01-182021-04-30深圳市轱辘车联数据技术有限公司Sales prediction method and device, terminal equipment and readable storage medium
CN114677183A (en)*2022-04-222022-06-28润联软件系统(深圳)有限公司New product sales prediction method and device, computer equipment and storage medium

Patent Citations (6)

* Cited by examiner, † Cited by third party
Publication numberPriority datePublication dateAssigneeTitle
CA2961596A1 (en)*2016-03-222017-09-22Wal-Mart Stores, Inc.Event-based sales prediction
CN111445134A (en)*2020-03-262020-07-24珠海随变科技有限公司Commodity sales prediction method, commodity sales prediction apparatus, computer device, and storage medium
CN111652657A (en)*2020-06-102020-09-11创新奇智(南京)科技有限公司Commodity sales prediction method and device, electronic equipment and readable storage medium
CN112330358A (en)*2020-10-222021-02-05北京明略昭辉科技有限公司Method and apparatus for product sales prediction, storage medium, and electronic device
CN112734494A (en)*2021-01-182021-04-30深圳市轱辘车联数据技术有限公司Sales prediction method and device, terminal equipment and readable storage medium
CN114677183A (en)*2022-04-222022-06-28润联软件系统(深圳)有限公司New product sales prediction method and device, computer equipment and storage medium

Cited By (6)

* Cited by examiner, † Cited by third party
Publication numberPriority datePublication dateAssigneeTitle
CN115829629A (en)*2022-12-162023-03-21广州飞狮数字科技有限公司Method and device for determining smooth and sluggish pin state
CN115829629B (en)*2022-12-162023-12-08广州飞狮数字科技有限公司Method and device for determining smooth pin state
CN117196695A (en)*2023-11-032023-12-08中国民航信息网络股份有限公司Target product sales data prediction method and device
CN117196695B (en)*2023-11-032024-02-27中国民航信息网络股份有限公司Target product sales data prediction method and device
CN118505274A (en)*2024-06-132024-08-16北京法伯宏业科技发展有限公司Data trend prediction system based on AI analysis
CN118396658A (en)*2024-06-262024-07-26浙江口碑网络技术有限公司Sales prediction method, sales prediction device, electronic equipment, storage medium and program product

Similar Documents

PublicationPublication DateTitle
CN115423538A (en) New product sales data prediction method and device, storage medium, electronic equipment
Nekipelov et al.Econometrics for learning agents
CN113469730B (en) A customer repurchase prediction method and device based on RF-LightGBM fusion model in non-contractual scenarios
CN109255651A (en)A kind of search advertisements conversion intelligent Forecasting based on big data
CN110246037B (en)Transaction characteristic prediction method, device, server and readable storage medium
CN110634043B (en) Supply and demand matching model acquisition method, supply and demand matching method, platform and storage medium
Zhang et al.Statistical arbitrage mining for display advertising
WO2023150936A1 (en)Spatio-temporal graph neural network for time series prediction
HUP0301068A2 (en)Method and systems for optimizing return and present value
CN113781139A (en)Item recommendation method, item recommendation device, equipment and medium
Zhu et al.A gamma-based regression for winning price estimation in real-time bidding advertising
CN111581516A (en)Investment product recommendation method and related device
CN116362799A (en) Product demand forecasting method and storage medium based on multi-source data fusion of supply chain
US11551194B2 (en)System to facilitate exchange of data segments between data aggregators and data consumers
CN113672797A (en)Content recommendation method and device
CN111028080A (en)Multi-arm slot machine and Shapley value-based crowd sensing data dynamic transaction method
CN108256924A (en)A kind of product marketing forecast device
CN117010929B (en)Agricultural product public opinion information construction method
CN118710415A (en) Financial product processing method, device, computer storage medium and electronic device
US20200193486A1 (en)System and method for determining bid vector transformed predictive click-through rate
Elreedy et al.A framework for an agent-based dynamic pricing for broadband wireless price rate plans
CN117195555A (en) Power trading method and system for joint VPP under the energy blockchain environment
Yang et al.Dynamically optimizing display advertising profits under diverse budget settings
CN116611499A (en)Method and apparatus for training reinforcement learning system for automatic bidding
Nimma et al.Optimizing Mobile Advertising with Reinforcement Learning and Deep Neural Networks

Legal Events

DateCodeTitleDescription
PB01Publication
PB01Publication
SE01Entry into force of request for substantive examination
SE01Entry into force of request for substantive examination

[8]ページ先頭

©2009-2025 Movatter.jp