Coordination of Multiple Flexible Resources Considering Virtual Power Plants and Emergency Frequency Control

: High-voltage direct current (HVDC) blocking disturbance leads to large power losses in the receiving-end power grid, and the event-driven emergency frequency control (EFC) is an important measure to prevent large frequency deviation. By aggregating controllable distributed energy resources (DERs) on the demand side, a virtual power plant (VPP) could quickly reduce its power and can be a new fast response resource for EFC. Considering both the VPP and the traditional control resources, this paper proposes an optimized EFC strategy coordinating multiple resources for the receiving-end power grid with multi-infeed HVDC. The approximate aggregation model of the VPP response process is constructed, based on which the EFC strategy, aiming at minimizing the total control cost while meeting constraints on rotor angle stability and frequency deviation security, is proposed. The electromechanical transient simulation combined with particle swarm optimization (PSO) is utilized to solve the model, and parallel computation is utilized to accelerate the solving process. The effectiveness of the proposed EFC strategy is veriﬁed by a provincial receiving-end power grid with multi-infeed HVDC. The detailed simulation results show that VPP could dramatically reduce the control cost of EFC while maintaining the same stability margin.


Introduction
When the primary energy is far from the load center, transmitting large amounts of power with minimum losses is necessary. In China, large energy bases such as coal resources, wind and photovoltaic energy resources are mainly distributed in the northwestern provinces, while the load centers are in the eastern coastal areas. In order to transmit large-capacity power to load centers over long distances, several high-voltage direct current (HVDC) transmission lines have been built in China in recent years [1]. The high proportion of HVDC transmission operation power to the total demand of the receiving-end power grid replaces many synchronous generators, leading to the decline of system inertia [2,3]. A disturbance with the same amount of power loss can cause a larger rate of change of frequency and a larger frequency deviation under low inertia conditions [4,5]. In recent years, several HVDC blocking disturbances occurred. For example, in September 2015, a ±800 kV HVDC bipolar blocking disturbance caused the power system frequency to drop to 49.56 Hz in the East China Power Grid [6,7].
To prevent large frequency deviations caused by large power losses, emergency frequency control (EFC) is adopted to prevent the frequency from falling below the underfrequency load-shedding threshold [8]. For a HVDC blocking disturbance, the event-driven EFC can act immediately after disturbance to quickly reduce the active power imbalance and ensure system frequency stability [9]. For the receiving-end power grid with multiinfeed HVDC, EFC measures include HVDC emergency power support, cutting out any above works mainly focus on presenting quantitative indicators for the priority of singletype DERs.
With the help of the Internet of Things and low-latency communication such as 5G, VPP can realize high-precision condition monitoring and low-latency transmission of control instructions with massive DER devices [35][36][37]. VPP aggregates devices that guarantee user comfort to participate in EFC, reducing the impact of the ELS on residents, so its control cost is lower than the ELS. The response speed and control cost of ELS and VPP are complementary. However, few works have been focused on the coordination of VPP emergency power regulation (VEPR) with the existing control resources for EFC. Moreover, DERs are dispersed, and their communication means can be diverse. Therefore, the difference in communication delay and response speed of different DER devices should be considered when constructing the VPP response process for EFC decision-making. Meanwhile, there are several DERs types in VPP, and the response priority of DERs needs to consider the differences in the flexible duration between different devices.
To further reduce the EFC control cost for the receiving-end power grid and make full use of the massive controllable DERs on the demand side, this paper manages and controls the demand-side DERs in the form of VPP to provide VEPR and proposes an EFC strategy with the coordinating multiple control resources. The main contributions of this paper are three-fold. Firstly, an EFC strategy with multiple resources coordination for dealing with a HVDC blocking disturbance at the receiving-end power grid is proposed to minimize the total control cost while meeting constraints on rotor angle stability and frequency deviation security. Secondly, the approximate aggregation model of the VPP response process is constructed to consider the difference in communication delay and response speed between different DER devices. Finally, a bi-level optimization model is used to realize the EFC strategy. In the upper-level model, the decision table for EFC is made online by the dispatching center, which is solved by electromechanical transient simulation combined with the improved particle swarm optimization (PSO) algorithm. In the lower-level VPP instruction allocation, the dynamic response priority sequence of DERs is constructed based on the improved time margin and state margin of DER devices.
The remainder of this paper is organized as follows. Section 2 introduces the hierarchical management and control architecture of DERs in the form of VPP and the bi-level optimization scheme of EFC. Section 3 describes the EFC strategy with multi-resource coordination in the dispatching center. Section 4 introduces the dynamic response priority formulation and control instruction allocation strategy in the VPP control center. In Section 5, the case study is carried out, and the discussions for practical implementations are given. Finally, conclusions are drawn in Section 6.

