A project material demand forecasting method and system for electric power construction
By combining the RBF neural network and BP neural network prediction models, and using the fusion of the particle swarm optimization algorithm and the benchmark random forest model, the problem of subjective factors affecting the material demand prediction of power construction projects is solved, and the prediction accuracy and stability are improved. This reduces the waste of resources and ensures the normal progress of power grid construction.
Patent Information
- Application Number
- CN202410788368.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-06-19
- Publication Date
- 2024-09-10
- Estimated Expiration
- 2044-06-19
AI Technical Summary
The material demand forecast of existing power construction projects relies on the experience of planning managers and is easily affected by personal subjective factors, leading to misreporting or omissions in demand plans, resulting in resource waste and material redundancy and backlog inventory.
Using the combination of RBF neural network and BP neural network prediction model, through the fusion of particle swarm optimization algorithm and benchmark random forest model, a target prediction model is constructed to obtain the material demand prediction data of the project to be tested and avoid over-fitting of the neural network model. Improve the stability and accuracy of forecasts.
It effectively reduces the waste of materials in power construction projects, improves the prediction accuracy, reduces the overall prediction error, and ensures the normal progress of power grid construction and the reasonable allocation of resources.
Smart Images

Figure CN118365094B
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of material demand forecasting for power grid construction, and in particular to a material demand forecasting method and system for power construction projects. Background Art
[0002] Power materials are the basic guarantee in the process of power grid construction. The quality of materials is not only related to the safe operation of the power grid, but also to the company's cost management. Reasonable formulation and procurement of materials directly affect production safety. Therefore, the quality of purchased materials is related to the safety and stability of power production.
[0003] At present, the demand planning of various power construction projects mainly relies on the work experience of planning managers. When conducting demand statistics, the person in charge of each project management department estimates the material demand for the next quarter or the next year in the area they are responsible for based on their experience, and then summarizes the estimated demand of each person in charge step by step to predict the total material demand for the next quarter or the next year. This method is easily affected by personal subjective factors, and it is very easy to have misreporting and omissions when preparing demand plans, resulting in a waste of resources. In addition, over-reporting of materials will cause redundant backlogs of materials, and under-reporting of materials will cause delays in construction and impose a burden on material management.
[0004] Therefore, accurate forecasting of power construction material demand is of great significance to ensuring the normal progress of power grid construction. Accurate forecasting results can effectively reduce waste, guide engineering construction departments to make reasonable reports, improve quality and efficiency, and reduce unnecessary waste of resources. Summary of the invention
[0005] In order to solve the above technical problems, the present invention provides a method and system for predicting project material demand for electric power construction.
[0006] The present invention adopts the following technical solution: a method for predicting material demand for power construction projects, the method comprising:
[0007] Acquire historical project data, wherein the historical project data includes project attribute parameters and material usage data of multiple projects;
[0008] Normalizing the project attribute parameters and the material usage data, and constructing a first training sample set and a second training sample set;
[0009] Establishing an RBF neural network prediction model, and using the first training sample set to train the RBF neural network prediction model to obtain a first prediction model;
[0010] Establishing a BP neural network prediction model based on particle swarm optimization, and using the first training sample set to train the BP neural network prediction model to obtain a second prediction model;
[0011] The first prediction model and the second prediction model are integrated according to the second training sample set and a preset benchmark random forest model to obtain a target prediction model;
[0012] The project attribute parameters of the project to be tested are obtained, and the material demand forecast data of the project to be tested is obtained according to the target forecast model and the project attribute parameters of the project to be tested.
[0013] A project material demand forecasting method for electric power construction according to an embodiment of the present invention adopts a first training sample set to respectively train an RBF neural network forecasting model and a BP neural network forecasting model to obtain a first forecasting model and a second forecasting model, and then fuses the first forecasting model and the second forecasting model based on a benchmark random forest model to obtain a target forecasting model. On the one hand, overfitting of the neural network model can be avoided, and on the other hand, the stability of the forecast can be improved. Moreover, the target forecasting model obtained by fusing the two models is more generalized, so that the overall forecasting error is reduced. Moreover, the particle swarm optimization algorithm is simple to implement and has global search capabilities. The particle swarm optimization algorithm can improve the convergence speed and forecasting accuracy of the BP neural network model, further improve the overall forecasting accuracy, and effectively reduce the waste of materials in electric power construction projects.
[0014] Furthermore, the project attribute parameters include project type, project investment amount, voltage level, line length and project planned completion time, and the material usage data includes the usage amount, length and quantity of each material subcategory.
[0015] Furthermore, the steps of normalizing the project attribute parameters and the material usage data and constructing the first training sample set and the second training sample set specifically include:
[0016] Based on the attribute characteristics of the project attribute parameters, the project attribute parameters are divided into data-feature project attribute parameters and text-feature project attribute parameters;
[0017] Quantifying and assigning values to the attribute parameters of the text feature items, and normalizing the attribute parameters of the text feature items, the attribute parameters of the data feature items, and the material usage data after quantization and assignment to obtain a total sample set;
[0018] The total sample set is divided into a first training sample set and a second training sample set according to a preset ratio.
[0019] Furthermore, the step of establishing a BP neural network prediction model based on particle swarm optimization and training the BP neural network prediction model using the first training sample set to obtain a second prediction model specifically includes:
[0020] Establishing an initial BP neural network model, the initial BP neural network model includes an input layer, a hidden layer and an output layer; wherein the number of units in the input layer is consistent with the number of types of the project attribute parameters, and the number of units in the output layer is consistent with the number of material subcategories of the material usage data;
[0021] Determining the number of units in the hidden layer based on the number of units in the input layer and the number of units in the output layer; wherein the hidden layer is a double-layer structure;
[0022] Determine the initial value and threshold of the initial BP neural network model according to the particle swarm optimization algorithm to obtain the BP neural network prediction model;
[0023] The BP neural network prediction model is trained using the first training sample set to obtain a second prediction model.
[0024] Furthermore, the step of determining the number of units in the hidden layer based on the number of units in the input layer and the number of units in the output layer specifically includes:
[0025] The number of units in the hidden layer is calculated based on the number of units in the input layer and the number of units in the output layer. :
[0026]
[0027] in, is the number of units in the input layer, is the number of units in the output layer, is a constant.
[0028] Furthermore, the initial value and threshold of the initial BP neural network model are determined according to the particle swarm optimization algorithm, and the step of obtaining the BP neural network prediction model specifically includes:
[0029] Step 1, initialize the size Q of the particle swarm, the maximum number of iterations R, the inertia weight i, the acceleration constant and the speed V of each particle;
[0030] Step 2, initialize the particle position; randomly generate a three-dimensional vector, each component of which is between 0 and 1, and obtain Q vectors as the initial group, then respectively carry each component to the value range of Q, R, and V parameters, calculate the fitness value of the particle group, and select T solutions with better performance from the Q initial groups as the initial solution, and randomly generate Q initial velocities;
[0031] Step 3: If the fitness of the particle is better than the individual extreme value, the fitness value of the particle group is set to the new position;
[0032] Step 4: If the particle fitness is better than the global extreme value, the global extreme value is set to the new position;
[0033] Step 5: Update the speed and position of the particle; calculate the fitness value of each feasible solution experienced by the variable to obtain the optimal feasible solution; and use the optimal feasible solution to replace the position of any particle in the current group;
[0034] Step 6: If the maximum number of iterations is met, stop searching, and the global optimal position is the parameter vector (Q, R, V); otherwise, return to step 3;
[0035] Step 7: Based on the parameters to be optimized and Construct the fitness function of the BP neural network model, and use the fitness function as the objective function of the optimized particle swarm algorithm;
[0036] Step 8: When the sample root mean square error of the initial BP neural network model is the smallest, the corresponding and is the optimal parameter, and finally and A BP neural network prediction model is established as the initial value and threshold of the initial BP neural network model.
[0037] Furthermore, the initial value and threshold of the initial BP neural network model are determined according to the particle swarm optimization algorithm, and the step of obtaining the BP neural network prediction model also includes: optimizing the inertia weight based on the normal distribution function, and the optimized inertia weight transformation formula is:
[0038]
[0039] in, is the minimum value of the inertia weight, is the maximum value of the inertia weight, For the Iterations, For the The value of the inertia weight of the iteration is, is the scale parameter of the normal distribution.
[0040] Furthermore, the step of fusing the first prediction model and the second prediction model according to the second training sample set and the preset benchmark random forest model to obtain a target prediction model specifically includes:
[0041] Assume that the number of samples in the second training sample set is , input the item attribute parameters in the second training sample set into the first prediction model and the second prediction model respectively, and obtain Sample prediction results;
[0042] The material usage data in the second training sample set is compared with The sample prediction results form a third training sample set; wherein each subset of the third training sample set includes two sample prediction results corresponding to the same item attribute parameter and the material usage data corresponding to the item attribute parameter;
[0043] The third training sample set is input into the benchmark random forest model for training, the first prediction model and the second prediction model are integrated, and the trained benchmark random forest model, i.e., the target prediction model, is obtained.
[0044] Furthermore, the step of obtaining the project attribute parameters of the project to be tested and obtaining the material demand forecast data of the project to be tested according to the target forecast model and the project attribute parameters of the project to be tested specifically includes:
[0045] Acquire project attribute parameters of the project to be tested, and perform normalization processing on the project attribute parameters of the project to be tested;
[0046] Inputting the normalized item attribute parameters of the item to be tested into the first prediction model and the second prediction model respectively to obtain two initial prediction values;
[0047] Input the two initial forecast values into the target forecast model to obtain a forecast value of material demand for the project to be tested;
[0048] The material demand forecast value of the project to be tested is denormalized to obtain the material demand forecast data of the project to be tested.
[0049] The present invention also proposes a project material demand forecasting system for electric power construction, the system comprising:
[0050] An acquisition module, used to acquire historical project data, wherein the historical project data includes project attribute parameters and material usage data of multiple projects;
[0051] A preprocessing module, used for normalizing the project attribute parameters and the material usage data, and constructing a first training sample set and a second training sample set;
[0052] A first training module is used to establish an RBF neural network prediction model, and train the RBF neural network prediction model using the first training sample set to obtain a first prediction model;
[0053] A second training module is used to establish a BP neural network prediction model based on particle swarm optimization, and train the BP neural network prediction model using the first training sample set to obtain a second prediction model;
[0054] A fusion module, used to fuse the first prediction model and the second prediction model according to the second training sample set and a preset benchmark random forest model to obtain a target prediction model;
[0055] The prediction module is used to obtain the project attribute parameters of the project to be tested, and obtain the material demand prediction data of the project to be tested according to the target prediction model and the project attribute parameters of the project to be tested.
[0056] A project material demand forecasting system for electric power construction according to an embodiment of the present invention adopts a first training sample set to respectively train an RBF neural network forecasting model and a BP neural network forecasting model to obtain a first forecasting model and a second forecasting model, and then fuses the first forecasting model and the second forecasting model based on a benchmark random forest model to obtain a target forecasting model. On the one hand, overfitting of the neural network model can be avoided, and on the other hand, the stability of the forecast can be improved. Moreover, the target forecasting model obtained by fusing the two models is more generalized, so that the overall forecasting error is reduced. Moreover, the particle swarm optimization algorithm is simple to implement and has global search capabilities. The particle swarm optimization algorithm can improve the convergence speed and forecasting accuracy of the BP neural network model, further improve the overall forecasting accuracy, and effectively reduce the waste of materials in electric power construction projects. BRIEF DESCRIPTION OF THE DRAWINGS
[0057] In order to more clearly illustrate the technical solutions in the embodiments of the present invention, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative labor.
[0058] Figure 1 A flow chart of a method for predicting project material demand for electric power construction according to the present invention;
[0059] Figure 2 It is a structural block diagram of the project material demand forecasting system for power construction of the present invention. DETAILED DESCRIPTION
[0060] Embodiments of the present invention are described in detail below, examples of which are shown in the accompanying drawings, wherein the same or similar reference numerals throughout represent the same or similar elements or elements having the same or similar functions. The embodiments described below with reference to the accompanying drawings are exemplary and are intended to be used to explain the embodiments of the present invention, and should not be construed as limiting the present invention.
[0061] In the description of the embodiments of the present invention, it should be understood that the terms "length", "width", "up", "down", "front", "back", "left", "right", "vertical", "horizontal", "top", "bottom", "inside" and "outside" etc., indicating orientations or positional relationships, are based on the orientations or positional relationships shown in the accompanying drawings, and are only for the convenience of describing the embodiments of the present invention and simplifying the description, and do not indicate or imply that the referred device or element must have a specific orientation, be constructed and operated in a specific orientation, and therefore should not be understood as a limitation on the present invention.
[0062] In addition, the terms "first" and "second" are used for descriptive purposes only and should not be understood as indicating or implying relative importance or implicitly indicating the number of the indicated technical features. Thus, a feature defined as "first" or "second" may explicitly or implicitly include one or more of the features. In the description of the embodiments of the present invention, the meaning of "plurality" is two or more, unless otherwise clearly and specifically defined.
[0063] In the embodiments of the present invention, unless otherwise clearly specified and limited, the terms "installed", "connected", "connected", "fixed" and the like should be understood in a broad sense, for example, it can be a fixed connection, a detachable connection, or an integral connection; it can be a mechanical connection or an electrical connection; it can be a direct connection or an indirect connection through an intermediate medium, it can be the internal connection of two elements or the interaction relationship between two elements. For ordinary technicians in this field, the specific meanings of the above terms in the embodiments of the present invention can be understood according to specific circumstances.
[0064] Embodiment 1
[0065] Reference Figure 1 The first embodiment of the present invention is a method for predicting material demand for power construction projects, the method comprising:
[0066] S1: Obtain historical project data, which includes project attribute parameters and material usage data of multiple projects; further, the project attribute parameters include project type, project investment amount, voltage level, line length and project planned completion time, and the material usage data includes the usage amount, length and quantity of each material subcategory.
[0067] S2: normalizing the project attribute parameters and material usage data, and constructing a first training sample set and a second training sample set; further, the steps specifically include:
[0068] Based on the attribute characteristics of the item attribute parameters, the item attribute parameters are divided into data-feature item attribute parameters and text-feature item attribute parameters;
[0069] Quantitatively assign values to the attribute parameters of the text feature items, and normalize the attribute parameters of the text feature items, the attribute parameters of the data feature items, and the material use data after the quantified assignment to obtain a total sample set;
[0070] The total sample set is divided into a first training sample set and a second training sample set according to a preset ratio. In this embodiment, the ratio of the first training sample set to the second training sample set is 6:4.
[0071] S3: Establish an RBF neural network prediction model, and use the first training sample set to train the RBF neural network prediction model to obtain a first prediction model; in this embodiment, the RBF neural network prediction model is a network model well known to those skilled in the art, and therefore, its specific structure and principle are not described in detail herein.
[0072] In this embodiment, the kernel function of the RBF neural network prediction model is for:
[0073]
[0074] in, is the sample data, is the width of the kernel function, is the center of the kernel function;
[0075] According to the error back propagation method, the parameters and parameters The specific adjustment formula is:
[0076]
[0077] in, is the step length, is the weight, is the sample attribute value, is the sample error, For the Iterations, For the The width of the kernel function after iterations, For the The center of the kernel function after iterations.
[0078] S4: establishing a BP neural network prediction model based on particle swarm optimization, and using the first training sample set to train the BP neural network prediction model to obtain a second prediction model;
[0079] Furthermore, a BP neural network prediction model based on particle swarm optimization is established, and the BP neural network prediction model is trained using the first training sample set to obtain the second prediction model. Specifically, the steps include:
[0080] Establish an initial BP neural network model, which includes an input layer, a hidden layer and an output layer; the number of units in the input layer is consistent with the number of types of project attribute parameters, and the number of units in the output layer is consistent with the number of material subcategories in the material usage data;
[0081] The number of units in the hidden layer is determined based on the number of units in the input layer and the number of units in the output layer; wherein the hidden layer is a double-layer structure;
[0082] Determine the initial value and threshold of the initial BP neural network model according to the particle swarm optimization algorithm, and obtain the BP neural network prediction model;
[0083] The BP neural network prediction model is trained using the first training sample set to obtain a second prediction model.
[0084] Furthermore, the step of determining the number of units in the hidden layer based on the number of units in the input layer and the number of units in the output layer specifically includes:
[0085] Calculate the number of units in the hidden layer based on the number of units in the input layer and the number of units in the output layer :
[0086]
[0087] in, is the number of units in the input layer, is the number of units in the output layer, is a constant, The value range is .
[0088] Furthermore, the initial value and threshold of the initial BP neural network model are determined according to the particle swarm optimization algorithm, and the steps of obtaining the BP neural network prediction model specifically include:
[0089] Step 4.1, initialize the size Q of the particle swarm, the maximum number of iterations R, the inertia weight i, the acceleration constant and the speed V of each particle;
[0090] Step 4.2, initialize the particle position; randomly generate a three-dimensional vector, each component of which is between 0 and 1, and obtain Q vectors as the initial group, then respectively carry each component to the value range of Q, R, and V parameters, calculate the fitness value of the particle group, and select T solutions with better performance from the Q initial groups as the initial solution, and randomly generate Q initial velocities;
[0091] Step 4.3, if the fitness of the particle is better than the individual extreme value, the fitness value of the particle group is set to the new position;
[0092] Step 4.4, if the particle fitness is better than the global extreme value, set the global extreme value to the new position;
[0093] Step 4.5: Update the speed and position of the particle; calculate the fitness value of each feasible solution experienced by the variable to obtain the optimal feasible solution; and use the optimal feasible solution to replace the position of any particle in the current group;
[0094] Step 4.6: If the maximum number of iterations is met, stop searching and the global optimal position is the parameter vector (Q, R, V); otherwise, return to step 4.3;
[0095] Step 4.7: Based on the parameters to be optimized and Construct the fitness function of the BP neural network model, and use the fitness function as the objective function of the optimized particle swarm algorithm;
[0096] Step 4.8: When the sample root mean square error of the initial BP neural network model is the smallest, the corresponding and is the optimal parameter, and finally and A BP neural network prediction model is established as the initial value and threshold of the initial BP neural network model.
[0097] Furthermore, the initial value and threshold of the initial BP neural network model are determined according to the particle swarm optimization algorithm, and the step of obtaining the BP neural network prediction model also includes: optimizing the inertia weight based on the normal distribution function, and the optimized inertia weight transformation formula is:
[0098]
[0099] in, is the minimum value of the inertia weight, is the maximum value of the inertia weight, For the Iterations, For the The value of the inertia weight of the iteration is, is the scale parameter of the normal distribution;
[0100] In this embodiment, the change of the inertia weight is similar to the curve change of the normal distribution function, so that the search ability of the particles in different iteration stages changes continuously with the demand situation, thereby accelerating the convergence speed of the algorithm.
[0101] based on Function to Acceleration Constant , Perform dynamic adjustment, the adjustment function is:
[0102]
[0103] in, is the acceleration constant The initial value of is the acceleration constant The final value of is the acceleration constant The initial value of is the acceleration constant The final value of
[0104] In this embodiment, at the beginning of the iteration, the acceleration constant Greater than , the particle adaptation value has a greater impact on the current speed adjustment, while the global extreme value has a smaller impact on the current speed adjustment. As the iteration proceeds, gradually becomes smaller, and As it gradually increases, the global optimum has a greater impact on the particles, thereby ensuring that the particles move closer to the optimal solution faster and achieving faster convergence of the algorithm.
[0105] S5: According to the second training sample set and the preset benchmark random forest model, the first prediction model and the second prediction model are integrated to obtain a target prediction model; further, the steps specifically include:
[0106] Assume that the number of samples in the second training sample set is , input the item attribute parameters in the second training sample set into the first prediction model and the second prediction model respectively, and obtain Sample prediction results;
[0107] The material usage data in the second training sample set is compared with The sample prediction results form a third training sample set; wherein each subset of the third training sample set includes two sample prediction results corresponding to the same item attribute parameter and the material usage data corresponding to the item attribute parameter;
[0108] The third training sample set is input into the benchmark random forest model for training, the fusion of the first prediction model and the second prediction model is completed, and the trained benchmark random forest model, that is, the target prediction model, is obtained.
[0109] In this embodiment, multi-threaded parallel computing is used to achieve model fusion, which can effectively improve the system processing speed and reduce latency. By using the benchmark random forest model as the basis of the target prediction model, the errors in the prediction results of the two neural network models can be effectively balanced, and the problem of easy overfitting of the neural network model can be effectively solved. The structure and principle of the benchmark random forest model are already well known to people in this field, so they will not be described in detail here.
[0110] S6: Obtaining the project attribute parameters of the project to be tested, and obtaining the material demand forecast data of the project to be tested according to the target forecast model and the project attribute parameters of the project to be tested; further, the steps specifically include:
[0111] Acquire project attribute parameters of the project to be tested, and perform normalization processing on the project attribute parameters of the project to be tested;
[0112] Inputting the normalized project attribute parameters of the project to be tested into the first prediction model and the second prediction model respectively to obtain two initial prediction values;
[0113] Input the two initial forecast values into the target forecast model to obtain the material demand forecast value of the project to be tested;
[0114] The material demand forecast value of the project to be tested is denormalized to obtain the material demand forecast data of the project to be tested.
[0115] A project material demand forecasting method for electric power construction according to an embodiment of the present invention adopts a first training sample set to respectively train an RBF neural network forecasting model and a BP neural network forecasting model to obtain a first forecasting model and a second forecasting model, and then fuses the first forecasting model and the second forecasting model based on a benchmark random forest model to obtain a target forecasting model. On the one hand, overfitting of the neural network model can be avoided, and on the other hand, the stability of the forecast can be improved. Moreover, the target forecasting model obtained by fusing the two models is more generalized, so that the overall forecasting error is reduced. Moreover, the particle swarm optimization algorithm is simple to implement and has global search capabilities. The particle swarm optimization algorithm can improve the convergence speed and forecasting accuracy of the BP neural network model, further improve the overall forecasting accuracy, and effectively reduce the waste of materials in electric power construction projects.
[0116] Embodiment 2
[0117] Reference Figure 2 The present invention also proposes a project material demand forecasting system for electric power construction, the system comprising:
[0118] An acquisition module is used to acquire historical project data, which includes project attribute parameters and material usage data of multiple projects;
[0119] A preprocessing module, used for normalizing the project attribute parameters and material usage data, and constructing a first training sample set and a second training sample set;
[0120] A first training module is used to establish an RBF neural network prediction model, and train the RBF neural network prediction model using a first training sample set to obtain a first prediction model;
[0121] The second training module is used to establish a BP neural network prediction model based on particle swarm optimization, and train the BP neural network prediction model using the first training sample set to obtain a second prediction model;
[0122] A fusion module, used to fuse the first prediction model and the second prediction model according to the second training sample set and a preset benchmark random forest model to obtain a target prediction model;
[0123] The prediction module is used to obtain the project attribute parameters of the project to be tested, and obtain the material demand prediction data of the project to be tested according to the target prediction model and the project attribute parameters of the project to be tested.
[0124] Furthermore, the acquisition module is specifically used to obtain historical project data, which includes project attribute parameters and material usage data of multiple projects; the project attribute parameters include project type, project investment amount, voltage level, line length and project planned completion time, and the material usage data includes the usage amount, length and quantity of each material subcategory.
[0125] Further, the preprocessing module is specifically used to: divide the project attribute parameters into data feature project attribute parameters and text feature project attribute parameters based on the attribute features of the project attribute parameters;
[0126] Quantitatively assign values to the attribute parameters of the text feature items, and normalize the attribute parameters of the text feature items, the attribute parameters of the data feature items, and the material use data after the quantified assignment to obtain a total sample set;
[0127] The total sample set is divided into a first training sample set and a second training sample set according to a preset ratio. In this embodiment, the ratio of the first training sample set to the second training sample set is 6:4.
[0128] Furthermore, the first training module is specifically used for: the kernel function of the RBF neural network prediction model for:
[0129]
[0130] in, is the sample data, is the width of the kernel function, is the center of the kernel function;
[0131] According to the error back propagation method, the parameters and parameters The specific adjustment formula is:
[0132]
[0133] in, is the step length, is the weight, is the sample attribute value, is the sample error, For the Iterations, For the The width of the kernel function after iterations, For the The center of the kernel function after iterations.
[0134] Furthermore, the second training module is specifically used to establish a BP neural network prediction model based on particle swarm optimization, and use the first training sample set to train the BP neural network prediction model. The steps of obtaining the second prediction model specifically include:
[0135] Establish an initial BP neural network model, which includes an input layer, a hidden layer and an output layer; the number of units in the input layer is consistent with the number of types of project attribute parameters, and the number of units in the output layer is consistent with the number of material subcategories in the material usage data;
[0136] The number of units in the hidden layer is determined based on the number of units in the input layer and the number of units in the output layer; wherein the hidden layer is a double-layer structure;
[0137] Determine the initial value and threshold of the initial BP neural network model according to the particle swarm optimization algorithm, and obtain the BP neural network prediction model;
[0138] The BP neural network prediction model is trained using the first training sample set to obtain a second prediction model.
[0139] Furthermore, the step of determining the number of units in the hidden layer based on the number of units in the input layer and the number of units in the output layer specifically includes:
[0140] Calculate the number of units in the hidden layer based on the number of units in the input layer and the number of units in the output layer :
[0141]
[0142] in, is the number of units in the input layer, is the number of units in the output layer, is a constant, The value range is .
[0143] Furthermore, the initial value and threshold of the initial BP neural network model are determined according to the particle swarm optimization algorithm, and the steps of obtaining the BP neural network prediction model specifically include:
[0144] Step 1, initialize the size Q of the particle swarm, the maximum number of iterations R, the inertia weight i, the acceleration constant and the speed V of each particle;
[0145] Step 2, initialize the particle position; randomly generate a three-dimensional vector, each component of which is between 0 and 1, and obtain Q vectors as the initial group, then respectively carry each component to the value range of Q, R, and V parameters, calculate the fitness value of the particle group, and select T solutions with better performance from the Q initial groups as the initial solution, and randomly generate Q initial velocities;
[0146] Step 3: If the fitness of the particle is better than the individual extreme value, the fitness value of the particle group is set to the new position;
[0147] Step 4: If the particle fitness is better than the global extreme value, the global extreme value is set to the new position;
[0148] Step 5: Update the speed and position of the particle; calculate the fitness value of each feasible solution experienced by the variable to obtain the optimal feasible solution; and use the optimal feasible solution to replace the position of any particle in the current group;
[0149] Step 6: If the maximum number of iterations is met, stop searching, and the global optimal position is the parameter vector (Q, R, V); otherwise, return to step 3;
[0150] Step 7: Based on the parameters to be optimized and Construct the fitness function of the BP neural network model, and use the fitness function as the objective function of the optimized particle swarm algorithm;
[0151] Step 8: When the sample root mean square error of the initial BP neural network model is the smallest, the corresponding and is the optimal parameter, and finally and A BP neural network prediction model is established as the initial value and threshold of the initial BP neural network model.
[0152] Furthermore, the initial value and threshold of the initial BP neural network model are determined according to the particle swarm optimization algorithm, and the step of obtaining the BP neural network prediction model also includes: optimizing the inertia weight based on the normal distribution function, and the optimized inertia weight transformation formula is:
[0153]
[0154] in, is the minimum value of the inertia weight, is the maximum value of the inertia weight, For the Iterations, For the The value of the inertia weight of the iteration is, is the scale parameter of the normal distribution;
[0155] In this embodiment, the change of the inertia weight is similar to the curve change of the normal distribution function, so that the search ability of the particles in different iteration stages changes continuously with the demand situation, thereby accelerating the convergence speed of the algorithm.
[0156] based on Function to Acceleration Constant , Perform dynamic adjustment, the adjustment function is:
[0157]
[0158] in, is the acceleration constant The initial value of is the acceleration constant The final value of is the acceleration constant The initial value of is the acceleration constant The final value of
[0159] In this embodiment, at the beginning of the iteration, the acceleration constant Greater than , the particle adaptation value has a greater impact on the current speed adjustment, while the global extreme value has a smaller impact on the current speed adjustment. As the iteration proceeds, gradually becomes smaller, and As it gradually increases, the global optimum has a greater impact on the particles, thereby ensuring that the particles move closer to the optimal solution faster and achieving faster convergence of the algorithm.
[0160] Furthermore, the fusion module is specifically used to: Assume that the number of samples in the second training sample set is , input the item attribute parameters in the second training sample set into the first prediction model and the second prediction model respectively, and obtain Sample prediction results;
[0161] The material usage data in the second training sample set is compared with The sample prediction results form a third training sample set; wherein each subset of the third training sample set includes two sample prediction results corresponding to the same item attribute parameter and the material usage data corresponding to the item attribute parameter;
[0162] The third training sample set is input into the benchmark random forest model for training, the fusion of the first prediction model and the second prediction model is completed, and the trained benchmark random forest model, that is, the target prediction model, is obtained.
[0163] Furthermore, the prediction module is specifically used to: obtain the project attribute parameters of the project to be tested, and perform normalization processing on the project attribute parameters of the project to be tested;
[0164] Inputting the normalized project attribute parameters of the project to be tested into the first prediction model and the second prediction model respectively to obtain two initial prediction values;
[0165] Input the two initial forecast values into the target forecast model to obtain the material demand forecast value of the project to be tested;
[0166] The material demand forecast value of the project to be tested is denormalized to obtain the material demand forecast data of the project to be tested.
[0167] A project material demand forecasting system for electric power construction according to an embodiment of the present invention adopts a first training sample set to respectively train an RBF neural network forecasting model and a BP neural network forecasting model to obtain a first forecasting model and a second forecasting model, and then fuses the first forecasting model and the second forecasting model based on a benchmark random forest model to obtain a target forecasting model. On the one hand, overfitting of the neural network model can be avoided, and on the other hand, the stability of the forecast can be improved. Moreover, the target forecasting model obtained by fusing the two models is more generalized, so that the overall forecasting error is reduced. Moreover, the particle swarm optimization algorithm is simple to implement and has global search capabilities. The particle swarm optimization algorithm can improve the convergence speed and forecasting accuracy of the BP neural network model, further improve the overall forecasting accuracy, and effectively reduce the waste of materials in electric power construction projects.
[0168] Embodiment 3
[0169] The third embodiment of the present invention is based on the same inventive concept. The present invention proposes a computer-readable storage medium, which stores a computer program. When the computer program is executed by a processor, the steps of the project material demand forecasting method for power construction of the above embodiment are implemented.
[0170] The logic and / or steps represented in the flowchart or otherwise described herein, for example, may be considered as an ordered list of executable instructions for implementing logical functions, and may be embodied in any computer-readable medium for use by an instruction execution system, device or apparatus (such as a computer-based system, a system including a processor, or other system that can fetch instructions from an instruction execution system, device or apparatus and execute instructions), or in conjunction with such instruction execution system, device or apparatus. For purposes of this specification, "computer-readable medium" may be any device that contains storage, communication, propagation or transmission of a program for use by an instruction execution system, device or apparatus, or in conjunction with such instruction execution system, device or apparatus.
[0171] More specific examples of computer-readable media (a non-exhaustive list) include the following: an electrical connection with one or more wirings (electronic device), a portable computer disk case (magnetic device), a random access memory (RAM), a read-only memory (ROM), an erasable and editable read-only memory (EPROM or flash memory), an optical fiber device, and a portable compact disk read-only memory (CDROM). In addition, the computer-readable medium may even be paper or other suitable medium on which the program can be printed, because the program can be obtained electronically, for example, by optically scanning the paper or other medium, followed by editing, interpreting or processing in other suitable ways as necessary, and then stored in a computer memory, wherein the memory may include a large capacity memory for data or instructions. By way of example and not limitation, the memory may include a hard disk drive (HDD), a floppy disk drive, a solid state drive (SSD), a flash memory, an optical disk, a magneto-optical disk, a magnetic tape, or a universal serial bus (USB) drive, or a combination of two or more of these. Where appropriate, the memory may include a removable or non-removable (or fixed) medium. In appropriate cases, the memory may be inside or outside the data processing device. In a specific embodiment, the memory is a non-volatile memory. In a specific embodiment, the memory includes a read-only memory (ROM) and a random access memory (RAM). In appropriate cases, the ROM may be a mask-programmed ROM, a programmable ROM (PROM), an erasable PROM (EPROM), an electrically erasable PROM (EEPROM), an electrically alterable ROM (EAROM), or a flash memory (FLASH) or a combination of two or more of these.Under appropriate circumstances, the RAM can be a static random access memory (SRAM) or a dynamic random access memory (DRAM), wherein the DRAM can be a fast page mode dynamic random access memory (FPMDRAM), an extended data output dynamic random access memory (EDODRAM), a synchronous dynamic random access memory (SDRAM), etc.
[0172] Embodiment 4
[0173] The fourth embodiment of the present invention is based on the same inventive concept. The present invention proposes a terminal, which includes: a processor and a memory; the processor and the memory communicate with each other; the memory is used to store instructions; the processor is used to execute the instructions in the memory, and execute the project material demand forecasting method for power construction of the above embodiment.
[0174] It should be understood that the various parts of the present invention can be implemented by hardware, software, firmware or a combination thereof. In the above-mentioned embodiments, multiple steps or methods can be implemented by software or firmware stored in a memory and executed by a suitable instruction execution system. For example, if implemented by hardware, as in another embodiment, it can be implemented by any one of the following technologies known in the art or their combination: a discrete logic circuit having a logic gate circuit for implementing a logic function for a data signal, a dedicated integrated circuit having a suitable combination of logic gate circuits, a programmable gate array (PGA), a field programmable gate array (FPGA), etc.
[0175] In the description of this specification, the description with reference to the terms "one embodiment", "some embodiments", "examples", "specific examples", or "some examples" means that the specific features, structures, materials or characteristics described in conjunction with the embodiment or example are included in at least one embodiment or example of the present invention. In this specification, the schematic representation of the above terms does not necessarily refer to the same embodiment or example. Moreover, the specific features, structures, materials or characteristics described may be combined in any one or more embodiments or examples in a suitable manner.
[0176] Under the premise that no conflict occurs, those skilled in the art may freely combine and superimpose the above-mentioned additional technical features.
[0177] The above description is only a preferred embodiment of the present invention and is not intended to limit the present invention. Any modifications, equivalent substitutions and improvements made within the spirit and principles of the present invention should be included in the protection scope of the present invention.
Claims
1. A method for predicting project material demand for power construction, It is characterized in that The method comprises: Acquire historical project data, wherein the historical project data includes project attribute parameters and material usage data of multiple projects; Normalizing the project attribute parameters and the material usage data, and constructing a first training sample set and a second training sample set; Establishing an RBF neural network prediction model, and using the first training sample set to train the RBF neural network prediction model to obtain a first prediction model; Establishing a BP neural network prediction model based on particle swarm optimization, and using the first training sample set to train the BP neural network prediction model to obtain a second prediction model; The first prediction model and the second prediction model are integrated according to the second training sample set and the preset benchmark random forest model to obtain a target prediction model, wherein the step of integrating the first prediction model and the second prediction model according to the second training sample set and the preset benchmark random forest model to obtain the target prediction model specifically includes: Assume that the number of samples in the second training sample set is , input the item attribute parameters in the second training sample set into the first prediction model and the second prediction model respectively, and obtain Sample prediction results; The material usage data in the second training sample set is compared with The sample prediction results form a third training sample set; wherein each subset of the third training sample set includes two sample prediction results corresponding to the same item attribute parameter and the material usage data corresponding to the item attribute parameter; Inputting the third training sample set into the benchmark random forest model for training, completing the fusion of the first prediction model and the second prediction model, and obtaining the trained benchmark random forest model, that is, the target prediction model; The project attribute parameters of the project to be tested are obtained, and the material demand forecast data of the project to be tested is obtained according to the target forecast model and the project attribute parameters of the project to be tested.
2. The project material demand forecasting method for electric power construction according to claim 1, It is characterized in that The project attribute parameters include project type, project investment amount, voltage level, line length and project planned completion time, and the material usage data includes the usage amount, length and quantity of each material subcategory.
3. The project material demand forecasting method for electric power construction according to claim 1, It is characterized in that The steps of normalizing the project attribute parameters and the material usage data and constructing the first training sample set and the second training sample set specifically include: Based on the attribute characteristics of the project attribute parameters, the project attribute parameters are divided into data-feature project attribute parameters and text-feature project attribute parameters; Quantifying and assigning values to the attribute parameters of the text feature items, and normalizing the attribute parameters of the text feature items, the attribute parameters of the data feature items, and the material usage data after quantization and assignment to obtain a total sample set; The total sample set is divided into a first training sample set and a second training sample set according to a preset ratio.
4. The project material demand forecasting method for electric power construction according to claim 1, It is characterized in that The step of establishing a BP neural network prediction model based on particle swarm optimization and training the BP neural network prediction model using the first training sample set to obtain a second prediction model specifically includes: Establishing an initial BP neural network model, the initial BP neural network model includes an input layer, a hidden layer and an output layer; wherein the number of units in the input layer is consistent with the number of types of the project attribute parameters, and the number of units in the output layer is consistent with the number of material subcategories of the material usage data; Determining the number of units in the hidden layer based on the number of units in the input layer and the number of units in the output layer; wherein the hidden layer is a double-layer structure; Determine the initial value and threshold of the initial BP neural network model according to the particle swarm optimization algorithm to obtain the BP neural network prediction model; The BP neural network prediction model is trained using the first training sample set to obtain a second prediction model.
5. The project material demand forecasting method for electric power construction according to claim 4, It is characterized in that The step of determining the number of units in the hidden layer based on the number of units in the input layer and the number of units in the output layer specifically includes: The number of units in the hidden layer is calculated based on the number of units in the input layer and the number of units in the output layer. : in, is the number of units in the input layer, is the number of units in the output layer, is a constant.
6. The project material demand forecasting method for electric power construction according to claim 4, It is characterized in that The steps of determining the initial value and threshold of the initial BP neural network model according to the particle swarm optimization algorithm and obtaining the BP neural network prediction model specifically include: Step 1, initialize the size Q of the particle swarm, the maximum number of iterations R, the inertia weight i, the acceleration constant and the speed V of each particle; Step 2, initialize the particle position; randomly generate a three-dimensional vector, each component of which is between 0 and 1, and obtain Q vectors as the initial group, then respectively carry each component to the value range of Q, R, and V parameters, calculate the fitness value of the particle group, and select T solutions with better performance from the Q initial groups as the initial solution, and randomly generate Q initial velocities; Step 3: If the fitness of the particle is better than the individual extreme value, the fitness value of the particle group is set to the new position; Step 4: If the particle fitness is better than the global extreme value, the global extreme value is set to the new position; Step 5: Update the speed and position of the particle; calculate the fitness value of each feasible solution experienced by the variable to obtain the optimal feasible solution; and use the optimal feasible solution to replace the position of any particle in the current group; Step 6: If the maximum number of iterations is met, stop searching, and the global optimal position is the parameter vector (Q, R, V); otherwise, return to step 3; Step 7: Based on the parameters to be optimized and Construct the fitness function of the BP neural network model, and use the fitness function as the objective function of the optimized particle swarm algorithm; Step 8: When the sample root mean square error of the initial BP neural network model is the smallest, the corresponding and is the optimal parameter, and finally and A BP neural network prediction model is established as the initial value and threshold of the initial BP neural network model.
7. The project material demand forecasting method for electric power construction according to claim 6, It is characterized in that The step of determining the initial value and threshold of the initial BP neural network model according to the particle swarm optimization algorithm, and obtaining the BP neural network prediction model also includes: optimizing the inertia weight based on the normal distribution function, and the optimized inertia weight transformation formula is: in, is the minimum value of the inertia weight, is the maximum value of the inertia weight, For the Iterations, For the The value of the inertia weight of the iteration is, is the scale parameter of the normal distribution.
8. The project material demand forecasting method for electric power construction according to claim 1, It is characterized in that The step of obtaining the project attribute parameters of the project to be tested and obtaining the material demand forecast data of the project to be tested according to the target forecast model and the project attribute parameters of the project to be tested specifically includes: Acquire project attribute parameters of the project to be tested, and perform normalization processing on the project attribute parameters of the project to be tested; Inputting the normalized item attribute parameters of the item to be tested into the first prediction model and the second prediction model respectively to obtain two initial prediction values; Input the two initial forecast values into the target forecast model to obtain a forecast value of material demand for the project to be tested; The material demand forecast value of the project to be tested is denormalized to obtain the material demand forecast data of the project to be tested.
9. A project material demand forecasting system for power construction, It is characterized in that The system comprises: An acquisition module, used to acquire historical project data, wherein the historical project data includes project attribute parameters and material usage data of multiple projects; A preprocessing module, used for normalizing the project attribute parameters and the material usage data, and constructing a first training sample set and a second training sample set; A first training module is used to establish an RBF neural network prediction model, and train the RBF neural network prediction model using the first training sample set to obtain a first prediction model; A second training module is used to establish a BP neural network prediction model based on particle swarm optimization, and train the BP neural network prediction model using the first training sample set to obtain a second prediction model; A fusion module, used to fuse the first prediction model and the second prediction model according to the second training sample set and a preset benchmark random forest model to obtain a target prediction model; A prediction module, used to obtain project attribute parameters of the project to be tested, and obtain material demand prediction data of the project to be tested according to the target prediction model and the project attribute parameters of the project to be tested; Furthermore, the fusion module is specifically used to: Assume that the number of samples in the second training sample set is , input the item attribute parameters in the second training sample set into the first prediction model and the second prediction model respectively, and obtain Sample prediction results; The material usage data in the second training sample set is compared with The sample prediction results form a third training sample set; wherein each subset of the third training sample set includes two sample prediction results corresponding to the same item attribute parameter and the material usage data corresponding to the item attribute parameter; The third training sample set is input into the benchmark random forest model for training, the fusion of the first prediction model and the second prediction model is completed, and the trained benchmark random forest model, that is, the target prediction model, is obtained.
