A short-term prediction method and prediction system for top oil temperature of distribution transformer
Through the improved sparrow optimization algorithm and the double-layer LSTM model, the problem of low oil temperature prediction accuracy of the top layer of the distribution transformer is solved, and efficient and robust oil temperature prediction is achieved, avoiding damage caused by temperature exceeding the limit and power grid outage.
Patent Information
- Application Number
- CN202111415692.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-11-25
- Publication Date
- 2024-11-26
- Estimated Expiration
- 2041-11-25
AI Technical Summary
The existing distribution transformer top-level oil temperature prediction model has low prediction accuracy, time-consuming and labor-intensive calculation, and cannot guarantee the best prediction effect, and cannot effectively prevent damage caused by temperature exceeding the limit and power grid power outages.
The improved sparrow optimization algorithm (ISSA) combined with the two-layer LSTM model is used to generate the initial sparrow population through a one-dimensional composite chaotic mapping model, and the hyperparameters are optimized using reverse learning strategies to improve prediction accuracy and model robustness.
The accuracy of oil temperature prediction of the top layer of the distribution transformer is improved, the time-consuming and labor-intensive artificial parameter adjustment is reduced, the robustness of the model is enhanced, and the prediction effect is optimized.
Smart Images

Figure CN114065649B_ABST
Abstract
Description
Technical Field
[0001] The present invention mainly relates to the technical field of substations, and in particular to a short-term prediction method and prediction system for the top layer oil temperature of a distribution transformer. Background Art
[0002] With the development of electric power technology, the safe and stable operation of power transformers is a necessary condition to ensure the reliability and economy of modern power system operation. The insulation damage and service life reduction caused by the transformer temperature exceeding the limit are one of the important factors affecting the load capacity of power transformers. Therefore, monitoring the internal temperature of power transformers is an effective method to judge the real-time operating status of transformers. The hot spot temperature and top oil temperature of transformer windings are important indicators to measure the internal thermal state of transformers. Due to the immature development of measurement technology, the hot spot temperature is often calculated by the top oil temperature of transformers in actual engineering at this stage, or the thermal state of transformers is directly obtained by monitoring the top oil temperature of transformers in real time. How to prevent transformer damage or even power outages caused by temperature exceeding the limit depends on the accurate prediction of the top oil temperature of transformers.
[0003] Considering that most of the measures to prevent transformer damage due to temperature exceeding the limit are based on the high prediction accuracy of the transformer top oil temperature, ensuring the accuracy of transformer top oil temperature prediction and improving the robustness of the prediction model are the core of transformer operation status monitoring and risk control. However, in the existing distribution transformer top oil temperature prediction model, the prediction model based on the finite volume method and the finite element method requires the support of various static and physical indicator data of the transformer and is time-consuming to calculate; the differential equation prediction model based on the improved thermal circuit model is too idealized and cannot guarantee the prediction accuracy; the hyperparameter adjustment in the data-driven machine learning prediction model is time-consuming and labor-intensive, and cannot guarantee the optimal prediction effect. Summary of the invention
[0004] The technical problem to be solved by the present invention is: in view of the technical problems existing in the prior art, the present invention provides a short-term prediction method for the top layer oil temperature of a distribution transformer with high prediction accuracy.
[0005] In order to solve the above technical problems, the technical solution proposed by the present invention is:
[0006] A short-term prediction method for top oil temperature of a distribution transformer comprises the steps of:
[0007] S1. Obtain historical data of top oil temperature of distribution transformers, process them into time series data, and select a certain proportion as training data;
[0008] S2, initializing various parameters in the ISSA algorithm, the parameters including one or more of the sparrow population m, the sparrow location dimension n, the discoverer ratio PD, the scout ratio SD, the maximum number of iterations N or the warning threshold ST;
[0009] S3, input the number of sparrow population m and the dimension of sparrow position n into the one-dimensional composite chaotic mapping model SPM to generate the initial sparrow population of ISSA algorithm, the total number of sparrows in the population is m, and the dimension of the position of each sparrow is n;
[0010] S4, respectively substitute the hyperparameter value representing the position of each sparrow into the double-layer LSTM model, combine the training data divided in step S1, train the double-layer LSTM model after normalization, use the mean square error between the predicted value and the true value output by the network as the fitness function, calculate the fitness value of each sparrow and sort them;
[0011] S5. Determine the discoverer, follower and scout based on the fitness ranking of the sparrow population in step S4 and the proportion of discoverers determined in step S2, and update their positions;
[0012] S6, combining the fitness ranking of the sparrow population in step S4, selecting the sparrow ranked first as the best position, and updating the position of the best sparrow according to the reverse learning strategy;
[0013] S7, determine whether the iteration end requirement is met, if so, output the hyperparameters represented by the optimal sparrow and proceed to the next step, otherwise return to step S4;
[0014] S8. Combining the hyperparameters outputted in step S7 with the double-layer LSTM model, the normalized time series data of the top layer oil temperature of the distribution transformer is input into the model to obtain the prediction result of the top layer oil temperature.
[0015] As a further improvement of the above scheme, in step S1, the training data needs to appear in the form of a time series, that is, the input data itself, the output data and the output data need to have a continuous relationship in time; based on this, the samples obtained after processing the data are:
[0016]
[0017]
[0018]
[0019] Among them, A is the total sample set, Train is the training set sample, Test is the test set sample, A i is the i-th sample including the historical data of the top oil temperature of the distribution transformer and the corresponding historical data of its influencing factors, a i is the label of the i-th sample, i.e. the predicted top oil temperature value of the distribution transformer, Num total is the total number of samples, Num train is the number of samples in the training set.
[0020] As a further improvement of the above scheme, the specific steps of step S2 are:
[0021] S2-1, determine the population size m according to the prediction accuracy of the top oil temperature and the model operation speed;
[0022] S2-2. Determine the individual position dimension n in the population according to the number of hyperparameters to be optimized. Combined with the population size m, the sparrow population expression is as follows:
[0023]
[0024] Among them, X represents the entire population, x m represents the mth sparrow in the population, x mn represents the n-th dimension position of the m-th sparrow in the population;
[0025] The fitness expression of the sparrow population is as follows:
[0026]
[0027] Among them, F(X) represents the population fitness matrix, and f is the fitness function;
[0028] S2-3. According to the population size and experience, determine the discoverer ratio PD, the scout ratio SD, the maximum number of iterations N, the warning threshold ST, the upper position limit a and the lower position limit b, where PD∈(0,1), SD∈(0,1), ST∈(0.5,1), a∈(0,1), b∈(0,1) and a>b.
[0029] As a further improvement of the above scheme, the specific steps of step S3 are:
[0030] S3-1. From step S2-2, we know that the number of hyperparameters that need to be optimized is equal to the individual position dimension n of the population. After considering the order of magnitude of each hyperparameter, the hyperparameter boundary vector is set as follows:
[0031] LB=[lb1,lb2,…,lb n ] (6)
[0032] UB=[ub1,ub2,…,ub n ] (7)
[0033] Among them, LB is the lower bound vector of the hyperparameter, UB is the upper bound vector of the hyperparameter, and lb x is the lower bound of the xth hyperparameter to be optimized, ub x is the upper bound of the xth hyperparameter to be optimized;
[0034] S3-2. Use the Rand function to randomly generate the position of each dimension of the first individual in the sparrow population The formula is as follows:
[0035]
[0036] Among them, x 11 ,x 12 ,…,x 1n ∈[0,1];
[0037] The position parameters of the first individual are input into the one-dimensional compound chaotic mapping model SPM to generate the position parameters of the second sparrow individual. This is repeated m-1 times to obtain the initial population of sparrows with chaotic properties. The expression of the one-dimensional compound chaotic mapping model SPM is as follows:
[0038]
[0039] in, Based on the point in the chaotic sequence generation process When the next point is generated, α∈(0,1), β∈(0,1), the model can generate a chaotic sequence, δ∈(0,0.5), which is the disturbance variable, and Mod is the remainder function, that is, if Then Mod(a,b)=d, f1 is the generating function of the next point with the previous point and parameter as variables in the SPM chaotic sequence generation process;
[0040] This can generate a normalized initial population of sparrows:
[0041]
[0042] S3-3. Combining the upper and lower bounds of the hyperparameters set in step S3-1 with the normalized initial population positions generated in step S3-2, the denormalized initial population position matrix is obtained using the following formula:
[0043]
[0044] Among them, E m×1 is an m×1 unit vector;
[0045] S3-4. Set the current population position matrix to the normalized population initial matrix
[0046] As a further improvement of the above solution, the specific steps of step S4 are:
[0047] S4-1. In order to reduce the impact of frequent or large changes in time series data on the training model, the time series data is normalized as follows:
[0048] y′=(yy min ) / (y max -y min ) (12)
[0049] Among them, y is the original value of the data, y max is the maximum value in the data, y min is the minimum value in the data, y ′ is the normalized value;
[0050] S4-2, denormalize the current position matrix according to formula (11), apply the hyperparameters represented by it to the two-layer LSTM model respectively, and train the model with the normalized data obtained in step S4-1, and calculate the fitness value of each sparrow with the mean square error between the predicted value and the true value output by the network as the fitness function, as shown in the following formula:
[0051]
[0052] Among them, Y i Indicates the fitness value of the i-th sparrow individual, Num train represents the data volume in the top oil temperature training data of the distribution transformer, is the predicted value of the jth top oil temperature data in the data, y j is the true value of the jth top oil temperature data in the data;
[0053] S4-3. According to the fitness values of the individual sparrows calculated in step S4-2, the individual sparrows are sorted according to the fitness values.
[0054] As a further improvement of the above solution, the specific steps of step S5 are:
[0055] S5-1, according to the fitness ranking in step S4-3, select the sparrow with the highest ranking as the discoverer according to the proportion PD, and the remaining sparrows as followers;
[0056] S5-2, combining the alert threshold selected in step S2-3, and updating the position of the discoverer according to formulas (14)-(15), the formulas are as follows:
[0057]
[0058]
[0059] Where t is the current iteration number, is the j-th dimension position of the t-th generation sparrow whose fitness value is ranked i, is the j-th dimension position of the t+1th generation sparrow whose fitness value is ranked as i, R2 is a uniform random number and R2∈[0,1], Q is a random number that obeys the standard normal distribution, ω is the dynamic adaptation weight, and N is the maximum number of iterations;
[0060] S5-3, combining the results of sorting the individual fitness values of the current population in step S4-3, and updating the position of the follower according to formula (16):
[0061]
[0062] Among them, rand{-1,1} is a uniform random number between [-1,1]. is the j-th dimension position of the sparrow with the highest fitness value in the t-generation population;
[0063] S5-4, according to the proportion of scouts determined in step S2-3, selecting individuals in the proportion from all individuals including discoverers and followers as scouts;
[0064] S5-5: Based on the current population position, update the scout's position according to formula (17):
[0065]
[0066] Where η is a random number that obeys a standard normal distribution, K and ε are random numbers that obey a uniform distribution, and K∈[-1,1], ε∈[0,0.05], f i is the fitness value of the current sparrow individual, f b With f w are the fitness values of the sparrow individuals in the best and worst positions respectively;
[0067] S5-6, check whether the position of each dimension exceeds the limit. Then let x ij =a; if Then let x ij =b.
[0068] As a further improvement of the above solution, the specific steps of step S6 are:
[0069] S6-1, select the position p of the sparrow individual with the highest fitness value determined in step S4-3 = (x1, x2, ... x n ), define the reverse position p of the sparrow individual * for:
[0070] x * =a+bx,x∈[a,b] (18)
[0071]
[0072] Among them, a and b are the upper and lower bounds of the position of each dimension respectively;
[0073] S6-2. Consider the reverse position of the individual sparrow in the optimal position and reselect the optimal position of the population. The formula is as follows:
[0074]
[0075] S6-3, updating the current position matrix to the position matrix after the position is updated in step S6-2.
[0076] The present invention also discloses a short-term prediction system for top oil temperature of a distribution transformer, comprising:
[0077] The first program module is used to obtain the historical data of the top oil temperature of the distribution transformer, process it into time series data, and select a certain proportion as training data;
[0078] The second program module is used to initialize various parameters in the ISSA algorithm, the parameters including one or more of the number of sparrow population m, the sparrow location dimension n, the proportion of discoverers PD, the proportion of scouts SD, the maximum number of iterations N or the warning threshold ST;
[0079] The third program module is used to input the number of sparrow population m and the dimension of sparrow position n into the one-dimensional composite chaotic mapping model SPM to generate an initial sparrow population of the ISSA algorithm, the total number of sparrows in the population is m, and the dimension of the position of each sparrow is n;
[0080] The fourth program module is used to substitute the hyperparameter value representing the position of each sparrow into the double-layer LSTM model, combine the training data divided in the first program module, train the double-layer LSTM model after normalization, use the mean square error between the predicted value and the true value output by the network as the fitness function, calculate the fitness value of each sparrow and sort them;
[0081] A fifth program module is used to determine the discoverer, follower and scout, and update their positions by combining the sparrow population fitness ranking in the fourth program module with the discoverer ratio determined in the second program module;
[0082] The sixth program module is used to select the sparrow with the first ranking as the best position according to the fitness ranking of the sparrow population in the fourth program module, and update the position of the best sparrow according to the reverse learning strategy;
[0083] The seventh program module is used to determine whether the iteration end requirement is met. If so, the hyperparameter represented by the optimal sparrow is output and the next step is performed, otherwise, the fourth program module is returned;
[0084] The eighth program module is used to combine the hyperparameters output by the seventh program module with the double-layer LSTM model, input the normalized time series data of the top oil temperature of the distribution transformer into the model, and obtain the prediction result of the top oil temperature.
[0085] The present invention further discloses a computer-readable storage medium having a computer program stored thereon. When the computer program is executed by a processor, the steps of the method for short-term prediction of top layer oil temperature of a distribution transformer as described above are executed.
[0086] The present invention also discloses a computer device, including a memory and a processor, wherein the memory stores a computer program, and when the computer program is run by the processor, the steps of the short-term prediction method for the top layer oil temperature of the distribution transformer are executed.
[0087] Compared with the prior art, the advantages of the present invention are:
[0088] The short-term prediction method for the top oil temperature of the distribution transformer of the present invention first changes the position update strategy of any individual in the iterative process of the traditional sparrow algorithm, and integrates the reverse learning strategy and the greedy algorithm idea to form an improved sparrow optimization algorithm; secondly, the improved sparrow optimization algorithm ISSA is used to optimize the hyperparameters such as the number of first-layer nodes, the number of second-layer nodes, the learning rate and the number of iterations in the double-layer LSTM model; finally, the top oil temperature of the distribution transformer is predicted according to the established ISSA-LSTM model. The present invention establishes a method for predicting the top oil temperature of the distribution transformer combining the improved sparrow optimization algorithm and LSTM, and optimizes the hyperparameters in the LSTM model by using the improved sparrow optimization algorithm, thereby overcoming the time-consuming and labor-intensive problem of manual parameter adjustment in the traditional machine learning model, improving the accuracy of oil temperature prediction, avoiding the problem of unsatisfactory prediction effect caused by blind artificial parameter adjustment, and also improving the robustness of the model. BRIEF DESCRIPTION OF THE DRAWINGS
[0089] Figure 1 The flowchart of the prediction method of the present invention in an embodiment.
[0090] Figure 2 This is a framework diagram of the ISSA-LSTM model of the present invention in an embodiment.
[0091] Figure 3 Schematic diagram of chaotic sequence generated based on one-dimensional composite chaotic mapping model SPM in the method of the present invention.
[0092] Figure 4 It is a curve diagram of the optimization iteration process of the improved sparrow optimization algorithm ISSA and the traditional sparrow optimization algorithm SSA for the optimal solution close to the origin objective function in the method of the present invention.
[0093] Figure 5 It is a comparison diagram of the predicted curve and the actual curve of each prediction model in the present invention.
[0094] Figure 6 It is a point-by-point error curve diagram of the prediction curve of each prediction model in the present invention.
[0095] Figure 7 It is a performance diagram of the prediction curve of each prediction model in the present invention within the 95% confidence region of the true curve. DETAILED DESCRIPTION
[0096] The present invention is further described below in conjunction with the accompanying drawings and specific embodiments.
[0097] like Figure 1 As shown, the short-term prediction method for the top layer oil temperature of the distribution transformer according to the embodiment of the present invention is specifically implemented in the following steps:
[0098] S1: First, select a distribution transformer of a specific model and type in a certain area, install a top oil temperature sensor on it, collect historical data of the top oil temperature of the distribution transformer, process it into time series data, and select a certain proportion as training data;
[0099] S2: Initialize various parameters in the ISSA algorithm, including the number of sparrow population m, the sparrow location dimension n, the proportion of discoverers PD, the proportion of scouts SD, the maximum number of iterations N, and the warning threshold ST;
[0100] S3: Input the number of sparrow population m and the dimension of sparrow position n into the one-dimensional composite chaotic mapping model SPM to generate the initial sparrow population of the ISSA algorithm. The total number of sparrows in the population is m, and the dimension of the position of each sparrow is n;
[0101] S4: Substitute the hyperparameter value representing the position of each sparrow into the double-layer LSTM model respectively, combine the training data divided in step S1, and train the double-layer LSTM model after normalization. The training uses the mean square error between the predicted value and the true value output by the network as the fitness function, calculates the fitness value of each sparrow and sorts them;
[0102] S5: combining the fitness ranking of the sparrow population in step S4 with the proportion of discoverers determined in step S2, determining the discoverer, follower and scout, and updating their positions;
[0103] S6: Combined with the fitness ranking of the sparrow population in step S4, the sparrow ranked first is selected as the sparrow with the best position, and the position of the best sparrow is updated according to the reverse learning strategy;
[0104] S7: Determine whether the iteration end requirement is met, if so, output the hyperparameters represented by the optimal sparrow and proceed to the next step, otherwise return to step S4;
[0105] S8: Combining the hyperparameters outputted in step S7 with the double-layer LSTM model, the normalized time series data of the top oil temperature of the distribution transformer is input into the model to obtain the prediction result of the top oil temperature.
[0106] The short-term prediction method for the top oil temperature of the distribution transformer of the present invention first changes the position update strategy of any individual in the iterative process of the traditional sparrow algorithm, and integrates the reverse learning strategy and the greedy algorithm idea to form an improved sparrow optimization algorithm; secondly, the improved sparrow optimization algorithm ISSA is used to optimize the hyperparameters such as the number of first-layer nodes, the number of second-layer nodes, the learning rate and the number of iterations in the double-layer LSTM model; finally, the top oil temperature of the distribution transformer is predicted according to the established ISSA-LSTM model. The present invention establishes a method for predicting the top oil temperature of the distribution transformer combining the improved sparrow optimization algorithm and LSTM, and optimizes the hyperparameters in the LSTM model by using the improved sparrow optimization algorithm, thereby overcoming the time-consuming and labor-intensive problem of manual parameter adjustment in the traditional machine learning model, improving the accuracy of oil temperature prediction, avoiding the problem of unsatisfactory prediction effect caused by blind artificial parameter adjustment, and also improving the robustness of the model.
[0107] In a specific embodiment, the specific description of step S1 is as follows:
[0108] According to the basic idea of machine learning, the output result of the prediction model depends largely on the data used to train the model. Therefore, a distribution transformer from a certain type or model can only be used to train a model to predict the top oil temperature of the distribution transformer of that type or model.
[0109] Considering that the changing trend and amplitude of the oil temperature at the top of the distribution transformer may vary due to the interference of factors such as season and weather, the robustness of the model prediction needs to be based on training data that includes various weather and seasons as well as other factors that affect the oil temperature.
[0110] In addition, based on the above requirements for training data, the training data must appear in the form of a time series, that is, the input data itself, the output data and the output data must have a continuous relationship in time. Based on this, the samples obtained after processing the data are:
[0111]
[0112]
[0113]
[0114] Among them, A is the total sample set, Train is the training set sample, Test is the test set sample, A iis the i-th sample including the historical data of the top oil temperature of the distribution transformer and the corresponding historical data of its influencing factors, a i is the label of the i-th sample, i.e. the predicted top oil temperature value of the distribution transformer, Num total is the total number of samples, Num train is the number of samples in the training set.
[0115] In addition, the ratio of training data to test data should not be too high or too low. Too little training data may lead to insufficient model training, while too much training data may lead to too little test data, resulting in the test effect being insufficient to characterize the prediction effect of the model.
[0116] In a specific embodiment, the specific steps and description of step S2 are as follows:
[0117] Step S2-1: Determine the number of populations m according to the prediction accuracy of the top oil temperature and the model operation speed, wherein the more populations there are, the stronger the optimization ability of the ISSA algorithm will be, but the algorithm operation speed will be correspondingly reduced;
[0118] Step S2-2: Determine the individual position dimension n in the population according to the number of hyperparameters to be optimized. Combined with the population size m, the sparrow population expression is as follows:
[0119]
[0120] Among them, X represents the entire population, x m represents the mth sparrow in the population, x mn represents the n-th dimension position of the m-th sparrow in the population;
[0121] The fitness expression of the sparrow population is as follows:
[0122]
[0123] Among them, F(X) represents the population fitness matrix, and f is the fitness function;
[0124] Step S2-3: According to the population size and experience, determine the discoverer ratio PD, the scout ratio SD, the maximum number of iterations N and the warning threshold ST, the upper limit a of the position, and the lower limit b of the position, where PD∈(0,1), SD∈(0,1), ST∈(0.5,1), a∈(0,1), b∈(0,1) and a>b.
[0125] Step S2 mainly determines the size of the algorithm population and the parameters in the algorithm based on the data volume and the algorithm running speed requirements.
[0126] In a specific embodiment, the specific steps of step S3 are as follows:
[0127] Step S3-1: From step S2-2, we know that the number of hyperparameters that need to be optimized is equal to the individual position dimension n of the population. After considering the order of magnitude of each hyperparameter, the hyperparameter boundary vector is set as follows:
[0128] LB=[lb1,lb2,…,lb n ] (6)
[0129] UB=[ub1,ub2,…,ub n ] (7)
[0130] Among them, LB is the lower bound vector of the hyperparameter, UB is the upper bound vector of the hyperparameter, and lb x is the lower bound of the xth hyperparameter to be optimized, ub x is the upper bound of the xth hyperparameter to be optimized;
[0131] Step S3-2: Use the Rand function to randomly generate the position of each dimension of the first individual in the sparrow population The formula is as follows:
[0132]
[0133] Among them, x 11 ,x 12 ,…,x 1n ∈[0,1].
[0134] The position parameters of the first individual are input into the one-dimensional compound chaotic mapping model SPM to generate the position parameters of the second sparrow individual. This is repeated m-1 times to obtain the initial population of sparrows with chaotic properties. The expression of the one-dimensional compound chaotic mapping model SPM is as follows:
[0135]
[0136] in, Based on the point in the chaotic sequence generation process When the next point is generated, α∈(0,1), β∈(0,1), the model can generate a chaotic sequence, δ∈(0,0.5), which is the disturbance variable, and Mod is the remainder function, that is, if Then Mod(a,b)=d, and f1 is the generating function of the next point with the previous point and parameters as variables in the SPM chaotic sequence generating process. Figure 3 Taking the two-dimensional position as an example, after 100 iterations, the obtained point series are uniform in the two-dimensional space, proving that this method can generate a sequence with chaotic properties and meet the algorithm's requirements for the initial population.
[0137] This can generate a normalized initial population of sparrows:
[0138]
[0139] Step S3-3: Combining the upper and lower bounds of the hyperparameters set in step S3-1 with the normalized initial population positions generated in step S3-2, the denormalized initial population position matrix is obtained using the following formula:
[0140]
[0141] Among them, E m×1 is an m×1 unit vector.
[0142] Specifically, the present invention uses the ISSA algorithm to optimize the number of first-layer network nodes, the number of second-layer network nodes, the learning rate and the number of training times in the double-layer LSTM model, so n=4 is taken.
[0143] Step S3-4: Set the current population position matrix to the normalized population initial matrix
[0144] In step S3, based on the size of the population, a one-dimensional composite chaotic mapping model SPM is used to generate an initial algorithm population with chaotic properties.
[0145] In a specific embodiment, the specific steps of step S4 are as follows:
[0146] Step S4-1: In order to reduce the impact of frequent or large changes in time series data on the training model, the time series data is normalized according to the following formula:
[0147] y′=(yy min ) / (y max -y min ) (12)
[0148] Among them, y is the original value of the data, y max is the maximum value in the data, y min is the minimum value in the data, y ′ is the normalized value.
[0149] Step S4-2: Denormalize the current position matrix according to formula (11), apply the hyperparameters represented by it to the two-layer LSTM model respectively, and train the model with the normalized data obtained in step S4-1. The fitness value of each sparrow is calculated with the mean square error between the predicted value and the true value output by the network as the fitness function, as shown in the following formula:
[0150]
[0151] Among them, Y i Indicates the fitness value of the i-th sparrow individual, Num trainrepresents the data volume in the top oil temperature training data of the distribution transformer, is the predicted value of the jth top oil temperature data in the data, y j is the true value of the jth top oil temperature data in the data.
[0152] Step S4-3: According to the fitness value of each sparrow individual calculated in step S4-2, the sparrow individuals are sorted according to the fitness value.
[0153] In a specific embodiment, the specific steps of step S5 are as follows:
[0154] Step S5-1: According to the fitness ranking in step S4-3, select the sparrow with the highest ranking as the discoverer according to the proportion PD, and the remaining sparrows as followers;
[0155] Step S5-2: Combined with the warning threshold selected in step S2-3, the location of the discoverer is updated according to formulas (14)-(15), which are as follows:
[0156]
[0157]
[0158] Where t is the current iteration number, is the j-th dimension position of the t-th generation sparrow whose fitness value is ranked i, is the j-th dimension position of the t+1th generation sparrow whose fitness value is ranked as i, R2 is a uniform random number and R2∈[0,1], Q is a random number that obeys the standard normal distribution, ω is the dynamic adaptation weight, and N is the maximum number of iterations.
[0159] Step S5-3: Combine the results of the ranking of the individual fitness values of the current population in step S4-3, and update the position of the follower according to formula (16):
[0160]
[0161] Among them, rand{-1,1} is a uniform random number between [-1,1]. is the j-th dimension position of the sparrow with the highest fitness value in the t-generation population.
[0162] Step S5-4: According to the scout ratio determined in step S2-3, individuals of the ratio are selected as scouts from among all individuals including discoverers and followers.
[0163] Step S5-5: Based on the current population position, update the scout's position according to formula (17):
[0164]
[0165] Where η is a random number that obeys a standard normal distribution, K and ε are random numbers that obey a uniform distribution, and K∈[-1,1], ε∈[0,0.05], f i is the fitness value of the current sparrow individual, f b With f w are the fitness values of the sparrow individuals in the best and worst positions respectively.
[0166] Step S5-6: Check whether the position of each dimension exceeds the limit. If the position Then let x ij =a; if Then let x ij =b.
[0167] In a specific embodiment, the specific steps of step S6 are:
[0168] Step S6-1: Select the position p of the sparrow individual with the highest fitness value determined in step S4-3 = (x1, x2, ... x n ), define the reverse position p of the sparrow individual * for:
[0169] x * =a+bx,x∈[a,b] (18)
[0170]
[0171] Among them, a and b are the upper and lower bounds of the position of each dimension respectively.
[0172] Step S6-2: Considering the reverse position of the individual sparrow in the optimal position, reselect the optimal position of the population, and the formula is as follows:
[0173]
[0174] The specific explanation of formula (20) is as follows:
[0175] It can be seen from equations (14)-(17) that the speed at which the algorithm approaches the global optimal solution during the iteration process is affected by the optimal individual in the current population. In order to avoid the optimal individual being too far away from the global optimal solution due to poor initial value selection in the early stage of the iteration, thereby affecting the convergence speed of the algorithm, the greedy algorithm simultaneously searches for the reverse position of the optimal individual, thereby ensuring the correctness of the algorithm's search direction for the global optimal solution.
[0176] Step S6-3: Update the current position matrix to the position matrix after the position is updated in step S6-2.
[0177] The above steps S5-S6 are the process of optimizing the double-layer LSTM hyperparameters by the ISSA algorithm. In order to fully verify the advantages of the improved sparrow optimization algorithm over the traditional sparrow algorithm, the following experimental simulation is performed:
[0178] The optimization objective function is: minf2(z)=(z1-50) 2 +(z2-50) 2 (twenty one)
[0179] Among them, f2 is the objective function, z is the variable vector, and z1 and z2 are variables.
[0180] The parameters in the algorithm are shown in the following table:
[0181]
[0182] The optimization process of the traditional sparrow optimization algorithm SSA and the improved sparrow optimization algorithm ISSA for formula (21) is compared as follows: Figure 4 shown.
[0183] The initial population generated by the one-dimensional composite chaotic mapping model SPM is evenly distributed in the global range, which enables the improved sparrow optimization algorithm ISSA to obtain a more ideal solution before the algorithm starts to iterate. In addition, the improved sparrow optimization algorithm ISSA has better jump search ability and a wider search range, so it can approach the global optimal solution faster than the SSA algorithm in the middle and late stages of the iteration.
[0184] The effectiveness of the present invention is described below with reference to a practical case:
[0185] Figure 5 The example given is a comparison chart of the predicted curve and actual curve of the oil temperature of a distribution transformer in Jiangxi. The predicted curve includes the traditional LSTM model without fusion optimization algorithm, the double-layer LSTM model after the hyperparameters are optimized by the traditional sparrow optimization algorithm SSA, and the double-layer LSTM model after the hyperparameters are optimized by the improved sparrow optimization algorithm ISSA. Figure 6 It is a point-by-point error comparison chart of the prediction results of each model.
[0186] Combination Figure 5 and Figure 6 The results show that the ISSA-LSTM prediction model proposed in the present invention has a better fitting effect and a smaller point-by-point error for the real curve than the other two traditional methods, which reflects the effectiveness of the present invention.
[0187] In order to compare and evaluate the prediction effects of the three prediction models numerically, the following indicators are established:
[0188]
[0189]
[0190]
[0191]
[0192] Among them, RMSE is the root mean square error, MAE is the mean absolute error, MAPE is the mean absolute percentage error, R 2 is the coefficient of determination, Num test is the amount of test set data, y i is the true value, is the predicted value, is the data average.
[0193] Obviously, the smaller the RMSE, MAE, and MAPE, the smaller the error between the predicted value and the true value, and the higher the prediction accuracy; 2 The closer it is to 1, the better the fit between the predicted curve and the true curve.
[0194] The prediction indicators of the above prediction model are shown in the following table:
[0195]
[0196] It can be seen from the data in the table that ISSA-LSTM has the best prediction effect, SSA-LSTM is second, and LSTM has the worst prediction effect.
[0197] Figure 7 The figure shows the performance of the prediction curves of the above three prediction models in the 95% confidence region of the true curve. Obviously, some prediction curves of the traditional LSTM model and the SSA-LSTM model are outside the 95% confidence region of the true curve, which is not allowed in engineering. The prediction curve of the ISSA-LSTM prediction model proposed in the present invention is completely within the 95% confidence region of the true curve, indicating that the model has better prediction accuracy.
[0198] Therefore, the present invention can ensure the prediction accuracy without obtaining various complex static and physical indicator data of the transformer, and has the ability of self-optimization and adjustment.
[0199] The present invention also discloses a short-term prediction system for top layer oil temperature of a distribution transformer, comprising:
[0200] The first program module is used to obtain the historical data of the top oil temperature of the distribution transformer, process it into time series data, and select a certain proportion as training data;
[0201] The second program module is used to initialize various parameters in the ISSA algorithm, the parameters including one or more of the number of sparrow population m, the sparrow location dimension n, the proportion of discoverers PD, the proportion of scouts SD, the maximum number of iterations N or the warning threshold ST;
[0202] The third program module is used to input the number of sparrow population m and the dimension of sparrow position n into the one-dimensional composite chaotic mapping model SPM to generate an initial sparrow population of the ISSA algorithm, the total number of sparrows in the population is m, and the dimension of the position of each sparrow is n;
[0203] The fourth program module is used to substitute the hyperparameter value representing the position of each sparrow into the double-layer LSTM model, combine the training data divided in the first program module, train the double-layer LSTM model after normalization, use the mean square error between the predicted value and the true value output by the network as the fitness function, calculate the fitness value of each sparrow and sort them;
[0204] A fifth program module is used to determine the discoverer, follower and scout, and update their positions by combining the sparrow population fitness ranking in the fourth program module with the discoverer ratio determined in the second program module;
[0205] The sixth program module is used to select the sparrow with the first ranking as the best position according to the fitness ranking of the sparrow population in the fourth program module, and update the position of the best sparrow according to the reverse learning strategy;
[0206] The seventh program module is used to determine whether the iteration end requirement is met. If so, the hyperparameter represented by the optimal sparrow is output and the next step is performed, otherwise, the fourth program module is returned;
[0207] The eighth program module is used to combine the hyperparameters output by the seventh program module with the double-layer LSTM model, input the normalized time series data of the top oil temperature of the distribution transformer into the model, and obtain the prediction result of the top oil temperature.
[0208] The short-term prediction system for the top oil temperature of a distribution transformer of the present invention corresponds to the above prediction method and also has the advantages described in the above prediction method.
[0209] The present invention further discloses a computer-readable storage medium, on which a computer program is stored, and when the computer program is executed by a processor, the steps of the short-term prediction method for the top oil temperature of the distribution transformer are executed as described above. The present invention also discloses a computer device, including a memory and a processor, on which a computer program is stored, and when the computer program is executed by the processor, the steps of the short-term prediction method for the top oil temperature of the distribution transformer are executed as described above. The present invention implements all or part of the processes in the above-mentioned embodiment method, and can also be completed by instructing related hardware through a computer program. The computer program can be stored in a computer-readable storage medium, and when the computer program is executed by the processor, the steps of each of the above-mentioned method embodiments can be implemented. Among them, the computer program includes computer program code, and the computer program code can be in source code form, object code form, executable file or some intermediate form, etc. The computer-readable medium can include: any entity or device capable of carrying computer program code, recording medium, U disk, mobile hard disk, magnetic disk, optical disk, computer memory, read-only memory (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory), electric carrier signal, telecommunication signal and software distribution medium, etc. The memory can be used to store computer programs and / or modules. The processor implements various functions by running or executing the computer programs and / or modules stored in the memory, and calling the data stored in the memory. The memory can include a high-speed random access memory, and can also include a non-volatile memory, such as a hard disk, a memory, a plug-in hard disk, a smart memory card (Smart Media Card, SMC), a secure digital (Secure Digital, SD) card, a flash card (Flash Card), at least one disk storage device, a flash memory device, or other volatile solid-state storage devices, etc.
[0210] The above are only preferred embodiments of the present invention, and the protection scope of the present invention is not limited to the above embodiments. All technical solutions under the concept of the present invention belong to the protection scope of the present invention. It should be pointed out that for ordinary technicians in this technical field, some improvements and modifications without departing from the principle of the present invention should be regarded as the protection scope of the present invention.
Claims
1. A short-term prediction method for top oil temperature of distribution transformer, characterized in that: Includes steps: S1. Obtain historical data of top oil temperature of distribution transformers, process them into time series data, and select a certain proportion as training data; S2, initializing various parameters in the ISSA algorithm, the parameters including one or more of the sparrow population m, the sparrow location dimension n, the discoverer ratio PD, the scout ratio SD, the maximum number of iterations N or the warning threshold ST; S3, input the number of sparrow population m and the dimension of sparrow position n into the one-dimensional composite chaotic mapping model SPM to generate the initial sparrow population of ISSA algorithm, the total number of sparrows in the population is m, and the dimension of the position of each sparrow is n; S4, respectively substitute the hyperparameter value representing the position of each sparrow into the double-layer LSTM model, combine the training data divided in step S1, train the double-layer LSTM model after normalization, use the mean square error between the predicted value and the true value output by the network as the fitness function, calculate the fitness value of each sparrow and sort them; S5. Determine the discoverer, follower and scout based on the fitness ranking of the sparrow population in step S4 and the proportion of discoverers determined in step S2, and update their positions; S6, combining the fitness ranking of the sparrow population in step S4, selecting the sparrow ranked first as the best position, and updating the position of the best sparrow according to the reverse learning strategy; S7, determine whether the iteration end requirement is met, if so, output the hyperparameters represented by the optimal sparrow and proceed to the next step, otherwise return to step S4; S8. Combining the hyperparameters outputted in step S7 with the double-layer LSTM model, the normalized time series data of the top layer oil temperature of the distribution transformer is input into the model to obtain the prediction result of the top layer oil temperature.
2. The short-term prediction method for top oil temperature of distribution transformer according to claim 1 is characterized in that: In step S1, the training data needs to appear in the form of a time series, that is, the input data itself, the output data and the output data need to have a continuous relationship in time; based on this, the samples obtained after processing the data are: Among them, A is the total sample set, Train is the training set sample, Test is the test set sample, A i is the i-th sample including the historical data of the top oil temperature of the distribution transformer and the corresponding historical data of its influencing factors, a i is the label of the i-th sample, i.e. the predicted top oil temperature value of the distribution transformer, Num total is the total number of samples, Num train is the number of samples in the training set.
3. The short-term prediction method for top oil temperature of distribution transformer according to claim 2 is characterized in that: The specific steps of step S2 are: S2-1, determine the population size m according to the prediction accuracy of the top oil temperature and the model operation speed; S2-2. Determine the individual position dimension n in the population according to the number of hyperparameters to be optimized. Combined with the population size m, the sparrow population expression is as follows: Among them, X represents the entire population, x m represents the mth sparrow in the population, x mn represents the n-th dimension position of the m-th sparrow in the population; The fitness expression of the sparrow population is as follows: Among them, F(X) represents the population fitness matrix, and f is the fitness function; S2-3. According to the population size and experience, determine the discoverer ratio PD, the scout ratio SD, the maximum number of iterations N, the warning threshold ST, the upper position limit a and the lower position limit b, where PD∈(0,1), SD∈(0,1), ST∈(0.5,1), a∈(0,1), b∈(0,1) and a>b.
4. The short-term prediction method for top oil temperature of distribution transformer according to claim 3 is characterized in that: The specific steps of step S3 are: S3-1. From step S2-2, we know that the number of hyperparameters that need to be optimized is equal to the individual position dimension n of the population. After considering the order of magnitude of each hyperparameter, the hyperparameter boundary vector is set as follows: LB=[lb1,lb2,…,lb n ] (6) UB=[ub1,ub2,…,ub n ] (7) Among them, LB is the lower bound vector of the hyperparameter, UB is the upper bound vector of the hyperparameter, and lb x is the lower bound of the xth hyperparameter to be optimized, ub x is the upper bound of the xth hyperparameter to be optimized; S3-2. Use the Rand function to randomly generate the position of each dimension of the first individual in the sparrow population The formula is as follows: Among them, x 11 , x 12 , …, x 1n ∈[0, 1]; The position parameters of the first individual are input into the one-dimensional compound chaotic mapping model SPM to generate the position parameters of the second sparrow individual. This is repeated m-1 times to obtain the initial population of sparrows with chaotic properties. The expression of the one-dimensional compound chaotic mapping model SPM is as follows: in, Based on the point in the chaotic sequence generation process When the next point is generated, α∈(0, 1), β∈(0, 1), the model can generate a chaotic sequence, δ∈(0, 0.5), which is the disturbance variable, and Mod is the remainder function, that is, if Then Mod(a, b) = d, f1 is the generating function of the next point with the previous point and parameter as variables in the SPM chaotic sequence generation process; This can generate a normalized initial population of sparrows: S3-3. Combining the upper and lower bounds of the hyperparameters set in step S3-1 with the normalized initial population positions generated in step S3-2, the denormalized initial population position matrix is obtained using the following formula: Among them, E m×1 is an m×1 unit vector; S3-4. Set the current population position matrix to the normalized population initial matrix 5. The short-term prediction method for top oil temperature of distribution transformer according to claim 4 is characterized in that: The specific steps of step S4 are: S4-1. In order to reduce the impact of frequent or large changes in time series data on the training model, the time series data is normalized as follows: y′=(yy min ) / (and max -and min ) (12) Among them, y is the original value of the data, y max is the maximum value in the data, y min is the minimum value in the data, and y′ is the normalized value; S4-2, denormalize the current position matrix according to formula (11), apply the hyperparameters represented by it to the two-layer LSTM model respectively, and train the model with the normalized data obtained in step S4-1, and calculate the fitness value of each sparrow with the mean square error between the predicted value and the true value output by the network as the fitness function, as shown in the following formula: Among them, Y i Indicates the fitness value of the i-th sparrow individual, Num train represents the data volume in the top oil temperature training data of the distribution transformer, is the predicted value of the jth top oil temperature data in the data, y j is the true value of the jth top oil temperature data in the data; S4-3. According to the fitness values of the individual sparrows calculated in step S4-2, the individual sparrows are sorted according to the fitness values.
6. The short-term prediction method for top oil temperature of distribution transformer according to claim 5 is characterized in that: The specific steps of step S5 are: S5-1, according to the fitness ranking in step S4-3, select the sparrow with the highest ranking as the discoverer according to the proportion PD, and the remaining sparrows as followers; S5-2, combining the alert threshold selected in step S2-3, and updating the position of the discoverer according to formulas (14)-(15), the formulas are as follows: Where t is the current iteration number, is the j-th dimension position of the t-th generation sparrow whose fitness value is ranked i, is the j-th dimension position of the t+1th generation sparrow whose fitness value is ranked as i, R2 is a uniform random number and R2∈[0,1], Q is a random number that obeys the standard normal distribution, ω is the dynamic adaptation weight, and N is the maximum number of iterations; S5-3, combining the results of sorting the individual fitness values of the current population in step S4-3, and updating the position of the follower according to formula (16): Among them, rand{-1, 1} is a uniform random number between [-1, 1]. is the j-th dimension position of the sparrow with the highest fitness value in the t-generation population; S5-4, according to the proportion of scouts determined in step S2-3, selecting individuals in the proportion from all individuals including discoverers and followers as scouts; S5-5: Based on the current population position, update the scout's position according to formula (17): Where η is a random number that obeys a standard normal distribution, K and ε are random numbers that obey a uniform distribution, and K∈[-1, 1], ε∈[0, 0.05], f i is the fitness value of the current sparrow individual, f b With f w are the fitness values of the sparrow individuals in the best and worst positions respectively; S5-6, check whether the position of each dimension exceeds the limit. Then let x ij =a; if Then let x ij =b.
7. The short-term prediction method for top layer oil temperature of distribution transformer according to claim 6 is characterized in that: The specific steps of step S6 are: S6-1, select the position p of the sparrow individual with the highest fitness value determined in step S4-3 = (x1, x2, ... x n ), define the reverse position p of the sparrow individual * for: x * =a+b-x,x∈[a,b] (18) Among them, a and b are the upper and lower bounds of the position of each dimension respectively; S6-2. Consider the reverse position of the individual sparrow in the optimal position and reselect the optimal position of the population. The formula is as follows: S6-3, updating the current position matrix to the position matrix after the position is updated in step S6-2.
8. A short-term prediction system for top oil temperature of distribution transformer, characterized in that: include: The first program module is used to obtain the historical data of the top oil temperature of the distribution transformer, process it into time series data, and select a certain proportion as training data; The second program module is used to initialize various parameters in the ISSA algorithm, the parameters including one or more of the number of sparrow population m, the sparrow location dimension n, the proportion of discoverers PD, the proportion of scouts SD, the maximum number of iterations N or the warning threshold ST; The third program module is used to input the number of sparrow population m and the dimension of sparrow position n into the one-dimensional composite chaotic mapping model SPM to generate an initial sparrow population of the ISSA algorithm, the total number of sparrows in the population is m, and the dimension of the position of each sparrow is n; The fourth program module is used to substitute the hyperparameter value representing the position of each sparrow into the double-layer LSTM model, combine the training data divided in the first program module, train the double-layer LSTM model after normalization, use the mean square error between the predicted value and the true value output by the network as the fitness function, calculate the fitness value of each sparrow and sort them; A fifth program module is used to determine the discoverer, follower and scout, and update their positions by combining the sparrow population fitness ranking in the fourth program module with the discoverer ratio determined in the second program module; The sixth program module is used to select the sparrow with the first ranking as the best position according to the fitness ranking of the sparrow population in the fourth program module, and update the position of the best sparrow according to the reverse learning strategy; The seventh program module is used to determine whether the iteration end requirement is met. If so, the hyperparameter represented by the optimal sparrow is output and the next step is performed, otherwise, the fourth program module is returned; The eighth program module is used to combine the hyperparameters output by the seventh program module with the double-layer LSTM model, input the normalized time series data of the top oil temperature of the distribution transformer into the model, and obtain the prediction result of the top oil temperature.
9. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the computer program executes the steps of the method for short-term prediction of top layer oil temperature of a distribution transformer as claimed in any one of claims 1 to 7.
10. A computer device comprising a memory and a processor, wherein a computer program is stored in the memory, wherein: When the computer program is executed by a processor, the computer program executes the steps of the method for short-term prediction of top layer oil temperature of a distribution transformer as claimed in any one of claims 1 to 7.
Citation Information
Patent Citations
Process parameter optimization method for abrasive belt grinding maching
CN113065630A
Ship motion attitude prediction method based on GRU optimized by sparrow search algorithm
CN113238666A
Short-term load prediction method for optimizing Elman neural network based on sparrow search algorithm
CN113689029A