Multiple Resources Coordination Control Framework for EFC
The number of DER devices is huge, and the regulation capability of individual devices is limited, so they cannot be directly controlled by the grid dispatching center. Fortunately, the form of VPP can aggregate a cluster of limited-capacity and dispersed DERs to participate in bulk grid stability control. There may be several auxiliary services that VPP can provide, in order to realize the decoupling of different control objectives; this paper proposes a hierarchical control architecture to manage DERs, as shown in Figure 1. There are four layers, which are DERs devices, a VPP control center, a VPP cloud control platform, and a grid dispatching center from bottom to top. Appl. Sci. 2023, 13,   When participating in EFC, a VPP is required to fully respond to the allocated capacity within 1 s after receiving the control instruction, which is the same response speed as fast frequency response. For EFC, the communication between the VPP control center and the DERs adopts a low-delay communication technology, such as optical fibers or 5G. To achieve a rapid power decrease, EV can immediately stop charging or reverse discharge, and AC can immediately shut down. To reduce the computational burden of VEPR capacity evaluation, the cloud-side collaboration technique is adopted in this paper. The intelligent terminal unit (ITU) of the DER evaluates the EPR capacity of individual devices based on the current status of the DER device, device constraints, and user comfort settings. The ITU sends the evaluation result to the VPP control center, and then the VPP control center can refresh its EPR capability periodically. The VEPR capacity of all VPPs in the receiving power grid will be aggregated through the VPPs cloud control platform to the grid dispatching center for online EFC decision-making.
The hierarchical management architecture of DERs decouples the VPP regulation capacity aggregation and control instruction allocation between different layers. For the grid dispatching center, the VPPs connected to the transmission bus can be regarded as controllable loads.
The resources for EFC considered in this work include HVDC emergency power support, ELS and VEPR. This work proposes a bi-level optimized EFC caused by HVDC blocking. Figure 2 shows the EFC framework.    When participating in EFC, a VPP is required to fully respond to the allocated capacity within 1 s after receiving the control instruction, which is the same response speed as fast frequency response. For EFC, the communication between the VPP control center and the DERs adopts a low-delay communication technology, such as optical fibers or 5G. To achieve a rapid power decrease, EV can immediately stop charging or reverse discharge, and AC can immediately shut down. To reduce the computational burden of VEPR capacity evaluation, the cloud-side collaboration technique is adopted in this paper. The intelligent terminal unit (ITU) of the DER evaluates the EPR capacity of individual devices based on the current status of the DER device, device constraints, and user comfort settings. The ITU sends the evaluation result to the VPP control center, and then the VPP control center can refresh its EPR capability periodically. The VEPR capacity of all VPPs in the receiving power grid will be aggregated through the VPPs cloud control platform to the grid dispatching center for online EFC decision-making.
The hierarchical management architecture of DERs decouples the VPP regulation capacity aggregation and control instruction allocation between different layers. For the grid dispatching center, the VPPs connected to the transmission bus can be regarded as controllable loads.
The resources for EFC considered in this work include HVDC emergency power support, ELS and VEPR. This work proposes a bi-level optimized EFC caused by HVDC blocking. Figure 2 shows the EFC framework.  When participating in EFC, a VPP is required to fully respond to the allocated capacity within 1 s after receiving the control instruction, which is the same response speed as fast frequency response. For EFC, the communication between the VPP control center and the DERs adopts a low-delay communication technology, such as optical fibers or 5G. To achieve a rapid power decrease, EV can immediately stop charging or reverse discharge, and AC can immediately shut down. To reduce the computational burden of VEPR capacity evaluation, the cloud-side collaboration technique is adopted in this paper. The intelligent terminal unit (ITU) of the DER evaluates the EPR capacity of individual devices based on the current status of the DER device, device constraints, and user comfort settings. The ITU sends the evaluation result to the VPP control center, and then the VPP control center can refresh its EPR capability periodically. The VEPR capacity of all VPPs in the receiving power grid will be aggregated through the VPPs cloud control platform to the grid dispatching center for online EFC decision-making.
The hierarchical management architecture of DERs decouples the VPP regulation capacity aggregation and control instruction allocation between different layers. For the grid dispatching center, the VPPs connected to the transmission bus can be regarded as controllable loads.
The resources for EFC considered in this work include HVDC emergency power support, ELS and VEPR. This work proposes a bi-level optimized EFC caused by HVDC blocking. Figure 2 shows the EFC framework.    Through the aggregation and disaggregation roles of VPP, when massive controllable DERs participate in EFC, the decision complexity can be reduced by hierarchical optimization. The upper-level optimization model is a multiple resources coordination scheme with minimal control cost solved by the grid dispatching center. The participation of VEPR can reduce the impact of ELS on residents' lives. In the upper-level model, the grid dispatching center needs to know the regulation capacity of all resources and their response process characteristics. The power grid dispatching center updates its decision table according to the latest operation status of the power grid and the support capability of all resources under the stable operation condition. Usually, the update period of the decision table can be 10 min.
The lower-level optimization model is the instruction allocation of each control resource. Since HVDC emergency power support and ELS are mature technologies in the existing stability and control system, this work only presents the instruction allocation of VPP. After receiving the control instruction, the VPP control center quickly determines the DER device that needs to participate according to the DERs dynamic response priority sequence. Under the stable operation condition, the VPP control center updates the dynamic response priority sequence according to the regulation capability and margin information of each DER device.

Resources Modeling
For the receiving-end power grid with multi-infeed HVDC, after one HVDC line blocking occurs, the remaining HVDC lines can increase the power supply through DC modulation to reduce the active power imbalance of the receiving-end power grid. The overload capacity of a HVDC line is inversely proportional to the duration, and DC modulation also requires a power supply at the sending-end grid to increase their power generation output. So only the long-time overload capacity is considered in this work. The response process characteristic of HVDC emergency power support is shown in Figure 3, and it can be expressed as where P dc,0 is the initial operating power of the HVDC line. K dc,i is the power increase rate. t f is the time when the disturbance occurs; t dc st is the time duration from disturbance occurrence to the starting point of the HVDC power increase, that is, the whole group action time of HVDC line. k dc,i is the maximum increment of the HVDC line power. Through the aggregation and disaggregation roles of VPP, when massive controllable DERs participate in EFC, the decision complexity can be reduced by hierarchical optimization. The upper-level optimization model is a multiple resources coordination scheme with minimal control cost solved by the grid dispatching center. The participation of VEPR can reduce the impact of ELS on residents' lives. In the upper-level model, the grid dispatching center needs to know the regulation capacity of all resources and their response process characteristics. The power grid dispatching center updates its decision table according to the latest operation status of the power grid and the support capability of all resources under the stable operation condition. Usually, the update period of the decision table can be 10 min.
The lower-level optimization model is the instruction allocation of each control resource. Since HVDC emergency power support and ELS are mature technologies in the existing stability and control system, this work only presents the instruction allocation of VPP. After receiving the control instruction, the VPP control center quickly determines the DER device that needs to participate according to the DERs dynamic response priority sequence. Under the stable operation condition, the VPP control center updates the dynamic response priority sequence according to the regulation capability and margin information of each DER device.

