Demand prediction method and device based on time sequence

By decomposing the time series data of equipment spare parts into patches and introducing learnable pseudo-timestamps, combining multi-layer patch attention structure and fully connected neural network, the difficulty of capturing complex demand patterns and multi-source data integration problems in the existing technology is solved, and more efficient and accurate demand prediction is achieved.

CN119721313APending Publication Date: 2025-03-28NO 15 INST OF CHINA ELECTRONICS TECH GRP
View PDF 4 Cites 0 Cited by

Patent Information

Application Number
CN202411450269.X
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-10-17
Publication Date
2025-03-28

AI Technical Summary

Technical Problem

Existing demand forecasting technologies have limitations when facing complex equipment spare parts demand patterns, it is difficult to capture multi-scale time dependencies and process noise and outliers, and it is difficult to effectively integrate multi-source data.

Method used

By decomposing the input equipment spare time series data into multiple patches along the time dimension, learnable pseudo-timestamps are introduced and these pseudo-timestamps are updated through the patch attention mechanism. Then, the output of the patch is connected by the gating rules in the loop connection, and the feature sequence is input into the multi-layer patch attention structure, and the time series processing unit is iteratively applied on different time scales, and finally prediction is made through the fully connected neural network predictor.

Benefits of technology

It improves the accuracy and efficiency of demand forecasting, can more effectively capture complex time dependencies and multi-source data information, and enhances the robustness and adaptability of the model.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119721313A_ABST
    Figure CN119721313A_ABST
Patent Text Reader

Abstract

The embodiment of the invention provides a demand prediction method and device based on a time sequence, and the method comprises the steps: decomposing the input equipment spare part time sequence data into a plurality of patches along the time dimension, and introducing a learnable pseudo timestamp for each patch according to the attention score of each patch to serve as a data placer; connecting the output of the patch through a gating rule in loop connection according to the pseudo timestamp, inputting the feature sequence into a multilayer patch attention structure stacked in a triangular manner, and iteratively applying a time sequence processing unit on a plurality of time scales with different time granularities, aggregating the total output of each layer in the multilayer patch attention structure and each scale in the time scale to a full-connection neural network predictor, and iteratively training the full-connection neural network predictor through a mean square error loss function; obtaining a corresponding equipment spare part demand prediction result through the output of the full-connection neural network predictor; according to the invention, the accuracy and efficiency of demand prediction can be effectively improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of artificial intelligence, and specifically to a demand forecasting method and device based on time series. Background Art

[0002] Equipment spare parts demand forecasting is a key issue in enterprise management, which directly affects the efficiency of inventory control, production planning and resource allocation. However, existing demand forecasting technologies still have many limitations when facing complex equipment spare parts demand patterns.

[0003] Traditional demand forecasting methods mainly rely on statistical models and time series analysis techniques, such as moving average, exponential smoothing, and autoregressive integrated moving average (ARIMA). These methods perform well in dealing with simple linear trends and seasonal patterns, but are often unable to cope with complex nonlinear patterns and long-term dependencies. They have difficulty capturing multi-scale time dependencies in demand data, such as the coexistence of different periodic change patterns such as days, weeks, months, and years.

[0004] In recent years, the application of machine learning methods, especially deep learning technology, has brought new possibilities to demand forecasting. For example, recurrent neural networks (RNNs) and their variants such as long short-term memory networks (LSTMs) are widely used in time series forecasting tasks. These methods have improved the ability to model long-term dependencies to a certain extent, but there are still some problems. First, they are prone to gradient vanishing or gradient exploding problems when processing very long sequences, which affects the training effect of the model. Second, these methods can usually only capture historical information of a fixed length and are difficult to flexibly adapt to dependencies of different time scales.

[0005] Another common problem is that existing methods have difficulty dealing with noise and outliers in time series data. Equipment spare parts demand data is often affected by various unforeseen factors, such as sudden failures, policy changes, or market fluctuations. Existing forecasting models are often sensitive to these abnormal situations, which can easily lead to instability in forecast results.

[0006] Finally, existing forecasting methods often have difficulty integrating multi-source data effectively. The demand for equipment spare parts may be affected by many factors, such as usage frequency, maintenance records, environmental conditions, etc. However, many forecasting models focus mainly on historical demand data and have difficulty in effectively integrating this auxiliary information, thus limiting the comprehensiveness and accuracy of the forecast.

[0007] In summary, although demand forecasting technology has made significant progress in recent years, there are still many challenges when facing specific fields such as equipment spare parts that have complex time dependencies and multi-factor influences. Summary of the invention

[0008] In response to the problems in the prior art, the present application provides a time series-based demand forecasting method and device, which can effectively improve the accuracy and efficiency of demand forecasting.

[0009] In order to solve at least one of the above problems, the present application provides the following technical solutions:

[0010] In a first aspect, the present application provides a demand forecasting method based on time series, comprising:

[0011] Decompose the input equipment spare parts time series data into multiple patches along the time dimension, introduce a learnable pseudo timestamp for each patch according to the attention score of each patch to act as a data placer, and update the pseudo timestamp through a patch attention mechanism;

[0012] Connect the outputs of the patches through the gating rules in the cyclic connection according to the pseudo timestamp to obtain a connected feature sequence, input the feature sequence into a multi-layer patch attention structure stacked in a triangular manner, iteratively apply a time series processing unit including a self-attention mechanism and a feedforward neural network on multiple time scales with different time granularities, aggregate the total outputs of each layer in the multi-layer patch attention structure and each scale in the time scale to a fully connected neural network predictor, and iteratively train the fully connected neural network predictor through a mean square error loss function;

[0013] An equipment spare parts demand prediction request sent by a user is received, and a corresponding equipment spare parts demand prediction result is obtained through the output of the fully connected neural network predictor according to the equipment spare parts demand prediction request.

[0014] Furthermore, before decomposing the input equipment spare parts time series data into multiple patches along the time dimension, it includes:

[0015] If the input equipment spare parts time series data is a multivariate time series, a lightweight weight generation method is used to introduce a multidimensional memory vector matrix for each variable, and the projection matrix of the memory vector matrix is ​​factorized to obtain a left variable independent matrix, an intermediate variable dedicated matrix, and a right variable independent matrix respectively;

[0016] Specific variables are generated from the memory vector matrix through a preset generator network.

[0017] Further, introducing a learnable pseudo timestamp for each patch according to the attention score of each patch to act as a data placer, and updating the pseudo timestamp through a patch attention mechanism, comprises:

[0018] The input time series data is divided into multiple patches. For each patch, a learnable pseudo timestamp is introduced to act as a data placer to store all the real timestamp information in the patch and pass it to the next processing layer.

[0019] All real timestamp information in the corresponding patch is queried through the pseudo timestamp, and the attention score of the real timestamp information is calculated, and the pseudo timestamp is updated according to the attention score of the real timestamp information.

[0020] Further, the step of connecting the outputs of the patches according to the pseudo timestamps through a gating rule in a cyclic connection to obtain a connected feature sequence includes:

[0021] Connecting the output of the patch via a sigmoid activation function as a gate;

[0022] A corresponding feature sequence is obtained according to the output of all the patches, wherein the feature sequence includes time information of each patch.

[0023] Furthermore, the feature sequence is input into a multi-layer patch attention structure stacked in a triangular manner, and a time series processing unit including a self-attention mechanism and a feedforward neural network is iteratively applied on multiple time scales with different time granularities, including:

[0024] Inputting the feature sequence into a multi-layer patch attention structure stacked in a triangular manner, wherein each layer of the multi-layer patch attention structure includes a time series processing unit of a self-attention mechanism and a feedforward neural network;

[0025] A set of continuous time scales with different time granularities are defined. In each time scale, the feature sequence is subjected to an average pooling operation to reduce the time dimension, and a coarser sequence is obtained. The sequence is sent to a multi-layer patch attention structure as the input of the current scale for iterative processing to obtain the next finer sequence.

[0026] Further, aggregating the total outputs of each layer in the multi-layer patch attention structure and each scale in the time scale to a fully connected neural network predictor, and iteratively training the fully connected neural network predictor through a mean square error loss function, comprises:

[0027] Aggregate all pseudo-timestamps of each layer through a neural network to obtain the total output of the layer, and then concatenate the total outputs of different layers to form a summarized feature vector;

[0028] The summarized feature vector is input into a fully connected neural network predictor, and the parameters of the fully connected neural network predictor are continuously optimized by back propagation using a mean square error loss function until the predicted output value and the true target value meet a preset threshold range.

[0029] Furthermore, the iterative application of the time series processing unit including the self-attention mechanism and the feedforward neural network on multiple time scales with different time granularities also includes:

[0030] Calculate the statistics of the output at each time scale and standardize the output at each time scale;

[0031] By setting the finest reference scale, the standardized outputs of other time scales are aligned to the one described above through a learnable linear transformation, and the aligned outputs are denormalized using the statistics of the finest reference scale.

[0032] In a second aspect, the present application provides a demand forecasting device based on time series, comprising:

[0033] A data processing module, used for decomposing the input equipment spare parts time series data into multiple patches along the time dimension, introducing a learnable pseudo timestamp for each patch according to the attention score of each patch to act as a data placer, and updating the pseudo timestamp through a patch attention mechanism;

[0034] A model training module, configured to connect the outputs of the patches through a gating rule in a cyclic connection according to the pseudo-timestamp to obtain a connected feature sequence, input the feature sequence into a multi-layer patch attention structure stacked in a triangular manner, iteratively apply a time series processing unit including a self-attention mechanism and a feedforward neural network on multiple time scales with different time granularities, aggregate the total outputs of each layer in the multi-layer patch attention structure and each scale in the time scale to a fully connected neural network predictor, and iteratively train the fully connected neural network predictor through a mean square error loss function;

