Method for stabilizing voltage quality of power grid through charging and discharging of new energy automobile

By constructing the GM-GRU prediction model and using the PSA algorithm, combining the battery status of new energy vehicles and the needs of car owners, the problem of the degradation of grid voltage quality after the new energy vehicles are connected to the power grid is solved, and the dual guarantee of grid stability and car owners' power demand is achieved.

CN119994927APending Publication Date: 2025-05-13HUAIYIN INSTITUTE OF TECHNOLOGY
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202510010096.8
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-01-03
Publication Date
2025-05-13

AI Technical Summary

Technical Problem

After a large number of new energy vehicles are connected to the power grid, the local distribution network voltage quality has declined, and the existing technology is difficult to effectively solve the grid stability problem when there is huge excess voltage, and the power demand of new energy vehicle owners is not fully considered.

Method used

The power grid data is collected through voltage sensors, frequency sensors, and waveform sensors, combined with the battery status of new energy vehicles and the needs of car owners, a GM-GRU prediction model is built to predict the grid voltage quality index at the next moment, calculate the voltage gap, and use the PSA algorithm to find the best charging and discharging solution to stabilize the grid voltage.

Benefits of technology

It realizes monitoring the change in the grid voltage quality at the first time and finding suitable solutions, taking into account the power requirements of the car owner, preventing excessive discharge of the battery, improving power supply stability, and reducing the economic cost of dealing with abnormal grid voltage quality.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119994927A_ABST
    Figure CN119994927A_ABST
Patent Text Reader

Abstract

The invention discloses a method for stabilizing the voltage quality of a power grid through charging and discharging of a new energy automobile. A data acquisition unit monitors the changes of voltage, frequency and waveform in the power grid, obtains the battery condition and electric quantity of the new energy automobile and the current electric quantity demand of an automobile owner and uploads the data to a cloud analysis unit; the cloud analysis unit uses a GM-GRU prediction model to determine whether the power grid voltage quality is in a normal interval, if not, it is considered that the power grid voltage is abnormal, and a voltage gap is determined; a PSA algorithm is called to find out the electric quantity or charging electric quantity needing to be released by the new energy automobile with the lowest economic cost as the target, and an instruction is sent to the intelligent regulation and control unit; and the intelligent regulation and control unit responds to the strategy and sends an instruction for encouraging a vehicle owner to discharge or charge the power grid. Compared with the prior art, the method can make a response quickly according to the change of the voltage quality of the power grid, finds a solution in the first time, greatly improves the power supply reliability, reduces the processing economic cost, and achieves the purpose of stabilizing the voltage quality of the power grid.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The invention belongs to automatic voltage stabilization technology, relates to a technology for stabilizing the voltage quality of a power grid, and specifically relates to a method for stabilizing the voltage quality of a power grid by charging and discharging a new energy vehicle. Background Art

[0002] At present, the country is vigorously developing new energy technologies, and a large number of brands of new energy products have emerged. With the massive electric vehicles, distributed photovoltaics, and various power electronic equipment entering thousands of households, when many devices are connected to the power grid, the local distribution network's voltage instability, short-term heavy overloads, high and low voltage limit violations and other operating risks increase sharply, which undoubtedly brings a potential danger to the power grid.

[0003] In order to solve the problem of voltage quality degradation in local distribution networks, the following methods are currently used:

[0004] Establish dual charging stations, introduce vehicle-grid interactive technology, optimize charging peak and valley time-of-use electricity prices, improve the electricity trading market mechanism, encourage user participation, help the power grid to reduce peaks and fill valleys, and stabilize voltage quality. However, this method has poor solving ability when facing huge excess voltage.

[0005] V2G technology allows electric vehicles to interact with the power grid in a two-way manner. When the power grid is overloaded, electric vehicles can feed back electricity to the grid; when the power grid is underloaded, electric vehicles can obtain electricity from the grid for charging. V2G technology can not only optimize the utilization of power resources, but also provide new ideas for the consumption of renewable energy and grid load regulation. However, this technology fails to take into account the changes in the charging and discharging efficiency of new energy electric vehicle batteries over time and the mileage of the electric vehicle; at the same time, this technology does not take into account the current power demand of new energy vehicle owners, and excessive discharge may cause some trouble to the owners.

[0006] Therefore, an automatic voltage stabilization technology is needed that can not only monitor the changes in the voltage quality of the power grid, but also find appropriate solutions and stabilize the voltage quality of the power grid by taking into account the needs of the electricity users. Summary of the invention

[0007] Purpose of the invention: In response to the problems pointed out in the background technology, the present invention provides a method for stabilizing the voltage quality of the power grid by charging and discharging new energy vehicles, monitoring the changes in the voltage quality of the power grid, and stabilizing the voltage quality of the power grid by integrating multiple factors such as consumer demand and the vehicle's own conditions.

[0008] Technical solution: The present invention discloses a method for stabilizing the voltage quality of a power grid by charging and discharging a new energy vehicle, comprising the following steps:

[0009] Voltage sensors, frequency sensors, and waveform sensors collect voltage, frequency, and waveform data from the power grid, and the vehicle-power sharing platform obtains the battery status and power level of new energy vehicles and the current power demand of the owner;

[0010] Receive the voltage, frequency, waveform data, battery status and power of new energy vehicles in the power grid, as well as the current power demand information of the owner, build a GM-GRU prediction model, predict the voltage quality index value at the next moment and determine whether it is in an abnormal state. If the voltage quality index value of the power grid is predicted to be abnormal at the next moment, calculate the voltage gap Q(t). Based on the calculated voltage gap Q(t), build an economic cost objective function, and use the PSA algorithm to find the best electric vehicle charging and discharging plan with the lowest economic cost as the goal, and find the best electric vehicle charging and discharging amount;

[0011] Corresponding instructions are issued for the best electric vehicle charging and discharging plan to remind new energy vehicle owners to charge and discharge to achieve the purpose of stabilizing the voltage quality of the power grid.

[0012] Furthermore, when predicting the voltage quality value at the next moment, the voltage quality index objective function is constructed:

[0013]