Resources Modeling
For the receiving-end power grid with multi-infeed HVDC, after one HVDC line blocking occurs, the remaining HVDC lines can increase the power supply through DC modulation to reduce the active power imbalance of the receiving-end power grid. The overload capacity of a HVDC line is inversely proportional to the duration, and DC modulation also requires a power supply at the sending-end grid to increase their power generation output. So only the long-time overload capacity is considered in this work. The response process characteristic of HVDC emergency power support is shown in Figure 3, and it can be expressed as where dc,0 P is the initial operating power of the HVDC line. dc,i K is the power increase rate. f t is the time when the disturbance occurs; dc st t is the time duration from disturbance occurrence to the starting point of the HVDC power increase, that is, the whole group action time of HVDC line. dc,i k is the maximum increment of the HVDC line power. Figure 3. Illustration of the HVDC emergency power support.
ELS can rapidly reduce load power by directly cu ing off the outlet or the substation. Therefore, the response process characteristic of ELS can be described by a step function, as shown in Figure 4. The load power of the bus where the ELS station is located can be expressed as ELS can rapidly reduce load power by directly cutting off the outlet or the substation. Therefore, the response process characteristic of ELS can be described by a step function, as shown in Figure 4. The load power of the bus where the ELS station is located can be expressed as where P tl,0 is the initial load power of the bus, P tl is the shedding power, t 1,tl is the time duration from disturbance occurrence to the starting point of circuit breaker action, that is, the whole group action time of ELS, and t tl br is the circuit breaker tripping duration.
where tl,0 P is the initial load power of the bus, tl P is the shedding power, 1,tl t is the time duration from disturbance occurrence to the starting point of circuit breaker action, that is, the whole group action time of ELS, and tl br t is the circuit breaker tripping duration. Compared with ELS, the control instructions go through more intermediate levels from the grid dispatching center to the DER devices, and the communication delay of the DER device using 4G/5G instead of optical fiber is longer than that of the HVDC and ELS station. On the other hand, for ON/OFF-type DER devices, the load-switch tripping time is larger than that of the high-voltage circuit breaker, and for converter type devices, there is a transition time from charging to discharging state switching. Therefore, the response speed of VEPR is slower than that of ELS. If the number of DER devices in VPP is large, the response of VPP has an obvious transition process due to the difference in communication delay and response speed between DER devices.
Taking a VPP containing switching-type and converter-type devices as an example, the response process of the VPP is shown in Figure 5. DER1 and DER2 are ON/OFF-type devices, DER3 and DER4 are converters with reverse discharge ability. 2,i t is the response time of the DER device; 3,1 t and 3,2 t correspond to the tripping completion time of DER1 and DER2 load switches, respectively. 3,3 t and 3,4 t correspond to the state switching completion time of DER3 and DER4 converters, respectively. For the response process of VPP, vpp st,1 t is the time duration from disturbance occurrence to the instruction issued by the VPP control center. After vpp de t , the fastest DER device completes the response, which is the starting time of the VPP response process. The moment when the VPP completes the instruction is determined by the slowest DER device, and the time duration from the beginning of the VPP response process to the final full response is vpp Figure 4. Illustration of the ELS.
Compared with ELS, the control instructions go through more intermediate levels from the grid dispatching center to the DER devices, and the communication delay of the DER device using 4G/5G instead of optical fiber is longer than that of the HVDC and ELS station. On the other hand, for ON/OFF-type DER devices, the load-switch tripping time is larger than that of the high-voltage circuit breaker, and for converter type devices, there is a transition time from charging to discharging state switching. Therefore, the response speed of VEPR is slower than that of ELS. If the number of DER devices in VPP is large, the response of VPP has an obvious transition process due to the difference in communication delay and response speed between DER devices.
Taking a VPP containing switching-type and converter-type devices as an example, the response process of the VPP is shown in Figure 5. DER 1 and DER 2 are ON/OFF-type devices, DER 3 and DER 4 are converters with reverse discharge ability. t 2,i is the response time of the DER device; t 3,1 and t 3,2 correspond to the tripping completion time of DER 1 and DER 2 load switches, respectively. t 3,3 and t 3,4 correspond to the state switching completion time of DER 3 and DER 4 converters, respectively. For the response process of VPP, t vpp st,1 is the time duration from disturbance occurrence to the instruction issued by the VPP control center. After t vpp de , the fastest DER device completes the response, which is the starting time of the VPP response process. The moment when the VPP completes the instruction is determined by the slowest DER device, and the time duration from the beginning of the VPP response process to the final full response is t vpp pr . tion. Compared with ELS, the control instructions go through more intermediat from the grid dispatching center to the DER devices, and the communication dela DER device using 4G/5G instead of optical fiber is longer than that of the HVDC a station. On the other hand, for ON/OFF-type DER devices, the load-switch trippi is larger than that of the high-voltage circuit breaker, and for converter type device is a transition time from charging to discharging state switching. Therefore, the re speed of VEPR is slower than that of ELS. If the number of DER devices in VPP i the response of VPP has an obvious transition process due to the difference in com cation delay and response speed between DER devices.
Taking a VPP containing switching-type and converter-type devices as an ex the response process of the VPP is shown in Figure 5. DER1 and DER2 are ON/O devices, DER3 and DER4 are converters with reverse discharge ability. 2,i t is the re time of the DER device; 3,1 t and 3,2 t correspond to the tripping completion time o and DER2 load switches, respectively. 3,3 t and 3,4 t correspond to the state sw completion time of DER3 and DER4 converters, respectively. For the response pro VPP, vpp st,1 t is the time duration from disturbance occurrence to the instruction iss the VPP control center. After vpp de t , the fastest DER device completes the response is the starting time of the VPP response process. The moment when the VPP com the instruction is determined by the slowest DER device, and the time duration fr beginning of the VPP response process to the final full response is vpp time/converter state switching time. For DER devices in the same VPP, the decision time of the VPP control center is the same. Due to the dispersed locations of DERs and different communication modes, the communication delay of DER devices is different, so a certain probability distribution is used to describe the communication delay difference in this work. For heterogeneous DERs in a VPP, the last two periods can also be described by a certain probability distribution. In this work, the uniform distribution is used to describe the response delay (the sum of the last three parts) of DERs. The power of VPP can be expressed as , P tl,0 is the initial power of VPP, and P vpp,i is the response amount of VEPR.

Objective Function
The objective of EFC is to minimize the total control cost of maintaining the frequency stability of the receiving-end power grid and can be expressed as where λ dc ,λ tl , and λ vpp are the weight coefficients of the HVDC emergency power support, ELS, and VEPR, respectively. The weight coefficients are determined by the dispatcher of the grid dispatching center. P dc,i , P tl,j , and P vpp,k are control amounts of the ith HVDC, jth load shedding, and kth VPP. c dc,i ,c tl,j , and c vpp,k are control cost factors of the ith HVDC, jth load shedding, and kth VPP.

