A long-term time series prediction method based on life cycle mutual learning
Through the life cycle-based mutual learning method, combined with clustering and neural network models, the problem of data complexity and low long-term forecast accuracy in supply chain time series forecasting is solved, achieving higher forecast accuracy and stability, and is suitable for Forecasting of demand and inventory levels.
Patent Information
- Application Number
- CN202410052280.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-01-15
- Publication Date
- 2024-09-13
- Estimated Expiration
- 2044-01-15
AI Technical Summary
In the field of supply chain timing forecasting, existing technologies are difficult to effectively process large-scale, high-dimensional data and capture nonlinear relationships and complex interactions. Long-term forecasting accuracy is low and errors accumulate seriously.
Using a life cycle-based mutual learning method, through clustering and neural network models, combined with the sample's own characteristics and large categories of life cycle information, a revised model is built to make one-time predictions and avoid error accumulation.
It improves the accuracy and stability of time series forecasting, can better capture data changing trends, adapt to different data patterns, and is suitable for forecasting demand and inventory levels.
Smart Images

Figure CN117574112B
Abstract
Description
Technical Field
[0001] The present invention relates to the field of computer application technology, in particular to a long-term time series prediction method based on life cycle mutual learning. Background Art
[0002] Time series forecasting technology is an important technology used in the field of data analysis and forecasting. Its core task is to use the patterns and trends of historical time series data to predict values, trends or events at future time points. At present, the commonly used time series forecasting methods in the supply chain include statistical time series forecasting methods, machine learning methods and deep learning methods.
[0003] Statistical time series forecasting methods include moving average, exponential smoothing, autoregressive model (AR), moving average model (MA), ARIMA (autoregressive integrated moving average model) and VAR (vector autoregressive model), which are designed to understand the trend, periodicity and seasonality of data and are suitable for simple time series patterns. Machine learning methods such as support vector machine (SVM), decision tree, random forest, etc. can learn patterns from complex time series data. Deep learning techniques such as recurrent neural network (RNN), long short-term memory network (LSTM), transformer, etc. can handle longer-term dependencies and complex patterns.
[0004] In the field of supply chain time series forecasting, affected by the diversity and life cycle of SKUs, data often has characteristics such as large scale, large fluctuations, incompleteness, and intermittence, which makes the time series forecasting problem complicated; and the limitation of inventory levels also increases the difficulty of forecasting. These factors pose challenges to building models for supply chain time series forecasting.
[0005] Statistical-based forecasting methods are inefficient in processing large-scale, high-dimensional supply chain data, and are usually unable to capture nonlinear relationships and complex interactions between multiple variables; traditional machine learning-based forecasting methods require complex feature engineering when processing large-scale supply chain data; traditional deep learning technology requires a lot of time and resources for model selection and tuning. Summary of the invention
[0006] The purpose of the present invention is to provide a long-term time series forecasting method based on life cycle mutual learning, aiming to solve the problems in the field of supply chain forecasting: first, the time series forecasting is not ideal due to the periodicity, trend, seasonality and intermittent characteristics of the data; second, in long-term forecasting, the existing algorithms have low prediction accuracy and large errors. For example, the iterative method will cause the accumulation of errors.
[0007] In response to the above problems, the present invention emphasizes the use of life cycle information to build a mutual learning framework, and combines the sample's own interval mean model to build a correction model to improve the accuracy of prediction; one-time prediction is used in long-term prediction to overcome the problem of error accumulation.
[0008] The method for long-term time series prediction based on mutual learning of life cycle of the present invention comprises the steps of:
[0009] (1) Collect sample data and process the data, use clustering methods to divide all samples into several categories, and then use trend learning models to learn the life cycles of different categories;
[0010] (2) A single sample uses a neural network model to learn its own characteristics and obtain the changing trend characteristics of the sample itself;
[0011] (3) Select the life cycle of the major category to which the sample belongs, and use the life cycle of the major category to guide the overall change trend of the sample through mutual learning. The sample adjusts itself through its own characteristics and finally obtains the prediction result;
[0012] (4) Analyze the changes in samples through the sample’s own interval mean model, build a correction model to correct the prediction results, further improve the accuracy of the model, and finally complete the prediction of future time points of the time series data.
[0013] Preferably, in step (1), the sample data includes multiple pieces of data, each piece of data includes a data ID, an accessory model SKU, the launch time of the SKU, and time series data of each ID, wherein the time series data is data with a natural month as the time granularity;
[0014] The data processing includes data alignment, that is, calculating the launch period (ie, launch duration) corresponding to each ID time series data according to the launch time, and aligning the time series data of all IDs according to the launch period.
[0015] Preferably, in step (1), the data processing also includes data cleaning, that is, before data alignment, removing the time series data before listing from the sample data.
[0016] Preferably, in step (1), the method of using a clustering method to divide all samples into several major categories specifically comprises: calculating the similarity between the sample sequence and the remaining samples, selecting the most similar ones as the same type, and repeating this operation to divide the samples into several major categories;
[0017] The life cycle includes characteristics such as the amount of change and the trend of change.
[0018] Preferably, step (2) includes building a neural network model including an input layer, two hidden layers, and finally adding a softmax function (normalized exponential function) to output the probability of increasing, decreasing or unchanged.
[0019] Preferably, step (3) specifically includes:
[0020] The first step is to calculate the trend probability of the sample when the major trend direction occurs based on the conditional probability, as shown in formula (1):
[0021]
[0022] Among them, B i represents the change trend of a single sample in the i-th period of the life cycle, C i Indicates the changing trend of the major categories of data in the i-th cycle of the life cycle, P(B i |C i ) indicates that in the major trend C i In the case of occurrence, the trend of the sample B i The probability of occurrence, P(C i ) indicates that the change trend of the sample category is C i The probability of i C i ) means that in the same period, the sample trend B i and major trend C i Probability of simultaneous occurrence;
[0023] The second step is to learn the change trend b of the future i-th cycle in the sub-network according to its own change characteristics. i , combining the changes of the sample itself with the changes of the major categories to learn the probability of the final sample's downward or upward trend, as shown in formula (2):
[0024] P B =w1*P(B i |C i )+w2*P(b i ) (2)
[0025] Among them, P B Indicates the final probability of the sample changing trend, P(b i ) represents the probability of the changing trend of the sample after learning, w1 and w2 represent the corresponding weight coefficients, which are the optimal values obtained through training and learning; the role of formula (2) is to adjust P B The loss between the actual value and the numerical value of learning parameters w1 and w2;
[0026] In the third step, after determining the sample change trend, the magnitude of the change is determined by formula (3):
[0027] Δy i =w1*y c +w2*Δy i-1 (3)
[0028] Among them, Δy i represents the predicted value of the sample change in the i-th period; y c Represents the change of a major category in the same listing cycle; the values of parameters w1 and w2 are the optimal values of the second step training; the initial value Δy1 is set to 0;
[0029] The fourth step is to determine the magnitude of the change and then predict the sample according to formula (4):
[0030] y i =y i-1 +Δy i (4)
[0031] Among them, y i-1 Represents the known value of the (i-1)th period of a single sample life cycle; y i Represents the predicted value of the i-th period of the life cycle.
[0032] Preferably, step 4 specifically includes:
[0033] Assume the prediction time point is t, the time length to be predicted is N, and the prediction value after time t is Y f ={y1,y2,…,y N}, the mean of the N predicted values is
[0034] Calculate the mean of every N values before the predicted time point to get the mean sequence Among them, the mean of the N values before the prediction time point t is used The calculation method is shown in formula (5):
[0035]
[0036] Among them, y t-i Indicates the value at time (ti);
[0037] According to formula (6), the proportion of sample natural months is calculated as r m ={r1,r2,...,r 12},
[0038]
[0039] in, represents the mean of the sample in the ith natural month, represents the sample mean of all time;
[0040] According to the predicted mean The mean of the previous N values The difference between , adjust the prediction results:
[0041] if Adjust the predicted value according to formula (7);
[0042]
[0043] if Adjust the predicted value according to formula (8)
[0044]
[0045] Among them, y c Represents the amount of change in a major category during the same listing cycle; and Represents the corresponding weight coefficient, which is the optimal value obtained through training and learning; Represents the revised forecast value.
[0046] The invention also aims to disclose the application of the method in supply chain forecasting, for example, it can be used to forecast demand and / or inventory levels.
[0047] The positive and progressive effects of the present invention are:
[0048] The invention of this application proposes a long-term time series prediction method based on mutual learning of the life cycle. First, this prediction method uses a curve clustering method to group samples, rather than just traditional data point clustering, which can better capture the changing trends and patterns in time series data. Second, mutual learning not only considers the historical data characteristics of the sample itself, but also refers to the life cycle of similar samples, and realizes the prediction of samples in the early stages of their life or samples with incomplete data based on rich information. Third, the interval mean correction model helps to better understand the changing patterns and trends of the data, and improves the stability and robustness of the prediction.
[0049] The present invention proposes a new method for time series prediction, namely a long-term time series prediction method based on mutual learning of life cycle. The method proposes a sequence data clustering method, and uses an improved mutual learning model to fine-tune the prediction through the final sample self-interval mean model through the mutual learning of the sample's own change characteristics and the major category life cycle to obtain the final time series prediction value.
[0050] The method of the present invention combines lifecycle learning with personalized learning, can capture the characteristics of supply chain products at different stages, can better adapt to different data patterns and needs, and can more accurately predict demand and inventory levels. BRIEF DESCRIPTION OF THE DRAWINGS
[0051] Figure 1 It is a flow chart of the long-term time series prediction method based on life cycle mutual learning of the present invention;
[0052] Figure 2 A schematic diagram of a student network feature extraction model of the present invention;
[0053] Figure 3 This is an improved mutual learning model of the present invention. DETAILED DESCRIPTION
[0054] The present invention is further described below in conjunction with specific embodiments and drawings. It should be understood that the following embodiments are only used to illustrate the present invention and are not used to limit the scope of the present invention.
[0055] Example 1
[0056] See also Figure 1 The method for long-term time series prediction based on mutual learning of life cycle of the present invention comprises the steps of:
[0057] (1) Collect sample data and process the data, use clustering methods to divide all samples into several categories, and then use trend learning models to learn the life cycles of different categories;
[0058] (2) A single sample uses a neural network model to learn its own characteristics and obtain the changing trend characteristics of the sample itself;
[0059] (3) Select the life cycle of the category to which the sample belongs (category 2 in the example in the figure), and use the life cycle of the category to guide the overall change trend of the sample through mutual learning. The sample adjusts itself through its own characteristics and finally obtains the prediction result;
[0060] (4) Analyze the changes in samples through the sample’s own interval mean model, build a correction model to correct the prediction results, further improve the accuracy of the model, and finally complete the prediction of future time points of the time series data.
[0061] Preferably, in step (1), the sample data includes multiple pieces of data, each piece of data includes a data ID, an accessory model SKU, the launch time of the SKU, and time series data of each ID, wherein the time series data is data with a natural month as the time granularity;
[0062] The data processing includes data alignment, that is, calculating the launch period (ie, launch duration) corresponding to each ID time series data according to the launch time, and aligning the time series data of all IDs according to the launch period.
[0063] Preferably, in step (1), the data processing also includes data cleaning, that is, before data alignment, removing the time series data before listing from the sample data.
[0064] Preferably, in step (1), the method of using a clustering method to divide all samples into several major categories specifically comprises: calculating the similarity between the sample sequence and the remaining samples, selecting the most similar ones as the same type, and repeating this operation to divide the samples into several major categories;
[0065] The life cycle includes characteristics such as the amount of change and the trend of change.
[0066] Better, see Figure 2 In step (2), the neural network model includes an input layer, two hidden layers, and finally a softmax function is added to output the probability of increasing, decreasing or unchanged.
[0067] Better, participate Figure 3 , step (3) specifically includes:
[0068] The first step is to calculate the trend probability of the sample when the major trend direction occurs based on the conditional probability, as shown in formula (1):
[0069]
[0070] Among them, B i represents the change trend of a single sample in the i-th period of the life cycle, C i Indicates the changing trend of the major categories of data in the i-th cycle of the life cycle, P(B i |C i ) indicates that in the major trend C i In the case of occurrence, the trend of the sample B i The probability of occurrence, P(C i ) indicates that the change trend of the sample category is C i The probability of i C i ) means that in the same period, the sample trend B i and major trend C i Probability of simultaneous occurrence;
[0071] The second step is to learn the change trend b of the future i-th cycle in the sub-network according to its own change characteristics. i , combining the changes of the sample itself with the changes of the major categories to learn the probability of the final sample's downward or upward trend, as shown in formula (2):
[0072] P B =w1*P(B i |C i )+w2*P(bi ) (2)
[0073] Among them, P B Indicates the final probability of the sample changing trend, P(b i ) represents the probability of the changing trend of the sample after learning, w1 and w2 represent the corresponding weight coefficients, which are the optimal values obtained through training and learning; the role of formula (2) is to adjust P B The loss between the actual value and the numerical value of learning parameters w1 and w2;
[0074] In the third step, after determining the sample change trend, the magnitude of the change is determined by formula (3):
[0075] Δy i =w1*y c +w2*Δy i-1 (3)
[0076] Among them, Δy i represents the predicted value of the sample change in the i-th period; y c Represents the change of a major category in the same listing cycle; the values of parameters w1 and w2 are the optimal values of the second step training; the initial value Δy1 is set to 0;
[0077] The fourth step is to determine the magnitude of the change and then predict the sample according to formula (4):
[0078] y i =y i-1 +Δy i (4)
[0079] Among them, y i-1 Represents the known value of the (i-1)th period of a single sample life cycle; y i Represents the predicted value of the i-th period of the life cycle.
[0080] Preferably, step 4 specifically includes:
[0081] Suppose the prediction time point is t, the time length to be predicted is N (in the example in the figure, N is 6), and the predicted value after time t is Y f ={y1,y2,…,y N}, the mean of the N predicted values is
[0082] Calculate the mean of every N values before the predicted time point to get the mean sequence Among them, the mean of the N values before the prediction time point t is used The calculation method is shown in formula (5):
[0083]
[0084] Among them, y t-i Indicates the value at time (ti);
[0085] According to formula (6), the proportion of sample natural months is calculated as r m ={r1,r2,...,r 12},
[0086]
[0087] in, represents the mean of the sample in the ith natural month, represents the sample mean of all time;
[0088] According to the predicted mean The mean of the previous N values The difference between , adjust the prediction results:
[0089] if Adjust the predicted value according to formula (7);
[0090]
[0091] if Adjust the predicted value according to formula (8)
[0092]
[0093] Among them, y c Represents the amount of change in a major category during the same listing cycle; and Represents the corresponding weight coefficient, which is the optimal value obtained through training and learning; Represents the revised forecast value.
[0094] The preferred embodiments of the present invention have been specifically described above, but the present invention is not limited to the embodiments. Those skilled in the art may make various equivalent modifications or substitutions without departing from the innovation of the present invention. These equivalent modifications or substitutions are all included in the scope defined by the claims of this application.
Claims
1. A long-term time series prediction method based on life cycle mutual learning, characterized in that: Includes steps: (1) Collect sample data and process the data, use clustering methods to divide all samples into several categories, and then learn the life cycle of each category; The sample data includes multiple pieces of data, each piece of data includes a data ID, an accessory model SKU, the time of listing of the SKU, and time series data of each ID, and the time series data is data with a natural month as the time granularity; (2) A single sample uses a neural network model to learn its own characteristics and obtain the changing trend characteristics of the sample itself; (3) Select the life cycle of the major category to which the sample belongs, and use the life cycle of the major category to guide the overall change trend of the sample through mutual learning. The sample adjusts itself through its own characteristics and finally obtains the prediction results, including: The first step is to calculate the trend probability of the sample when the major trend direction occurs based on the conditional probability, as shown in formula (1): Among them, B i represents the change trend of a single sample in the i-th period of the life cycle, C i Indicates the changing trend of the major categories of data in the i-th cycle of the life cycle, P(B i |C i ) indicates that in the major trend C i In the case of occurrence, the trend of the sample B i The probability of occurrence, P(C i ) indicates that the change trend of the sample category is C i The probability of i C i ) means that in the same period, the sample trend B i and major trend C i Probability of simultaneous occurrence; The second step is to learn the change trend b of the future i-th cycle in the sub-network according to its own change characteristics. i , combining the changes of the sample itself with the changes of the major categories to learn the probability of the final sample's downward or upward trend, as shown in formula (2): P B =w1*P(B i |C i )+w2*P(b i ) (2) Among them, P B Indicates the final probability of the sample changing trend, P(b i ) represents the probability of the changing trend of the sample after learning, w1 and w2 represent the corresponding weight coefficients, which are the optimal values obtained through training and learning; In the third step, after determining the sample change trend, the magnitude of the change is determined by formula (3): Δy i =w1*y c +w2*Δy i-1 (3) Among them, Δy i represents the predicted value of the sample change in the i-th period; y c Represents the change of a major category in the same listing cycle; the values of parameters w1 and w2 are the optimal values of the second step training; the initial value Δy1 is set to 0; The fourth step is to determine the magnitude of the change and then predict the sample according to formula (4): y i =y i-1 +Δy i (4) Among them, y i-1 Represents the known value of the (i-1)th period of a single sample life cycle; y i represents the predicted value of the i-th period of the life cycle; (4) Analyze the changes in the samples through the sample's own interval mean model, build a correction model to correct the prediction results, further improve the accuracy of the model, and finally complete the prediction of the future time point of the time series data. The prediction is to predict demand and / or inventory levels in the supply chain, including: Suppose the prediction time point is t, the time length to be predicted is N, and the prediction value after time t is Y f ={y1, y2, ..., y N }, the mean of the N predicted values is Calculate the mean of every N values before the predicted time point to get the mean sequence Among them, the mean of the N values before the prediction time point t is used The calculation method is shown in formula (5): Among them, y t-i Indicates the value at time (ti); According to formula (6), the proportion of sample natural months is calculated as r m ={r1, r2, ..., r 12 }, in, represents the mean of the sample in the ith natural month, represents the sample mean of all time; According to the predicted mean The mean of the previous N values The difference between , adjust the prediction results: if Adjust the predicted value according to formula (7); if Adjust the predicted value according to formula (8) Among them, y c Represents the amount of change in a major category during the same listing cycle; and Represents the corresponding weight coefficient, which is the optimal value obtained through training and learning; Represents the revised forecast value.
2. The method according to claim 1, characterized in that In step (1), the data processing includes data alignment, that is, calculating the launch period corresponding to each ID time series data according to the launch time, and aligning the time series data of all IDs according to the launch period.
3. The method according to claim 2, characterized in that In step (1), the data processing also includes data cleaning, that is, before data alignment, the time series data before listing is removed from the sample data.
4. The method according to claim 3, characterized in that In step (1), the method of using a clustering method to divide all samples into several major categories is specifically as follows: calculating the similarity between the sample sequence and the remaining samples, selecting the most similar ones as the same type, and repeating this operation to divide the samples into several major categories; The life cycle includes a change amount and a change trend.
5. The method according to claim 4, characterized in that In step (2), the neural network model includes an input layer, two hidden layers, and finally a softmax function is added to output the probability of increasing, decreasing or unchanged.
