Prediction method, device and equipment for multi-cycle time series data and medium

Through feature extraction and expansion of historical data, combined with the probability weighted summation method, the problem of poor applicability of prediction methods and unreliable results in multi-period time series data prediction is solved, improving the applicability and reliability of prediction, and is suitable for commodities Sales forecasting and inventory planning.

CN118586537APending Publication Date: 2024-09-03GUANGZHOU JIAFAN COMPUTER CO LTD
View PDF 0 Cites 1 Cited by

Patent Information

Application Number
CN202410061505.2
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-01-15
Publication Date
2024-09-03

AI Technical Summary

Technical Problem

The existing technology has poor applicability of prediction methods and unreliable prediction results in multi-cycle time series data prediction. This is mainly because data stability is affected by external environmental factors, resulting in internal and multi-cycle data stability that cannot be guaranteed.

Method used

Feature extraction is performed on one-dimensional time series data by calculating at least two cycle lengths of historical data to obtain two-dimensional time series features, which are expanded according to the cycle length to obtain one-dimensional time series features, and weighted summation is performed based on probability to obtain prediction results.

Benefits of technology

It improves the applicability of multi-cycle time series data prediction and the reliability of prediction results, and can more accurately predict product sales and inventory placement.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118586537A
    Figure CN118586537A
Patent Text Reader

Abstract

The invention discloses a multi-cycle time series data prediction method and device, equipment and a medium, and belongs to the technical field of data prediction. The method comprises the following steps: acquiring historical data, and calculating at least two cycle lengths of the historical data by adopting a preset algorithm; wherein the historical data is one-dimensional time series data; performing feature extraction on the one-dimensional time sequence data according to the at least two period lengths to obtain two-dimensional time sequence features of each period length; expanding the two-dimensional time sequence characteristics of each period length according to the period length to obtain one-dimensional time sequence characteristics; and calculating a probability corresponding to the one-dimensional time sequence feature, and carrying out weighted summation on the one-dimensional time sequence feature and the probability to obtain a time sequence data prediction result. According to the technical scheme, the applicability of multi-cycle time series data prediction and the reliability of a prediction result can be improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application belongs to the field of data prediction technology, and specifically relates to a method, device, equipment and medium for predicting multi-period time series data. Background Art

[0002] The application scope of time series data prediction is constantly expanding, for example, forecasting the sales volume of goods. Goods sales forecasting is a means of predicting the future sales of a product based on its historical sales volume. It is widely used in various aspects of the supply chain, such as replenishment, inventory management, logistics management, and cost control. Sales forecasting helps merchants decide on the location and purchase volume of goods.

[0003] In the related art, the prediction method of multi-period time series data mainly adopts the regression moving average model. The regression moving average model is a linear combination model based on time series data. After the time series data is tested to determine its data stability, the autocorrelation function and partial autocorrelation function are used to determine the order of autoregression and historical average sales, and the least squares method or maximum likelihood estimation is used to estimate the parameters of the autoregressive moving model. Finally, the parameter estimation is diagnosed to obtain a complete autoregressive moving average model to predict future sales.

[0004] Since the existing technology is mainly used to predict time series data with stable historical data, and the actual time series changes of the data will be affected by factors such as the external environment, the stability of the data within each period and between multiple periods cannot be guaranteed. Therefore, when using the existing technology to predict multi-period time series data, there are problems such as poor applicability of the prediction method and inaccurate prediction results. Summary of the invention

[0005] The purpose of the embodiments of the present application is to provide a prediction method, device, equipment and medium for multi-period time series data, which solves the problems of poor applicability of prediction methods and unreliable prediction results in the prior art. By calculating at least two period lengths of historical data, feature extraction is performed on one-dimensional time series data to obtain two-dimensional time series features of each period length, and the two-dimensional time series features of each period length are expanded according to the period length to obtain one-dimensional time series features. The one-dimensional time series features and the corresponding probabilities are weighted and summed to obtain time series data prediction results, which can improve the applicability of multi-period time series data prediction and the reliability of the prediction results.

[0006] In a first aspect, an embodiment of the present application provides a method for predicting multi-period time series data, the method comprising:

[0007] Acquire historical data, and use a preset algorithm to calculate at least two period lengths of the historical data; wherein the historical data is one-dimensional time series data;

[0008] Performing feature extraction on the one-dimensional time series data according to the at least two cycle lengths to obtain two-dimensional time series features of each cycle length;

[0009] Expanding the two-dimensional time series features of each period length according to the period length to obtain a one-dimensional time series feature;

[0010] The probability corresponding to the one-dimensional time series feature is calculated, and the one-dimensional time series feature and the probability are weighted and summed to obtain a time series data prediction result.

[0011] Furthermore, a preset algorithm is used to calculate the cycle length of the historical data, including:

[0012] The intensity of each frequency component in the one-dimensional time series data is calculated by fast Fourier transform, and the period lengths corresponding to at least two of the frequency components with the largest intensities are used as the period lengths of the one-dimensional time series data.

[0013] Further, feature extraction is performed on the one-dimensional time series data according to the at least two cycle lengths to obtain two-dimensional time series features of each cycle length, including:

[0014] For any cycle length, fill the one-dimensional time series data to a multiple of the cycle length according to the cycle length, and divide the one-dimensional time series data into at least two one-dimensional components according to the cycle length;

[0015] The one-dimensional components of the same period length are stacked to obtain two-dimensional time series data of the current period length;

[0016] The features of each of the two-dimensional time series data are extracted through a pre-built convolutional neural network model to obtain two-dimensional time series features.

[0017] Furthermore, the two-dimensional time series features of each period length are expanded according to the period length to obtain a one-dimensional time series feature, including:

[0018] The reshap function is used to expand each of the two-dimensional time series features according to the period length to obtain a one-dimensional time series feature.

[0019] Furthermore, the calculating the probability corresponding to the one-dimensional time series feature includes:

[0020] The softmax function is used to calculate the probability of the frequency intensity corresponding to each of the one-dimensional time series features.

[0021] Furthermore, after performing weighted summation on the one-dimensional time series feature and the probability to obtain a time series data prediction result, the method further includes:

[0022] Adding the time series data prediction result to the historical data to obtain a first prediction result, and updating the historical data by the first prediction result;

[0023] The updated historical data is predicted cyclically for a preset number of times, and the last prediction result is used as the time series data prediction result.

[0024] Furthermore, after taking the last prediction result as the time series data prediction result, the method further includes:

[0025] According to the sorting results of the time series data prediction results, the placement location of the commodity to be predicted is determined.

[0026] In a second aspect, an embodiment of the present application provides a prediction device for multi-cycle time series data, the device comprising:

[0027] A cycle length calculation module, used to obtain historical data and calculate at least two cycle lengths of the historical data using a preset algorithm; wherein the historical data is one-dimensional time series data;

[0028] A two-dimensional time series feature extraction module, used to extract features from the one-dimensional time series data according to the at least two cycle lengths to obtain two-dimensional time series features of each cycle length;

[0029] A one-dimensional time series feature acquisition module, used for expanding the two-dimensional time series features of each period length according to the period length to obtain a one-dimensional time series feature;

[0030] The time series data prediction module is used to calculate the probability corresponding to the one-dimensional time series feature, and perform weighted summation of the one-dimensional time series feature and the probability to obtain a time series data prediction result.

[0031] In a third aspect, an embodiment of the present application provides an electronic device, which includes a processor, a memory, and a program or instruction stored in the memory and executable on the processor, wherein the program or instruction, when executed by the processor, implements the steps of the method described in the first aspect.

[0032] In a fourth aspect, an embodiment of the present application provides a readable storage medium, on which a program or instruction is stored, and when the program or instruction is executed by a processor, the steps of the method described in the first aspect are implemented.

[0033] In a fifth aspect, an embodiment of the present application provides a chip, comprising a processor and a communication interface, wherein the communication interface is coupled to the processor, and the processor is used to run a program or instruction to implement the method described in the first aspect.

[0034] In an embodiment of the present application, historical data is obtained, and at least two cycle lengths of the historical data are calculated using a preset algorithm; wherein the historical data is one-dimensional time series data; the one-dimensional time series data is feature extracted according to the at least two cycle lengths to obtain two-dimensional time series features of each cycle length; the two-dimensional time series features of each cycle length are expanded according to the cycle length to obtain a one-dimensional time series feature; the probability corresponding to the one-dimensional time series feature is calculated, and the one-dimensional time series feature and the probability are weighted summed to obtain a time series data prediction result. Through the above-mentioned prediction method for multi-cycle time series data, the problems of poor applicability of the prediction method and unreliable prediction results in the prior art are solved, and the one-dimensional time series data is feature extracted by calculating at least two cycle lengths of the historical data to obtain two-dimensional time series features of each cycle length, and the two-dimensional time series features of each cycle length are expanded according to the cycle length to obtain a one-dimensional time series feature, and the one-dimensional time series feature and the corresponding probability are weighted summed to obtain a time series data prediction result, which can improve the applicability of multi-cycle time series data prediction and the reliability of the prediction result. BRIEF DESCRIPTION OF THE DRAWINGS

[0035] Figure 1 It is a flowchart of a method for predicting multi-cycle time series data provided in Example 1 of the present application;

[0036] Figure 2 It is a flowchart of a method for predicting multi-cycle time series data provided in Example 2 of the present application;

[0037] Figure 3 It is a flowchart of a method for predicting multi-cycle time series data provided in Embodiment 3 of the present application;

[0038] Figure 4 This is a schematic diagram of the structure of a prediction model for multi-period commodity sales data provided by an embodiment of the present application;

[0039] Figure 5 It is a schematic diagram of the internal structure of the processing block provided in an embodiment of the present application;

[0040] Figure 6 It is a schematic diagram of the structure of a prediction device for multi-cycle time series data provided in Embodiment 4 of the present application;

[0041] Figure 7 It is a schematic diagram of the structure of an electronic device provided in Example 5 of the present application. DETAILED DESCRIPTION

[0042] In order to make the purpose, technical scheme and advantages of the present application clearer, the specific embodiments of the present application are further described in detail below in conjunction with the accompanying drawings. It is understood that the specific embodiments described herein are only used to explain the present application, rather than to limit the present application. It should also be noted that, for the convenience of description, only the part related to the present application but not all the contents are shown in the accompanying drawings. Before discussing the exemplary embodiments in more detail, it should be mentioned that some exemplary embodiments are described as processes or methods depicted as flow charts. Although the flow chart describes each operation (or step) as a sequential process, many of the operations therein can be implemented in parallel, concurrently or simultaneously. In addition, the order of each operation can be rearranged. The process can be terminated when its operation is completed, but it can also have additional steps not included in the accompanying drawings. The process can correspond to a method, a function, a procedure, a subroutine, a subprogram, etc.

[0043] The following will be combined with the drawings in the embodiments of the present application to clearly describe the technical solutions in the embodiments of the present application. Obviously, the described embodiments are part of the embodiments of the present application, rather than all the embodiments. All other embodiments obtained by ordinary technicians in this field based on the embodiments in the present application belong to the scope of protection of this application.

