Material demand prediction method and system, electronic equipment and storage medium
Through the multi-particle data prediction method, combined with historical production data, the material demand is predicted, and the problem of low prediction accuracy in the existing technology is solved, and the accuracy of material procurement and the efficiency of production management is improved.
Patent Information
- Application Number
- CN202311172712.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2023-09-12
- Publication Date
- 2025-03-14
AI Technical Summary
The prior art has low accuracy when predicting material demand, resulting in the risk of default for material procurement.
By obtaining the historical production data of the target product, a multi-particle size data prediction method is adopted, including predicting the first production volume based on the first particle size data and fitting the first prior data, subtracting the second particle size data with the first prior data to obtain the residual data, and then predicting the second production volume based on the residual data, and finally determining the bill of materials.
It improves the accuracy of material demand forecasting, reduces the risk of default, and ensures the smooth progress of the production process.
Smart Images

Figure CN119623676A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of artificial intelligence, and in particular to a material demand forecasting method, system, electronic device and storage medium. Background Art
[0002] In the manufacturing industry, the material procurement cycle is usually long. If material procurement is carried out after receiving a production order, there may be a risk of default. Some solutions are to predict material demand and purchase materials in advance. In this way, after receiving a production order, production can be carried out immediately based on stock preparation, effectively avoiding the risk of default. It can be seen that whether the material demand can be accurately predicted is extremely important for the production management of an enterprise.
[0003] At present, some technologies predict material demand based on simple univariate linear regression algorithms or production data with relatively simple rules. The material demand predicted by these methods is not accurate enough.
[0004] Therefore, a highly accurate material demand forecasting method is urgently needed. Summary of the invention
[0005] In view of this, an embodiment of the present invention provides a material demand forecasting method, a material demand forecasting system, an electronic device and a computer-readable storage medium, which can improve the forecasting accuracy.
[0006] In one aspect, the present invention provides a material demand forecasting method, the method comprising:
[0007] Acquire historical production data of a target product, wherein the historical production data includes first granularity data counted at a first time granularity and second granularity data counted at a second time granularity, wherein the first time granularity is greater than the second time granularity;
[0008] Based on the first granularity data, predicting a first production volume of the target product and fitting first a priori data, the first a priori data referring to historical production data having the same time granularity as the second granularity data obtained by fitting the first granularity data;
[0009] subtracting the second granularity data from the first priori data to obtain first residual data, and predicting a second production volume of the target product based on the first residual data;
[0010] A bill of materials required to produce the target product is determined based on the first production volume and the second production volume.
[0011] Another aspect of the present invention further provides a material demand forecasting system, the system comprising:
[0012] A data acquisition module, used to acquire historical production data of a target product, wherein the historical production data includes first granularity data counted at a first time granularity and second granularity data counted at a second time granularity, wherein the first time granularity is greater than the second time granularity;
[0013] A first prediction module is used to predict a first production volume of the target product and fit first priori data based on the first granularity data, where the first priori data refers to historical production data having the same time granularity as the second granularity data obtained by fitting the first granularity data;
[0014] a residual module, comprising a subtraction module and a second prediction module, wherein the subtraction module is used to subtract the second granularity data from the first priori data, and the second prediction module is used to predict a second production volume of the target product based on the first residual data;
[0015] A bill of materials generation module is used to determine a bill of materials required for producing the target product based on the first production volume and the second production volume.
[0016] Another aspect of the present invention provides an electronic device, which includes a processor and a memory, wherein the memory is used to store a computer program, and when the computer program is executed by the processor, the method described above is implemented.
[0017] Another aspect of the present invention further provides a computer-readable storage medium, wherein the computer-readable storage medium is used to store a computer program, and when the computer program is executed by a processor, the method as described above is implemented.
[0018] In the technical solutions of some embodiments of the present application, the first production volume of the target product is predicted based on the first granularity data, and the first prior data is fitted. The second granularity data is subtracted from the first prior data to obtain the first residual data, and the second production volume of the target product is predicted based on the first residual data. Based on the first production volume and the second production volume, the bill of materials required to generate the target product is determined. On the one hand, this method comprehensively utilizes the data features of the two granularity data, which can make the final predicted production volume of the target product more accurate, thereby improving the accuracy of the bill of materials; on the other hand, the present application first predicts the production volume of the target product, and then determines the bill of materials based on the production volume. This method predicts from the granularity of the product level, not directly from the granularity of the material level. The larger the granularity of the product level, the lower the difficulty of prediction, and the higher the accuracy of the prediction of the production volume, thereby improving the accuracy of the bill of materials. BRIEF DESCRIPTION OF THE DRAWINGS
[0019] The features and advantages of the present invention will be more clearly understood by referring to the accompanying drawings, which are schematic and should not be construed as limiting the present invention in any way. In the accompanying drawings:
[0020] Figure 1 A schematic diagram of a process flow of a material demand forecasting method provided by an embodiment of the present application is shown;
[0021] Figure 2 A schematic diagram showing the relationship between first granularity data, second granularity data and third granularity data provided by an embodiment of the present application is shown;
[0022] Figure 3 A schematic diagram of a module of a material prediction system provided by an embodiment of the present application is shown;
[0023] Figure 4 A schematic diagram of a module of a material prediction system provided by another embodiment of the present application is shown;
[0024] Figure 5 for Figure 4 A module schematic diagram of a processing module in FIG.
[0025] Figure 6 A schematic diagram of an electronic device provided by an embodiment of the present application is shown. DETAILED DESCRIPTION
[0026] In order to make the purpose, technical solutions and advantages of the embodiments of the present invention clearer, 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 described embodiments are 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 those skilled in the art without creative work are within the scope of protection of the present invention.
[0027] In some techniques, the process of forecasting material requirements is as follows:
[0028] 1) Construct the historical consumption data of materials into sequence data;
[0029] 2) Input the sequence data into a univariate linear regression model and solve the parameters of the univariate linear regression model based on the least squares method;
[0030] 3) Predict material demand based on the univariate linear regression model after parameter solution.
[0031] On the one hand, the univariate linear regression model used by these technologies is a relatively simple model, and the predicted material demand is not accurate enough; on the other hand, these technologies use single-granularity data, which has the problem of information loss; on the other hand, these technologies directly predict material demand from the material level, the prediction granularity is small, and the prediction difficulty is greater.
[0032] In view of this, the present application provides a material demand forecasting method that can solve the above problems. The material demand forecasting method can be applied to electronic devices. Electronic devices include but are not limited to laptops, tablet computers, servers, etc. Figure 1 , which is a flow chart of a material demand forecasting method provided in one embodiment of the present application. Figure 1 In the material demand forecasting method, the following steps are included:
[0033] Step S11, obtaining historical production data of the target product, the historical production data including first granularity data counted at a first time granularity and second granularity data counted at a second time granularity, the first time granularity being greater than the second time granularity.
[0034] The target product refers to the product to be produced. The materials required to produce the target product are called materials. For example, when producing boards (i.e., target products), the required materials may include thick film resistors, switching diodes, blade cards, etc.
[0035] In some embodiments, the historical production data may represent the historical data of various production volume influencing factors of the target product. Production volume influencing factors refer to factors that may affect the production volume of the target product, including but not limited to the number of holidays, working days, model of the target product, production capacity (i.e., the number of target products produced per unit time), order volume, etc.
[0036] The historical production data may include first granularity data counted at a first time granularity and second granularity data counted at a second time granularity. The time granularity refers to the smallest time unit for data statistics. Different granularity data represent the historical data of various production volume influencing factors counted at different time granularities. For example, the first time granularity may be a month, and the second time granularity may be a week. The first granularity data may be the historical data of various production volume influencing factors counted on a monthly basis, and the second granularity data may be the historical data of various production volume influencing factors counted on a weekly basis. Each granularity data may include the historical data of various production volume influencing factors obtained by statistics at multiple statistical time points. The statistical time points may be divided according to the corresponding time granularity. For example, assuming that the time granularity is a month, then the first month is the first statistical time point, and the second month may be the second statistical time point; assuming that the time granularity is a week, then the first week of January may be the first statistical time point, and the second week of January may be the second statistical time point, and so on.
[0037] It should be noted that the time spans corresponding to data of different granularities can be the same. For example, the first granularity data and the second granularity data both include the historical data of various production volume influencing factors from January to June. The difference is that the first granularity data is the historical data from January to June counted on a monthly basis, while the second granularity data is the historical data from January to June counted on a weekly basis.
[0038] For ease of understanding, assuming that the factors affecting production volume include holidays, working days, and order volume, examples of first-granularity data and second-granularity data are given below:
[0039] First granularity data = {(number of holidays in January, number of working days in January, number of orders in January), (number of holidays in February, number of working days in February, number of orders in February), ... (number of holidays in June, number of working days in June, number of orders in June)}
[0040] Second granularity data = {(number of holidays in the first week of January, number of working days in the first week of January, number of orders in the first week of January), (number of holidays in the second week of January, number of working days in the second week of January, number of orders in the second week of January), ... (number of holidays in the fourth week of June, number of working days in the fourth week of June, number of orders in the fourth week of June)}
[0041] Step S12, based on the first granularity data, predicting the first production volume of the target product and fitting the first priori data, the first priori data refers to the historical production data having the same time granularity as the second granularity data obtained by fitting the first granularity data.
[0042] In some embodiments, a time series analysis is performed on the first granularity data in the historical production data to predict a first production volume of the target product. The first production volume refers to a first quantity of the target product that needs to be produced within a future period of time. The future period of time refers to the time after the time corresponding to the historical production data.
[0043] In some embodiments, the first priori data refers to second granularity data that can be fitted based on the data features of the first granularity data, that is, information about the second granularity data that can be obtained based on the first granularity data. The second granularity data obtained by fitting and the second granularity data obtained in step S11 may be partially the same, completely the same, or completely different.
[0044] Step S13, subtracting the second granularity data from the first priori data to obtain first residual data, and predicting a second production volume of the target product based on the first residual data.
[0045] From the description of step S12, it can be known that since the first priori data is information of the second granularity data that can be obtained based on the first granularity data, the first priori data can be subtracted from the second granularity data to eliminate redundant information in the second granularity data.
[0046] In some embodiments, subtracting the second granularity data from the first priori data refers to subtracting the data of the corresponding time point and the corresponding production volume influencing factor. For ease of understanding, it is assumed that the first priori data and the second granularity data are as follows:
[0047] The first prior data = {(the number of holidays in the first week of January is 2 days, the number of working days in the first week of January is 5 days, and the number of orders in the first week of January is 30), (the number of holidays in the second week of January is 3 days, the number of working days in the second week of January is 4 days, and the number of orders in the second week of January is 20)};
[0048] Second granularity data = {(the number of holidays in the first week of January is 3 days, the number of working days in the first week of January is 6 days, and the number of orders in the first week of January is 25), (the number of holidays in the second week of January is 2 days, the number of working days in the second week of January is 5 days, and the number of orders in the second week of January is 22)};
[0049] Subtract the second granularity data from the first a priori data, that is, subtract 3 holidays in the first week of January from 2 holidays in the first week of January, subtract 6 working days in the first week of January from 5 working days in the first week of January, and so on. The first residual data obtained by subtracting the second granularity data from the first a priori data is {(1, 1, -5,)(-1, 1, 2)}.
[0050] The first residual data may be information that cannot be obtained based on the first granularity data. The second production volume of the target product predicted based on the first residual data may be the same as or different from the first production volume. Since the first production volume and the second production volume are predicted based on different data, the first production volume and the second production volume are comprehensively considered to make the production volume of the target product more objective and accurate.
[0051] In some embodiments, a time series analysis is performed on the first residual data to predict a second production volume of the target product. The second production volume is similar to the first production volume and is not described in detail here.
[0052] Step S14: determining a bill of materials required to produce the target product based on the first production volume and the second production volume.
[0053] In this embodiment, the average of the first production volume and the second production volume is used as the final production volume of the target product. After obtaining the final production volume of the target product in the future, based on the final production volume and the material types and quantities required for each target product, the bill of materials required for the target product in the future can be determined.
[0054] In summary, in the technical solutions of some embodiments of the present application, the first production volume of the target product is predicted based on the first granularity data, and the first prior data is fitted. The second granularity data is subtracted from the first prior data to obtain the first residual data, and the second production volume of the target product is predicted based on the first residual data. Based on the first production volume and the second production volume, the bill of materials required to generate the target product is determined. On the one hand, this method comprehensively utilizes the data features of the two granularity data, which can make the final predicted production volume of the target product more accurate, thereby improving the accuracy of the bill of materials; on the other hand, the present application first predicts the production volume of the target product, and then determines the bill of materials based on the production volume. This method predicts from the granularity of the product level, and does not directly predict from the granularity of the material level. The larger the granularity of the product level, the lower the difficulty of prediction, the higher the accuracy of the prediction of the production volume, and thus the higher the accuracy of the bill of materials.
[0055] The solution of the present application is further described below.
[0056] In some embodiments, the historical production data further includes third granularity data counted at a third time granularity, and the second time granularity is greater than the third time granularity; the material demand forecasting method of the present application further includes:
[0057] Based on the first residual data, second a priori data is fitted, where the second a priori data refers to historical production data having the same time granularity as the third granularity data obtained by fitting the first residual data;
[0058] subtracting the third granularity data from the second priori data to obtain second residual data, and predicting a third production volume of the target product based on the second residual data;
[0059] The above step S14 of determining the bill of materials required for producing the target product includes:
[0060] Based on the first production volume, the second production volume, and the third production volume, a bill of materials required to produce the target product is determined.
[0061] For example, when the first time granularity is month and the second time granularity is week, the third time granularity may be day. The relationship between the first granularity data, the second granularity data and the third granularity data obtained by statistics of these three time granularities can be as follows: Figure 2 shown. Figure 2 middle:
[0062] The first production volume y1 and the first priori data Q1 of the target product are predicted from the first granularity data;
[0063] After subtracting the second granularity data from the first a priori data Q1, first residual data is obtained, and based on the first residual data, a second production volume y2 of the target product and a second a priori data Q2 are predicted;
[0064] After subtracting the third granularity data from the second priori data Q2, second residual data is obtained, and based on the second residual data, the third production volume y3 of the target product is predicted.
[0065] Based on the first production volume y1, the second production volume y2 and the third production volume y3 (for example, taking the average of these three production volumes), the final production volume of the target product can be obtained, and then based on the final production volume, the bill of materials required to produce the target product can be determined.
[0066] In the above embodiment, the historical production data also includes data of the third granularity. In this way, the data features of data of more granularities can be comprehensively considered, so that the production volume of the target product finally predicted is more accurate.
[0067] Referring to the principle similar to the third granularity data, the historical production data may further include other granularity data, such as fourth granularity data, fifth granularity data, ..., to further make the predicted production volume of the target product more accurate.
[0068] In some embodiments, after obtaining each granularity data, each granularity data may be processed as follows:
[0069] Obtain the characteristic weights of each production volume influencing factor;
[0070] Multiply the historical data of each production volume influencing factor in the granular data by the corresponding feature weight.
[0071] Specifically, the feature weight can characterize the degree of influence of each production volume influencing factor on the production volume of the target product. The greater the influence of the production volume influencing factor on the production volume of the target product, the greater the corresponding feature weight. For example, compared with the number of working days, the order volume has a greater impact on the production volume of the target product, so the feature weight of the order volume can be greater than the feature weight of the working days. For example, take the first granularity data as an example. Assuming that the first time granularity is monthly, the production volume influencing factors include holiday days, working days and order volume, and the feature weight corresponding to the holiday days is v1, the feature weight corresponding to the working days is v2, and the feature weight corresponding to the order volume is v3. Then, after multiplying the historical data of each production volume influencing factor in the first granularity data with the corresponding feature weight, the weighted first granularity data is obtained as follows:
[0072] The first granularity data with weights = {(number of holidays in January * v1, number of working days in January * v2, number of orders in January * v3), (number of holidays in February * v1, number of working days in February * v2, number of orders in February * v3), ...}
[0073] The weighted granular data can reflect the degree of influence of each production volume influencing factor on the production volume of the target product. In this way, the production volume of the target product predicted based on the weighted granular data is more accurate. In this application, the historical data of each production volume influencing factor adjusted based on the feature weight can also be called feature screening. That is, through the feature weight, the production volume influencing factors that have a greater impact on the production volume of the target product are screened out.
[0074] In some embodiments, the feature weight of each production volume influencing factor can be manually set in advance. In this embodiment, considering that the feature weight of each production volume influencing factor is also related to the historical data features between the production volume influencing factors, for example, when the order volume is large, the feature weights of holidays and working days may be small; when the order volume is small, the feature weights of holidays and working days may be large. In view of this, the above-mentioned acquisition of the feature weights of each production volume influencing factor may include:
[0075] Based on the historical data characteristics of each statistical time point, the characteristic weights of each production volume influencing factor at the corresponding statistical time point are determined respectively;
[0076] The above multiplies the historical data of each production volume influencing factor in the granular data by the corresponding feature weight, including:
[0077] Multiply the historical data of production influencing factors at each statistical time point by the feature weight of the corresponding statistical time point.
[0078] Take the first-granularity data as an example. Assuming the first-time granularity is monthly, and the factors affecting production volume include holidays, working days, and order volume, the first-granularity data can be as follows:
[0079] First granularity data = {(number of holidays in January, number of working days in January, number of orders in January), (number of holidays in February, number of working days in February, number of orders in February), ...}
[0080] Based on the historical data characteristics of the first statistical time point (i.e., the historical data characteristics of January), the characteristic weights of each production volume influencing factor at the first statistical time point can be obtained as follows: 11 、v 12 、v 13 ;
[0081] Based on the historical data characteristics of the second statistical time point (i.e., the historical data characteristics of February), the characteristic weights of each production volume influencing factor at the first statistical time point can be obtained as follows: 21 、v 22 、v 23 ;
[0082] And so on.
[0083] Multiply the historical data of production volume influencing factors at each statistical time point by the feature weight of the corresponding statistical time point to obtain the weighted granular data as follows:
[0084] Granular data to be weighted = {(number of holidays in January * v 11 、Number of working days in a month*v 12 、Order volume in January*v 13 )、(number of holidays in February*v 21 、Number of working days in February*v 22 、Order volume in February*v 23 ),...}
[0085] In this way, the feature weights are more accurate.
[0086] In some embodiments, multiplying the historical data of each production volume influencing factor in the granular data by the corresponding feature weight includes:
[0087] Based on the trained neural network, the historical data of the factors affecting production volume are converted to obtain the converted historical data of each factor affecting production volume;
[0088] Multiply the conversion history data of each production volume influencing factor by the corresponding feature weight.
[0089] Specifically, the trained neural network can be a neural network fully connected layer. Each production volume influencing factor can correspond to a neural network fully connected layer. The historical data of each production volume influencing factor can be input into the corresponding neural network fully connected layer, and the neural network fully connected layer outputs the corresponding conversion historical data.
[0090] Let's take the first-granularity data as an example. Assuming the first-time granularity is monthly, the factors affecting production volume include holidays, working days, and order volume. Then the first-granularity data can be as follows:
[0091] First granularity data = {(number of holidays in January, number of working days in January, number of orders in January), (number of holidays in February, number of working days in February, number of orders in February), ...}
[0092] After the first granularity data is converted, the converted first granularity data is as follows:
[0093] The first granularity data after conversion = {(the number of holidays in January after conversion, the number of working days in January after conversion, the number of orders in January after conversion), (the number of holidays in February after conversion, the number of working days in February after conversion, the number of orders in February after conversion), ...}
[0094] By multiplying the conversion history data of each production volume influencing factor by the corresponding feature weight, the weighted granular data obtained can be:
[0095] Weighted granular data = {(converted number of holidays in January * v1, converted number of working days in January * v2, converted number of orders in January * v3), (converted number of holidays in February * v1, converted number of working days in February * v2, converted number of orders in February * v3), ...}; or
[0096] Granular data with weights = {(number of holidays in January after conversion * v 11 、Number of working days in a month after conversion*v 12 , converted January order volume*v 13 )、(the number of holidays in February after conversion*v 21 、Number of working days in February after conversion*v 22 、Converted February order volume*v 23 ),...}
[0097] The historical data of production volume influencing factors are converted, and then the converted historical data is multiplied by the feature weight, so that the feature screening effect is better. For example, when the feature weight is not accurate enough, the historical data of production volume influencing factors can be adjusted based on the fully connected layer of the neural network, so that the final weighted granular data can accurately reflect the importance of each production volume influencing factor.
[0098] In some embodiments, after obtaining each granularity data, each granularity data is processed as follows:
[0099] Each granularity data is linearly transformed to obtain the granularity data after feature alignment, so as to improve the prediction accuracy.
[0100] In some embodiments, the predicted production of each target product needs to be counted at the first time granularity. However, in some time series prediction scenarios, the prediction result and the data used for prediction are of the same time granularity. For example, when the production of the target product is predicted based on the monthly statistical data, the target product is obtained in each month in the future; when the production of the target product is predicted based on the weekly statistical data, the target product is obtained in each week in the future. This results in that when the production of the target product is predicted based on the first residual data or the second residual data, the production is obtained according to the time granularity corresponding to each residual data. For example, the first residual data is weekly statistical data, and the second production of the target product based on the first residual data is weekly statistical; similarly, the second residual data is daily statistical data, and the third production of the target product based on the second residual data is daily statistical. Obviously, this does not meet the granularity statistical requirements for each production of the target product. In order to solve this problem, when predicting the production of the target product based on the residual data, multiple initial productions can be predicted based on the residual data according to the time granularity corresponding to the residual data, and the multiple initial productions are added to obtain the production of the target product.
[0101] In order to more clearly explain the technical solution of the present application, the following is an explanation in conjunction with the material demand forecasting system provided by the present application. The material forecasting system can be a neural network system. Before explaining the material forecasting system, the relevant data definitions are first explained. In the subsequent description:
[0102] X m : represents the mth granularity data, where m is an integer greater than 0. For example, X 1 Indicates the first granularity data, X 2 represents second granularity data;
[0103] It represents the historical data of the m-th granularity data at the statistical time point t, for example It represents the historical data of the first granularity data obtained at the statistical time point t. represents the historical data of the second granularity data obtained by statistics at the statistical time point t;
[0104] It represents the historical data of the Dth production volume influencing factor obtained at the statistical time point t in the mth granularity data, such as represents the historical data of the first production volume influencing factor obtained at the statistical time point t in the first granularity data, represents the historical data of the second production volume influencing factor obtained at the statistical time point t in the first granularity data, Represents the historical data of the first production volume influencing factor obtained at the statistical time point t in the second granularity data.
[0105] Based on the above description, please refer to Figure 3 , which is a module diagram of a material prediction system provided in one embodiment of the present application. Figure 3 In the material demand forecasting system, the material demand forecasting system may include:
[0106] The data acquisition module 31 is used to acquire the historical production data of the target product, and the historical production data includes the first granularity data X counted at the first time granularity. 1 and the second granularity data X counted at the second time granularity 2 , the first time granularity is greater than the second time granularity;
[0107] The first prediction module 32 is used to predict the 1 , predict the first production volume y1 of the target product and fit the first priori data Q1, the first priori data Q1 refers to the first granularity data X 1 The fitted second particle size data X 2 Historical production data with the same time granularity;
[0108] The residual module 33 includes a subtraction module 331 and a second prediction module 332. The subtraction module 331 is used to convert the second granularity data X 2 Subtract the first prior data Q1 to get the first residual data The second prediction module 332 is used to predict the first residual data based on the Predict the second production volume y2 of the target product;
[0109] The BOM generation module 34 is used to determine the BOM required for producing the target product based on the first production volume y1 and the second production volume y2.
[0110] See also Figure 4 , which is a module diagram of a material prediction system provided in another embodiment of the present application. Figure 4 with Figure 3 Basically similar, the main difference is that Figure 4 After acquiring each granularity data, the data acquisition module 41 in the method further processes each granularity data. The first prediction module 42 and the residual module 43 perform prediction based on the processed granularity data.
[0111] Specifically, Figure 4 In the present invention, the material demand forecasting system may include two data acquisition modules 41. One of the data acquisition modules 41 is used to acquire the first granularity data X 1 , another data acquisition module is used to acquire the second granularity data X 2Each data acquisition module 41 may include a weight determination module 45, a conversion module 46, a multiplication module 47, and a feature alignment module 48. The working principle of the material demand forecasting system is described below.
[0112] 41) The first granularity data X 1 Historical data obtained at statistical time point t Input to the weight determination module 45 to obtain the characteristic weights of each production volume influencing factor at the statistical time point t Specifically, the weight determination module 45 may include one or more fully connected layers, an activation module, a gating module, a normalized index module, and a residual connection network ResNet. Among them, the activation module may include a ReLu activation function, the gating module may include a gating function, and the normalized index module may include a normalized index function. The weight determination module 45 determines the feature weight The formula can be as follows:
[0113]
[0114] Gate(z)=sigmoid(W1z+b1)⊙(W2z+b2)
[0115]
[0116] 42) The first granularity data X 1 The historical data of various production volume influencing factors obtained at the statistical time point t Input to the corresponding fully connected layer in the conversion module 46 to obtain the corresponding conversion history data
[0117] 44) The feature weights obtained in step 41) The conversion history data obtained in step 42) Do weighted summation to get the weighted first-granularity data
[0118] 44) The first granularity data with weight The feature alignment module 48 is used to align Perform linear transformation to obtain the first granularity data after feature alignment Specifically, the feature alignment module 48 may include a linear transformation layer. The linear transformation layer may be based on the following formula: Perform a linear transformation:
[0119]
[0120] 45) The first granularity data after feature alignment The first prediction module 42 is input to the first prediction module 42. The first prediction module 42 is based on the first granularity data The first production volume y1 is predicted and the first priori data Q1 is fitted.
[0121] 46) According to the principle similar to step 41) to step 44), the second data acquisition module 41 obtains the second granularity data X 2 Processing is performed to obtain the second granularity data after feature alignment
[0122] 47) The second granularity data The first prior data Q1 is input into the residual module 43. The residual module 43 includes a subtraction module 431 and a second prediction module 432. The subtraction module 431 is used to convert the second granularity data Subtract the first prior data Q1 to get the first residual data The second prediction module 432 is used to predict the The second production volume y2 is predicted.
[0123] 48) The first production volume y1 and the second production volume y2 are input into the bill of materials generation module 44 to obtain the bill of materials required for producing the target product.
[0124] It should be noted that Figure 3 and Figure 4 It is only to take two granularity data as an example for explanation. It is understandable that when the historical production data includes m granularity data, the material demand forecasting system can include m forecasting modules, and the forecasting modules are connected in sequence according to the time granularity corresponding to the granularity data. For example, when the historical production data includes the third granularity data, Figure 4 In the second prediction module, the processing module 49 will fit to obtain the second priori data Q2, and the second priori data Q2 will be input into the prediction module corresponding to the third granularity data to eliminate the second priori data Q2 from the third granularity data. And so on.
[0125] See also Figure 5 ,for Figure 4 A module schematic diagram of the processing module 49 in FIG. Figure 4 In the example, the processing module 49 may include a temporal representation network 491 , a fine-grained reconstruction network 492 , and a prediction network 494 .
[0126] in:
[0127] The time series representation network 491 is used to encode the input granular data, and it can adopt a two-layer GRU structure to better capture the time series characteristics of the time series data.
[0128] The fine-grained reconstruction network 492 is used to fit the prior data based on the output result of the time series representation network 491. The fine-grained reconstruction network 492 can use multiple layers of fully connected layers.
[0129] The prediction network 494 is used to predict the production volume of the target product based on the output result of the time series representation network 491. The prediction network 494 can also use multiple layers of fully connected layers.
[0130] In some embodiments, in order to learn trend information from coarse-grained historical data and to keep the uniqueness of finer-grained data information after the residual structure, the coarse-grained historical data can represent the original fine-grained data information as much as possible. The loss function formula for subtracting the m-th granularity data from the m-1-th prior data can be expressed as:
[0131]
[0132] in, represents the Frobenius norm. M represents the number of time granularities, L Rec represents the loss when the m-th granularity data is subtracted from the m-1-th prior data. m It can also be obtained by processing the m-th granularity data.
[0133] In order not to affect the subsequent more fine-grained information extraction process, when optimizing the above formula, X can be fixed m feature selection and alignment process, and only optimize Q m-1 .
[0134] In some embodiments, for the model loss function, the MSE loss of the prediction task, the reconstruction loss in the multi-granularity residual learning process, and the regularization term can be comprehensively considered, and the total loss function formula of the model can be expressed as:
[0135]
[0136] Where L represents the total loss. α1 and α θ is a hyperparameter used to balance different losses. is L2 regularization, and S is the total step length of the time series.
[0137] See also Figure 6 , is a schematic diagram of an electronic device provided by an embodiment of the present application. The electronic device includes a processor and a memory, the memory is used to store a computer program, and when the computer program is executed by the processor, the above method is implemented.
[0138] The processor may be a central processing unit (CPU). The processor may also be other general-purpose processors, digital signal processors (DSP), application-specific integrated circuits (ASIC), field-programmable gate arrays (FPGA) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, or a combination of the above chips.
[0139] As a non-transitory computer-readable storage medium, the memory can be used to store non-transitory software programs, non-transitory computer executable programs and modules, such as program instructions / modules corresponding to the method in the embodiment of the present invention. The processor executes various functional applications and data processing of the processor by running the non-transitory software programs, instructions and modules stored in the memory, that is, implementing the method in the above method embodiment.
[0140] The memory may include a program storage area and a data storage area, wherein the program storage area may store an operating system, an application required for at least one function; the data storage area may store data created by the processor, etc. In addition, the memory may include a high-speed random access memory, and may also include a non-transitory memory, such as at least one disk storage device, a flash memory device, or other non-transitory solid-state storage device. In some embodiments, the memory may optionally include a memory remotely disposed relative to the processor, and these remote memories may be connected to the processor via a network. Examples of the above-mentioned network include, but are not limited to, the Internet, an intranet, a local area network, a mobile communication network, and combinations thereof.
[0141] One embodiment of the present application further provides a computer-readable storage medium, which is used to store a computer program. When the computer program is executed by a processor, the above method is implemented.
[0142] Although the embodiments of the present invention have been described in conjunction with the accompanying drawings, those skilled in the art may make various modifications and variations without departing from the spirit and scope of the present invention, and such modifications and variations are all within the scope defined by the appended claims.
Claims
1. A material demand forecasting method, characterized in that: The method comprises: Acquire historical production data of a target product, wherein the historical production data includes first granularity data counted at a first time granularity and second granularity data counted at a second time granularity, wherein the first time granularity is greater than the second time granularity; Based on the first granularity data, predicting a first production volume of the target product and fitting first a priori data, the first a priori data referring to historical production data having the same time granularity as the second granularity data obtained by fitting the first granularity data; subtracting the second granularity data from the first priori data to obtain first residual data, and predicting a second production volume of the target product based on the first residual data; A bill of materials required to produce the target product is determined based on the first production volume and the second production volume.
2. The method according to claim 1, characterized in that The historical production data further includes third granularity data counted at a third time granularity, and the second time granularity is greater than the third time granularity; the method further includes: Based on the first residual data, second a priori data is fitted, where the second a priori data refers to historical production data having the same time granularity as the third granularity data obtained by fitting the first residual data; subtracting the third granularity data from the second priori data to obtain second residual data, and predicting a third production volume of the target product based on the second residual data; Determining the bill of materials required to produce the target product includes: A bill of materials required to produce the target product is determined based on the first production volume, the second production volume, and the third production volume.
3. The method according to claim 1 or 2, characterized in that The historical production data represents the historical data of each production volume influencing factor of the target product, and different granularity data represents the historical data of each production volume influencing factor statistically analyzed at different time granularities; after obtaining each granularity data, each granularity data is processed as follows: Obtaining characteristic weights of each of the production volume influencing factors; The historical data of each of the production volume influencing factors in the granular data is multiplied by the corresponding feature weight.
4. The method according to claim 3, characterized in that The granular data includes historical data of various production volume influencing factors obtained by statistics at multiple statistical time points; The step of obtaining the characteristic weights of the various production volume influencing factors includes: Based on the historical data characteristics of each statistical time point, the characteristic weights of each of the production volume influencing factors at the corresponding statistical time point are determined respectively; The multiplying the historical data of each of the production volume influencing factors in the granular data by the corresponding feature weight includes: The historical data of the production volume influencing factors at each statistical time point are multiplied by the feature weight of the corresponding statistical time point.
5. The method according to claim 3, characterized in that The multiplying the historical data of each of the production volume influencing factors in the granular data by the corresponding feature weight includes: Based on the trained neural network, the historical data of the production volume influencing factors are converted to obtain the converted historical data of each of the production volume influencing factors; The conversion history data of each of the production volume influencing factors is multiplied by the corresponding feature weight.
6. The method according to claim 1 or 2, characterized in that: After obtaining the data of each granularity, the data of each granularity is processed as follows: Each granularity data is linearly transformed to obtain granularity data after feature alignment.
7. The method according to claim 1 or 2, characterized in that: The predicted production quantities of the target products are calculated based on the first time granularity; Predicting the production volume of the target product based on the residual data includes: Based on the residual data, predict a plurality of initial production quantities according to the time granularity corresponding to the residual data; The multiple initial production quantities are added together to obtain the production quantity of the target product.
8. A material demand forecasting system, characterized in that: The system comprises: A data acquisition module, used to acquire historical production data of a target product, wherein the historical production data includes first granularity data counted at a first time granularity and second granularity data counted at a second time granularity, wherein the first time granularity is greater than the second time granularity; A first prediction module is used to predict a first production volume of the target product and fit first priori data based on the first granularity data, where the first priori data refers to historical production data having the same time granularity as the second granularity data obtained by fitting the first granularity data; a second prediction module, configured to subtract the second granularity data from the first priori data to obtain first residual data, and predict a second production volume of the target product based on the first residual data; A bill of materials generation module is used to determine a bill of materials required for producing the target product based on the first production volume and the second production volume.
9. A computer-readable storage medium, characterized in that: The computer-readable storage medium is used to store a computer program, and when the computer program is executed by a processor, the method according to any one of claims 1 to 7 is implemented.
10. An electronic device, characterized in that: The electronic device comprises a processor and a memory, wherein the memory is used to store a computer program, and when the computer program is executed by the processor, the method according to any one of claims 1 to 7 is implemented.