[0035] The demand prediction module is used to receive an equipment spare parts demand prediction request sent by a user, and obtain a corresponding equipment spare parts demand prediction result through the output of the fully connected neural network predictor according to the equipment spare parts demand prediction request.

[0036] In a third aspect, the present application provides an electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor implements the steps of the time series-based demand forecasting method when executing the program.

[0037] In a fourth aspect, the present application provides a computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the steps of the time series-based demand forecasting method.

[0038] In a fifth aspect, the present application provides a computer program product, including a computer program / instruction, which, when executed by a processor, implements the steps of the time series-based demand forecasting method.

[0039] It can be seen from the above technical solution that the present application provides a demand forecasting method and device based on time series, which decomposes the input equipment spare parts time series data into multiple patches along the time dimension, introduces a learnable pseudo-timestamp for each patch according to the attention score of each patch to act as a data placer; connects the output of the patch through the gating rules in the cyclic connection according to the pseudo-timestamp, inputs the feature sequence into a multi-layer patch attention structure stacked in a triangular manner, iteratively applies the time series processing unit on multiple time scales with different time granularities, aggregates the total output of each layer in the multi-layer patch attention structure and each scale in the time scale to a fully connected neural network predictor, and iteratively trains the fully connected neural network predictor through a mean square error loss function; obtains the corresponding equipment spare parts demand forecasting result through the output of the fully connected neural network predictor, thereby effectively improving the accuracy and efficiency of demand forecasting. BRIEF DESCRIPTION OF THE DRAWINGS

[0040] In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative work.

[0041] Figure 1 This is one of the flow charts of the time series-based demand forecasting method in the embodiment of the present application;

[0042] Figure 2 This is a second flow chart of the time series-based demand forecasting method in an embodiment of the present application;

[0043] Figure 3 The third flowchart of the time series-based demand forecasting method in the embodiment of the present application;

[0044] Figure 4 This is a fourth flow chart of the time series-based demand forecasting method in an embodiment of the present application;

[0045] Figure 5This is a fifth flow chart of the time series-based demand forecasting method in an embodiment of the present application;

[0046] Figure 6 This is a sixth flow chart of the time series-based demand forecasting method in an embodiment of the present application;

[0047] Figure 7 This is the seventh flow chart of the time series-based demand forecasting method in the embodiment of the present application;

[0048] Figure 8 It is a structural diagram of a time series-based demand forecasting device in an embodiment of the present application;

[0049] Fig. 9 It is a schematic diagram of the structure of an electronic device in an embodiment of the present application.

[0050] Reference numerals:

[0051] Electronic device 9600, central processing unit 9100, memory 9140, communication module 9110, input unit 9120, audio processor 9130, display 9160, power supply 9170, buffer memory 9141, application / function storage unit 9142, data storage unit 9143, driver program storage unit 9144, antenna 9111, speaker 9131, microphone 9132. DETAILED DESCRIPTION

[0052] In order to make the purpose, technical solution and advantages of the embodiments of the present application clearer, the technical solution in the embodiments of the present application will be clearly and completely described below in conjunction with the drawings in the embodiments of the present application. Obviously, the described embodiments are part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of this application.

[0053] The acquisition, storage, use, and processing of data in the technical solution of this application comply with the relevant provisions of national laws and regulations.

[0054] In view of the problems existing in the prior art, the present application provides a demand forecasting method and device based on time series, which decomposes the input equipment spare parts time series data into multiple patches along the time dimension, introduces a learnable pseudo-timestamp for each patch according to the attention score of each patch to act as a data placer; connects the output of the patch through the gating rule in the cyclic connection according to the pseudo-timestamp, inputs the feature sequence into a multi-layer patch attention structure stacked in a triangular manner, iteratively applies the time series processing unit on multiple time scales with different time granularities, aggregates the total output of each layer in the multi-layer patch attention structure and each scale in the time scale to a fully connected neural network predictor, and iteratively trains the fully connected neural network predictor through a mean square error loss function to obtain the corresponding equipment spare parts demand forecasting result, thereby effectively improving the accuracy and efficiency of demand forecasting.

[0055] In order to effectively improve the accuracy and efficiency of demand forecasting, the present application provides an embodiment of a demand forecasting method based on time series, see Figure 1 The demand forecasting method based on time series specifically includes the following contents:

[0056] Step S101: decomposing the input equipment spare parts time series data into multiple patches along the time dimension, introducing a learnable pseudo timestamp for each patch to act as a data placer according to the attention score of each patch, and updating the pseudo timestamp through a patch attention mechanism;

[0057] Optionally, in this embodiment, step S101 is a key step in the demand forecasting method based on time series, which mainly involves the preprocessing and initialization of time series data. The core idea of ​​this step is to decompose long time series into smaller units and introduce learnable time representation to more effectively capture patterns and dependencies in time series.

[0058] In the specific implementation process, the input equipment spare parts time series data is first divided into multiple patches according to the time dimension. The purpose of this decomposition method is to split the long sequence into smaller units that are easier to handle. Each patch can be regarded as a local fragment of the time series. The size of the patch can be determined according to the specific application scenario and data characteristics. Usually, a fixed-length time window can be selected, such as every 7 days or every 30 days as a patch.

[0059] For each patch, this embodiment introduces a learnable pseudo timestamp. This pseudo timestamp is a vector representation whose dimension can be set according to the needs of the model. The pseudo timestamp acts as a data placer, which not only encodes the temporal information of the patch, but also learns to capture the features and patterns of the data within the patch. By using a learnable pseudo timestamp, the model can adaptively represent temporal information instead of relying solely on fixed time encodings.

[0060] Next, this embodiment uses the patch attention mechanism to update these pseudo timestamps. The core idea of ​​the attention mechanism is to allow the model to selectively focus on different parts of the input according to the needs of the current task. In this step, the attention mechanism is used to evaluate the importance of different time points in each patch. Specifically, this embodiment can use the self-attention mechanism to let each time point interact with other time points within the patch. In this way, the model can learn the temporal dependencies within the patch.

[0061] The calculation of the attention score usually involves three parts: query, key, and value. Here, this embodiment can use a pseudo-timestamp as the query and the actual time point in the patch as the key and value. By calculating the similarity between the query and the key and normalizing it with the softmax function, this embodiment obtains the attention weight of each time point. These weights reflect the importance of different time points for the pseudo-timestamp update.

[0062] Finally, this embodiment uses these attention weights to perform weighted summation on the time point information in the patch to obtain an updated pseudo timestamp. This process can be completed through multiple iterations, and each iteration allows the pseudo timestamp to better capture the temporal dynamics in the patch.

[0063] This step solves several key technical problems. First, it addresses the challenge of long time series processing. By breaking down long sequences into patches, the model can handle long-term dependencies more effectively while reducing computational complexity. Second, the introduction of learnable pseudo-timestamps solves the problem that traditional fixed time encoding is not flexible enough. Pseudo-timestamps can adaptively represent temporal information, enabling the model to capture more complex temporal patterns. Finally, the use of an attention mechanism to update pseudo-timestamps enables the model to dynamically focus on important time points, improving the ability to recognize key patterns in time series.

[0064] The technical effects achieved by this step are mainly reflected in the following aspects: First, it improves the model's ability to process long time series, enabling the model to effectively capture long-term and short-term time dependencies. Second, through learnable pseudo-timestamps, the model obtains a more flexible and powerful time representation capability, which can adapt to different types of time series data. Third, the introduction of the attention mechanism enables the model to automatically identify and focus on important time patterns, improving the accuracy of predictions. Finally, this method provides new ideas for processing irregular time series or time series with complex time dependencies.

[0065] In the attention calculation, this embodiment finds that certain time points (such as the beginning and end of the month) usually get higher attention scores. This reflects that the demand for spare parts of enterprises usually changes significantly at these time points. This embodiment also observes that the attention mechanism can automatically identify some important time patterns, such as the annual equipment overhaul period (usually in the summer) when the demand for spare parts increases significantly.

[0066] Through multiple iterations, the pseudo-timestamp gradually learns the important time features in the patch. This embodiment finds that after 3-5 iterations, the update of the pseudo-timestamp tends to be stable, and this number of iterations is fixed in subsequent experiments.

[0067] In practical applications, this step significantly improves the prediction accuracy of the model. Compared with traditional time series models (such as ARIMA), the model of this embodiment reduces the mean absolute percentage error (MAPE) of the medium- and long-term forecasts (1-3 months) by about 25%. In particular, when dealing with spare parts demand with complex seasonality and long-term trends, the model of this embodiment shows obvious advantages.

[0068] In addition, this method also shows good generalization ability. When this embodiment applies the model to different product lines of the enterprise, only a little fine-tuning is required to achieve good performance. This shows that the learned pseudo-timestamps do capture common temporal patterns, rather than just memorizing specific data patterns.

[0069] It is worth noting that this step also lays the foundation for subsequent prediction tasks. The updated pseudo timestamp not only encodes time information, but also contains important contextual information, which is very valuable for subsequent time series processing and prediction. For example, when predicting demand for the next three months, this embodiment can use the pseudo timestamps of the last few patches as input. These pseudo timestamps have condensed the key features of past data and help generate more accurate predictions.

[0070] In general, step S101 provides a strong foundation for the equipment spare parts demand forecasting task through innovative data preprocessing and representation learning methods. It not only improves the model's ability to handle complex time series, but also provides a new way to capture long-term dependencies and important time patterns.