[0044] The terms "first", "second", etc. in the specification and claims of the present application are used to distinguish similar objects, and are not used to describe a specific order or sequence. It should be understood that the data used in this way can be interchangeable under appropriate circumstances, so that the embodiments of the present application can be implemented in an order other than those illustrated or described here, and the objects distinguished by "first", "second", etc. are generally of one type, and the number of objects is not limited. For example, the first object can be one or more. In addition, "and / or" in the specification and claims represents at least one of the connected objects, and the character " / " generally indicates that the objects associated with each other are in an "or" relationship.

[0045] In conjunction with the accompanying drawings, the following describes in detail the method, device, equipment and medium for predicting multi-cycle time series data provided by the embodiments of the present application through specific embodiments and their application scenarios.

[0046] Embodiment 1

[0047] Figure 1 It is a flowchart of the method for predicting multi-cycle time series data provided in Example 1 of the present application.

[0048] like Figure 1 As shown, the specific steps include:

[0049] S101, acquiring historical data, and using a preset algorithm to calculate at least two period lengths of the historical data; wherein the historical data is one-dimensional time series data;

[0050] First, the use scenario of this solution can be the scenario of predicting time series data, especially the scenario of predicting time series data based on multiple different cycle lengths. For example, the sales volume of goods is predicted based on multiple different cycle lengths, and then the sales placement and purchase quantity of goods are determined according to the sales forecast results.

[0051] Based on the above usage scenarios, it can be understood that the executor of this solution can be an electronic device that has the ability to perform periodic calculations, feature extraction, dimensionality conversion and weighted summation on data, such as: smart terminals such as mobile phones, tablets and desktop computers, and no excessive restrictions are made here.

[0052] Among them, time series data, that is, time series data, is data recorded and indexed in order of time dimension. For example: commodity sales data recorded in chronological order. Historical data can be historical record data of the time series data, and the historical data is one-dimensional time series data. The one-dimensional time series data can be data composed of time series data of peer relationships and organized in a linear manner. The peer relationship is a horizontal relationship, that is, it is not a containment or subordinate relationship. The preset algorithm can be an algorithm for calculating the length of a cycle, such as: fast Fourier transform. The cycle length can be the time length of each cycle in the historical data, such as: one month or one year, etc.

[0053] In one embodiment, historical data of the required length can be obtained according to the time series data record table, and the historical data can be calculated using a preset algorithm according to the time series data division requirements and the time length of the time series data, and at least two cycle lengths of the historical data can be calculated respectively.

[0054] In a feasible embodiment, optionally, a preset algorithm is used to calculate the cycle length of the historical data, including:

[0055] The intensity of each frequency component in the one-dimensional time series data is calculated by fast Fourier transform, and the period lengths corresponding to at least two of the frequency components with the largest intensities are used as the period lengths of the one-dimensional time series data.

[0056] Among them, the fast Fourier transform is an efficient algorithm of discrete Fourier transform and one of the most basic methods in time domain-frequency domain transform analysis. The fast Fourier transform algorithm can be divided into time extraction algorithm and frequency extraction algorithm.

[0057] In one embodiment, the Fourier transform is to transform the signal in the time domain into the frequency domain, and use a lot of sine waves to synthesize the time domain signal. Therefore, the period corresponding to the sine wave frequency with the largest amplitude after the Fourier transform can be used as the period of the function. That is, the one-dimensional time series data can be analyzed in the frequency domain by fast Fourier transform, the intensity of each frequency component in the one-dimensional time series data can be calculated, and the period length corresponding to at least two of the frequency components with the largest intensity can be used as the period length of the one-dimensional time series data.

[0058] This solution calculates the intensity of each frequency component in one-dimensional time series data through fast Fourier transform, and uses the period length corresponding to at least two of the frequency components with the largest intensity as the period length of the one-dimensional time series data, which can improve the efficiency of period length calculation.

[0059] S102, performing feature extraction on the one-dimensional time series data according to the at least two cycle lengths to obtain two-dimensional time series features of each cycle length;

[0060] Among them, feature extraction can be information useful for the result extracted from the input data, which can be text or data. For example: extract the top few products with the highest sales in the product sales data. Time series features can be indicators used to characterize the statistical characteristics of time series data. For example: mean, variance, maximum, minimum, local maximum, number of local minimums, periodicity and autocorrelation, etc. Two-dimensional time series features can be feature data obtained after feature extraction of two-dimensional time series data. The two-dimensional time series data can be tabular data or matrix data composed of multiple one-dimensional time series data, which is a combination of one-dimensional data.

[0061] In one embodiment, the one-dimensional time series data can be divided according to the at least two cycle lengths to obtain a plurality of one-dimensional time series data components with different cycle lengths, and the one-dimensional time series data components can be stacked according to the cycle lengths to obtain two-dimensional time series data with the same number of cycle lengths. Each row of data and each column of data in the two-dimensional time series data correspond to adjacent cycles and adjacent moments, respectively. According to the requirements for feature extraction of time series data, feature extraction is performed on the two-dimensional time series data through convolution operations and pooling operations to obtain two-dimensional time series features of each cycle length.

[0062] S103, expanding the two-dimensional time series features of each period length according to the period length to obtain a one-dimensional time series feature;

[0063] In one embodiment, the two-dimensional time series features corresponding to each period length can be expanded using a dimension conversion function to obtain a one-dimensional time series feature according to the period length. The dimension conversion function includes: a transpose function and a reshape function.

[0064] In a feasible embodiment, optionally, the two-dimensional time series features of each period length are expanded according to the period length to obtain a one-dimensional time series feature, including:

[0065] The reshap function is used to expand each of the two-dimensional time series features according to the period length to obtain a one-dimensional time series feature.