[0014] Among them, VQI is the voltage quality index, V dev is the actual grid voltage, V nom is the rated voltage, f dev is the actual frequency of the power grid, f nom is the rated frequency, THD is the total harmonic distortion, α, β, γ are weight coefficients used to indicate the influence of different factors on voltage quality. Here, α is defined to have the largest proportion.

[0015] Furthermore, the GM-GRU prediction model is as follows:

[0016] 2.1) Data preprocessing: preprocess the collected voltage, frequency and waveform data in the power grid;

[0017] The voltage, frequency, waveform data at time t and the calculated voltage quality index VQI are combined to form a vector at time t, and then the data at different times are collected together to form the actual voltage quality index data group sequence X (0) ={x (0) (1),x (0) (2),…,x (0) (n)}, n represents the number of data in the data sequence, x (0) (n) represents the nth voltage quality index data group, and its level ratio is:

[0018]

[0019] If all level ratios fall within the acceptable coverage interval If the original voltage quality index data set sequence meets the level ratio condition, the GM (1, 1) model is established;

[0020] If the data sequence does not meet the level ratio condition, the weighted neighbor value generation is performed on the original voltage quality index data group sequence. The weighted neighbor value generation formula is as follows:

[0021] x (1) (i) = w1·x (0) (i-1)+w2·x (0) (i)+w3·x (0) (i+1)

[0022] Among them, x (1) (i) is the i-th data value in the weighted neighbor generation sequence, x (0) (i) is the i-th data value in the original data sequence; w1, w2, w3 are weight coefficients, and w1+w2+w3=1;

[0023] 2.2) The voltage quality index data set sequence that meets the level ratio condition is used as the input of the GM model:

[0024] X (0) ={x (0) (1),x (0) (2),…,x (0) (n)}

[0025] Among them, X (0) represents the first generation voltage quality index data set, x (0) (n) represents the nth voltage quality data value in the primary voltage quality indicator data set; after the primary voltage quality indicator data set is constructed, a new voltage quality indicator data set sequence X is obtained by accumulating the primary voltage quality indicator data set. (1) , X (1) Also known as X (0) The 1-ACO sequence is as follows:

[0026] X (1) ={x (1) (1),x (1) (2),…,x (1) (n)}

[0027]

[0028] Among them, x (1) (n) is the data value obtained after one accumulation of the original data sequence, and both k and i are non-zero natural numbers;

[0029] By initial voltage quality index data set sequence X (0) and sequence X (1) , calculate X (1) The adjacent mean value of the sequence Z (1) ,as follows:

[0030] Z (1) ={z (1) (1),z (1) (2),…,z (1) (n)}

[0031]

[0032] The basic form of the GM model is:

[0033] x (0) (k)+az (1) (k)=b,k=2,3,…n

[0034] Among them, a is the development coefficient, b is the gray action;

[0035] The least squares estimation of the parameters is performed, is the parameter list, T is the vector transpose symbol, and satisfies the following formula:

[0036]

[0037] Among them, Y is a non-negative data series, and B is a sequence of numbers generated by the nearest mean;

[0038] That is, the least squares estimated parameter series The whitening equation is obtained as follows:

[0039]

[0040] The time response equation is:

[0041]

[0042] It is the predicted value of the power grid voltage quality index at the next moment obtained by accumulating the original data sequence once;

[0043] X (1) (t) is reduced by one order, and X can be restored. (0) The simulated value of:

[0044]

[0045] in, To transform the predicted values ​​into simulated values ​​in the initial data series;

[0046] 2.3) Construct a GRU prediction model. GRU has a gate structure in each neuron, including a reset gate r i and update gate z i , the predicted value data of voltage, frequency, and waveform at the next moment after preprocessing by the GM model and the obtained predicted value of voltage quality index are used as the input data of the GRU model: by resetting the gate, the voltage quality index data obtained after data preprocessing by the GM model is retained, the voltage quality index data group with relatively large errors is forgotten, and the dynamic changes in the voltage quality index sequence data are processed; by updating the gate, important voltage quality index data groups are retained and memorized, making the model more flexible when making predictions.

[0047] Furthermore, the GRU prediction model is specifically as follows:

[0048] 2.4.1) The calculation formula of reset gate is as follows:

[0049]

[0050] Among them, r t is the output of the reset gate; σ is the sigmoid function, and the output value is between [0,1]; x t The input of the current time step; W r is the weight matrix of the reset gate; is the transposed matrix of the weight matrix; tanh is the activation function, b a is the bias term; b r is the bias term for the reset gate;

[0051] 2.4.2 The calculation formula of the update gate is as follows:

[0052]

[0053] Among them, W z is the weight matrix of the update gate; h t-1 is the hidden state of the previous time step; x t The input of the current time step; b z is the bias term of the update gate; is the transposed matrix of the weight matrix;

[0054] 2.4.3) Candidate hidden state h i It is the temporary hidden state in each cycle, which is used to calculate the final hidden state h of this cycle i , the relevant calculation formula is as follows:

[0055] h t =tanh(W·[r t *h t-1 ,x t ]+b)

[0056] h t =(1-z t )*h t-1 +z t *h t

[0057] Among them, h t is the candidate hidden state; W is the weight matrix of the candidate hidden state; r t *h t-1 is the element-by-element multiplication of the reset gate output and the hidden state of the previous time step; b is the bias term of the candidate hidden state; 1-z t is the closing part of the update gate, which retains the weight of the hidden state of the previous time step; z t It is the part where the update gate is opened, introducing the weight of the candidate hidden state;

[0058] 2.4.4) After prediction by the GRU prediction model, the voltage quality index value VQI at the next moment is obtained.

[0059] Furthermore, the voltage quality index value VQI predicted by the GRU prediction model at the next moment is compared. If VQI = 0, the power grid is considered to be in an ideal operating state. If 0 ≤ VQI ≤ 100, it is considered that the power grid voltage is abnormal but still within an acceptable range and no alarm is required. If VQI ≥ 100, it is considered that the power grid voltage has a fault, which is considered to be undervoltage or high voltage, and the voltage gap value is calculated:

[0060]

[0061] Wherein, Q(t) is the voltage gap, t1, t2 are time, I is the average current of the power grid, if Q(t) is greater than 0, it is considered that overvoltage has occurred, if Q(t) is less than 0, it is considered that undervoltage has occurred.