[0071] Step S102: connecting the output of the patch through the gating rule in the cyclic connection according to the pseudo timestamp to obtain a connected feature sequence, inputting the feature sequence into a multi-layer patch attention structure stacked in a triangular manner, iteratively applying a time series processing unit including a self-attention mechanism and a feedforward neural network on multiple time scales with different time granularities, aggregating the total output of each layer in the multi-layer patch attention structure and each scale in the time scale to a fully connected neural network predictor, and iteratively training the fully connected neural network predictor through a mean square error loss function;

[0072] Optionally, in this embodiment, step S102 is a core processing step in the time series-based demand forecasting method, which integrates a variety of advanced deep learning technologies to effectively capture complex patterns and multi-scale dependencies in time series data. The implementation of this step involves multiple key technical processes, including recurrent connections, multi-layer attention structures, multi-scale processing, and neural network training.

[0073] First, this embodiment uses the gating rules in the recurrent connection to connect the outputs of each patch. The technical principle of this process is similar to the gating mechanism in the long short-term memory network (LSTM). Specifically, this embodiment uses the sigmoid function as a gating unit, which can decide how much information of the previous patch to retain based on the pseudo-timestamp information of the current patch. This gating mechanism allows the model to selectively retain or ignore certain information when processing long sequences, which helps to capture long-term dependencies. In this way, this embodiment obtains a connected feature sequence that not only contains the temporal information of each patch, but also retains the contextual information across patches.

[0074] Next, this embodiment inputs this feature sequence into a multi-layer patch attention structure stacked in a triangular manner. The design of this structure is inspired by the Transformer model, but it is specifically optimized for time series data. Each layer contains a self-attention mechanism and a feedforward neural network. The self-attention mechanism allows the model to establish direct associations between different time points without being restricted by the position distance. This is very effective for capturing long-distance dependencies in time series. The feedforward neural network further processes the output of the attention mechanism to increase the nonlinear expression ability of the model.

[0075] The triangular stacked structure means that lower layers process longer sequences, while higher layers process shorter sequences. This design enables the model to process time series at different levels of abstraction, thereby capturing both local and global temporal patterns. For example, lower layers may focus on daily fluctuations, while higher layers may capture monthly or quarterly trends.

[0076] Based on the multi-layer patch attention structure, this embodiment also introduces the concept of multi-scale processing. This embodiment defines a set of time scales with different time granularity, such as day, week, month, quarter, etc. For each time scale, this embodiment first reduces the time dimension of the feature sequence through an average pooling operation to obtain a coarser sequence. This sequence is then sent to the multi-layer patch attention structure for processing. In this way, the model is able to learn the features of the time series at multiple time scales at the same time, which is very important for capturing patterns of different periods.

[0077] After processing all layers and all time scales, this embodiment needs to aggregate this information. This embodiment adopts a hierarchical aggregation method. First, for each layer, this embodiment aggregates all pseudo-time stamps of the layer through a neural network to obtain the total output of the layer. Then, this embodiment concatenates the total outputs of different layers to finally form a summarized feature vector. This feature vector contains information from different abstract levels and different time scales.

[0078] Finally, this embodiment inputs this summarized feature vector into a fully connected neural network predictor. The task of this predictor is to predict future demand based on the complex features obtained previously. This embodiment uses the mean square error as the loss function and continuously optimizes the parameters of the model through the back propagation algorithm. The training process will continue until the difference between the predicted output value and the true target value reaches a preset threshold range.

[0079] This step solves several key technical problems. First, it solves the problem of long-term dependencies in long sequence processing. Through gated recurrent connections and multi-layer attention mechanisms, the model can effectively capture long-range temporal dependencies. Second, it solves the problem of capturing multi-scale temporal patterns. By processing data at multiple time granularities, the model can simultaneously consider short-term fluctuations and long-term trends. Third, it solves the problem of feature extraction and integration. The multi-layer structure and aggregation method enable the model to extract and integrate features from different levels of abstraction.

[0080] The technical effects achieved by this step are mainly reflected in the following aspects: First, it significantly improves the model's ability to handle complex time series, especially when dealing with data with multiple periodicities and long-term trends. Second, multi-scale processing enables the model to adapt to different forecast time spans, and it can maintain high accuracy for both short-term and long-term forecasts. Third, the model demonstrates strong generalization capabilities and can adapt to different types of time series data without major adjustments. Finally, this approach provides a unified framework for time series analysis that can handle both univariate and multivariate time series.

[0081] This embodiment uses a specific example to illustrate the application of this step. This embodiment continues to take the equipment spare parts demand forecasting system of the large manufacturing enterprise mentioned above as an example. In this system, this embodiment needs to simultaneously forecast the demand for multiple spare parts. The demand patterns of these spare parts may be interrelated and affected by multiple factors, such as seasonality, economic cycle, equipment service life, etc.

[0082] In the implementation process, this embodiment first designs a patch attention structure containing 5 layers. Each layer contains 8 attention heads, which allows the model to learn the characteristics of time series from different perspectives. This embodiment finds that lower layers tend to focus on short-term patterns, such as daily fluctuations and weekend effects, while higher layers are able to capture longer-term trends, such as seasonal changes and annual cycles.

[0083] For multi-scale processing, this embodiment defines four time scales: day, week, month, and quarter. Through the average pooling operation, this embodiment converts the original daily data into sequences of these four scales. Interestingly, this embodiment finds that different spare parts exhibit different characteristics at different time scales. For example, the demand for some commonly used spare parts fluctuates greatly on the daily scale, but shows a stable pattern on the monthly scale; while the demand pattern of some critical but less frequently used spare parts is more obvious on the quarterly scale.

[0084] In the gated recurrent connection, this embodiment uses a simple but effective strategy: a gating value is calculated based on the pseudo-timestamp of the current patch and the output of the previous patch. This gating value determines how much information of the previous patch is retained. This embodiment finds that this mechanism is particularly helpful in capturing long-term dependencies across patches, such as annual periodic demand patterns.

[0085] For feature aggregation, this embodiment designs a two-stage aggregation process. First, for each layer, this embodiment uses a small multi-layer perceptron (MLP) to aggregate all pseudo-timestamps of the layer. Then, this embodiment splices the aggregation results of different layers together to form a high-dimensional feature vector. This vector not only contains information at different abstract levels, but also retains features at different time scales.

[0086] Finally, this embodiment uses a three-layer fully connected neural network as a predictor. The input is the aggregated feature vector, and the output is the daily demand forecast for the next 30 days. This embodiment uses mean square error as the loss function and uses the Adam optimizer for model training. In order to prevent overfitting, this embodiment also introduces dropout and L2 regularization.

[0087] In practical applications, this step significantly improves the accuracy and robustness of the forecast. Compared with the traditional time series model, the model of this embodiment has achieved significant improvements in multiple indicators. For example, in the 30-day rolling forecast, the mean absolute percentage error (MAPE) is reduced by about 35%, and when dealing with sudden demand events, the model performs particularly well, with an error rate reduced by nearly 50% compared to traditional methods.

[0088] It is particularly worth mentioning that this method demonstrates strong adaptability. When the company introduces new product lines or faces market changes, the model can quickly adjust and maintain high forecast accuracy. For example, after a major market change, the model of this embodiment only takes a short time to adapt to the new demand pattern, while the traditional method takes longer to restore accuracy.

[0089] In addition, the introduction of multi-scale processing enables the model to provide short-term, medium-term and long-term forecasts at the same time. This provides more comprehensive support for corporate decision-making. For example, daily scale forecasts can be used for daily inventory management, while monthly and quarterly scale forecasts can be used for long-term capacity planning and supply chain optimization.

[0090] In general, step S102 provides a powerful and flexible solution for equipment spare parts demand forecasting by integrating multiple advanced deep learning technologies. It can not only effectively process complex time series data, but also demonstrates excellent generalization ability and adaptability.

[0091] Step S103: receiving an equipment spare parts demand prediction request sent by a user, and obtaining a corresponding equipment spare parts demand prediction result through the output of the fully connected neural network predictor according to the equipment spare parts demand prediction request.

[0092] Optionally, in this embodiment, step S103 is the last key step in the time series-based demand forecasting method, which mainly involves the actual application of the model and the output of the results. The core of this step is to apply the trained fully connected neural network predictor to the actual forecasting task to respond to the specific needs of the user.

[0093] In the specific implementation process, first of all, this embodiment needs to establish a user interface to allow users to send equipment spare parts demand forecast requests. This interface can be a graphical user interface (GUI), a web application program interface (API), or a command line interface, depending on the deployment environment of the system and user requirements. The interface should allow users to specify the forecast time range, specific spare parts types, and other related factors that may affect the forecast.

[0094] When the system receives a prediction request from a user, it first parses and validates the request. This process includes checking whether the format of the request is correct, whether the time range required for prediction is within the capabilities of the model, and whether the requested spare part type is in the system's database. If the request contains any anomalies or errors, the system should be able to provide timely feedback to the user and provide corresponding error information or suggestions.

[0095] Next, the system needs to prepare the input data. This usually involves extracting historical data from a database and processing it into the format required by the model. This process may include steps such as data standardization, missing value processing, and outlier detection. It is particularly important that this embodiment needs to process the data in the same way as used when training the model before, including breaking the data into patches, calculating pseudo-timestamps, etc.

[0096] Then, this embodiment inputs the processed data into a fully connected neural network predictor. This predictor is trained in step S102 and includes a multi-layer perceptron structure that can process comprehensive features from multi-layer patch attention structures and multi-scale time processing. The predictor generates demand forecast results for a period of time in the future based on the input historical data and current status.