[0066] Among them, the reshap function can be a function for changing the shape of an array. The reshape function can convert an array into another array of a specified shape without changing the data in the array. The reshape function can be used to adjust the dimension of a tensor, for example: convert a multidimensional array into a one-dimensional array, or convert a one-dimensional array into a multidimensional array.

[0067] In one embodiment, a reshap function may be used to expand each of the two-dimensional time series features according to the period length to obtain a one-dimensional time series feature.

[0068] In this solution, by using the reshap function to expand each of the two-dimensional time series features according to the period length to obtain a one-dimensional time series feature, the steps of converting the time series data dimension can be simplified and the efficiency of converting the time series data dimension can be improved.

[0069] S104, calculating the probability corresponding to the one-dimensional time series feature, and performing weighted summation on the one-dimensional time series feature and the probability to obtain a time series data prediction result.

[0070] The probability corresponding to the one-dimensional time series feature may be the activation frequency of the frequency intensity corresponding to the period length of the one-dimensional time series feature. The time series data prediction result may be the data volume of each data in the time series data in the future time period. For example, the time series data prediction result of commodity sales data may be the sales data of each commodity in the future time period.

[0071] In one embodiment, the probability corresponding to each of the one-dimensional time series features can be calculated by an activation function, and all of the one-dimensional time series features and the corresponding probabilities are weighted and summed to obtain a time series data prediction result. The activation function defines the output of a node under a given input or input set. For example: a standard computer chip circuit can be regarded as a digital circuit activation function that obtains an on (1) or off (0) output based on the input. Activation functions can be divided into linear activation functions (linear equations control the mapping from input to output, such as: f(x) = x, etc.) and nonlinear activation functions (nonlinear equations control the mapping from input to output, such as: Sigmoid, Tanh, ReLU, LReLU, PReLU, Swish, etc.).

[0072] In a feasible embodiment, optionally, the calculating the probability corresponding to the one-dimensional time series feature includes:

[0073] The softmax function is used to calculate the probability of the frequency intensity corresponding to each of the one-dimensional time series features.

[0074] Among them, the softmax function can be an activation function for multi-class classification problems. In multi-class classification problems, more than two class labels require class membership. For any real vector of length K, softmax can compress it into a real vector of length K, with values ​​in the range (0, 1), and the sum of the elements in the vector is 1. The softmax function is different from the normal max function: the max function only outputs the maximum value, but the softmax function ensures that smaller values ​​have smaller probabilities and are not directly discarded. The denominator of the softmax function combines all the factors of the original output value, which means that the various probabilities obtained by the softmax function are related to each other.

[0075] In one embodiment, a softmax function may be used to calculate the probability of the frequency intensity corresponding to each of the one-dimensional time series features.

[0076] This solution calculates the probability of the frequency intensity corresponding to the one-dimensional time series feature through the softmax function, which can improve the comprehensiveness and reliability of the probability result calculation.

[0077] In a feasible embodiment, optionally, after performing weighted summation on the one-dimensional time series feature and the probability to obtain the time series data prediction result, the method further includes:

[0078] Adding the time series data prediction result to the historical data to obtain a first prediction result, and updating the historical data by the first prediction result;

[0079] The updated historical data is predicted cyclically for a preset number of times, and the last prediction result is used as the time series data prediction result.

[0080] In one embodiment, the time series data prediction result and the historical data can be added to obtain a first prediction result, and the first prediction result can be used as the historical data input for the next time series data prediction. The first prediction result is cyclically predicted according to the above prediction steps and a preset number of times, and the last prediction result is used as the time series data prediction result.

[0081] In this scheme, after obtaining the time series data prediction result, the first prediction result is obtained by adding the time series data prediction result to the historical data, and the historical data is updated by the first prediction result. The updated historical data is predicted cyclically according to a preset number of times, and the last prediction result is used as the time series data prediction result. This can achieve the purpose of comprehensive prediction of time series data and improve the reliability of the time series data prediction result.

[0082] In a feasible embodiment, optionally, after taking the last prediction result as the time series data prediction result, the method further includes:

[0083] According to the sorting results of the time series data prediction results, the placement location of the commodity to be predicted is determined.

[0084] In one embodiment, the predicted sales volume of each commodity in the commodities to be predicted can be determined according to the sorting results of each item of data in the time series data prediction results, and the placement location of each commodity can be determined according to the predicted sales volume.

[0085] This solution can improve the accuracy of commodity placement planning by determining the placement location of the commodity to be predicted based on the sorting results of the time series data prediction results.

[0086] The technical solution provided by the embodiment of the present application obtains historical data, and uses a preset algorithm to calculate at least two cycle lengths of the historical data; wherein the historical data is one-dimensional time series data; extracts features from the one-dimensional time series data according to the at least two cycle lengths to obtain two-dimensional time series features of each cycle length; expands the two-dimensional time series features of each cycle length according to the cycle length to obtain a one-dimensional time series feature; calculates the probability corresponding to the one-dimensional time series feature, and weighted sums the one-dimensional time series feature and the probability to obtain a time series data prediction result. Through the above-mentioned prediction method for multi-cycle time series data, the problems of poor applicability of the prediction method and unreliable prediction results in the prior art are solved. By calculating at least two cycle lengths of historical data, extracting features from the one-dimensional time series data to obtain two-dimensional time series features of each cycle length, and expanding the two-dimensional time series features of each cycle length according to the cycle length to obtain a one-dimensional time series feature, weighted summing the one-dimensional time series feature and the corresponding probability to obtain a time series data prediction result can improve the applicability of multi-cycle time series data prediction and the reliability of the prediction result.