[0062] Furthermore, the PSA algorithm is used to find the best electric vehicle charging and discharging solution and optimize the lowest economic cost, as follows:

[0063] 3.1) Construct the objective function of economic cost:

[0064]

[0065] Among them, E is the economic cost, P buy (t) is the electricity purchase price at time t, P sell (t) is the electricity price at time t, Q charge,i (t) is the charge amount of the i-th new energy vehicle at time t, Q discharge,i (t) is the discharge amount of the i-th new energy vehicle at time t, C genis the power generation cost per unit of electricity of the generator, Q gen (t) is the power generation of the generator at time t, C old,i (m) is the cost caused by battery aging of the i-th new energy vehicle at mileage m, η charge,i (0) , η discharge,i (0) are the initial charge and discharge efficiencies, respectively, and f old (m) is the function of the relationship between battery aging and mileage, and its value is less than or equal to 0. n is the number of new energy vehicles required, n max is the number of new energy vehicles that are currently in greatest demand, Q(t) is the voltage gap value, which is a constraint condition, ψ1, ψ2, ψ3 are the proportions of charging, discharging, and generating capacity at time t. In the process of minimizing the economic cost E, the voltage quality is adjusted by charging and discharging new energy vehicles and adjusting the output of the generator. The charging and discharging capacity of the new energy vehicle owners and the generator are used to make up for the grid voltage gap; considering that the new energy vehicle owners have power demand at time t, Q is guaranteed. charge,i (t)≥Q demand,i (t)-Q discharge,i (t), where Q demand,i (t) The current power demand reported by the car owner on the car-power sharing platform;

[0066] 3.2) Constructing the PSA algorithm

[0067] 3.2.1) Population initialization: Assuming that the number of decision variables in the three groups of new energy vehicle charging and discharging, generator power generation, and electricity price is d, and the upper and lower bounds of the variables are u and i respectively, the control parameters of PSA include the maximum number of iterations T and the population size n, then the initial population is expressed as:

[0068] x ij =(u j -l j )·r1+l j ,i=1,2,…n;j=1,2,…,d

[0069] Among them, x ij represents the value of the jth dimension of the ith individual, which is used to represent an element in a multidimensional array or matrix; i and j are indexes used to specify the position of the element in the array. The charge and discharge amount of new energy vehicles, the power generation of generators, and the electricity price are regarded as a decision variable, that is, a set of solutions, which represents the value of the jth dimension in the ith group of solutions. j = 1 is the charge and discharge amount; j = 2 is the power generation of the generator; j = 3 is the electricity price, u j and l j are the upper and lower bounds of the jth dimension respectively; r1 is a random number from 0 to 1;

[0070] 3.2.2) Calculate system deviation: For the minimization problem, the solution x for the optimal new energy vehicle charging and discharging amount, generator power generation, and electricity price at iteration number t * (t) is the individual corresponding to the overall historical minimum, and the overall deviation e of multiple iterations t k (t) is:

[0071] e k (t) = x * (t-1)-x(t-1)

[0072] When the number of iterations is t, the deviations of the three solutions of the previous iteration’s new energy vehicle charging and discharging amount, generator power generation, and electricity price are expressed as e k-1 (t) indicates that the overall deviation of the first two iterations is respectively represented by e k-2 (t) to represent e k-1 (t) is expressed as: e k-1 (t) = e k (t-1)+x * (t)-x * (t-1);

[0073] 3.2.3) PID regulation: When the number of iterations is t, the output value of PID regulation Δu(t) is: Δu(t) = K p ·r2·[e k (t)-e k-1 (t)]+K i ·r3·e k (t)+K d ·r4·[e k (t)-2e k-1 (t)+e k-2 (t)]

[0074] Among them, r2, r3 and r4 are vectors of random numbers from 0 to 1 in n rows and 1 column; K p , K i and K d are the adjustment coefficients of proportional, integral, and differential, which are set to 1, 0.5, and 1.2, respectively, in this paper;

[0075] A conditional factor called zero output is added to the original Δu(t) to ensure that the algorithm can find the three best solutions of new energy vehicle charging and discharging, generator power generation, and electricity price in space. Zero output is defined in the following formula:

[0076] o(t)=(cos(1-t / T)+λr5·L)·e k (t)

[0077] where r5 is a vector of random numbers from 0 to 1 in n rows and d columns; λ is the adjustment coefficient, and L is a Levy flight function;

[0078] The updates of all individuals are related to Δu(t) and o(t), and the formula for updating the optimal population is:

[0079] x(t+1)=x(t)+ηΔu(t)+θ(t)·o(t)

[0080]

[0081] ΔE(t)=|E(t)-E(t-1)|

[0082] Among them, θ(t) is an adjustment factor based on the historical optimal solution, which is used to enhance local search; E(t) is the value of the economic cost when the optimal new energy vehicle charging and discharging capacity, generator power generation, and electricity price solution are brought in at time t; η is a matrix of n rows and 1 column, expressed as: η=r6 cos(t / T); r6 is a matrix of 0 to 1 random numbers in n rows and 1 column.

[0083] Furthermore, the adjustment coefficient λ is formulated as follows:

[0084]

[0085] T is the maximum number of iterations. The adjusted formula combines the periodicity of the sine function and the growth characteristics of the logarithmic function, so that λ changes more slowly in the early stage of iteration, which helps the algorithm to explore the whole world. As the iteration proceeds, the λ value gradually decreases, which helps the algorithm to develop locally.

[0086] Furthermore, the Levy flight function L is defined as:

[0087]

[0088] where u and v are matrices of n rows and d columns of random numbers following a standard normal distribution, respectively; β is a factor set to 1.5.

[0089] Furthermore, the intelligent control unit determines whether it is overvoltage or undervoltage. If it is overvoltage, it will first publish a strategy on the vehicle-power sharing platform to encourage car owners to charge, and then reduce the power generation of the generator. If it is undervoltage, it will publish a strategy to encourage car owners to discharge and increase the power generation of the generator, so as to solve the problem of abnormal grid voltage quality indicators at the lowest cost.

[0090] Beneficial effects:

[0091] 1. The present invention predicts the voltage quality index at the next moment by establishing a GM-GRU prediction model, so as to obtain the grid voltage quality information at the first time, find out the corresponding strategy, and improve the power supply stability; compared with the current technology, the present invention fully considers the current power demand of the car owner, and can prevent the problem that the car cannot be started due to excessive discharge when discharging to the grid; the present invention takes into account the decrease in the charging and discharging rate of the new energy vehicle battery caused by the change of mileage and time, which can reduce the owner's concern about the impact of the dual charging strategy on the battery to a certain extent, and accelerate the implementation of the policy; the present invention also finds a strategy for handling the grid voltage quality index problem at the lowest economic cost by constructing a PSA optimization algorithm, thereby improving the economy of the grid in handling the problem.

[0092] 2. The data processed by the GM model can more accurately reflect the changing trends of key parameters such as grid voltage and frequency. This processed data is used as the input of the GRU algorithm, which can improve the accuracy of the GRU algorithm in analyzing and predicting the quality of grid voltage. Secondly, there is a correlation between the GM model and the GRU algorithm. The output of the GM model can be used as the input of the GRU algorithm, and this correlation is reflected in the data flow and processing flow. The prediction results of the GM model provide basic data for the GRU algorithm, enabling the GRU algorithm to perform further analysis and prediction on a more accurate basis.

[0093] 3. The present invention uses the GRU prediction model for prediction. By resetting the gate, the voltage quality index data obtained by the GM prediction model after data preprocessing can be retained, and some voltage quality index data groups with relatively large errors can be forgotten. This can effectively handle the dynamic changes in the voltage quality index sequence data and improve the model's understanding and prediction capabilities. By updating the gate, important voltage quality index data groups can be retained and memorized, making the model more flexible when making predictions.

[0094] 4. When the grid voltage is abnormal, the present invention calls the PSA algorithm (PID search optimization algorithm) to find out the amount of electricity that the new energy vehicle needs to release or charge, and sends instructions to the intelligent control unit, so as to reduce the economic cost of dealing with the abnormal grid voltage problem. Instructions are issued on the vehicle-power sharing platform to encourage car owners to discharge or charge the grid, thereby stabilizing the grid voltage quality. The present invention can respond quickly to changes in the grid voltage quality and find a solution in the first place, greatly improving the reliability of power supply while reducing the economic cost of processing. BRIEF DESCRIPTION OF THE DRAWINGS

[0095] Figure 1 It is the overall system block diagram of the present invention;

[0096] Figure 2 The present invention is a flow chart of the method for stabilizing the voltage quality of the power grid. DETAILED DESCRIPTION

[0097] The present invention will be further described below in conjunction with the accompanying drawings. The following embodiments are only used to more clearly illustrate the technical solution of the present invention, and cannot be used to limit the protection scope of the present invention.

[0098] The present invention discloses a method for stabilizing the voltage quality of a power grid by charging and discharging new energy vehicles, including a data acquisition unit, a cloud analysis unit, and an intelligent control unit connected to each other. Taking voltage anomaly as an example:

[0099] Data acquisition unit: Voltage sensors, frequency sensors, and waveform sensors collect data on voltage, frequency, and waveform in the power grid. The vehicle-power sharing platform is responsible for obtaining the battery status, power level, and current power demand of new energy vehicles, and uploading these results to the cloud analysis unit.

[0100] Cloud analysis unit: Receives information from the data acquisition unit, and builds a GM-GRU prediction model to predict the voltage quality value at the next moment and determine whether it is in an abnormal state. If it is in an abnormal state, the voltage gap Q(t) is calculated. Based on the calculated voltage gap Q(t), an economic cost objective function is constructed. With the lowest economic cost as the goal, the PSA algorithm is used to find the best electric vehicle charging and discharging solution and the best electric vehicle charging and discharging amount.

[0101] Intelligent control unit: issues corresponding instructions for the strategies found by the cloud analysis unit, encouraging new energy vehicle owners to use the wireless coils and dual charging piles installed in the vehicle for charging and discharging to achieve the purpose of stabilizing the voltage quality of the power grid.

[0102] Construct an optimized GM-GRU prediction model to predict the voltage quality at the next moment:

[0103] 2.1) Construct voltage quality index objective function:

[0104]

[0105] Among them, VQI is the voltage quality index, V dev is the deviation between the actual grid voltage and the rated voltage, V nom is the rated voltage, f dev is the deviation between the actual frequency of the power grid and the rated frequency, f nom is the rated frequency, THD is the total harmonic distortion, α, β, γ are weight coefficients used to indicate the influence of different factors on voltage quality. Here, α is defined to have the largest proportion.

[0106] 2.2) Constructing GM prediction model

[0107] 2.2.1) The voltage, frequency, waveform data at time t and the calculated voltage quality index VQI are combined to form a vector at time t, and then the data at different times are collected together to form the actual voltage quality index data group sequence X (0) ={x (0) (1),x (0) (2),…,x (0) (n)}, n represents the number of data in the data sequence, x (0) (n) represents the nth voltage quality index data group, and its level ratio is:

[0108]

[0109] If all level ratios fall within the acceptable coverage interval If the original voltage quality index data set sequence meets the level ratio condition, the GM (1, 1) model can be established.

[0110] If the data sequence does not meet the level ratio condition, the weighted neighbor value generation is performed on the original voltage quality index data group sequence. The weighted neighbor value generation formula is as follows:

[0111] x (1) (i) = w1·x (0) (i-1)+w2·x (0) (i)+w3·x (0) (i+1)

[0112] Among them, x (1) (i) is the i-th data value in the weighted neighbor generation sequence, x (0) (i) is the i-th data value in the original data sequence; w1, w2, w3 are weight coefficients, and w1+w2+w3=1.

[0113] 2.2.2) The voltage quality index data set sequence that meets the level ratio condition is used as the input of the GM model:

[0114] X (0) ={x (0) (1),x (0) (2),…,x (0) (n)}

[0115] Among them, X (0) represents the first generation (0th generation) voltage quality indicator data set, x (0) (n) represents the nth voltage quality data value in the primary voltage quality indicator data set.

[0116] After the initial voltage quality indicator data set is constructed, a new voltage quality indicator data set sequence X is obtained by accumulating the initial voltage quality indicator data set. (1), X (1) Also known as X (0) The 1-ACO sequence is as follows:

