Electric power material demand prediction method and device, computer equipment, readable storage medium and program product
By constructing a project material demand relationship model and using matrix decomposition and iterative models to predict the demand for power materials, the problem of low prediction accuracy caused by sparse historical data is solved, and the accuracy of power materials demand prediction is improved.
Patent Information
- Application Number
- CN202411283805.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-09-13
- Publication Date
- 2025-01-14
AI Technical Summary
The existing power supply demand forecasting methods rely on a large amount of historical data, and the historical data is sparse, resulting in low prediction accuracy.
By constructing a project material demand relationship model, using matrix decomposition and iterative models, unknown demand is predicted based on known demand, reducing dependence on historical data, and improving prediction accuracy.
By reducing dependence on historical data, the accuracy of power material demand forecasting is improved and the reliability of forecast results is enhanced.
Smart Images

Figure CN119313055A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the technical field of material demand forecasting, and in particular to a method, device, computer equipment, computer-readable storage medium and computer program product for forecasting power material demand. Background Art
[0002] The forecast of power material demand is one of the important tasks for the development of modern power enterprises. The forecast of power material demand can help power enterprises effectively control procurement costs, inventory costs and production costs, and avoid cost increases caused by changes in demand. Therefore, it is necessary to accurately forecast the demand for power materials.
[0003] At present, the demand for power materials can be predicted by manual or mathematical models. However, the current forecasting method for power material demand requires a large amount of power material demand data support, but there is less historical power material demand data with high application value, which leads to low accuracy of power material demand forecasting results. Summary of the invention
[0004] Based on this, it is necessary to provide a method, device, computer equipment, computer-readable storage medium and computer program product for predicting demand for electric power materials in response to the above technical problems.
[0005] In a first aspect, the present application provides a method for predicting demand for electric power materials, comprising:
[0006] Obtaining a first project material matrix according to the unknown demand of the first power material corresponding to each power project and the known demand of the second power material corresponding to each power project;
[0007] The first project material matrix is input into a pre-constructed project material demand relationship model to obtain a second project material matrix; the loss value between the known demand of the second power material and the predicted demand of the second power material in the second project material matrix satisfies the loss threshold;
[0008] According to the second project material matrix, a solution result of predicting the unknown demand quantity of the first power material is predicted.
[0009] In one embodiment, obtaining the known demand of the second power material includes:
[0010] According to the hierarchical relationship between various power materials, the power material node diagram is obtained;
[0011] Acquire the subnode electric power material corresponding to the second electric power material;
[0012] When the unit of the second electric power material is consistent with the unit of the corresponding child node electric power material, the demand of the child node electric power material is merged into the demand of the second electric power material to obtain the known demand of the second electric power material.
[0013] In one embodiment, the first project material matrix is input into a pre-built project material demand relationship model to obtain a second project material matrix, including:
[0014] Decomposing the first project material matrix by using the matrix decomposition sub-model included in the project material demand relationship model to obtain a project feature initial matrix and a material feature initial matrix;
[0015] Iterating the project characteristic initial matrix and the material characteristic initial matrix through the matrix iteration sub-model included in the project material demand relationship model;
[0016] After each iteration, the material matrix of the project to be evaluated is obtained according to the iterated project feature matrix and material feature matrix, and it is determined whether the loss value between the predicted demand of the second electric power material in the material matrix of the project to be evaluated and the known demand of the second electric power material meets the loss threshold. If so, the material matrix of the project to be evaluated is used as the second project material matrix.
[0017] In one embodiment, obtaining a matrix decomposition sub-model includes:
[0018] According to the unknown demand of the first power material sample corresponding to each power project and the known demand of the second power material sample corresponding to each power project, a first project material matrix sample is obtained;
[0019] According to the known demand of the first power material sample corresponding to each power project and the known demand of the second power material sample corresponding to each power project, a real project material matrix is obtained;
[0020] Performing at least one training according to the first project material matrix sample and the real project material matrix;
[0021] Among them, each time training is performed, the following steps are performed: the first project material matrix sample is decomposed through the parameter to be adjusted model carrying the current training parameters to obtain project feature initial matrix samples and material feature initial matrix samples; the project feature initial matrix samples and the material feature initial matrix samples are iterated through the matrix iteration sub-model to obtain the second project material matrix samples; if the difference between the second project material matrix sample and the real project material matrix does not meet the conditions, the current training parameters are adjusted to obtain the next training parameters and enter the next training; if the difference between the second project material matrix sample and the real project material matrix meets the conditions, the parameter to be adjusted model carrying the current training parameters is used as the matrix decomposition sub-model.
[0022] In one embodiment, the method further comprises:
[0023] Selecting target power materials from the historical power materials corresponding to each historical power project as a first power material sample;
[0024] Setting the demand of the first electric power material sample as an unknown number to obtain the unknown demand of the first electric power material sample;
[0025] According to the record information of each historical power project, the actual demand for the target power material is obtained;
[0026] The actual demand for the target electric power material is used as the known demand for the first electric power material sample.
[0027] In one embodiment, the solution of predicting the unknown demand of the first power material according to the second project material matrix includes:
[0028] sequentially taking the unknown demand of the first electric power material as the target demand;
[0029] Obtaining a target position of the target demand in the first project material matrix;
[0030] Determining a target element in the second project material matrix according to the target location;
[0031] The value of the target element is used as the solution result of the target demand.
[0032] In a second aspect, the present application also provides a device for predicting demand for electric power materials, including:
[0033] A first matrix acquisition module, used to obtain a first project material matrix according to the unknown demand of the first power material corresponding to each power project and the known demand of the second power material corresponding to each power project;
[0034] A second matrix acquisition module is used to input the first project material matrix into a pre-constructed project material demand relationship model to obtain a second project material matrix; the loss value between the known demand of the second power material and the predicted demand of the second power material in the second project material matrix meets the loss threshold;
[0035] A solution result acquisition module is used to predict the solution result of the unknown demand quantity of the first power material according to the second project material matrix.
[0036] In a third aspect, the present application further provides a computer device, wherein the computer device comprises a memory and a processor, wherein the memory stores a computer program, and the processor executes the above method.
[0037] In a fourth aspect, the present application further provides a computer-readable storage medium, wherein a computer program is stored on the computer-readable storage medium, and the computer program is executed by a processor to execute the above method.
[0038] In a fifth aspect, the present application further provides a computer program product, wherein the computer program product comprises a computer program, and the computer program is executed by a processor to execute the above method.
[0039] The above-mentioned method, device, computer equipment, computer-readable storage medium and computer program product for predicting the demand for electric power materials obtain a first project material matrix based on the unknown demand for the first electric power material corresponding to each electric power project and the known demand for the second electric power material corresponding to each electric power project; the first project material matrix is input into a pre-constructed project material demand relationship model to obtain a second project material matrix; the loss value between the known demand for the second electric power material and the predicted demand for the second electric power material in the second project material matrix satisfies the loss threshold; and the solution result of the unknown demand for the first electric power material is predicted based on the second project material matrix. This application analyzes and predicts the solution result of the unknown demand for the first electric power material corresponding to each electric power project based on the correlation between the demand for the second electric power material and the demand for the first electric power material and the known demand for the second electric power material corresponding to each electric power project, which can reduce the dependence on historical electric power material demand data and improve the accuracy of the solution result of the unknown demand for the first electric power material. BRIEF DESCRIPTION OF THE DRAWINGS
[0040] In order to more clearly illustrate the technical solutions in the embodiments of the present application or related technologies, the drawings required for use in the embodiments of the present application or related technical descriptions will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other related drawings can be obtained based on these drawings without paying creative work.
[0041] Figure 1 It is an application environment diagram of a method for predicting power material demand in one embodiment;
[0042] Figure 2 A schematic diagram of a flow chart of a method for predicting power material demand in one embodiment;
[0043] Figure 3 A schematic diagram of a process for obtaining a known demand for a second electric power material in one embodiment;
[0044] Figure 4 It is a structural block diagram of a device for predicting power material demand in one embodiment;
[0045] Figure 5 FIG. 4 is a diagram showing the internal structure of a computer device in one embodiment. DETAILED DESCRIPTION
[0046] In order to make the purpose, technical solution and advantages of the present application more clearly understood, the present application is further described in detail below in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present application and are not used to limit the present application.
[0047] The present application embodiment provides a method for predicting power material demand, which can be executed by a computer device, such as Figure 1 As shown, the computer device can obtain the first project material matrix based on the unknown demand of the first power material corresponding to each power project and the known demand of the second power material corresponding to each power project, and then predict the solution result of the unknown demand of the first power material. It can be understood that the computer device can be implemented by a server, a terminal, or an interactive system between a terminal and a server. In this embodiment, the method includes Figure 2 The steps shown are:
[0048] Step S201: obtaining a first project material matrix according to the unknown demand of the first power material corresponding to each power project and the known demand of the second power material corresponding to each power project.
[0049] The electric power material whose demand is unknown may be referred to as a first electric power material, and the electric power material whose demand is known may be referred to as a second electric power material.
[0050] The unknown demand for the first power material corresponding to each power project and the known demand for the second power material corresponding to each power project can be used as elements of the first project material matrix, where the rows of the first project material matrix can represent various types of power projects, and the columns of the first project material matrix can represent various types of power materials.
[0051] Specifically, the number of power projects a is taken as the number of rows of the first project material matrix, and the material types b is taken as the number of columns of the first project material matrix. The first project material matrix can be recorded as , then the element of the material matrix of the first project is Represents the demand for the jth type of power materials in the ith power project.
[0052] Step S202, inputting the first project material matrix into a pre-constructed project material demand relationship model to obtain a second project material matrix; the loss value between the known demand of the second power material and the predicted demand of the second power material in the second project material matrix meets the loss threshold.
[0053] The project material demand relationship model can be trained through the historical use of power materials in the power project. The project material demand relationship model can analyze and predict the second project material matrix based on the correlation between the first project material matrix and the second power material demand and the first power material demand.
[0054] When the loss value between the known demand of the second power material and the predicted demand of the second power material in the second project material matrix meets the loss threshold, the accuracy of the second project material matrix meets the condition, and the project material demand relationship model can output the second project material matrix.
[0055] Step S203: predicting the unknown demand of the first power material according to the second project material matrix.
[0056] The second project material matrix has the same number of rows and columns as the first project material matrix. The position of the unknown demand for the first power material in the second project material matrix can be determined based on the position of the unknown demand for the first power material in the first project material matrix, and the element corresponding to the position is used as the solution result of the unknown demand for the first power material.
[0057] In the above-mentioned method for predicting the demand for electric power materials, based on the correlation between the demand for the second electric power material and the demand for the first electric power material and the known demand for the second electric power material corresponding to each electric power project, the solution results of the unknown demand for the first electric power material corresponding to each electric power project are analyzed and predicted, which can reduce the dependence on historical electric power material demand data and improve the accuracy of the solution results of the unknown demand for the first electric power material.
[0058] In one embodiment, the known demand for the second power material is obtained, and the specific steps are as follows: Figure 3As shown: Step S301, obtain the power material node diagram according to the hierarchical relationship between various power materials; Step S302, obtain the sub-node power material corresponding to the second power material; Step S303, when the unit of the second power material is consistent with the unit of the corresponding sub-node power material, merge the demand of the sub-node power material into the demand of the second power material to obtain the known demand of the second power material.
[0059] There is a hierarchical relationship between various electric power materials. According to the hierarchical relationship between various electric power materials, an electric power material node diagram can be obtained, in which the parent node of the electric power material node diagram belongs to the major category of electric power materials, such as wires and cables, and the child nodes corresponding to the parent node belong to the minor category of electric power materials, such as power cables, control cables and communication cables.
[0060] The subnode power material corresponding to the second power material can be obtained; when the unit of the second power material is consistent with the unit of the corresponding subnode power material, the demand for the subnode power material is merged into the demand for the second power material to obtain the known demand for the second power material.
[0061] The same method can be used to obtain the unknown demand for the first power material. Specifically, the sub-node power material corresponding to the first power material can be obtained; when the unit of the first power material is consistent with the unit of the corresponding sub-node power material, the demand for the sub-node power material is merged into the demand for the first power material to obtain the unknown demand for the first power material.
[0062] In this embodiment, when the unit of the second electric power material is consistent with the unit of the corresponding sub-node electric power material, the demand of the sub-node electric power material is merged into the demand of the second electric power material to obtain the known demand of the second electric power material, which can reduce the sparsity of the demand data of the second electric power material, thereby improving the accuracy of the solution result of the unknown demand of the first electric power material.
[0063] In one of the embodiments, the first project material matrix is input into a pre-constructed project material demand relationship model to obtain a second project material matrix, and the specific steps are as follows: the first project material matrix is decomposed by a matrix decomposition sub-model included in the project material demand relationship model to obtain a project feature initial matrix and a material feature initial matrix; the project feature initial matrix and the material feature initial matrix are iterated by a matrix iteration sub-model included in the project material demand relationship model; after each iteration, the material matrix of the project to be evaluated is obtained according to the iterated project feature matrix and material feature matrix, and it is determined whether the loss value between the predicted demand of the second power material in the material matrix of the project to be evaluated and the known demand of the second power material meets the loss threshold, and if so, the material matrix of the project to be evaluated is used as the second project material matrix.
[0064] The first project material matrix can be decomposed by the matrix decomposition sub-model included in the project material demand relationship model. Decompose and obtain the initial matrix of project characteristics and the initial matrix of material characteristics.
[0065] The project feature initial matrix and the material feature initial matrix can be iterated through the matrix iteration sub-model included in the project material demand relationship model. The stochastic gradient descent method can be used for iteration. After each iteration, the iterated project feature matrix and material characteristics matrix The product of is used as the material matrix of the project to be evaluated, where k refers to the project feature matrix The number of rows and material characteristics matrix The number of columns indicates the number of decomposed latent variables.
[0066] Specifically, the mean squared error (MSE) can be used as the predicted demand for the second power material in the material matrix of the project to be evaluated. Known demand for second power material The loss value between is shown in formula (1).
[0067] (1)
[0068] in is the item feature matrix Elements of is the material feature matrix The elements in .
[0069] The loss value L that needs to be solved is shown in formula (2).
[0070] (2)
[0071] In practical applications, in order to prevent overfitting, a regularization term can be added to the loss value L to obtain the optimized loss value As shown in formula (3).
[0072] (3)
[0073] in is the regularization coefficient.
[0074] Formula (3) can be used to and Taking the derivative, we get equation (4) and equation (5).
[0075] (4)
[0076] (5)
[0077] From equations (4) and (5), we can see that when iterating according to the stochastic gradient descent method, the project feature matrix and material characteristics matrix The iterative formulas are (6) and (7) respectively.
[0078] (6)
[0079] (7)
[0080] After each iteration, the feature matrix of the project after the iteration can be and material characteristics matrix , obtain the material matrix of the project to be evaluated, and determine the loss value between the predicted demand of the second power material in the material matrix of the project to be evaluated and the known demand of the second power material Whether the loss threshold is met. If so, the accuracy of the material matrix of the project to be evaluated meets the conditions, and the material matrix of the project to be evaluated is used as the material matrix of the second project. .
[0081] The second project material matrix obtained by the above method , so that the item feature matrix and material characteristics matrix The product can restore the first project material matrix as much as possible , as shown in formula (8).
[0082] (8)
[0083] The demand for the j-th power material of power project i can be calculated using formula (9).
[0084] (9)
[0085] In this embodiment, a second project material matrix with higher accuracy is obtained through the matrix decomposition sub-model and the matrix iteration sub-model included in the project material demand relationship model, thereby improving the accuracy of the solution result of the unknown demand of the first power material.
[0086] In one of the embodiments, a matrix decomposition sub-model is obtained, and the specific steps are as follows: a first project material matrix sample is obtained according to the unknown demand of the first power material sample corresponding to each power project and the known demand of the second power material sample corresponding to each power project; a real project material matrix is obtained according to the known demand of the first power material sample corresponding to each power project and the known demand of the second power material sample corresponding to each power project; at least one training is performed according to the first project material matrix sample and the real project material matrix; wherein, during each training, the following steps are performed: the first project material matrix sample is decomposed by the parameter to be adjusted model carrying the training parameters of this time to obtain the project feature initial matrix sample and the material feature initial matrix sample; the project feature initial matrix sample and the material feature initial matrix sample are iterated by the matrix iteration sub-model to obtain the second project material matrix sample; if the difference between the second project material matrix sample and the real project material matrix does not meet the conditions, the current training parameters are adjusted to obtain the next training parameters and enter the next training; if the difference between the second project material matrix sample and the real project material matrix meets the conditions, the parameter to be adjusted model carrying the training parameters of this time is used as the matrix decomposition sub-model.
[0087] The historical demand data of project materials can be obtained from the database of the power grid system, and the historical demand data of project materials can be preprocessed to analyze and process data that is helpful for predicting the demand for power materials, such as project name, power material demand, power material model and power material unit, to obtain the historical power material demand data, and based on the historical power material demand data, the unknown demand of the first power material sample corresponding to each power project and the known demand of the second power material sample corresponding to each power project can be obtained.
[0088] The unknown demand of the first power material sample corresponding to each power project and the known demand of the second power material sample corresponding to each power project can be used as elements of the first project material matrix sample, where the rows of the first project material matrix sample can represent various types of power projects, and the columns of the first project material matrix sample can represent various types of power materials.
[0089] Similarly, the real project material matrix can be obtained according to the known demand of the first power material sample corresponding to each power project and the known demand of the second power material sample corresponding to each power project.
[0090] At least one training can be performed based on the first project material matrix sample and the real project material matrix; wherein, during each training, the following steps are performed: the first project material matrix sample is decomposed by the parameter adjustment model carrying the training parameters of this time to obtain the project feature initial matrix sample and the material feature initial matrix sample.
[0091] The initial matrix samples of project characteristics and the initial matrix samples of material characteristics are iterated through the matrix iteration sub-model; after each iteration, the material matrix samples of the project to be evaluated are obtained according to the iterated project characteristic matrix samples and material characteristic matrix samples, and it is judged whether the loss value between the predicted demand of the second power material in the material matrix sample of the project to be evaluated and the known demand of the second power material meets the loss threshold; if so, the material matrix sample of the project to be evaluated is used as the material matrix sample of the second project.
[0092] If the difference between the second project material matrix sample and the real project material matrix does not meet the conditions, the parameters of this training are adjusted to obtain the parameters of the next training and enter the next training; if the difference between the second project material matrix sample and the real project material matrix meets the conditions, the parameter adjustment model carrying the training parameters of this time is used as the matrix decomposition sub-model.
[0093] In this embodiment, at least one training is performed based on the first project material matrix sample and the real project material matrix. During each training, when the difference between the second project material matrix sample and the real project material matrix meets the conditions, the parameter to be adjusted model carrying the training parameters of this time is used as the matrix decomposition sub-model, thereby obtaining a matrix decomposition sub-model with higher accuracy.
[0094] In one of the embodiments, the method provided in the present application also includes: selecting a target power material from the historical power materials corresponding to each historical power project as a first power material sample; setting the demand for the first power material sample to an unknown number to obtain an unknown demand for the first power material sample; obtaining an actual demand for the target power material based on the recorded information of each historical power project; and using the actual demand for the target power material as a known demand for the first power material sample.
[0095] Historical power material demand data can be obtained from the power grid system. The historical power material demand data can include a project material table as shown in Table 1. Based on the historical power material demand data, the historical power materials corresponding to each historical power project are determined, and the target power material is selected from the historical power materials corresponding to each historical power project as the first power material sample.
[0096] Table 1 Project Materials List
[0097]
[0098] The demand of the first power material sample is set as an unknown number to obtain the unknown demand of the first power material sample; the real demand of the target power material is obtained according to the record information of each historical power project; the real demand of the target power material is used as the known demand of the first power material sample.
[0099] In this embodiment, a target power material is selected from the historical power materials corresponding to each historical power project as the first power material sample. The demand of the first power material sample is processed to obtain the unknown demand and known demand of the first power material sample, so as to prepare data for obtaining the matrix decomposition sub-model.
[0100] In one of the embodiments, the solution result of the unknown demand of the first power material is predicted according to the second project material matrix, and the specific steps are as follows: the unknown demand of the first power material is used as the target demand in turn; the target position of the target demand in the first project material matrix is obtained; according to the target position, the target element is determined in the second project material matrix; and the value of the target element is used as the solution result of the target demand.
[0101] The second project material matrix has the same number of rows and columns as the first project material matrix, and each element in the second project material matrix has a corresponding element in the first project material matrix.
[0102] There are several unknown demands for the first power material. The unknown demands for the first power material can be taken as target demands in turn; the target position of the target demand in the first project material matrix is obtained; according to the target position, the target element is determined in the second project material matrix; and the value of the target element is taken as the solution result of the target demand.
[0103] For example, the target position of the target demand in the first project material matrix is the third row and fourth column, and the target element is determined in the second project material matrix according to the third row and fourth column of the target position. . The target element The value of is taken as the solution of the target demand.
[0104] In this embodiment, the unknown demand of the first power material can be used as the target demand in turn; the target element is determined in the second project material matrix according to the target position of the target demand in the first project material matrix; the value of the target element is used as the solution result of the target demand, so as to quickly and accurately obtain the solution result of the unknown demand of the first power material.
[0105] Historical power material demand data can be extracted from the database of the power grid system and filtered for specific power project demand, focusing on projects with "WN" and "WP" in the power project number. Given the wide variety of power materials and sparse historical data, an upward generalization strategy can be adopted to merge some power material categories. Subsequently, the frequency of occurrence of power materials in all power projects is counted and the power materials are sorted according to the frequency of occurrence. Based on this sorting, the top 20, 40, 80, 100 and 160 power materials with the highest frequency of occurrence are selected, and demand forecasts are made for the projects corresponding to these power materials.
[0106] The corresponding power projects can be selected from 80 power projects for the power materials ranked in the top 20, 40, 80, 100 and 160 in terms of frequency of use. The demand (usage value) of a specific material in one of the historical projects can be removed as the target of prediction. Considering the differences in the demand for power materials between different power projects, the relative error can be used as the criterion for evaluating the accuracy of the prediction. The rows and columns of the matrices P and Q decomposed from the matrix M are set to K. The relationship between the value of K and the number of power material categories is shown in Table 2. For each power material category, ten projects were selected to predict the demand for the power material, and the average relative error of the predicted power material demand was calculated.
[0107] Table 2 Parameter settings
[0108]
[0109] The prediction results are shown in Table 3. The analysis results show that as the number of power material categories considered increases, the average relative error shows an upward trend. This phenomenon may be because as the number of power material categories increases, the zero values in the first project material matrix samples also increase, resulting in a decrease in the efficiency of the first project material matrix sample decomposition.
[0110] Table 3 Prediction results
[0111]
[0112] The demand for the same power materials in different power projects varies significantly, which may also affect the performance of the project material demand relationship model. The project material demand relationship model can be tested by selecting an interval with a smaller error, as shown in Table 4:
[0113] Table 4 Forecast results of demand for some power materials
[0114]
[0115] According to the observation in Table 4, among the 10 types of power materials studied, the one with the largest error is power material 9, with an actual usage of 76 and a predicted value of 59.3, with an error of 22.0%. The one with the smallest error is material 6, with an actual usage of 3425 and a predicted value of 3241, with an error of 5.4%. Overall, the comprehensive error of predicting power material demand is 13.98%, which is relatively accurate overall.
[0116] In the actual forecast analysis of power material demand, in order to ensure the smooth progress of subsequent power projects, it is necessary to conduct a comprehensive analysis and evaluation of the types and quantities of materials required for each power project. Based on material information and historical power material usage data, in-depth data analysis can be conducted on power materials that are highly relevant to power projects. The demand and forecast results of specific materials are shown in Table 5.
[0117] Table 5 Test sample data
[0118]
[0119] As shown in Table 5, for power materials with strong correlation, the prediction error obtained by the prediction method of power material demand provided by this application is controlled within 10%. In general, the prediction method of power material demand provided by this application has high accuracy.
[0120] It should be understood that, although the various steps in the flowcharts involved in the above-mentioned embodiments are displayed in sequence according to the indication of the arrows, these steps are not necessarily executed in sequence according to the order indicated by the arrows. Unless there is a clear explanation in this article, the execution of these steps does not have a strict order restriction, and these steps can be executed in other orders. Moreover, at least a part of the steps in the flowcharts involved in the above-mentioned embodiments can include multiple steps or multiple stages, and these steps or stages are not necessarily executed at the same time, but can be executed at different times, and the execution order of these steps or stages is not necessarily to be carried out in sequence, but can be executed in turn or alternately with other steps or at least a part of the steps or stages in other steps.
[0121] Based on the same inventive concept, the embodiment of the present application also provides a device for predicting the demand for electric power materials for implementing the method for predicting the demand for electric power materials involved above. The implementation scheme for solving the problem provided by the device is similar to the implementation scheme recorded in the above method, so the specific limitations in the embodiments of one or more devices for predicting the demand for electric power materials provided below can refer to the limitations of the method for predicting the demand for electric power materials above, and will not be repeated here.
[0122] In an exemplary embodiment, Figure 4 As shown, a device for predicting power material demand is provided, wherein:
[0123] The first matrix acquisition module 401 is used to obtain a first project material matrix according to the unknown demand of the first power material corresponding to each power project and the known demand of the second power material corresponding to each power project;
[0124] The second matrix acquisition module 402 is used to input the first project material matrix into a pre-constructed project material demand relationship model to obtain a second project material matrix; the loss value between the known demand of the second power material and the predicted demand of the second power material in the second project material matrix meets the loss threshold;
[0125] The solution result acquisition module 403 is used to predict the solution result of the unknown demand quantity of the first power material according to the second project material matrix.
[0126] In one of the embodiments, the device also includes a known demand acquisition module, which is used to: obtain an electric power material node diagram based on the hierarchical relationship between various electric power materials; obtain the sub-node electric power material corresponding to the second electric power material; when the unit of the second electric power material is consistent with the unit of the corresponding sub-node electric power material, merge the demand of the sub-node electric power material into the demand of the second electric power material to obtain the known demand of the second electric power material.
[0127] In one embodiment, the second matrix acquisition module 402 is further used to: decompose the first project material matrix through the matrix decomposition submodel included in the project material demand relationship model to obtain a project feature initial matrix and a material feature initial matrix; iterate the project feature initial matrix and the material feature initial matrix through the matrix iteration submodel included in the project material demand relationship model; after each iteration, obtain the material matrix of the project to be evaluated based on the iterated project feature matrix and material feature matrix, and judge whether the loss value between the predicted demand of the second electric power material in the material matrix of the project to be evaluated and the known demand of the second electric power material meets the loss threshold; if so, use the material matrix of the project to be evaluated as the second project material matrix.
[0128] In one of the embodiments, the device further includes a sub-model acquisition module, which is used to: obtain a first project material matrix sample according to the unknown demand of the first power material sample corresponding to each power project and the known demand of the second power material sample corresponding to each power project; obtain a real project material matrix according to the known demand of the first power material sample corresponding to each power project and the known demand of the second power material sample corresponding to each power project; perform at least one training according to the first project material matrix sample and the real project material matrix; wherein, during each training, the following steps are performed: decompose the first project material matrix sample through the parameter to be adjusted model carrying the current training parameters to obtain project feature initial matrix samples and material feature initial matrix samples; iterate the project feature initial matrix samples and the material feature initial matrix samples through the matrix iteration sub-model to obtain the second project material matrix sample; if the difference between the second project material matrix sample and the real project material matrix does not meet the conditions, adjust the current training parameters to obtain the next training parameters and enter the next training; if the difference between the second project material matrix sample and the real project material matrix meets the conditions, use the parameter to be adjusted model carrying the current training parameters as the matrix decomposition sub-model.
[0129] In one of the embodiments, the device also includes a sample demand acquisition module, which is used to: select a target power material from the historical power materials corresponding to each historical power project as a first power material sample; set the demand of the first power material sample to an unknown number to obtain the unknown demand of the first power material sample; obtain the actual demand of the target power material based on the recorded information of each historical power project; and use the actual demand of the target power material as the known demand of the first power material sample.
[0130] In one embodiment, the solution result acquisition module 403 is used to: sequentially take the unknown demand of the first power material as the target demand; obtain the target position of the target demand in the first project material matrix; determine the target element in the second project material matrix according to the target position; and take the value of the target element as the solution result of the target demand.
[0131] Each module in the above-mentioned prediction device for power material demand can be implemented in whole or in part by software, hardware and a combination thereof. Each of the above-mentioned modules can be embedded in or independent of a processor in a computer device in the form of hardware, or can be stored in a memory in a computer device in the form of software, so that the processor can call and execute the operations corresponding to each of the above modules.
[0132] In an exemplary embodiment, a computer device is provided. The computer device may be a server, and its internal structure diagram may be as shown in FIG. Figure 5 As shown. The computer device includes a processor, a memory, an input / output interface (Input / Output, referred to as I / O) and a communication interface. Among them, the processor, the memory and the input / output interface are connected through a system bus, and the communication interface is connected to the system bus through the input / output interface. Among them, the processor of the computer device is used to provide computing and control capabilities. The memory of the computer device includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system, a computer program and a database. The internal memory provides an environment for the operation of the operating system and the computer program in the non-volatile storage medium. The database of the computer device is used to store data of a method for predicting demand for electric power materials. The input / output interface of the computer device is used to exchange information between the processor and an external device. The communication interface of the computer device is used to communicate with an external terminal through a network connection. When the computer program is executed by the processor, a method for predicting demand for electric power materials is implemented.
[0133] Those skilled in the art will understand that Figure 5 The structure shown in the figure is only a block diagram of a part of the structure related to the solution of the present application, and does not constitute a limitation on the computer device to which the solution of the present application is applied. The specific computer device may include more or fewer components than those shown in the figure, or combine certain components, or have a different arrangement of components.
[0134] In one embodiment, a computer device is further provided, including a memory and a processor, wherein a computer program is stored in the memory, and the processor implements the steps in the above method embodiments when executing the computer program.
[0135] In one embodiment, a computer-readable storage medium is provided, on which a computer program is stored. When the computer program is executed by a processor, the steps in the above-mentioned method embodiments are implemented.
[0136] In one embodiment, a computer program product is provided, including a computer program, which implements the steps in the above method embodiments when executed by a processor.
[0137] It should be noted that the user information (including but not limited to user device information, user personal information, etc.) and data (including but not limited to data used for analysis, stored data, displayed data, etc.) involved in this application are all information and data authorized by the user or fully authorized by all parties, and the collection, use and processing of relevant data must comply with relevant regulations.
[0138] A person of ordinary skill in the art can understand that all or part of the processes in the above-mentioned embodiment method can be completed by instructing the relevant hardware through a computer program, and the computer program can be stored in a non-volatile computer-readable storage medium. When the computer program is executed, it can include the processes of the embodiments of the above-mentioned methods. Among them, any reference to the memory, database or other medium used in the embodiments provided in the present application can include at least one of non-volatile memory and volatile memory. Non-volatile memory can include read-only memory (ROM), magnetic tape, floppy disk, flash memory, optical memory, high-density embedded non-volatile memory, resistive random access memory (ReRAM), magnetic random access memory (MRAM), ferroelectric random access memory (FRAM), phase change memory (PCM), graphene memory, etc. Volatile memory can include random access memory (RAM) or external cache memory, etc. As an illustration and not limitation, RAM can be in various forms, such as static random access memory (SRAM) or dynamic random access memory (DRAM). The database involved in each embodiment provided in this application may include at least one of a relational database and a non-relational database. Non-relational databases may include distributed databases based on blockchains, etc., but are not limited to this. The processor involved in each embodiment provided in this application may be a general-purpose processor, a central processing unit, a graphics processor, a digital signal processor, a programmable logic device, a data processing logic device based on quantum computing, an artificial intelligence (AI) processor, etc., but are not limited to this.
[0139] The technical features of the above embodiments may be combined arbitrarily. To make the description concise, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this application.
[0140] The above-described embodiments only express several implementation methods of the present application, and the descriptions thereof are relatively specific and detailed, but they cannot be understood as limiting the scope of the present application. It should be pointed out that, for a person of ordinary skill in the art, several variations and improvements can be made without departing from the concept of the present application, and these all belong to the protection scope of the present application. Therefore, the protection scope of the present application shall be subject to the attached claims.
Claims
1. A method for predicting power material demand, characterized in that: The method comprises: Obtaining a first project material matrix according to the unknown demand of the first power material corresponding to each power project and the known demand of the second power material corresponding to each power project; The first project material matrix is input into a pre-constructed project material demand relationship model to obtain a second project material matrix; the loss value between the known demand of the second power material and the predicted demand of the second power material in the second project material matrix satisfies the loss threshold; According to the second project material matrix, a solution result of predicting the unknown demand quantity of the first power material is predicted.
2. The method according to claim 1, characterized in that Obtain the known demand for the second power material, including: According to the hierarchical relationship between various power materials, the power material node diagram is obtained; Acquire the subnode electric power material corresponding to the second electric power material; When the unit of the second electric power material is consistent with the unit of the corresponding child node electric power material, the demand of the child node electric power material is merged into the demand of the second electric power material to obtain the known demand of the second electric power material.
3. The method according to claim 1, characterized in that The first project material matrix is input into a pre-built project material demand relationship model to obtain a second project material matrix, including: Decomposing the first project material matrix by using the matrix decomposition sub-model included in the project material demand relationship model to obtain a project feature initial matrix and a material feature initial matrix; Iterating the project characteristic initial matrix and the material characteristic initial matrix through the matrix iteration sub-model included in the project material demand relationship model; After each iteration, the material matrix of the project to be evaluated is obtained according to the iterated project feature matrix and material feature matrix, and it is determined whether the loss value between the predicted demand of the second electric power material in the material matrix of the project to be evaluated and the known demand of the second electric power material meets the loss threshold. If so, the material matrix of the project to be evaluated is used as the second project material matrix.
4. The method according to claim 3, characterized in that Get the matrix decomposition sub-model, including: According to the unknown demand of the first power material sample corresponding to each power project and the known demand of the second power material sample corresponding to each power project, a first project material matrix sample is obtained; According to the known demand of the first power material sample corresponding to each power project and the known demand of the second power material sample corresponding to each power project, a real project material matrix is obtained; Performing at least one training according to the first project material matrix sample and the real project material matrix; Among them, each time training is performed, the following steps are performed: the first project material matrix sample is decomposed through the parameter to be adjusted model carrying the current training parameters to obtain project feature initial matrix samples and material feature initial matrix samples; the project feature initial matrix samples and the material feature initial matrix samples are iterated through the matrix iteration sub-model to obtain the second project material matrix samples; if the difference between the second project material matrix sample and the real project material matrix does not meet the conditions, the current training parameters are adjusted to obtain the next training parameters and enter the next training; if the difference between the second project material matrix sample and the real project material matrix meets the conditions, the parameter to be adjusted model carrying the current training parameters is used as the matrix decomposition sub-model.
5. The method according to claim 4, characterized in that The method further comprises: Selecting target power materials from the historical power materials corresponding to each historical power project as a first power material sample; Setting the demand of the first electric power material sample as an unknown number to obtain the unknown demand of the first electric power material sample; According to the record information of each historical power project, the actual demand for the target power material is obtained; The actual demand for the target electric power material is used as the known demand for the first electric power material sample.
6. The method according to claim 1, characterized in that The solution result of predicting the unknown demand quantity of the first power material according to the second project material matrix includes: sequentially taking the unknown demand of the first electric power material as the target demand; Obtaining a target position of the target demand in the first project material matrix; Determining a target element in the second project material matrix according to the target location; The value of the target element is used as the solution result of the target demand.
7. A device for predicting demand for electric power materials, characterized in that: The device comprises: A first matrix acquisition module, used to obtain a first project material matrix according to the unknown demand of the first power material corresponding to each power project and the known demand of the second power material corresponding to each power project; A second matrix acquisition module is used to input the first project material matrix into a pre-constructed project material demand relationship model to obtain a second project material matrix; the loss value between the known demand of the second power material and the predicted demand of the second power material in the second project material matrix meets the loss threshold; A solution result acquisition module is used to predict the solution result of the unknown demand quantity of the first power material according to the second project material matrix.
8. A computer device comprising a memory and a processor, wherein the memory stores a computer program, wherein: When the processor executes the computer program, the steps of the method according to any one of claims 1 to 6 are implemented.
9. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 6 are implemented.
10. A computer program product, comprising a computer program, characterized in that When the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 6 are implemented.