[0087] Embodiment 2

[0088] Figure 2 It is a flow chart of a prediction device for multi-cycle time series data provided in the second embodiment of the present application.

[0089] like Figure 2As shown, the specific steps include:

[0090] S201, acquiring historical data, and using a preset algorithm to calculate at least two period lengths of the historical data; wherein the historical data is one-dimensional time series data;

[0091] S202: for any cycle length, fill the one-dimensional time series data to a multiple of the cycle length according to the cycle length, and divide the one-dimensional time series data into at least two one-dimensional components according to the cycle length;

[0092] In one embodiment, for any cycle length, the one-dimensional time series data can be padded with 0s to a multiple of the cycle length according to the cycle length, and the one-dimensional time series data can be divided according to the cycle length to obtain at least two one-dimensional components.

[0093] S203, stacking the one-dimensional components of the same period length to obtain two-dimensional time series data of the current period length;

[0094] In one embodiment, the one-dimensional components of the same period length may be stacked using a reshape function to obtain two-dimensional time series data of the current period length.

[0095] S204, extracting features from each of the two-dimensional time series data using a pre-built convolutional neural network model to obtain two-dimensional time series features;

[0096] Among them, the convolutional neural network model can be a type of feedforward neural network model that includes convolution calculations and has a deep structure. The convolutional neural network has the ability to represent learning and can classify input information in a translation-invariant manner according to its hierarchical structure. The convolutional neural network is constructed by imitating the visual perception mechanism of organisms, and can perform supervised learning and unsupervised learning. The convolutional kernel parameter sharing in its hidden layer and the sparsity of the inter-layer connection enable the convolutional neural network to grid features with a smaller amount of calculation. The convolutional neural network model in this scheme is mainly the Inception model. The basic structure of the Inception model has four components, namely 1×1 convolution, 3×3 convolution, 5×5 convolution and 3×3 maximum pooling, and finally the results of the four component operations are combined on the channel. The Inception model can extract information of different scales of the image through multiple convolution kernels, and finally fuse them to obtain a better representation of the image.

[0097] In one embodiment, each of the two-dimensional time series data can be input into a pre-built convolutional neural network model, and the convolutional neural network model can use multiple different convolution kernels to perform multi-layer convolution calculations and pooling operations on each of the two-dimensional time series data to extract the features of each of the two-dimensional time series data and obtain the two-dimensional time series features corresponding to each of the two-dimensional time series data.

[0098] S205, expanding the two-dimensional time series features of each period length according to the period length to obtain a one-dimensional time series feature;

[0099] S206, calculating the probability corresponding to the one-dimensional time series feature, and performing weighted summation on the one-dimensional time series feature and the probability to obtain a time series data prediction result.

[0100] The technical solution provided in the embodiment of the present application can achieve the purpose of converting one-dimensional time series data into two-dimensional time series data by filling one-dimensional time series data to multiples of the cycle length according to the cycle length, and dividing and stacking the one-dimensional time series data according to the cycle length to obtain two-dimensional time series data of the current cycle length, thereby improving the smoothness of the time series data. By extracting features from each of the two-dimensional time series data through a pre-built convolutional neural network model, the accuracy and reliability of time series data prediction can be improved.

[0101] Embodiment 3

[0102] Figure 3 It is a flowchart of the method for predicting multi-cycle time series data provided in Example 3 of the present application.

[0103] like Figure 3 As shown, the specific steps include:

[0104] S301, embedding the historical sales data of the commodity to be predicted into a processing block for processing;

[0105] S302, obtaining k period lengths of the historical sales data by using fast Fourier transform through the processing block;

[0106] S303, stacking the one-dimensional historical sales data into a two-dimensional tensor according to the length of k periods;

[0107] S304, extracting time series features from multiple two-dimensional tensors using an Inception model;

[0108] S305, converting the extracted two-dimensional time series features back to one-dimensional space;

[0109] S306, performing weighted aggregation on the extracted one-dimensional representations according to the corresponding frequencies and outputting the results;

[0110] S307, adding the obtained output to the input of the current processing block, embedding them together into the next processing block, and the last processing block outputs the prediction result;

[0111] S308, sorting the products according to the sales forecast results and allocating storage locations.

[0112] Furthermore, the sales volume of commodities within a period of time is collected and embedded in the first processing block to extract features.

[0113] Furthermore, for the one-dimensional time series output by the previous processing block, the k-period length of the sequence is obtained by fast Fourier transform. For the first processing block, what is received is a one-dimensional time series of commodity sales.

[0114] Furthermore, the one-dimensional time series are stacked according to k period lengths to obtain k two-dimensional tensors, in which each row and each column correspond to adjacent periods and adjacent moments.

[0115] Furthermore, the Inception model is used to extract features from the k two-dimensional tensors to obtain k two-dimensional time series features.

[0116] Furthermore, the extracted two-dimensional time series features are subjected to dimensionality reduction processing and converted back to one-dimensional space for information aggregation.

[0117] Furthermore, the one-dimensional representation obtained by the transformation is weighted and summed according to the intensity of its corresponding frequency to obtain the aggregation result.

[0118] Furthermore, the aggregation result is added to the input of the current processing block, and the two are embedded as the input of the next processing block. The last processing block directly outputs the result.

[0119] Furthermore, the output results are sorted to obtain the sales ranking of the products, and the storage locations are allocated according to the ranking.

[0120] Figure 4 It is a schematic diagram of the structure of the prediction model for multi-period commodity sales data provided in an embodiment of the present application.

