Training method of equipment consumption prediction model, equipment consumption prediction method and device, computer readable storage medium and electronic equipment
By combining deep learning models with LSTM and Attention mechanisms, and using gradient optimization algorithm to optimize parameters, the problem of low prediction accuracy in equipment consumption in the prior art is solved, and higher prediction accuracy and accuracy are achieved.
Patent Information
- Application Number
- CN202411816526.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-11
- Publication Date
- 2025-01-07
- Estimated Expiration
- Not applicable · inactive patent
AI Technical Summary
The prior art cannot improve the prediction accuracy of equipment consumption. As the influencing factors increase and the amount of data increases, the prediction accuracy is lower.
Using a deep learning model that integrates long and short-term memory LSTM network and attention Attention mechanism, GBO optimizes LSTM-Attention parameters through the gradient optimization algorithm of fusion reverse learning strategy, builds equipment consumption prediction models, expands search range, and improves population diversity, thereby Improve prediction accuracy.
It achieves the accuracy of the equipment consumption prediction model, improves the prediction accuracy, and can more accurately predict the equipment consumption corresponding to any task.
Smart Images

Figure CN119272836A_ABST
Abstract
Description
Technical Field
[0001] The present disclosure relates to the technical field of equipment consumption prediction, and in particular to a training method for an equipment consumption prediction model, an equipment consumption prediction method, a device, a computer-readable storage medium, and an electronic device. Background Art
[0002] Equipment consumption refers to the process in which equipment gradually decreases or becomes ineffective due to use, wear, aging, etc. in various application scenarios. In order to ensure effective resource allocation and reduce waste, especially in the fields of military equipment, industrial production, vehicle maintenance, etc., equipment consumption forecasting is the premise and basis for doing a good job in technical support.
[0003] At present, as the factors affecting equipment consumption increase and the amount of data increases, the methods for equipment consumption prediction in related technologies are no longer applicable, resulting in low prediction accuracy.
[0004] Therefore, the related technology cannot improve the accuracy of equipment consumption prediction. Summary of the invention
[0005] The main purpose of the present disclosure is to provide a training method for an equipment consumption prediction model, an equipment consumption prediction method, a device, a computer-readable storage medium and an electronic device to solve the problem in related technologies that the accuracy of equipment consumption prediction cannot be improved.
[0006] In order to achieve the above-mentioned object, the first aspect of the present disclosure provides a method for training an equipment consumption prediction model, comprising: Acquire historical equipment consumption data, the historical equipment consumption data including: mission duration, mission type, mission intensity, number of personnel involved in the mission, equipment index involved in the mission, climate when performing the mission, terrain when performing the mission, wind speed when performing the mission, visibility when performing the mission, and equipment consumption corresponding to the mission, where there are multiple missions; Extracting features from the historical equipment consumption data to obtain a sample set; The sample set is divided into a training set, a validation set and a test set, and according to the training set, the LSTM-Attention parameters are optimized by using the gradient optimization algorithm GBO that integrates the reverse learning strategy, and the LSTM-Attention model after the optimized parameters is evaluated by using the validation set, and the evaluated LSTM-Attention is tested by using the test set to determine the equipment consumption prediction model; Among them, the LSTM-Attention is a deep learning model that integrates the long short-term memory LSTM network and the attention mechanism, and the equipment consumption prediction model is used to predict the equipment consumption corresponding to any task.
[0007] Optionally, further, extracting features from the historical equipment consumption data to obtain a sample set includes: For each task in the equipment consumption data, the following operations are performed to obtain a sample set: Normalizing the task duration, the task intensity, the number of personnel participating in the task, the equipment index participating in the task, and the wind force when the task is performed, respectively corresponding to the tasks, to obtain a plurality of first features; Obtaining a plurality of second features through one-hot encoding according to the task types, the climate when performing the tasks, the terrain when performing the tasks, and the visibility when performing the tasks respectively corresponding to the tasks; The actual equipment consumption corresponding to the task is used as a sample label; The plurality of first features, the plurality of second features and the sample labels respectively corresponding to the tasks are used as sample data corresponding to the tasks; The sample set includes sample data corresponding to each of the multiple tasks.
[0008] Optionally, further, the LSTM-Attention parameters include at least a batch size beach_size, a learning rate, a regularization parameter, and the number of LSTM hidden layer units; the step of optimizing the LSTM-Attention parameters by using a gradient optimization algorithm GBO integrating a reverse learning strategy based on the training set includes: Initialize the LSTM-Attention parameters, and determine the upper limit and lower limit of each parameter in the LSTM-Attention parameters; According to the beach_size, each sample data in the training set is input into the LSTM-Attention, and the LSTM-Attention parameters are optimized by the GBO integrating the reverse learning strategy to determine the optimized LSTM-Attention parameters and the LSTM-Attention after the optimized parameters.
[0009] Optionally, further, optimizing LSTM-Attention parameters by integrating the GBO with the reverse learning strategy, determining the optimized LSTM-Attention parameters and the LSTM-Attention after the optimized parameters, includes: Determine GBO algorithm parameters and construct the GBO; Initialize the population by using the GBO, and calculate the population at the opposite position corresponding to the initialized population by using a reverse learning strategy; According to the initialized population and the population at the opposite position corresponding to the initialized population, the population fitness value is calculated to find the current optimal vector and the current worst vector; By repeatedly performing the first operation, a target optimal vector is determined, and the optimized LSTM-Attention parameters are determined according to the target optimal vector, and the LSTM-Attention after the optimized parameters is constructed according to the optimized LSTM-Attention parameters.
[0010] Optionally, further, the first operation includes: Determine whether the current number of iterations is less than the total number of iterations; If the current number of iterations is greater than or equal to the total number of iterations, the process of performing the GBO optimization of LSTM-Attention parameters is stopped, and the current optimal vector is used as the target optimal vector; If the current number of iterations is less than the total number of iterations, the following second operation is performed: Calculate a first vector by using a gradient search rule GSR in the GBO; The first vector calculated according to the GSR is a position of a previous current vector and an opposite position of the current vector; If the random number generated by the rand function is greater than or equal to the execution probability of the local escape operator LEO in the GBO, then according to the position of the current vector and the opposite position of the current vector, the population fitness value is calculated to find the current optimal vector and the current worst vector; If the random number generated by the rand function is less than the execution probability of the local escape operator LEO in the GBO, the second vector is calculated through LEO; the position of the current vector and the opposite position of the current vector are calculated according to the second vector calculated by LEO; and the current optimal vector and the current worst vector are found by calculating the population fitness value according to the position of the current vector and the opposite position of the current vector.
[0011] Optionally, further, the performing model evaluation on the LSTM-Attention after optimizing the parameters through the validation set includes: Input the validation set into the LSTM-Attention after optimizing the parameters, and obtain the prediction value corresponding to each task in the validation set; According to the predicted values and corresponding sample labels corresponding to each of the tasks in the validation set, at least one of the mean square error, the mean absolute error, the mean relative error, and the coefficient of determination is calculated to evaluate the LSTM-Attention after the optimized parameters; If the evaluation result does not meet the preset conditions, continue to optimize the LSTM-Attention parameters through the GBO that integrates the reverse learning strategy until the evaluation result meets the preset conditions.
[0012] A second aspect of the present disclosure provides an equipment consumption prediction method, comprising: Acquire equipment consumption data of the target task to be predicted, wherein the equipment consumption data of the target task includes: duration of the target task, type of the target task, intensity of the target task, number of personnel participating in the target task, equipment index of participating in the target task, climate when performing the target task, terrain when performing the target task, wind speed when performing the target task, and visibility when performing the target task; Extracting features from the equipment consumption data of the target task to obtain feature data of the target task; Inputting the characteristic data of the target task into the equipment consumption prediction model to predict the equipment consumption of the target task; Among them, the equipment consumption prediction model is obtained by optimizing the LSTM-Attention parameters by integrating GBO with the reverse learning strategy, and performing model evaluation and model testing on the LSTM-Attention after optimizing the parameters. The LSTM-Attention is a deep learning model that integrates the LSTM network and the Attention mechanism.
[0013] A third aspect of the present disclosure provides a training device for an equipment consumption prediction model, comprising: an acquisition unit, used to acquire historical equipment consumption data, the historical equipment consumption data including: mission duration, mission type, mission intensity, number of personnel participating in the mission, equipment index participating in the mission, climate when performing the mission, terrain when performing the mission, wind speed when performing the mission, visibility when performing the mission, and equipment consumption corresponding to the mission, wherein there are multiple missions; A processing unit, used for extracting features from the historical equipment consumption data to obtain a sample set; A training unit, used for dividing the sample set into a training set, a validation set and a test set, and optimizing the LSTM-Attention parameters by using the gradient optimization algorithm GBO integrating the reverse learning strategy according to the training set, and performing a model evaluation on the LSTM-Attention after the optimization parameters by using the validation set, and testing the evaluated LSTM-Attention by using the test set to determine the equipment consumption prediction model; Among them, the LSTM-Attention is a deep learning model that integrates the long short-term memory LSTM network and the attention mechanism, and the equipment consumption prediction model is used to predict the equipment consumption corresponding to any task.
[0014] The fourth aspect of the present disclosure provides a computer-readable storage medium storing computer instructions for causing a computer to execute the equipment consumption prediction model training method provided in any one of the first aspects or the equipment consumption prediction method provided in any one of the second aspects.
[0015] The fifth aspect of the present disclosure provides an electronic device, comprising: at least one processor; and a memory communicatively connected to the at least one processor; wherein the memory stores a computer program executable by the at least one processor, and the computer program is executed by the at least one processor so that the at least one processor executes the training method of the equipment consumption prediction model provided in any one of the first aspects or the equipment consumption prediction method provided in any one of the second aspects.
[0016] The sixth aspect of the present disclosure provides a computer program product, which includes a computer program. When the computer program is executed by a processor, it implements the training method of the equipment consumption prediction model provided in any one of the first aspects or the equipment consumption prediction method provided in any one of the second aspects.
[0017] In the training method of the equipment consumption prediction model provided in the embodiment of the present disclosure, a sample set is constructed by extracting features of historical equipment consumption data, and based on the training set divided by the sample set, the LSTM-Attention parameters are optimized by the gradient optimization algorithm GBO that integrates the reverse learning strategy, so as to expand the search range through the reverse learning strategy and improve the diversity of the population. The LSTM-Attention parameters are optimized in combination with GBO to improve the accuracy of the prediction, and the LSTM-Attention model after the optimized parameters is evaluated through the validation set, and the evaluated LSTM-Attention is tested through the test set, thereby determining the equipment consumption prediction model that can be used to predict the equipment consumption corresponding to any task, thereby achieving the purpose of training the equipment consumption prediction model, thereby achieving the technical effect of improving the accuracy of the equipment consumption prediction model, and thereby solving the technical problem that the related technology cannot improve the accuracy of equipment consumption prediction. BRIEF DESCRIPTION OF THE DRAWINGS
[0018] In order to more clearly illustrate the specific embodiments of the present disclosure or the technical solutions in the related technologies, the drawings required for use in the specific embodiments or the related technical descriptions will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present disclosure. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.
[0019] Figure 1 A schematic diagram of a scenario of a method for training an equipment consumption prediction model provided in an embodiment of the present disclosure; Figure 2 A flowchart of a method for training an equipment consumption prediction model provided in an embodiment of the present disclosure; Figure 3 A flowchart of a method for training an equipment consumption prediction model provided by yet another embodiment of the present disclosure; Figure 4 A schematic diagram of a projection provided by an embodiment of the present disclosure; Figure 5 A schematic diagram of a process for optimizing LSTM-Attention parameters provided in an embodiment of the present disclosure; Figure 6 A block diagram of a training device for an equipment consumption prediction model provided in an embodiment of the present disclosure; Figure 7 A block diagram of an electronic device provided for an embodiment of the present disclosure. DETAILED DESCRIPTION
[0020] In order to enable those skilled in the art to better understand the scheme of the present disclosure, the technical scheme in the embodiments of the present disclosure will be clearly and completely described below in conjunction with the drawings in the embodiments of the present disclosure. Obviously, the described embodiments are only part of the embodiments of the present disclosure, not all of the embodiments. Based on the embodiments in the present disclosure, all other embodiments obtained by ordinary technicians in the field without creative work should fall within the scope of protection of the present disclosure.
[0021] It should be noted that the terms "first", "second", etc. in the specification and claims of the present disclosure and the above-mentioned drawings are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence. It should be understood that the data used in this way can be interchanged where appropriate, so as to describe the embodiments of the present disclosure described herein. In addition, the terms "including" and "having" and any variations thereof are intended to cover non-exclusive inclusions, for example, a process, method, system, product or device that includes a series of steps or units is not necessarily limited to those steps or units clearly listed, but may include other steps or units that are not clearly listed or inherent to these processes, methods, products or devices.
[0022] In the present disclosure, the terms "upper", "lower", "left", "right", "front", "back", "top", "bottom", "inner", "outer", "middle", "vertical", "horizontal", "lateral", "longitudinal" and the like indicate positions or positional relationships based on the positions or positional relationships shown in the drawings. These terms are mainly used to better describe the present disclosure and its embodiments, and are not used to limit the indicated devices, elements or components to have a specific orientation, or to be constructed and operated in a specific orientation.
[0023] In addition, some of the above terms may be used to express other meanings in addition to indicating orientation or positional relationship. For example, the term "on" may also be used to express a certain dependency or connection relationship in some cases. For those of ordinary skill in the art, the specific meanings of these terms in this disclosure can be understood according to specific circumstances.
[0024] In addition, the terms "installed", "set", "provided with", "connected", "connected", and "socketed" should be understood in a broad sense. For example, it can be a fixed connection, a detachable connection, or an integral structure; it can be a mechanical connection or an electrical connection; it can be a direct connection, or an indirect connection through an intermediate medium, or it can be an internal connection between two devices, elements, or components. For those of ordinary skill in the art, the specific meanings of the above terms in this disclosure can be understood according to specific circumstances.
[0025] It should be noted that, in the absence of conflict, the embodiments and features in the embodiments of the present disclosure may be combined with each other. The present disclosure will be described in detail below with reference to the accompanying drawings and in combination with the embodiments.
[0026] The prediction of equipment consumption is the premise and foundation for doing a good job in technical support. With the development of science and technology, the factors affecting equipment consumption in various special operations have also changed, which has brought severe challenges to equipment support. Equipment demand prediction is the basic work of equipment support, which has a driving effect on equipment procurement and supply. Most of the new equipment used in modern high-tech conditions are high-efficiency and precise equipment, which is of high value. It is of great significance to predict equipment demand, and the equipment demand prediction system or program is indispensable. Accurately predicting equipment demand is the key to accurate equipment support, and it is also the difficulty of current equipment support research.
[0027] At present, as the factors affecting equipment consumption increase and the amount of data increases, the methods for predicting equipment consumption in related technologies are no longer applicable, resulting in low prediction accuracy. Therefore, related technologies cannot improve the accuracy of equipment consumption prediction.
[0028] In order to solve the above problems, the technical concept of the present invention is to adopt a combination of LSTM and Attention, build a sample set based on historical equipment consumption data, and train the LSTM-Attention model, which can give full play to the advantages of LSTM and Attention in prediction, and use the gradient optimization algorithm GBO to optimize the LSTM-Attention parameters, which can effectively ensure the accuracy of the prediction. At the same time, the reverse learning strategy is adopted to integrate GBO and then optimize the LSTM-Attention parameters, so as to expand the search range through the reverse learning strategy, improve the diversity of the population, and further improve the accuracy of the prediction.
[0029] In practical applications, taking the training scenario as an example, the execution subject of the present disclosure can be a training device for the equipment consumption prediction model, and the training device for the equipment consumption prediction model can be deployed in electronic devices, such as terminal devices, servers, etc. Users can train the equipment consumption prediction model through electronic devices deployed with the training device for the equipment consumption prediction model. The equipment here can be equipment in military operations or battlefield equipment (for example, new equipment, etc., which are not specifically limited here). The equipment consumption prediction model can adopt a model combining a long short-term memory network (Long Short-Term Memory, LSTM) and an attention mechanism (Attention), that is, LSTM-Attention. By extracting the features of historical equipment consumption data, a sample set is constructed, and then the LSTM-Attention model is trained based on the sample set. During the entire training process, the gradient optimization algorithm GBO that integrates the reverse learning strategy can be used to optimize the LSTM-Attention parameters, which can expand the search range, improve the diversity of the population, and further improve the prediction accuracy. Among them, the trained LSTM-Attention is used as an equipment consumption prediction model to predict the equipment consumption corresponding to any task.
[0030] For example, see Figure 1 As shown, Figure 1A schematic diagram of a scenario of a training method for an equipment consumption prediction model provided by an embodiment of the present disclosure. The scenario includes an equipment consumption data collection device 101 and a server 102 on which a training device for an equipment consumption prediction model is deployed. The equipment consumption data collection device is used to collect equipment consumption data. For example, a task corresponds to at least one set of data, including: task duration, task type, task intensity, number of personnel participating in the task, equipment index participating in the task, climate when performing the task, terrain when performing the task, wind force when performing the task, visibility when performing the task, etc. If the historical equipment consumption data collected is historical equipment consumption data, the set of data may also include the equipment consumption corresponding to the task. The server 102 is used to obtain the historical equipment consumption data transmitted by the equipment consumption data collection device, and pre-process the historical equipment consumption data to construct a sample set, or construct a sample set based on the acquired historical equipment consumption data through the equipment consumption data collection device, and transmit the sample set to the server 102. Based on the sample set, the server 102 trains the LSTM-Attention model through the training device of the equipment consumption prediction model to obtain an equipment consumption prediction model to predict the equipment consumption corresponding to any task.
[0031] Through the above application scenarios, the present invention optimizes the LSTM-Attention parameters by integrating the gradient optimization algorithm GBO with the reverse learning strategy, thereby expanding the search range through the reverse learning strategy, improving the diversity of the population, and combining GBO to optimize the LSTM-Attention parameters to improve the accuracy of the prediction.
[0032] Optionally, in practical applications, taking prediction scenarios as an example (e.g., equipment consumption prediction scenarios during various special operations), the execution subject of the present disclosure may be an equipment consumption prediction device, which may be determined after a model is trained by a training device based on an equipment consumption prediction model, or the trained LSTM-Attention may be configured in the equipment consumption prediction device, without specific limitation here. Among them, the equipment consumption prediction device may be deployed in an electronic device, such as a terminal device, a server, etc., and the training device of the equipment consumption prediction model and the equipment consumption prediction device may be the same device or different devices; if they are different devices, the training device of the equipment consumption prediction model and the equipment consumption prediction device may be deployed on the same electronic device or on different electronic devices, without specific limitation here.
[0033] Specifically, users can predict equipment consumption through electronic devices equipped with equipment consumption prediction devices. The equipment here is the same or similar to the equipment in the above training scenario, and is not specifically limited here. The equipment consumption prediction model is obtained by training a model combining LSTM and Attention. Among them, GBO with a fusion reverse learning strategy is used to optimize the LSTM-Attention parameters, so that the trained LSTM-Attention model (i.e., the equipment consumption prediction model) has a higher prediction accuracy.
[0034] First, an electronic device equipped with an equipment consumption prediction device, taking a server as an example, obtains the equipment consumption data of the target task to be predicted transmitted by the equipment consumption data acquisition device, such as: the duration of the target task, the type of target task, the intensity of the target task, the number of personnel participating in the target task, the equipment index participating in the target task, the climate when performing the target task, the terrain when performing the target task, the wind force when performing the target task, the visibility when performing the target task, etc. Then, the equipment consumption data acquisition device or the server extracts the characteristic data based on the acquired equipment consumption data of the target task, and the characteristic data of the target task is input into the equipment consumption prediction model through the server to predict the equipment consumption of the target task. The prediction results (for example, equipment consumption) of the equipment consumption prediction model can be used to reserve more accurate materials or equipment for military operations or battlefields.
[0035] It should be noted that in the technical solution of the present invention, the collection, storage, use, processing, transmission, provision and disclosure of information such as equipment consumption data or user data involved are in compliance with the provisions of relevant laws and regulations and do not violate public order and good morals.
[0036] The technical solution of the present disclosure is described in detail with specific embodiments below. The following specific embodiments can be combined with each other, and the same or similar concepts or processes may not be described in detail in some embodiments.
[0037] The present disclosure provides a method for training an equipment consumption prediction model. Figure 2 As shown, the method includes the following steps S201 to S203: Step S201: Obtain historical equipment consumption data, the historical equipment consumption data including: mission duration, mission type, mission intensity, number of personnel involved in the mission, equipment index involved in the mission, climate when performing the mission, terrain when performing the mission, wind speed when performing the mission, visibility when performing the mission, and equipment consumption corresponding to the mission, where there are multiple tasks.
[0038] Step S202: extracting features from the historical equipment consumption data to obtain a sample set.
[0039] Step S203: Divide the sample set into a training set, a validation set and a test set, and optimize the LSTM-Attention parameters according to the training set by using the gradient optimization algorithm GBO that integrates the reverse learning strategy, and evaluate the LSTM-Attention model after optimizing the parameters through the validation set, and test the evaluated LSTM-Attention through the test set to determine the equipment consumption prediction model.
[0040] Among them, the LSTM-Attention is a deep learning model that integrates the long short-term memory LSTM network and the attention mechanism, and the equipment consumption prediction model is used to predict the equipment consumption corresponding to any task.
[0041] In the disclosed embodiment, feature extraction is performed based on the acquired historical equipment consumption data to construct a sample set, and based on the training set divided by the sample set, the LSTM-Attention parameters are optimized by the gradient optimization algorithm GBO that integrates the reverse learning strategy, so as to expand the search range through the reverse learning strategy and improve the diversity of the population. The LSTM-Attention parameters are optimized in combination with GBO to improve the accuracy of the prediction, and the LSTM-Attention model after the optimized parameters is evaluated through the validation set, and the evaluated LSTM-Attention is tested through the test set, thereby determining an equipment consumption prediction model that can be used to predict the equipment consumption corresponding to any task, thereby achieving the purpose of training the equipment consumption prediction model, thereby improving the prediction accuracy of the equipment consumption prediction model, and then improving the accuracy of the equipment consumption prediction.
[0042] Among them, the indicators that affect the consumption of equipment (for example, equipment used in missions, including battlefield equipment, etc., where the missions here can be military action missions or war mission events) mainly include: (1) Task duration, in hours; (2) Mission type: divided into offensive mission and defensive mission according to the type of operation; (3) Task intensity; the larger the value, the greater the task intensity; (4) The number of people involved in the task; the unit is individual; (5) Participation Equipment Index (or Participation Mission Equipment Index); the larger the value, the greater the equipment index; (6) The terrain where the mission is to be carried out (e.g., on-site terrain); divided into plateaus, basins, plains, hills, and mountains; (7) Wind speed during the mission (e.g., on-site wind speed); classified by wind speed; (8) Visibility during mission execution (e.g., on-site visibility); a value between 0 and 8, where the larger the value, the better the visibility.
[0043] (9) The climate during which the mission is performed (e.g., on-site climate).
[0044] Among them, mission duration, number of personnel involved in the mission, mission intensity, participating equipment index, on-site wind speed, and on-site visibility are numerical indicators, while mission type, on-site terrain, and on-site climate are classification indicators.
[0045] The consumption data of a certain type of equipment obtained through simulation is shown in Table 1.
[0046] Table 1 Data table of consumption of certain type of equipment
[0047] The following is a detailed explanation of LSTM and Attention.
[0048] 1. For LSTM prediction model: LSTM belongs to recursive neural network (RNN). Compared with traditional RNN, LSTM adds memory units to each neural unit in the hidden layer. At the same time, each neural unit transmits information through a "gate" structure (forget gate, input gate, cell state update, output gate), thereby determining the degree of memory and forgetting of past information and immediate information, and has a long-term memory function.
[0049] The LSTM model mainly includes , , , , and etc., among which for The input at for The memory input value is called for The forget gate value at for The new cell state value at time is the output value of the output gate, called for The output value when .
[0050] The LSTM model is The specific process of the layer is: after the forget gate calculation, the first Layer Input and Output , The information in is preserved. Get and information, using The function performs the calculation and passes the result to the previous layer . After the input gate, control Layer Value and the upper layer , and keep the layer After the output gate, the control Layer Input , Still retain The LSTM model is in The output result of the layer. Through training, the weights of each control gate are obtained. The layer obtained , as the input of the next layer. According to the above ideas, we can achieve step-by-step recursion and finally get the LSTM model.
[0051] Specifically, the purpose of the forget gate is to filter the Layer Input And the output of the previous layer , after passing through the forget gate, it remains in the current layer long-term state When you get the information and After the information is obtained, the activation function will be used Process the data. At the same time, the forget gate passes the result to the previous long-term state , whose output The expression is: (1) in: is the weight vector; is the forget gate parameter; It is the sigmpd function; symbol is the vector dot product.
[0052] The purpose of the input gate is to control the Layer Input Ge and the previous layer output After passing through the input gate, it remains in the current Layer long-term status This information is mainly divided into two parts: one is the use of Function pair and The data is processed to determine the The data information that needs to be updated The other part is to process these data through the tanh function to obtain a long-term state to be updated. . and The expression is: (2) (3) in: and are weight vectors respectively; and are the input gate parameters respectively.
[0053] The purpose of state update is to update the long-term state of the previous layer Update to the long-term state of the current layer , The expression is: (4) Among them, the symbol Represents the vector cross product.
[0054] The purpose of the output gate is to control the Layer Input Previous layer output After passing through the output gate, the output remains in the current layer Information in.
[0055] Output value of the output gate It can be obtained by formula (5). The output of the layer , as shown in formula (6).
[0056] (5) (6) in: is the weight vector; are the output gate parameters.
[0057] The weight of each control gate can be obtained by training its corresponding input data. The output obtained by the layer The data information will be used as the input information of the next layer of the LSTM model. The implementation process of the layer can be recursively performed to obtain the LSTM prediction model.
[0058] 2. Regarding the attention mechanism (Attention): Attention is a data processing method that simulates human behavior and pays different attention to various information. When applied to neural networks, Attention redistributes the weight of each feature, increases the weight of important information, and reduces the weight of unimportant information, thereby increasing the neural network's attention to key information and reallocating resources. The attention mechanism is calculated according to the following formula: (7) (8) in Indicates the weight that needs to be set. Represents the weight at each moment, reflecting the attention of the neural network at different moments.
[0059] For example, see Figure 3 As shown, Figure 3 A flowchart of a method for training a device consumption prediction model provided in another embodiment of the present disclosure. The training process of the device consumption prediction model includes: Step a1. Obtain historical equipment consumption data.
[0060] Step a2. Clean the historical equipment consumption data. Remove duplicate data from the historical equipment consumption data, delete data with missing factors, repair variable types, and process abnormal values.
[0061] Step a3. Feature engineering: Extract features for numerical indicators and categorical indicators respectively.
[0062] Step a4. Data division: Divide the feature-engineered data into training set, validation set, and test set according to the ratio of 7:2:1.
[0063] Step a5: Modeling using the training set.
[0064] Step a6. Evaluate the model using the validation set.
[0065] Step a7. Use the test set to perform model prediction to test model performance.
[0066] For example, through training calculation, the optimal value of beach_size is 8, the optimal value of learning rate is 0.0007, the optimal value of regularization parameter is 0.146, and the optimal value of the number of LSTM hidden layer units is 137. Using the optimal parameter modeling, for comparison, the model evaluation results of LSTM-Attention and GBO-LSTM-Attention (i.e., the LSTM-Attention model using GBO to optimize LSTM-Attention parameters) are shown in Table 2.
[0067] Table 2 Model evaluation results
[0068] It can be seen that the various evaluation indicators of the GBO-LSTM-Attention model have been greatly improved, which is significantly better than the LSTM-Attention model, proving that the model has higher prediction accuracy.
[0069] It should be noted that the above data are merely exemplary and are not specifically limited here.
[0070] Optionally, extracting features from the historical equipment consumption data to obtain a sample set includes: For each task in the equipment consumption data, the following operations are performed to obtain a sample set: Normalizing the task duration, the task intensity, the number of personnel participating in the task, the equipment index participating in the task, and the wind force when the task is performed, respectively corresponding to the tasks, to obtain a plurality of first features; Obtaining a plurality of second features through one-hot encoding according to the task types, the climate when performing the tasks, the terrain when performing the tasks, and the visibility when performing the tasks respectively corresponding to the tasks; The actual equipment consumption corresponding to the task is used as a sample label; The plurality of first features, the plurality of second features and the sample labels respectively corresponding to the tasks are used as sample data corresponding to the tasks; The sample set includes sample data corresponding to each of the multiple tasks.
[0071] In the embodiment of the present disclosure, the feature extraction method can be implemented in at least two ways: Method 1: (1) For numerical indicators: mission duration, number of personnel involved in the mission, mission intensity, participating equipment index, on-site wind speed, and on-site visibility are numerical indicators. Since the dimensions and value ranges of each indicator vary greatly, in order to eliminate the impact of the different dimensions and value ranges of each indicator on the model, the numerical indicators are normalized and the minimum-maximum normalization method is used. The formula is: (9) in , are the maximum and minimum values of the numerical indicators respectively. Through normalization transformation, the data of the numerical indicator characteristics are mapped to the interval [0, 1].
[0072] (2) For classification indicators: task type, on-site climate, and on-site terrain, since each indicator does not have a sequential nature and cannot be compared in size, it cannot be replaced by a numerical value, because the numerical value may affect the calculation of the weight matrix. There is no attribute with a size relationship, and its weight should not change accordingly. Therefore, one-hot encoding is required. For each classification indicator, let the indicator have a total of different states, when the indicator of the sample is state, then The first position is 1, and the rest The positions are all 0, and the one-hot encoding of this sample (corresponding to this indicator) is expressed as .
[0073] Method 2: (1) For numerical indicators, the numerical value is directly used as the feature; (2) For categorical indicators, word vector processing is performed separately, such as the One-hot encoding in Method 1, which is not repeated here; in addition to One-hot encoding, other word vector processing methods can also be used, which are not specifically limited here.
[0074] Optionally, the LSTM-Attention parameters include at least a batch size beach_size, a learning rate, a regularization parameter, and the number of LSTM hidden layer units; the step of optimizing the LSTM-Attention parameters by using a gradient optimization algorithm GBO integrating a reverse learning strategy based on the training set includes: Initialize the LSTM-Attention parameters, and determine the upper limit and lower limit of each parameter in the LSTM-Attention parameters; According to the beach_size, each sample data in the training set is input into the LSTM-Attention, and the LSTM-Attention parameters are optimized by the GBO integrating the reverse learning strategy to determine the optimized LSTM-Attention parameters and the LSTM-Attention after the optimized parameters.
[0075] In the present disclosure, in combination Figure 3 As shown, modeling using the training set includes (for example, the specific implementation of step a5): Step b1: Set the parameters to be optimized of the LSTM-Attention model to beach_size, learning rate, regularization parameter, number of LSTM hidden layer units, etc. Here, it refers to LSTM-Attention parameters or LSTM-Attention model parameters, which will not be repeated below.
[0076] Step b2: Set the upper and lower limits of the parameters to be optimized. For example, the upper and lower limits of each parameter in the LSTM-Attention parameter.
[0077] Step b3: Use the GBO optimization algorithm integrated with the reverse learning strategy to optimize the LSTM-Attention model parameters. And import the optimized parameters into the LSTM-Attention model.
[0078] Among them, the gradient optimization algorithm GBO and the reverse learning strategy are explained in detail.
[0079] 1. Gradient optimization algorithm GBO is a meta-heuristic optimization algorithm based on the combination of gradient and population methods. The algorithm determines the search direction through Newton's method and explores the search domain using vector sets and two operators: gradient search rule (GSR) and local escape operator (LEO). The algorithm has the characteristics of strong optimization performance, simple structure and strong computing power. GBO uses two rules and operators to jointly use a set of vectors to explore the search space. At present, GBO has established an appropriate balance between the two stages.
[0080] The GBO algorithm mainly consists of the following steps: Step 1: Vector initialization process Using the formula: (10) in, ,and The decision variables are The upper and lower bounds of is a random number in [0,1].
[0081] Step 2: Gradient search rule calculation process Using the formula: (11) (12) in: is a random number; is a number in [0,0.1]; is the worst solution, is the best solution; is the position of the iteration vector; is a random parameter.
[0082]
[0083] in, , , is a random number, Represents the current iteration number, is the total number of iterations.
[0084] No. The formula for iterations is: (13) in: (14) (15) (16) Where: , , Indicates the current iteration vector position; , Represents 2 random numbers in the range [0,1]; , Indicates that from [1, ], where ; , Represents 2 random vectors.
[0085] Step 3: Local escape operator calculation process By introducing LEO, the solution efficiency is improved. This operator can significantly change the solution By analyzing the location , , , , , , generate a new solution , This makes the performance better, and the calculation is as follows: (17) (18) in: Represents a random number within [-1,1]; Indicates that it follows a normal distribution A random number; Represents the probability value (i.e., the LEO execution probability, which refers to the probability that LEO is selected for execution in each iteration of the GBO algorithm. This probability value is usually a real number between 0 and 1, indicating the possibility of LEO being activated in each iteration.); , , Are represented as random numbers.
[0086] 2. For reverse learning strategies (for example, dynamic lens imaging reverse learning strategy) The main idea of reverse learning is to generate a reverse position based on the current coordinates to expand the search range. This can not only jump out of the current position, but also expand the search range, improve the diversity of the population, and thus improve the accuracy of the training model and prediction accuracy.
[0087] Depend on Figure 4 It can be seen that in two-dimensional coordinates, the search range of the x-axis is , the y-axis represents a convex lens. Assume an object The projection on the x-axis is , the height is , through lens imaging, the image on the other side can be obtained as , The projection on the x-axis is , the height is According to the above principle, we can get Back projection of .
[0088] individual Take o as the base point to get its corresponding reverse point , according to the lens imaging principle:
[0089] remember It is called the scaling factor, and the reverse learning formula based on the lens imaging principle can be obtained:
[0090] in For individuals in The location of the dimension, for The reverse solution of . and They are the first The maximum and minimum boundaries of the dimension.
[0091] Due to the fixed scaling factor Unable to fully utilize the advantages of lens imaging learning strategy, a dynamic lens imaging learning strategy is proposed. ,in is a random number between [0,1].
[0092] Optionally, optimizing LSTM-Attention parameters by integrating the GBO with a reverse learning strategy, and determining optimized LSTM-Attention parameters and LSTM-Attention after optimizing the parameters include: Determine GBO algorithm parameters and construct the GBO; Initialize the population by using the GBO, and calculate the population at the opposite position corresponding to the initialized population by using a reverse learning strategy; According to the initialized population and the population at the opposite position corresponding to the initialized population, the population fitness value is calculated to find the current optimal vector and the current worst vector; By repeatedly performing the first operation, a target optimal vector is determined, and the optimized LSTM-Attention parameters are determined according to the target optimal vector, and the LSTM-Attention after the optimized parameters is constructed according to the optimized LSTM-Attention parameters.
[0093] In the embodiment of the present disclosure, the process of optimizing the LSTM-Attention parameters by the GBO integrating the reverse learning strategy (for example, the specific implementation process of step b3) includes: Step c1: Initialization.
[0094] Step c11: Set parameters , , and M; Step c12: Generate initial population ; Step c13: Calculate using the reverse learning formula ; Step c14: Evaluate the objective function value and ; Step c15: Calculate the optimal vector (e.g., the best solution or optimal solution) and the worst vector (i.e., the worst solution) .
[0095] Step c2: Main loop.
[0096] While (m <M) for n = 1 : N for i = 1 : D In [1, N ] randomly selected Calculate position
[0097] end for if rand < pr Calculate position
[0098]
[0099] end Update position and opposite position, select and
[0100] end for m=m+1 end Step c3: Get .
[0101] Among them, for the fitness function, the mean square error index (MSE) is selected as the fitness function, which is defined as follows:
[0102] in for The predicted value of .
[0103] Optionally, the first operation includes: Determine whether the current number of iterations is less than the total number of iterations; If the current number of iterations is greater than or equal to the total number of iterations, the process of performing the GBO optimization of LSTM-Attention parameters is stopped, and the current optimal vector is used as the target optimal vector; If the current number of iterations is less than the total number of iterations, the following second operation is performed: Calculate a first vector by using a gradient search rule GSR in the GBO; The first vector calculated according to the GSR, the position of the previous current vector, and the opposite position of the current vector; If the random number generated by the rand function is greater than or equal to the execution probability of the local escape operator LEO in the GBO, then according to the position of the current vector and the opposite position of the current vector, the population fitness value is calculated to find the current optimal vector and the current worst vector; If the random number generated by the rand function is less than the execution probability of the local escape operator LEO in the GBO, then the second vector is calculated through the LEO; the position of the current vector and the opposite position of the current vector are advanced according to the second vector calculated according to the LEO; and according to the position of the current vector and the opposite position of the current vector, the population fitness value is calculated to find the current optimal vector and the current worst vector.
[0104] Wherein, the current vector here can be the vector updated in the previous step or the currently found optimal vector, which needs to be determined based on the specific scenario.
[0105] Exemplarily, in combination with Figure 5 As shown, the process of optimizing the LSTM-Attention parameters by the GBO integrating the reverse learning strategy (for example, the specific implementation process of step b3) includes: 1) Set algorithm parameters; 2) Initialize the population and calculate the population at the opposite position; 3) Calculate the fitness values of the population and the population at the opposite position, and find the optimal vector and the worst vector; 4) Judge whether m < M. If so, execute 5); if not, end the optimization process; 5) Use GSR for vector calculation; 6) Update the position and the opposite position of the current vector according to the GSR calculation result; 7) Judge whether rand < pr. If so, execute 8); if not, execute 10); 8) Use LEO to calculate the vector; 9) Update the position and the opposite position of the current vector according to the LEO calculation result; 10) Calculate the fitness values of the population and the population at the opposite position, select the optimal vector and the worst vector, and continue to execute 4).
[0106] Among them, the implementation processes of 3) and 10) are the same or similar, and will not be elaborated here.
[0107] Optionally, the model evaluation of the optimized LSTM-Attention through the validation set includes: Input the validation set into the LSTM-Attention after optimizing the parameters, and obtain the prediction value corresponding to each task in the validation set; According to the predicted values and corresponding sample labels corresponding to each of the tasks in the validation set, at least one of the mean square error, the mean absolute error, the mean relative error, and the coefficient of determination is calculated to evaluate the LSTM-Attention after the optimized parameters; If the evaluation result does not meet the preset conditions, continue to optimize the LSTM-Attention parameters through the GBO that integrates the reverse learning strategy until the evaluation result meets the preset conditions.
[0108] In the present disclosure, Figure 3 As shown in Figure 1, the process of evaluating the model using the validation set (for example, the specific implementation process of step a6) includes: The evaluation indicators are mean square error (MSE), mean absolute error (MAE), mean relative error (MAPE), determination coefficient ( ),set up The predicted value is , the definitions of the evaluation indicators are: (19) (20) (twenty one) (twenty two) Optionally, the evaluated LSTM-Attention is tested by using the test set to determine the equipment consumption prediction model, including: Input the test set into the evaluated LSTM-Attention to obtain the prediction value corresponding to each task in the test set; According to the predicted values and corresponding sample labels of each task in the test set, by calculating At least one of precision, recall, F1 score, and AUC-ROC is used to calculate the performance of the model on the test set.
[0109] Among them, you can choose the most relevant evaluation indicators according to your business needs: accuracy, recall, F1 score, AUC-ROC, etc.
[0110] In the disclosed embodiment, during the test, if the test is successful, the LSTM-Attention parameters used in the test are the parameters of the equipment consumption prediction model; if the test fails, the LSTM-Attention parameters are optimized through GBO integrating the reverse learning strategy until the test passes.
[0111] Among them, the implementation process of GBO optimizing LSTM-Attention parameters through the fusion reverse learning strategy can be referred to the above embodiment, which will not be repeated here.
[0112] From the above description, it can be seen that the present disclosure achieves the following technical effects: by providing an equipment consumption prediction method combining LSTM and Attention, the advantages of LSTM and Attention in prediction are brought into play, and the parameters of LSTM-Attention (such as beach_size, learning rate, regularization parameter, number of LSTM hidden layer units, etc.) are optimized using a gradient optimization algorithm. The model is verified and / or tested, and evaluation indicators such as mean square error (MSE), mean absolute error (MAE), mean relative error (MAPE), and determination coefficient are greatly improved, proving that the model has higher prediction accuracy and is of great significance to equipment guarantee.
[0113] The present disclosure also provides a method for predicting equipment consumption, the method comprising: Acquire equipment consumption data of the target task to be predicted, wherein the equipment consumption data of the target task includes: duration of the target task, type of the target task, intensity of the target task, number of personnel participating in the target task, equipment index of participating in the target task, climate when performing the target task, terrain when performing the target task, wind speed when performing the target task, and visibility when performing the target task; Extracting features from the equipment consumption data of the target task to obtain feature data of the target task; Inputting the characteristic data of the target task into the equipment consumption prediction model to predict the equipment consumption of the target task; Among them, the equipment consumption prediction model is obtained by optimizing the LSTM-Attention parameters by integrating GBO with the reverse learning strategy, and performing model evaluation and model testing on the LSTM-Attention after optimizing the parameters. The LSTM-Attention is a deep learning model that integrates the LSTM network and the Attention mechanism.
[0114] In the disclosed embodiment, based on the acquired equipment consumption data of the target task to be predicted (target task duration, target task type, target task intensity, number of personnel participating in the target task, equipment index participating in the target task, climate when performing the target task, terrain when performing the target task, wind force when performing the target task, visibility when performing the target task, etc.), feature extraction is performed on the equipment consumption data of the target task to obtain feature data of the target task as input data of an equipment consumption prediction model (i.e., the equipment consumption prediction model, which is obtained based on the training method of the equipment consumption prediction model), and then the equipment consumption situation is predicted by the equipment consumption prediction model, for example, the expected number or amount of equipment to be consumed.
[0115] The equipment consumption prediction model obtained by the training method of the equipment consumption prediction model adopts a combination of LSTM and Attention. A sample set is constructed based on historical equipment consumption data to train the LSTM-Attention model. The advantages of LSTM and Attention in prediction are brought into play, and the LSTM-Attention parameters are optimized using the gradient optimization algorithm GBO, which can effectively ensure the accuracy of the prediction. At the same time, the reverse learning strategy is used to integrate GBO to optimize the LSTM-Attention parameters, and the search range is expanded through the reverse learning strategy, which improves the diversity of the population and further improves the prediction accuracy.
[0116] It should be noted that the steps shown in the flowcharts of the accompanying drawings can be executed in a computer system such as a set of computer executable instructions, and that, although a logical order is shown in the flowcharts, in some cases, the steps shown or described can be executed in an order different from that shown here.
[0117] The present disclosure also provides a training device for an equipment consumption prediction model for implementing the training method of the equipment consumption prediction model. Figure 6 As shown, the training device 60 of the equipment consumption prediction model includes: The acquisition unit 601 is used to acquire historical equipment consumption data, wherein the historical equipment consumption data includes: mission duration, mission type, mission intensity, number of personnel participating in the mission, equipment index participating in the mission, climate when performing the mission, terrain when performing the mission, wind speed when performing the mission, visibility when performing the mission, and equipment consumption corresponding to the mission, wherein there are multiple missions; The processing unit 602 is used to extract features from the historical equipment consumption data to obtain a sample set; The training unit 603 is used to divide the sample set into a training set, a validation set and a test set, and optimize the LSTM-Attention parameters according to the training set by using the gradient optimization algorithm GBO integrating the reverse learning strategy, and evaluate the LSTM-Attention model after the optimization parameters by using the validation set, and test the evaluated LSTM-Attention by using the test set to determine the equipment consumption prediction model; Among them, the LSTM-Attention is a deep learning model that integrates the long short-term memory LSTM network and the attention mechanism, and the equipment consumption prediction model is used to predict the equipment consumption corresponding to any task.
[0118] Optionally, the processing unit 602, when performing feature extraction on the historical equipment consumption data to obtain a sample set, specifically includes: For each task in the equipment consumption data, the following operations are performed to obtain a sample set: Normalizing the task duration, the task intensity, the number of personnel participating in the task, the equipment index participating in the task, and the wind force when the task is performed, respectively corresponding to the tasks, to obtain a plurality of first features; Obtaining a plurality of second features through one-hot encoding according to the task types, the climate when performing the tasks, the terrain when performing the tasks, and the visibility when performing the tasks respectively corresponding to the tasks; The actual equipment consumption corresponding to the task is used as a sample label; The plurality of first features, the plurality of second features and the sample labels respectively corresponding to the tasks are used as sample data corresponding to the tasks; The sample set includes sample data corresponding to each of the multiple tasks.
[0119] Optionally, the LSTM-Attention parameters include at least a batch size beach_size, a learning rate, a regularization parameter, and the number of LSTM hidden layer units; the training unit 603, when optimizing the LSTM-Attention parameters according to the training set by using a gradient optimization algorithm GBO that integrates a reverse learning strategy, specifically includes: Initialize the LSTM-Attention parameters, and determine the upper limit and lower limit of each parameter in the LSTM-Attention parameters; According to the beach_size, each sample data in the training set is input into the LSTM-Attention, and the LSTM-Attention parameters are optimized by the GBO integrating the reverse learning strategy to determine the optimized LSTM-Attention parameters and the LSTM-Attention after the optimized parameters.
[0120] Optionally, further, optimizing LSTM-Attention parameters by integrating the GBO with the reverse learning strategy, determining the optimized LSTM-Attention parameters and the LSTM-Attention after the optimized parameters, includes: Determine GBO algorithm parameters and construct the GBO; Initialize the population by using the GBO, and calculate the population at the opposite position corresponding to the initialized population by using a reverse learning strategy; According to the initialized population and the population at the opposite position corresponding to the initialized population, the population fitness value is calculated to find the current optimal vector and the current worst vector; By repeatedly performing the first operation, a target optimal vector is determined, and the optimized LSTM-Attention parameters are determined according to the target optimal vector, and the LSTM-Attention after the optimized parameters is constructed according to the optimized LSTM-Attention parameters.
[0121] Optionally, the first operation includes: Determine whether the current number of iterations is less than the total number of iterations; If the current number of iterations is greater than or equal to the total number of iterations, the process of performing the GBO optimization of LSTM-Attention parameters is stopped, and the current optimal vector is used as the target optimal vector; If the current number of iterations is less than the total number of iterations, the following second operation is performed: Calculate a first vector by using a gradient search rule GSR in the GBO; The first vector calculated according to the GSR is a position of a previous current vector and an opposite position of the current vector; If the random number generated by the rand function is greater than or equal to the execution probability of the local escape operator LEO in the GBO, then according to the position of the current vector and the opposite position of the current vector, the population fitness value is calculated to find the current optimal vector and the current worst vector; If the random number generated by the rand function is less than the execution probability of the local escape operator LEO in the GBO, the second vector is calculated through LEO; the position of the current vector and the opposite position of the current vector are calculated according to the second vector calculated by LEO; and the current optimal vector and the current worst vector are found by calculating the population fitness value according to the position of the current vector and the opposite position of the current vector.
[0122] Optionally, when the training unit 603 performs model evaluation on the LSTM-Attention after optimizing the parameters through the validation set, the training unit 603 specifically includes: Input the validation set into the LSTM-Attention after optimizing the parameters, and obtain the prediction value corresponding to each task in the validation set; According to the predicted values and corresponding sample labels corresponding to each of the tasks in the validation set, at least one of the mean square error, the mean absolute error, the mean relative error, and the coefficient of determination is calculated to evaluate the LSTM-Attention after the optimized parameters; If the evaluation result does not meet the preset conditions, continue to optimize the LSTM-Attention parameters through the GBO that integrates the reverse learning strategy until the evaluation result meets the preset conditions.
[0123] The present disclosure also provides an equipment consumption prediction device for implementing the above equipment consumption prediction method embodiment, including: an acquisition unit, used to acquire equipment consumption data of a target task to be predicted, wherein the equipment consumption data of the target task includes: duration of the target task, type of the target task, intensity of the target task, number of personnel participating in the target task, equipment index of the personnel participating in the target task, climate when performing the target task, terrain when performing the target task, wind speed when performing the target task, and visibility when performing the target task; A processing unit, used for extracting features from the equipment consumption data of the target task to obtain feature data of the target task; A prediction unit, used for inputting the characteristic data of the target task into the equipment consumption prediction model to predict the equipment consumption of the target task; Among them, the equipment consumption prediction model is obtained by optimizing the LSTM-Attention parameters through GBO integrating the reverse learning strategy, and performing model evaluation and model testing on the LSTM-Attention after optimizing the parameters. The LSTM-Attention is a deep learning model integrating the LSTM network and the Attention mechanism.
[0124] The specific manner in which each unit in the above device embodiment performs operations has been described in detail in the embodiment of the method, and will not be elaborated on here.
[0125] The present disclosure also provides an electronic device, such as Figure 7 As shown, the electronic device includes one or more processors 71 and a memory 72. Figure 7 A processor 71 is taken as an example.
[0126] The controller may further include: an input device 73 and an output device 74 .
[0127] The processor 71, the memory 72, the input device 73 and the output device 74 may be connected via a bus or other means. Figure 7 The example of connecting through bus is taken in the following.
[0128] The processor 71 may be a central processing unit (CPU), or other general-purpose processors, a digital signal processor (DSP), an application-specific integrated circuit (ASIC), a field-programmable gate array (FPGA), or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, or a combination of the above chips. The general-purpose processor may be a microprocessor or any conventional processor.
[0129] The memory 72 is a non-transient computer-readable storage medium that can be used to store non-transient software programs, non-transient computer executable programs and modules, such as program instructions / modules corresponding to the control method in the embodiment of the present disclosure. The processor 71 executes various functional applications and data processing of the server by running the non-transient software programs, instructions and modules stored in the memory 72, that is, the training method of the equipment consumption prediction model or the equipment consumption prediction method of the above method embodiment is implemented.
[0130] The memory 72 may include a program storage area and a data storage area, wherein the program storage area may store an operating system, an application required for at least one function; the data storage area may store data created according to the use of a processing device operated by the server, etc. In addition, the memory 72 may include a high-speed random access memory, and may also include a non-volatile memory, such as at least one disk storage device, a flash memory device, or other non-volatile solid-state storage device. In some embodiments, the memory 72 may optionally include a memory remotely arranged relative to the processor 71, and these remote memories may be connected to a network connection device via a network. Examples of the above-mentioned network include, but are not limited to, the Internet, an intranet, a local area network, a mobile communication network, and combinations thereof.
[0131] The input device 73 can receive input digital or character information, and generate key signal input related to user settings and function control of the processing device of the server. The output device 74 can include display devices such as a display screen.
[0132] One or more modules are stored in the memory 72, and when executed by one or more processors 71, the method shown above is performed.
[0133] The embodiment of the present disclosure also provides a computer-readable storage medium, which stores computer instructions, and the computer instructions are used to enable a computer to execute the training method or equipment consumption prediction method of the equipment consumption prediction model as described above.
[0134] The embodiments of the present disclosure also provide a computer program product, including a computer program, which, when executed by a processor, implements the training method of the equipment consumption prediction model or the equipment consumption prediction method as described above.
[0135] Those skilled in the art can understand that the implementation of all or part of the processes in the above method embodiments can be completed by instructing the relevant hardware through a computer program, and the program can be stored in a computer-readable storage medium, and when the program is executed, it can include the processes in the above method embodiments. Among them, the storage medium can be a disk, an optical disk, a read-only memory (ROM), a random access memory (RAM), a flash memory (FM), a hard disk (HDD), or a solid-state drive (SSD), etc.; the storage medium can also include a combination of the above types of memory.
[0136] Although the embodiments of the present disclosure have been described in conjunction with the accompanying drawings, those skilled in the art may make various modifications and variations without departing from the spirit and scope of the present disclosure, and such modifications and variations are all within the scope defined by the appended claims.
Claims
1. A training method for an equipment consumption prediction model, characterized in that: include: Acquire historical equipment consumption data, the historical equipment consumption data including: mission duration, mission type, mission intensity, number of personnel involved in the mission, equipment index involved in the mission, climate when performing the mission, terrain when performing the mission, wind speed when performing the mission, visibility when performing the mission, and equipment consumption corresponding to the mission, where there are multiple missions; Extracting features from the historical equipment consumption data to obtain a sample set; The sample set is divided into a training set, a validation set and a test set, and according to the training set, the LSTM-Attention parameters are optimized by using the gradient optimization algorithm GBO that integrates the reverse learning strategy, and the LSTM-Attention model after the optimized parameters is evaluated by using the validation set, and the evaluated LSTM-Attention is tested by using the test set to determine the equipment consumption prediction model; Among them, the LSTM-Attention is a deep learning model that integrates the long short-term memory LSTM network and the attention mechanism, and the equipment consumption prediction model is used to predict the equipment consumption corresponding to any task.
2. The method according to claim 1, characterized in that The feature extraction of the historical equipment consumption data to obtain a sample set includes: For each task in the equipment consumption data, the following operations are performed to obtain a sample set: Normalizing the task duration, the task intensity, the number of personnel participating in the task, the equipment index participating in the task, and the wind force when the task is performed, respectively corresponding to the tasks, to obtain a plurality of first features; Obtaining a plurality of second features through one-hot encoding according to the task types, the climate when performing the tasks, the terrain when performing the tasks, and the visibility when performing the tasks respectively corresponding to the tasks; The actual equipment consumption corresponding to the task is used as a sample label; The plurality of first features, the plurality of second features and the sample labels respectively corresponding to the tasks are used as sample data corresponding to the tasks; The sample set includes sample data corresponding to each of the multiple tasks.
3. The method according to claim 1 or 2, characterized in that: The LSTM-Attention parameters at least include a batch size beach_size, a learning rate, a regularization parameter, and the number of LSTM hidden layer units; the LSTM-Attention parameters are optimized according to the training set by using a gradient optimization algorithm GBO that integrates a reverse learning strategy, including: Initialize the LSTM-Attention parameters, and determine the upper limit and lower limit of each parameter in the LSTM-Attention parameters; According to the beach_size, each sample data in the training set is input into the LSTM-Attention, and the LSTM-Attention parameters are optimized by the GBO integrating the reverse learning strategy to determine the optimized LSTM-Attention parameters and the LSTM-Attention after the optimized parameters.
4. The method according to claim 3, characterized in that The step of optimizing LSTM-Attention parameters by integrating the GBO with the reverse learning strategy, and determining the optimized LSTM-Attention parameters and the LSTM-Attention after the optimized parameters, includes: Determine GBO algorithm parameters and construct the GBO; Initialize the population by using the GBO, and calculate the population at the opposite position corresponding to the initialized population by using a reverse learning strategy; According to the initialized population and the population at the opposite position corresponding to the initialized population, the population fitness value is calculated to find the current optimal vector and the current worst vector; By repeatedly performing the first operation, a target optimal vector is determined, and the optimized LSTM-Attention parameters are determined according to the target optimal vector, and the LSTM-Attention after the optimized parameters is constructed according to the optimized LSTM-Attention parameters.
5. The method according to claim 4, characterized in that The first operation includes: Determine whether the current number of iterations is less than the total number of iterations; If the current number of iterations is greater than or equal to the total number of iterations, the process of performing the GBO optimization of LSTM-Attention parameters is stopped, and the current optimal vector is used as the target optimal vector; If the current number of iterations is less than the total number of iterations, the following second operation is performed: Calculate a first vector by using a gradient search rule GSR in the GBO; The first vector calculated according to the GSR is a position of a previous current vector and an opposite position of the current vector; If the random number generated by the rand function is greater than or equal to the execution probability of the local escape operator LEO in the GBO, then according to the position of the current vector and the opposite position of the current vector, the population fitness value is calculated to find the current optimal vector and the current worst vector; If the random number generated by the rand function is less than the execution probability of the local escape operator LEO in the GBO, the second vector is calculated through LEO; the position of the current vector and the opposite position of the current vector are calculated according to the second vector calculated by LEO; and the current optimal vector and the current worst vector are found by calculating the population fitness value according to the position of the current vector and the opposite position of the current vector.
6. The method according to claim 2, characterized in that The validation set is used to evaluate the LSTM-Attention model after optimizing the parameters, including: Input the validation set into the LSTM-Attention after optimizing the parameters, and obtain the prediction value corresponding to each task in the validation set; According to the predicted values and corresponding sample labels corresponding to each of the tasks in the validation set, at least one of the mean square error, the mean absolute error, the mean relative error, and the coefficient of determination is calculated to evaluate the LSTM-Attention after the optimized parameters; If the evaluation result does not meet the preset conditions, continue to optimize the LSTM-Attention parameters through the GBO that integrates the reverse learning strategy until the evaluation result meets the preset conditions.
7. A method for predicting equipment consumption, characterized in that: The method further comprises: Acquire equipment consumption data of the target task to be predicted, wherein the equipment consumption data of the target task includes: duration of the target task, type of the target task, intensity of the target task, number of personnel participating in the target task, equipment index of participating in the target task, climate when performing the target task, terrain when performing the target task, wind speed when performing the target task, and visibility when performing the target task; Extracting features from the equipment consumption data of the target task to obtain feature data of the target task; Inputting the characteristic data of the target task into the equipment consumption prediction model to predict the equipment consumption of the target task; Among them, the equipment consumption prediction model is obtained by optimizing the LSTM-Attention parameters by integrating GBO with the reverse learning strategy, and performing model evaluation and model testing on the LSTM-Attention after optimizing the parameters. The LSTM-Attention is a deep learning model that integrates the LSTM network and the Attention mechanism.
8. A training device for an equipment consumption prediction model, characterized in that: include: an acquisition unit, used to acquire historical equipment consumption data, the historical equipment consumption data including: mission duration, mission type, mission intensity, number of personnel participating in the mission, equipment index participating in the mission, climate when performing the mission, terrain when performing the mission, wind speed when performing the mission, visibility when performing the mission, and equipment consumption corresponding to the mission, wherein there are multiple missions; A processing unit, used for extracting features from the historical equipment consumption data to obtain a sample set; A training unit, used for dividing the sample set into a training set, a validation set and a test set, and optimizing the LSTM-Attention parameters by using the gradient optimization algorithm GBO integrating the reverse learning strategy according to the training set, and performing a model evaluation on the LSTM-Attention after the optimization parameters by using the validation set, and testing the evaluated LSTM-Attention by using the test set to determine the equipment consumption prediction model; Among them, the LSTM-Attention is a deep learning model that integrates the long short-term memory LSTM network and the attention mechanism, and the equipment consumption prediction model is used to predict the equipment consumption corresponding to any task.
9. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores computer instructions, and the computer instructions are used to enable a computer to execute the equipment consumption prediction model training method described in any one of claims 1 to 6 or the equipment consumption prediction method described in claim 7.
10. An electronic device, characterized in that: The electronic device includes: at least one processor; and a memory communicatively connected to the at least one processor; wherein the memory stores a computer program executable by the at least one processor, and the computer program is executed by the at least one processor so that the at least one processor executes the training method of the equipment consumption prediction model described in any one of claims 1 to 6 or the equipment consumption prediction method described in claim 7.
Citation Information
Patent Citations
Elevator energy consumption prediction method and device based on EEFG-LSTM-Attention
CN115935818A
Cited By
Data processing method and device for equipment consumption prediction
CN122287993A