[0117] X (1) ={x (1) (1),x (1) (2),…,x (1) (n)}

[0118]

[0119] Among them, x (1) (n) is the data value obtained after one accumulation of the original data sequence, and k and i are both non-zero natural numbers.

[0120] By initial voltage quality index data set sequence X (0) and sequence X (1) , we can calculate X (1) The adjacent mean value of the sequence Z (1) ,as follows:

[0121] Z (1) ={z (1) (1),z (1) (2),…,z (1) (n)}

[0122]

[0123] So the basic form of the GM model is: (0) (k)+az (1) (k)=b, k=2,3,…n, where a is the development coefficient and b is the gray action.

[0124] The least squares estimation of the parameters is performed, is the parameter list, T is the vector transpose symbol, and satisfies the following formula:

[0125]

[0126] Among them, Y is a non-negative data series, and B is a series of numbers generated adjacent to the mean.

[0127] That is, the least squares estimated parameter series The whitening equation is obtained as follows:

[0128]

[0129] The time response equation is:

[0130]

[0131] is the predicted value of the power grid voltage quality index at the next moment obtained by accumulating the original data sequence once; (1) (t) is reduced by one order, and X can be restored. (0) The simulated value of:

[0132]

[0133] in, In order to transform the predicted value into the simulated value in the initial data sequence, the output result at this time is the predicted value of the voltage quality index at the next moment.

[0134] 2.3) Building a GRU prediction model

[0135] 2.3.1) GRU is a neural network model, a variant of recurrent neural network, used to process sequence data. GRU has a gating structure in each neuron, including a reset gate r i and update gate z i .

[0136] 2.3.2) The calculation formula of reset gate is as follows:

[0137]

[0138] Among them, r t is the output of the reset gate; σ is the sigmoid function, and the output value is between [0,1]; x t The input of the current time step; W r is the weight matrix of the reset gate; is the transposed matrix of the weight matrix; tanh is the activation function, b a is the bias term; b r is the bias term for the reset gate.

[0139] By resetting the gate, the voltage quality indicator data set predicted by the previous GM prediction model can be retained, and some voltage quality indicator data sets with relatively large errors can be forgotten. This can effectively handle the dynamic changes in the voltage quality indicator sequence data and improve the model's understanding and prediction capabilities.

[0140] 2.3.3) The calculation formula of the update gate is as follows:

[0141]

[0142] Among them, W z is the weight matrix of the update gate; h t-1 is the hidden state of the previous time step; x t The input of the current time step; b z is the bias term of the update gate; is the transposed matrix of the weight matrix. By updating the gate, important voltage quality indicator data sets can be retained and memorized, making the model more flexible when making predictions.

[0143] 2.3.4) Candidate hidden state h i It is the temporary hidden state in each cycle, which is used to calculate the final hidden state h of this cycle i , the relevant calculation formula is as follows:

[0144] h t =tanh(W·[r t *h t-1 ,x t ]+b)

[0145] h t =(1-z t )*h t-1 +z t *h t

[0146] Among them, h t is the candidate hidden state; W is the weight matrix of the candidate hidden state; r t *h t-1 is the element-by-element multiplication of the reset gate output and the hidden state of the previous time step; b is the bias term of the candidate hidden state; 1-z t is the closing part of the update gate, which retains the weight of the hidden state of the previous time step; z t It is the part where the update gate is opened, introducing the weight of the candidate hidden state.

[0147] 2.3.5) After the GRU model predicts, the predicted voltage quality index value of the next moment is compared. If VQI = 0, the grid is considered to be in an ideal operating state. If 0 ≤ VQI ≤ 100, the grid voltage is considered to be abnormal but still within an acceptable range and no alarm is required. If VQI ≥ 100, the grid voltage is considered to be faulty.

[0148] 2.4) At this point, it is roughly assumed that the power grid is undervoltage or overvoltage, and the voltage gap value is calculated:

[0149]

[0150] Among them, V nom is the nominal voltage, that is, the voltage value of the power grid under normal operating conditions; V actual It is the actual voltage, that is, the actual measured voltage value of the power grid at a specific time point, Q(t) is the voltage gap, t1, t2 are time, I is the average current of the power grid, if Q(t) is greater than 0, it is considered that overvoltage has occurred, if Q(t) is less than 0, it is considered that undervoltage has occurred.

[0151] The improved PSA algorithm is used to find the lowest economic cost:

[0152] 3.1) Construct the objective function of economic cost:

[0153]

[0154] Among them, E is the economic cost, P buy (t) is the electricity purchase price at time t, P sell (t) is the electricity price at time t, Q charge,i (t) is the charge amount of the i-th new energy vehicle at time t, Q discharge,i (t) is the discharge amount of the i-th new energy vehicle at time t, C gen is the power generation cost per unit of electricity of the generator, Q gen (t) is the power generation of the generator at time t, C old,i (m) is the cost caused by battery aging of the i-th new energy vehicle at mileage m, η charge,i (0) , η discharge,i (0) are the initial charge and discharge efficiencies, respectively, and f old (m) is the function of the relationship between battery aging and mileage, and its value is less than or equal to 0. n is the number of new energy vehicles required, n max is the number of new energy vehicles that are currently in greatest demand, Q(t) is the voltage gap value, which is a constraint condition, ψ1, ψ2, ψ3 are the proportions of charging, discharging, and generating capacity at time t. In the process of minimizing the economic cost E, the voltage quality is adjusted by charging and discharging new energy vehicles and adjusting the output of the generator. The charging and discharging capacity of the new energy vehicle owners and the generator are used to make up for the grid voltage gap; considering that the new energy vehicle owners have power demand at time t, Q is guaranteed. charge,i (t)≥Q demand,i (t)-Q discharge,i (t), where Q demand,i (t) is the current power demand reported by the car owner on the car-power sharing platform.

[0155] 3.2) Constructing the PSA algorithm

[0156] 3.2.1) The PSA algorithm is a new meta-heuristic algorithm that converges the entire population to the optimal state by continuously adjusting the system deviation.

[0157] 3.2.2 Population initialization: Assume that the number of decision variables in the three groups of new energy vehicle charging and discharging, generator power generation, and electricity price is d, and the upper and lower bounds of the variables are u and i respectively. The control parameters of PSA include the maximum number of iterations T and the population size n. Then the initial population can be expressed as:

[0158] x ij =(u j -l j )·r1+l j ,i=1,2,…n;j=1,2,…,d

[0159] Among them, x ij represents the value of the jth dimension of the ith individual, which is used to represent an element in a multidimensional array or matrix; i and j are indexes used to specify the position of the element in the array. The charge and discharge amount of new energy vehicles, the power generation of generators, and the electricity price are regarded as a decision variable, that is, a set of solutions, which represents the value of the jth dimension in the ith group of solutions. j = 1 is the charge and discharge amount; j = 2 is the power generation of the generator; j = 3 is the electricity price, u j and l j are the upper and lower bounds of the j-th dimension respectively; r1 is a random number from 0 to 1.

[0160] 3.2.3) Calculate system deviation: For the minimization problem, the solution x for the optimal new energy vehicle charging and discharging amount, generator power generation, and electricity price at iteration number t * (t) is the individual corresponding to the overall historical minimum. The overall deviation e of multiple iterations t k (t) is:

[0161] e k (t) = x * (t-1)-x(t-1)

[0162] In order to facilitate calculation and iterative update, when the number of iterations is t, the deviations of the three solutions of the new energy vehicle charging and discharging amount, generator power generation, and electricity price in the previous iteration are expressed as e k-1 (t) indicates that the overall deviation of the first two iterations is respectively represented by e k-2 (t). In order to reduce the space complexity of the algorithm as much as possible, e k-1 (t) can be expressed as:

[0163] e k-1 (t) = e k (t-1)+x * (t)-x * (t-1)

[0164] 3.2.4) PID regulation: In real problems, the proportional, integral and differential factors are constantly adjusted. When the number of iterations is t, the output value Δu(t) of PID regulation is:

[0165] Δu(t)=K p ·r2·[e k (t)-e k-1 (t)]+K i·r3·e k (t)+K d ·r4·[e k (t)-2e k-1 (t)+e k-2 (t)]

[0166] Among them, r2, r3 and r4 are vectors of random numbers from 0 to 1 in n rows and 1 column; K p , K i and K d are the adjustment coefficients of proportion, integration and differentiation, which are set to 1, 0.5 and 1.2 respectively in this paper.

[0167] To prevent the algorithm from falling into a local optimum, a conditional factor called zero output is added to the original Δu(t) to ensure that the algorithm can find the three best solutions of new energy vehicle charging and discharging, generator power generation, and electricity price in space. Zero output is defined in the following formula:

[0168] o(t)=(cos(1-t / T)+λr5·L)·e k (t)

[0169] where r5 is a vector of random numbers from 0 to 1 in n rows and d columns; λ is the adjustment coefficient, and L is a Levy flight function.

[0170] In order to improve the search efficiency of the algorithm and the quality of the solution, the λ formula is updated as follows:

[0171]

[0172] T is the maximum number of iterations. The adjusted formula combines the periodicity of the sine function and the growth characteristics of the logarithmic function, so that λ changes more slowly in the early stage of iteration, which helps the algorithm to explore the world. As the iteration proceeds, the λ value gradually decreases, which helps the algorithm to develop locally.

[0173] As t increases, it decreases slowly, which helps the algorithm to fully explore. In the later stage, λ decreases rapidly, which helps the algorithm to switch from exploration to exploitation.

[0174] The L in the equation is a Levy flight function, defined as:

[0175]

[0176] where u and v are matrices of n rows and d columns of random numbers following a standard normal distribution, respectively; β is a factor set to 1.5.

[0177] All individual updates are related to Δu(t) and o(t). Update the optimal population formula:

[0178] x(t+1)=x(t)+ηΔu(t)+θ(t)·o(t)

[0179]

[0180] ΔE(t)=|E(t)-E(t-1)|

[0181] Among them, is an adjustment factor based on the historical optimal solution, which is used to enhance the local search; E(t) is the value of the economic cost when the optimal new energy vehicle charging and discharging capacity, generator power generation, and electricity price solution are found at time t; η is a matrix with n rows and 1 column, expressed as:

[0182] η=r6cos(t / T)

[0183] where r6 is a matrix of 0 to 1 random numbers in n rows and 1 column.

[0184] When the cloud analysis unit finds that the grid voltage quality indicators are abnormal, it builds a PSA algorithm to find the lowest cost for handling the problem and sends the result to the intelligent control unit. The intelligent control unit determines whether it is overvoltage or undervoltage based on the strategy. If it is overvoltage, it first publishes a strategy on the vehicle-power sharing platform to encourage car owners to charge, and then reduces the power generation of the generator. If it is undervoltage, it publishes a strategy to encourage car owners to discharge and increase the power generation of the generator, so as to solve the problem of abnormal grid voltage quality indicators at the lowest cost.

[0185] The above embodiments are only for illustrating the technical concept and features of the present invention, and their purpose is to enable people familiar with the technology to understand the content of the present invention and implement it accordingly, and they cannot be used to limit the protection scope of the present invention. Any equivalent transformation or modification made according to the spirit of the present invention should be included in the protection scope of the present invention.

Claims

1. A method for stabilizing the voltage quality of a power grid by charging and discharging new energy vehicles, characterized in that: The following steps are involved: Voltage sensors, frequency sensors, and waveform sensors collect voltage, frequency, and waveform data from the power grid, and the vehicle-power sharing platform obtains the battery status and power level of new energy vehicles and the current power demand of the owner; Receive the voltage, frequency, waveform data, battery status and power of new energy vehicles in the power grid, as well as the current power demand information of the owner, build a GM-GRU prediction model, predict the voltage quality index value at the next moment and determine whether it is in an abnormal state. If the voltage quality index value of the power grid is predicted to be abnormal at the next moment, calculate the voltage gap Q(t). Based on the calculated voltage gap Q(t), build an economic cost objective function, and use the PSA algorithm to find the best electric vehicle charging and discharging plan with the lowest economic cost as the goal, and find the best electric vehicle charging and discharging amount; Corresponding instructions are issued for the best electric vehicle charging and discharging plan to remind new energy vehicle owners to charge and discharge to achieve the purpose of stabilizing the voltage quality of the power grid.

