Power grid frequency adjusting method and system, electronic equipment and storage medium
By obtaining the available energy capacity and grid status information of electric vehicles, and using the frequency adjustment model to charge and discharge control, the problem of grid frequency fluctuation is solved, and the stable regulation and precise control of grid frequency is achieved.
Patent Information
- Application Number
- CN202411249426.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-09-06
- Publication Date
- 2024-12-06
AI Technical Summary
The existing technology cannot effectively improve the problem of power grid frequency fluctuations, especially when the grid load surges after the large-scale popularization of electric vehicles, resulting in instability in the power supply.
By obtaining the available energy capacity and grid status information of the electric vehicle in the target area, input the preset frequency adjustment model to predict the charging and discharging control strategy. If the strategy meets the charging and discharging power range constraints, charge and discharging control of the electric vehicle is carried out to achieve Grid frequency regulation.
It realizes stable regulation of the power grid frequency, reduces costs, improves control accuracy, and ensures the stability of the power grid frequency.
Smart Images

Figure CN119093410A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of vehicle networking, and in particular to a power grid frequency regulation method, system, electronic equipment and storage medium. Background Art
[0002] As people's environmental protection and sustainable development concepts continue to improve, new energy vehicles, especially electric vehicles (EVs), are rapidly becoming popular. However, the large-scale popularization of electric vehicles has also brought new challenges to the power grid (power system), especially in terms of grid-connected charging. During peak hours, if a large number of electric vehicles are connected to the grid for charging at the same time, the load on the grid will increase significantly. This surge in load may cause grid frequency fluctuations, thereby affecting the stability and reliability of power supply.
[0003] At present, dynamic pricing and time limit are usually used to guide users to charge their electric vehicles at the right time to reduce the charging demand during peak hours, thereby avoiding the surge in grid load. However, this method still cannot effectively improve the above-mentioned grid frequency fluctuation. Summary of the invention
[0004] The present invention provides a power grid frequency regulation method, system, electronic device and storage medium to solve the problem that the prior art cannot improve the power grid frequency fluctuation.
[0005] The present invention provides a method for regulating the frequency of a power grid, the method comprising: obtaining the available energy capacity of electric vehicles in a target area, the available energy capacity referring to the charging and discharging power range of the electric vehicles in the target area that can be used for frequency regulation of the power grid;
[0006] Acquiring power grid status information, wherein the power grid status information is information describing the operation status of the power grid;
[0007] Inputting the grid state information into a preset frequency regulation model to predict the charge and discharge control strategy and obtain a target strategy;
[0008] If the target strategy satisfies the constraint of the charging and discharging power range, then based on the target strategy, the charging and discharging of electric vehicles in the target area are controlled to complete the grid frequency regulation.
[0009] In one embodiment of the present invention, the step of obtaining the available energy capacity of electric vehicles in the target area includes:
[0010] Determine the electric vehicles participating in the power grid frequency modulation in the target area as target electric vehicles;
[0011] Collecting the adjustable frequency capacity of each target electric vehicle, where the adjustable frequency capacity refers to the power range within which the target electric vehicle can currently be charged and discharged;
[0012] The available energy capacity is obtained by summing the adjustable frequency capacities of all the target electric vehicles.
[0013] In one embodiment of the present invention, the grid state information includes a plurality of grid state vectors, the plurality of grid state vectors are arranged in time sequence, the grid state vectors are deviation vectors of grid state information at adjacent moments, and the grid state information includes grid frequency information; the grid state information is input into a preset frequency regulation model to predict the charge and discharge control strategy, and the step of obtaining the target strategy includes:
[0014] Inputting the plurality of grid state vectors into the strategy network of the frequency regulation model to predict the charge and discharge control strategy to obtain a plurality of initial strategies, wherein the initial strategies correspond one-to-one to the grid state vectors;
[0015] Inputting the initial strategy into the evaluation network of the frequency regulation model to obtain an evaluation value output by the evaluation network, wherein the evaluation value corresponds to the initial strategy in a one-to-one manner;
[0016] Based on the evaluation value and a preset objective function, adjusting parameters of the strategy network so that the strategy network outputs a new control strategy until the evaluation value of the control strategy converges to the objective function, wherein the objective function is to minimize the evaluation value;
[0017] The power grid state vector closest to the current moment is determined as the target state vector, and the final control strategy corresponding to the target state vector is determined as the target strategy.
[0018] In one embodiment of the present invention, the step of inputting the initial strategy into the evaluation network of the frequency regulation model to obtain the evaluation value output by the evaluation network includes:
[0019] Determine the modulus of the initial strategy as a first value, and determine the modulus of the power grid state vector corresponding to the initial strategy as a second value;
[0020] Determine the product of the first value and a preset first weight as a first intermediate value, and determine the product of the second value and a preset second weight as a second intermediate value;
[0021] Determine the sum of the first intermediate value and the second intermediate value as a target value, wherein the target value corresponds to the initial strategy one by one; the sum of the first weight and the second weight is 1;
[0022] If the target value is less than or equal to the preset cost threshold, the instantaneous value of the current initial strategy is determined as the preset first-generation value; if the target value is greater than the cost threshold, the instantaneous value of the current initial strategy is determined as the preset second-generation value; the first-generation value is less than the second-generation value;
[0023] According to the instantaneous value of each of the initial strategies, an evaluation value of each of the initial strategies is obtained, and the evaluation value of each of the initial strategies is obtained based on the instantaneous value of the target initial strategy. The target initial strategy refers to the initial strategy corresponding to the target power grid state vector, and the target power grid state vector refers to the power grid state vector located after the current power grid state vector.
[0024] In one embodiment of the present invention, the step of obtaining the evaluation value of each of the initial strategies according to the instantaneous value of each of the initial strategies includes:
[0025] Obtain all the target initial strategies of the current initial strategy;
[0026] Determining the instantaneous value of the target initial strategy as a target cost value;
[0027] Multiplying each of the target cost values by a preset decay rate value to obtain a plurality of third intermediate values, wherein the target cost values correspond to the decay rate values one by one;
[0028] The sum of all the third intermediate values is determined as the evaluation value of the current initial strategy, and the remaining initial strategies are traversed to obtain the evaluation values of the remaining initial strategies.
[0029] In one embodiment of the present invention, after the step of inputting the grid state information into a preset frequency regulation model to predict the charge and discharge control strategy and obtain the target strategy, the following steps are further included:
[0030] Obtaining an expected strategy corresponding to the target strategy, wherein the expected strategy is a preset strategy; and determining an area adjacent to the target area as an adjacent area, obtaining a power grid state vector of the adjacent area, determining the power grid state vector of the adjacent area as an adjacent state vector, determining the product of the adjacent state vector and the acquired power grid state matrix of the adjacent area as a first product, determining the product of the first product and a preset interference gain as a second product, wherein the second product corresponds to the adjacent area one-to-one, determining the sum of all the second products as a fourth intermediate value, and determining the sum of the fourth intermediate value and preset noise data as an error value;
[0031] Based on the gap between the target strategy and the expected strategy, parameters of the frequency regulation model are adjusted; and according to the error value, parameters of the frequency regulation model are adjusted.
[0032] In one embodiment of the present invention, the strategy network and the evaluation network of the frequency regulation model are both convex neural networks, and the convex neural network includes: an input layer, an output layer, and multiple hidden layers, and the hidden layer is located between the input layer and the output layer; the hidden layer is used to perform forward transmission based on a preset first forward transmission weight matrix, a second forward transmission matrix, a bias, and the current power grid state vector, and the step of the hidden layer performing forward transmission includes:
[0033] Determine the product of the first forward transfer weight matrix and the output of the previous layer network as a third product, and determine the product of the second forward transfer matrix and the current power grid state vector as a fourth product;
[0034] Summing the third product, the fourth product and the offset to obtain an intermediate vector;
[0035] The intermediate vector is activated using a preset activation function to obtain an output vector of the current hidden layer.
[0036] The present invention also provides a power grid frequency regulation system, the system comprising: a capacity acquisition module, used to acquire the available energy capacity of electric vehicles in a target area, the available energy capacity refers to the charging and discharging power range of electric vehicles in the target area that can be used for power grid frequency regulation;
[0037] A status information acquisition module is used to acquire power grid status information, wherein the power grid status information is information describing the operation status of the power grid;
[0038] A prediction module, used to input the grid state information into a preset frequency regulation model, perform charge and discharge control strategy prediction, and obtain a target strategy;
[0039] A control module is used to control the charging and discharging of electric vehicles in the target area based on the target strategy if the target strategy meets the constraint of the charging and discharging power range, so as to complete the grid frequency regulation.
[0040] The present invention also provides an electronic device, comprising a processor, a memory and a communication bus; the communication bus is used to connect the processor and the memory; the processor is used to execute a computer program stored in the memory to implement a grid frequency regulation method provided in any one of the above embodiments.
[0041] The present invention also provides a computer-readable storage medium having a computer program stored thereon, wherein the computer program is used to enable a computer to execute the power grid frequency regulation method provided in any one of the above embodiments.
[0042] Beneficial effects of the present invention: The grid frequency regulation method, system, electronic device and storage medium proposed in the present invention obtain the available energy capacity of electric vehicles in the target area, which refers to the charging and discharging power range that electric vehicles in the target area can use for grid frequency regulation; obtain grid status information, which is information describing the operation of the grid; input the grid status information into a preset frequency regulation model, predict the charging and discharging control strategy, and obtain the target strategy; if the target strategy meets the constraints of the charging and discharging power range, then based on the target strategy, the electric vehicles in the target area are charged and discharged to complete the grid frequency regulation. The method can realize real-time dynamic charging and discharging control of electric vehicles in the target area, thereby better ensuring the stability of the grid frequency and at a low cost. BRIEF DESCRIPTION OF THE DRAWINGS
[0043] Figure 1 A schematic diagram of a flow chart of a method for adjusting power grid frequency provided in one embodiment of the present invention;
[0044] Figure 2 A schematic diagram of the structure of a frequency regulation model in a power grid frequency regulation method provided in an embodiment of the present invention;
[0045] Figure 3 It is a structural schematic diagram of a convex neural network in a power grid frequency regulation method provided by an embodiment of the present invention;
[0046] Figure 4 is a structural schematic diagram of a power grid frequency regulation system provided by an embodiment of the present invention;
[0047] Figure 5 A schematic diagram of the signal flow logic of a power grid frequency regulation method provided in one embodiment of the present invention;
[0048] Figure 6 It is a structural schematic diagram of an electronic device provided by an embodiment of the present invention. DETAILED DESCRIPTION
[0049] The following describes the embodiments of the present invention by specific examples, and those skilled in the art can easily understand other advantages and effects of the present invention from the contents disclosed in this specification. The present invention can also be implemented or applied through other different specific embodiments, and the details in this specification can also be modified or changed in various ways based on different viewpoints and applications without departing from the spirit of the present invention. It should be noted that the following embodiments and features in the embodiments can be combined with each other without conflict.
[0050] It should be noted that the illustrations provided in the following embodiments are only schematic illustrations of the basic concept of the present invention, and thus the drawings only show components related to the present invention rather than being drawn according to the number, shape and size of components in actual implementation. In actual implementation, the type, quantity and proportion of each component may be changed arbitrarily, and the component layout may also be more complicated.
[0051] In the following description, numerous details are discussed to provide a more thorough explanation of the embodiments of the present invention. However, it is obvious to those skilled in the art that the embodiments of the present invention can be implemented without these specific details. In other embodiments, well-known structures and devices are shown in the form of block diagrams rather than in detail to avoid making the embodiments of the present invention difficult to understand.
[0052] Combine the following Figures 1 to 6 , the power grid frequency regulation method, system, electronic device and storage medium provided by the present invention are explained.
[0053] See also Figure 1 , Figure 1 A method for adjusting the frequency of a power grid provided by an embodiment of the present invention is as follows: Figure 1 As shown, the method includes:
[0054] S110: Obtaining available energy capacity of electric vehicles in a target area, where the available energy capacity refers to a charging and discharging power range of electric vehicles in the target area that can be used for grid frequency modulation.
[0055] It should be noted that the available energy capacity refers to the power capacity of all electric vehicles participating in the grid frequency regulation in the target area. The charging and discharging power range includes the charging power range and the discharging power range that can be used for grid frequency regulation. By obtaining the available energy capacity of multiple electric vehicles in the target area, it is convenient to subsequently control the charging and discharging of the multiple electric vehicles based on the available energy capacity and grid status information, that is, to control the charging and discharging power of the multiple electric vehicles.
[0056] S120: Acquire power grid status information, where the power grid status information is information describing the operation status of the power grid.
[0057] It should be noted that by acquiring the grid status information, it is possible to subsequently predict the charging and discharging control strategy for electric vehicles in the target area based on the grid status information.
[0058] S130: Inputting the grid state information into a preset frequency regulation model, performing charge and discharge control strategy prediction, and obtaining a target strategy.
[0059] It should be noted that by inputting the grid status information into a preset frequency regulation model, the charging and discharging control strategy is predicted to obtain the target strategy with high accuracy and low cost.
[0060] S140: If the target strategy satisfies the constraint of the charging and discharging power range, then based on the target strategy, the charging and discharging of electric vehicles in the target area are controlled to complete grid frequency regulation.
[0061] It should be noted that by taking the charging and discharging power range as a constraint of the target strategy, the rationality of the target strategy can be ensured while stabilizing the grid frequency. By controlling the charging and discharging of electric vehicles in the target area based on the target strategy when it is determined that the target strategy satisfies the constraint of the charging and discharging power range, the grid frequency can be adjusted well to avoid fluctuations in the grid frequency, with low cost and high accuracy.
[0062] In some embodiments, the step of obtaining the available energy capacity of electric vehicles in the target area includes:
[0063] Firstly, electric vehicles participating in power grid frequency modulation in the target area are determined as target electric vehicles.
[0064] Secondly, the adjustable frequency capacity of each target electric vehicle is collected, where the adjustable frequency capacity refers to the power range within which the target electric vehicle can currently be charged and discharged.
[0065] Finally, the available energy capacity is obtained by summing the adjustable frequency capacities of all the target electric vehicles.
[0066] It should be noted that the mathematical expression for obtaining the available energy capacity of electric vehicles in the target area is:
[0067]
[0068] Among them, U i represents the available energy capacity of target area i, r represents the rth electric vehicle participating in grid frequency regulation in target area i, n represents the number of electric vehicles participating in grid frequency regulation in target area i, and p i,r It represents the adjustable frequency capacity of the rth electric vehicle participating in the grid frequency regulation in the target area i. Through the above steps, the adjustable frequency capacity of multiple target electric vehicles in the target area can be well integrated to obtain the available energy capacity of the target area.
[0069] It should also be noted that, based on the target strategy, the charging and discharging control of the electric vehicles in the target area to complete the grid frequency regulation is mathematically expressed as:
[0070]
[0071] Among them, u i,r represents the control strategy or control signal for the rth electric vehicle in target area i, u i represents the target strategy, u i ≥0 means that the current target strategy is the discharge strategy, that is, the vehicles in the target area i are controlled to discharge, u i <0 means that the current target strategy is the charging strategy, that is, charging the vehicles in the target area i. represents the total discharge power range of electric vehicles in target area i that can be used to participate in grid frequency regulation, represents the total charging power range that electric vehicles in target area i can use to participate in grid frequency regulation, represents the discharge power range of the rth electric vehicle in the target area i, represents the charging power range of the rth electric vehicle in the target area i. i,r , the charging and discharging control of multiple electric vehicles in the target area can be completed, thereby completing the grid frequency regulation.
[0072] In some embodiments, the grid state information includes multiple grid state vectors, the multiple grid state vectors are arranged in time sequence, the grid state vectors are deviation vectors of grid state information at adjacent moments, and the grid state information includes grid frequency information.
[0073] It should be noted that the grid state vector is the deviation vector between the grid state information at the current moment and the grid state information at the previous moment, that is, the vector corresponding to the deviation between the grid state information at the current moment and the grid state information at the previous moment. For example: the grid state vector at time k is the deviation vector between the grid state information at time k and the grid state information at time k-1. In some embodiments, the grid state information also includes: turbine power, tie line active power, and regional control error, etc.
[0074] In some embodiments, the grid state information is input into a preset frequency regulation model to predict the charge and discharge control strategy, and the step of obtaining the target strategy includes:
[0075] 1. Inputting the plurality of grid state vectors into the strategy network of the frequency regulation model, predicting the charge and discharge control strategy, and obtaining a plurality of initial strategies, wherein the initial strategies correspond one-to-one to the grid state vectors.
[0076] 2. Input the initial strategy into the evaluation network of the frequency regulation model to obtain an evaluation value output by the evaluation network, wherein the evaluation value corresponds to the initial strategy one by one.
[0077] 3. Based on the evaluation value and a preset objective function, the policy network is parameter adjusted so that the policy network outputs a new control strategy until the evaluation value of the control strategy converges to the objective function, and the objective function is to minimize the evaluation value.
[0078] Fourth, the power grid state vector closest to the current moment is determined as the target state vector, and the final control strategy corresponding to the target state vector is determined as the target strategy.
[0079] It should be noted that the strategy network is used to learn the optimal control strategy, and the evaluation network is used to evaluate the quality of the current control strategy to adjust the parameters of the strategy network. By setting the above strategy network and the evaluation network, a target strategy with high accuracy can be obtained, which is used to control the charging and discharging of electric vehicles in the target area.
[0080] It should also be noted that the frequency regulation model in the above steps adopts a reinforcement learning method, which relies on data and is not restricted by the system model, and can better cope with the problem of analytical modeling of the power grid system.
[0081] In some embodiments, the step of inputting the initial strategy into the evaluation network of the frequency regulation model to obtain the evaluation value output by the evaluation network includes:
[0082] 1. Determine the modulus of the initial strategy as a first value, and determine the modulus of the power grid state vector corresponding to the initial strategy as a second value.
[0083] 2. Determine the product of the first value and a preset first weight as a first intermediate value, and determine the product of the second value and a preset second weight as a second intermediate value.
[0084] 3. Determine the sum of the first intermediate value and the second intermediate value as a target value, wherein the target value corresponds to the initial strategy one by one; and the sum of the first weight and the second weight is 1.
[0085] 4. If the target value is less than or equal to the preset cost threshold, the immediate value of the current initial strategy is determined as the preset first-generation value; if the target value is greater than the cost threshold, the immediate value of the current initial strategy is determined as the preset second-generation value; the first-generation value is less than the second-generation value.
[0086] 5. According to the instantaneous value of each of the initial strategies, an evaluation value of each of the initial strategies is obtained. The evaluation value of each of the initial strategies is obtained based on the instantaneous value of the target initial strategy. The target initial strategy refers to the initial strategy corresponding to the target grid state vector. The target grid state vector refers to the grid state vector located after the current grid state vector.
[0087] It should be noted that, through the above steps, the accuracy of the evaluation value can be improved well, thereby improving the accuracy of the entire frequency regulation model.
[0088] In some embodiments, according to the instantaneous value of each of the initial strategies, the step of obtaining the evaluation value of each of the initial strategies comprises:
[0089] 1. Obtain all the target initial strategies of the current initial strategy.
[0090] 2. Determine the instantaneous value of the target initial strategy as the target cost value.
[0091] 3. Multiply each of the target cost values by a preset decay rate value to obtain a plurality of third intermediate values, wherein the target cost value corresponds to the decay rate value in a one-to-one manner. The decay rate value can be set according to actual conditions.
[0092] Fourth, the sum of all the third intermediate values is determined as the evaluation value of the current initial strategy, and the remaining initial strategies are traversed to obtain the evaluation values of the remaining initial strategies.
[0093] It should be noted that, through the above steps, the accuracy of the obtained evaluation value can be effectively improved.
[0094] It should also be noted that the mathematical expression for obtaining the instant value is:
[0095]
[0096] Among them, q i (k) is the instantaneous cost function, i.e., the value of the current era, k represents the kth moment, λ1 is the first weight, λ2 is the second weight, λ1+λ2=1, ||·|| represents the modulus of the vector, x i (k) represents the grid state vector, u i (k) represents the initial strategy at time k, and f represents the preset cost threshold, which can be set according to actual conditions. i The smaller (k) is, the more stable it is. i The larger (k) is, the greater the volatility is.
[0097] It should be mentioned that the mathematical expression for obtaining the evaluation value of the initial strategy is:
[0098] Q i (k) = η m q i (k+1)+η m-1 q i (k+2)+...η m+1 q i (m)+...
[0099] Among them, Q i (k) represents the cost function, i.e. the evaluation value, η∈(0,1) is the decay rate value, and m is a preset positive integer that can be set according to the actual situation. i (·) Values for the target at different times.
[0100] It is also worth mentioning that under the optimal trajectory, Q i The iterative formula of (k) can be expressed as follows:
[0101] Q i (k) = ηQ i (k-1)-η N+1 q i (k)
[0102] Wherein, N represents the number of grid state vectors.
[0103] In some embodiments, after the step of inputting the grid state information into a preset frequency regulation model, predicting the charge and discharge control strategy, and obtaining the target strategy, the following steps are further included:
[0104] 1. Obtain an expected strategy corresponding to the target strategy, wherein the expected strategy is a preset strategy; and, determine an area adjacent to the target area as an adjacent area, obtain a power grid state vector of the adjacent area, determine the power grid state vector of the adjacent area as an adjacent state vector, determine the product of the adjacent state vector and the acquired power grid state matrix of the adjacent area as a first product, determine the product of the first product and a preset interference gain as a second product, the second product corresponds to the adjacent area one-to-one, determine the sum of all the second products as a fourth intermediate value, and determine the sum of the fourth intermediate value and preset noise data as an error value.
[0105] 2. Based on the gap between the target strategy and the expected strategy, adjusting the parameters of the frequency regulation model; and, according to the error value, adjusting the parameters of the frequency regulation model.
[0106] It should be noted that by adopting the above method, the accuracy of the frequency regulation model can be improved well.
[0107] The mathematical expression of the error value is:
[0108]
[0109] Among them, λ i represents the error value, b represents the number of adjacent areas, δ ji Denotes the interference gain, G ji represents the grid status matrix of neighboring area j, x j (k) represents the power grid state vector of neighboring area j, E i represents the noise gain, ω i (k) represents the noise matrix, E i ω i (k) represents the noise data.
[0110] It should be mentioned that the frequency dynamic characteristics of the power grid are expressed as:
[0111] x i (k+1)=A i x i (k)+B i [u i (k)-u id (k)]+λ i
[0112] Among them, x i (k+1) represents the power grid state vector at time k+1, A i represents the system state matrix, that is, the matrix corresponding to the power grid state information, B i represents the system input gain, u i (k) represents the target strategy at time k, u id (k) represents the expected strategy.
[0113] It should be noted that the desired control input u id (k) is actually the optimal controllable active power injected by the power grid system where the target area i is located, so u id (k) can be expressed as follows:
[0114]
[0115] in, Indicates the preset damping coefficient, Δf i Indicates frequency deviation, M i Indicates the preset inertia constant, D i Indicates the preset damping coefficient, T ji represents the preset synchronization constant, Δt represents the preset time period, ΔP mirepresents the active power deviation of the turbine, P vi represents the active power deviation of the electric vehicle, N(i) represents the area connected to area i through the tie line, ΔP tie,j Indicates the active power deviation of the tie line.
[0116] If the gap between the target strategy and the expected strategy is bounded, and the error value is bounded, it means that the power grid system is in a stable state, that is, bounded stability. Therefore, through the above steps, the frequency deviation (frequency change) of the power grid can be reduced to 0 or constrained to a smaller fixed interval, effectively improving the accuracy of the frequency regulation model.
[0117] Figure 2 A schematic diagram of the structure of a frequency regulation model in a power grid frequency regulation method provided in an embodiment of the present invention, such as Figure 2 As shown in Figure 1, the frequency regulation model includes a strategy network and an evaluation network. The evaluation network is used to evaluate the quality of the current control strategy so as to adjust the parameters of the strategy network. There is interaction and interference between power grids i and j.
[0118] In some embodiments, the strategy network and the evaluation network of the frequency regulation model are both convex neural networks, and the convex neural network includes: an input layer, an output layer, and multiple hidden layers, and the hidden layer is located between the input layer and the output layer; the hidden layer is used for forward transmission based on a preset first forward transmission weight matrix, a second forward transmission matrix, a bias, and the current grid state vector. It should be noted that the convex neural network can transform the nonlinear optimization problem in the evaluation network into a convex optimization problem, avoiding the occurrence of local optimality in the optimization process, while ensuring that the strategy network can output a nearly optimal control strategy, that is, a target strategy.
[0119] The step of forward transmission of the hidden layer includes:
[0120] 1. Determine the product of the first forward transfer weight matrix and the output of the previous layer network as the third product, and determine the product of the second forward transfer matrix and the current power grid state vector as the fourth product.
[0121] 2. Summing the third product, the fourth product and the offset to obtain an intermediate vector.
[0122] 3. Using a preset activation function, activate the intermediate vector to obtain the output vector of the current hidden layer.
[0123] It should be noted that since the forward weight matrix is non-negative, it may cause loss of network representability. Therefore, in order to improve the representation ability of the network while ensuring the convexity of the network, the above embodiment adds direct transmission from the input layer to each hidden layer, that is, the power grid state vector in the input layer is transmitted to each hidden layer respectively, and forward transmission is performed.
[0124] It should also be noted that the mathematical expression of the output vector of the hidden layer is:
[0125]
[0126] Among them, y i represents the output vector of the i-th hidden layer, represents the activation function, represents the first forward pass weight matrix of layer i-1, z i-1 represents the output of the previous layer of network, represents the second forward pass matrix, x i represents the current grid state vector, b i-1 represents the bias of layer i-1, Represents the first forward pass weight matrix of layer 0.
[0127] Figure 3 is a schematic diagram of the structure of a convex neural network in a grid frequency regulation method provided by an embodiment of the present invention, such as Figure 3 As shown, the convex neural network has an input layer, an output layer, and multiple hidden layers. Each hidden layer is based on the first forward pass weight matrix (such as Figure 3 In as well as The product of the output of the previous layer network, the second forward transfer matrix (such as Figure 3 In and w i etc.), and the current grid state vector x i Perform a forward pass to output y i . Figure 3 b0, b1, ..., b n represents the bias of each hidden layer.
[0128] It should be mentioned that in this embodiment, ReLU (Rectified Linear Unit) is selected as the activation function. The output of the entire network (policy network or evaluation network) can be expressed as follows:
[0129]
[0130] Among them, Y irepresents the output of the entire network, w i represents the forward transfer matrix of the output layer, b n Represents the bias of the nth layer.
[0131] The above embodiments allow electric vehicles to participate in the frequency regulation of the power grid, so that electric vehicles can flexibly respond to the frequency regulation of the power grid and operate in coordination, thereby effectively reducing the load pressure and frequency fluctuation of the power grid. This coordinated development helps to improve the stability, flexibility and sustainability of the power grid, while also providing better charging services and operating environment for electric vehicles.
[0132] The power grid frequency regulation system provided by the present invention is described below. The power grid frequency regulation system described below and the power grid frequency regulation method described above can be referenced to each other.
[0133] Please refer to Figure 4 , the power grid frequency regulation system provided in this embodiment includes:
[0134] The capacity acquisition module 410 is used to acquire the available energy capacity of electric vehicles in the target area, where the available energy capacity refers to the charging and discharging power range of electric vehicles in the target area that can be used for grid frequency modulation;
[0135] The state information acquisition module 420 is used to acquire the state information of the power grid, wherein the state information of the power grid is information describing the operation status of the power grid;
[0136] A prediction module 430 is used to input the grid state information into a preset frequency regulation model to predict the charge and discharge control strategy and obtain a target strategy;
[0137] The control module 440 is used to control the charging and discharging of the electric vehicles in the target area based on the target strategy if the target strategy meets the constraints of the charging and discharging power range, so as to complete the grid frequency regulation. The capacity acquisition module 410, the state information acquisition module 420, the prediction module 430, and the control module 440 are connected. The grid frequency regulation system in this embodiment can realize real-time dynamic charging and discharging control of electric vehicles in the target area, thereby better ensuring the stability of the grid frequency, with high accuracy and low cost.
[0138] In some embodiments, the capacity acquisition module 410 is specifically used to determine the electric vehicles participating in the grid frequency modulation in the target area as target electric vehicles;
[0139] Collecting the adjustable frequency capacity of each target electric vehicle, where the adjustable frequency capacity refers to the power range within which the target electric vehicle can currently be charged and discharged;
[0140] The available energy capacity is obtained by summing the adjustable frequency capacities of all the target electric vehicles.
[0141] In some embodiments, the prediction module 430 is specifically used to input the plurality of grid state vectors into the strategy network of the frequency regulation model, perform charge and discharge control strategy prediction, and obtain a plurality of initial strategies, wherein the initial strategies correspond one-to-one to the grid state vectors;
[0142] Inputting the initial strategy into the evaluation network of the frequency regulation model to obtain an evaluation value output by the evaluation network, wherein the evaluation value corresponds to the initial strategy in a one-to-one manner;
[0143] Based on the evaluation value and a preset objective function, adjusting parameters of the strategy network so that the strategy network outputs a new control strategy until the evaluation value of the control strategy converges to the objective function, wherein the objective function is to minimize the evaluation value;
[0144] The power grid state vector closest to the current moment is determined as the target state vector, and the final control strategy corresponding to the target state vector is determined as the target strategy.
[0145] In some embodiments, the prediction module 430 is further specifically configured to determine the modulus of the initial strategy as a first value, and determine the modulus of the power grid state vector corresponding to the initial strategy as a second value;
[0146] Determine the product of the first value and a preset first weight as a first intermediate value, and determine the product of the second value and a preset second weight as a second intermediate value;
[0147] Determine the sum of the first intermediate value and the second intermediate value as a target value, wherein the target value corresponds to the initial strategy one by one; the sum of the first weight and the second weight is 1;
[0148] If the target value is less than or equal to the preset cost threshold, the instantaneous value of the current initial strategy is determined as the preset first-generation value; if the target value is greater than the cost threshold, the instantaneous value of the current initial strategy is determined as the preset second-generation value; the first-generation value is less than the second-generation value;
[0149] According to the instantaneous value of each of the initial strategies, an evaluation value of each of the initial strategies is obtained, and the evaluation value of each of the initial strategies is obtained based on the instantaneous value of the target initial strategy. The target initial strategy refers to the initial strategy corresponding to the target power grid state vector, and the target power grid state vector refers to the power grid state vector located after the current power grid state vector.
[0150] In some embodiments, the prediction module 430 is further specifically used to obtain all the target initial strategies of the current initial strategy;
[0151] Determining the instantaneous value of the target initial strategy as a target cost value;
[0152] Multiplying each of the target cost values by a preset decay rate value to obtain a plurality of third intermediate values, wherein the target cost values correspond to the decay rate values one by one;
[0153] The sum of all the third intermediate values is determined as the evaluation value of the current initial strategy, and the remaining initial strategies are traversed to obtain the evaluation values of the remaining initial strategies.
[0154] In some embodiments, it also includes: a model learning module, which is used to obtain an expected strategy corresponding to the target strategy, wherein the expected strategy is a preset strategy; and, an area adjacent to the target area is determined as a neighboring area, a power grid state vector of the neighboring area is obtained, the power grid state vector of the neighboring area is determined as a neighboring state vector, the product between the neighboring state vector and the acquired power grid state matrix of the neighboring area is determined as a first product, the product between the first product and a preset interference gain is determined as a second product, the second product corresponds to the neighboring area one by one, the sum of all the second products is determined as a fourth intermediate value, and the sum between the fourth intermediate value and the preset noise data is determined as an error value;
[0155] Based on the gap between the target strategy and the expected strategy, parameters of the frequency regulation model are adjusted; and according to the error value, parameters of the frequency regulation model are adjusted.
[0156] In some embodiments, the strategy network and the evaluation network of the frequency regulation model are both convex neural networks, and the convex neural network includes: an input layer, an output layer, and multiple hidden layers, and the hidden layer is located between the input layer and the output layer; the hidden layer is used to perform forward transfer based on a preset first forward transfer weight matrix, a second forward transfer matrix, a bias, and the current power grid state vector, and the hidden layer is used to determine the product between the first forward transfer weight matrix and the output of the previous layer of the network as a third product, and the product between the second forward transfer matrix and the current power grid state vector as a fourth product;
[0157] Summing the third product, the fourth product and the offset to obtain an intermediate vector;
[0158] The intermediate vector is activated using a preset activation function to obtain an output vector of the current hidden layer.
[0159] Figure 5 This is a schematic diagram of the signal flow logic (hardware level) of the power grid frequency regulation method provided in one embodiment of the present invention. Figure 5 Regarding the signal flow process of the grid frequency regulation method, first, the adjustable frequency capacity of multiple electric vehicles in the target area is collected by a preset EV aggregator, and the available energy capacity U of the target area is obtained according to the adjustable frequency capacity. i . Will U i The grid state information is sent to the V2G (Vehicle-to-Grid) controller. At the same time, the grid (grid system / smart grid) sends the grid state information to the V2G controller. The grid state information includes multiple grid state vectors x i Secondly, the V2G controller uses the grid status information and available energy capacity U i , predict the charge and discharge control strategy and get the target strategy u i , and the target strategy u i Then, the EV aggregator uses the target policy u i , get u i,r , based on u i,r The charging and discharging of electric vehicles in the target area is controlled. The electric vehicles and the power grid exchange energy through the preset charging and discharging coordinator.
[0160] In some embodiments, an electronic device is also provided, which may be a server, and its internal structure is shown in FIG. Figure 6 As shown. The electronic device includes a processor, a memory, a network interface and a database connected via a system bus. The processor of the electronic device is used to provide computing and control capabilities. The memory of the electronic device includes a non-volatile and / or volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system, a computer program and a database. The internal memory provides an environment for the operation of the operating system and the computer program in the non-volatile storage medium. The network interface of the electronic device is used to communicate with an external client via a network connection. When the computer program is executed by the processor, the functions or steps on the server side of the above method are implemented.
[0161] In some embodiments, an electronic device is provided, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor implements the following steps when executing the computer program: obtaining available energy capacity of electric vehicles in a target area, wherein the available energy capacity refers to a charging and discharging power range that electric vehicles in the target area can use for grid frequency regulation; obtaining grid status information, wherein the grid status information is information describing the operation status of the grid; inputting the grid status information into a preset frequency regulation model, performing charge and discharge control strategy prediction, and obtaining a target strategy; if the target strategy satisfies the constraints of the charge and discharge power range, then based on the target strategy, performing charge and discharge control on the electric vehicles in the target area to complete grid frequency regulation.
[0162] In some embodiments, a computer-readable storage medium is provided, on which a computer program is stored, and when the computer program is executed by a processor, the following steps are implemented: obtaining the available energy capacity of electric vehicles in a target area, wherein the available energy capacity refers to the charging and discharging power range that electric vehicles in the target area can use for grid frequency regulation; obtaining grid status information, wherein the grid status information is information describing the operation status of the grid; inputting the grid status information into a preset frequency regulation model, performing charge and discharge control strategy prediction, and obtaining a target strategy; if the target strategy meets the constraints of the charge and discharge power range, then based on the target strategy, performing charge and discharge control on the electric vehicles in the target area to complete grid frequency regulation.
[0163] It should be noted that the above functions or steps that can be implemented by the computer-readable storage medium or electronic device can refer to the relevant descriptions on the server side and the client side in the aforementioned method embodiment. To avoid repetition, they will not be described one by one here.
[0164] The flow chart and block diagram in the accompanying drawings illustrate the possible implementation architecture, function and operation of the method and computer program product according to various embodiments of the present disclosure. In this regard, each square box in the flow chart or block diagram can represent a module, a program segment, or a part of a code, and the module, program segment, or a part of a code contains one or more executable instructions for realizing the specified logical function. It should also be noted that in some implementations as replacements, the functions marked in the square box can also occur in a sequence different from that marked in the accompanying drawings. For example, two square boxes represented in succession can actually be executed substantially in parallel, and they can sometimes be executed in the opposite order, depending on the functions involved. It should also be noted that each square box in the block diagram and / or flow chart, and the combination of the square boxes in the block diagram and / or flow chart can be implemented with a dedicated hardware-based system that performs a specified function or operation, or can be implemented with a combination of dedicated hardware and computer instructions.
[0165] The above embodiments are merely illustrative of the principles and effects of the present invention, and are not intended to limit the present invention. Anyone familiar with the art may modify or alter the above embodiments without departing from the spirit and scope of the present invention. Therefore, all equivalent modifications or alterations made by a person of ordinary skill in the art without departing from the spirit and technical concept disclosed by the present invention shall still be covered by the claims of the present invention.
Claims
1. A method for regulating power grid frequency, characterized in that: include: Obtaining the available energy capacity of electric vehicles in the target area, where the available energy capacity refers to the charging and discharging power range of electric vehicles in the target area that can be used for grid frequency modulation; Acquiring power grid status information, wherein the power grid status information is information describing the operation status of the power grid; Inputting the grid state information into a preset frequency regulation model to predict the charge and discharge control strategy and obtain a target strategy; If the target strategy satisfies the constraint of the charging and discharging power range, then based on the target strategy, the charging and discharging of electric vehicles in the target area are controlled to complete the grid frequency regulation.
2. The method for adjusting the power grid frequency according to claim 1, characterized in that: The steps of obtaining the available energy capacity of electric vehicles in the target area include: Determine the electric vehicles participating in the power grid frequency modulation in the target area as target electric vehicles; Collecting the adjustable frequency capacity of each target electric vehicle, where the adjustable frequency capacity refers to the power range within which the target electric vehicle can currently be charged and discharged; The available energy capacity is obtained by summing the adjustable frequency capacities of all the target electric vehicles.
3. The method for adjusting the power grid frequency according to claim 1, characterized in that: The grid state information includes a plurality of grid state vectors, the plurality of grid state vectors are arranged in time sequence, the grid state vectors are deviation vectors of grid state information at adjacent moments, and the grid state information includes grid frequency information; The grid state information is input into a preset frequency regulation model to predict the charge and discharge control strategy, and the steps of obtaining the target strategy include: Inputting the plurality of grid state vectors into the strategy network of the frequency regulation model to predict the charge and discharge control strategy to obtain a plurality of initial strategies, wherein the initial strategies correspond one-to-one to the grid state vectors; Inputting the initial strategy into the evaluation network of the frequency regulation model to obtain an evaluation value output by the evaluation network, wherein the evaluation value corresponds to the initial strategy in a one-to-one manner; Based on the evaluation value and a preset objective function, adjusting parameters of the strategy network so that the strategy network outputs a new control strategy until the evaluation value of the control strategy converges to the objective function, wherein the objective function is to minimize the evaluation value; The power grid state vector closest to the current moment is determined as the target state vector, and the final control strategy corresponding to the target state vector is determined as the target strategy.
4. The method for adjusting the power grid frequency according to claim 3, characterized in that: The step of inputting the initial strategy into the evaluation network of the frequency regulation model to obtain the evaluation value output by the evaluation network comprises: Determine the modulus of the initial strategy as a first value, and determine the modulus of the power grid state vector corresponding to the initial strategy as a second value; Determine the product of the first value and a preset first weight as a first intermediate value, and determine the product of the second value and a preset second weight as a second intermediate value; Determine the sum of the first intermediate value and the second intermediate value as a target value, wherein the target value corresponds to the initial strategy one by one; the sum of the first weight and the second weight is 1; If the target value is less than or equal to the preset cost threshold, the instantaneous value of the current initial strategy is determined as the preset first-generation value; if the target value is greater than the cost threshold, the instantaneous value of the current initial strategy is determined as the preset second-generation value; the first-generation value is less than the second-generation value; According to the instantaneous value of each of the initial strategies, an evaluation value of each of the initial strategies is obtained, and the evaluation value of each of the initial strategies is obtained based on the instantaneous value of the target initial strategy. The target initial strategy refers to the initial strategy corresponding to the target power grid state vector, and the target power grid state vector refers to the power grid state vector located after the current power grid state vector.
5. The method for adjusting the power grid frequency according to claim 4, characterized in that: The step of obtaining the evaluation value of each initial strategy according to the instantaneous value of each initial strategy comprises: Obtain all the target initial strategies of the current initial strategy; Determining the instantaneous value of the target initial strategy as a target cost value; Multiplying each of the target cost values by a preset decay rate value to obtain a plurality of third intermediate values, wherein the target cost values correspond to the decay rate values one by one; The sum of all the third intermediate values is determined as the evaluation value of the current initial strategy, and the remaining initial strategies are traversed to obtain the evaluation values of the remaining initial strategies.
6. The method for adjusting the power grid frequency according to claim 1, characterized in that: After the step of inputting the grid state information into a preset frequency regulation model to predict the charge and discharge control strategy and obtain the target strategy, the method further includes: Obtaining an expected strategy corresponding to the target strategy, wherein the expected strategy is a preset strategy; and determining an area adjacent to the target area as an adjacent area, obtaining a power grid state vector of the adjacent area, determining the power grid state vector of the adjacent area as an adjacent state vector, determining the product of the adjacent state vector and the acquired power grid state matrix of the adjacent area as a first product, determining the product of the first product and a preset interference gain as a second product, wherein the second product corresponds to the adjacent area one-to-one, determining the sum of all the second products as a fourth intermediate value, and determining the sum of the fourth intermediate value and preset noise data as an error value; Based on the gap between the target strategy and the expected strategy, parameters of the frequency regulation model are adjusted; and according to the error value, parameters of the frequency regulation model are adjusted.
7. The method for adjusting the power grid frequency according to any one of claims 3 to 5, characterized in that: The strategy network and the evaluation network of the frequency regulation model are both convex neural networks, and the convex neural network includes: an input layer, an output layer, and multiple hidden layers, and the hidden layer is located between the input layer and the output layer; the hidden layer is used to perform forward transmission based on a preset first forward transmission weight matrix, a second forward transmission matrix, a bias, and the current power grid state vector, and the steps of the hidden layer performing forward transmission include: Determine the product of the first forward transfer weight matrix and the output of the previous layer network as a third product, and determine the product of the second forward transfer matrix and the current power grid state vector as a fourth product; Summing the third product, the fourth product and the offset to obtain an intermediate vector; The intermediate vector is activated using a preset activation function to obtain an output vector of the current hidden layer.
8. A power grid frequency regulation system, characterized in that: include: A capacity acquisition module, used to acquire the available energy capacity of electric vehicles in a target area, wherein the available energy capacity refers to the charging and discharging power range of electric vehicles in the target area that can be used for grid frequency modulation; A status information acquisition module is used to acquire power grid status information, wherein the power grid status information is information describing the operation status of the power grid; A prediction module, used to input the grid state information into a preset frequency regulation model, perform charge and discharge control strategy prediction, and obtain a target strategy; A control module is used to control the charging and discharging of electric vehicles in the target area based on the target strategy if the target strategy meets the constraint of the charging and discharging power range, so as to complete the grid frequency regulation.
9. An electronic device, characterized in that: It comprises a processor, a memory and a communication bus; the communication bus is used to connect the processor and the memory; the processor is used to execute a computer program stored in the memory to implement the grid frequency regulation method as described in any one of claims 1 to 7.
10. A computer-readable storage medium, characterized in that: A computer program is stored thereon, and the computer program is used to enable a computer to execute the grid frequency regulation method as described in any one of claims 1 to 7.