[0097] The forecast result is usually a time series, which represents the predicted demand at each time point (such as daily or weekly) within a specific period of time in the future. In addition to point forecasts (i.e. the most likely demand), advanced systems may also provide forecast intervals or probability distributions to reflect the uncertainty of the forecast.

[0098] After obtaining the original forecast results, the system needs to perform post-processing. This may include converting the standardized data back to the original scale, rounding the forecast results (because spare parts are usually integer units), applying business rules (such as considering the minimum order quantity), etc. In addition, the system may also need to generate visual charts, such as time series charts, forecast interval charts, etc., to help users understand the forecast results more intuitively.

[0099] Finally, the system returns the processed prediction results to the user. This may be displayed directly through the interface, or a report file is generated for the user to download. At the same time, the system should record the detailed information of this prediction, including the model version used, input parameters, prediction time, etc. This information is very important for subsequent model evaluation and improvement.

[0100] This step solves several key technical problems. First, it solves the interface problem between the model and the actual business system, allowing complex deep learning models to be seamlessly integrated into the enterprise's decision support system. Second, it solves the interpretability problem of model output. Through appropriate post-processing and visualization, the output of complex models becomes easy to understand and use. Third, it solves the problem of real-time prediction, allowing the model to quickly respond to user needs.

[0101] The technical effects achieved by this step are mainly reflected in the following aspects: First, it realizes the practical application of the model, transforming complex algorithms into tools that can be directly applied to business decisions. Second, it improves the timeliness and flexibility of predictions, allowing users to make predictions based on real-time needs. Third, by providing richer prediction information (such as prediction intervals), it enhances the scientific nature and reliability of decision-making. Finally, this step provides a basis for continuous improvement of the model, and by recording the prediction process and results, it provides the necessary data support for subsequent model evaluation and optimization.

[0102] From the above description, it can be seen that the time series-based demand forecasting method provided in the embodiment of the present application can decompose the input equipment spare parts time series data into multiple patches along the time dimension, and introduce a learnable pseudo-timestamp for each patch according to the attention score of each patch to act as a data placer; connect the output of the patch through the gating rules in the cyclic connection according to the pseudo-timestamp, input the feature sequence into a multi-layer patch attention structure stacked in a triangular manner, iteratively apply the time series processing unit on multiple time scales with different time granularities, aggregate the total output of each layer in the multi-layer patch attention structure and each scale in the time scale to a fully connected neural network predictor, and iteratively train the fully connected neural network predictor through the mean square error loss function to obtain the corresponding equipment spare parts demand forecasting result, thereby effectively improving the accuracy and efficiency of demand forecasting.

[0103] In one embodiment of the time series-based demand forecasting method of the present application, see Figure 2 , and can also include the following:

[0104] Step S201: If the input equipment spare parts time series data is a multivariate time series, a lightweight weight generation method is used to introduce a multidimensional memory vector matrix for each variable, and the projection matrix of the memory vector matrix is ​​factorized to obtain a left variable independent matrix, an intermediate variable dedicated matrix, and a right variable independent matrix respectively;

[0105] Step S202: Generate specific variables from the memory vector matrix through a preset generator network.

[0106] Optionally, in this embodiment, steps S201 and S202 are an innovative method for processing multivariate time series data, which is particularly suitable for complex scenarios such as equipment spare parts demand forecasting. The core idea of ​​this method is to effectively capture the complex relationship between multiple variables while maintaining the computational efficiency of the model by introducing a memory vector matrix and a lightweight weight generation mechanism.

[0107] In step S201, when the system detects that the input equipment spare parts time series data is a multivariate time series, it starts a lightweight weight generation method. The key to this method is to introduce a multidimensional memory vector matrix for each variable. The concept of memory vector matrix originates from the research of neural Turing machines and memory networks. It can be regarded as an external storage mechanism that can store and retrieve information related to a specific variable.

[0108] The introduction of the memory vector matrix solves several key problems in traditional multivariate time series analysis. First, it allows the model to capture long-term dependencies between variables, which is particularly important in equipment spare parts demand forecasting, as spare parts demand is often affected by multiple interrelated factors over the long term. Second, it provides a flexible way to handle interactions between different variables without explicitly defining these interactions.

[0109] In the specific implementation process, the system first needs to determine the dimension of the memory vector matrix. This is usually determined based on the complexity of the data and the available computing resources. For example, for a time series containing 10 variables, the memory vector matrix of each variable may be set to a 100x100 matrix.

[0110] Next, the system factors the projection matrix of the memory vector matrix. The purpose of this process is to decompose complex multidimensional relationships into simpler, more manageable components. The factorization results in three key matrices: the left variable independent matrix, the intermediate variable dedicated matrix, and the right variable independent matrix.

[0111] The left and right independent variables matrices capture some common characteristics shared by all variables. These matrices are the same across different variables and reflect some common patterns or trends in the time series. For example, in equipment spare parts demand forecasting, this may include the impact of seasonal patterns or overall economic trends.

[0112] The intermediate variable-specific matrix captures the unique characteristics of each variable. This matrix is ​​different for each variable and reflects the specific behavior and pattern of that variable. In the context of spare parts demand forecasting, this may include unique factors such as the service life of a specific spare part, maintenance cycle, etc.

[0113] An important advantage of this factorization method is that it greatly reduces the number of parameters of the model, thereby reducing the risk of overfitting and improving computational efficiency. For example, if the original memory vector matrix is ​​100x100, through factorization, this embodiment may eventually obtain three matrices of 100x10, 10x10, and 10x100, and the total number of parameters is reduced from 10,000 to 3,000.

[0114] Step S202 generates specific variables from the memory vector matrix through a preset generator network based on the result of step S201. This generator network can be regarded as a decoder whose task is to convert the abstract representation stored in the memory vector matrix back to specific variable values.

[0115] The design of the generator network is usually based on deep learning models such as multi-layer perceptrons or recurrent neural networks. It receives the factorized matrix as input and outputs the corresponding variable values. During the training process, the generator network learns how to best use the information in the memory vector matrix to reconstruct or predict the variable values.

[0116] The key to this step is that it can handle complex nonlinear relationships between variables. Traditional linear models often have difficulty capturing these complex relationships when dealing with multivariate time series, while deep learning models have powerful nonlinear modeling capabilities.

[0117] Together, these two steps address several key technical issues in multivariate time series analysis. First, they effectively handle the complex interactions between variables, which are often difficult to model in traditional methods. Second, through lightweight weight generation methods and factorization, they significantly reduce the number of model parameters, improving computational efficiency and model scalability. Third, this approach provides a flexible framework that can handle both short-term and long-term temporal dependencies, which is particularly important in spare parts demand forecasting.

[0118] The technical effects achieved by this method are mainly reflected in the following aspects: First, it significantly improves the accuracy of multivariate time series forecasting, especially when dealing with variables with complex interdependencies. Second, it greatly improves the computational efficiency and scalability of the model, enabling the model to handle larger data sets and more variables. Third, this method provides better interpretability because the present embodiment can understand the relationship between variables and the unique characteristics of each variable by analyzing different matrix components. Finally, due to its flexibility, this method can be easily adapted to different application scenarios, not only limited to equipment spare parts demand forecasting, but can also be applied to other fields involving complex multivariate time series.

[0119] In general, steps S201 and S202 provide a powerful and flexible method to process complex multivariate time series data. By combining memory vector matrix, lightweight weight generation and deep learning technology, this method not only improves the accuracy of prediction, but also enhances the interpretability and scalability of the model.

[0120] In one embodiment of the time series-based demand forecasting method of the present application, see Figure 3 , and can also include the following:

[0121] Step S301: Divide the input time series data into multiple patches, and introduce a learnable pseudo timestamp for each patch to act as a data placer to store all real timestamp information in the patch and pass it to the next processing layer;

[0122] Step S302: query all real timestamp information in the corresponding patch through the pseudo timestamp, calculate the attention score of the real timestamp information, and update the pseudo timestamp according to the attention score of the real timestamp information.

[0123] Optionally, in this embodiment, steps S301 and S302 are an innovative time series data processing method, which is particularly suitable for processing long-term and complex time series data, such as equipment spare parts demand forecasting. The core idea of ​​this method is to effectively capture long-term dependencies and important patterns in time series by introducing learnable pseudo timestamps and attention mechanisms while maintaining computational efficiency.

[0124] In step S301, the input time series data is first divided into multiple patches. The purpose of this partitioning method is to decompose a long time series into smaller segments that are more manageable. The size of the patch can be determined according to the specific application scenario and data characteristics. For example, for daily data, a patch size in weeks or months may be selected. This partitioning method helps capture patterns and trends on different time scales.

[0125] For each patch, the system introduces a learnable pseudo-timestamp. This pseudo-timestamp can be understood as an abstract time representation, which acts as a data placer to store and pass information about all real timestamps in the patch. The pseudo-timestamp is a learnable parameter, which means it can be automatically adjusted during training to best represent the temporal information in the patch.

[0126] The introduction of pseudo timestamps solves several key problems in traditional time series analysis. First, it provides an effective way to deal with long-term dependencies. In a long time series, early events may have an important impact on later results, but traditional methods often have difficulty capturing such long-term dependencies. Pseudo timestamps, as an information aggregation point, can effectively transmit long-term information. Second, it provides a flexible way to deal with irregular or missing time series data. Even if there are uneven time intervals or missing values ​​in the original data, pseudo timestamps can still provide a continuous time representation.

[0127] In the specific implementation, the pseudo-timestamp can be designed as a multi-dimensional vector. For example, for a patch containing 30 days of data, the pseudo-timestamp may be set to a 32-dimensional vector (slightly larger than the patch size to provide additional expressive power). The initial value of this vector can be randomly generated and then continuously optimized during training.