2. A method for stabilizing grid voltage quality by charging and discharging new energy vehicles according to claim 1, characterized in that: When predicting the voltage quality value at the next moment, the voltage quality index objective function is constructed: Among them, VQI is the voltage quality index, V dev is the actual grid voltage, V nom is the rated voltage, f dev is the actual frequency of the power grid, f nom is the rated frequency, THD is the total harmonic distortion, α, β, γ are weight coefficients used to indicate the influence of different factors on voltage quality. Here, α is defined to have the largest proportion.

3. A method for stabilizing grid voltage quality by charging and discharging new energy vehicles according to claim 2, characterized in that: The GM-GRU prediction model is as follows: 2.1) Preprocess the collected voltage, frequency and waveform data of the power grid; The voltage, frequency, waveform data at time t and the calculated voltage quality index VQI are combined to form a vector at time t, and then the data at different times are collected together to form the actual voltage quality index data group sequence X (0) ={x (0) (1),x (0) (2),…,x (0) (n)}, n represents the number of data in the data sequence, x (0) (n) represents the nth voltage quality index data group, and its level ratio is: If all level ratios fall within the acceptable coverage interval If the original voltage quality index data set sequence meets the level ratio condition, the GM (1, 1) model is established; If the data sequence does not meet the level ratio condition, the weighted neighbor value generation is performed on the original voltage quality index data group sequence. The weighted neighbor value generation formula is as follows: x (1) (i)=w1·x (0) (i-1)+w2·x (0) (i)+w3·x (0) (i+1) Among them, x (1) (i) is the i-th data value in the weighted neighbor generation sequence, x (0) (i) is the i-th data value in the original data sequence; w1, w2, w3 are weight coefficients, and w1+w2+w3=1; 2.2) The voltage quality index data set sequence that meets the level ratio condition is used as the input of the GM model: X (0) ={x (0) (1),x (0) (2),…,x (0) (n)} Among them, X (0) represents the first generation voltage quality index data set, x (0) (n) represents the nth voltage quality data value in the primary voltage quality indicator data set; after the primary voltage quality indicator data set is constructed, a new voltage quality indicator data set sequence X is obtained by accumulating the primary voltage quality indicator data set. (1) , X (1) Also known as X (0) The 1-ACO sequence is as follows: X (1) ={x (1) (1),x (1) (2),…,x (1) (n)} Among them, x (1) (n) is the data value obtained after one accumulation of the original data sequence, and both k and i are non-zero natural numbers; By initial voltage quality index data set sequence X (0) and sequence X (1) , calculate X (1) The adjacent mean value of the sequence Z (1) ,as follows: WITH (1) ={z (1) (1),with (1) (2),…,of (1) (n)} The basic form of the GM model is: x (0) (k)+az (1) (k)=b,k=2,3,…n Among them, a is the development coefficient, b is the gray action; The least squares estimation of the parameters is performed, is the parameter list, T is the vector transpose symbol, and satisfies the following formula: Among them, Y is a non-negative data series, and B is a sequence of numbers generated by the nearest mean; That is, the least squares estimated parameter series The whitening equation is obtained as follows: The time response equation is: It is the predicted value of the power grid voltage quality index at the next moment obtained by accumulating the original data sequence once; X (1) (t) is reduced by one order, and X can be restored. (0) The simulated value of: in, To transform the predicted values ​​into simulated values ​​in the initial data series; 2.3) Construct a GRU prediction model. GRU has a gate structure in each neuron, including a reset gate r i and update gate z i , the predicted value data of voltage, frequency, and waveform at the next moment after preprocessing by the GM model and the obtained predicted value of voltage quality index are used as the input data of the GRU model: by resetting the gate, the voltage quality index data obtained after data preprocessing by the GM model is retained, the voltage quality index data group with relatively large errors is forgotten, and the dynamic changes in the voltage quality index sequence data are processed; by updating the gate, important voltage quality index data groups are retained and memorized, making the model more flexible when making predictions.

4. A method for stabilizing grid voltage quality by charging and discharging new energy vehicles according to claim 3, characterized in that: The GRU prediction model is as follows: 2.4.1) The calculation formula of reset gate is as follows: Among them, r t is the output of the reset gate; σ is the sigmoid function, and the output value is between [0,1]; x t The input of the current time step; W r is the weight matrix of the reset gate; is the transposed matrix of the weight matrix; tanh is the activation function, b a is the bias term; b r is the bias term for the reset gate; 2.4.2 The calculation formula of the update gate is as follows: Among them, W z is the weight matrix of the update gate; h t-1 is the hidden state of the previous time step; x t The input of the current time step; b z is the bias term of the update gate; is the transposed matrix of the weight matrix; 2.4.3) Candidate hidden state h i It is the temporary hidden state in each cycle, which is used to calculate the final hidden state h of this cycle i , the relevant calculation formula is as follows: h t =tanh(W·[r t *h t-1 ,x t ]+b) h t =(1-z t )*h t-1 +z t *h t Among them, h t is the candidate hidden state; W is the weight matrix of the candidate hidden state; r t *h t-1 is the element-by-element multiplication of the reset gate output and the hidden state of the previous time step; b is the bias term of the candidate hidden state; 1-z t is the closing part of the update gate, which retains the weight of the hidden state of the previous time step; z t It is the part where the update gate is opened, introducing the weight of the candidate hidden state; 2.4.4) After prediction by the GRU prediction model, the voltage quality index value VQI at the next moment is obtained.

5. A method for stabilizing grid voltage quality by charging and discharging new energy vehicles according to claim 2, characterized in that: The voltage quality index value VQI predicted by the GRU prediction model at the next moment is compared. If VQI=0, the power grid is considered to be in an ideal operating state. If 0≤VQI≤100, it is considered that the power grid voltage is abnormal but still within the acceptable range and no alarm is required. If VQI≥100, it is considered that the power grid voltage has a fault, which is considered to be undervoltage or high voltage, and the voltage gap value is calculated: Among them, V nom is the nominal voltage, that is, the voltage value of the power grid under normal operating conditions; V actual It is the actual voltage, that is, the actual measured voltage value of the power grid at a specific time point, Q(t) is the voltage gap, t1, t2 are time, I is the average current of the power grid, if Q(t) is greater than 0, it is considered that overvoltage has occurred, if Q(t) is less than 0, it is considered that undervoltage has occurred.