[0121] like Figure 4 As shown, the historical sales data of all commodities are processed by the same processing block to obtain the prediction result of the processing block, and the prediction result of the processing block is added to the original commodity sales history data and input into the next processing block. After the cyclic calculation of multiple processing blocks, the sales prediction result of each commodity can be obtained, and the sorting of commodities and storage locations can be determined according to the commodity sales prediction results.

[0122] The present invention is a prediction method for multi-period time series data constructed by the following techniques:

[0123] Convert one-dimensional time series data into two dimensions:

[0124] Each time point of the commodity time data involves two kinds of time changes with the same phase between its adjacent areas and different periods, namely, intra-cycle changes and inter-cycle changes. This method explores the two-dimensional structure of commodity time changes to capture the characteristic relationship within and between time periods. For the sales data of a certain commodity, its original structure is a channel with Length Time Series . It is embedded as input into the first processing block. In order to obtain information about its periodicity, this method analyzes it in the frequency domain by using Fast Fourier Transform (FFT) at the beginning of each processing block. The specific process is as follows:

[0125]

[0126]

[0127]

[0128] Among them, A represents X 1D The intensity of each frequency component in {f1,…,f k} represents the most significant k period lengths calculated, p i Indicates how many segments each cycle can be divided into, and l represents the lth processing block. According to these k cycles, the original one-dimensional time series is filled with 0 to a multiple of the cycle length, and then folded according to the cycle length to obtain k two-dimensional time series tensors {X 1_2D ,X 2_2D ,…,X k_2D}, the specific process is as follows:

[0129]

[0130] Extract representation using the Inception model:

[0131] The Inception model is a network with excellent local topology structure, which performs multiple convolution operations or pooling operations on the input image in parallel and concatenates all output results into a very deep feature map. This method uses the Inception model to extract features from the stacked two-dimensional time series tensor to obtain k two-dimensional representations containing different periodic time series information:

[0132]

[0133] Then, these k two-dimensional representations are expanded according to the period length to obtain k one-dimensional representations for information aggregation:

[0134]

[0135] Aggregate and output the representation

[0136] For k frequency intensities Use the Softmax function to process and get the activated frequency Then, each one-dimensional representation is weighted and summed according to the corresponding frequency to obtain the prediction result of the processing block. The prediction result is added to the input of this processing block and embedded into the next processing block as input. The last processing block directly outputs the result:

[0137]

[0138]

[0139]

[0140] Generate forecast results and allocate storage locations

[0141] The last processing block outputs the sales forecast results of all products within a certain period, sorts them, selects the top n products as hot-selling products, and allocates them to storage locations close to the platform.

[0142] Figure 5 It is a schematic diagram of the internal structure of the processing block provided in an embodiment of the present application.

[0143] like Figure 5 As shown, the processing block obtains multiple period lengths by fast Fourier transforming the input one-dimensional time series and obtains multiple two-dimensional time series corresponding to the multiple period lengths by two-dimensional transformation, and activates the frequency component intensity of the one-dimensional time series after fast Fourier transform using the softmax function to obtain the probability corresponding to each frequency component intensity. The two-dimensional time series is respectively subjected to feature extraction of the two-dimensional time series features through the Inception model, and the two-dimensional time series features are subjected to one-dimensional transformation to obtain one-dimensional time series features. Finally, the one-dimensional time series features and the probabilities of the corresponding frequency component intensities are weighted and summed to obtain the final prediction result of the processing block.

[0144] The technical solution provided by the embodiment of the present application embeds the historical sales data of the commodity to be predicted into the processing block for processing; obtains the k period lengths of the historical sales data through the processing block by using the fast Fourier transform; stacks the one-dimensional historical sales data into a two-dimensional tensor according to the k period lengths; extracts time series features from multiple two-dimensional tensors using the Inception model; converts the extracted two-dimensional time series features back into one-dimensional space; performs weighted aggregation and output of the extracted one-dimensional representation according to the corresponding frequency; adds the obtained output to the input of this processing block, and embeds them into the next processing block together, and the last processing block outputs the prediction result; sorts according to the sales forecast results of the commodity, and allocates the placement location. Through the above-mentioned prediction method for multi-period time series data, the purpose of accurately predicting non-stationary data and calculating the time series data of commodities with multiple periods and different changes within the period can be achieved, and the reliability of feature extraction of time series data and the reliability of prediction results of time series data can be improved.

[0145] Embodiment 4

[0146] Figure 6 It is a schematic diagram of the structure of the prediction device for multi-cycle time series data provided in Example 4 of the present application.

[0147] like Figure 6 As shown, specifically including the following:

[0148] The cycle length calculation module 601 is used to obtain historical data and calculate at least two cycle lengths of the historical data using a preset algorithm; wherein the historical data is one-dimensional time series data;

[0149] A two-dimensional time series feature extraction module 602 is used to extract features from the one-dimensional time series data according to the at least two cycle lengths to obtain two-dimensional time series features of each cycle length;

[0150] A one-dimensional time series feature acquisition module 603 is used to expand the two-dimensional time series features of each period length according to the period length to obtain a one-dimensional time series feature;

[0151] The time series data prediction module 604 is used to calculate the probability corresponding to the one-dimensional time series feature, and perform weighted summation of the one-dimensional time series feature and the probability to obtain a time series data prediction result.

[0152] Furthermore, the cycle length calculation module 601 is specifically used for:

[0153] The intensity of each frequency component in the one-dimensional time series data is calculated by fast Fourier transform, and the period lengths corresponding to at least two of the frequency components with the largest intensities are used as the period lengths of the one-dimensional time series data.

[0154] Furthermore, the two-dimensional time series feature extraction module 602 is specifically used for:

[0155] For any cycle length, fill the one-dimensional time series data to a multiple of the cycle length according to the cycle length, and divide the one-dimensional time series data into at least two one-dimensional components according to the cycle length;

