CN111401651A - A method for predicting material procurement demand based on LSTM network - Google Patents
A method for predicting material procurement demand based on LSTM network Download PDFInfo
- Publication number
- CN111401651A CN111401651A CN202010213036.3A CN202010213036A CN111401651A CN 111401651 A CN111401651 A CN 111401651A CN 202010213036 A CN202010213036 A CN 202010213036A CN 111401651 A CN111401651 A CN 111401651A
- Authority
- CN
- China
- Prior art keywords
- data
- model
- time
- lstm
- input
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Pending
Links
- 238000000034 method Methods 0.000 title claims abstract description 69
- 239000000463 material Substances 0.000 title claims abstract description 44
- 238000012545 processing Methods 0.000 claims abstract description 19
- 238000003062 neural network model Methods 0.000 claims abstract description 14
- 230000000306 recurrent effect Effects 0.000 claims abstract description 8
- 238000012549 training Methods 0.000 claims description 58
- 230000014509 gene expression Effects 0.000 claims description 17
- 230000000694 effects Effects 0.000 claims description 15
- 238000004140 cleaning Methods 0.000 claims description 12
- 230000008569 process Effects 0.000 claims description 12
- 238000005070 sampling Methods 0.000 claims description 9
- 230000007547 defect Effects 0.000 claims description 8
- 238000003491 array Methods 0.000 claims description 6
- 125000004122 cyclic group Chemical group 0.000 claims description 6
- 230000002159 abnormal effect Effects 0.000 claims description 5
- 238000010586 diagram Methods 0.000 description 11
- 238000009826 distribution Methods 0.000 description 11
- 238000005457 optimization Methods 0.000 description 10
- 238000007726 management method Methods 0.000 description 7
- 238000013079 data visualisation Methods 0.000 description 5
- 239000006185 dispersion Substances 0.000 description 4
- 230000006870 function Effects 0.000 description 4
- 239000004020 conductor Substances 0.000 description 3
- 238000010276 construction Methods 0.000 description 3
- 238000011156 evaluation Methods 0.000 description 3
- 230000007774 longterm Effects 0.000 description 3
- 238000007711 solidification Methods 0.000 description 3
- 230000008023 solidification Effects 0.000 description 3
- 230000009286 beneficial effect Effects 0.000 description 2
- 238000011161 development Methods 0.000 description 2
- 238000005516 engineering process Methods 0.000 description 2
- 238000003306 harvesting Methods 0.000 description 2
- 230000006872 improvement Effects 0.000 description 2
- 230000015654 memory Effects 0.000 description 2
- 230000006403 short-term memory Effects 0.000 description 2
- 230000004913 activation Effects 0.000 description 1
- 238000013528 artificial neural network Methods 0.000 description 1
- 238000004364 calculation method Methods 0.000 description 1
- 238000010835 comparative analysis Methods 0.000 description 1
- 238000007405 data analysis Methods 0.000 description 1
- 230000007423 decrease Effects 0.000 description 1
- 230000003247 decreasing effect Effects 0.000 description 1
- 230000007812 deficiency Effects 0.000 description 1
- 230000001934 delay Effects 0.000 description 1
- 238000012217 deletion Methods 0.000 description 1
- 230000037430 deletion Effects 0.000 description 1
- 238000013461 design Methods 0.000 description 1
- 238000000605 extraction Methods 0.000 description 1
- 238000012417 linear regression Methods 0.000 description 1
- 238000012986 modification Methods 0.000 description 1
- 230000004048 modification Effects 0.000 description 1
- 238000010606 normalization Methods 0.000 description 1
- 238000013439 planning Methods 0.000 description 1
- 238000007781 pre-processing Methods 0.000 description 1
- 238000000611 regression analysis Methods 0.000 description 1
- 238000011160 research Methods 0.000 description 1
- 238000013468 resource allocation Methods 0.000 description 1
- 238000012546 transfer Methods 0.000 description 1
Images
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06Q—INFORMATION AND COMMUNICATION TECHNOLOGY [ICT] SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES; SYSTEMS OR METHODS SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES, NOT OTHERWISE PROVIDED FOR
- G06Q10/00—Administration; Management
- G06Q10/04—Forecasting or optimisation specially adapted for administrative or management purposes, e.g. linear programming or "cutting stock problem"
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06N—COMPUTING ARRANGEMENTS BASED ON SPECIFIC COMPUTATIONAL MODELS
- G06N3/00—Computing arrangements based on biological models
- G06N3/02—Neural networks
- G06N3/04—Architecture, e.g. interconnection topology
- G06N3/044—Recurrent networks, e.g. Hopfield networks
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06N—COMPUTING ARRANGEMENTS BASED ON SPECIFIC COMPUTATIONAL MODELS
- G06N3/00—Computing arrangements based on biological models
- G06N3/02—Neural networks
- G06N3/04—Architecture, e.g. interconnection topology
- G06N3/045—Combinations of networks
Landscapes
- Engineering & Computer Science (AREA)
- Physics & Mathematics (AREA)
- Theoretical Computer Science (AREA)
- Business, Economics & Management (AREA)
- General Physics & Mathematics (AREA)
- Computational Linguistics (AREA)
- Health & Medical Sciences (AREA)
- Biomedical Technology (AREA)
- Data Mining & Analysis (AREA)
- Evolutionary Computation (AREA)
- General Health & Medical Sciences (AREA)
- Molecular Biology (AREA)
- Computing Systems (AREA)
- General Engineering & Computer Science (AREA)
- Artificial Intelligence (AREA)
- Mathematical Physics (AREA)
- Software Systems (AREA)
- Life Sciences & Earth Sciences (AREA)
- Biophysics (AREA)
- Strategic Management (AREA)
- Economics (AREA)
- Human Resources & Organizations (AREA)
- Game Theory and Decision Science (AREA)
- Development Economics (AREA)
- Entrepreneurship & Innovation (AREA)
- Marketing (AREA)
- Operations Research (AREA)
- Quality & Reliability (AREA)
- Tourism & Hospitality (AREA)
- General Business, Economics & Management (AREA)
- Management, Administration, Business Operations System, And Electronic Commerce (AREA)
Abstract
Description
技术领域technical field
本发明涉及预测物资采购需求方法技术领域,具体来说,涉及一种基于LSTM网络预测物资采购需求量的方法。The invention relates to the technical field of methods for predicting material procurement requirements, in particular to a method for predicting material procurement requirements based on an LSTM network.
背景技术Background technique
当前,我国社会经济快速发展,各个职能部门,如电力部门,对于物资的需求越来越高,这促进了电网工程市场的繁荣,也对相关企业提出了更大的挑战,只有进一步优化企业管理和各种资源配置,提高资源利用率和工程设计开发效率,才能适应市场新情况,迎接各种挑战。At present, with the rapid development of my country's society and economy, various functional departments, such as the power department, have higher and higher demand for materials, which has promoted the prosperity of the power grid engineering market, and has also brought greater challenges to related enterprises. Only by further optimizing enterprise management And various resource allocation, improve resource utilization and engineering design and development efficiency, in order to adapt to the new market situation and meet various challenges.
以电力部门、企业为例,如何准确预测变电站及配网工程的物资需求、在保障工程进度的前提下提高资金利用率,节约成本,具有重要意义,有助于提升这些部门、企业的竞争力。Taking the power sector and enterprises as an example, how to accurately predict the material needs of substations and distribution network projects, improve capital utilization and save costs on the premise of ensuring the progress of the project, is of great significance and helps to improve the competitiveness of these departments and enterprises. .
在物资需求预测方面,现有技术中一般使用采购物资需求预测模型进行预测,该模型首先通过对近三年可研批复数据和综合计划数据以及项目物资历史采购订单的整理,得到项目实际计划采购金额、实际采购金额、电压等级以及相关小类采购情况等属性信息,然后通过项目的属性信息对项目进行聚类,并确认聚类结果所属的项目类型,接着以总投资金额和项目类型为出发点,同时考虑到年度增长率、项目批复影响因素、物资单价浮动、设备使用状态等要素,对小类采购量进行回归分析,剔除不显著的影响因素,得到多因素的回归系数,最后通过得到的多元回归模型以及未来一段时间内相关因素的取值预测各类物资采购需求量。In the aspect of material demand forecasting, the existing technology generally uses the procurement material demand forecasting model for forecasting. The model first obtains the actual planned procurement of the project by sorting out the feasibility study approval data and comprehensive planning data in the past three years, as well as the historical purchase orders for project materials. Attribute information such as amount, actual purchase amount, voltage level, and related sub-category purchase status, and then cluster the projects through the project attribute information, and confirm the project type to which the clustering result belongs, and then take the total investment amount and project type as the starting point At the same time, taking into account factors such as annual growth rate, project approval factors, material unit price fluctuations, equipment use status and other factors, a regression analysis was carried out on the purchase volume of small categories, and insignificant factors were eliminated to obtain multi-factor regression coefficients. Finally, through the obtained The multiple regression model and the values of related factors in the future predict the demand for various materials procurement.
但是,现有的采购物资需求预测模型存在以下缺陷:1、数据冗余、离散,物品购买量波动大,没有对采购数据进行数据清洗,忽略了异常值对预测带来的影响;2、采购需求的影响因子太多,普通的线性回归模型并不能很好的拟合出预测函数;3、没有考虑历史采购量之间的时序关系,预测精确度较低。However, the existing procurement material demand prediction model has the following defects: 1. The data is redundant and discrete, and the purchase volume of items fluctuates greatly. The procurement data is not cleaned, and the impact of outliers on the prediction is ignored; 2. The procurement There are too many influencing factors of demand, and the ordinary linear regression model cannot fit the prediction function well; 3. The time series relationship between historical purchases is not considered, and the prediction accuracy is low.
针对相关技术中的问题,目前尚未提出有效的解决方案。For the problems in the related technologies, no effective solutions have been proposed so far.
发明内容SUMMARY OF THE INVENTION
(一)解决的技术问题(1) Technical problems solved
针对现有技术的不足,本发明提供了基于LSTM网络预测物资采购需求量的方法,具备预测精度高,可实现采购优化及成本优化的目的,进而解决背景技术中的问题。In view of the deficiencies of the prior art, the present invention provides a method for predicting the demand for material procurement based on the LSTM network, which has high prediction accuracy, and can achieve the purposes of procurement optimization and cost optimization, thereby solving the problems in the background art.
(二)技术方案(2) Technical solutions
为实现上述具备预测精度高,可实现采购优化及成本优化的目的,本发明采用的具体技术方案如下:In order to achieve the above-mentioned purposes of having high prediction accuracy and realizing procurement optimization and cost optimization, the specific technical solutions adopted in the present invention are as follows:
一种基于LSTM网络预测物资采购需求量的方法,包括以下步骤:A method for predicting material procurement requirements based on LSTM network, comprising the following steps:
S1:采用预设方法对预先采集的数据进行数据处理;S1: use a preset method to perform data processing on the pre-collected data;
S2:通过预设方法对原预测模型和循环神经网络模型进行对比;S2: Compare the original prediction model and the recurrent neural network model by a preset method;
S3:采用预设方法构建LSTM模型,并将所述处理后的数据作为所述LSTM模型的输入,获取预测值。S3: Construct an LSTM model by using a preset method, and use the processed data as the input of the LSTM model to obtain a predicted value.
作为优选,所述步骤S1采用预设方法对预先采集的数据进行数据处理具体包括以下步骤:Preferably, the step S1 adopts a preset method to perform data processing on the pre-collected data, which specifically includes the following steps:
S11:通过预备的数据库进行所需数据的采集,得到采集数据;S11: Collect the required data through the prepared database to obtain the collected data;
S12:通过预设方法对所述采集数据进行数据清洗,得到处理后的数据。通过上述处理,可以得到更加客观真实的购买量。S12: Perform data cleaning on the collected data by a preset method to obtain processed data. Through the above processing, a more objective and real purchase amount can be obtained.
作为优选,所述步骤S12通过预设方法对所述采集数据进行数据清洗,得到处理后的数据具体包括以下步骤:Preferably, the step S12 performs data cleaning on the collected data by a preset method, and obtaining the processed data specifically includes the following steps:
S121:对所述采集数据中的原始时序数据进行随机采样和估计得到多条估计数据,并对随机采样产生的空缺点补齐,获得多条补齐估计数据;S121: Perform random sampling and estimation on the original time series data in the collected data to obtain a plurality of pieces of estimation data, and fill up the gaps and defects generated by the random sampling to obtain a plurality of pieces of fill-in estimation data;
S122:按采样时间点对所有的所述补齐估计数据进行分类,获得多组时间分类数据,并对每组所述时间分类数据按照大小进行排序得到多组排序数组;S122: Classify all the supplemented estimated data according to the sampling time point, obtain multiple groups of time-classified data, and sort each group of the time-classified data according to size to obtain multiple groups of sorted arrays;
S123:对多组所述排序数组进行处理获得多个对应的平均值数据,并通过多个所述平均值数据构成均值序列;S123: Process multiple groups of the sorted arrays to obtain a plurality of corresponding average data, and form an average sequence by using the plurality of average data;
S124:输出所述均值序列,即完成对购买量异常数据的清除,得到处理后的数据。通过上述处理,有效地去掉了异常过高过低购买量,使得数据离散性低,具有一定规律性。S124: Outputting the mean value sequence, that is, completing the removal of the abnormal data of the purchase amount, and obtaining the processed data. Through the above processing, the abnormally high and low purchase volume is effectively removed, so that the data has low discreteness and certain regularity.
作为优选,所述步骤S2通过预设方法对原预测模型和循环神经网络模型进行对比具体包括以下步骤:将原预测模型和循环神经网络模型从数据处理、函数关系、时间依赖性、趋势4个方面进行对比分析,针对原预测模型的缺陷找出更合适的预测模型。通过上述处理,可以针对原预测模型的缺陷找出更合适的预测模型。Preferably, the step S2 compares the original prediction model and the cyclic neural network model by a preset method, and specifically includes the following steps: comparing the original prediction model and the cyclic neural network model from four data processing, functional relationship, time dependence, and trend. A comparative analysis is carried out in terms of aspects, and a more suitable prediction model is found according to the defects of the original prediction model. Through the above processing, a more suitable prediction model can be found for the defects of the original prediction model.
作为优选,所述步骤S3采用预设方法构建LSTM模型,并将所述处理后的数据作为所述LSTM模型的输入,获取预测值具体包括以下步骤:Preferably, the step S3 adopts a preset method to construct an LSTM model, and uses the processed data as the input of the LSTM model, and obtaining the predicted value specifically includes the following steps:
S31:通过预设方法建立LSTM模型;S31: establish an LSTM model by a preset method;
S32:将所述处理后的数据作为所述LSTM模型的输入序列,并标记为{x1,x2,……xt……},其中,xt代表时刻为t时刻的输入;S32: Use the processed data as the input sequence of the LSTM model, and mark it as {x 1 , x 2 ,...x t ...}, where x t represents the input at time t;
S33:对所述LSTM模型进行训练,得到遗忘门权重Wf、遗忘门偏置bf、输入门权重Wi、输入门偏置bi、cell权重Wc、cell偏置bc、输出门权重Wo和输出门偏置bo;S33: Train the LSTM model to obtain forget gate weight W f , forget gate bias b f , input gate weight Wi , input gate bias bi , cell weight W c , cell bias b c , and output gate weight W o and output gate bias b o ;
S34:当所述LSTM模型训练好后,将处理后的t时刻数据输入训练好的所述LSTM模型中,得到t+1时刻的数据,即为预测值。通过上述处理,可以得到LSTM模型,并可以通过LSTM模型获取预测值。S34: After the LSTM model is trained, input the processed data at time t into the trained LSTM model, and obtain the data at time t+1, which is the predicted value. Through the above processing, an LSTM model can be obtained, and a predicted value can be obtained through the LSTM model.
作为优选,所述步骤S31通过预设方法建立LSTM模型具体包括以下步骤:Preferably, the step S31 to establish an LSTM model by a preset method specifically includes the following steps:
S311:选择性的忘记上一个节点传出来的输入信息,并通过计算得到遗忘门限ft+1作为忘记门控,来控制上一个状态的ct-1哪些需要遗忘,遗忘门限ft+1的表达式为:S311: Selectively forget the input information from the previous node, and obtain the forgetting threshold f t+1 as the forgetting gate by calculating, to control which c t-1 of the previous state need to be forgotten, and the forgetting threshold f t+1 The expression is:
ft+1=σ(Wf·[ht,xt]+bf);f t+1 =σ(W f ·[h t , x t ]+b f );
其中,ht表示t时刻单元的输出,Wf表示遗忘门权重,bf表示遗忘门的偏置,xt表示t时刻的输入,σ表示sigmod函数;Among them, h t represents the output of the unit at time t, W f represents the weight of the forget gate, b f represents the bias of the forget gate, x t represents the input at time t, and σ represents the sigmod function;
S312:对所述输入信息进行选择性的记忆,用it+1表示输入门限,并用t时刻cell状态Ct对选择门的控制信号进行控制,输入门限it+1和t时刻的cell状态Ct的表达式分别为:S312: Selectively memorize the input information, use i t+1 to represent the input threshold, and use the cell state C t at time t to control the control signal of the selection gate, input the threshold it + 1 and the cell state at time t The expressions of C t are:
it+1=σ(Wi·[ht,xt]+bi),Ct=tanh(Wc·[ht,xt]+bc);i t+1 =σ(W i ·[h t , x t ]+b i ), C t =tanh(W c ·[h t , x t ]+b c );
其中,Wi表示输入门权重,bi表示输入门的偏置,Wc表示cell的权重,bc表示cell的偏置;Among them, Wi represents the weight of the input gate, bi represents the bias of the input gate, W c represents the weight of the cell, and bc represents the bias of the cell;
S313:对所述t时刻cell的状态Ct进行更新,得到t+1时刻的cell的状态Ct+1,t+1时刻的cell的状态Ct+1的表达式为:S313: Update the state C t of the cell at time t to obtain the state C t+1 of the cell at time t+1, and the expression of the state C t+1 of the cell at time t+1 is:
Ct+1=ft+1*Ct+it+1*Ct;C t+1 =f t+1 *C t +i t+1 *C t ;
S314:通过输出门限Ot+1来控制,并对上一阶段得到的Ot进行放缩,得到t+1时刻的输出ht+1,输出门限Ot+1和t+1时刻的输出ht+1的表达式分别为:S314: Controlled by the output threshold O t+1 , and scaling the O t obtained in the previous stage to obtain the output h t+1 at time t+1 , the output thresholds O t+1 and the output at time t+1 The expressions of h t+1 are:
Ot+1=σ(Wo·[ht,xt]+bo),ht+1=Ot+1*tanh(Ct+1);O t+1 =σ(W o ·[h t , x t ]+b o ), h t+1 =O t+1 *tanh(C t+1 );
其中,Wo表示输出门权重,bo表示输出门的偏置。通过上述处理,可以实现LSTM模型的构建。where W o represents the output gate weight, and b o represents the output gate bias. Through the above processing, the construction of the LSTM model can be realized.
作为优选,所述步骤S33中对所述LSTM模型进行训练还包括以下步骤:在训练所述LSTM模型时,分别以1天、7天、8天、10天、12天为周期进行训练,然后选取训练效果最好的模型进行预测。通过上述处理,可以得到更好地训练结果。Preferably, the training of the LSTM model in the step S33 further includes the following steps: when training the LSTM model, the training is performed in cycles of 1 day, 7 days, 8 days, 10 days and 12 days respectively, and then The model with the best training effect is selected for prediction. Through the above processing, better training results can be obtained.
作为优选,所述步骤S33中对所述LSTM模型进行训练还包括以下步骤:Preferably, the training of the LSTM model in the step S33 further includes the following steps:
对于训练不足的情况,通过增加网络中的节点,或者增加网络的训练周期来达到训练效果;In the case of insufficient training, the training effect can be achieved by increasing the nodes in the network or increasing the training period of the network;
对于过度拟合的情况,通多减少或控制训练周期,在数据出现拐点前,停止对网络的训练来达到训练效果。通过上述处理,保证了LSTM模型的训练效果。In the case of overfitting, the training period can be reduced or controlled, and the training of the network is stopped before the inflection point of the data to achieve the training effect. Through the above processing, the training effect of the LSTM model is guaranteed.
(三)有益效果(3) Beneficial effects
与现有技术相比,本发明提供了基于LSTM网络预测物资采购需求量的方法,具备以下有益效果:Compared with the prior art, the present invention provides a method for predicting the demand for material procurement based on the LSTM network, which has the following beneficial effects:
(1)、本发明通过数据清洗对数据进行处理,去掉了异常过高过低购买量,使得数据离散性低,具有一定规律性,从而有效地避免了异常值对预测带来的影响,提高了其预测精度。(1) The present invention processes the data through data cleaning, and removes the abnormally high and low purchase volume, so that the data has low discreteness and certain regularity, thereby effectively avoiding the impact of abnormal values on prediction, improving its prediction accuracy.
(2)、本发明通过对比原预测模型和循环神经网络模型,构建LSTM模型,通过非线性关系可以更好的拟合复杂的关节分布,良好的映射输入输出之间的关系,使预测模型能够灵活应用于负责的关节分布,保证其预测效果。(2) The present invention constructs the LSTM model by comparing the original prediction model and the cyclic neural network model, and can better fit the complex joint distribution through the nonlinear relationship, and map the relationship between the input and output well, so that the prediction model can It is flexibly applied to the responsible joint distribution to ensure its prediction effect.
(3)、本发明通过构建基于LSTM网络的物资采购预测模型并进行训练,考虑历史采购量之间的时序关系,根据时间序列增加或减少水平,能够随着时间的推移不断重复模式,提升了模型的预测精确度。(3) In the present invention, by constructing and training a material procurement prediction model based on LSTM network, considering the time series relationship between historical procurement quantities, and increasing or decreasing the level according to the time series, the model can be repeated over time, improving the The prediction accuracy of the model.
(4)、本发明将t-1时刻更新后的cell状态和cell的输出还有t时刻的数据作为输入,通过三路输入和一路输出的配合使用,使得LSTM模型能够记住长期的状态,从而使得其能够有效的解决长距离依赖问题。(4) The present invention uses the updated cell state at time t-1 and the output of the cell as well as the data at time t as input. Through the combination of three inputs and one output, the LSTM model can remember the long-term state. Therefore, it can effectively solve the long-distance dependence problem.
(5)、本发明通过采购需求预测模型对传统采购需求收集进行验证、指导到最终的逐步替代及IT固化,使电信运营商采购需求管理工作科学、细化、高效,采购流程上释放人力、提高效率,采购需求上准确预测、精益管理,有计划地进行采购,有效降低突发采购成本、仓储成本和工程时间成本,实现采购优化及成本优化。(5) The present invention verifies and guides the collection of traditional procurement requirements through the procurement demand prediction model, and guides to the final step-by-step replacement and IT solidification, so that the procurement demand management work of telecom operators is scientific, refined and efficient, and the procurement process releases manpower, Improve efficiency, accurately predict procurement needs, lean management, and carry out procurement in a planned way, effectively reducing sudden procurement costs, warehousing costs and engineering time costs, and achieve procurement optimization and cost optimization.
附图说明Description of drawings
为了更清楚地说明本发明实施例或现有技术中的技术方案,下面将对实施例中所需要使用的附图作简单地介绍,显而易见地,下面描述中的附图仅仅是本发明的一些实施例,对于本领域普通技术人员来讲,在不付出创造性劳动的前提下,还可以根据这些附图获得其他的附图。In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the accompanying drawings required in the embodiments will be briefly introduced below. Obviously, the drawings in the following description are only some of the present invention. In the embodiments, for those of ordinary skill in the art, other drawings can also be obtained according to these drawings without any creative effort.
图1是根据本发明实施例的基于LSTM网络预测物资采购需求量的方法的流程图;Fig. 1 is a flowchart of a method for predicting material procurement demand based on an LSTM network according to an embodiment of the present invention;
图2是根据本发明实施例的基于LSTM网络预测物资采购需求量的方法中10kv变压器清洗前后的数据可视化图;2 is a data visualization diagram before and after cleaning of a 10kv transformer in a method for predicting material procurement requirements based on an LSTM network according to an embodiment of the present invention;
图3是根据本发明实施例的基于LSTM网络预测物资采购需求量的方法中10kv电缆终端采购数据清洗前后的数据可视化图;3 is a data visualization diagram before and after cleaning of 10kv cable terminal procurement data in the method for predicting material procurement requirements based on an LSTM network according to an embodiment of the present invention;
图4是根据本发明实施例的基于LSTM网络预测物资采购需求量的方法中LSTM模型结构的结构示意图;4 is a schematic structural diagram of an LSTM model structure in a method for predicting material procurement requirements based on an LSTM network according to an embodiment of the present invention;
图5是根据本发明实施例的基于LSTM网络预测物资采购需求量的方法中10kv变压器的训练结果的示意图;5 is a schematic diagram of a training result of a 10kv transformer in a method for predicting material procurement requirements based on an LSTM network according to an embodiment of the present invention;
图6是根据本发明实施例的基于LSTM网络预测物资采购需求量的方法中10kv电缆终端的预测结果的示意图;6 is a schematic diagram of a prediction result of a 10kv cable terminal in a method for predicting material procurement requirements based on an LSTM network according to an embodiment of the present invention;
图7是根据本发明实施例的基于LSTM网络预测物资采购需求量的方法中低压开关柜的预测结果示意图;7 is a schematic diagram of a prediction result of a low-voltage switchgear in a method for predicting material procurement requirements based on an LSTM network according to an embodiment of the present invention;
图8是根据本发明实施例的基于LSTM网络预测物资采购需求量的方法中电力电缆的预测结果示意图;8 is a schematic diagram of a prediction result of a power cable in a method for predicting material procurement requirements based on an LSTM network according to an embodiment of the present invention;
图9是根据本发明实施例的基于LSTM网络预测物资采购需求量的方法中架空绝缘导线的预测结果示意图;9 is a schematic diagram of a prediction result of an overhead insulated wire in a method for predicting material procurement requirements based on an LSTM network according to an embodiment of the present invention;
图10是根据本发明实施例的基于LSTM网络预测物资采购需求量的方法中接地铁的预测结果示意图。FIG. 10 is a schematic diagram of the prediction result of the grounding line in the method for predicting the demand for material procurement based on the LSTM network according to an embodiment of the present invention.
具体实施方式Detailed ways
为进一步说明各实施例,本发明提供有附图,这些附图为本发明揭露内容的一部分,其主要用以说明实施例,并可配合说明书的相关描述来解释实施例的运作原理,配合参考这些内容,本领域普通技术人员应能理解其他可能的实施方式以及本发明的优点,图中的组件并未按比例绘制,而类似的组件符号通常用来表示类似的组件。In order to further illustrate the various embodiments, the present invention provides accompanying drawings, which are part of the disclosure of the present invention, and are mainly used to illustrate the embodiments, and can be used in conjunction with the relevant descriptions in the specification to explain the operation principles of the embodiments. For these, those of ordinary skill in the art will understand other possible implementations and the advantages of the present invention. Components in the figures are not drawn to scale, and similar component symbols are generally used to represent similar components.
根据本发明的实施例,提供了一种基于LSTM网络预测物资采购需求量的方法。According to an embodiment of the present invention, a method for predicting the demand for material procurement based on an LSTM network is provided.
现结合附图和具体实施方式对本发明进一步说明,如图1-10所示,根据本发明实施例的基于LSTM网络预测物资采购需求量的方法,包括以下步骤:The present invention will now be further described with reference to the accompanying drawings and specific embodiments. As shown in Figures 1-10, the method for predicting the demand for material procurement based on an LSTM network according to an embodiment of the present invention includes the following steps:
S1:采用预设方法对预先采集的数据进行数据处理;S1: use a preset method to perform data processing on the pre-collected data;
其中,所述S1具体包括以下步骤:Wherein, the S1 specifically includes the following steps:
S11:通过预备的数据库进行所需数据的采集,得到采集数据;S11: Collect the required data through the prepared database to obtain the collected data;
具体的,本实施例中选用的都是采购量大,采购周期频繁的物品,包括6个种类,分别是10kv变压器、10kv电缆终端、低压开关柜、电力电缆、架空绝缘导线、接地铁。选择其中的10kv变压器、10kv电缆终端进行数据可视化展示,由于数据波动较大,离散性太高,对于采购预测模型的建立不够友好,所以需要进行数据清洗,将购买量异常过高和过低的数据删除,如图2所示为10kv变压器清洗前后的数据可视化图,如图3为10kv电缆终端采购数据清洗前后的数据可视化图。Specifically, the items selected in this embodiment are items with large purchase volume and frequent purchase cycles, including 6 types, namely 10kv transformers, 10kv cable terminals, low-voltage switch cabinets, power cables, overhead insulated conductors, and grounding lines. Among them, 10kv transformer and 10kv cable terminal are selected for data visualization display. Because the data fluctuates greatly and the discreteness is too high, it is not friendly enough for the establishment of the procurement prediction model. Therefore, data cleaning is required, and the purchase volume is abnormally high and low. Data deletion, as shown in Figure 2 is the data visualization diagram before and after cleaning the 10kv transformer, and Figure 3 is the data visualization diagram before and after cleaning the 10kv cable terminal procurement data.
本实施例中的数据来源于国网物资部2014-2019收获数据,根据国网上海市电力公司的一篇文章基于大数据分析的协议库存需求预测研究的项目聚类整体分布表选出占比前6的种类,并从2014-2019收获数据表中整理出6种种类的日期及其相应的购买量。The data in this example comes from the 2014-2019 harvest data of the State Grid Materials Department. According to an article of the State Grid Shanghai Electric Power Company, the proportion of the project clustering overall distribution table of the research on agreement inventory demand forecasting based on big data analysis is selected. Top 6 species, and collate the dates of the 6 species and their corresponding purchases from the 2014-2019 harvest data table.
S12:通过预设方法对所述采集数据进行数据清洗,得到处理后的数据。S12: Perform data cleaning on the collected data by a preset method to obtain processed data.
具体的,所述S12具体包括以下步骤:Specifically, the S12 specifically includes the following steps:
S121:对所述采集数据中的原始时序数据进行随机采样和估计得到多条估计数据,并对随机采样产生的空缺点补齐,获得多条补齐估计数据;S121: Perform random sampling and estimation on the original time series data in the collected data to obtain a plurality of pieces of estimation data, and fill up the gaps and defects generated by the random sampling to obtain a plurality of pieces of fill-in estimation data;
S122:按采样时间点对所有的所述补齐估计数据进行分类,获得多组时间分类数据,并对每组所述时间分类数据按照大小进行排序得到多组排序数组;S122: Classify all the supplemented estimated data according to the sampling time point, obtain multiple groups of time-classified data, and sort each group of the time-classified data according to size to obtain multiple groups of sorted arrays;
S123:对多组所述排序数组进行处理获得多个对应的平均值数据,并通过多个所述平均值数据构成均值序列;S123: Process multiple groups of the sorted arrays to obtain a plurality of corresponding average data, and form an average sequence by using the plurality of average data;
S124:输出所述均值序列,即完成对购买量异常数据的清除,得到处理后的数据。S124: Outputting the mean value sequence, that is, completing the removal of the abnormal data of the purchase amount, and obtaining the processed data.
S2:通过预设方法对原预测模型和循环神经网络模型进行对比;S2: Compare the original prediction model and the recurrent neural network model by a preset method;
其中,所述S2具体包括以下步骤:由于原预测模型不能友好的专注长时间的预测,因此,本实施例中通过将原预测模型和循环神经网络模型从数据处理、函数关系、时间依赖性、趋势4个方面进行对比分析,针对原预测模型的缺陷找出更合适的预测模型,如表1所示为原模型和循环神经网络模型对比。Wherein, the S2 specifically includes the following steps: since the original prediction model cannot focus on long-term prediction friendly, therefore, in this embodiment, the original prediction model and the cyclic neural network model are analyzed from data processing, functional relationship, time dependence, The four aspects of the trend are compared and analyzed, and a more suitable prediction model is found according to the defects of the original prediction model. Table 1 shows the comparison between the original model and the recurrent neural network model.
表1 原模型和循环神经网络模型对比Table 1 Comparison of original model and recurrent neural network model
LSTM(Long Short-Term Memory)是长短期记忆网路,是一种时间递归神经网络,适合于处理和预测时间序列中间隔和延迟相对较长的重要事件,如图4是一个典型的LSTM模型结构,图中xt代表t时刻的输入,ht代表这一时刻cell的输出,中间的cell中展示了具体的数值传递计算的这么一个过程。LSTM (Long Short-Term Memory) is a long short-term memory network, a time recurrent neural network, suitable for processing and predicting important events with relatively long intervals and delays in time series, as shown in Figure 4 is a typical LSTM model Structure, in the figure x t represents the input at time t, h t represents the output of the cell at this time, and the middle cell shows such a process of specific value transfer calculation.
LSTM内部主要是三个阶段:There are three main stages inside LSTM:
1)忘记阶段:这个阶段主要是对上一个节点传进来的输入进行选择性忘记。简单来说就是会“忘记不重要的,记住重要的”,通过计算得到的ft+1来作为忘记门控,来控制上一个状态的ct-1哪些需要遗忘。1) Forgetting stage: This stage is mainly to selectively forget the input from the previous node. In short, it will "forget the unimportant, remember the important", and use the calculated f t+1 as the forget gate to control which c t-1 of the previous state need to be forgotten.
2)选择记忆阶段:这个阶段将这个阶段的输入有选择性地进行“记忆”。主要是会对输入xt进行记忆,哪些重要的着重记录下来,哪些不重要的,则少记一点,当前输入内容由前面计算得到的C表示,选择门的控制信号是由Ct进行控制。2) Select the memory stage: This stage selectively "memory" the input of this stage. The main thing is to memorize the input x t , which are important to focus on recording, and which are not important, remember a little less, the current input content is represented by the previously calculated C, and the control signal of the selection gate is controlled by C t .
3)输出阶段:这个阶段将决定哪些将会被当成当前状态的输出。主要是通过Ot+1来进行控制的,并且还对上一阶段得到的Ot进行了放缩(通过一个tanh激活函数进行变化)。3) Output stage: This stage will decide which will be regarded as the output of the current state. It is mainly controlled by O t+1 , and the O t obtained in the previous stage is also scaled (changed by a tanh activation function).
具体的,如S3所示为LSTM模型的构建和模型的表达式。Specifically, as shown in S3, the construction of the LSTM model and the expression of the model are shown.
S3:采用预设方法构建LSTM模型,并将所述处理后的数据作为所述LSTM模型的输入,获取预测值;S3: using a preset method to construct an LSTM model, and using the processed data as the input of the LSTM model to obtain a predicted value;
其中,所述S3具体包括以下步骤:Wherein, the S3 specifically includes the following steps:
S31:通过预设方法建立LSTM模型;S31: establish an LSTM model by a preset method;
具体的,所述S31具体包括以下步骤:Specifically, the S31 specifically includes the following steps:
S311:选择性的忘记上一个节点传出来的输入信息,并通过计算得到遗忘门限ft+1作为忘记门控,来控制上一个状态的ct-1哪些需要遗忘,遗忘门限ft+1的表达式为:S311: Selectively forget the input information from the previous node, and obtain the forgetting threshold f t+1 as the forgetting gate by calculating, to control which c t-1 of the previous state need to be forgotten, and the forgetting threshold f t+1 The expression is:
ft+1=σ(Wf·[ht,xt]+bf);f t+1 =σ(W f ·[h t , x t ]+b f );
其中,ht表示t时刻单元的输出,Wf表示遗忘门权重,bf表示遗忘门的偏置,xt表示t时刻的输入,σ表示sigmod函数;Among them, h t represents the output of the unit at time t, W f represents the weight of the forget gate, b f represents the bias of the forget gate, x t represents the input at time t, and σ represents the sigmod function;
S312:对所述输入信息进行选择性的记忆,用it+1表示输入门限,并用t时刻cell状态Ct对选择门的控制信号进行控制,输入门限it+1和t时刻的cell状态Ct的表达式分别为:S312: Selectively memorize the input information, use i t+1 to represent the input threshold, and use the cell state C t at time t to control the control signal of the selection gate, input the threshold it + 1 and the cell state at time t The expressions of C t are:
it+1=σ(Wi·[ht,xt]+bi),Ct=tanh(Wc·[ht,xt]+bc);i t+1 =σ(W i ·[h t , x t ]+b i ), C t =tanh(W c ·[h t , x t ]+b c );
其中,Wi表示输入门权重,bi表示输入门的偏置,Wc表示cell的权重,bc表示cell的偏置;Among them, Wi represents the weight of the input gate, bi represents the bias of the input gate, W c represents the weight of the cell, and bc represents the bias of the cell;
S313:对所述t时刻cell的状态Ct进行更新,得到t+1时刻的cell的状态Ct+1,t+1时刻的cell的状态Ct+1的表达式为:S313: Update the state C t of the cell at time t to obtain the state C t+1 of the cell at
Ct+1=ft+1*Ct+it+1*Ct;C t+1 =f t+1 *C t +i t+1 *C t ;
S314:通过输出门限Ot+1来控制,并对上一阶段得到的Ot进行放缩,得到t+1时刻的输出ht+1,输出门限Ot+1和t+1时刻的输出ht+1的表达式分别为:S314: Controlled by the output threshold O t+1 , and scaling the O t obtained in the previous stage to obtain the output h t+1 at time t+1 , the output thresholds O t+1 and the output at
Ot+1=σ(Wo·[ht,xt]+bo),ht+1=Ot+1*tanh(Ct+1);O t+1 =σ(W o ·[h t , x t ]+b o ), h t+1 =O t+1 *tanh(C t+1 );
其中,Wo表示输出门权重,bo表示输出门的偏置。where W o represents the output gate weight, and b o represents the output gate bias.
S32:将所述处理后的数据作为所述LSTM模型的输入序列,并标记为{x1,x2,……xt……},其中,xt代表时刻为t时刻的输入;S32: Use the processed data as the input sequence of the LSTM model, and mark it as {x 1 , x 2 ,...x t ...}, where x t represents the input at time t;
S33:对所述LSTM模型进行训练,得到遗忘门权重Wf、遗忘门偏置bf、输入门权重Wi、输入门偏置bi、cell权重Wc、cell偏置bc、输出门权重Wo和输出门偏置bo;S33: Train the LSTM model to obtain forget gate weight W f , forget gate bias b f , input gate weight Wi , input gate bias bi , cell weight W c , cell bias b c , and output gate weight W o and output gate bias b o ;
具体的,传统模型预测需要大量的数据作为支撑,但是对国网物资采购的预测由于数据量不够大,并不能很好的拟合出采购量的线性方程,为了使现有的数据量的利用率达到最大化,本实施例在训练模型时,分别以1天、7天、8天、10天、12为周期(比如以7天为周期,则将1号到7号数据相加作为一个数据,8号到14号数据相加作为一个数据,后面数据以此类推)进行训练,然后选取效果最好的模型进行预测;Specifically, the traditional model prediction requires a large amount of data as support, but the prediction of the State Grid’s material procurement cannot fit the linear equation of the procurement volume well due to the insufficient data volume. In order to make the use of the existing data volume In this example, when training the model, the cycle is 1 day, 7 days, 8 days, 10 days, and 12 respectively (for example, if the cycle is 7 days, the data from No. 1 to No. 7 are added together as a Data, the data from No. 8 to No. 14 are added as one data, and the latter data are analogized) for training, and then the model with the best effect is selected for prediction;
由于各物品的数据分布参差不齐,而且在训练过程中常常因为训练数据较少或者是离散性太高而导致训练不足和过度拟合。过度拟合指的是由于训练数据过少,或者对训练集训练的次数过多,导致模型的结果不是找到所有数据的一般共有特性,而是仅对训练数据进行了特征提取。换句话说,这个模型已经记住了所有的训练数据,对训练数据的预测效果非常好,但对其他数据的预测效果非常差。Due to the uneven data distribution of each item, and in the training process, insufficient training and overfitting are often caused because the training data is too small or the dispersion is too high. Overfitting refers to the fact that due to too little training data, or too many training times for the training set, the result of the model is not to find the general common characteristics of all the data, but only to perform feature extraction on the training data. In other words, the model has memorized all the training data and predicts very well on the training data but very poorly on other data.
对于训练不足的情况来说,可以通过增加网络中的节点,或者增加网络的训练周期来达到训练效果;In the case of insufficient training, the training effect can be achieved by increasing the nodes in the network or increasing the training period of the network;
对于过度拟合的情况来说,可以通多减少或控制训练周期,在数据出现拐点前,停止对网络的训练来达到训练效果。In the case of overfitting, the training period can be reduced or controlled, and the training of the network can be stopped before the inflection point of the data to achieve the training effect.
S34:当所述LSTM模型训练好后,将处理后的t时刻数据输入训练好的所述LSTM模型中,得到t+1时刻的数据,即为预测值。S34: After the LSTM model is trained, input the processed data at time t into the trained LSTM model, and obtain the data at
具体的,在训练LSTM模型时,可能需要缩放序列预测问题的数据。当输入数据序列分布并不标准,或者变化幅度(标准差)过大时,这会减慢网络的学习和收敛速度,也会阻碍网络的学习效率。由于物品采购数据集中存在异常值和较多噪音,故本实施例中采用归一化来对处理后t时刻的数据进行再处理,可以间接通过中心化避免异常值和极端值的影响,归一化公式为:x=(x-μ)/σ,其中,x表示原值,μ表示均值,σ表示方差。Specifically, when training an LSTM model, it may be necessary to scale the data for sequence prediction problems. When the distribution of the input data sequence is not standard, or the variation range (standard deviation) is too large, it will slow down the learning and convergence speed of the network, and also hinder the learning efficiency of the network. Since there are outliers and more noise in the item purchase data set, normalization is used in this embodiment to reprocess the data at time t after processing, which can indirectly avoid the influence of outliers and extreme values through centralization, and normalize The formula is: x=(x-μ)/σ, where x represents the original value, μ represents the mean value, and σ represents the variance.
为了更好地理解本技术方案,本实施中还包括误差评估和预测结果展示两个部分。In order to better understand the technical solution, this implementation also includes two parts: error evaluation and prediction result display.
1)误差评估1) Error evaluation
为了评价对比在原有顺序时间序列之上,引入新特征组后的LSTM神经网络模型的预测性能,选择平均绝对误差(MAE)、均方根误差(RMSE)和相对准确率来进行误差评估。因为在采购数量过少的时刻点,评估相对准确率时,误差会比采购数量相对较大的时刻点大得多,而且采购量太少也没有预测的必要,所以在算相对准确率时删除了与真实采购量均值相差过大的数据。In order to evaluate the prediction performance of the LSTM neural network model after the introduction of the new feature group on the original sequential time series, the mean absolute error (MAE), root mean square error (RMSE) and relative accuracy were selected for error evaluation. Because at the time point when the purchase quantity is too small, when evaluating the relative accuracy, the error will be much larger than at the time point when the purchase quantity is relatively large, and the purchase quantity is too small and there is no need to predict, so delete it when calculating the relative accuracy rate The data is too different from the actual average purchase volume.
①平均绝对误差(MAE),是指所有预测值与真实值之间偏差绝对值的平均值,其表达式为:MAE能更好的反映预测值与真实值误差的实际情况,MAE值越大,表明预测值与真实值之间的差别越大,预测效果越差,反之越好。①Mean absolute error (MAE), refers to the average value of the absolute value of the deviation between all predicted values and the true value, and its expression is: MAE can better reflect the actual situation of the error between the predicted value and the actual value. The larger the MAE value, the greater the difference between the predicted value and the actual value, the worse the prediction effect, and vice versa.
②均方根误差(RMSE),是指所有预测值与真实值之差的平方的平均值,再开平方得到的值,其表达式为;RMSE对于一组预测的特小或特大误差非常敏感,可以很好反映预测的精密度,因此同MAE一样,RMSE越大,预测效果则越差。②The root mean square error (RMSE) refers to the average value of the square of the difference between all predicted values and the actual value, and then the value obtained by the square root, its expression is; RMSE is very sensitive to very small or large errors in a set of predictions, and can well reflect the precision of prediction. Therefore, like MAE, the larger the RMSE, the worse the prediction effect.
③相对准确率,相对准确率和MAE以及RMSE不同,准确率越高,则表示预测效果越好,预测精度越高,其表达式为:相对 ③ Relative accuracy, relative accuracy is different from MAE and RMSE. The higher the accuracy, the better the prediction effect and the higher the prediction accuracy. The expression is: relative
以上表达式中fi表示i点的预测值,yi表示i点的真实值,N表示数据数目。In the above expression, f i represents the predicted value of point i, y i represents the actual value of point i, and N represents the number of data.
2)预测结果展示2) Prediction result display
依据物品采购需求建立采购预测体系,开展采购链全流程建模,推动电力物资全供应链的统一数据体系的构建,开发一套适用于电力物资未来采购需求预处理算法,并通过采购需求预测模型对传统采购需求收集进行验证、指导到最终的逐步替代及IT固化,使电信运营商采购需求管理工作科学、细化、高效,采购流程上释放人力、提高效率,采购需求上准确预测、精益管理,有计划地进行采购,有效降低突发采购成本、仓储成本和工程时间成本,实现采购优化及成本优化。Establish a procurement forecasting system based on the procurement requirements of goods, carry out the whole process modeling of the procurement chain, promote the construction of a unified data system for the entire supply chain of power materials, develop a set of preprocessing algorithms suitable for future procurement requirements of power materials, and use the procurement demand forecast model. Verify and guide the collection of traditional procurement requirements to the final step-by-step replacement and IT solidification, so that the management of procurement requirements of telecom operators is scientific, refined and efficient, freeing manpower and improving efficiency in the procurement process, accurate forecasting and lean management of procurement requirements. , Purchasing in a planned way, effectively reducing unexpected procurement costs, warehousing costs and engineering time costs, and achieving procurement optimization and cost optimization.
为了验证引入后模型对准确度的提升,本实施中选用采购频率较高的6种类别进行预测,他们分别是10kv变压器、10kv电缆终端、低压开关柜、电力电缆、架空绝缘导体、接地铁。本实施中对上面6个种类的数据输入到先前写好的预测模型中进行训练,表2各类别训练后的绝对平均误差、均方根误差和准确率的数据展示(以不同周期的数据作为输入,选取出训练结果做好的模型)。In order to verify the improvement of the accuracy of the model after the introduction, 6 categories with higher procurement frequency are selected for prediction in this implementation. They are 10kv transformers, 10kv cable terminals, low-voltage switch cabinets, power cables, overhead insulated conductors, and grounding lines. In this implementation, the above 6 types of data are input into the previously written prediction model for training. Table 2 shows the data display of the absolute average error, root mean square error and accuracy rate after each type of training (taking the data of different periods as Input, select the model with the training results).
表2各类别通过LSTM模型训练后的数据Table 2 Data of each category after training by LSTM model
在进行物品采购预测训练的时候发现以1天、7天、8天、10天、12为周期进行训练出来的结果截然不同,是由于各个物品对于不同周期的数据分布不一样,离散性也不一致,所以本实施例针对不同物品采用不同的预测周期,以10kv变压器为例,展示采用不同时间周期进行训练的结果,看出针对不同时间周期的绝对平方差、均方根误差和准确率都有所不同,如表3为10kv变压器的数据输入到预测模型训练之后的结果。During the training of item purchase prediction, it was found that the results of training in cycles of 1 day, 7 days, 8 days, 10 days, and 12 were completely different, because the data distribution of each item for different cycles was different, and the discreteness was also inconsistent. , so this example uses different prediction periods for different items. Taking a 10kv transformer as an example, the results of training with different time periods are shown. It can be seen that the absolute squared difference, root mean square error and accuracy rate of The difference, as shown in Table 3, is the result after the data of the 10kv transformer is input to the prediction model training.
表310kv变压器的训练结果Table 310kv transformer training results
其中,图5-10分别为LSTM模型6个类别预测结果,在进行各类别训练过程中,分别尝试了以1天、7天、8天、10天、12天为周期进行训练,由于各物品的数据分布不同,而且离散程度也各不相同,训练过程中发现10kv变压器、接地铁2种类别的物品以10天为周期进行训练的结果比较好,能到达比较好的预测精度,10kv电缆终端、架空绝缘导线是以一周为周期进行训练,能到达很好的预测精度,低压开关柜是以8天为周期进行训练,电力电缆是以12天为周期进行训练,能够达到各自最优的预测精度。Among them, Figure 5-10 shows the prediction results of 6 categories of LSTM model. In the process of training each category, we tried to train in cycles of 1 day, 7 days, 8 days, 10 days and 12 days. The distribution of the data is different, and the degree of dispersion is also different. During the training process, it was found that the 10kv transformer and the grounding line were trained in a period of 10 days. The results are better, and can achieve better prediction accuracy. 10kv cable terminal . The overhead insulated conductor is trained in a cycle of one week, which can achieve good prediction accuracy. The low-voltage switchgear is trained in a cycle of 8 days, and the power cable is trained in a cycle of 12 days, which can achieve their respective optimal predictions. precision.
本实施例中通过预测结果发现只有10kv变压器和接地铁的预测精度达到了90%以上,因为它们的数据量大,数据分布规律性好,离散性低,可以很好的提取其中的时间特征组,所以在预测训练的时候能够达到很好的效果。According to the prediction results in this example, it is found that the prediction accuracy of only the 10kv transformer and the grounding line has reached more than 90%. Because of their large amount of data, good data distribution regularity and low discreteness, the time feature group can be well extracted. , so it can achieve good results in prediction training.
具体的,如图5所示为10kv变压器的训练结果,实线为真实值,虚线为预测值,由于10kv变压器的数据量大,而且离散度不高,预测模型能够很好的提取出其中的特征,10kv变压器的预测周期为10天,从图中可以清楚的看到10kv变压器的预测精度是很高的,达到了0.93。Specifically, as shown in Figure 5, the training results of the 10kv transformer are shown. The solid line is the real value, and the dotted line is the predicted value. Since the data volume of the 10kv transformer is large and the dispersion is not high, the prediction model can extract the Characteristic, the prediction period of the 10kv transformer is 10 days. It can be clearly seen from the figure that the prediction accuracy of the 10kv transformer is very high, reaching 0.93.
如图6所示为10kv电缆终端的预测结果,实线为真实值,虚线为预测值,10kv电缆终端预测周期为7天,10kv电缆终端的原始数据过于离散,经过数据处理之后还是存在过高过低的数据,导致最后的预测精度并不是很高,达到了0.78。Figure 6 shows the prediction results of the 10kv cable terminal, the solid line is the real value, the dotted line is the predicted value, the prediction period of the 10kv cable terminal is 7 days, the original data of the 10kv cable terminal is too discrete, and there is still too high after data processing Too low data, resulting in the final prediction accuracy is not very high, reaching 0.78.
如图7所示为低压开关柜的预测结果图,实线为真实值,虚线为预测值,低压开光柜的预测周期为8天,低压开关柜的预测精度不高,只有0.69。Figure 7 shows the prediction result of the low-voltage switchgear. The solid line is the actual value, and the dotted line is the predicted value. The prediction period of the low-voltage switchgear is 8 days, and the prediction accuracy of the low-voltage switchgear is not high, only 0.69.
如图8所示为电力电缆的预测结果,实线为真实值,虚线为预测值,电力电缆预测周期为12天,电力电缆的预测精度为0.69。Figure 8 shows the prediction result of the power cable, the solid line is the real value, the dotted line is the predicted value, the prediction period of the power cable is 12 days, and the prediction accuracy of the power cable is 0.69.
如图9为架空绝缘导线的预测结果,实线为真实值,虚线为预测值,架空绝缘导线的预测周期为7天,预测精度为0.8。Figure 9 shows the prediction result of the overhead insulated wire, the solid line is the real value, the dotted line is the predicted value, the prediction period of the overhead insulated wire is 7 days, and the prediction accuracy is 0.8.
如图10为接地铁的预测结果,实线为真实值,虚线为预测值,接地铁的预测周期为10天,由于接地铁的数据量大,而且离散度不高,能够很好的提取出其中的特征,预测精度达到了0.9。As shown in Figure 10, the prediction result of the grounding line is the real value, the dashed line is the predicted value, and the forecasting period of the grounding line is 10 days. Due to the large amount of data of the grounding line and the low degree of dispersion, it can be extracted very well. Among them, the prediction accuracy reached 0.9.
本方案的预测原理为:由于对物资采购量的影响因子很多,要找到这些影响因子就需要建立一个影响因子与采购量的模型,拟合出影响因子与采购量的函数关系。但是物资采购量的影响因子太多,普通的线性方程并不能完整的拟合出采购量和影响因子之间的关系,而且国网物资的采购与时间序列具有很大的关联性,而LSTM网络模型提出的方法刚好可以拟合出一种非线性的函数关系,而且可以很好的利用(如何利用在模型中数据输入中有所体现)具有时间序列的数据,表现出时间序列数据的一些关系。The prediction principle of this scheme is as follows: Since there are many influencing factors on the purchasing quantity of materials, to find these influencing factors, it is necessary to establish a model of influencing factors and purchasing quantity, and fit the functional relationship between the influencing factors and purchasing quantity. However, there are too many influencing factors of material purchases, and ordinary linear equations cannot completely fit the relationship between purchases and influencing factors, and the purchase of materials by the State Grid is closely related to the time series, while the LSTM network The method proposed by the model can just fit a nonlinear functional relationship, and can make good use of (how to use it in the data input in the model) data with time series, showing some relationships of time series data .
综上所述,借助于本发明的上述技术方案,通过数据清洗对数据进行处理,去掉了异常过高过低购买量,使得数据离散性低,具有一定规律性,从而有效地避免了异常值对预测带来的影响,提高了其预测精度。To sum up, with the help of the above technical solutions of the present invention, the data is processed through data cleaning, and the abnormally high and low purchase volume is removed, so that the data has low discreteness and certain regularity, thereby effectively avoiding abnormal values. The impact on the prediction has improved its prediction accuracy.
此外,本发明通过对比原预测模型和循环神经网络模型,构建LSTM模型,通过非线性关系可以更好的拟合复杂的关节分布,良好的映射输入输出之间的关系,使预测模型能够灵活应用于负责的关节分布,保证其预测效果。In addition, the present invention constructs the LSTM model by comparing the original prediction model and the cyclic neural network model, and can better fit the complex joint distribution through the nonlinear relationship, and map the relationship between the input and output well, so that the prediction model can be flexibly applied It depends on the distribution of the responsible joints to ensure its prediction effect.
此外,本发明通过构建基于LSTM网络的物资采购预测模型并进行训练,考虑历史采购量之间的时序关系,根据时间序列增加或减少水平,能够随着时间的推移不断重复模式,提升了模型的预测精确度。In addition, by constructing and training a material procurement prediction model based on an LSTM network, the present invention considers the time series relationship between historical procurement quantities, increases or decreases the level according to the time series, and can repeat the pattern over time, improving the model's performance. prediction accuracy.
此外,本发明将t-1时刻更新后的cell状态和cell的输出还有t时刻的数据作为输入,通过三路输入和一路输出的配合使用,使得LSTM模型能够记住长期的状态,从而使得其能够有效的解决长距离依赖问题。In addition, the present invention uses the updated cell state at time t-1, the output of the cell, and the data at time t as input, and through the combined use of three inputs and one output, the LSTM model can remember the long-term state, so that the It can effectively solve the long-distance dependence problem.
此外,本发明通过采购需求预测模型对传统采购需求收集进行验证、指导到最终的逐步替代及IT固化,使电信运营商采购需求管理工作科学、细化、高效,采购流程上释放人力、提高效率,采购需求上准确预测、精益管理,有计划地进行采购,有效降低突发采购成本、仓储成本和工程时间成本,实现采购优化及成本优化。In addition, the present invention verifies and guides the collection of traditional procurement requirements through the procurement demand prediction model, and guides the final step-by-step replacement and IT solidification, so that the procurement demand management work of telecom operators is scientific, refined and efficient, and the procurement process releases manpower and improves efficiency. ,Accurate prediction of procurement requirements, lean management, and planned procurement, effectively reduce sudden procurement costs, warehousing costs and engineering time costs, and achieve procurement optimization and cost optimization.
在本发明中,以上所述仅为本发明的较佳实施例而已,并不用以限制本发明,凡在本发明的精神和原则之内,所作的任何修改、等同替换、改进等,均应包含在本发明的保护范围之内。In the present invention, the above descriptions are only preferred embodiments of the present invention, and are not intended to limit the present invention. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present invention shall be Included in the protection scope of the present invention.
Claims (8)
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202010213036.3A CN111401651A (en) | 2020-03-24 | 2020-03-24 | A method for predicting material procurement demand based on LSTM network |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202010213036.3A CN111401651A (en) | 2020-03-24 | 2020-03-24 | A method for predicting material procurement demand based on LSTM network |
Publications (1)
Publication Number | Publication Date |
---|---|
CN111401651A true CN111401651A (en) | 2020-07-10 |
Family
ID=71429057
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN202010213036.3A Pending CN111401651A (en) | 2020-03-24 | 2020-03-24 | A method for predicting material procurement demand based on LSTM network |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN111401651A (en) |
Cited By (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN114718359A (en) * | 2022-04-29 | 2022-07-08 | 河北工程大学 | A sponge city underground garage self-power generation and rainwater utilization system |
CN118428862A (en) * | 2024-07-05 | 2024-08-02 | 江西博微新技术有限公司 | Inventory material purchase prediction method and system |
CN118567237A (en) * | 2024-07-29 | 2024-08-30 | 中国电建集团贵阳勘测设计研究院有限公司 | A flocculation equipment selection and control method |
CN118863160A (en) * | 2024-07-16 | 2024-10-29 | 山东佳烨检验检测有限公司 | A method for predicting demand for building cement materials |
Citations (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN104679834A (en) * | 2015-02-06 | 2015-06-03 | 北京工商大学 | Time series data cleaning method and system |
US20180137412A1 (en) * | 2016-11-16 | 2018-05-17 | Cisco Technology, Inc. | Network traffic prediction using long short term memory neural networks |
-
2020
- 2020-03-24 CN CN202010213036.3A patent/CN111401651A/en active Pending
Patent Citations (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN104679834A (en) * | 2015-02-06 | 2015-06-03 | 北京工商大学 | Time series data cleaning method and system |
US20180137412A1 (en) * | 2016-11-16 | 2018-05-17 | Cisco Technology, Inc. | Network traffic prediction using long short term memory neural networks |
Non-Patent Citations (1)
Title |
---|
柴龙凯: "基于数据(序列模式)挖掘的医院物资使用量预测模型研究" * |
Cited By (6)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN114718359A (en) * | 2022-04-29 | 2022-07-08 | 河北工程大学 | A sponge city underground garage self-power generation and rainwater utilization system |
CN114718359B (en) * | 2022-04-29 | 2024-03-29 | 河北工程大学 | A self-generated power generation and rainwater utilization system for sponge city underground garages |
CN118428862A (en) * | 2024-07-05 | 2024-08-02 | 江西博微新技术有限公司 | Inventory material purchase prediction method and system |
CN118863160A (en) * | 2024-07-16 | 2024-10-29 | 山东佳烨检验检测有限公司 | A method for predicting demand for building cement materials |
CN118567237A (en) * | 2024-07-29 | 2024-08-30 | 中国电建集团贵阳勘测设计研究院有限公司 | A flocculation equipment selection and control method |
CN118567237B (en) * | 2024-07-29 | 2024-11-19 | 中国电建集团贵阳勘测设计研究院有限公司 | A flocculation equipment selection and control method |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN111401651A (en) | A method for predicting material procurement demand based on LSTM network | |
Gan et al. | Real-time deferrable load control: handling the uncertainties of renewable generation | |
CN111489036B (en) | Resident load prediction method and device based on electrical load characteristics and deep learning | |
CN112488395A (en) | Power distribution network line loss prediction method and system | |
CN106372747B (en) | Estimation method of reasonable line loss rate in station area based on random forest | |
CN105930931A (en) | Electric power engineering cost management method | |
CN112149873B (en) | Low-voltage station line loss reasonable interval prediction method based on deep learning | |
CN106022614A (en) | Data mining method of neural network based on nearest neighbor clustering | |
CN110907754B (en) | A method for evaluating the severity of faulty lines based on PSD-BPA | |
CN111340312A (en) | A method for predicting material procurement requirements based on RNN network | |
CN107909208A (en) | Damage method drops in a kind of taiwan area distribution | |
CN115860797B (en) | A Power Demand Forecasting Method Adapting to the Situation of New Power Price Reform | |
CN116757465A (en) | A line risk assessment method and device based on dual training weight allocation model | |
CN110751327A (en) | Long-term load combination prediction method based on multiple linear regression and gray Verhulst model | |
CN111445009A (en) | Method for predicting material purchasing demand based on GRU network | |
CN111311026A (en) | Runoff nonlinear prediction method considering data characteristics, model and correction | |
CN115330201A (en) | Power grid digital project pareto optimization method and system | |
Kumar et al. | A demand and response management model using load forecasting technique for smart grid | |
CN116011153A (en) | Distribution Network Reliability Evaluation Method Based on Light-Load Correlation Enhanced Credibility | |
Ma et al. | A general topology identification framework for distribution systems using smart meter and μ-PMU measurements | |
Deng et al. | An IP network traffic prediction method based on ARIMA and N-BEATS | |
CN111864728B (en) | Important equipment identification method and system for reconfigurable power distribution network | |
CN112508254A (en) | Method for determining investment prediction data of transformer substation engineering project | |
CN106548199A (en) | A kind of large user's load characteristics clustering method based on demand response | |
CN115860270A (en) | Network supply load prediction system and method based on LSTM neural network |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
PB01 | Publication | ||
PB01 | Publication | ||
SE01 | Entry into force of request for substantive examination | ||
SE01 | Entry into force of request for substantive examination | ||
RJ01 | Rejection of invention patent application after publication |
Application publication date: 20200710 |
|
RJ01 | Rejection of invention patent application after publication |