Mineral resource price prediction method and device, equipment and storage medium
By smoothing the sliding window of the time series of mineral resource prices and building a multi-layer neural network model, the problem of low accuracy of time series prediction for nonlinear data is solved, and a higher prediction accuracy and understanding of market trends are achieved.
Patent Information
- Application Number
- CN202510037219.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-01-09
- Publication Date
- 2025-05-02
AI Technical Summary
In the prior art, time series predictions have low accuracy in predicting nonlinear mineral resource price data.
By obtaining the time series of mineral resources prices and smoothing based on the sliding window, an initial price prediction model including a convolutional neural network layer, a bidirectional gating cycle unit and an attention mechanism layer is constructed, and the data set is divided based on the delay step length for training to obtain the target price prediction model.
It improves the prediction accuracy of nonlinear mineral resource price data, reduces the impact of short-term fluctuations, and enhances the model's understanding of market trends and information processing capabilities.
Smart Images

Figure CN119919202A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of mineral resource price prediction, and in particular to a mineral resource price prediction method, device, equipment and storage medium. Background Art
[0002] Ensuring resource supply is an important part of the national security strategy, among which mineral resources are regarded as the foundation of national resource security. Rational use of resource price adjustment mechanism is one of the main means to ensure national resource security. Correctly carrying out quantitative forecasting of mineral resource prices is of great significance to achieving national macro-control and effectively ensuring the security of land and resources.
[0003] In recent years, research on mineral resource price prediction has made great progress, and with the rise of artificial intelligence, various prediction methods have emerged. The existing technology proposes price regression prediction based on influencing factors. The regression analysis model selects influencing factors with high correlation with the prediction object to establish a prediction model, but the prediction accuracy is greatly affected by the selected factors, and incomplete collection of influencing factors will also lead to a decrease in accuracy. In order to improve the accuracy of price prediction, the existing technology proposes time series prediction based on historical price data. Time series prediction mainly analyzes the relationship between price series and time. This type of model has a good effect on linear prediction, but it often has a large deviation for nonlinear processing.
[0004] Therefore, there is an urgent need to provide a mineral resource price prediction method, device, equipment and storage medium to improve the prediction accuracy of time series prediction methods for nonlinear mineral resource price data. Summary of the invention
[0005] In view of this, it is necessary to provide a mineral resource price prediction method, device, equipment and storage medium to solve the technical problem of low accuracy of time series prediction for nonlinear mineral resource price data in the prior art.
[0006] On the one hand, in order to solve the above technical problems, the present invention provides a method for predicting mineral resource prices, comprising: Obtaining a mineral resource price time series, and smoothing the mineral resource price time series based on a sliding window to obtain a target mineral resource price time series; Constructing an initial price prediction model, wherein the initial price prediction model includes a convolutional neural network layer, a bidirectional gated recurrent unit, and an attention mechanism layer; Dividing the target mineral resource price time series into a plurality of data groups based on a delay step; The initial price prediction model is trained based on the multiple data groups to obtain a target price prediction model, and the price of mineral resources is predicted based on the target price prediction model.
[0007] In a possible implementation, the target mineral resource price time series includes a plurality of target mineral resource price data, and the target mineral resource price data is:
[0008] In the formula, is the price data of the i-th target mineral resource; is the window radius of the sliding window; is the jth mineral resource price data in the mineral resource price time series.
[0009] In a possible implementation, before dividing the target mineral resource price time series into a plurality of data groups based on the delay step, the method further includes: Acquire multiple initial delay step lengths, and determine multiple initial data groups corresponding one-to-one to the multiple initial delay step lengths; Training the initial price prediction model based on the multiple initial data groups to obtain multiple price prediction models to be evaluated; The multiple price prediction models to be evaluated are evaluated based on preset evaluation indicators to obtain multiple evaluation values, and the initial delay step corresponding to the price prediction model to be evaluated with the highest evaluation value is used as the delay step.
[0010] In a possible implementation, the training of the initial price prediction model based on the multiple data groups to obtain a target price prediction model includes: Initialize algorithm parameters in the whale optimization algorithm, wherein the algorithm parameters include the population size and the maximum number of iterations; constructing a fitness function based on the data set; Determine a parameter to be optimized of the initial price prediction model, set the parameter to be optimized as an initial position vector of the whale optimization algorithm, and determine an initial fitness value based on the initial position vector and the fitness function; Performing an optimal neighborhood perturbation update on the initial position vector using an optimal neighborhood perturbation formula to obtain an initial updated position vector; Obtain a random number, and determine whether the random number is less than a random number threshold; When the random number is less than the random number threshold, updating the initial update position vector based on an adaptive weight position update formula to obtain a first update position vector, and determining a first fitness value based on the first update position vector and the fitness function; When the random number is greater than or equal to the random number threshold, the initial update position vector is updated based on the variable spiral position update formula to obtain a second update position vector, and a second fitness value is determined based on the first update position vector and the fitness function; Determine whether the first fitness value is greater than the initial fitness value, and whether the second fitness value is greater than the initial fitness value; When the first fitness value is greater than the initial fitness value, the initial position vector is replaced by the first updated position vector, and it is determined whether an iteration termination condition is satisfied. When the iteration termination condition is satisfied, a target parameter is obtained based on the first updated position vector, and the target parameter is assigned to the initial price prediction model to obtain the target price prediction model. When the second fitness value is greater than the initial fitness value, the second updated position vector replaces the initial position vector, and it is determined whether the iteration termination condition is met. When the iteration termination condition is met, the target parameters are obtained based on the second updated position vector, and the target parameters are assigned to the initial price prediction model to obtain the target price prediction model.
[0011] In a possible implementation, the optimal neighborhood perturbation formula is:
[0012] In the formula, is the global optimal position vector of the tth iteration; is the new position randomly searched after the tth iteration; , is a random number between [0, 1].
[0013] In a possible implementation, the adaptive weight position update formula is:
[0014]
[0015]
[0016]
[0017]
[0018] In the formula, is the updated position vector of the t+1th iteration; is the adaptive weight; is the first coefficient matrix; is the second coefficient matrix; is the updated position vector of the tth iteration; is the maximum number of iterations.
[0019] In a possible implementation, the variable spiral position update formula is:
[0020] In the formula, Parameters to control the shape of the spiral; is the distance between the current whale position and the target prey position; is a random number between [-1, 1].
[0021] On the other hand, the present invention also provides a mineral resource price prediction device, comprising: A price time series smoothing processing unit is used to obtain a mineral resource price time series, and smooth the mineral resource price time series based on a sliding window to obtain a target mineral resource price time series; An initial price prediction model construction unit, used to construct an initial price prediction model, wherein the initial price prediction model includes a convolutional neural network layer, a bidirectional gated recurrent unit, and an attention mechanism layer; A price time series division unit, used for dividing the target mineral resource price time series into a plurality of data groups based on a delay step; The mineral resource price prediction unit is used to train the initial price prediction model based on the multiple data groups to obtain a target price prediction model, and predict the mineral resource price based on the target price prediction model.
[0022] On the other hand, the present invention also provides a mineral resource price prediction device, including a memory and a processor, wherein: The memory is used to store programs; The processor is coupled to the memory and is used to execute the program stored in the memory to implement the steps in the mineral resource price prediction method described in any one of the possible implementation methods mentioned above.
[0023] On the other hand, the present invention also provides a computer-readable storage medium for storing computer-readable programs or instructions, which, when executed by a processor, can implement the steps in the mineral resource price prediction method described in any of the above possible implementation methods.
[0024] The beneficial effects of the present invention are as follows: the mineral resource price prediction method provided by the present invention removes high-frequency noise in the time series to a certain extent by smoothing the mineral resource price time series based on a sliding window, retains the trend and periodicity, and the processed target mineral resource price time series is more continuous and stable, emphasizing the long-term trend. It helps to make the target price prediction model more focused on the overall market trend, reduce the excessive impact of short-term fluctuations, improve the prediction accuracy of nonlinear data, and thus improve the prediction accuracy of the target price prediction model for mineral resource prices.
[0025] Furthermore, the present invention divides the target mineral resource price time series based on the delay step, that is, reconstructs the target mineral resource price time series, selects a suitable time step to predict the price at the current moment based on multiple moments in the past, and further improves the prediction accuracy of the mineral resource price.
[0026] Furthermore, the target price prediction model of the present invention introduces a bidirectional gated recurrent unit and integrates past and future information at the same time, so that the target price prediction model has a more comprehensive understanding of the mineral resource price time series, enhances the model's ability to process information, and further improves the prediction accuracy of mineral resource prices. At the same time, the target price prediction model optimizes the weight distribution in the network by introducing an attention mechanism, can identify more important data features in the prediction of mineral resource prices, dynamically adjust weights and biases during the training process, and build a suitable and stable model. BRIEF DESCRIPTION OF THE DRAWINGS
[0027] In order to more clearly illustrate the technical solutions in the embodiments of the present invention, the following briefly introduces the drawings required for use in the description of the embodiments. Obviously, the drawings described below are only some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative work.
[0028] Figure 1 A schematic diagram of a flow chart of an embodiment of a method for predicting mineral resource prices provided by the present invention; Figure 2 A schematic diagram of a flow chart of an embodiment of determining a delay step length provided by the present invention; Figure 3 For the present invention Figure 1 A schematic diagram of an embodiment of training the initial price prediction model in step S104; Figure 4 A schematic diagram of the structure of an embodiment of a mineral resource price prediction device provided by the present invention; Figure 5 A schematic structural diagram of an embodiment of the mineral resource price prediction device provided by the present invention. DETAILED DESCRIPTION
[0029] The following will be combined with the drawings in the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative work are within the scope of protection of the present invention.
[0030] It should be understood that the schematic drawings are not drawn to scale. The flowchart used in the present invention shows the operations implemented according to some embodiments of the present invention. It should be understood that the operations of the flowchart can be implemented out of order, and the steps without logical context can be reversed in order or implemented simultaneously. In addition, those skilled in the art, under the guidance of the content of the present invention, can add one or more other operations to the flowchart, and can also remove one or more operations from the flowchart. Some of the block diagrams shown in the accompanying drawings are functional entities, which do not necessarily correspond to physically or logically independent entities. These functional entities can be implemented in software form, or in one or more hardware modules or integrated circuits, or in different networks and / or processor systems and / or microcontroller systems.
[0031] Reference to an "embodiment" herein means that a particular feature, structure, or characteristic described in conjunction with the embodiment may be included in at least one embodiment of the present invention. The appearance of the phrase in various places in the specification does not necessarily refer to the same embodiment, nor is it an independent or alternative embodiment that is mutually exclusive with other embodiments. It is explicitly and implicitly understood by those skilled in the art that the embodiments described herein may be combined with other embodiments.
[0032] The present invention provides a method, device, equipment and storage medium for predicting mineral resource prices, which are described below respectively.
[0033] Figure 1 A schematic diagram of an embodiment of the method for predicting mineral resource prices provided by the present invention is shown in FIG. Figure 1 As shown, the mineral resource price prediction methods include: S101, obtaining a mineral resource price time series, and smoothing the mineral resource price time series based on a sliding window to obtain a target mineral resource price time series; S102, constructing an initial price prediction model, the initial price prediction model comprising a convolutional neural network layer, a bidirectional gated recurrent unit, and an attention mechanism layer; S103, dividing the target mineral resource price time series into multiple data groups based on the delay step length; S104: training an initial price prediction model based on multiple data sets to obtain a target price prediction model, and predicting the price of mineral resources based on the target price prediction model.
[0034] Among them, the mineral resource price time series includes multiple mineral resource price data. Since the futures settlement price at a certain moment is a weighted average of the prices based on all the trading volumes of a trading day, reflecting the average market price at that moment, the futures settlement price not only represents the reference standard for current market transactions, but also the settlement starting point for the next round of transactions. Therefore, the mineral resource price data uses the settlement price of mineral resource futures in the futures exchange.
[0035] Among them, the mineral resource price time series obtained in step S101 is specifically: 400 copper price settlement price data from the New York Mercantile Exchange from January 1, 1990 to April 1, 2023.
[0036] The convolutional neural network layer in step S102 includes a first convolutional layer, a first maximum pooling layer, a second convolutional layer, a second maximum pooling layer and an activation function layer, wherein the activation function of the activation function layer is a Sigmoid activation function. The bidirectional gated recurrent unit is composed of two GRU models, which are in opposite directions, one for processing the forward time series and the other for processing the reverse time series. The attention mechanism layer assigns different weights to the feature data processed by the bidirectional gated recurrent unit, highlighting the expression of key information and avoiding the problem of information loss caused by long sequences.
[0037] It should be noted that the delay step length in step S103 refers to: using k historical price data as independent variables to predict the k+1th data. In other words, the delay step length refers to the number of independent variables (historical price data) in each data group.
[0038] It should be understood that after obtaining the target price prediction model, it is necessary to test the target price prediction model based on the data set. When the test passes, the mineral resource price is predicted based on the target price prediction model to ensure the generalization ability and prediction accuracy of the target price prediction model. Specifically, the ratio of the training set to the test set is 7:3.
[0039] It should also be noted that: in order to avoid the impact of different orders of magnitude of input data on the prediction results, the prediction of mineral resource prices based on the target price prediction model in step S104 is specifically as follows: normalizing the input data, inputting the normalized data into the target price prediction model to obtain prediction result data, and denormalizing the prediction result data to obtain the predicted mineral resource price.
[0040] Among them, the order of step S101, step S102 and step S103 can be adaptively adjusted, and does not need to be strictly executed according to the step process specified in the embodiment of the present invention. It is only necessary to build the initial price prediction model and obtain multiple data groups before training the initial price prediction model.
[0041] Compared with the prior art, the mineral resource price prediction method provided by the embodiment of the present invention removes high-frequency noise in the time series to a certain extent by smoothing the mineral resource price time series based on a sliding window, retains the trend and periodicity, and the processed target mineral resource price time series is more continuous and stable, emphasizing the long-term trend. It helps to make the target price prediction model more focused on the overall market trend, reduce the excessive impact of short-term fluctuations, improve the prediction accuracy of nonlinear data, and thus improve the prediction accuracy of the target price prediction model for mineral resource prices.
[0042] Furthermore, the embodiment of the present invention divides the target mineral resource price time series based on the delay step, that is, reconstructs the target mineral resource price time series, selects a suitable time step to predict the price at the current moment based on multiple moments in the past, thereby further improving the prediction accuracy of the mineral resource price.
[0043] Furthermore, the target price prediction model of the embodiment of the present invention introduces a bidirectional gated recurrent unit and integrates past and future information at the same time, so that the target price prediction model has a more comprehensive understanding of the mineral resource price time series, enhances the model's ability to process information, and further improves the prediction accuracy of mineral resource prices. At the same time, the target price prediction model optimizes the weight distribution in the network by introducing an attention mechanism, can identify more important data features in the prediction of mineral resource prices, dynamically adjust weights and biases during the training process, and build a suitable and stable model.
[0044] In some embodiments of the present invention, the target mineral resource price data is:
[0045] In the formula, is the price data of the i-th target mineral resource; is the window radius of the sliding window; is the jth mineral resource price data in the mineral resource price time series.
[0046] Since the delay step determines the "memory" length of the target price prediction model when observing historical data, it affects the focus of the target price prediction model when processing sequence information. If the step size is set too large, the target price prediction model may pay too much attention to older data and ignore recent changes, which may lead to a decrease in prediction ability in a market where mineral resource prices fluctuate rapidly. On the contrary, if the step size is set too small, the target price prediction model may ignore early data that has a potential impact on predicting future trends. Therefore, in order to establish a target price prediction model that can accurately predict mineral resource prices, it is necessary to determine an accurate and appropriate delay step size to ensure the prediction accuracy of the target price prediction model.
[0047] Therefore, in some embodiments of the present invention, Figure 2 As shown, before step S103, it also includes: S201, obtaining a plurality of initial delay step lengths, and determining a plurality of initial data groups corresponding one-to-one to the plurality of initial delay step lengths; S202, training an initial price prediction model based on multiple initial data groups, and correspondingly obtaining multiple price prediction models to be evaluated; S203. Evaluate multiple price prediction models to be evaluated based on preset evaluation indicators to obtain multiple evaluation values, and use the initial delay step length corresponding to the price prediction model to be evaluated with the highest evaluation value as the delay step length.
[0048] The embodiment of the present invention determines the appropriate delay step length through an experimental method, which can improve the accuracy and rationality of the delay step length, thereby improving the price prediction accuracy of the determined target price prediction model.
[0049] In a specific embodiment of the present invention, as shown in Table 1, the delay step is set to 5, 6, 7, 8, and 9, respectively, and the mean absolute error MAE, root mean square error RMSE, mean absolute percentage error MAPE, and determination coefficient R are set. 2 These four evaluation indicators.
[0050] Table 1 Different delay step lengths and evaluation index values
[0051] It can be seen from Table 1 that when the delay step is 7, the prediction error evaluation index is the smallest, the prediction effect is better, the MAE of the price prediction model is reduced by an average of 4.86%, the RMSE is reduced by an average of 7.88%, the MAPE is reduced by an average of 6.94, and the R2 is increased by an average of 0.38%. Therefore, in a preferred embodiment of the present invention, a delay step of 7 is selected, that is, the mineral resource prices for 7 consecutive days are selected as independent variables to predict the settlement price on the 8th day, and the step size is continuously moved (one day at a time) until all the data are captured to ensure the continuity and integrity of the time series in the data set.
[0052] Since there are many model parameters in the initial price prediction model, in order to improve the training speed of the initial price prediction model, in some embodiments of the present invention, Figure 3 As shown, the initial price prediction model is trained based on the multiple data groups in step S104 to obtain a target price prediction model, including: S301, initializing algorithm parameters in the whale optimization algorithm, the algorithm parameters including population size and maximum number of iterations; S302, constructing a fitness function based on the data set; S303, determining the parameters to be optimized of the initial price prediction model, setting the parameters to be optimized as the initial position vector of the whale optimization algorithm, and determining the initial fitness value based on the initial position vector and the fitness function; S304, performing optimal neighborhood perturbation update on the initial position vector using the optimal neighborhood perturbation formula to obtain an initial updated position vector; S305, obtaining a random number, and determining whether the random number is less than a random number threshold; S306: when the random number is less than the random number threshold, updating the initial update position vector based on the adaptive weight position update formula to obtain a first update position vector, and determining a first fitness value based on the first update position vector and the fitness function; S307, when the random number is greater than or equal to the random number threshold, updating the initial update position vector based on the variable spiral position update formula to obtain a second update position vector, and determining a second fitness value based on the first update position vector and the fitness function; S308, determining whether the first fitness value is greater than the initial fitness value, and whether the second fitness value is greater than the initial fitness value; S309, when the first fitness value is greater than the initial fitness value, the initial position vector is replaced by the first updated position vector, and it is determined whether the iteration termination condition is met. When the iteration termination condition is met, the target parameter is obtained based on the first updated position vector, and the target parameter is assigned to the initial price prediction model to obtain the target price prediction model; S3010. When the second fitness value is greater than the initial fitness value, the second updated position vector replaces the initial position vector, and determines whether the iteration termination condition is met. When the iteration termination condition is met, the target parameters are obtained based on the second updated position vector, and the target parameters are assigned to the initial price prediction model to obtain the target price prediction model.
[0053] It should be noted that, when the iteration termination condition is not met, the first updated position vector or the second updated position vector is used as the initial position vector, and the process returns to step S304.
[0054] The embodiment of the present invention introduces the optimal neighborhood perturbation formula, the adaptive weight position update formula and the variable spiral position update formula to adjust the update method of the whale's position, dynamically adjusts the speed at which the whale approaches the target object, and optimizes the problem that the traditional whale optimization algorithm is prone to fall into the local optimal solution, thereby improving the global search capability of the entire algorithm, thereby improving the training speed of the initial price prediction model.
[0055] The fitness function in the embodiment of the present invention is the mean square error MSE.
[0056] In a specific embodiment of the present invention, the optimal neighborhood perturbation formula is:
[0057] In the formula, is the global optimal position vector of the tth iteration; is the new position randomly searched after the tth iteration; , is a random number between [0, 1].
[0058] Specifically, the adaptive weight position update formula is:
[0059]
[0060]
[0061]
[0062]
[0063] In the formula, is the updated position vector of the t+1th iteration; is the adaptive weight; is the first coefficient matrix; is the second coefficient matrix; is the updated position vector of the tth iteration; is the maximum number of iterations.
[0064] Specifically, the variable spiral position update formula is:
[0065] In the formula, Parameters to control the shape of the spiral; is the distance between the current whale position and the target prey position; is a random number between [-1, 1].
[0066] In summary, the embodiments of the present invention introduce adaptive weights to adjust the influence of the optimal position and optimize the convergence speed; use variable spiral position updates to adjust the spiral shape and improve the global optimal search capability; use optimal field perturbations to avoid falling into local optimality and solve the problem of premature algorithm maturation.
[0067] In order to verify the superiority of the target price prediction model obtained by training based on the optimized whale algorithm proposed in the embodiment of the present invention, the target price prediction model of the embodiment of the present invention is compared with the commonly used ARIMA, LSTM, GRU, BiGRU, CNN-BiGRU, and CNN-BiGRU-Attention. The evaluation indicators used for the comparison include MAE, RMSE, MAPE, and R 2 , the comparison results are shown in Table 2: Table 2 Comparison of results between different commonly used models and the model in this application Prediction Model MAE RMSE MAPE <![CDATA[R 2 ]]> ARIMA 351.864 493.533 3.456 0.746 LSTM 221.963 251.3335 2.765 0.964 GRU 184.641 222.664 2.721 0.977 BiGRU 135.516 159.413 2.066 0.988 CNN-BiGRU 131.651 155.349 2.023 0.988 CNN-BiGRU-Attention 115.349 135.159 1.864 0.990 This application 103.398 123.078 1.599 0.993 As shown in Table 2, compared with the other six commonly used models, the target price prediction model proposed in the embodiment of the present invention has the smallest error indexes of MAE, RMSE and MAPE, which are 103.398, 123.078 and 1.599% respectively, indicating that the target price prediction model proposed in the embodiment of the present invention has the smallest prediction error for the mineral resource price and the predicted value is closest to the truth; R 2 The value is the largest, which is 0.933, indicating that the fitting effect of the target price prediction model is good.
[0068] In summary, the method for predicting mineral resource prices proposed in the embodiment of the present invention has strong practicability and can meet the requirements for predicting mineral resource prices within the allowable error range.
[0069] In order to better implement the mineral resource price prediction method in the embodiment of the present invention, based on the mineral resource price prediction method, the embodiment of the present invention also provides a mineral resource price prediction device, such as Figure 4 As shown, the mineral resource price prediction device 400 includes: The price time series smoothing processing unit 401 is used to obtain the mineral resource price time series, and smooth the mineral resource price time series based on the sliding window to obtain the target mineral resource price time series; An initial price prediction model construction unit 402 is used to construct an initial price prediction model, the initial price prediction model includes a convolutional neural network layer, a bidirectional gated recurrent unit and an attention mechanism layer; The price time series division unit 403 is used to divide the target mineral resource price time series into multiple data groups based on the delay step length; The mineral resource price prediction unit 404 is used to train the initial price prediction model based on multiple data groups, obtain a target price prediction model, and predict the mineral resource price based on the target price prediction model.
[0070] The mineral resource price prediction device 400 provided in the above embodiment can implement the technical solution described in the above mineral resource price prediction method embodiment. The specific implementation principles of the above modules or units can refer to the corresponding contents in the above mineral resource price prediction method embodiment, which will not be repeated here.
[0071] like Figure 5 As shown, the present invention also provides a mineral resource price prediction device 500. The mineral resource price prediction device 500 includes a processor 501, a memory 502 and a display 503. Figure 5 Only some components of the mineral resource price prediction device 500 are shown, but it should be understood that it is not required to implement all of the shown components, and more or fewer components may be implemented instead.
[0072] In some embodiments, the processor 501 may be a central processing unit (CPU), a microprocessor or other data processing chip, used to run program codes or process data stored in the memory 502, such as the mineral resource price prediction method of the present invention.
[0073] In some embodiments of the present invention, processor 501 may be a single server or a server group. The server group may be centralized or distributed. In some embodiments, processor 501 may be local or remote. In some embodiments, processor 501 may be implemented in a cloud platform. In one embodiment, the cloud platform may include a private cloud, a public cloud, a hybrid cloud, a community cloud, a distributed cloud, an internal cloud, a multi-cloud, etc., or any combination thereof.
[0074] In some embodiments, the memory 502 may be an internal storage unit of the mineral resource price prediction device 500, such as a hard disk or memory of the mineral resource price prediction device 500. In other embodiments, the memory 502 may also be an external storage device of the mineral resource price prediction device 500, such as a plug-in hard disk, a smart media card (SMC), a secure digital (SD) card, a flash card, etc., equipped on the mineral resource price prediction device 500.
[0075] Furthermore, the memory 502 may include both an internal storage unit and an external storage device of the mineral resource price prediction device 500. The memory 502 is used to store application software for installing the mineral resource price prediction device 500 and various data.
[0076] In some embodiments, the display 503 may be an LED display, a liquid crystal display, a touch-sensitive liquid crystal display, an OLED (Organic Light-Emitting Diode) touch device, etc. The display 503 is used to display information of the mineral resource price prediction device 500 and to display a visual user interface. The components 501-503 of the mineral resource price prediction device 500 communicate with each other via a system bus.
[0077] In some embodiments of the present invention, when the processor 501 executes the mineral resource price prediction program in the memory 502, the following steps may be implemented: Obtain the mineral resource price time series, and smooth the mineral resource price time series based on the sliding window to obtain the target mineral resource price time series; Construct an initial price prediction model, which includes a convolutional neural network layer, a bidirectional gated recurrent unit, and an attention mechanism layer; Divide the target mineral resource price time series into multiple data groups based on the delay step; An initial price prediction model is trained based on multiple data sets to obtain a target price prediction model, and mineral resource prices are predicted based on the target price prediction model.
[0078] It should be understood that: when the processor 501 executes the mineral resource price prediction program in the memory 502, in addition to the above functions, other functions can also be implemented. For details, please refer to the description of the corresponding method embodiment above.
[0079] Furthermore, the embodiment of the present invention does not specifically limit the type of the mineral resource price prediction device 500 mentioned. The mineral resource price prediction device 500 may be a portable mineral resource price prediction device such as a mobile phone, a tablet computer, a personal digital assistant (PDA), a wearable device, a laptop computer, etc. Exemplary embodiments of portable mineral resource price prediction devices include but are not limited to portable mineral resource price prediction devices equipped with IOS, Android, Microsoft or other operating systems. The above-mentioned portable mineral resource price prediction device may also be other portable mineral resource price prediction devices. It should also be understood that in some other embodiments of the present invention, the mineral resource price prediction device 500 may not be a portable mineral resource price prediction device, but a desktop computer with a touch-sensitive surface (such as a touch panel).
[0080] Correspondingly, an embodiment of the present invention also provides a computer-readable storage medium, which is used to store computer-readable programs or instructions. When the program or instructions are executed by a processor, it can implement the steps or functions of the mineral resource price prediction method provided by the above-mentioned method embodiments.
[0081] Those skilled in the art will appreciate that all or part of the processes of the above-mentioned embodiments can be implemented by instructing related hardware (such as a processor, a controller, etc.) through a computer program, and the computer program can be stored in a computer-readable storage medium, wherein the computer-readable storage medium is a disk, an optical disk, a read-only storage memory, or a random access memory, etc.
[0082] The above is a detailed introduction to a mineral resource price prediction method, device, equipment and storage medium provided by the present invention. Specific examples are used in this article to illustrate the principles and implementation methods of the present invention. The description of the above embodiments is only used to help understand the method of the present invention and its core idea; at the same time, for technical personnel in this field, according to the idea of the present invention, there will be changes in the specific implementation method and application scope. In summary, the content of this specification should not be understood as a limitation on the present invention.
Claims
1. A method for predicting mineral resource prices, characterized in that: include: Acquire a mineral resource price time series, and smooth the mineral resource price time series based on a sliding window to obtain a target mineral resource price time series; Constructing an initial price prediction model, wherein the initial price prediction model includes a convolutional neural network layer, a bidirectional gated recurrent unit, and an attention mechanism layer; Dividing the target mineral resource price time series into a plurality of data groups based on a delay step; The initial price prediction model is trained based on the multiple data groups to obtain a target price prediction model, and the price of mineral resources is predicted based on the target price prediction model.
2. The method for predicting mineral resource prices according to claim 1, characterized in that: The target mineral resource price time series includes a plurality of target mineral resource price data, and the target mineral resource price data are: In the formula, is the price data of the i-th target mineral resource; is the window radius of the sliding window; is the jth mineral resource price data in the mineral resource price time series.
3. The method for predicting mineral resource prices according to claim 1, characterized in that: Before dividing the target mineral resource price time series into a plurality of data groups based on the delay step, the method further includes: Acquire multiple initial delay step lengths, and determine multiple initial data groups corresponding one-to-one to the multiple initial delay step lengths; Training the initial price prediction model based on the multiple initial data groups to obtain multiple price prediction models to be evaluated; The multiple price prediction models to be evaluated are evaluated based on preset evaluation indicators to obtain multiple evaluation values, and the initial delay step length corresponding to the price prediction model to be evaluated with the highest evaluation value is used as the delay step length.
4. The method for predicting mineral resource prices according to claim 1, characterized in that: The training of the initial price prediction model based on the multiple data groups to obtain a target price prediction model includes: Initialize algorithm parameters in the whale optimization algorithm, wherein the algorithm parameters include the population size and the maximum number of iterations; constructing a fitness function based on the data set; Determine a parameter to be optimized of the initial price prediction model, set the parameter to be optimized as an initial position vector of the whale optimization algorithm, and determine an initial fitness value based on the initial position vector and the fitness function; Performing an optimal neighborhood perturbation update on the initial position vector using an optimal neighborhood perturbation formula to obtain an initial updated position vector; Obtain a random number, and determine whether the random number is less than a random number threshold; When the random number is less than the random number threshold, updating the initial update position vector based on an adaptive weight position update formula to obtain a first update position vector, and determining a first fitness value based on the first update position vector and the fitness function; When the random number is greater than or equal to the random number threshold, the initial update position vector is updated based on the variable spiral position update formula to obtain a second update position vector, and a second fitness value is determined based on the first update position vector and the fitness function; Determine whether the first fitness value is greater than the initial fitness value, and whether the second fitness value is greater than the initial fitness value; When the first fitness value is greater than the initial fitness value, the initial position vector is replaced by the first updated position vector, and it is determined whether an iteration termination condition is satisfied. When the iteration termination condition is satisfied, a target parameter is obtained based on the first updated position vector, and the target parameter is assigned to the initial price prediction model to obtain the target price prediction model. When the second fitness value is greater than the initial fitness value, the second updated position vector replaces the initial position vector, and it is determined whether the iteration termination condition is met. When the iteration termination condition is met, the target parameters are obtained based on the second updated position vector, and the target parameters are assigned to the initial price prediction model to obtain the target price prediction model.
5. The method for predicting mineral resource prices according to claim 4, characterized in that: The optimal neighborhood perturbation formula is: In the formula, is the global optimal position vector of the tth iteration; is the new position randomly searched after the tth iteration; , is a random number between [0, 1].
6. The method for predicting mineral resource prices according to claim 5, characterized in that: The adaptive weight position update formula is: In the formula, is the updated position vector of the t+1th iteration; is the adaptive weight; is the first coefficient matrix; is the second coefficient matrix; is the updated position vector of the tth iteration; is the maximum number of iterations.
7. The method for predicting mineral resource prices according to claim 6, characterized in that: The variable spiral position update formula is: In the formula, Parameters to control the shape of the spiral; is the distance between the current whale position and the target prey position; is a random number between [-1, 1].
8. A mineral resource price prediction device, characterized in that: include: A price time series smoothing processing unit is used to obtain a mineral resource price time series, and smooth the mineral resource price time series based on a sliding window to obtain a target mineral resource price time series; An initial price prediction model construction unit, used to construct an initial price prediction model, wherein the initial price prediction model includes a convolutional neural network layer, a bidirectional gated recurrent unit, and an attention mechanism layer; A price time series division unit, used for dividing the target mineral resource price time series into a plurality of data groups based on a delay step; The mineral resource price prediction unit is used to train the initial price prediction model based on the multiple data groups to obtain a target price prediction model, and predict the mineral resource price based on the target price prediction model.
9. A mineral resource price prediction device, characterized in that: comprising a memory and a processor, wherein: The memory is used to store programs; The processor is coupled to the memory and is used to execute the program stored in the memory to implement the steps in the mineral resource price prediction method described in any one of claims 1 to 7 above.
10. A computer-readable storage medium, characterized in that: Used to store computer-readable programs or instructions, which, when executed by a processor, can implement the steps in the mineral resource price prediction method described in any one of claims 1 to 7 above.