[0156] The one-dimensional components of the same period length are stacked to obtain two-dimensional time series data of the current period length;

[0157] The features of each of the two-dimensional time series data are extracted through a pre-built convolutional neural network model to obtain two-dimensional time series features.

[0158] Furthermore, the one-dimensional time series feature acquisition module 603 is specifically used for:

[0159] The reshap function is used to expand each of the two-dimensional time series features according to the period length to obtain a one-dimensional time series feature.

[0160] Furthermore, the time series data prediction module 604 is specifically used for:

[0161] The softmax function is used to calculate the probability of the frequency intensity corresponding to each of the one-dimensional time series features.

[0162] Furthermore, the device also includes:

[0163] A historical data updating module, configured to add the time series data prediction result to the historical data to obtain a first prediction result, and update the historical data by using the first prediction result;

[0164] The prediction result determination module is used to cyclically predict the updated historical data according to a preset number of times, and use the last prediction result as the time series data prediction result.

[0165] Furthermore, the device also includes:

[0166] The storage location determination module is used to determine the storage location of the commodity to be predicted based on the sorting result of the time series data prediction result.

[0167] The technical solution provided in the embodiment of the present application includes a cycle length calculation module, which is used to obtain historical data and calculate at least two cycle lengths of the historical data using a preset algorithm; wherein the historical data is one-dimensional time series data; a two-dimensional time series feature extraction module, which is used to extract features from the one-dimensional time series data according to the at least two cycle lengths to obtain two-dimensional time series features of each cycle length; a one-dimensional time series feature acquisition module, which is used to expand the two-dimensional time series features of each cycle length according to the cycle length to obtain one-dimensional time series features; and a time series data prediction module, which is used to calculate the probability corresponding to the one-dimensional time series feature, and perform weighted summation of the one-dimensional time series feature and the probability to obtain a time series data prediction result. The above-mentioned prediction device for multi-period time series data solves the problems of poor applicability of prediction methods and unreliable prediction results in the prior art. By calculating at least two period lengths of historical data, feature extraction is performed on one-dimensional time series data to obtain two-dimensional time series features of each period length, and the two-dimensional time series features of each period length are expanded according to the period length to obtain one-dimensional time series features. The one-dimensional time series features and the corresponding probabilities are weighted and summed to obtain the time series data prediction results, which can improve the applicability of multi-period time series data prediction and the reliability of the prediction results.

[0168] The prediction device of multi-cycle time series data in the embodiment of the present application can be a device, or a component, integrated circuit, or chip in a terminal. The device can be a mobile electronic device or a non-mobile electronic device. Exemplarily, the mobile electronic device can be a mobile phone, a tablet computer, a laptop computer, a palmtop computer, an in-vehicle electronic device, a wearable device, an ultra-mobile personal computer (ultra-mobile personal computer, UMPC), a netbook or a personal digital assistant (personal digital assistant, PDA), etc., and the non-mobile electronic device can be a server, a network attached storage (Network Attached Storage, NAS), a personal computer (personal computer, PC), a television (television, TV), a teller machine or a self-service machine, etc., which is not specifically limited in the embodiment of the present application.

[0169] The prediction device for multi-cycle time series data in the embodiment of the present application can be a device with an operating system. The operating system can be an Android operating system, an iOS operating system, or other possible operating systems, which are not specifically limited in the embodiment of the present application.

[0170] The multi-cycle time series data prediction device provided in the embodiment of the present application can implement each process implemented by the above-mentioned method embodiments. To avoid repetition, it will not be described again here.

[0171] Embodiment 5

[0172] like Figure 7 As shown, an embodiment of the present application also provides an electronic device 700, including a processor 701, a memory 702, and a program or instruction stored in the memory 702 and executable on the processor 701. When the program or instruction is executed by the processor 701, each process of the above-mentioned multi-cycle timing data prediction device embodiment is implemented, and the same technical effect can be achieved. To avoid repetition, it will not be described here.

[0173] It should be noted that the electronic devices in the embodiments of the present application include the mobile electronic devices and non-mobile electronic devices mentioned above.

[0174] Embodiment 6

[0175] An embodiment of the present application also provides a readable storage medium, on which a program or instruction is stored. When the program or instruction is executed by a processor, each process of the above-mentioned multi-cycle timing data prediction device embodiment is implemented, and the same technical effect can be achieved. To avoid repetition, it will not be repeated here.

[0176] The processor is a processor in the electronic device described in the above embodiment. The readable storage medium includes a computer readable storage medium, such as a computer read-only memory (ROM), a random access memory (RAM), a magnetic disk or an optical disk.

[0177] Embodiment 7

[0178] An embodiment of the present application further provides a chip, which includes a processor and a communication interface, wherein the communication interface is coupled to the processor, and the processor is used to run programs or instructions to implement the various processes of the above-mentioned multi-cycle time series data prediction device embodiment, and can achieve the same technical effect. To avoid repetition, it will not be repeated here.

[0179] It should be understood that the chip mentioned in the embodiments of the present application can also be called a system-level chip, a system chip, a chip system or a system-on-chip chip, etc.

[0180] It should be noted that, in this article, the terms "comprise", "include" or any other variant thereof are intended to cover non-exclusive inclusion, so that the process, method, article or device including a series of elements includes not only those elements, but also includes other elements not explicitly listed, or also includes elements inherent to such process, method, article or device. In the absence of further restrictions, the elements defined by the sentence "comprise one..." do not exclude the presence of other identical elements in the process, method, article or device including the element. In addition, it should be pointed out that the scope of the methods and devices in the embodiments of the present application is not limited to performing functions in the order shown or discussed, and may also include performing functions in a substantially simultaneous manner or in reverse order according to the functions involved, for example, the described method may be performed in an order different from that described, and various steps may also be added, omitted, or combined. In addition, the features described with reference to certain examples may be combined in other examples.