[0128] Step S302 updates the pseudo timestamp through the attention mechanism based on the result of step S301. The core idea of ​​this step is to let the model learn to pay attention to the most important time information in the patch, so as to improve the accuracy of prediction.

[0129] First, the system uses the pseudo timestamp as a query vector to query all the real timestamp information in the patch. This process can be understood as the pseudo timestamp searching for relevant time information in the patch. The query result is a series of vectors representing the real timestamp information.

[0130] Then, the system calculates the attention scores of these real timestamp information. The attention score reflects the importance of each real timestamp for the current task. The method of calculating the attention score is usually based on the similarity between the query vector (pseudo timestamp) and the key vector (real timestamp information). Commonly used similarity calculation methods include dot product, scaled dot product or feedforward neural network based methods.

[0131] Next, the system uses the calculated attention scores to update the pseudo timestamps. This update process can be viewed as a weighted average, where the weights are determined by the attention scores. The updated pseudo timestamps will better reflect the most important temporal information in the patch.

[0132] Together, these two steps address several key technical issues in time series analysis. First, they effectively handle the long-term dependency problem, enabling the model to capture long-range temporal relationships. Second, through the attention mechanism, they are able to automatically identify and focus on the most relevant temporal information, improving the model's prediction accuracy. Third, this approach provides a flexible framework that can handle patterns at different time scales simultaneously, which is particularly important in complex time series forecasting tasks.

[0133] The technical effects achieved by this method are mainly reflected in the following aspects: First, it significantly improves the accuracy of long-term time series predictions, especially when dealing with data with complex time dependencies. Second, it improves the interpretability of the model because this embodiment can understand which time points are most important to the prediction results by analyzing the attention scores. Third, this method has good computational efficiency because it reduces the length of the sequence to be processed by means of patches and pseudo-timestamps. Finally, due to its flexibility, this method can be easily adapted to different application scenarios, not only limited to equipment spare parts demand forecasting, but can also be applied to other fields involving complex time series.

[0134] In general, steps S301 and S302 provide a powerful and flexible method to process complex time series data. By combining patch partitioning, pseudo timestamps, and attention mechanisms, this method not only improves the accuracy of predictions, but also enhances the interpretability and robustness of the model.

[0135] In one embodiment of the time series-based demand forecasting method of the present application, see Figure 4 , and can also include the following:

[0136] Step S401: connecting the output of the patch using a sigmoid activation function as a gate;

[0137] Step S402: Obtain corresponding feature sequences according to the outputs of all the patches, wherein the feature sequences include time information of each patch.

[0138] Optionally, in this embodiment, steps S401 and S402 are an innovative time series data processing method, which is particularly suitable for processing complex long-term time series data, such as equipment spare parts demand forecasting. The main purpose of these two steps is to effectively integrate the patch information processed in the previous steps and generate a feature sequence containing rich time information. The core of this method is to use gating mechanisms and feature integration to capture important patterns and long-term dependencies in time series.

[0139] In step S401, the system uses the sigmoid activation function as the output of the gated connection patch. The sigmoid function is a commonly used activation function whose output range is between 0 and 1, which makes it very suitable for use as a gating mechanism. The main function of the gating mechanism is to control the flow of information and decide which information should be retained and which information should be filtered out.

[0140] Specifically, for each patch output, the system applies a sigmoid function. This process can be expressed as: g = sigmoid (Wx + b), where x is the original output of the patch, W and b are learnable parameters, and g is the resulting gating value. The system then uses this gating value to adjust the patch output: y = g*x, where y is the final patch output.

[0141] This gating mechanism solves several key technical problems. First, it provides an adaptive way to adjust the importance of different patches. For patches that contain important information, the gating value will approach 1, allowing most information to pass through; while for less important patches, the gating value will approach 0, inhibiting the transmission of information. This helps the model focus on the most relevant temporal information and improves the accuracy of predictions.

[0142] Secondly, the gating mechanism helps solve the vanishing gradient problem. When processing long sequence data, traditional recurrent neural networks often face the problem of vanishing gradients, which makes it difficult to capture long-term dependencies. By using the gating mechanism, the system can more effectively transmit important information in long sequences and alleviate the vanishing gradient problem.

[0143] In step S402, the system obtains the corresponding feature sequence based on the output of all patches. The core of this step is to integrate the output of each patch after gated processing into a coherent feature sequence. This feature sequence contains not only the information of the original data, but also the time information of each patch.

[0144] The specific integration process may involve a variety of techniques. A common approach is to use a concatenation operation to connect the outputs of all patches in time order. Another approach is to use some form of pooling operation, such as average pooling or maximum pooling, to combine the information of each patch. Regardless of the method used, the key is to preserve and emphasize the temporal information in each patch.

[0145] This integration process solves several technical problems in time series analysis. First, it provides an efficient way to handle information at different time scales. By integrating information from different patches into one series, the model can consider both short-term fluctuations and long-term trends. Second, this method preserves the sequential information of the time series, which is crucial for many forecasting tasks. Finally, by integrating information from multiple patches, this method can effectively handle long series data, overcoming the limitations of traditional methods in dealing with long time series.

[0146] Together, these two steps achieve several important technical effects. First, they significantly improve the model's ability to handle long-term time series data. Through the gating mechanism and feature integration, the model is better able to capture long-term dependencies, which is particularly important in prediction tasks. Second, this approach enhances the adaptability of the model. The gating mechanism allows the model to dynamically adjust the flow of information based on the importance of different patches, allowing the model to better adapt to different data patterns. Third, by generating a feature sequence that contains rich temporal information, this approach provides high-quality input for subsequent analysis and prediction tasks, helping to improve the accuracy of the overall prediction.

[0147] In one embodiment of the time series-based demand forecasting method of the present application, see Figure 5 , and can also include the following:

[0148] Step S501: inputting the feature sequence into a multi-layer patch attention structure stacked in a triangular manner, wherein each layer of the multi-layer patch attention structure includes a time series processing unit of a self-attention mechanism and a feedforward neural network;

[0149] Step S502: define a set of continuous time scales with different time granularities, and perform an average pooling operation on the feature sequence in each time scale to reduce the time dimension, obtain a coarser sequence and send it as the input of the current scale into the multi-layer patch attention structure for iterative processing to obtain the next finer sequence.

[0150] Optionally, in this embodiment, steps S501 and S502 constitute an innovative time series processing framework, which is particularly suitable for processing complex data with multi-scale time dependencies, such as equipment spare parts demand forecasting. The core idea of ​​these two steps is to use a multi-layer patch attention structure and multi-scale time series processing to capture features and dependencies at different time scales. The uniqueness of this method is that it can adaptively process information of different time granularities, thereby improving the model's ability to understand long-term and short-term patterns.

[0151] In step S501, the system inputs the feature sequence into a multi-layer patch attention structure stacked in a triangular manner. The design of this structure is inspired by the transformer model, but with specific improvements to better adapt to time series data. Each layer contains a self-attention mechanism and a feedforward neural network, which together constitute a time series processing unit.

[0152] The self-attention mechanism is at the heart of this architecture. It allows the model to consider all other positions in the entire sequence when processing each position in the sequence. This mechanism is particularly useful for capturing long-range dependencies. In the time series processing unit, the self-attention mechanism works by calculating the correlation of each element in the sequence with all other elements, and then performing a weighted aggregation of information based on these correlations. This allows the model to dynamically decide which parts of the sequence should be focused on when making predictions.

[0153] The feedforward neural network further processes and transforms information after the self-attention mechanism. It increases the expressiveness of the model through nonlinear activation functions, enabling the model to learn more complex features and patterns. This combination can not only capture the temporal dependencies in the sequence, but also learn more abstract and advanced feature representations.

[0154] The triangular stacking of multi-layer patch attention structures is a key design. In this structure, the attention mechanisms of lower layers process larger ranges of sequences, while higher layers gradually focus on smaller ranges of sequences. This design enables the model to process information at different levels of abstraction, thereby considering both long-term trends and short-term fluctuations.

[0155] Step S502 introduces the concept of multi-scale time series processing. This step first defines a set of continuous time scales with different time granularities. Then, for each time scale, the system reduces the time dimension of the feature sequence through an average pooling operation to obtain a coarser sequence. The purpose of this operation is to reduce the length of the sequence while retaining important information, so that the model can more effectively process long-term dependencies.

[0156] The choice of the average pooling operation is based on its advantage in preserving the overall trend of the time series. Unlike maximum pooling, average pooling is able to preserve the average information within the time window, which is particularly effective in capturing overall trends and smoothing short-term fluctuations.

[0157] At each time scale, the system inputs the average pooled sequence into a multi-layer patch attention structure for iterative processing. This process starts from the coarsest time scale and gradually transitions to finer time scales. At each scale, the model can learn the temporal patterns and dependencies unique to that scale.

[0158] This multi-scale processing approach solves several key technical problems. First, it effectively solves the problem of computational efficiency in long sequence processing. By processing long-term dependencies at a coarser time scale, the model can capture long-term patterns on shorter sequences, greatly reducing computational complexity. Second, this approach is able to capture patterns on different time scales simultaneously. For example, it can learn annual trends, seasonal changes, and daily fluctuations at the same time. Finally, through the coarse-to-fine processing process, the model is able to gradually refine its predictions, which helps improve the stability and accuracy of the predictions.

[0159] Together, these two steps achieve several important technical effects. First, they greatly improve the model's ability to handle long-term time series data. Through multi-layer attention mechanisms and multi-scale processing, the model is able to effectively capture a variety of temporal dependencies from short-term to long-term. Second, this approach enhances the model's adaptability and generalization capabilities. Being able to process information at different time granularities, the model can better adapt to different types of time series data. Third, by combining the self-attention mechanism and multi-scale processing, this approach improves the interpretability of the model. Analyzing the attention weights at different layers and scales can provide insights into the time periods and features that the model focuses on when making predictions.