6. The method for stabilizing grid voltage quality indicators by charging and discharging new energy vehicles according to claim 1, characterized in that: Use the PSA algorithm to find the best electric vehicle charging and discharging solution and optimize the lowest economic cost, as follows: 3.1) Construct the objective function of economic cost: Among them, E is the economic cost, P buy (t) is the electricity purchase price at time t, P sell (t) is the electricity price at time t, Q charge,i (t) is the charge amount of the i-th new energy vehicle at time t, Q discharge,i (t) is the discharge amount of the i-th new energy vehicle at time t, C gen is the power generation cost per unit of electricity of the generator, Q gen (t) is the power generation of the generator at time t, C old,i (m) is the cost caused by battery aging of the i-th new energy vehicle at mileage m, η charge,i (0) , η discharge,i (0) are the initial charge and discharge efficiencies, respectively, and f old (m) is the function of the relationship between battery aging and mileage, and its value is less than or equal to 0. n is the number of new energy vehicles required, n max is the number of new energy vehicles that are currently in greatest demand, Q(t) is the voltage gap value, which is a constraint condition, ψ1, ψ2, ψ3 are the proportions of charging, discharging, and generating capacity at time t. In the process of minimizing the economic cost E, the voltage quality is adjusted by charging and discharging new energy vehicles and adjusting the output of the generator. The charging and discharging capacity of the new energy vehicle owners and the generator are used to make up for the grid voltage gap; considering that the new energy vehicle owners have power demand at time t, Q is guaranteed. charge,i (t)≥Q demand,i (t)-Q discharge,i (t), where Q demand,i (t) The current power demand reported by the car owner on the car-power sharing platform; 3.2) Constructing the PSA algorithm 3.2.1) Population initialization: Assuming that the number of decision variables in the three groups of new energy vehicle charging and discharging, generator power generation, and electricity price is d, and the upper and lower bounds of the variables are u and i respectively, the control parameters of PSA include the maximum number of iterations T and the population size n, then the initial population is expressed as: x ij =(u j -l j )·r1+l j ,i=1,2,…n;j=1,2,…,d Among them, x ij represents the value of the jth dimension of the ith individual, which is used to represent an element in a multidimensional array or matrix; i and j are indexes used to specify the position of the element in the array. The charge and discharge amount of new energy vehicles, the power generation of generators, and the electricity price are regarded as a decision variable, that is, a set of solutions, which represents the value of the jth dimension in the ith group of solutions. j = 1 is the charge and discharge amount; j = 2 is the power generation of the generator; j = 3 is the electricity price, u j and l j are the upper and lower bounds of the jth dimension respectively; r1 is a random number from 0 to 1; 3.2.2) Calculate system deviation: For the minimization problem, the solution x for the optimal new energy vehicle charging and discharging amount, generator power generation, and electricity price at iteration number t * (t) is the individual corresponding to the overall historical minimum, and the overall deviation e of multiple iterations t k (t) is: e k (t)=x * (t-1)-x(t-1) When the number of iterations is t, the deviations of the three solutions of the previous iteration’s new energy vehicle charging and discharging amount, generator power generation, and electricity price are expressed as e k-1 (t) indicates that the overall deviation of the first two iterations is respectively represented by e k-2 (t) to represent e k-1 (t) is expressed as: e k-1 (t) = e k (t-1)+x * (t)-x * (t-1); 3.2.3) PID regulation: When the number of iterations is t, the output value Δu(t) of PID regulation is: Δu(t)=K p ·r2·[e k (t)-e k-1 (t)]+K i ·r3·e k (t)+K d ·r4·[e k (t)-2e k-1 (t)+e k-2 (t)] Among them, r2, r3 and r4 are vectors of random numbers from 0 to 1 in n rows and 1 column; K p , K i and K d are the adjustment coefficients for proportional, integral and differential respectively; A conditional factor called zero output is added to the original Δu(t) to ensure that the algorithm can find the three best solutions of new energy vehicle charging and discharging, generator power generation, and electricity price in space. Zero output is defined in the following formula: o(t)=(cos(1-t / T)+λr5·L)·e k (t) where r5 is a vector of random numbers from 0 to 1 in n rows and d columns; λ is the adjustment coefficient, and L is a Levy flight function; The updates of all individuals are related to Δu(t) and o(t), and the formula for updating the optimal population is: x(t+1)=x(t)+ηΔu(t)+θ(t)·o(t) ΔE(t)=|E(t)-E(t-1)| Among them, θ(t) is an adjustment factor based on the historical optimal solution, which is used to enhance local search; E(t) is the value of the economic cost when the optimal new energy vehicle charging and discharging capacity, generator power generation, and electricity price solution are brought in at time t; η is a matrix of n rows and 1 column, expressed as: η=r6 cos(t / T); r6 is a matrix of 0 to 1 random numbers in n rows and 1 column.

7. A method for stabilizing grid voltage quality indicators by charging and discharging new energy vehicles according to claim 6, characterized in that: The adjustment coefficient λ formula is as follows: T is the maximum number of iterations. The adjusted formula combines the periodicity of the sine function and the growth characteristics of the logarithmic function, so that λ changes more slowly in the early stage of iteration, which helps the algorithm to explore the world. As the iteration proceeds, the λ value gradually decreases, which helps the algorithm to develop locally.

8. The method for stabilizing grid voltage quality indicators by charging and discharging new energy vehicles according to claim 6, characterized in that: The Levy flight function L is defined as: where u and v are matrices of n rows and d columns of random numbers following a standard normal distribution, respectively; β is a factor set to 1.

5.

9. The method for stabilizing the voltage quality of a power grid by charging and discharging a new energy vehicle according to claim 1, characterized in that: The intelligent control unit determines whether it is overvoltage or undervoltage. If it is overvoltage, it will first publish a strategy on the vehicle-power sharing platform to encourage car owners to charge, and then reduce the power generation of the generator. If it is undervoltage, it will publish a strategy to encourage car owners to discharge and increase the power generation of the generator, so as to solve the problem of abnormal grid voltage quality indicators at the lowest cost.