Material data processing method, device, storage medium and processor
By extracting the static and dynamic characteristics of material demand, weighted fusion and combining quantile regression processing with recent and periodic characteristics, the problem of low accuracy in material data prediction is solved and more accurate material demand prediction is achieved.
Patent Information
- Application Number
- CN202110077676.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-01-20
- Publication Date
- 2025-08-22
- Estimated Expiration
- 2041-01-20
AI Technical Summary
The prior art has problems with low accuracy in material data prediction, logical rules cannot adapt to dynamic changes, linear prediction considerations are insufficient, time series decomposition is lossy and inefficient, and deep learning cannot effectively capture timing characteristics, resulting in a large deviation from the prediction results from the actual results.
Static and dynamic features are extracted from the material demand, weighted fusion is carried out to strengthen features, and converted into hidden layer features. Combining recent features and periodic features, the material demand is predicted through quantile regression processing.
It improves the accuracy of material data prediction, can better reflect the inherent change trend and periodic characteristics of material demand, and provide more reasonable prediction results.
Smart Images

Figure CN114863126B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of data processing, and in particular to a material data processing method, device, storage medium and processor. Background Art
[0002] At present, forecasting material data is a crucial part of supply chain management. Accurate material data forecasting can better guide the supply chain planning center to provide resources to various suppliers.
[0003] In related technologies, material data forecasting is mostly performed using logical rules, linear prediction algorithms, time series decomposition, and deep learning algorithms. However, first, using logical rules to forecast material data, because the developed calculation logic is entirely rule-based, cannot adapt to dynamic external changes. Second, using linear prediction algorithms to forecast material data, because they take fewer factors into account, and in actual business scenarios, future demand is often a nonlinear combination of historical demand, resulting in significant discrepancies in forecast results. Third, using time series decomposition to forecast material data requires extensive labeling and feature processing, and because sequence decomposition is lossy, using machine learning models to predict will only result in biased predictions based on this loss, resulting in significant discrepancies between the predicted results and the true values. Fourth, using deep learning algorithms to forecast material data, because conventional multi-layer feedforward (BP) neural networks cannot effectively capture time series features and may not clearly capture seasonality-related features, convolutional networks require multiple convolutional layers to capture seasonality, which also affects computational efficiency.
[0004] Therefore, the above methods for predicting material data will all lead to a problem of large deviation between the predicted results and the actual results, resulting in a problem of low accuracy in material data prediction.
[0005] Currently, no effective solution has been proposed to address the above-mentioned problem of low accuracy in material data prediction. Summary of the Invention
[0006] Embodiments of the present invention provide a material data processing method, device, storage medium, and processor to at least solve the technical problem of low accuracy in predicting material data.
[0007] According to one aspect of an embodiment of the present invention, a material data processing method is provided, including: extracting static features and dynamic features from a first material demand, wherein the first material demand is material data generated at a first moment; fusing the static features and dynamic features into enhanced features, and converting the enhanced features into hidden layer features; obtaining recent features and periodic features of the first material demand at a second moment, wherein the second moment is a moment after the first moment, the recent features are used to characterize the material data change trend of the first material demand at the second moment, and the periodic features are used to characterize the periodic change trend of the first material demand; based on the hidden layer features, recent features and periodic features, predicting the second material demand generated at the second moment.
[0008] In an embodiment of the present invention, static features and dynamic features are extracted from the first material demand, and then the static features and dynamic features are weightedly fused to obtain enhanced features, and the enhanced features are converted into hidden layer features. After obtaining the recent features and periodic features of the first material demand at the second moment to be predicted, the hidden layer features, recent features and periodic features are subjected to quantile regression processing to predict the second material demand generated at the second moment. In related technologies, the use of logical rules, linear prediction algorithms, time series decomposition and deep learning algorithms to predict material data will lead to a large deviation between the prediction results and the actual results. The present application extracts static features and dynamic features from the first material demand, and fuses the static features and dynamic features into enhanced features. It takes into account the impact of the intrinsic connection between static features and dynamic features at different moments on the prediction results, and combines the recent features and periodic features of the second moment to be predicted, so that the input features during the prediction are more comprehensive and sufficient, so that the prediction results are more reasonable, thereby solving the technical problem of low accuracy in predicting material data and achieving the technical effect of improving the accuracy of predicting material data. BRIEF DESCRIPTION OF THE DRAWINGS
[0009] The drawings described herein are used to provide a further understanding of the present invention and constitute a part of this application. The exemplary embodiments of the present invention and their descriptions are used to explain the present invention and do not constitute an improper limitation of the present invention. In the drawings:
[0010] Figure 1 is a flow chart of a material data processing method according to an embodiment of the present invention;
[0011] Figure 2 It is a flow chart of a method for predicting material demand based on logical rules according to relevant technology;
[0012] Figure 3It is a flow chart of a method for predicting material demand based on a linear prediction algorithm according to related technology;
[0013] Figure 4 It is a flow chart of a method for predicting material demand based on time series decomposition according to related technologies;
[0014] Figure 5 is a network structure diagram of a static-dynamic selection model according to an embodiment of the present invention;
[0015] Figure 6 is a network structure diagram of a local loop fusion model according to an embodiment of the present invention;
[0016] Figure 7 is a network structure diagram of a sequence fusion recurrent neural network model according to an embodiment of the present invention;
[0017] Figure 8 This is a flowchart of a method for predicting material demand based on a sequence fusion recurrent neural network according to an embodiment of the present invention;
[0018] Figure 9 is a curve chart of a prediction result of material demand according to an embodiment of the present invention;
[0019] Figure 10 2 is a schematic diagram of a material data processing device according to an embodiment of the present invention. DETAILED DESCRIPTION
[0020] In order to enable those skilled in the art to better understand the solutions of the present invention, the technical solutions in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiments of the present invention. Obviously, the embodiments described are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without making creative efforts should fall within the scope of protection of the present invention.
[0021] It should be noted that the terms "first", "second", etc. in the description and claims of the present invention and the above-mentioned drawings are used to distinguish similar objects and are not necessarily used to describe a specific order or sequence. It should be understood that the numbers used in this way can be interchanged where appropriate, so that the embodiments of the present invention described herein can be implemented in an order other than those illustrated or described herein. In addition, the terms "including" and "having" and any variations thereof are intended to cover non-exclusive inclusions. For example, a process, method, system, product or device that includes a series of steps or units is not necessarily limited to those steps or units clearly listed, but may include other steps or units that are not clearly listed or inherent to these processes, methods, products or devices.
[0022] Example 1
[0023] According to an embodiment of the present invention, an embodiment of a material data processing method is provided. It should be noted that the steps shown in the flowchart of the accompanying drawings can be executed in a computer system such as a set of computer executable instructions, and although a logical order is shown in the flowchart, in some cases, the steps shown or described can be executed in an order different from that shown here.
[0024] Figure 1 FIG. 1 is a flow chart of a material data processing method according to an embodiment of the present invention. Figure 1 As shown, the method may include the following steps:
[0025] Step S102 : extracting static features and dynamic features from the first material requirement, wherein the first material requirement is material data generated at the first moment.
[0026] In the technical solution provided in the above step S102 of the present invention, the first material requirement may be material data generated historically, and static features and dynamic features may be extracted from the first material requirement.
[0027] In the above embodiment, static features may be features that do not change over time, such as the size, quality, and supplier of the material, and dynamic features may be features that change over time, such as the state, price, and matching model of the material.
[0028] Optionally, in this embodiment, a self-attention mechanism can be used to obtain recent features of the time (t+1) to be predicted, wherein Attention has a hyperparameter l, which identifies the recent range, and l is between 1 and k. Convolutional Neural Networks (CNN) are used to obtain specified periodic features, wherein the hyperparameters are p and m, p can be used to represent the period length, and m can be used to represent the fluctuation range.
[0029] For example, if a company increases demand on the 1st of each month due to business reasons, p can be set to 30. However, since months have 28, 30, and 31 days, simply setting the cycle length p to 30 may not accurately capture the cycle characteristics. Therefore, m can be set to 3 to extract more complete features.
[0030] Step S104: The static features and the dynamic features are fused into enhanced features, and the enhanced features are converted into hidden layer features.
[0031] In the technical solution provided in step S104 of the present invention, after obtaining the static features and the dynamic features, the static features and the dynamic features can be weighted and fused to obtain enhanced features, so that the enhanced features can fully reflect the inherent relationship between the static features and the dynamic features. After obtaining the enhanced features, the enhanced features can be converted into hidden layer features.
[0032] Step S106, obtaining the recent characteristics and periodic characteristics of the first material demand at the second moment, wherein the second moment is the moment after the first moment, the recent characteristics are used to characterize the material data change trend of the first material demand at the second moment, and the periodic characteristics are used to characterize the periodic change trend of the first material demand.
[0033] In the technical solution provided in the above step S106 of the present invention, when it is necessary to predict the material data, a moment to be predicted can be selected first, that is, the above-mentioned second moment, which is the moment after the first moment, and then the recent characteristics and periodic characteristics of the first material demand at the second moment are obtained. The recent characteristics can be used to represent the material data change trend of the first material demand at the second moment, and the periodic characteristics can be used to represent the periodic change trend of the first material demand, so that the recent characteristics and periodic characteristics of the material data can be used to improve the accuracy of predicting the material data.
[0034] In the above example, recent features can represent the current material trend. For example, if demand for a material increases for several consecutive days, it indicates that the material is a hot commodity and demand may continue to rise. The inherent nature of a company's business also has some impact on material demand. For example, peak seasons often indicate increased demand, while demand tends to decrease during long holidays like Spring Festival and National Day. These fixed-point fluctuations present a cyclical trend, which can be reflected using periodic features.
[0035] Step S108 : predicting the second material demand generated at the second moment based on the hidden layer features, the recent features, and the periodic features.
[0036] In the technical solution provided in the above step S108 of the present invention, after obtaining the hidden layer features, recent features and periodic features, the second material demand generated at the second moment to be predicted can be predicted based on these features. Optionally, the second material demand can be the material data generated at the second moment.
[0037] Through the above steps S102 to S108, static features and dynamic features are extracted from the first material demand, wherein the first material demand is data generated at the first moment; the static features and dynamic features are fused into enhanced features, and the enhanced features are converted into hidden layer features; the recent features and periodic features of the first material demand at the second moment are obtained, wherein the second moment is the moment after the first moment, the recent features are used to characterize the material data change trend of the first material demand at the second moment, and the periodic features are used to characterize the periodic change trend of the first material demand; based on the hidden layer features, recent features and periodic features, the second material demand generated at the second moment is predicted. That is, this embodiment extracts static features and dynamic features from the first material demand, then weightedly fuses the static features and dynamic features to obtain enhanced features, and converts the obtained enhanced features into hidden layer features. After obtaining the recent features and periodic features of the first material demand at the second moment to be predicted, the hidden layer features, recent features and periodic features are subjected to quantile regression processing, thereby predicting the second material demand generated at the second moment, thereby solving the technical problem of low accuracy in predicting material data and achieving the technical effect of improving the accuracy of predicting material data.
[0038] The above method of this embodiment is further introduced below.
[0039] As an optional implementation, step S106, obtaining the recent characteristics and periodic characteristics of the first material demand at the second moment, includes: converting the first material demand into sequence data represented in sequence form; capturing and processing the sequence data to obtain the recent characteristics and periodic characteristics.
[0040] In this embodiment, when obtaining the recent characteristics and periodic characteristics of the first material demand at the second moment, the first material demand can be first converted into sequence data, which can be expressed in sequence form, and then the converted sequence data can be captured and processed, so that the recent characteristics and periodic characteristics can be obtained.
[0041] In the above embodiment, the sequence data can be input into the local cycle fusion model for capture and processing, so that the recent features and periodic features can be extracted from the sequence data. The above local cycle fusion model can be trained using multiple sets of data, and each set of data in the multiple sets of data can include sequence data samples and corresponding labels of recent features and labels of periodic features.
[0042] In the above embodiment, the local-cycle fusion model can be used to capture the recent features and periodic features in the sequence data. The network structure diagram of the model can be as follows: Figure 6 As shown. Among them, Figure 6 4 is a network structure diagram of a local loop fusion model according to an embodiment of the present invention.
[0043] In the network structure of the local cycle fusion model in this embodiment, h t It can be used to represent the hidden layer features obtained by the recurrent neural network model (seq2seq model) at different times, h t ,…,h t-k It can be used to represent the hidden layer features of k historical moments, h t+1 It can be used to represent the hidden layer features of the future moment to be predicted, h t , h t-1 ,…,h t-l It can be used to represent l local features, l can be used to represent hyperparameters, whose values can be set according to the specific company business experience, or directly set l = k, and then use the self-attention mechanism to obtain the weight coefficient of each local feature, and finally obtain the weighted recent feature vector υ l , the calculation formula of the weighted recent feature vector can be as follows:
[0044]
[0045]
[0046] Among them, score() can be a distance function used to represent the distance length or correlation between two feature vectors, and α can be used to represent the weight coefficient.
[0047] In the network structure of the local cycle fusion model in this embodiment, h t-p It can be used to represent the features of p moments from the time t+1 to be predicted. p can be used to represent the length of the cycle. This feature can be used to reflect the periodic features corresponding to the time to be predicted. Then, using the convolutional neural network structure, three convolution kernels are used to compare h t-p Convolution is performed on the surrounding m features to obtain 3 convolution features h cj, j can be used to represent the jth convolution kernel, and finally the periodic feature v is obtained through the fully connected layer (Dense layer) of the convolutional neural network p , the calculation formula of the periodic characteristic can be as follows:
[0048]
[0049]
[0050] v p =W5h m +b4
[0051] Among them, Cj can be used to represent the j-th convolution kernel, which is an m-dimensional column vector. Then each h cj It can be used to represent the convolution feature obtained by performing a one-dimensional convolution on m hidden layer features, and then concatenating the three convolution features and inputting them into the Dense layer for full connection operation, so that the periodic feature v can be obtained. p At the same time, the convolution kernel Cj of CNN can be an m-dimensional vector, which can be obtained through the training process after random initialization.
[0052] As an optional implementation, converting the first material requirement into sequence data represented in sequence form includes: deleting abnormal values in the first material requirement and filling in empty values in the first material requirement to obtain a third material requirement, wherein the third material requirement is the material data after processing the first material requirement; sampling the third material requirement to obtain sample data; and constructing sequence data based on the time sequence of the sample data.
[0053] In this embodiment, when converting the first material requirement into sequence data, the first material requirement can be preprocessed first, that is, the abnormal values in the first material requirement are deleted and the empty values in the first material requirement are filled. In this way, the third material requirement after the first material requirement is preprocessed can be obtained, and the third material requirement is sampled to obtain sample data. Since the generation time of the sample data has a chronological order, the sequence data represented in the form of a sequence can be constructed according to the chronological order of the generation time of the sample data.
[0054] In the above embodiment, the hyperparameter k can be set, that is, how long the first material demand (e.g., historical data) is needed to predict the second material demand (e.g., future data). Optionally, this embodiment can be combined with the company's specific business scenario and set k to 356, that is, the material data of the past year can be used to predict the future material data, and then the obtained historical data can be sampled, so that the sequence data of each material can be constructed. At this time, the input data can be D∈R N*k*n, where N can be used to represent the number of materials, k can be used to represent the length of sequence data, and n can be used to represent the feature dimension of the input, that is, the number of features.
[0055] Optionally, the input data D∈R in this embodiment N*k*n It can be a multidimensional time series variable. That is, there are N materials in total, the historical data length of each material is k, each material is represented by an n-dimensional feature vector, that is, k*n, then N materials are represented by an n-dimensional feature vector, that is, N*k*n.
[0056] As an optional implementation, step S104, the static features and dynamic features are fused into enhanced features, including: embedding the static features to obtain a static feature vector corresponding to the static features; inputting the static feature vector and the dynamic features into a static-dynamic selection model for weighted processing to obtain enhanced features, wherein the static-dynamic selection model is trained using multiple sets of data, and each set of data in the multiple sets of data includes: static feature samples, dynamic feature samples and corresponding enhanced feature labels.
[0057] In this embodiment, when fusing static features and dynamic features into enhanced features, the static features can be first embedded. After obtaining the static feature vector corresponding to the static feature, the static feature vector and the dynamic feature are used as input data and input into the static-dynamic selection model for weighted processing. In this way, an enhanced feature that is a fusion of static and dynamic features can be obtained.
[0058] In the above embodiment, the static feature vector obtained can be c x , c h , c c , the values of these three vectors can be the same, just copied into three copies, so that they can be used in different places, where c x It can be used together with dynamic features as input data to the Static-Dynamic Select model to obtain an enhanced feature of static and dynamic fusion.
[0059] It should be noted that in the historical period, dynamic features can be Among them, z t Can be used to represent historical demand, X t It can be used to represent date features. During the forecast period, since the demand is unknown and needs to be predicted by the static and dynamic selection model, the dynamic features input in the forecast stage are only X. t .
[0060] In the above embodiment, the static-dynamic selection model may be trained by machine learning using multiple sets of data, and each set of the multiple sets of data may include static feature samples, dynamic feature samples, and corresponding enhanced feature labels.
[0061] In the above embodiment, the static-dynamic selection model can be used to perform a weighted fusion of static features and dynamic features, so that the enhanced features after fusion can fully reflect the intrinsic relationship between the two types of features. The network structure diagram of this model can be shown as follows Figure 5 As shown. Among them, Figure 5 4 is a network structure diagram of a static-dynamic selection model according to an embodiment of the present invention.
[0062] In the network structure of the static-dynamic selection model in this embodiment, It can be used to represent the jth dynamic feature variable at time t. There are n dynamic feature variables in total. It can be used to represent the variable set of all dynamic feature variables at time t. C can be used to represent static feature variables. This variable is an embedding vector. First, at time t, all dynamic feature variables will pass through a fully connected network Dense layer. This step is similar to embedding or dimensionality reduction operation to obtain η′ t (j) In this process, all dynamic feature variables and static feature variables will go through a gate mechanism to obtain an n-dimensional weight vector. Figure 6 In
[15] , Dense can be used to represent a fully connected layer, ELU can be used to represent the activation function, GAL can be used to represent the gate operation (Gate), addition instruction operation (Add) and normalization operation (LayerNorm), and the calculation formula for the enhanced feature can be as follows:
[0063] v t =softmax(LayerNorm(ζ t +Gate(ρ)))
[0064] Gate(ρ)=σ(W3ρ+b2)⊙(W4ρ+b3)
[0065] ρ=ELU(W1ζ t +W2c+b1)
[0066] Among them, v tIt can be used to represent a weight vector, which is an n-dimensional vector, where each dimension corresponds to the weight of n dynamic features. Softmax() can be used to represent the maximum probability function, ρ can be used to represent the enhanced feature, σ can be used to represent the sigmoid activation function, W is the parameter to be determined, b can be used to represent the partial term coefficient, and c can be used to represent the static feature variable.
[0067] In the above embodiment, first z t A Dense layer operation is performed on c, and after the ELU activation function, the fusion feature ρ is obtained. Then ρ is passed through a Gate operation, similar to the process of vector element screening by the input gate in the Long Short-Term Memory (LSTM) network. Finally, a skip connection is made to add the original input ζt, and finally a weight vector v is obtained after LayerNorm normalization and softmax. t After obtaining the weight vector, the converted multiple dynamic features are weighted and summed to obtain the fusion feature at the current time t The calculation formula of the fusion feature can be as follows:
[0068]
[0069] The static-dynamic selection model in this embodiment enables the model to fuse different dynamic features and static features at the same time, so that the final weight coefficient can reduce the impact of irrelevant features on the prediction, thereby making the features input to the model more expressive.
[0070] As an optional implementation, step S104 converts the enhanced features into hidden layer features, including: inputting the enhanced features into a recurrent neural network model for processing to obtain hidden layer features at multiple moments, wherein the recurrent neural network model is trained using multiple sets of data, and each set of data in the multiple sets of data includes: enhanced feature samples and corresponding hidden layer feature labels.
[0071] In this embodiment, when the enhanced features are converted into hidden layer features, the enhanced features can be input into a recurrent neural network model for processing, so that the hidden layer features at multiple moments can be obtained.
[0072] In the above embodiment, the enhanced features after the fusion of static features and dynamic features are input into the LSTM-based recurrent neural network (Seq2Seq) structure to obtain the hidden layer features at each moment, so that the timing information in the sequence data can be captured, and the hidden layer features at each moment t contain all the timing information before that moment.
[0073] In the above embodiment, the recurrent neural network model can be a sequence fusion recurrent neural network model, which can be trained by machine learning using multiple sets of data, each of which includes: enhanced feature samples and labels of corresponding hidden layer features. The network structure diagram of the model can be as follows Figure 7 As shown, Figure 7 2 is a network structure diagram of a sequence fusion recurrent neural network model according to an embodiment of the present invention.
[0074] In the network structure of the recurrent neural network model in this embodiment, it is assumed that a total of k-length sequence data from the historical time tk to time t is used to predict the material demand at time t+1, z t It can be used to represent dynamic but unknown features in the future. For material demand forecasting scenarios, Z t It can represent the comprehensive characteristics of material demand, material status, etc. at the current time t, X t It can be used to represent dynamic and future-knowable data, such as date, whether it is a holiday, etc. It can be used to represent all dynamic features. Therefore, in the past, the dynamic feature is Xt, while at the node (t+1) to be predicted, the dynamic feature is only Xt. t , S can be used to represent the original static features, which are output as three identical feature vectors c after an Embedding layer x , c h , c c .
[0075] In the above embodiment, the recurrent neural network model can be trained by combining all the historical dynamic features Xt with the static features c x , do a static-dynamic select operation to make the fusion feature more representative. When predicting, use feature X t With static feature c x Perform Static-Dynamic Select operation. Then use a seq2seq structure based on LSTM to obtain the hidden layer features at each moment, where the initial variables of LSTM h and c are static features c h , c c Instead of strengthening the role of static features in encoding and decoding, the hidden layer features at this time contain all the time series information before each moment. Finally, Attention is used to extract recent features, and CNN is used to extract periodic features. Then, a fully connected operation is performed together with the hidden layer features at time t+1. Combined with quantile regression, the prediction results of the three quantiles are obtained. If the next τ values are to be predicted, the same process can be used for rolling iterative prediction.
[0076] As an optional implementation, based on hidden layer features, recent features and periodic features, the second material demand generated at the second moment is predicted, including: inputting the hidden layer features, recent features and periodic features into a quantile regression model for quantile regression processing to obtain prediction data for multiple quantile points, wherein the quantile regression model is trained through machine learning using multiple sets of data, and each set of data in the multiple sets of data includes: hidden layer feature samples, recent feature samples, periodic feature samples and labels of the corresponding quantile point prediction data; the prediction data of multiple quantile points are iteratively processed to obtain the second material demand.
[0077] In this embodiment, when predicting the second material demand generated at the second moment based on the hidden layer features, recent features and periodic features, the hidden layer features, recent features and periodic features can be first input into the quantile regression model for quantile regression processing, so that the prediction data of multiple quantiles can be obtained, and then the prediction data of the obtained multiple quantiles are iteratively processed to obtain the predicted second material demand.
[0078] In the above embodiment, quantiles can be used to predict the results of the three quantile points of 0.1, 0.5 and 0.9 respectively, so that the final prediction result is a fluctuation range, which can better guide the business party to make decisions. The quantile regression loss function can be used to predict the above three quantile points. The quantile regression loss function can be expressed as follows:
[0079] QLoss(y,y′,q)=q(yy′) + +(1-q)(y′-y) + (.) + =max(0, .)
[0080] Among them, y can be used to represent the true value, y' can be used to represent the predicted value, and q can be used to represent the quantile.
[0081] In the above embodiment, the calculation formula for quantile prediction can be as follows:
[0082]
[0083] Among them, i can be used to represent the material number, q can be used to represent the quantile, and τ can be used to represent the prediction step.
[0084] As an optional implementation, the first material demand is the historical material demand, and the second material demand is the predicted material demand.
[0085] In this embodiment, taking the material forecasting scenario as an example, the first material demand quantity may be historical material demand quantity data, and the second material demand quantity may be predicted material demand quantity data.
[0086] The data processing method in this embodiment extracts static features and dynamic features from the first material demand, then weightedly fuses the static features and dynamic features to obtain enhanced features, and converts the enhanced features into hidden layer features. After obtaining the recent features and periodic features of the first material demand at the second moment to be predicted, the hidden layer features, recent features and periodic features are subjected to quantile regression processing to predict the second material demand generated at the second moment, thereby solving the technical problem of low accuracy in predicting material data and achieving the technical effect of improving the accuracy in predicting material data.
[0087] Example 2
[0088] The data processing method in the embodiment of the present invention is further introduced below through preferred implementation modes, and is specifically described by taking the data as material demand as an example.
[0089] In a related technology, material demand forecasting can be achieved within a company's supply chain management scenario by organizing business logic, coding the logical rules, and integrating them into the Material Requirement Planning (MRP) system for calculation. The core concept is to break down the original order demand into material requirements using a bill of materials (BOM). This can be modified based on customer needs through BOM locking and customization.
[0090] Figure 2 This is a flowchart of a method for predicting material demand based on logical rules according to related technologies. Figure 2 As shown, in steps S201 to S208, the business logic is first sorted out to determine the initialization parameters for program operation, such as lead time, procurement cycle, daily inventory and other parameters, and then calculations are performed through the pre-developed MRP system. The calculation logic of the MRP system is a rule logic combined with the company's business scenarios. After obtaining the MRP calculation result, a weighted sum is performed with the historical data to obtain the predicted value. Finally, combined with relevant conditions, it is determined whether to make a purchase.
[0091] The focus of the above-mentioned related technologies is on the calculation logic of the MRP system, which requires a lot of business research and mathematical analysis in the early stage. At the same time, the developed calculation logic is completely based on rules. Although there are optional parameters for dynamic adjustment, the parameters are limited after all, and the rule calculation cannot adapt to dynamic changes in the external environment. For example, the sudden outbreak of an epidemic, extreme weather and other impacts reduce shipments. Once these emergencies occur, if the calculation is still based on the previously specified rules, the prediction results will inevitably not meet actual needs.
[0092] In another related technology, to predict material demand, historical demand data can be constructed into sequence variables as input to solve the undetermined coefficients of a univariate linear regression equation, thereby obtaining a regression equation model for prediction.
[0093] Figure 3 This is a flowchart of a method for predicting material demand based on a linear prediction algorithm according to related technology. Figure 3 As shown, in steps 1 to 9, commodity demand can be predicted based on univariate linear regression and least squares method.
[0094] In the above-mentioned related technologies, since the impact of other factors on demand is not considered, the input of the univariate linear equation is only historical demand, which is a one-dimensional variable. The entire model does not consider the impact of other factors on demand, such as weather, suppliers, procurement ratios, changes in material prices, etc., and the univariate linear regression is a linear model, so the predicted demand is just a linear combination of historical demand. However, in actual business scenarios, future demand is often a nonlinear combination of historical demand, resulting in large deviations in the prediction results.
[0095] In yet another related technology, material demand is predicted, and seasonal commodity demand can be predicted based on time series decomposition.
[0096] Figure 4 This is a flowchart of a method for predicting material demand based on time series decomposition according to related technologies. Figure 4 As shown, in steps S401 to S414, the peak sequence S1 and the normal value sequence S2 of the historical demand data are obtained based on a statistical method, and then S1 is used to mark the peaks and predict the probability P of the future peak. If P is greater than a preset threshold α, it means that there will be a peak in the future. The peak sequence is combined with weather characteristics as input, and the K-nearest neighbor algorithm is used to predict the future peak. If P is less than α, it indicates a normal value prediction. The normal values are aggregated by month, and the monthly median is calculated to replace the original peak value and put into S2, and then S2 is predicted using random forest.
[0097] In the above-mentioned related technologies, although external factors and nonlinear transformations are taken into consideration, whether it is peak labeling K-nearest neighbor prediction or regular value prediction using random forest, a large amount of label annotation and feature processing work is required. At the same time, sequence decomposition is a lossy behavior. Using machine learning related models for prediction will only make biased predictions based on the loss, and the final prediction results will be significantly different from the true values.
[0098] In another related technology, the material demand can be predicted based on an improved BP neural network or a deep spatiotemporal neural network. To predict the demand based on the improved BP neural network, factors affecting inventory can be collected first, and then relevant features can be constructed as input to build a basic BP neural network for prediction. To predict the demand based on the deep spatiotemporal neural network, attention mechanisms and causal extended convolutional networks can be used to capture temporal features.
[0099] In the above-mentioned related technologies, demand is predicted based on an improved BP neural network. The limitation of this method is that ordinary BP networks cannot capture time series features well, and no special processing is performed on the input features. They are directly spliced into vectors as input. Demand is predicted based on a deep spatiotemporal neural network. This method may not be able to capture seasonal related features obviously. The convolutional network needs to superimpose more convolution layers to capture seasonality, which affects the computational efficiency. At the same time, it does not consider the impact of multiple feature inputs on the prediction results. Therefore, both methods will lead to the problem of large deviations in the final prediction results.
[0100] Compared with the traditional MRP system, the material data processing method in the present application can better break through the limitations of logical rules and use external features to improve prediction accuracy. Traditional MRP calculations are all about formulating rules and writing programs in advance, which cannot adapt to external changes. Once a major change occurs, the program can only be rewritten. This technology is an end-to-end model, and changes in external data only require retraining the model; compared with linear models, it mainly includes linear and nonlinear transformations. In industrial scenarios, changes in demand are often an extremely complex process. Simply using a linear model to fit data for prediction will produce poor results; compared with the time decomposition algorithm, time decomposition essentially causes partial loss in the decomposition process, while the method of the present application is an end-to-end model and a lossless model, but it can also extract periodic and recent features internally, which can achieve the effect of time decomposition prediction; compared with the current deep learning model, it more fully considers the fusion of static and dynamic features, and uses different mechanisms to extract recent features and periodic features respectively, strengthens the feature representation of each part, and finally uses quantile regression prediction to provide a predicted fluctuation range.
[0101] Figure 8This is a flow chart of a method for predicting material demand based on a sequence fusion recurrent neural network according to an embodiment of the present invention. Figure 8 As shown, the method may include the following steps:
[0102] Step S801: data preprocessing.
[0103] In the technical solution provided in the above step S801 of the present invention, static features and dynamic features can be obtained after preprocessing the material data.
[0104] Step S802: construct sequence data with a length of K.
[0105] In the technical solution provided in the above step S802 of the present invention, the pre-processed material data can be constructed into sequence data with a length of K.
[0106] Step S803: embed the static features and fuse the static features with the dynamic features.
[0107] In the technical solution provided in the above step S803 of the present invention, after the static features and the dynamic features are fused, the fused enhanced features can be obtained.
[0108] Step S804: extract hidden layer features from the enhanced features using a recurrent neural network model.
[0109] Step S805: extract recent features using the self-attention mechanism.
[0110] Step S806: extract periodic features using a convolutional neural network model.
[0111] Step S807: Perform quantile regression processing on the hidden layer features, recent features, and periodic features.
[0112] Step S808: Calculate and obtain the prediction result of the 0.1 quantile.
[0113] Step S809: Calculate and obtain the prediction result of the 0.5 quantile.
[0114] Step S810: Calculate and obtain the prediction result of the 0.9 quantile.
[0115] In this embodiment, taking the material prediction scenario as an example, the material data is first preprocessed, outliers are deleted, and null values are filled to obtain the historical demand for each material and the corresponding static and dynamic feature related data. Then, the historical data is sampled, and the obtained sample data is constructed into sequence data for each material. The static features and dynamic features are fused to obtain enhanced features, and the enhanced features are input into the LSTM-based Seq2Seq structure to obtain the hidden layer features at each moment to capture the temporal information of the sequence. The hidden layer features at each moment t contain all the information before that moment. Then, the Attention mechanism is used to obtain the recent features of the time moment (t+1) to be predicted, and the specified periodic features are obtained using CNN. Finally, the hidden layer features extracted by Seq2Seq, the recent features extracted by Attention, and the periodic features extracted by CNN are input into the last Dense layer to perform a quantile regression to obtain the predicted values of each quantile point, and then the rolling iteration is continued to predict τ.
[0116] Figure 9 This is a graph showing the prediction results of material demand according to an embodiment of the present invention. The material demand is predicted by the material data processing method according to an embodiment of the present invention. The final partial prediction results can be shown as follows: Figure 9 shown.
[0117] In this embodiment, the cycle length is set to 50, that is, with 50 days as a cycle, and by preprocessing the material data for 170 days of history, outliers in the historical data during this period are deleted and null values are filled. Then, the historical demand for each material and the corresponding static and dynamic feature data are obtained, and sequence data for each material is constructed. After the static and dynamic features are fused to obtain enhanced features, the enhanced features are converted into hidden layer features at each moment. Then, the recent features and cyclical features at the time to be predicted are determined. Quantile regression is performed on the hidden layer features, recent features, and cyclical features, and a rolling iterative process is performed. Ultimately, the changing trends of the material data for the next 50 days can be predicted, and the predicted material data for any day within the next 50 days can be obtained.
[0118] The method for predicting material demand based on sequence fusion recurrent neural network in this embodiment can fully consider the relationship between static features and dynamic features, assign weights to each input feature, strengthen useful features, and reduce useless features; the Attention mechanism can be used to extract recent features to capture the trend changes of the sequence, and CNN can be used to extract periodic features to capture the periodic changes of the sequence, thereby achieving the sequence decomposition prediction effect in a lossless manner; the enhanced features of the fusion of static features and dynamic features can be obtained first, and then Seq2Seq can be used to extract the hidden layer features of the time series information, and finally the recent and periodic features can be obtained for prediction; the corresponding weight coefficients can be used to increase the interpretability of the model; quantile regression can be used to better identify the predicted fluctuation range, providing more constructive prediction results for downstream task decisions.
[0119] Example 3
[0120] According to an embodiment of the present invention, a material data processing device is further provided. The material data processing device can be used to execute the material data processing method of the embodiment of the present invention.
[0121] Figure 10 FIG. 1 is a schematic diagram of a material data processing device according to an embodiment of the present invention. Figure 10 As shown, the material data processing device 1000 may include: an extraction unit 1001 , a fusion unit 1002 , an acquisition unit 1003 and a prediction unit 1004 .
[0122] The extraction unit 1001 is configured to extract static features and dynamic features from a first material requirement, wherein the first material requirement is material data generated at a first moment.
[0123] The fusion unit 1002 is used to fuse the static features and the dynamic features into enhanced features, and convert the enhanced features into hidden layer features.
[0124] The acquisition unit 1003 is used to obtain the recent characteristics and periodic characteristics of the first material demand at the second moment, wherein the second moment is the moment after the first moment, the recent characteristics are used to characterize the material data change trend of the first material demand at the second moment, and the periodic characteristics are used to characterize the periodic change trend of the first material demand.
[0125] The prediction unit 1004 is configured to predict the second material demand generated at the second moment based on the hidden layer features, the recent features, and the periodic features, wherein the second material demand is the material data generated at the second moment.
[0126] The material data processing device in this embodiment extracts static features and dynamic features from the first material demand, then weightedly fuses the static features and dynamic features to obtain enhanced features, and converts the enhanced features into hidden layer features. After obtaining the recent features and periodic features of the first material demand at the second moment to be predicted, the hidden layer features, recent features and periodic features are subjected to quantile regression processing to predict the second material demand generated at the second moment, thereby solving the technical problem of low accuracy in predicting material data and achieving the technical effect of improving the accuracy in predicting material data.
[0127] Example 4
[0128] According to an embodiment of the present invention, a computer-readable storage medium is further provided. The computer-readable storage medium includes a stored program, wherein the program executes the material data processing method described in Example 1.
[0129] Example 5
[0130] According to an embodiment of the present invention, a processor is further provided, which is used to run a program, wherein the material data processing method described in Example 1 is executed when the program is run.
[0131] The serial numbers of the above embodiments of the present invention are for description only and do not represent the advantages or disadvantages of the embodiments.
[0132] In the above embodiments of the present invention, the description of each embodiment has its own focus. For parts that are not described in detail in a certain embodiment, reference can be made to the relevant descriptions of other embodiments.
[0133] In the several embodiments provided in this application, it should be understood that the disclosed technical content can be implemented in other ways. Among them, the device embodiments described above are only exemplary. For example, the division of the units can be a logical function division. In actual implementation, there may be other division methods, such as multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some interfaces, indirect coupling or communication connection of units or modules, which can be electrical or other forms.
[0134] The units described as separate components may or may not be physically separate, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed across multiple units. Some or all of the units may be selected according to actual needs to achieve the purpose of the present embodiment.
[0135] In addition, the functional units in the various embodiments of the present invention may be integrated into a single processing unit, each unit may exist physically separately, or two or more units may be integrated into a single unit. The aforementioned integrated units may be implemented in the form of hardware or software functional units.
[0136] If the integrated unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present invention, or the part that contributes to the relevant technology, or all or part of the technical solution can be embodied in the form of a software product. The computer software product is stored in a storage medium and includes several instructions for enabling a computer device (which can be a personal computer, server or network device, etc.) to perform all or part of the steps of the method described in each embodiment of the present invention. The aforementioned storage medium includes: U disk, read-only memory (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory), mobile hard disk, magnetic disk or optical disk, etc. Various media that can store program codes.
[0137] The above is only a preferred embodiment of the present invention. It should be pointed out that for ordinary technicians in this technical field, several improvements and modifications can be made without departing from the principles of the present invention. These improvements and modifications should also be regarded as within the scope of protection of the present invention.
Claims
1. A material data processing method, characterized in that: Applications in supply chain management include: Extracting static features and dynamic features from the first material demand, wherein the first material demand is material data generated at a first moment, which is a historical moment in supply chain management; the static features are features that do not change over time, including material size, material quality, and material supplier in supply chain management; and the dynamic features are features that change over time, including material status, material price, and matching model in supply chain management; The static features and the dynamic features are fused into enhanced features through a static-dynamic selection model, and the enhanced features are converted into hidden layer features through a recurrent neural network model; Obtaining a recent characteristic and a periodic characteristic of the first material demand at a second moment, wherein the second moment is a moment in supply chain management after the first moment, the recent characteristic is used to characterize a material data change trend of the first material demand at the second moment, and the periodic characteristic is used to characterize a periodic change trend of the first material demand. Obtaining the recent characteristic and the periodic characteristic of the first material demand at the second moment includes: converting the first material demand into sequence data represented in sequence form, and capturing and processing the sequence data to obtain the recent characteristic and the periodic characteristic; The second material demand generated at the second moment is predicted based on the hidden layer features, the recent features, the periodic features and the quantile regression model, wherein the second material demand is the material data generated at the second moment.
2. The method according to claim 1, characterized in that Converting the first material requirement into sequence data represented in a sequence form includes: Deleting abnormal values in the first material requirement and filling in blank values in the first material requirement to obtain a third material requirement, wherein the third material requirement is material data after processing the first material requirement; Sampling the third material demand to obtain sample data; The sequence data is constructed based on the time sequence in which the sample data are generated.
3. The method according to claim 1, characterized in that The static features and the dynamic features are merged into enhanced features, comprising: Performing embedding processing on the static feature to obtain a static feature vector corresponding to the static feature; The static feature vector and the dynamic feature are input into a static-dynamic selection model for weighted processing to obtain the enhanced feature, wherein the static-dynamic selection model is trained using multiple sets of data, and each set of data in the multiple sets of data includes: static feature samples, dynamic feature samples and corresponding enhanced feature labels.
4. The method according to claim 1, wherein Converting the enhanced features into hidden layer features includes: The enhanced features are input into a recurrent neural network model for processing to obtain the hidden layer features at multiple moments, wherein the recurrent neural network model is trained using multiple sets of data, and each set of data in the multiple sets of data includes: enhanced feature samples and corresponding hidden layer feature labels.
5. The method according to claim 1, wherein Predicting a second material demand generated at the second moment based on the hidden layer features, the recent features, and the periodic features includes: Inputting the hidden layer features, the recent features, and the periodic features into a quantile regression model for quantile regression processing to obtain prediction data for multiple quantiles, wherein the quantile regression model is trained using multiple sets of data, each set of the multiple sets of data including: hidden layer feature samples, recent feature samples, periodic feature samples, and labels of the prediction data for the corresponding quantiles; Iteratively process the forecast data of the multiple quantiles to obtain the second material demand.
6. The method according to any one of claims 1 to 5, characterized in that The first material demand is the historical material demand, and the second material demand is the predicted material demand.
7. A material data processing device, characterized in that: Applications in supply chain management include: an extraction unit, configured to extract static features and dynamic features from a first material requirement, wherein the first material requirement is material data generated at a first moment, which is a historical moment in supply chain management; the static features are features that do not change over time, including material size, material quality, and material supplier in supply chain management; and the dynamic features are features that change over time, including material status, material price, and a model used for matching in supply chain management; a fusion unit, configured to fuse the static features and the dynamic features into enhanced features through a static-dynamic selection model, and convert the enhanced features into hidden layer features through a recurrent neural network model; an acquisition unit, configured to acquire a recent characteristic and a periodic characteristic of the first material demand at a second moment, wherein the second moment is a moment in supply chain management after the first moment, the recent characteristic is used to characterize a material data change trend of the first material demand at the second moment, and the periodic characteristic is used to characterize a periodic change trend of the first material demand, the acquisition unit comprising: a conversion module, configured to convert the first material demand into sequence data represented in sequence form, and a capture module, configured to capture and process the sequence data to obtain the recent characteristic and the periodic characteristic; A prediction unit is used to predict the second material demand generated at the second moment based on the hidden layer features, the recent features, the periodic features and the quantile regression model, wherein the second material demand is the material data generated at the second moment.
8. A computer-readable storage medium, characterized in that The computer-readable storage medium includes a stored program, wherein when the program is executed, the device where the computer-readable storage medium is located is controlled to execute the material data processing method according to any one of claims 1 to 6.
9. A processor, characterized in that: The processor is used to run a program, wherein the program, when run by the processor, executes the material data processing method according to any one of claims 1 to 6.
Citation Information
Patent Citations
Script file detection method and device based on artificial intelligence and electronic equipment
CN111680297A
Traffic prediction method of spatio-temporal diagram convolution model based on attribute enhancement
CN112216108A