[0160] In one embodiment of the time series-based demand forecasting method of the present application, see Figure 6 , and can also include the following:

[0161] Step S601: Aggregate all pseudo-time stamps of each layer through a neural network to obtain the total output of the layer, and then concatenate the total outputs of different layers to finally form a summarized feature vector;

[0162] Step S602: input the summarized feature vector into a fully connected neural network predictor, and continuously optimize the parameters of the fully connected neural network predictor through back propagation using a mean square error loss function until the predicted output value and the true target value meet a preset threshold range.

[0163] Optionally, in this embodiment, steps S601 and S602 constitute an efficient feature fusion and prediction optimization framework, which is particularly suitable for processing complex time series data at multiple levels and time scales. The core idea of ​​these two steps is to effectively aggregate and fuse the features processed by the multi-layer patch attention structure, and then generate the final prediction result through a trainable predictor. The uniqueness of this method is that it can make full use of the information captured at different levels and time scales, thereby improving the prediction accuracy and generalization ability of the model.

[0164] In step S601, the system first aggregates all pseudo timestamps of each layer. The "pseudo timestamp" here can be understood as the feature representation after each layer of patch attention structure processing. The purpose of using neural network for aggregation is to learn an intelligent feature fusion method instead of simple averaging or splicing. This neural network can be designed as a multi-layer perceptron (MLP) or a more complex structure, such as a self-attention mechanism.

[0165] The design of the aggregation neural network is the key to this step. It needs to be able to effectively capture the relationship between different pseudo timestamps and extract the most valuable information. For example, a bidirectional LSTM network can be used to process these pseudo timestamps, because LSTM can handle sequence data well and capture long-term and short-term dependencies. Another option is to use a self-attention mechanism, which can directly model the dependency between any two positions in the sequence.

[0166] After the aggregation process is complete, each layer gets a total output. These total outputs represent the features captured at each level. Next, the system concatenates the total outputs of different layers. This concatenation operation retains the unique information of each layer instead of mixing them together. In this way, the model is able to retain features at different levels of abstraction, thereby utilizing multi-scale information in subsequent predictions.

[0167] The final summary feature vector is a high-dimensional vector that contains all the important information from the lowest level to the highest level. This vector not only contains the features of the original data, but also contains the advanced features extracted through multi-layer processing, making subsequent predictions more accurate and robust.

[0168] Step S602 focuses on how to use this summarized feature vector for final prediction. This step uses a fully connected neural network predictor because the fully connected layer has a strong nonlinear mapping capability and can learn the complex relationship between the feature vector and the prediction target.

[0169] The design of the fully connected neural network predictor is also a key point in this step. It can be a simple multi-layer perceptron or a more complex structure such as a residual network. The depth and width of the network need to be adjusted according to the complexity of the problem and the characteristics of the data. Generally, for complex time series forecasting problems, using a deeper network (e.g. 3-5 layers) can provide better performance.

[0170] During the training process, the system uses mean squared error (MSE) as the loss function. MSE is a commonly used loss function in regression problems, which measures the average squared difference between the predicted value and the true value. The reason for choosing MSE is that it is particularly sensitive to large errors, which helps the model adjust quickly to reduce significant prediction deviations.

[0171] The optimization process uses the back-propagation algorithm, which is the most commonly used parameter update method in deep learning. In each iteration, the model first performs forward propagation to calculate the predicted value, then calculates the loss, and finally calculates the gradient and updates the parameters through back-propagation. This process is repeated until the difference between the predicted output value and the true target value falls within the preset threshold range.

[0172] In one embodiment of the time series-based demand forecasting method of the present application, see Figure 7 , and can also include the following:

[0173] Step S701: Calculate the statistics of each time scale output and perform standardization on the output of each time scale;

[0174] Step S702: by setting the finest reference scale, aligning the standardized outputs of other time scales to the said through a learnable linear transformation, and using the statistics of the finest reference scale to de-standardize the aligned outputs.

[0175] Optionally, in this embodiment, steps S701 and S702 constitute an innovative multi-scale time series data processing and alignment framework, which is particularly suitable for processing complex data of different time granularities. The core idea of ​​these two steps is to align the features of different time scales to a unified reference scale through statistical normalization and learnable linear transformation, thereby achieving effective fusion of multi-scale information. The uniqueness of this method is that it can retain the feature information of different time scales while achieving consistency and comparability of data.

[0176] In step S701, the system first calculates the statistics of each time scale output. The statistics here usually include mean and standard deviation, but may also include other descriptive statistical indicators, such as median, quartiles, etc. The purpose of calculating these statistics is to understand the characteristics of the data distribution at each time scale, which is crucial for subsequent standardization processing.

[0177] The calculation process of statistics needs to take into account the characteristics of time series data. For example, for data with obvious seasonality or periodicity, it may be necessary to calculate statistics for different periods separately. In addition, for non-stationary time series, it may be necessary to use a sliding window method to calculate local statistics to capture changes in data distribution over time.

[0178] After calculating the statistics, the system normalizes the output of each time scale. The purpose of normalization is to convert data of different scales to a common scale so that they are comparable. The most commonly used normalization method is Z-score normalization, which converts the data into a distribution with a mean of 0 and a standard deviation of 1. This standardization not only allows data of different scales to be directly compared, but also helps the convergence and performance improvement of subsequent machine learning algorithms.

[0179] Standardization solves several key technical problems. First, it eliminates the dimensional differences between data at different time scales. For example, data at the daily scale may fluctuate in the range of 0-100, while data at the annual scale may fluctuate in the range of 1000-10000. After standardization, these data are mapped to a unified scale. Second, standardization helps reduce the impact of outliers. In the original data, extreme values ​​may have an excessive impact on the model, but after standardization, the impact of these extreme values ​​will be appropriately reduced.

[0180] Step S702 focuses on how to align the standardized outputs of different time scales to a unified reference scale. This step first sets a finest reference scale, which is usually the finest time granularity in the original data (for example, if the original data contains three scales of day, week, and month, the day scale will be selected as the reference scale).

[0181] Next, the system aligns the normalized outputs of other time scales to this reference scale through a learnable linear transformation. The "learnable linear transformation" here is a key innovation. It is not a simple fixed mapping, but a transformation that can be optimized through the model training process. This design allows the system to adaptively learn the optimal scale alignment instead of relying on predefined fixed rules.

[0182] The specific form of the linear transformation can be a simple linear layer (i.e. matrix multiplication plus bias) or a more complex structure such as a multilayer perceptron. The parameters of this transformation are continuously optimized during the training process of the entire model to minimize the prediction error.

[0183] After the alignment process is completed, the system uses the statistics of the finest reference scale to denormalize the aligned output. The purpose of this step is to convert the normalized data back to the original scale for subsequent analysis and prediction. The denormalization process is usually the inverse of normalization, that is, mapping the normalized data back to the original data range using the mean and standard deviation of the reference scale.

[0184] These two steps together achieve several important technical effects. First, they achieve effective fusion of data at different time scales. By aligning data of all scales to the same reference scale, the model is able to simultaneously use information of different time granularities for prediction. This is particularly effective for capturing complex time dependencies. Second, this approach improves the generalization ability of the model. By learning the optimal scale alignment, the model can better adapt to different types of time series data. Third, this approach enhances the interpretability of the model. By analyzing the alignment parameters of different scales, this embodiment can understand how information of different time scales affects the final prediction results.

[0185] In order to effectively improve the accuracy and efficiency of demand forecasting, the present application provides an embodiment of a time series-based demand forecasting device for implementing all or part of the time series-based demand forecasting method, see Figure 8 The time series-based demand forecasting device specifically includes the following contents:

[0186] The data processing module 10 is used to decompose the input equipment spare parts time series data into multiple patches along the time dimension, introduce a learnable pseudo timestamp for each patch according to the attention score of each patch to act as a data placer, and update the pseudo timestamp through a patch attention mechanism;

[0187] A model training module 20 is used to connect the output of the patch through the gating rule in the cyclic connection according to the pseudo timestamp to obtain a connected feature sequence, input the feature sequence into a multi-layer patch attention structure stacked in a triangular manner, iteratively apply a time series processing unit including a self-attention mechanism and a feedforward neural network on multiple time scales with different time granularities, aggregate the total output of each layer in the multi-layer patch attention structure and each scale in the time scale to a fully connected neural network predictor, and iteratively train the fully connected neural network predictor through a mean square error loss function;

[0188] The demand prediction module 30 is used to receive an equipment spare parts demand prediction request sent by a user, and obtain a corresponding equipment spare parts demand prediction result through the output of the fully connected neural network predictor according to the equipment spare parts demand prediction request.

[0189] From the above description, it can be seen that the time series-based demand forecasting device provided in the embodiment of the present application can decompose the input equipment spare parts time series data into multiple patches along the time dimension, introduce a learnable pseudo-timestamp for each patch according to the attention score of each patch to act as a data placer; connect the output of the patch through the gating rules in the cyclic connection according to the pseudo-timestamp, input the feature sequence into a multi-layer patch attention structure stacked in a triangular manner, iteratively apply the time series processing unit on multiple time scales with different time granularities, aggregate the total output of each layer in the multi-layer patch attention structure and each scale in the time scale to a fully connected neural network predictor, and iteratively train the fully connected neural network predictor through the mean square error loss function to obtain the corresponding equipment spare parts demand forecasting result, thereby effectively improving the accuracy and efficiency of demand forecasting.

