Power marketing risk prediction optimization method
By improving the special relativity search algorithm and particle optimization weight factor, and optimizing the hidden layer parameters of the LSTM model, the problems of low prediction accuracy of the LSTM model and slow convergence of the special relativity search algorithm are solved, and the accuracy and timeliness of power marketing risk prediction are improved. .
Patent Information
- Application Number
- CN202410633348.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-05-21
- Publication Date
- 2024-09-03
- Estimated Expiration
- 2044-05-21
AI Technical Summary
The network parameters in the long short-term memory neural network (LSTM) model are overly dependent on empirical settings, resulting in low power marketing risk prediction accuracy and long prediction time. The special relativistic search algorithm (SRS) is easy to fall into local optimality and has slow convergence speed in the late iteration period, resulting in The prediction accuracy and speed of the SRS-LSTM prediction model are still poor.
By improving the special relativity search algorithm, using the "relative convergence" strategy model and the fitness value change Δf and the current iteration particle speed to improve the particle optimization weight factor β, and optimizing the number of hidden layer nodes and the initial learning rate of the LSTM model, βSRS- LSTM model improves local convergence speed and the ability to jump out of local optimality.
It improves the performance of the SRS-LSTM prediction model, improves the accuracy and timeliness of power marketing risk prediction, optimizes marketing strategies, and can more effectively respond to risk challenges in complex environments.
Smart Images