[0181] Through the description of the above implementation methods, those skilled in the art can clearly understand that the above-mentioned embodiment methods can be implemented by means of software plus a necessary general hardware platform, and of course by hardware, but in many cases the former is a better implementation method. Based on such an understanding, the technical solution of the present application, or the part that contributes to the prior art, can be embodied in the form of a computer software product, which is stored in a storage medium (such as ROM / RAM, a disk, or an optical disk), and includes a number of instructions for a terminal (which can be a mobile phone, a computer, a server, or a network device, etc.) to execute the methods described in each embodiment of the present application.

[0182] The embodiments of the present application are described above in conjunction with the accompanying drawings, but the present application is not limited to the above-mentioned specific implementation methods. The above-mentioned specific implementation methods are merely illustrative and not restrictive. Under the guidance of the present application, ordinary technicians in this field can also make many forms without departing from the purpose of the present application and the scope of protection of the claims, all of which are within the protection of the present application.

[0183] The above are only preferred embodiments of the present application and the technical principles used. The present application is not limited to the specific embodiments described herein, and various obvious changes, readjustments and substitutions that can be made by those skilled in the art will not deviate from the scope of protection of the present application. Therefore, although the present application is described in more detail through the above embodiments, the present application is not limited to the above embodiments, and may include more other equivalent embodiments without departing from the concept of the present application, and the scope of the present application is determined by the scope of the claims.

Claims

1. A method for predicting multi-period time series data, characterized in that: The method comprises: Acquire historical data, and use a preset algorithm to calculate at least two period lengths of the historical data; wherein the historical data is one-dimensional time series data; Performing feature extraction on the one-dimensional time series data according to the at least two cycle lengths to obtain two-dimensional time series features of each cycle length; Expanding the two-dimensional time series features of each period length according to the period length to obtain a one-dimensional time series feature; The probability corresponding to the one-dimensional time series feature is calculated, and the one-dimensional time series feature and the probability are weighted and summed to obtain a time series data prediction result.

2. The method for predicting multi-cycle time series data according to claim 1, characterized in that: The cycle length of the historical data is calculated using a preset algorithm, including: The intensity of each frequency component in the one-dimensional time series data is calculated by fast Fourier transform, and the period lengths corresponding to at least two of the frequency components with the largest intensities are used as the period lengths of the one-dimensional time series data.

3. The method for predicting multi-cycle time series data according to claim 1, characterized in that: Extracting features from the one-dimensional time series data according to the at least two cycle lengths to obtain two-dimensional time series features of each cycle length includes: For any cycle length, fill the one-dimensional time series data to a multiple of the cycle length according to the cycle length, and divide the one-dimensional time series data into at least two one-dimensional components according to the cycle length; The one-dimensional components of the same period length are stacked to obtain two-dimensional time series data of the current period length; The features of each of the two-dimensional time series data are extracted through a pre-built convolutional neural network model to obtain two-dimensional time series features.

4. The method for predicting multi-cycle time series data according to claim 1, characterized in that: The two-dimensional time series features of each period length are expanded according to the period length to obtain a one-dimensional time series feature, including: The reshap function is used to expand each of the two-dimensional time series features according to the period length to obtain a one-dimensional time series feature.

5. The method for predicting multi-cycle time series data according to claim 1, characterized in that: The calculating the probability corresponding to the one-dimensional time series feature includes: The softmax function is used to calculate the probability of the frequency intensity corresponding to each of the one-dimensional time series features.

6. The method for predicting multi-cycle time series data according to claim 1, characterized in that: After performing weighted summation of the one-dimensional time series feature and the probability to obtain a time series data prediction result, the method further includes: Adding the time series data prediction result to the historical data to obtain a first prediction result, and updating the historical data by the first prediction result; The updated historical data is predicted cyclically for a preset number of times, and the last prediction result is used as the time series data prediction result.

7. The method for predicting multi-cycle time series data according to claim 6, characterized in that: After taking the last prediction result as the time series data prediction result, the method further includes: According to the sorting results of the time series data prediction results, the placement location of the commodity to be predicted is determined.

8. A prediction device for multi-period time series data, characterized in that: The device comprises: A cycle length calculation module, used to obtain historical data and calculate at least two cycle lengths of the historical data using a preset algorithm; wherein the historical data is one-dimensional time series data; A two-dimensional time series feature extraction module, used to extract features from the one-dimensional time series data according to the at least two cycle lengths to obtain two-dimensional time series features of each cycle length; A one-dimensional time series feature acquisition module, used for expanding the two-dimensional time series features of each period length according to the period length to obtain a one-dimensional time series feature; The time series data prediction module is used to calculate the probability corresponding to the one-dimensional time series feature, and perform weighted summation of the one-dimensional time series feature and the probability to obtain a time series data prediction result.

9. An electronic device, characterized in that: It includes a processor, a memory, and a program or instruction stored in the memory and executable on the processor, wherein when the program or instruction is executed by the processor, the steps of the method for predicting multi-cycle timing data as described in any one of claims 1 to 7 are implemented.

10. A readable storage medium, characterized in that: The readable storage medium stores a program or instruction, and when the program or instruction is executed by a processor, the steps of the method for predicting multi-cycle time series data according to any one of claims 1 to 7 are implemented.

Citation Information

Cited By

  • Industrial equipment fault prediction method and system, electronic equipment and storage medium

    CN121561682A