[0190] From the hardware level, in order to effectively improve the accuracy and efficiency of demand forecasting, the present application provides an embodiment of an electronic device for implementing all or part of the content of the time series-based demand forecasting method, and the electronic device specifically includes the following content:

[0191] Processor, memory, communication interface and bus; wherein the processor, memory and communication interface communicate with each other through the bus; the communication interface is used to realize information transmission between the demand forecasting device based on time series and related devices such as core business system, user terminal and related database; the logic controller can be a desktop computer, tablet computer and mobile terminal, etc., but the present embodiment is not limited thereto. In the present embodiment, the logic controller can be implemented with reference to the embodiment of the demand forecasting method based on time series and the embodiment of the demand forecasting device based on time series in the embodiment, and the contents thereof are incorporated herein, and the repeated parts are not repeated.

[0192] It is understandable that the user terminal may include a smart phone, a tablet electronic device, a network set-top box, a portable computer, a desktop computer, a personal digital assistant (PDA), a vehicle-mounted device, a smart wearable device, etc. Among them, the smart wearable device may include smart glasses, a smart watch, a smart bracelet, etc.

[0193] In practical applications, part of the time series-based demand forecasting method can be executed on the electronic device side as described above, or all operations can be completed in the client device. The selection can be made based on the processing capability of the client device and the limitations of the user's usage scenario. This application does not limit this. If all operations are completed in the client device, the client device may also include a processor.

[0194] The client device may have a communication module (i.e., a communication unit) that can communicate with a remote server to achieve data transmission with the server. The server may include a server on the task scheduling center side, and other implementation scenarios may also include a server on an intermediate platform, such as a server on a third-party server platform that has a communication link with the task scheduling center server. The server may include a single computer device, or a server cluster consisting of multiple servers, or a server structure of a distributed device.

[0195] Fig. 9 FIG. 9 is a schematic block diagram of the system structure of the electronic device 9600 according to an embodiment of the present application. Fig. 9 As shown, the electronic device 9600 may include a central processor 9100 and a memory 9140; the memory 9140 is coupled to the central processor 9100. It is worth noting that Fig. 9 is exemplary; other types of structures may also be used to supplement or replace this structure to implement telecommunication functions or other functions.

[0196] In one embodiment, the function of the demand forecasting method based on time series can be integrated into the central processing unit 9100. The central processing unit 9100 can be configured to perform the following control:

[0197] Step S101: decomposing the input equipment spare parts time series data into multiple patches along the time dimension, introducing a learnable pseudo timestamp for each patch to act as a data placer according to the attention score of each patch, and updating the pseudo timestamp through a patch attention mechanism;

[0198] Step S102: connecting the output of the patch through the gating rule in the cyclic connection according to the pseudo timestamp to obtain a connected feature sequence, inputting the feature sequence into a multi-layer patch attention structure stacked in a triangular manner, iteratively applying a time series processing unit including a self-attention mechanism and a feedforward neural network on multiple time scales with different time granularities, aggregating the total output of each layer in the multi-layer patch attention structure and each scale in the time scale to a fully connected neural network predictor, and iteratively training the fully connected neural network predictor through a mean square error loss function;

[0199] Step S103: receiving an equipment spare parts demand prediction request sent by a user, and obtaining a corresponding equipment spare parts demand prediction result through the output of the fully connected neural network predictor according to the equipment spare parts demand prediction request.

[0200] From the above description, it can be seen that the electronic device provided by the embodiment of the present application decomposes the input equipment spare parts time series data into multiple patches along the time dimension, introduces a learnable pseudo-timestamp for each patch according to the attention score of each patch to act as a data placer; connects the output of the patch through the gating rules in the cyclic connection according to the pseudo-timestamp, inputs the feature sequence into a multi-layer patch attention structure stacked in a triangular manner, iteratively applies the time series processing unit on multiple time scales with different time granularities, aggregates the total output of each layer in the multi-layer patch attention structure and each scale in the time scale to a fully connected neural network predictor, and iteratively trains the fully connected neural network predictor through the mean square error loss function to obtain the corresponding equipment spare parts demand prediction result, thereby effectively improving the accuracy and efficiency of demand prediction.

[0201] In another embodiment, the time series-based demand forecasting device can be configured separately from the central processing unit 9100. For example, the time series-based demand forecasting device can be configured as a chip connected to the central processing unit 9100, and the function of the time series-based demand forecasting method can be implemented through the control of the central processing unit.

[0202] like Fig. 9 As shown, the electronic device 9600 may also include: a communication module 9110, an input unit 9120, an audio processor 9130, a display 9160, and a power supply 9170. It is worth noting that the electronic device 9600 does not necessarily have to include Fig. 9 In addition, the electronic device 9600 may also include Fig. 9 For components not shown, reference may be made to the prior art.

[0203] like Fig. 9 As shown, the central processing unit 9100 is sometimes also referred to as a controller or an operation control, and may include a microprocessor or other processor device and / or logic device, which receives input and controls the operation of various components of the electronic device 9600.

[0204] The memory 9140 may be, for example, one or more of a cache, a flash memory, a hard drive, a removable medium, a volatile memory, a non-volatile memory or other suitable devices. The above-mentioned information related to the failure may be stored, and a program for executing the relevant information may also be stored. The CPU 9100 may execute the program stored in the memory 9140 to implement information storage or processing, etc.

[0205] The input unit 9120 provides input to the central processing unit 9100. The input unit 9120 is, for example, a key or a touch input device. The power supply 9170 is used to provide power to the electronic device 9600. The display 9160 is used to display display objects such as images and texts. The display may be, for example, an LCD display, but is not limited thereto.

[0206] The memory 9140 may be a solid-state memory, such as a read-only memory (ROM), a random access memory (RAM), a SIM card, etc. It may also be a memory that saves information even when the power is off, can be selectively erased, and is provided with more data, examples of which are sometimes referred to as EPROMs, etc. The memory 9140 may also be some other type of device. The memory 9140 includes a buffer memory 9141 (sometimes referred to as a buffer). The memory 9140 may include an application / function storage unit 9142, which is used to store application programs and function programs or processes for executing the operation of the electronic device 9600 through the central processor 9100.

[0207] The memory 9140 may also include a data storage unit 9143 for storing data, such as contacts, digital data, pictures, sounds, and / or any other data used by the electronic device. The driver storage unit 9144 of the memory 9140 may include various drivers for communication functions of the electronic device and / or for executing other functions of the electronic device (such as messaging applications, address book applications, etc.).

[0208] The communication module 9110 is a transmitter / receiver that sends and receives signals via the antenna 9111. The communication module 9110 (transmitter / receiver) is coupled to the central processor 9100 to provide input signals and receive output signals, which may be the same as the case of a conventional mobile communication terminal.

[0209] Based on different communication technologies, multiple communication modules 9110 may be provided in the same electronic device, such as a cellular network module, a Bluetooth module and / or a wireless LAN module, etc. The communication module 9110 (transmitter / receiver) is also coupled to a speaker 9131 and a microphone 9132 via an audio processor 9130 to provide an audio output via the speaker 9131 and receive an audio input from the microphone 9132, thereby realizing a common telecommunication function. The audio processor 9130 may include any suitable buffer, decoder, amplifier, etc. In addition, the audio processor 9130 is also coupled to the central processor 9100, so that recording can be performed on the local machine through the microphone 9132, and the sound stored on the local machine can be played through the speaker 9131.

[0210] The embodiments of the present application also provide a computer-readable storage medium capable of implementing all the steps of the time series-based demand forecasting method in the above-mentioned embodiments, where the execution subject is a server or a client. The computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, all the steps of the time series-based demand forecasting method in the above-mentioned embodiments are implemented. For example, when the processor executes the computer program, the following steps are implemented:

[0211] Step S101: decomposing the input equipment spare parts time series data into multiple patches along the time dimension, introducing a learnable pseudo timestamp for each patch to act as a data placer according to the attention score of each patch, and updating the pseudo timestamp through a patch attention mechanism;

[0212] Step S102: connecting the output of the patch through the gating rule in the cyclic connection according to the pseudo timestamp to obtain a connected feature sequence, inputting the feature sequence into a multi-layer patch attention structure stacked in a triangular manner, iteratively applying a time series processing unit including a self-attention mechanism and a feedforward neural network on multiple time scales with different time granularities, aggregating the total output of each layer in the multi-layer patch attention structure and each scale in the time scale to a fully connected neural network predictor, and iteratively training the fully connected neural network predictor through a mean square error loss function;

[0213] Step S103: receiving an equipment spare parts demand prediction request sent by a user, and obtaining a corresponding equipment spare parts demand prediction result through the output of the fully connected neural network predictor according to the equipment spare parts demand prediction request.

[0214] From the above description, it can be seen that the computer-readable storage medium provided in the embodiment of the present application decomposes the input equipment spare parts time series data into multiple patches along the time dimension, introduces a learnable pseudo-timestamp for each patch according to the attention score of each patch to act as a data placer; connects the output of the patch through the gating rules in the cyclic connection according to the pseudo-timestamp, inputs the feature sequence into a multi-layer patch attention structure stacked in a triangular manner, iteratively applies the time series processing unit on multiple time scales with different time granularities, aggregates the total output of each layer in the multi-layer patch attention structure and each scale in the time scale to a fully connected neural network predictor, and iteratively trains the fully connected neural network predictor through the mean square error loss function to obtain the corresponding equipment spare parts demand prediction result, thereby effectively improving the accuracy and efficiency of demand prediction.