Figure CN118586955A
Abstract
Description
Technical Field
[0001] The invention belongs to the technical field of data prediction and relates to an optimization method for predicting risks in power marketing. Background Art
[0002] With the continuous opening of the power market and the intensification of competition, power marketing is facing an increasingly complex external environment, including policy adjustments, market fluctuations, technological advances, and changes in customer demand. These changes have brought higher uncertainty and risks to power marketing on-site behaviors. In a complex marketing environment, risk management has become the key for power companies to enhance their competitiveness and ensure operational safety. Through effective risk prediction and optimization methods, companies can identify potential risks in advance, formulate targeted response strategies, and reduce risk losses. With the rapid development of big data and intelligent optimization algorithm technology, new ideas and methods have been provided for power marketing risk prediction. By collecting and analyzing massive data, a more accurate risk prediction model can be built, marketing strategies can be optimized, and the accuracy and timeliness of predictions can be improved.
[0003] Traditional risk prediction methods are often based on historical data and empirical models, which are difficult to adapt to complex and changing environments. These methods have limitations in prediction accuracy and timeliness and are difficult to meet the needs of modern power marketing. Existing risk management methods mainly focus on risk control and risk transfer, lacking in-depth analysis of risk sources and comprehensive monitoring of risk processes. This makes it difficult for companies to respond quickly when faced with sudden risks, reducing the effectiveness of risk management. With the help of big data and intelligent optimization algorithm technology, risk management can be intelligent and automated. Through real-time monitoring of risk processes, automatic early warning and intelligent decision support, companies can respond to risk challenges more efficiently and improve their risk management level.
[0004] The LSTM model is used to predict the risk of power marketing in complex environments. The long short-term memory neural network prediction model (LSTM) contains many network parameters, such as kernel function, learning rate and number of neurons. These parameters will affect the accuracy of the LSTM model in predicting the risk of power marketing in complex environments. Because these parameters are overly dependent on empirical settings, their prediction accuracy is inaccurate. At the same time, the training time of the LSTM model will also change with different parameter settings, resulting in a long prediction time for power marketing risks.
[0005] The special relativity search algorithm (SRS) is a new meta-heuristic optimization algorithm. SRS is inspired by the interaction of particles in the electromagnetic field. The Lorentz force is used to calculate the interaction of particles, and the angular frequency is used to establish the equation of motion. The magnetic force between particles is perpendicular to the velocity and magnetic field of the charged particles, which causes the particles to move in a circular trajectory. The special relativity physics theory is used to determine the coordinates of the charged particles in each rotation. The charged particles are members of the randomly generated initial population, and their charges are determined according to their fitness. The SRS optimization mathematical model is established using the two phenomena of length contraction and time dilation. The use of the special relativity search algorithm to optimize the long short-term memory neural network prediction model can improve the prediction accuracy of the LSTM model to a certain extent. Further experimental measurements show that although the special relativity search algorithm has good global search performance, it is easy to fall into local optimality in the later stages of iteration and converges slowly. Summary of the invention
[0006] In view of the above-mentioned background technology, many network parameters in the long short-term memory neural network (LSTM) prediction model are overly dependent on empirical settings, resulting in low accuracy and long prediction time for power marketing risk prediction in complex environments, and the special relativity search algorithm (SRS) is prone to fall into local optimality and convergence speed in the late iteration, resulting in the problem that the prediction accuracy and prediction speed of the SRS-LSTM prediction model obtained by optimizing the long short-term memory neural network prediction model by the special relativity search algorithm are still poor. The present invention proposes a power marketing risk prediction optimization method, which improves the local convergence speed and the ability of the SRS algorithm to jump out of the local optimal by improving the special relativity search algorithm, thereby improving the performance of the SRS-LSTM prediction model and obtaining a βSRS-LSTM prediction model. The βSRS-LSTM prediction model is applied to power marketing risk prediction, optimizes marketing strategies, and improves the accuracy and timeliness of power marketing risk prediction in complex environments.
[0007] The technical solution adopted by the present invention to achieve the above-mentioned object is: a method for optimizing the prediction of power marketing risk, which improves the local convergence speed and the ability to jump out of the local optimum of the SRS algorithm by improving the special relativity algorithm, thereby improving the performance of the SRS-LSTM prediction model and obtaining the βSRS-LSTM prediction model. The specific steps are:
[0008] S1. Pre-process the historical power marketing data, market factor data, social factor data, and power system data that affect power marketing risk prediction.
[0009] S2. Using the "relative convergence" strategy model as the position update mathematical model of the special relativity algorithm in the local convergence stage, the position update strategy of the special relativity algorithm is improved. The "relative convergence" strategy model uses the special relativity search algorithm to search for the global optimal particle position X best As the center, according to the current position of the particle The best particle position relative to the current iteration The distance and average position of the particle population and The difference updates the new position of the particle.
[0010] S3, using the change in fitness value Δf and the current iteration particle speed And the optimal fitness value f best The particle optimization weight factor β of the special relativity algorithm is improved, and the position updating mathematical model of the special relativity algorithm is further improved.
[0011] S4. Use the improved special relativity algorithm (βSRS) to adjust the number of hidden layer nodes s and the initial learning rate α parameter of the LSTM model to obtain the βSRS-LSTM model.
[0012] S5. Use the data preprocessed by S1 as input to the βSRS-LSTM model, use the βSRS-LSTM model to process the preprocessed data, and output the power marketing risk prediction data value.
[0013] Preferably, step S1 affects power marketing risk prediction data, wherein historical power marketing data includes power sales volume, power sales revenue, and the number of power users; wherein market factor data includes market share value and competitor price value; wherein social factor data includes regional population density; wherein power system data includes power generation and load demand.
[0014] Preferably, the step S1 preprocesses the data affecting the prediction of power marketing risks, and after the preprocessing, the data is divided into a training set and a test set, 70% of the data is used as the training set, and 30% of the data is used as the test set, and the LSTM model is trained using the training set, wherein the specific steps of the preprocessing are:
[0015] S11. Use the mean to fill the missing values that affect the power marketing risk prediction data, and fill the calculated mean to the position of the missing value; the mean mathematical model is:
[0016]
[0017] In the formula, is the filled mean, m is the number of non-missing values, x z is the zth non-missing value;
[0018] S12. Use maximum and minimum value normalization to scale all data affecting power marketing risk prediction to between 0 and 1; the mathematical model is:
[0019]
[0020] Where x′ is the normalized data affecting the prediction of power marketing risks, x is the original data affecting the prediction of power marketing risks, and x min and x max are the minimum and maximum values of the data respectively.
[0021] Preferably, the "relative convergence" strategy model in step S2 is used to improve the position update strategy of the special relativity algorithm, and the mathematical formula of the "relative convergence" strategy model is:
[0022]
[0023] In formula (1), X i,j (t+1) is the position of the jth dimension of the ith particle in the t+1th iteration, X i,j (t) is the position of the jth dimension of the ith particle in the tth iteration, that is, the current position of the particle, X best is the global optimal particle position, Levy(D) is the Levy distribution function, D is the problem dimension, is the average position of the particle population at the tth iteration, is the optimal particle position at the tth iteration, R i,best for and distance.
[0024] Preferably, the position update strategy of the standard special relativity algorithm combines the global search and local development of the algorithm, and updates the position of the algorithm particles through a position update mathematical model. This method can improve the global search performance of the algorithm, but makes the local convergence performance of the algorithm poor. The "relative convergence" strategy model is used as the local convergence position update mathematical model of the special relativity algorithm, thereby improving the position update strategy of the special relativity algorithm. The addition of the "relative convergence" strategy model improves the accuracy of the local convergence of the special relativity algorithm. The Levy function can enhance the ability of the special relativity algorithm to jump out of the local optimum in the local convergence stage. Yang For the current iteration, the best position The particle convergence step size is designed based on the distance to avoid the special relativity algorithm from falling into the local optimum when adjusting the number of hidden layer nodes s and the initial learning rate α parameters of the LSTM model.
[0025] Preferably, the step S3 improves the particle optimization weight factor β of the special relativity search algorithm, and the specific steps are:
[0026] S31, according to the global search stage, the particle optimization weight factor is large to enhance the global search capability; the global search and local convergence balance stage, the particle optimization weight factor gradually decreases to balance the global search and local convergence; the particle optimization weight factor is small in the local convergence stage to enhance the local convergence capability, and the piecewise nonlinear adaptive mathematical model of the particle optimization weight factor β is designed according to formula (2);
[0027]
[0028] In formula (2), β max is the maximum value of the particle optimization weight factor, which is 1, β min is the minimum value of the particle optimization weight factor, which is 0.01; k1 and k2 are parameters for controlling the nonlinear decay rate; T1 is the number of iterations in the global search phase, which is T2 is the number of iterations in the equilibrium phase, and its value is T3 is the number of iterations in the local convergence phase, and its value is t is the current iteration number, h i (t) is the balance factor of the ith particle in the tth iteration, and the mathematical model is:
[0029]
[0030] In formula (3), is the fitness value of the position of the i-th particle in the t-th iteration, is the maximum fitness value of the particle position in the tth iteration, is the minimum fitness value of the particle position in the tth iteration;
[0031] S32, using the change in fitness value Δf and the current iteration particle speed And the historical best fitness value f best The particle optimization weight factor is improved. The improved mathematical model of the particle optimization weight factor is:
[0032]
[0033] In formula (4), β ipv is the improved particle optimization weight factor, r is the adjustment coefficient of the fitness function value, which is 0.5, q is the adjustment coefficient of the particle speed, which is 0.2, Δf is the change in fitness value, that is, the difference between the current fitness of the particle and the historical best fitness, ε is a very small value, which is 0.01, and v max It is the maximum value of all current particle speeds.
[0034] Preferably, the step S3 further improves the position update mathematical model of the special theory of relativity algorithm using the improved particle optimization weight factor, wherein the position update mathematical model includes the global search phase position mathematical model and the local convergence position update mathematical model of the special theory of relativity search algorithm;
[0035] Among them, the improved mathematical model of the global search stage position is:
[0036]
[0037] In formula (5), X i,j (t+1) is the position of the jth dimension of the ith particle in the t+1th iteration, β ipv is the improved particle optimization weight factor, is the coordinate value of the i-th particle in the t-th iteration; is the velocity of the i-th particle in the t-th iteration, i.e., the velocity of the particle in the previous iteration;
[0038] Among them, the improved mathematical model of the local convergence stage position is:
[0039]
[0040] Preferably, the step S4 uses an improved special relativity algorithm to adjust the number of hidden layer nodes s and the initial learning rate α parameter of the LSTM model, and the specific steps are:
[0041] S41, encoding the number of hidden layer nodes s and the initial learning rate α parameter of the LSTM model for power marketing risk prediction into a space vector solution set, and mapping the space vector solution set to the particle position of the improved special relativity algorithm through real number encoding;
[0042] S42. Initialize the parameters of the improved special relativity algorithm, including: the maximum size of the particle population N, the maximum number of iterations T max , the problem dimension D, the upper bound ub and lower bound lb of the particle position, and the maximum value β of the particle optimization weight factor max and the minimum value β min ;
[0043] S43, initial stage, current iteration number t = 0, use formula (7) to randomly initialize the current position X of N particles i,j (t);
[0044] X i,j (t) = lb + rand × (ub - lb) (7);
[0045] In formula (7), rand is a random number ranging from 0 to 1;
[0046] S44, the current iteration number t executes t=t+1, and the current iteration number t and the maximum iteration number T are determined. max , if t is less than T max If yes, execute S45 to S46, otherwise execute S47;
[0047] S45, simulating the principle of special theory of relativity to establish a position updating mathematical model of an improved special theory of relativity algorithm, and updating the particle position of the improved special theory of relativity algorithm through the position updating mathematical model;
[0048] S46, using the fitness function f of formula (8) to calculate the fitness value of the individual particle position, and retaining the individual particle position with the smallest fitness value of the current iteration;
[0049]
[0050] In formula (8), n is the number of test set data samples, y p is the true value of the p-th validation set sample, is the predicted value of the pth validation set sample;
[0051] S47. The individual particle position corresponding to the global minimum fitness value is resolved into the number of hidden layer nodes n and the initial learning rate α parameter value of the LSTM model for power marketing risk prediction, and the prediction parameter value of the optimal LSTM model is obtained.
[0052] Preferably, the principle of special theory of relativity is simulated to establish an improved position updating mathematical model of the special theory of relativity algorithm, and the specific method is as follows:
[0053] S451, using the Euclidean norm, the distance R between the coordinates of the current i-th particle and the coordinates of a random particle c in the magnetic field is determined i,a (t), establish a mathematical model according to formula (9);
[0054]
[0055] In formula (9), is the coordinate value of the ith particle in the tth iteration, is the coordinate value of the cth particle at the tth iteration;
[0056] S452, calculating the charges of the current i-th particle and a random particle c in the magnetic field, and establishing a mathematical model according to formula (10);
[0057]
[0058] In formula (10), Q i (t) is the charge value of the ith particle, Q c (t) is the charge value of the cth particle, is the fitness value of the position of the i-th particle in the t-th iteration, is the maximum fitness value of the particle position in the tth iteration, is the minimum fitness value of the particle position in the tth iteration; is the fitness value of the cth particle position in the tth iteration;
[0059] S453, simulating and calculating the movement speed of particles in the magnetic field, and establishing a mathematical model according to formula (11);
[0060]
[0061] In formula (11), is the velocity of the ith particle at the tth iteration, is the velocity of the cth particle in the tth iteration, μ is the magnetic permeability coefficient, m is the mass of the particle, r i,j is the separation distance between the ith particle and particle c;
[0062] S454, simulating the calculation of the frequency of the cyclotron accelerator through the magnetic field B, the particle charge and the particle mass, and establishing a mathematical model according to formula (12);
[0063]
[0064] In formula (12), w is the frequency of the cyclotron;
[0065] S455, based on the calculation of particle coordinates in special relativity, using v = w·R i,c , according to formula (13), a mathematical model for updating particle coordinates is established;
[0066]
[0067] In formula (13), is the coordinate value of the ith particle in the tth iteration, is the coordinate value of the i-th particle in the t-1th iteration;
[0068] S456, using formula (9) to formula (13) to design a particle position update mathematical model in the global search phase, introducing a "relative convergence" strategy model as a particle position update mathematical model in the local convergence phase, and establishing an improved particle position update mathematical model according to formula (14);
[0069]
[0070] In summary, due to the adoption of the technical solution, the present invention has the following effects: the present invention proposes a "relative convergence" strategy model, and uses the "relative convergence" strategy model as a position update mathematical model of the special relativity algorithm in the local convergence stage, thereby improving the position update strategy of the special relativity algorithm, and improving the local convergence accuracy of the special relativity algorithm and the ability to jump out of the global suboptimal solution; improving the particle optimization weight factor β of the special relativity search algorithm, and integrating the improved particle optimization weight factor into the position update mathematical model of the improved special relativity algorithm. In the global search stage, the particle optimization weight factor is relatively large, The global search capability of the algorithm is enhanced; in the global search and local convergence balance stage, the particle optimization weight factor gradually decreases to balance the global search and local convergence; in the local convergence stage, the particle optimization weight factor is small, which enhances the local convergence capability of the algorithm and prevents the algorithm from falling into a global suboptimal solution; the improved special relativity algorithm improves the performance of the SRS-LSTM prediction model and obtains the βSRS-LSTM prediction model. The βSRS-LSTM prediction model is applied to power marketing risk prediction, further optimizing the marketing strategy and improving the accuracy and timeliness of power marketing risk prediction in complex environments. BRIEF DESCRIPTION OF THE DRAWINGS
[0071] Figure 1 This is a step diagram of an optimization method for power marketing risk prediction.
[0072] Figure 2 Flowchart for adjusting the number of hidden layer nodes s and the initial learning rate α parameters of the LSTM model using the improved special relativity algorithm.
[0073] Figure 3 Comparison of the fitness of the special relativity algorithm before and after the improvement of the number of hidden layer nodes s and the initial learning rate α parameters.
[0074] Figure 4 Comparison chart of accuracy errors of power marketing risk prediction achieved by optimizing LSTM network using special relativity algorithm before and after improvement.
[0075] Figure 5 Comparison chart of risk prediction values for power marketing achieved by optimizing LSTM network using special relativity algorithm before and after improvement. DETAILED DESCRIPTION
[0076] The technical solutions in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, rather than all the embodiments; based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without making creative work are within the scope of protection of the present invention.
[0077] See also Figure 1-Figure 5 The present invention provides a technical solution: a method for optimizing the prediction of power marketing risk, which improves the local convergence speed and the ability to jump out of the local optimum of the SRS algorithm by improving the special relativity algorithm, thereby improving the performance of the SRS-LSTM prediction model and obtaining the βSRS-LSTM prediction model. The specific steps are as follows: Figure 1 shown.
[0078] S1. Pre-process the historical power marketing data, market factor data, social factor data, and power system data that affect power marketing risk prediction.
[0079] Furthermore, the power marketing risk prediction data is affected, wherein the historical power marketing data includes power sales volume, power sales revenue, and the number of power users; wherein the market factor data includes market share value and competitor price value; wherein the social factor data includes regional population density; wherein the power system data includes power generation and load demand.
[0080] Furthermore, the data affecting the prediction of power marketing risks are preprocessed. After preprocessing, the data are divided into a training set and a test set. 70% of the data is used as the training set and 30% of the data is used as the test set. The training set is used to train the LSTM model. The specific steps of preprocessing are as follows:
[0081] S11. Use the mean to fill the missing values that affect the power marketing risk prediction data, and fill the calculated mean to the position of the missing value; the mean mathematical model is:
[0082]
[0083] In the formula, is the filled mean, m is the number of non-missing values, x z is the zth non-missing value;
[0084] S12. Use maximum and minimum value normalization to scale all data affecting power marketing risk prediction to between 0 and 1; the mathematical model is:
[0085]
[0086] Where x′ is the normalized data affecting the prediction of power marketing risks, x is the original data affecting the prediction of power marketing risks, and x min and x max are the minimum and maximum values of the data respectively.
[0087] S2. Using the "relative convergence" strategy model as the position update mathematical model of the special relativity algorithm in the local convergence stage, the position update strategy of the special relativity algorithm is improved. The "relative convergence" strategy model uses the special relativity algorithm to search for the global optimal particle position X best As the center, according to the current position of the particle The best particle position relative to the current iteration The distance and average position of the particle population and The difference updates the new position of the particle.
[0088] Furthermore, the “relative convergence” strategy model is used to improve the position update strategy of the special relativity algorithm. The mathematical formula of the “relative convergence” strategy model is:
[0089]
[0090] In formula (1), X i,j (t+1) is the position of the jth dimension of the ith particle in the t+1th iteration, X i,j (t) is the position of the jth dimension of the ith particle in the tth iteration, that is, the current position of the particle, X best is the global optimal particle position, Levy(D) is the Levy distribution function, D is the problem dimension, is the average position of the particle population at the tth iteration, is the optimal particle position at the tth iteration, R i,best for and distance.
[0091] S3, using the change in fitness value Δf and the current iteration particle speed And the optimal fitness value f best The particle optimization weight factor β of the special relativity algorithm is improved, and the position updating mathematical model of the special relativity algorithm is further improved.
[0092] Furthermore, the particle optimization weight factor β of the special relativity search algorithm is improved. The specific steps are as follows:
[0093] S31, according to the global search stage, the particle optimization weight factor is large to enhance the global search capability; the global search and local convergence balance stage, the particle optimization weight factor gradually decreases to balance the global search and local convergence; the particle optimization weight factor is small in the local convergence stage to enhance the local convergence capability, and the piecewise nonlinear adaptive mathematical model of the particle optimization weight factor β is designed according to formula (2);
[0094]
[0095] In formula (2), βmax is the maximum value of the particle optimization weight factor, which is 1, β min is the minimum value of the particle optimization weight factor, which is 0.01; k1 and k2 are parameters for controlling the nonlinear decay rate; T1 is the number of iterations in the global search phase, which is T2 is the number of iterations in the equilibrium phase, and its value is T3 is the number of iterations in the local convergence phase, and its value is t is the current iteration number, h i (t) is the balance factor of the ith particle in the tth iteration, and the mathematical model is:
[0096]
[0097] In formula (3), is the fitness value of the position of the i-th particle in the t-th iteration, is the maximum fitness value of the particle position in the tth iteration, is the minimum fitness value of the particle position in the tth iteration;
[0098] S32, using the change in fitness value Δf and the current iteration particle speed And the historical best fitness value f best The particle optimization weight factor is improved. The improved mathematical model of the particle optimization weight factor is:
[0099]
[0100] In formula (4), β ipv is the improved particle optimization weight factor, r is the adjustment coefficient of the fitness function value, which is 0.5, q is the adjustment coefficient of the particle speed, which is 0.2, Δf is the change in fitness value, that is, the difference between the current fitness of the particle and the historical best fitness, ε is a very small value, which is 0.01, and v max It is the maximum value of all current particle speeds.
[0101] Furthermore, the improved particle optimization weight factor is used to further improve the position update mathematical model of the special relativity algorithm, wherein the position update mathematical model includes the global search phase position mathematical model and the local convergence position update mathematical model of the special relativity search algorithm;
[0102] Among them, the improved mathematical model of the global search stage position is:
[0103]
[0104] In formula (5), X i,j (t+1) is the position of the jth dimension of the ith particle in the t+1th iteration, βipv is the improved particle optimization weight factor, is the coordinate value of the i-th particle in the t-th iteration; is the velocity of the i-th particle in the t-th iteration, i.e., the velocity of the particle in the previous iteration;
[0105] Among them, the improved mathematical model of the local convergence stage position is:
[0106]
[0107] S4. Use the improved special relativity algorithm (βSRS) to adjust the number of hidden layer nodes s and the initial learning rate α parameter of the LSTM model to obtain the βSRS-LSTM model.
[0108] Furthermore, if Figure 2 As shown in the figure, the number of hidden layer nodes s and the initial learning rate α parameter of the LSTM model are adjusted using the improved special relativity algorithm. The specific steps are:
[0109] S41, encoding the number of hidden layer nodes s and the initial learning rate α parameter of the LSTM model for power marketing risk prediction into a space vector solution set, and mapping the space vector solution set to the particle position of the improved special relativity algorithm through real number encoding;
[0110] S42. Initialize the parameters of the improved special relativity algorithm, including: the maximum size of the particle population N, the maximum number of iterations T max , the problem dimension D, the upper bound ub and lower bound lb of the particle position, and the maximum value β of the particle optimization weight factor max and the minimum value β min ;
[0111] S43, initial stage, current iteration number t = 0, use formula (7) to randomly initialize the current position X of N particles i,j (t);
[0112] X i,j (t) = lb + rand × (ub - lb) (7);
[0113] In formula (7), rand is a random number ranging from 0 to 1;
[0114] S44, the current iteration number t executes t=t+1, and the current iteration number t and the maximum iteration number T are determined. max , if t is less than T max If yes, execute S45 to S46, otherwise execute S47;
[0115] S45, simulating the principle of special theory of relativity to establish a position updating mathematical model of an improved special theory of relativity algorithm, and updating the particle position of the improved special theory of relativity algorithm through the position updating mathematical model;
[0116] S46, using the fitness function f of formula (8) to calculate the fitness value of the individual particle position, and retaining the individual particle position with the smallest fitness value of the current iteration;
[0117]
[0118] In formula (8), n is the number of test set data samples, y p is the true value of the p-th validation set sample, is the predicted value of the pth validation set sample;
[0119] S47. The individual particle position corresponding to the global minimum fitness value is resolved into the number of hidden layer nodes n and the initial learning rate α parameter value of the LSTM model for power marketing risk prediction, and the prediction parameter value of the optimal LSTM model is obtained.
[0120] Furthermore, the principle of special relativity is simulated to establish a position update mathematical model of the improved special relativity algorithm. The specific method is as follows:
[0121] S451, using the Euclidean norm, the distance R between the coordinates of the current i-th particle and the coordinates of a random particle c in the magnetic field is determined i,a (t), establish a mathematical model according to formula (9);
[0122]
[0123] In formula (9), is the coordinate value of the ith particle in the tth iteration, is the coordinate value of the cth particle in the tth iteration; S452, calculate the charge of the current ith particle and a random particle c in the magnetic field, and establish a mathematical model according to formula (10);
[0124]
[0125] In formula (10), Q i (t) is the charge value of the ith particle, Q c (t) is the charge value of the cth particle, is the fitness value of the position of the i-th particle in the t-th iteration, is the maximum fitness value of the particle position in the tth iteration, is the minimum fitness value of the particle position in the tth iteration; is the fitness value of the cth particle position in the tth iteration;
[0126] S453, simulating and calculating the movement speed of particles in the magnetic field, and establishing a mathematical model according to formula (11);
[0127]
[0128] In formula (11), is the velocity of the ith particle at the tth iteration, is the velocity of the cth particle in the tth iteration, μ is the magnetic permeability coefficient, m is the mass of the particle, r i,j is the separation distance between the ith particle and particle c;
[0129] S454, simulating the calculation of the frequency of the cyclotron accelerator through the magnetic field B, the particle charge and the particle mass, and establishing a mathematical model according to formula (12);
[0130]
[0131] In formula (12), w is the frequency of the cyclotron;
[0132] S455, based on the calculation of particle coordinates in special relativity, using v = w·R i,c , according to formula (13), a mathematical model for updating particle coordinates is established;
[0133]
[0134] In formula (13), is the coordinate value of the ith particle in the tth iteration, is the coordinate value of the i-th particle in the t-1th iteration;
[0135] S456, using formula (9) to formula (13) to design a particle position update mathematical model in the global search phase, introducing a "relative convergence" strategy model as a particle position update mathematical model in the local convergence phase, and establishing an improved particle position update mathematical model according to formula (14);
[0136]
[0137] S5. Use the data preprocessed by S1 as input to the βSRS-LSTM model, use the βSRS-LSTM model to process the preprocessed data, and output the power marketing risk prediction data value.
[0138] Furthermore, 120 sets of data samples affecting power marketing risk prediction are stored in the form of eight inputs and one output in an xlsx file. The standard LSTM model prediction program, the standard special relativity algorithm (SRS) and the improved special relativity algorithm (βSRS) are designed and written in MATLAB. The maximum size of the particle population N = 40 and the maximum number of iterations T are set. max =40, problem dimension D = 2, upper bound ub = [150, 80, 0.05, 1e-3] and lower bound lb = [30, 50, 0.001, 1e-4] of particle position, and maximum value β of particle optimization weight factor max =1 and minimum value β min =0.01; the root mean square error function is used as the fitness function, and the standard LSTM model is optimized by the standard special relativity algorithm (SRS) and the improved special relativity algorithm (βSRS). The obtained SRS-LSTM prediction model program and βSRS-LSTM prediction model program and the standard LSTM model prediction program are run through three files respectively, and the xlsx file affecting the power marketing risk prediction data is input into the three prediction model files. The three prediction model programs are run in the order of the standard LSTM prediction model, the SRS-LSTM prediction model, and the βSRS-LSTM prediction model, and the output is as follows: Figure 3 , Figure 4 , Figure 5 Effect comparison chart.
[0139] Furthermore, Figure 3 The changes in the root mean square error (RMSE) fitness values of the SRS-LSTM prediction model and the βSRS-LSTM prediction model as the number of iterations changes. The smaller the fitness value, the better the performance of the algorithm in adjusting the number of hidden layer nodes s and the initial learning rate α parameters of the LSTM model, which will also reduce the error between the predicted value and the true value of the power marketing risk. Figure 3 It can be clearly seen that the SRS optimized LSTM model represented by the dotted line has a higher root mean square error value, which starts at about 0.048. As the number of iterations increases, the fitness value gradually decreases, but after reaching a certain number of iterations (about the 5th iteration), it tends to stabilize and reaches 0.034; the βSRS optimized LSTM model represented by the solid line has a lower root mean square error value, which starts at about 0.034 and quickly reaches a stable value of about 0.029 in the early iteration process, indicating that the model converges faster, and the improved special relativity algorithm adjusts the hidden layer node number s and the initial learning rate α parameters of the LSTM model with better performance.
[0140] Furthermore, Figure 4The error of power marketing risk prediction of different models, LSTM, SRS-LSTM, and βSRS-LSTM, is shown, that is, the difference between the predicted value and the target value; the error of the LSTM model represented by the dotted line has the largest fluctuation and a large error value range of -25 to 25, indicating that the model is not stable enough for power marketing risk prediction; the error of the SRS-LSTM model represented by the dotted line has a smaller fluctuation, but there are still some large error values of -8 to 8; the error of the βSRS-LSTM model represented by the solid line has the smallest fluctuation and the smallest error value range of about -2 to 2, indicating that the βSRS-LSTM model is the most accurate and stable for power marketing risk prediction, achieving the purpose of strategy optimization.
[0141] Furthermore, Figure 5 The comparison between the predicted values and target values of power marketing risks by different models including LSTM, SRS-LSTM and βSRS-LSTM is shown. The predicted value of the standard LSTM model represented by the thick dotted line shows that there is a big gap between its predicted result and the target value. The dotted line plus sign represents the predicted value of power marketing risk by the SRS-LSTM model, which has a small fluctuation and is close to the target value, but there are still obvious errors in some data points. The solid line plus circle symbol represents the predicted value of power marketing risk by the βSRS-LSTM model, which is the most stable and closest to the target value, thus achieving strategy optimization.
Claims
1. A method for optimizing power marketing risk prediction, characterized in that: The specific steps are: S1. Preprocess the historical power marketing data, market factor data, social factor data, and power system data that affect power marketing risk prediction; S2. Using the "relative convergence" strategy model as the position update mathematical model of the special relativity algorithm in the local convergence stage, the position update strategy of the special relativity algorithm is improved. The "relative convergence" strategy model uses the special relativity search algorithm to search for the global optimal particle position X best As the center, according to the current position of the particle The best particle position relative to the current iteration The distance and average position of the particle population and The difference between the two updates the new position of the particle; S3, using the change in fitness value Δf and the current iteration particle speed And the optimal fitness value f best Improve the particle optimization weight factor β of the special relativity algorithm, and further improve the position update mathematical model of the special relativity algorithm; S4, using the improved special relativity algorithm to adjust the number of hidden layer nodes s and the initial learning rate α parameter of the LSTM model to obtain the βSRS-LSTM model; S5. Use the data preprocessed by S1 as input to the βSRS-LSTM model, use the βSRS-LSTM model to process the preprocessed data, and output the power marketing risk prediction data value.
2. The method for optimizing power marketing risk prediction according to claim 1, characterized in that: The step S1 affects the power marketing risk prediction data, wherein the historical power marketing data includes power sales volume, power sales revenue, and the number of power users; wherein the market factor data includes market share value and competitor price value; wherein the social factor data includes regional population density; wherein the power system data includes power generation and load demand.
3. The method for optimizing power marketing risk prediction according to claim 2, characterized in that: The mathematical formula of the "relative convergence" strategy model in step S2 is: In formula (1), X i,j (t+1) is the position of the jth dimension of the ith particle in the t+1th iteration, X i,j (t) is the position of the jth dimension of the ith particle in the tth iteration, that is, the current position of the particle, X best is the global optimal particle position, Leυy(D) is the Levy distribution function, D is the problem dimension, is the average position of the particle population at the tth iteration, is the optimal particle position at the tth iteration, R i,best for and The Euler distance of .
4. The method for optimizing power marketing risk prediction according to claim 3 is characterized in that: The step S3 improves the particle optimization weight factor β of the special relativity algorithm, and the specific steps are: S31, according to the global search stage, the particle optimization weight factor is large to enhance the global search capability; the global search and local convergence balance stage, the particle optimization weight factor gradually decreases to balance the global search and local convergence; the particle optimization weight factor is small in the local convergence stage to enhance the local convergence capability, and the piecewise nonlinear adaptive mathematical model of the particle optimization weight factor β is designed according to formula (2); In formula (2), β max is the maximum value of the particle optimization weight factor, which is 1, β min is the minimum value of the particle optimization weight factor, which is 0.01; k1 and k2 are parameters for controlling the nonlinear decay rate; T1 is the number of iterations in the global search phase, which is T2 is the number of iterations in the equilibrium phase, and its value is T3 is the number of iterations in the local convergence phase, and its value is t is the current iteration number, h i (t) is the balance factor of the ith particle in the tth iteration, and the mathematical model is: In formula (3), is the fitness value of the position of the i-th particle in the t-th iteration, is the maximum fitness value of the particle position in the tth iteration, is the minimum fitness value of the particle position in the tth iteration; S32, using the change in fitness value Δf and the current iteration particle speed And the historical best fitness value f best The particle optimization weight factor is improved. The improved mathematical model of the particle optimization weight factor is: In formula (4), β ipυ is the improved particle optimization weight factor, r is the adjustment coefficient of the fitness function value, which is 0.5, q is the adjustment coefficient of the particle speed, which is 0.2, Δf is the change in fitness value, that is, the difference between the current fitness of the particle and the historical best fitness, ε is a very small value, which is 0.01, and υ max It is the maximum value of all current particle speeds.
5. The method for optimizing power marketing risk prediction according to claim 4, characterized in that: The step S3 further improves the position update mathematical model of the special theory of relativity algorithm by using the improved particle optimization weight factor, wherein the position update mathematical model includes the global search phase position mathematical model and the local convergence position update mathematical model of the special theory of relativity search algorithm; Among them, the improved mathematical model of the global search stage position is: In formula (5), X i,j(t+1) is the position of the j-th dimension of the ith particle in the t+1th iteration, β ipυ is the improved particle optimization weight factor, is the coordinate value of the i-th particle in the t-th iteration; is the velocity of the i-th particle in the t-th iteration, i.e., the velocity of the particle in the previous iteration; Among them, the improved mathematical model of the local convergence stage position is: In formula (6), X i,j (t+1) is the position of the jth dimension of the ith particle in the t+1th iteration, X i,j (t) is the position of the jth dimension of the ith particle in the tth iteration, that is, the current position of the particle, X best is the global optimal particle position, Leυy(D) is the Levy distribution function, D is the problem dimension, is the average position of the particle population at the tth iteration, is the optimal particle position at the tth iteration, R i,best for and The Euler distance of .
6. The method for optimizing power marketing risk prediction according to claim 5, characterized in that: The principle of special relativity is simulated to establish the position update mathematical model of the improved special relativity algorithm. The specific method is as follows: S451, using the Euclidean norm, the distance R between the coordinates of the current i-th particle and the coordinates of a random particle c in the magnetic field is determined i,a (t), establish a mathematical model according to formula (9); In formula (9), is the coordinate value of the ith particle in the tth iteration, is the coordinate value of the cth particle at the tth iteration; S452, calculating the charges of the current i-th particle and a random particle c in the magnetic field, and establishing a mathematical model according to formula (10); In formula (10), Q i (t) is the charge value of the ith particle, Q c (t) is the charge value of the cth particle, is the fitness value of the position of the i-th particle in the t-th iteration, is the maximum fitness value of the particle position in the tth iteration, is the minimum fitness value of the particle position in the tth iteration; is the fitness value of the cth particle position in the tth iteration; S453, simulating and calculating the movement speed of particles in the magnetic field, and establishing a mathematical model according to formula (11); In formula (11), is the velocity of the ith particle at the tth iteration, is the velocity of the cth particle in the tth iteration, μ is the magnetic permeability coefficient, m is the mass of the particle, r i,j is the separation distance between the ith particle and particle c; S454, simulating the calculation of the frequency of the cyclotron accelerator through the magnetic field B, the particle charge and the particle mass, and establishing a mathematical model according to formula (12); In formula (12), w is the frequency of the cyclotron; S455, based on the calculation of particle coordinates in special relativity, using v = w·R i,c , according to formula (13), a mathematical model for updating particle coordinates is established; In formula (13), is the coordinate value of the ith particle in the tth iteration, is the coordinate value of the i-th particle in the t-1th iteration; S456, using formula (9) to formula (13) to design a particle position update mathematical model in the global search phase, introducing a "relative convergence" strategy model as a particle position update mathematical model in the local convergence phase, and establishing an improved particle position update mathematical model according to formula (14); 7. A method for optimizing power marketing risk prediction according to any one of claims 1 to 6, characterized in that: The step S4 uses the improved special relativity algorithm to adjust the number of hidden layer nodes s and the initial learning rate α parameter of the LSTM model, and the specific steps are: S41, encoding the number of hidden layer nodes s and the initial learning rate α parameter of the LSTM model for power marketing risk prediction into a space vector solution set, and mapping the space vector solution set to the particle position of the improved special relativity algorithm through real number encoding; S42. Initialize the parameters of the improved special relativity algorithm, including: the maximum size of the particle population N, the maximum number of iterations T max , the problem dimension D, the upper bound ub and lower bound lb of the particle position, and the maximum value β of the particle optimization weight factor max and the minimum value β min ; S43, initial stage, current iteration number t = 0, use formula (7) to randomly initialize the current position X of N particles i,j (t); X i,j (t)=lb+rand×(ub-lb) (7); In formula (7), rand is a random number ranging from 0 to 1; S44, the current iteration number t executes t=t+1, and the current iteration number t and the maximum iteration number T are determined. max , if t is less than T max If yes, execute S45 to S46, otherwise execute S47; S45, simulating the principle of special theory of relativity to establish a position updating mathematical model of an improved special theory of relativity algorithm, and updating the particle position of the improved special theory of relativity algorithm through the position updating mathematical model; S46, using the fitness function f of formula (8) to calculate the fitness value of the individual particle position, and retaining the individual particle position with the smallest fitness value of the current iteration; In formula (8), n is the number of test set data samples, y p is the true value of the p-th validation set sample, is the predicted value of the pth validation set sample; S47. The individual particle position corresponding to the global minimum fitness value is resolved into the number of hidden layer nodes n and the initial learning rate α parameter value of the LSTM model for power marketing risk prediction, and the prediction parameter value of the optimal LSTM model is obtained.
Citation Information
Patent Citations
Foggy day image enhancing method based on APSO-BP coupling algorithm
CN104915933A
Long and short term attention circulation network recommendation method
CN115525835A
Underground water monitoring network optimization method for improving quantum particle swarm
CN117574779A
Artificial intelligence based system and method to diagnose parkinson’s disease
IN201941024901A
Data input processing
WO2023105262A1