Resource Control Cost
The three control resources are implemented in different ways, and their control cost factors are significantly different. In the actual power grid, the control cost factor of DC modulation is the lowest. Since VEPR does not cause a large area blackout, its control cost is usually less than that of the ELS. For HVDC emergency power support, its cost factor can be assumed to be constant.
In actual operation, the ELS is to cut off the line without informing the customers. The larger the load-shedding amount, the greater the resulting loss due to power outages and the impact on the normal production and life, so the cost increases with the increase of load-shedding amount. In this work, the first-order function is used to describe the characteristics of c tl increasing with the increase of the shedding proportion. The cost factor of ELS can be expressed as where P L,j is the total load active power before disturbance of the bus where the jth ELS station is located, and b tl,j is the linear growth coefficient of the cost factor. The control cost factor of VPP is not only related to the response proportion but is also affected by the VEPR evaluation error. Since the VEPR of the VPP is refreshed periodically, the evaluation results will lag behind the actual DER operating state at off-cycle moments. On the other hand, since the VEPR capacity is the maximum power change that VPP can provide, when the response amount of VPP is close to the VEPR capacity, there will be more DER devices approaching their operation status limit, resulting in user discomfort. Therefore, when the response amount is close to VEPR capacity, the control cost of VPP will increase. The modeling idea of the VPP control cost factor is as follows: when the VPP response proportion is small, the VPP control cost factor will be significantly smaller than the ELS cost factor. As the VPP response proportion increases, the control cost factor first increases slowly, and when the VPP response proportion approaches 100%, the control cost factor increases rapidly and is comparable to the ELS. The control cost factor of VPP can be expressed as where the first part of the expression, b vpp,k , is the constant term of the cost factor; the second part is the linear growth part with the VPP response proportion (P vpp,k /P max vpp,k ), b tl,j is the growth coefficient; the third part is an additional term that takes into account VEPR evaluation error, k c vpp,k is a constant between 0 and 1, ϑ is an odd number, and K c vpp,k is a constant.
k c vpp,k , ϑ, and K c vpp,k of the third part of the cost factor should be determined by the VPP control center according to the actual VEPR evaluation error and ELS cost factor. For example, when b vpp0,k , b vpp,k , and b tl0,j are 3, 0.5, and 5, respectively, Figure 6  comfort. Therefore, when the response amount is close to VEPR capacity, the con of VPP will increase. The modeling idea of the VPP control cost factor is as follows: when the VPP r proportion is small, the VPP control cost factor will be significantly smaller than cost factor. As the VPP response proportion increases, the control cost factor first i slowly, and when the VPP response proportion approaches 100%, the control co increases rapidly and is comparable to the ELS. The control cost factor of VPP ca pressed as where the first part of the expression, vpp,k b , is the constant term of the cost fa second part is the linear growth part with the VPP response proportion ( m vpp, vp k P P is the growth coefficient; the third part is an additional term that takes into accou evaluation error, c vpp,k k is a constant between 0 and 1,  is an odd number, an is a constant. As Figure 6 shows, when the other parameters are given, the larger the k larger is the proportion at which the cost factor starts to grow rapidly. The large is, the larger the maximum value of vpp,k c is. For example, when c vpp,k K is 40, th mum value is obviously higher than the value when the response proportion is 0 still less than the value of the ELS cost factor, and when it is 70, the maximum v slightly exceeded the constant term of the ELS cost factor. Therefore, the VPP con ter should reasonably determine the parameter values according to the actual gri tion.

The Grid Security and Stability Constraints
The grid security and stability constraints include the transient frequency n quasi-steady-state frequency constraints, rotor angle stability constraints, bus volt straints, and the power flow constraints of all transmission lines. The grid secu stability constraints can be expressed as As Figure 6 shows, when the other parameters are given, the larger the k c vpp,k , the larger is the proportion at which the cost factor starts to grow rapidly. The larger K c vpp,k is, the larger the maximum value of c vpp,k is. For example, when K c vpp,k is 40, the maximum value is obviously higher than the value when the response proportion is 0, but it is still less than the value of the ELS cost factor, and when it is 70, the maximum value has slightly exceeded the constant term of the ELS cost factor. Therefore, the VPP control center should reasonably determine the parameter values according to the actual grid operation.

The Grid Security and Stability Constraints
The grid security and stability constraints include the transient frequency nadir, the quasi-steady-state frequency constraints, rotor angle stability constraints, bus voltage constraints, and the power flow constraints of all transmission lines. The grid security and stability constraints can be expressed as f ss ≥ f ss,min (8) ∆δ o,w ≤ ∆δ max , o, w = 1, · · · , N gen (9) Appl. Sci. 2023, 13, 6390 S sp,l ≤ S max sp,l , l = 1, · · · , N line (11) where f dn , f dn,min are the transient frequency nadir and its security threshold, respectively.
f ss , f ss,min are the quasi-steady-state frequency and its security threshold, respectively. ∆δ o,w is the rotor angle between the oth generator and the wth generator, and ∆δ max is the maximum allowable rotor angle difference between any two generators. V s is the sth bus voltage, and V min s , V max s are the lower and upper allowable limits of the sth bus voltage, respectively. S sp,l , S max sp,l are the lth line overload rate and its threshold value, respectively.

Control Resources Amount Constraints
The control amount of HVDC emergency power support, ELS, and VEPR falls into the following ranges: P min tl,j ≤ P tl,j ≤ P max tl,j , j = 1, · · · , N tl (13) where P min tl,j and P max tl,j are the minimum and maximum response amount of jth ELS station, respectively. P min vpp,k and P max vpp,k are the minimum and maximum response amount of kth VPP, respectively.
To calculate the ELS amount faster, the ELS variables are treated as continuous in this work. However, in the actual power grid, as the ELS trips the outlet or substation, these variables actually consist of a series of discrete values. Therefore, treating them as continuous variables can only obtain the approximate optimal values of the load shedding. In engineering practice, the optimal combination of loads needs to be found to make the shedding amount of the ELS station require the control amount with the minimum excess of shedding. The DER equipment power in VPP is very small. For example, the rated power of slow-charging EV, AC, and WH are usually only a few kW, so it is reasonable to treat the response variables of VPP as continuous values.

Model Analysis
From the objective function and constraints, the upper-level optimization problem is to find the optimal solution in the feasible solution space bounded by the grid status security and stability constraints and the response amount constraints of each control resource.
Due to the complexity and strong nonlinearity of the power grid model, the traditional analytical solution is difficult to solve. The trajectory sensitivity-based algorithm also suffers from convergence because the control factors of ELS and VEPR are nonlinear. Considering that the heuristic algorithms can deal with high-dimensional optimization problems with complex nonlinear constraints and have global convergence, the heuristic algorithm is used to solve the optimized problem. In this work, the electromechanical transient simulation combined with the improved PSO algorithm is used to solve the upper model.

Model Solving
The classical PSO algorithm treats the solution of the optimization problem as a particle in space without mass and volume, and the update of the particle is determined by a combination of inertial motion, self-awareness, and social learning. The particle merit is evaluated according to the adaptation value determined by the objective function of the optimization problem. In this paper, the classical PSO algorithm is improved by using dynamically updated inertia weights. A larger inertia weight at the beginning of the algorithm iteration can improve the global search capability, and a smaller inertia weight at the end of the iteration can improve the local search capability. In the improved PSO algorithm, the inertia weights are updated in each iteration, and if the current position of the ith particle (x i = (x i1 , x i2 , · · · , x iD ), D is the particle space dimension) is known, then the particle velocity v i (n + 1) (v i = (v i1 , v i2 , · · · , v iD )) at the next moment is calculated based on the inertia weights (ω(n)), and thus the new position of the particle at the next moment (x i (n + 1)) can be calculated. The update of the particle position can be expressed as where ω(n) is the calculation formula of dynamic inertia weight. n is the current number of iterations. n max is the maximum number of iterations. ω max and ω min are the maximum and minimum values of dynamic weights, respectively. v i is the velocity of the ith particle in the population. α 1 and α 2 are the acceleration coefficients; α 1 corresponds to self-learning ability and α 2 corresponds to the social learning ability, that is, to learn from the optimal individual in the population. η pso is the weight coefficient of speed update.
In the solving of PSO, the fitness value can be obtained by adding penalty factors to the constraints into the objective function. The value of the penalty factors should be much larger than the estimated optimal value of the objective function. Therefore, the calculation formula of fitness can be expressed as follows, where h 1 −h 5 are the penalty factors of each constraint. f (·) is the penalty term corresponding to the constraints. Taking the transient frequency nadir constraint f ( f dn ) as an example, it can be expressed as The particle positions obtained by the particle swarm initialization and iteration are the control amounts of resources for EFC. The control amounts are input into the electromechanical transient simulation software to obtain power grid status trajectory data. Based on the status trajectories, the fitness and penalty term corresponding to each constraint can be calculated. In each iteration of PSO, it takes very little time to update the particle positions, and most of the computation time is used to obtain the simulation trajectory from electromechanical transient simulation software. The parallel simulation of the electromechanical transient can reduce the time consumption of each iteration of PSO. The electromechanical transient simulation can be parallelized by calling multiple cores on one computer/server or by using several computers/servers simultaneously for each iteration. In this work, the former method is adopted, and the selected electromechanical transient simulation software is STEPS V1.0 [38]. The parallel calculation is carried out by calling the Pool from the multiprocessing library of Python for asynchronous parallel simulation and fitness calculation. The flowchart of the electromechanical transient simulation combined with the improved PSO algorithm is shown in Figure 7.
on one computer/server or by using several computers/servers simultaneously for each iteration. In this work, the former method is adopted, and the selected electromechanical transient simulation software is STEPS V1.0 [38]. The parallel calculation is carried out by calling the Pool from the multiprocessing library of Python for asynchronous parallel simulation and fitness calculation. The flowchart of the electromechanical transient simulation combined with the improved PSO algorithm is shown in Figure 7.
start Set the population number, the upper and lower limits of weight coefficients, the maximum number of iterations , and then initialize the particle population n≥nmax Get the latest grid operating status, input HVDC emergency power support, ELS amount limits, and VEPR capacity n=0 Sub-process 1 Sub-process 2 Sub-process n … fitness 1 Power system simulation package

Lower-Level Dynamic Response Priority-Based Response Instruction Allocation in VPP
For EFC considering VEPR, although the aggregation model of VPP response process is adopted in EFC decision-making, the control instructions of VPP need to be allocated to the DER device. Therefore, the overall process of VPP instruction allocation needs to be determined.

Requirements for VPP Instruction Allocation
There are two ways to implement the control instruction allocation in the VPP. The first method is that after receiving the control amount instruction, the VPP control center adopts the optimization algorithm according to the latest status and emergency regulation capacity of each DER device to obtain the best combinations of DER devices. The second method is that the VPP control center creates the response priority sequence of DERs in advance and selects the DER devices participating in EFC by querying the priority sequence after receiving the instructions. Compared with the time-consuming optimization

Lower-Level Dynamic Response Priority-Based Response Instruction Allocation in VPP
For EFC considering VEPR, although the aggregation model of VPP response process is adopted in EFC decision-making, the control instructions of VPP need to be allocated to the DER device. Therefore, the overall process of VPP instruction allocation needs to be determined.

Requirements for VPP Instruction Allocation
There are two ways to implement the control instruction allocation in the VPP. The first method is that after receiving the control amount instruction, the VPP control center adopts the optimization algorithm according to the latest status and emergency regulation capacity of each DER device to obtain the best combinations of DER devices. The second method is that the VPP control center creates the response priority sequence of DERs in advance and selects the DER devices participating in EFC by querying the priority sequence after receiving the instructions. Compared with the time-consuming optimization solution of the first method, the method of querying the priority sequence is faster, so the decision-making of the VPP control center takes less time. Therefore, the second method is adopted in this work.
The response sequence of DERs is determined by the VPP control center based on DERs dynamic priority sequence, so that the VPP can follow the upper control instructions. When users agree that DERs such as EVs and TCLs are managed by VPP, the VPP control center considers these devices to be equally important to users. The following factors need to be considered in constructing the DERs dynamic priority: (1) fairness of different types of DER devices Different device types have different storage energy scales, leading to significant differences in the flexible time length. For example, EV discharge time can reach one hour or even several hours, while the flexible time of household AC is usually only a few minutes. If ignoring the difference in flexible time, the priority of TCLs may always be lower than the EV.
(2) user comfort When DER participates in EFC, the status (SOC of EV, indoor temperature of TCLs) may deviate from its normal range. When the state is close to the user's tolerance limit, user comfort is poor. Therefore, DER with little impact on user comfort should have higher priority.

Dynamic Response Priority Sequence Construction for DERs
The evaluation index of DERs priority sequence includes time margin.
(1) Normalized improved time margin t la The absolute time margin reflects the relationship between the maximum sustainable regulation time and a specific regulation duration T. The regulation duration T is defined as the time period during which the DER device is required to always participate in response without exiting. Additionally, the normalized improved time margin is the negative exponential function of absolute margin. When participating in EFC, EVs will discharge to the grid and TCLs will shut down.
For EV, the improved time margin can be expressed as where s(t 0 ) is the SOC of the battery at time t 0 . S min exp is the minimum SOC at the departure time set by the user. E r is the battery rated capacity. η c is the charging efficiency. P max c is the maximum charging power.
For ON/OFF-type TCLs (including fixed-frequency AC, fixed frequency RF, and resistance heating-type WH), the improved time margin can be expressed as t la,TCL = exp(−min( min(t re on , t max off ) − T T , 10)h la,TCL ) t re on = RC ln( where θ in (t 0 ) and θ a are the indoor and ambient temperatures at time t 0 , respectively. θ set , δ, and θ max are the indoor temperature setpoint, the temperature dead zone, and the maximum allowable temperature set by the user, respectively. P AC , R, C, and η AC are the rated electric power, equivalent thermal resistance, equivalent heat capacity, and energy efficiency ratio of the TCL device, respectively. h la,TCL is the amplification factor of the remaining duration of TCLs, and h la,TCL is a constant greater than 1. For different h la,TCL , the improved time margin curves are shown in Figure 8.
AC  are the rated electric power, equivalent thermal resistance, equivalent heat capacity and energy efficiency ratio of the TCL device, respectively. la,TCL h is the amplification factor of the remaining duration of TCLs, and la,TCL h is a constant greater than 1. For different la,TCL h , the improved time margin curves are shown in Figure 8. It can be seen from Figure 8 that for EVs with a large maximum sustainable regulation time, the margin curve is flat, and more of the normalized EV time margin falls in the lower part of the vertical axis. For TCLs, the larger la,TCL h will make more time margins of TCL devices distributed in the lower part of the vertical axis instead of all being concentrated in the upper part of the vertical axis, improving the probability that TCL can participate in EFC. (2) Normalized state margin la s The state margin reflects the relationship between the current state and the limit state set by the user (such as the minimum expected SOC of EV and the maximum indoor temperature of TCLs). The state margin can be expressed as follows, Considering that the response time of DER for EFC is generally tens of seconds, and it is usually less than 5 min, to simplify the analysis, the current state is used instead of the state after time T; that is, The DER priority value after integrating the above indicators can be expressed as where 1,i  and 2,i  are the weight coefficients of the time margin and state margin, respectively, and i is the device type of the jth DER device.

VPP Response Process Based on DERs Dynamic Response Priority Sequence
The formulation of the dynamic response priority of DERs and the decision-making process of the VPP control center are: In the first step, the ITU of DER needs to send its normalized time margin and state margin in addition to its adjustment capability to the VPP control center. For TCLs, la,TCL h is issued in advance by the VPP control center. It can be seen from Figure 8 that for EVs with a large maximum sustainable regulation time, the margin curve is flat, and more of the normalized EV time margin falls in the lower part of the vertical axis. For TCLs, the larger h la,TCL will make more time margins of TCL devices distributed in the lower part of the vertical axis instead of all being concentrated in the upper part of the vertical axis, improving the probability that TCL can participate in EFC.
(2) Normalized state margin s la The state margin reflects the relationship between the current state and the limit state set by the user (such as the minimum expected SOC of EV and the maximum indoor temperature of TCLs). The state margin can be expressed as follows, Considering that the response time of DER for EFC is generally tens of seconds, and it is usually less than 5 min, to simplify the analysis, the current state is used instead of the state after time T; that is, s(t 0 + T) and θ(t 0 + T) will become s(t 0 ) and θ(t 0 ), respectively.
The DER priority value after integrating the above indicators can be expressed as where ϕ 1,i and ϕ 2,i are the weight coefficients of the time margin and state margin, respectively, and i is the device type of the jth DER device.

VPP Response Process Based on DERs Dynamic Response Priority Sequence
The formulation of the dynamic response priority of DERs and the decision-making process of the VPP control center are: In the first step, the ITU of DER needs to send its normalized time margin and state margin in addition to its adjustment capability to the VPP control center. For TCLs, h la,TCL is issued in advance by the VPP control center.
In the second step, the VPP control center assigns weight coefficients according to the improved time margin and state margin of DERs. The priorities of all DER devices are arranged in ascending order to form the dynamic response priority sequence of DERs.
In the third step, after receiving the control instruction from the VPPs cloud control platform, the VPP control center determines the DERs that need to participate in the response according to the principle of "minimum over-cutting", and then sends the instruction to the corresponding DER equipment.
It is worth noting that the control instruction sent to the DER device contains a logical value characterizing the response to be engaged and a regulation time duration flag. The former tells the ITU that it needs to participate in the response, and the latter helps the ITU adjust DER's operating state (i.e., ON or OFF state for ON/OFF-type device, power setpoint for converter-type device).

Case Description
In this section, a simplified model of a provincial power grid is used as the test system to verify the proposed EFC strategy. The studied provincial power grid consists of 132 buses, 32 generators, 200 transmission lines, three HVDC links, and 65 loads. The operation power of ±660 kV HVDC link is 4 GW, and the other two ±800 kV HVDC links are 8 GW for each one. The load capacity is 58.9 GW. The generation model for the generators in the HVDC sending-end units is the GENCLS model, and all the generation models for the generators in the provincial power grid are modeled with the GENROU model, SEXS exciter model, and TGOV turbine-governor model. All HVDC links models are the CDC4T model. The grid topology is shown in Figure 9.
It is worth noting that the control instruction sent to the DER device contains a logical value characterizing the response to be engaged and a regulation time duration flag. The former tells the ITU that it needs to participate in the response, and the la er helps the ITU adjust DER's operating state (i.e., ON or OFF state for ON/OFF-type device, power setpoint for converter-type device).

Case Description
In this section, a simplified model of a provincial power grid is used as the test system to verify the proposed EFC strategy. The studied provincial power grid consists of 132 buses, 32 generators, 200 transmission lines, three HVDC links, and 65 loads. The operation power of ±660 kV HVDC link is 4 GW, and the other two ±800 kV HVDC links are 8 GW for each one. The load capacity is 58.9 GW. The generation model for the generators in the HVDC sending-end units is the GENCLS model, and all the generation models for the generators in the provincial power grid are modeled with the GENROU model, SEXS exciter model, and TGOV turbine-governor model. All HVDC links models are the CDC4T model. The grid topology is shown in Figure 9 There are 16 ELS stations in the power grid. The bus number, shedding capacity, and cost factor are shown in Table 1. There are 20 VPPs, and the VPPs contain three device types: EV, AC, and WH. The number of VPP devices is shown in Table 2.  There are 16 ELS stations in the power grid. The bus number, shedding capacity, and cost factor are shown in Table 1. There are 20 VPPs, and the VPPs contain three device types: EV, AC, and WH. The number of VPP devices is shown in Table 2. The parameters are as follows: control resources weight coefficients λ dc , λ tl and λ vpp are all 1.0. The units of the cost factors of the control resources are all 100 MW −1 ,c dc is 0.5; b vpp0 , b vpp , K c vpp , k c vpp and ϑ are 3.0, 0.2, 70, 0.7 and 3, respectively. For the grid security and stability constraints, f dn,min is 49.25 Hz, f ss,min is 49.50 Hz, ∆δ max is 180 • , S max sp,l is 0.1. K dc is 1000 MW/s, t dc st is 100 ms, k dc is 0.05. The sum of t tl st and t tl br is 200 ms. The sum of t vpp de and t vpp pr is 250 ms, and t vpp pr is 750 ms. PSO parameter setting: ω min and ω max are 0.4, 0.9, respectively; α 1 and α 2 are both 2. The penalty coefficients h 1 − h 5 are 10,000, 10,000, 100,000, 10,000, and 10,000, respectively. The relevant parameters in the lower model are set as follows: h la,TCL is 2; the weight coefficients ϕ 1 , ϕ 2 are all 1.0.

Simulation Results
The population size is set at 60 and the maximum number of iterations is 50. In the initial population of particles, the response proportion interval of HVDC emergency power support is [0.6,1], and the response proportion intervals of ELS and VEPR are all [0,0.6].
A ±800 kV HVDC bipolar blocking is utilized to verify the effectiveness of the proposed EFC strategy. The power deficiency due to the disturbance is 8 GW, which makes up 13.59% of the total grid demand. The amount of all resource responses and their control costs of the EFC scheme obtained by improved PSO are shown in Table 3. The total control cost of EFC is 79.234. The frequency curves with and without the EFC are shown in Figure 10, and the frequency curves of generator buses are shown in Figure 11. The total control cost of EFC is 79.234. The frequency curves with and without the EFC are shown in Figure 10, and the frequency curves of generator buses are shown in Figure 11.  As shown in Figures 10 and 11, the system frequency will rapidly drop to 49.25 Hz without the EFC strategy, resulting in under-frequency load-shedding action. The proposed EFC strategy can reduce the rate of change of frequency after resources act, and the transient frequency nadir for each bus is higher than the se ing under the frequency loadshedding threshold, which is 49.25 Hz. Meanwhile, the quasi-steady frequency of the system with EFC strategy is 49.74 Hz, which is close to the rated frequency of the system, ensuring the frequency security of the receiving-end power grid.
To further check voltage stability and rotor angle stability, bus voltage and rotor angle curves with EFC strategy are shown in Figures 12 and 13, respectively. The total control cost of EFC is 79.234. The frequency curves with and without the EFC are shown in Figure 10, and the frequency curves of generator buses are shown in Figure 11.  As shown in Figures 10 and 11, the system frequency will rapidly drop to 49.25 Hz without the EFC strategy, resulting in under-frequency load-shedding action. The proposed EFC strategy can reduce the rate of change of frequency after resources act, and the transient frequency nadir for each bus is higher than the se ing under the frequency loadshedding threshold, which is 49.25 Hz. Meanwhile, the quasi-steady frequency of the system with EFC strategy is 49.74 Hz, which is close to the rated frequency of the system, ensuring the frequency security of the receiving-end power grid.
To further check voltage stability and rotor angle stability, bus voltage and rotor angle curves with EFC strategy are shown in Figures 12 and 13, respectively. As shown in Figures 10 and 11, the system frequency will rapidly drop to 49.25 Hz without the EFC strategy, resulting in under-frequency load-shedding action. The proposed EFC strategy can reduce the rate of change of frequency after resources act, and the transient frequency nadir for each bus is higher than the setting under the frequency load-shedding threshold, which is 49.25 Hz. Meanwhile, the quasi-steady frequency of the system with EFC strategy is 49.74 Hz, which is close to the rated frequency of the system, ensuring the frequency security of the receiving-end power grid.
To further check voltage stability and rotor angle stability, bus voltage and rotor angle curves with EFC strategy are shown in Figures 12 and 13, respectively.
The total control cost of EFC is 79.234. The frequency curves with and without the EFC are shown in Figure 10, and the frequency curves of generator buses are shown in Figure 11. As shown in Figures 10 and 11, the system frequency will rapidly drop to 49.25 Hz without the EFC strategy, resulting in under-frequency load-shedding action. The proposed EFC strategy can reduce the rate of change of frequency after resources act, and the transient frequency nadir for each bus is higher than the se ing under the frequency loadshedding threshold, which is 49.25 Hz. Meanwhile, the quasi-steady frequency of the system with EFC strategy is 49.74 Hz, which is close to the rated frequency of the system ensuring the frequency security of the receiving-end power grid.
To further check voltage stability and rotor angle stability, bus voltage and rotor angle curves with EFC strategy are shown in Figures 12 and 13, respectively. As can be seen from Figure 12, since the HVDC converter station absorbs amount of reactive power during steady-state operation, the system voltage increa idly after HVDC blocking due to excessive reactive power in the grid. With the adju of the generator excitation adjustment, the voltage gradually returned to a steady is shown that the voltage deviation is very small during the transient state as well ing the steady state. Figure 13 shows that the receiving-end power grid has angu bility. Figure 14 shows the active power curves of load buses. As shown in Figure 14, the load active power of the buses where the ELS stat located decrease rapidly after the load-shedding action, while the load active powe buses connected with VPP decrease in a ramp style. The power changes of the res busbars are mainly caused by fluctuations of the system frequency and bus voltag Figure 15 shows the response proportion of each ELS station and VPP in t strategy. ELS can act quickly, but its control cost is high, while VEPR has a lower cost but has an obvious response process. It is impossible, therefore, to qualitativ termine their response proportion, and the EFC optimization model must be built the optimal control amounts. As can be seen from Figure 12, since the HVDC converter station absorbs a large amount of reactive power during steady-state operation, the system voltage increases rapidly after HVDC blocking due to excessive reactive power in the grid. With the adjustment of the generator excitation adjustment, the voltage gradually returned to a steady state. It is shown that the voltage deviation is very small during the transient state as well as during the steady state. Figure 13 shows that the receiving-end power grid has angular stability. Figure 14 shows the active power curves of load buses. As can be seen from Figure 12, since the HVDC converter station absorbs a large amount of reactive power during steady-state operation, the system voltage increases rap idly after HVDC blocking due to excessive reactive power in the grid. With the adjustmen of the generator excitation adjustment, the voltage gradually returned to a steady state. I is shown that the voltage deviation is very small during the transient state as well as dur ing the steady state. Figure 13 shows that the receiving-end power grid has angular sta bility. Figure 14 shows the active power curves of load buses. As shown in Figure 14, the load active power of the buses where the ELS stations are located decrease rapidly after the load-shedding action, while the load active power of the buses connected with VPP decrease in a ramp style. The power changes of the rest of the busbars are mainly caused by fluctuations of the system frequency and bus voltage. Figure 15 shows the response proportion of each ELS station and VPP in the EFC strategy. ELS can act quickly, but its control cost is high, while VEPR has a lower contro cost but has an obvious response process. It is impossible, therefore, to qualitatively de termine their response proportion, and the EFC optimization model must be built to solve the optimal control amounts. As shown in Figure 14, the load active power of the buses where the ELS stations are located decrease rapidly after the load-shedding action, while the load active power of the buses connected with VPP decrease in a ramp style. The power changes of the rest of the busbars are mainly caused by fluctuations of the system frequency and bus voltage. Figure 15 shows the response proportion of each ELS station and VPP in the EFC strategy. ELS can act quickly, but its control cost is high, while VEPR has a lower control cost but has an obvious response process. It is impossible, therefore, to qualitatively determine their response proportion, and the EFC optimization model must be built to solve the optimal control amounts.
Two strategies are selected to verify the effectiveness of the proposed EFC strategy in reducing the total control cost. Strategy 1 is a traditional EFC, which only considers HVDC emergency power support and ELS, and the control amount of ELS is based on the principle of average allocation. Strategy 2 considers VEPR, but the control amounts of ELS and VPP are also based on the principle of average allocation. The control amounts of HVDC emergency power support are the same as the proposed EFC strategy. In strategy 1, the total control amount of ELS is at least 1925 MW; that is, the control amount of each ELS is 120.31 MW, and the total control cost is 111.123. In strategy 2, the total control amount of ELS and VPP is at least 2030 MW; that is, the control amount of each ELS and VEPR is 56.39 MW, and the total control cost is 87.033. Figure 16 shows the frequency curves under the three strategies. Two strategies are selected to verify the effectiveness of the proposed E reducing the total control cost. Strategy 1 is a traditional EFC, which only con emergency power support and ELS, and the control amount of ELS is base ciple of average allocation. Strategy 2 considers VEPR, but the control amou VPP are also based on the principle of average allocation. The control amou emergency power support are the same as the proposed EFC strategy. In total control amount of ELS is at least 1925 MW; that is, the control amount 120.31 MW, and the total control cost is 111.123. In strategy 2, the total cont ELS and VPP is at least 2030 MW; that is, the control amount of each ELS 56.39 MW, and the total control cost is 87.033. Figure 16 shows the frequency the three strategies.   As shown in Figure 16, because ELS acts faster than VPP, strategy 1 h rate of change of frequency at the beginning time, and it requires the leas  Two strategies are selected to verify the effectiveness of the proposed EFC strategy in reducing the total control cost. Strategy 1 is a traditional EFC, which only considers HVDC emergency power support and ELS, and the control amount of ELS is based on the principle of average allocation. Strategy 2 considers VEPR, but the control amounts of ELS and VPP are also based on the principle of average allocation. The control amounts of HVDC emergency power support are the same as the proposed EFC strategy. In strategy 1, the total control amount of ELS is at least 1925 MW; that is, the control amount of each ELS is 120.31 MW, and the total control cost is 111.123. In strategy 2, the total control amount of ELS and VPP is at least 2030 MW; that is, the control amount of each ELS and VEPR is 56.39 MW, and the total control cost is 87.033. Figure 16 shows the frequency curves under the three strategies.  As shown in Figure 16, because ELS acts faster than VPP, strategy 1 has the lowest rate of change of frequency at the beginning time, and it requires the least total control amount. Although the total control amounts of strategy 2 and the proposed EFC strategy are greater than that of strategy 1, the lower control cost of the VEPR makes up for the shortage of its slow response speed compared with that of ELS. All three strategies can avoid the transient frequency deviation triggering the under-frequency load shedding, but the participation of VEPR can significantly reduce the total control cost, and the proposed EFC strategy can further reduce the total control cost.
The EFC scheme shows that all of the VPP response proportions are less than 70%, which reduces the influence of a VEPR evaluation error on control instruction following. Table 4 shows the DERs response priority based on absolute time margin and dynamic priority sequence. The regulation duration T is 5 min. As shown in Figure 16, because ELS acts faster than VPP, strategy 1 has the lowest rate of change of frequency at the beginning time, and it requires the least total control amount. Although the total control amounts of strategy 2 and the proposed EFC strategy are greater than that of strategy 1, the lower control cost of the VEPR makes up for the shortage of its slow response speed compared with that of ELS. All three strategies can avoid the transient frequency deviation triggering the under-frequency load shedding, but the participation of VEPR can significantly reduce the total control cost, and the proposed EFC strategy can further reduce the total control cost.
The EFC scheme shows that all of the VPP response proportions are less than 70%, which reduces the influence of a VEPR evaluation error on control instruction following. Table 4 shows the DERs response priority based on absolute time margin and dynamic priority sequence. The regulation duration T is 5 min.
As Table 4 shows, the time between arrival and departure of EV is usually on the hourly scale, while the on-time (i.e., cooling duration for AC and heating duration for WH) for household AC or WH is usually on the minute scale. In the test scenario, if only the absolute time margin is used to construct response priority, it will result in high priority for EV and low priority for AC and WH. When the dynamic priority of DERs is constructed by considering both the improved time margin and state margin, the difference in absolute time margin between EV and TCL is weakened, which improves the priority of AC and WH and improves the fairness between different device types.  10,20,30,40, and 60, respectively. For each population size, the simulation is carried out 100 times. The average values of the fitness results under different iterations are given in Table 5.  Table 5 shows that the larger population size and the higher maximum number of iterations can minimize the fitness at the maximum number of iterations, that is, the minimum total control cost. However, increasing the population size and the number of iterations will increase the optimization solution time. In engineering practice, the population size and the maximum number of iterations should not be too small or too large. The population size can be set to 40 or more, and the maximum number of iterations can be set to 20 or more.

The Computation Time
The solution time of the PSO determines whether it can be used for online decisionmaking. In each iteration of PSO, the process of evaluating and updating the particles according to the power grid simulation results takes a very short time, and almost all the time is occupied by the electromechanical transient simulation. This work selects a computer (the CPU is 2.90 GHz AMD Ryzen 7 4800H 8-Core 16-Thread processor with 16 GB of RAM) for electromechanical transient simulation, and the simulation duration is 12 s. Each sub-process performs one electromechanical transient simulation. The average time consumption of the simulation is shown in Table 6.  Table 6 shows that due to the limitation of cache capacity, a large number of parallel sub-processes increases the time for each iteration of PSO. In order to be applied to online decision-making, two improvement measures are given in this work. The first method is that in each iteration of PSO, the electromechanical transient simulation is carried out by multiple computers in parallel. For example, if the population size is set to 40 and the maximum iteration number is 20, the solving time of PSO can be less than 4 min when using four computers in parallel, and if the population size is set to 60 and the maximum iteration number is 30, the solving time of PSO can be less than 5 min when using eight computers in parallel. Both the above two computation times meet the requirements of online decision-making. The second method is to utilize a server/personal computer with a higher clock frequency processor. High processor frequency can speed up the electromechanical transient simulation, and combining it with the first method can further shorten the solution time of PSO.

Conclusions
A multiple resources coordinated EFC strategy considering VEPR is proposed to deal with a HVDC blocking disturbance at the receiving-end grid. An approximate aggregation model of VPP response process is constructed to reflect the difference in communication delay and response speed between different DER devices. The electromechanical transient simulation is parallelized in each iteration of PSO to speed up the model solving. The DERs dynamic response priority sequence in the VPP is constructed.
The effectiveness of the proposed method is verified by a provincial receiving-end power grid with multi-infeed HVDC. The simulation results show that considering VEPR can reduce the control cost of EFC while satisfying the system frequency constraints. In addition, parallel simulation can speed up the solution so that the algorithm can be used for online decision-making.
In the future, a more accurate VPP response process aggregation model considering grid frequency and bus voltage dynamics will be further studied. Additionally, more resources, such as renewable energy and battery energy storage, will be further considered.
Author Contributions: Conceptualization, Y.C. and X.S.; methodology, J.X. and Z.Z.; software, J.X. and R.M.; writing-original draft preparation, J.X.; writing-review and editing, Y.C. and J.Z.; supervision, X.S. All authors have read and agreed to the published version of the manuscript.