[0215] The embodiments of the present application also provide a computer program product capable of implementing all steps of the time series-based demand forecasting method in the above embodiments, where the execution subject is a server or a client. When the computer program / instruction is executed by a processor, the steps of the time series-based demand forecasting method are implemented. For example, the computer program / instruction implements the following steps:

[0216] Step S101: decomposing the input equipment spare parts time series data into multiple patches along the time dimension, introducing a learnable pseudo timestamp for each patch to act as a data placer according to the attention score of each patch, and updating the pseudo timestamp through a patch attention mechanism;

[0217] Step S102: connecting the output of the patch through the gating rule in the cyclic connection according to the pseudo timestamp to obtain a connected feature sequence, inputting the feature sequence into a multi-layer patch attention structure stacked in a triangular manner, iteratively applying a time series processing unit including a self-attention mechanism and a feedforward neural network on multiple time scales with different time granularities, aggregating the total output of each layer in the multi-layer patch attention structure and each scale in the time scale to a fully connected neural network predictor, and iteratively training the fully connected neural network predictor through a mean square error loss function;

[0218] Step S103: receiving an equipment spare parts demand prediction request sent by a user, and obtaining a corresponding equipment spare parts demand prediction result through the output of the fully connected neural network predictor according to the equipment spare parts demand prediction request.

[0219] From the above description, it can be seen that the computer program product provided by the embodiment of the present application decomposes the input equipment spare parts time series data into multiple patches along the time dimension, introduces a learnable pseudo-timestamp for each patch according to the attention score of each patch to act as a data placer; connects the output of the patch through the gating rules in the cyclic connection according to the pseudo-timestamp, inputs the feature sequence into a multi-layer patch attention structure stacked in a triangular manner, iteratively applies the time series processing unit on multiple time scales with different time granularities, aggregates the total output of each layer in the multi-layer patch attention structure and each scale in the time scale to a fully connected neural network predictor, and iteratively trains the fully connected neural network predictor through the mean square error loss function to obtain the corresponding equipment spare parts demand prediction result, thereby effectively improving the accuracy and efficiency of demand prediction.

[0220] It will be appreciated by those skilled in the art that embodiments of the present invention may be provided as methods, devices, or computer program products. Therefore, the present invention may take the form of a complete hardware embodiment, a complete software embodiment, or an embodiment combining software and hardware. Moreover, the present invention may take the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.

[0221] The present invention is described with reference to flowcharts and / or block diagrams of methods, devices (apparatus), and computer program products according to embodiments of the present invention. It should be understood that each process and / or block in the flowchart and / or block diagram, as well as the combination of processes and / or blocks in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing device to generate a machine, so that the instructions executed by the processor of the computer or other programmable data processing device generate instructions for implementing the processes in the flowchart and / or block diagram. Figure 1 A process or multiple processes and / or boxes Figure 1 A device that provides the functions specified in a block or multiple blocks.

[0222] These computer program instructions may also be stored in a computer-readable memory capable of directing a computer or other programmable data processing device to operate in a specific manner, so that the instructions stored in the computer-readable memory produce an article of manufacture comprising an instruction device, which implements the process Figure 1 A process or multiple processes and / or boxes Figure 1 A function specified in one or more boxes.

[0223] These computer program instructions can also be loaded onto a computer or other programmable data processing device so that a series of operating steps are executed on the computer or other programmable device to produce a computer-implemented process, thereby providing instructions for implementing the process. Figure 1 A process or multiple processes and / or boxes Figure 1 The steps for the functions specified in one or more boxes.

[0224] The present invention uses specific embodiments to illustrate the principles and implementation methods of the present invention. The description of the above embodiments is only used to help understand the method of the present invention and its core idea. At the same time, for those skilled in the art, according to the idea of ​​the present invention, there will be changes in the specific implementation methods and application scope. In summary, the content of this specification should not be understood as a limitation on the present invention.

Claims

1. A demand forecasting method based on time series, characterized in that: The method comprises: Decompose the input equipment spare parts time series data into multiple patches along the time dimension, introduce a learnable pseudo timestamp for each patch according to the attention score of each patch to act as a data placer, and update the pseudo timestamp through a patch attention mechanism; Connect the outputs of the patches through the gating rules in the cyclic connection according to the pseudo timestamp to obtain a connected feature sequence, input the feature sequence into a multi-layer patch attention structure stacked in a triangular manner, iteratively apply a time series processing unit including a self-attention mechanism and a feedforward neural network on multiple time scales with different time granularities, aggregate the total outputs of each layer in the multi-layer patch attention structure and each scale in the time scale to a fully connected neural network predictor, and iteratively train the fully connected neural network predictor through a mean square error loss function; An equipment spare parts demand prediction request sent by a user is received, and a corresponding equipment spare parts demand prediction result is obtained through the output of the fully connected neural network predictor according to the equipment spare parts demand prediction request.

2. The demand forecasting method based on time series according to claim 1 is characterized in that: Before decomposing the input equipment spare parts time series data into multiple patches along the time dimension, the method includes: If the input equipment spare parts time series data is a multivariate time series, a lightweight weight generation method is used to introduce a multidimensional memory vector matrix for each variable, and the projection matrix of the memory vector matrix is ​​factorized to obtain a left variable independent matrix, an intermediate variable dedicated matrix, and a right variable independent matrix respectively; Specific variables are generated from the memory vector matrix through a preset generator network.

3. The demand forecasting method based on time series according to claim 1 is characterized in that: The method of introducing a learnable pseudo timestamp for each patch according to the attention score of each patch to act as a data placer, and updating the pseudo timestamp through a patch attention mechanism, comprises: The input time series data is divided into multiple patches. For each patch, a learnable pseudo timestamp is introduced to act as a data placer to store all the real timestamp information in the patch and pass it to the next processing layer. All real timestamp information in the corresponding patch is queried through the pseudo timestamp, and the attention score of the real timestamp information is calculated, and the pseudo timestamp is updated according to the attention score of the real timestamp information.

4. The demand forecasting method based on time series according to claim 1 is characterized in that: The step of connecting the outputs of the patches according to the pseudo timestamps through a gating rule in a cyclic connection to obtain a connected feature sequence includes: Connecting the output of the patch via a sigmoid activation function as a gate; A corresponding feature sequence is obtained according to the output of all the patches, wherein the feature sequence includes time information of each patch.

5. The demand forecasting method based on time series according to claim 1 is characterized in that: The feature sequence is input into a multi-layer patch attention structure stacked in a triangular manner, and a time series processing unit including a self-attention mechanism and a feedforward neural network is iteratively applied on multiple time scales with different time granularities, including: Inputting the feature sequence into a multi-layer patch attention structure stacked in a triangular manner, wherein each layer of the multi-layer patch attention structure includes a time series processing unit of a self-attention mechanism and a feedforward neural network; A set of continuous time scales with different time granularities are defined. In each time scale, the feature sequence is subjected to an average pooling operation to reduce the time dimension, and a coarser sequence is obtained. The sequence is sent to a multi-layer patch attention structure as the input of the current scale for iterative processing to obtain the next finer sequence.

6. The demand forecasting method based on time series according to claim 1 is characterized in that: The aggregating the total outputs of each layer in the multi-layer patch attention structure and each scale in the time scale to a fully connected neural network predictor, and iteratively training the fully connected neural network predictor through a mean square error loss function, comprises: Aggregate all pseudo-timestamps of each layer through a neural network to obtain the total output of the layer, and then concatenate the total outputs of different layers to form a summarized feature vector; The summarized feature vector is input into a fully connected neural network predictor, and the parameters of the fully connected neural network predictor are continuously optimized by back propagation using a mean square error loss function until the predicted output value and the true target value meet a preset threshold range.

7. The demand forecasting method based on time series according to claim 1 is characterized in that: The iterative application of a time series processing unit including a self-attention mechanism and a feedforward neural network on multiple time scales with different time granularities also includes: Calculate the statistics of the output at each time scale and standardize the output at each time scale; By setting the finest reference scale, the standardized outputs of other time scales are aligned to the one described above through a learnable linear transformation, and the aligned outputs are denormalized using the statistics of the finest reference scale.

8. A demand forecasting device based on time series, characterized in that: The device comprises: A data processing module, used for decomposing the input equipment spare parts time series data into multiple patches along the time dimension, introducing a learnable pseudo timestamp for each patch according to the attention score of each patch to act as a data placer, and updating the pseudo timestamp through a patch attention mechanism; A model training module, configured to connect the outputs of the patches through a gating rule in a cyclic connection according to the pseudo-timestamp to obtain a connected feature sequence, input the feature sequence into a multi-layer patch attention structure stacked in a triangular manner, iteratively apply a time series processing unit including a self-attention mechanism and a feedforward neural network on multiple time scales with different time granularities, aggregate the total outputs of each layer in the multi-layer patch attention structure and each scale in the time scale to a fully connected neural network predictor, and iteratively train the fully connected neural network predictor through a mean square error loss function; The demand prediction module is used to receive an equipment spare parts demand prediction request sent by a user, and obtain a corresponding equipment spare parts demand prediction result through the output of the fully connected neural network predictor according to the equipment spare parts demand prediction request.

9. An electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that: When the processor executes the program, the steps of the time series-based demand forecasting method described in any one of claims 1 to 7 are implemented.

10. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the steps of the time series-based demand forecasting method described in any one of claims 1 to 7 are implemented.

Citation Information

Patent Citations

  • Anti-fact fault data generation method based on causal intervention

    CN117520905A

  • Malicious traffic detection method based on mask automatic encoder pre-training

    CN118400195A

  • Multivariate time sequence long-term prediction method based on multi-scale time sequence feature enhancement

    CN118657253A

  • Attention-based multiple instance learning

    US20240079138A1