A micro-grid intelligent control method and system based on a carbon attribute migration state representation of an electric vehicle

CN122931919APending Publication Date: 2026-10-16NORTHEAST DIANLI UNIVERSITY
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202611277231.6
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2026-08-21
Publication Date
2026-10-16

AI Technical Summary

Technical Problem

因此,现有能量状态不能完整表示车辆当前储存电能的碳属性

Benefits of technology

(1)提高单车储存电能碳属性的识别准确性。

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122931919A_ABST
    Figure CN122931919A_ABST
Patent Text Reader

Abstract

The present application relates to the technical field of micro-grid intelligent control, and particularly relates to a micro-grid intelligent control method and system based on carbon attribute migration state representation of electric vehicles. In each control period, the present application first collects micro-grid operation data and state information of each online EV, then determines the decision reference bus carbon intensity of the current control period, constructs single vehicle control features, encodes and summarizes the online vehicle set with dynamic quantity to form a dynamic EV state representation. The dynamic EV state representation, micro-grid operation data and bus carbon intensity are input into a reinforcement learning control model to generate micro-grid device control actions and EV overall charging and discharging targets. After the execution of the control instructions, the actual bus dynamic carbon intensity is determined according to the actual execution results of various power sources and vehicles, and the state records of each EV are updated synchronously. The updated micro-grid state and dynamic EV state representation are used as the input of the next control period, thereby forming a continuous closed-loop control process.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of intelligent control technology for microgrids, and specifically to an intelligent control method and system for microgrids based on the carbon attribute migration state characterization of electric vehicles. Background Technology

[0002] With the increasing scale of distributed energy sources such as wind and solar power, grid-connected multi-energy microgrids are gradually becoming an important platform for coordinating the public power grid, distributed power sources, energy conversion equipment, and energy storage devices. After electric vehicles (EVs) are connected to the microgrid, they can serve as charging loads and also participate in energy regulation through vehicle-to-grid (V2G) interaction. In actual operation, the EV aggregation management unit typically manages the charging and discharging processes of different vehicles uniformly based on their arrival and departure times, initial battery levels, and usage demands.

[0003] Regarding the coordinated operation of microgrids and EVs, existing patents have explored bidirectional energy transfer between photovoltaic power generation, the public power grid, and EVs. For example, Chinese invention patent application CN105186549A discloses a V2G system based on a DC microgrid. This system includes a DC bus, photovoltaic power generation units, an electric vehicle battery pack, a mains power grid, and an energy management unit. The energy management unit controls the charging of EVs or their discharge to the grid based on the operating status of each component, thereby utilizing the EV batteries to store photovoltaic energy and alleviating power supply pressure during peak electricity consumption periods. This technical solution primarily determines the energy transfer mode based on power output, grid load, and battery operating status.

[0004] Microgrid busbars can simultaneously receive electricity from the public grid, local wind and solar power, fuel cell power generation, and energy storage devices. Because the carbon emission levels of different energy sources vary, and the supply ratio of various power sources changes over time, the carbon intensity per unit of electricity on the busbar also changes dynamically. Existing carbon emission flow methods allocate carbon emissions from the generation side to corresponding nodes or loads by combining power output and energy flow relationships, used to calculate node carbon intensity and load-side carbon emission responsibility. When an EV is charged from the busbar, the energy injected into the battery is related to the busbar's carbon intensity at that moment and can be stored in the battery for subsequent periods. Vehicles with V2G capabilities can also release stored energy back into the microgrid. Therefore, while EVs achieve cross-period energy transfer, their corresponding carbon attributes also migrate during charging, parking, and discharging processes.

[0005] Regarding EV carbon emission accounting, the paper "V2G Carbon Accounting and Revenue Allocation: Balancing EV Contributions in Distribution Systems" proposes an EV carbon accounting method based on carbon emission flow. This method calculates node carbon intensity based on distribution network power flow and tracks carbon flow during EV charging and discharging processes to calculate the carbon emission reduction and contribution of EVs before and after V2G operation. This method can reflect the relationship between EV charging and discharging behavior and distribution network node carbon intensity, providing a basis for evaluating low-carbon EV operation.

[0006] As the number of EVs connected to the grid increases, microgrids need to simultaneously handle uncertainties related to renewable energy output, load demand, energy prices, equipment operating status, vehicle charging and discharging needs, and vehicle arrival and departure. Deep reinforcement learning (DRL) can generate control commands based on the real-time status of the system and has been applied to distributed energy systems and EV charging and discharging control. Chinese invention patent application CN112186799A discloses an autonomous control method and system for distributed energy systems based on deep reinforcement learning. This method inputs grid, gas grid, load, and equipment operating data into a deep reinforcement learning agent, which then generates control decisions for devices such as electric chillers, distributed photovoltaic systems, combined gas and electricity systems, and energy storage devices.

[0007] The paper "Online EVs Vehicle-to-Grid Scheduling Coordinated with Multi-Energy Microgrids: A Deep Reinforcement Learning-Based Approach" further constructs the uncertainties of EV arrival and departure, multi-energy flexible loads, and V2G charging and discharging processes as Markov decision processes. It also uses a deep reinforcement learning algorithm to dynamically determine EV charging and discharging commands based on electricity prices, energy demand, and vehicle status, thereby realizing the online coordinated operation of V2G and multi-energy microgrids.

[0008] In general, existing technologies have focused on multi-energy coordinated operation of microgrids, EV charging and discharging management, node carbon intensity calculation, V2G carbon emission accounting, and intelligent control based on deep reinforcement learning. Related solutions typically determine the charging and discharging commands for microgrid equipment and EVs based on renewable energy output, load demand, energy prices, equipment operating status, vehicle arrival and departure times, and battery status, and then analyze the carbon emissions corresponding to the EV charging and discharging process in conjunction with node carbon intensity analysis.

[0009] Existing microgrid low-carbon control methods are capable of formulating operating strategies based on renewable energy output, load demand, energy prices, and equipment status. Some methods also incorporate grid carbon intensity into EV charging time selection. However, current technologies still do not adequately consider the representation, updating, and control applications of the carbon attributes of EV-stored energy.

[0010] (1) The existing vehicle status cannot fully represent the carbon properties of stored electrical energy.

[0011] Current EV models primarily use State of Charge (SOC) to represent the vehicle's remaining battery power. However, SOC cannot reflect the carbon intensity of the electrical bus at which that portion of the energy is charged. Two EVs with the same SOC may complete charging at different carbon intensity periods, resulting in different carbon properties of their stored energy.

[0012] For vehicles charged at multiple times, the carbon intensity of the energy input at different times may vary. Using only the vehicle's total charge or State of Charge (SOC) is insufficient to preserve the carbon properties of this energy throughout its historical charging process. Therefore, the current state of energy cannot fully represent the carbon properties of the vehicle's currently stored energy.

[0013] (2) Existing methods lack synchronous updates of vehicle energy and carbon properties throughout the entire process.

[0014] During operation, an EV will experience several states, including arrival at a station, charging, parking, V2G discharging, and departure from a station. When a vehicle is charging, the amount of electricity added is related to the carbon intensity of the electrical bus at that time. When a vehicle is discharging, the carbon properties of the output electrical energy should be determined by the historical charging process. Arrival and departure from a station also change the online vehicle and its corresponding energy and carbon property states.

[0015] Existing methods primarily update SOC and charge / discharge power, lacking a unified approach to the retention, addition, migration, and removal of carbon attributes. This can easily lead to inconsistencies between the vehicle's carbon attribute status and the actual charge / discharge process, and also makes it difficult to accurately reflect the impact of V2G discharge on the carbon intensity of the microgrid's electrical bus.

[0016] (3) The carbon properties of a single vehicle are difficult to form a state characterization that can be used for microgrid control.

[0017] Current low-carbon charging methods often use grid carbon intensity for selecting charging periods or evaluating operational results. After a vehicle completes charging, the carbon properties of the stored energy typically no longer participate in subsequent charging and discharging control. The control system still primarily formulates operating instructions based on the vehicle's remaining battery power, departure time, and charging / discharging capacity, making it difficult to distinguish the differences in the carbon properties of the stored energy among different vehicles.

[0018] Introducing energy and carbon attribute status at the vehicle level further alters the number of online vehicles upon arrival and departure. The number and arrangement of vehicle statuses also change accordingly, making it difficult for existing fixed-dimensional control models to directly utilize this information. Simultaneously, the EV control objectives provided by the microgrid must satisfy vehicle access status, V2G permissions, power limitations, and departure requirements. Existing methods struggle to simultaneously utilize vehicle carbon attribute information while ensuring control commands are implemented at the specific vehicle level. Summary of the Invention

[0019] The purpose of this invention is to provide a microgrid intelligent control method and system based on the carbon attribute migration state characterization of electric vehicles, so as to solve the technical problems mentioned in the background art.

[0020] This invention provides a smart control method for microgrids based on the carbon attribute migration state characterization of electric vehicles, comprising: At the beginning of each control period, microgrid operation data and vehicle status records of each online EV after the end of the previous control period are collected. The vehicle status records include at least stored energy, carbon attribute inventory, and average carbon intensity. The vehicle status records are continuously updated based on the pre-acquired initial EV arrival status. For each online EV, the vehicle status features are constructed based on the vehicle status record after the end of the previous control period, which represents the energy and carbon attribute status; the vehicle's remaining access time and current departure energy gap, which represent the urgency of departure; the vehicle's current maximum charge and discharge power, which represents the adjustable capability; and the vehicle's V2G permission status. A single vehicle state set is jointly constructed based on the single vehicle state characteristics of each online EV; features are extracted and aggregated from the single vehicle state set to form a dynamic EV state representation; The reinforcement learning input state for the current control period is constructed based on the microgrid operation data, dynamic EV state characterization, pre-acquired decision reference bus carbon intensity, and actual bus dynamic carbon intensity from the previous control period. The reinforcement learning input state of the current control period is input into the reinforcement learning control model to generate microgrid equipment control actions and EV overall charging and discharging targets. The EV overall charging and discharging targets are allocated to each online EV that is allowed to charge and discharge and individual vehicle charging and discharging instructions are generated. After the microgrid equipment control actions and single-vehicle charging and discharging commands are generated, the microgrid-level safety action correction and single-vehicle-level safety action correction are performed sequentially. The corrected control commands are then sent to the microgrid equipment and charging facilities. Based on the actual execution results, the microgrid operation data is determined, the single-vehicle status records of each vehicle are updated synchronously, and the updated status is used as the input for the next control period.

[0021] Preferably, the online EVs are managed in the form of an online vehicle set, which is updated in real time according to the vehicle's arrival and departure status. When a vehicle arrives at the station, the vehicle type, rated battery capacity, actual arrival time, estimated departure time, departure energy requirement, maximum charging power, maximum discharging power, upper limit of allowed energy, lower limit of allowed energy, and V2G permissions are recorded simultaneously.

[0022] Preferably, the vehicle status record is associated with the vehicle's unique identifier; the vehicle status record is continuously updated based on the initial state of the EV upon arrival, including: No. i The stored energy of an EV is updated according to the following formula: ; In the formula, and The first i EVs during control period t Start and control period t Energy storage after the end For charging efficiency, For discharge efficiency, To control the length of the time period; the first i The actual charging power and actual V2G discharging power of the EV during the control period t are respectively and ; No. i The carbon footprint of an EV is updated according to the following formula: ; In the formula, and The first i EVs during control period t Start and control period t Carbon inventory remaining after the event The average carbon strength of the vehicle before discharge; Average carbon intensity after updating energy storage and carbon property stock Represented as: .

[0023] As a preferred option, it also includes: Establish a charging batch carbon attribute record associated with the vehicle's unique identifier based on the charging process at different times of the vehicle. The vehicle's stored energy is calculated by accumulating the remaining energy of all charging batches retained by the vehicle during the control period; The carbon inventory of a vehicle is calculated by multiplying the batch carbon intensity and the batch remaining energy of all charging batches retained by the vehicle during the control period. When a vehicle performs V2G discharge, the remaining energy and carbon attribute inventory of the corresponding batch are reduced according to the pre-set batch deduction rules that remain consistent within the same carbon accounting cycle. If the remaining energy of a batch is insufficient to meet the energy reduction of the battery side corresponding to this discharge, the next batch will be deducted until the actual discharge amount is reached. The batch deduction rules include deduction based on the first charge, deduction based on the last charge, or other pre-set carbon accounting rules.

[0024] As a preferred option, the first i EVs during control period t The bicycle status record is represented as follows: ; In the formula, This records the single-vehicle status of the i-th EV during the control period t. Indicates energy storage, Indicates the carbon stock; Indicates average carbon intensity; when When the value is greater than zero, the average carbon intensity is determined based on the ratio of carbon property stock to stored energy. When the value is zero, its average carbon intensity is set to a preset state value, and the vehicle is prohibited from executing discharge commands. The single-vehicle state characteristics are represented as follows: ; In the formula, For the first i EVs during control period t The characteristics of the single vehicle status, This represents the remaining access time for the vehicle until its estimated departure time. This refers to the amount of stored energy required for a vehicle to leave the station. This represents the current energy deficit for the vehicle before it leaves the station. This represents the maximum charging power that the vehicle can currently perform. This represents the current maximum V2G discharge power that the vehicle can perform. This indicates the vehicle's V2G permission status.

[0025] Preferably, the dynamic EV state characterization during the control period t is expressed as: ; In the formula, For dynamic EV state representation function, To represent the dynamic EV state corresponding to control time period t, This represents the set of vehicle states.

[0026] As a preferred approach, feature extraction and aggregation are performed on the set of individual vehicle states to form a dynamic EV state representation, including: A single-vehicle encoder with shared parameters is used to perform feature encoding on each online EV in the dynamic single-vehicle state set to obtain the corresponding single-vehicle encoding features; Based on the vehicle coding features, a vehicle attention score is generated according to the vehicle's average carbon intensity, off-site energy gap, remaining access time, and available charging and discharging power. Based on the attention scores of each online EV, normalized attention weights are determined; the weighted coding results are obtained by weighting and summing the coding features of each vehicle according to the vehicle attention weights. A set of statistical features is constructed based on the number of online EVs, the number of online EVs with V2G permissions, the sum of the stored energy of each online EV, the sum of the carbon attribute inventory of each online EV, the sum of the current off-site energy gap of each online EV, the sum of the current maximum charging power of each online EV, and the sum of the current maximum V2G discharge power of each online EV. After performing feature concatenation operations on the weighted encoding results and set statistical features, the results are input into a feature fusion function to obtain a dynamic EV state representation.

[0027] Preferably, the reinforcement learning control model constructs a reward function based on the microgrid's operating costs, carbon emission levels, and the satisfaction of operating constraints, and uses the reward signal to optimize the control strategy. During the actual control phase, the trained control strategy is invoked to generate the original control actions for each control period.

[0028] Preferably, the overall charging and discharging target of the EVs is allocated to each online EV that is allowed to charge and discharge, and individual vehicle charging and discharging instructions are generated, including: When allocating charging targets, vehicles that are in the access state, have not reached their energy storage limit, and are allowed to charge are selected from the online vehicle set. The charging priority determination method includes: The closer a vehicle is to its expected departure time and the greater its energy deficit before departure, the higher its charging priority. The carbon intensity of the new energy storage battery is added based on the ratio of the carbon intensity of the power bus to the vehicle charging efficiency during the current control period. The greater the difference between the average carbon intensity and the carbon intensity of the new energy storage battery, the higher the charging priority. The higher the current maximum charging power of a vehicle, the higher its charging priority. When allocating discharge targets, vehicles that are in the access state and allowed to discharge are selected from the online vehicle set. The discharge priority determination method includes: The greater the difference between the dynamic carbon intensity of the power bus and the carbon intensity of the discharge energy actually input to the power bus by the vehicle during the control period, the higher the discharge priority. The higher the current maximum V2G discharge power that a vehicle can perform, the higher its discharge priority. The higher the ratio of the vehicle's current energy deficit before departure to the remaining access time before the vehicle's expected departure time, the lower the discharge priority.

[0029] The present invention also provides a microgrid intelligent control system based on the carbon property migration state characterization of electric vehicles, which includes: The data acquisition module is used to collect microgrid operation data and individual vehicle status records of each online EV at the beginning of each control period and after the end of the previous control period. The individual vehicle status records include at least stored energy, carbon attribute inventory, and average carbon intensity. The individual vehicle status records are continuously updated based on the pre-acquired initial EV arrival status. The vehicle status feature construction module is used to construct vehicle status features for each online EV based on the vehicle status record after the end of the previous control period, which represents the energy and carbon attribute status; the vehicle's remaining access time and current departure energy gap, which represents the urgency of departure; the vehicle's current maximum charge and discharge power, which represents the adjustable capability; and the vehicle's V2G permission status. The extraction module is used to jointly construct a set of vehicle states based on the individual vehicle state characteristics of each online EV; and to extract features from and aggregate the set of vehicle states to form a dynamic EV state representation. The reinforcement learning input state construction module is used to construct the reinforcement learning input state for the current control period based on the microgrid operation data, dynamic EV state characterization, pre-acquired decision reference bus carbon intensity, and actual bus dynamic carbon intensity of the previous control period. The generation module is used to input the reinforcement learning input state of the current control period into the reinforcement learning control model to generate microgrid equipment control actions and EV overall charging and discharging targets, allocate the EV overall charging and discharging targets to each online EV that is allowed to charge and discharge, and generate individual vehicle charging and discharging instructions. The correction and distribution module is used to correct the safety actions of the microgrid equipment and the charging and discharging commands of individual vehicles in sequence after the microgrid equipment control actions and individual vehicle charging and discharging commands are generated. The corrected control commands are then distributed to the microgrid equipment and charging facilities. Based on the actual execution results, the microgrid operation data is determined, the individual vehicle status records of each vehicle are updated synchronously, and the updated status is used as the input for the next control period.

[0030] By combining the technical solution of the present invention, the following technical effects can be achieved: (1) Improve the accuracy of identifying the carbon properties of stored electrical energy in bicycles.

[0031] By establishing the stored energy, carbon attribute inventory, and average carbon intensity for each EV separately, it is possible to distinguish vehicles with the same stored energy but different historical charging periods and charging power sources. This avoids the loss of individual vehicle carbon attribute differences caused by using only the state of charge or aggregated average carbon intensity, and provides accurate carbon attribute status for subsequent vehicle charging and discharging control.

[0032] (2) Ensure the synchronization and consistency of EV energy and carbon properties throughout the entire process.

[0033] When a vehicle is charging, the newly added energy inherits the dynamic carbon intensity of the electrical bus during the charging period; when the vehicle is parked, the correspondence between stored energy and carbon properties is maintained; when the vehicle discharges via V2G, energy and carbon properties are synchronously transferred out based on the vehicle's historical stored energy; when the vehicle leaves the station, the state of the actually departing vehicle is removed. This avoids inconsistencies between energy state changes and carbon property updates, improving the accuracy of V2G discharge carbon intensity and electrical bus dynamic carbon intensity calculations.

[0034] (3) Enhance the adaptability of the control system to dynamic access of EVs.

[0035] By converting the constantly changing state of individual vehicles in terms of quantity and arrangement into a dynamic EV state representation with preset dimensions, changes in vehicle arrival, departure, and the number of online vehicles do not alter the input structure of the reinforcement learning model. Simultaneously, the resulting state preserves vehicle energy distribution, carbon attribute distribution, departure urgency, and adjustability, enabling the same control model to be applicable to different vehicle access scales and vehicle compositions.

[0036] (4) Improve the low-carbon economic operation of multi-energy microgrids.

[0037] By inputting dynamic EV state representations along with wind power, photovoltaic power, electricity and heating / cooling loads, energy prices, dynamic carbon intensity of the power bus, stationary energy storage status, and the operating status of multiple energy devices into a reinforcement learning control model, it is possible to coordinate the power interaction of the public grid, combined heat and power units, heating and cooling equipment, stationary energy storage, and EV charging and discharging power. Under the condition of meeting the balance of electricity, heat, and cooling supply and demand and the demand for vehicle departure from the grid, it guides EVs to store electrical energy during periods of lower carbon intensity and release historically stored low-carbon electrical energy during appropriate periods. This optimizes the power purchase structure of the public grid and the output structure of fuel equipment, reduces the use of high-carbon energy, and balances the operating costs of microgrids, carbon emission levels, and the utilization of new energy sources.

[0038] (5) Improve the executability and operational safety of microgrid control commands.

[0039] By allocating the overall charging and discharging targets of EVs to specific online vehicles and modifying them according to vehicle type, V2G permissions, energy boundaries, remaining access time, off-site requirements, and power limitations, reinforcement learning control results can be transformed into individual vehicle commands executable by the charging infrastructure. Combined with safety action corrections at the microgrid and individual vehicle levels, equipment control commands can satisfy multi-energy balance, equipment power boundaries, and energy storage operation limitations. Furthermore, the status of the next control period can be updated based on actual execution results, improving the reliability of the continuous control process. Attached Figure Description

[0040] Figure 1 This is a diagram of a multi-energy microgrid structure including electric vehicles provided in an embodiment of the present invention; Figure 2 A flowchart of a microgrid intelligent control method based on the carbon attribute migration state characterization of electric vehicles, provided for an embodiment of the present invention. Detailed Implementation

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

[0042] In view of the above-mentioned deficiencies in the background technology, the present invention aims to solve the following engineering and technical problems: (1) Establish a joint state characterization of the energy and carbon properties of a single vehicle.

[0043] The existing State of Charge (SOC) can only represent the vehicle's remaining battery power and cannot reflect the carbon attributes corresponding to the stored energy. Therefore, it is necessary to establish a correspondence between the energy state and carbon attribute state of a single EV, so that the vehicle's stored energy, carbon attribute inventory, and average carbon intensity can be uniformly represented, while retaining information reflecting the differences in carbon attributes at different charging periods.

[0044] (2) A method for updating the energy and carbon properties of a single vehicle throughout the entire process.

[0045] During the arrival, charging, parking, V2G discharging, and departure processes of EVs, their energy state and carbon property state change. The relevant state update method should reflect the inheritance relationship between charging energy and the carbon intensity of the electrical bus, maintain the continuity of carbon property state during parking, and determine the carbon property corresponding to the discharging energy based on historical charging states. Furthermore, the online vehicle state should be updated based on the actual arrival and departure of vehicles.

[0046] (3) Develop dynamic state representation and executable control methods suitable for microgrid control.

[0047] The number of online EVs and their individual status change continuously during operation, making them difficult to directly use as input for a fixed-dimensional control model. Therefore, it is necessary to incorporate EV energy, carbon properties, connection time, off-site requirements, and adjustability into a state representation that can be used by the control model, and to participate in control decisions together with the microgrid's operating status.

[0048] The generated EV control targets should also be able to be assigned to specific vehicles and meet operating conditions such as single-vehicle power limits, V2G permissions, access time, energy boundaries, and off-site requirements, so that carbon attribute information can be truly used for microgrid control.

[0049] Combination Figure 1 and Figure 2This paper describes a microgrid intelligent control method based on the carbon attribute migration state characterization of electric vehicles according to the present invention.

[0050] 1.1 Overall Technical Solution This invention proposes a multi-energy microgrid control method that takes into account the carbon attribute migration of a single vehicle. The overall control flow is shown in the attached figure. Figure 2 As shown in the diagram, the method uses a grid-connected multi-energy microgrid and an online EV set connected to the microgrid as the control objects. The EV aggregation management unit collects vehicle information, saves individual vehicle status, receives the overall EV charging and discharging target, and coordinates the execution of specific vehicles. Each EV establishes its own unique energy storage, carbon attribute inventory, and average carbon intensity associated with its vehicle identifier, without equating all online vehicles with a unified carbon attribute aggregated energy storage device. During each control period, microgrid operation data and the status information of each online EV are first collected, and the online vehicle set is updated based on vehicle arrival and departure status. Then, the decision reference bus carbon intensity for the current control period is determined, individual vehicle control characteristics are constructed, and the dynamically changing online vehicle set is encoded and summarized to form a fixed-dimensional dynamic EV carbon attribute migration state representation. This dynamic EV state representation, along with wind and solar power output, electrical and thermal loads, energy prices, fixed energy storage status, energy conversion equipment status, and bus carbon intensity, are input into a reinforcement learning control model to generate microgrid equipment control actions and the overall EV charging and discharging target. The EV aggregation management unit allocates the overall target to specific vehicles based on their carbon attributes, departure requirements, adjustability, and V2G permissions, and sequentially performs safety action corrections at the microgrid and individual vehicle levels. After the control commands are executed, the actual dynamic carbon intensity of the power bus is determined based on the actual execution results of various power sources and vehicles, and the stored energy, carbon attribute inventory, and average carbon intensity of each EV are updated simultaneously. The updated microgrid state and dynamic EV state representation serve as inputs for the next control period, thus forming a continuous closed-loop control process.

[0051] 1.2 Carbon intensity of the power bus and carbon properties of a single vehicle Combined with appendix Figure 1 The multi-energy microgrid structure shown has its power bus connected to the public power grid, wind power, photovoltaic power, combined heat and power units, stationary energy storage, electrical loads, electric chillers, and the EV aggregation management unit. The EV aggregation management unit maintains bidirectional power interaction with the power bus, used to collect vehicle information, receive control targets, and coordinate the execution of charging and discharging commands. The EV aggregation management unit does not establish a carbon attribute state as a unified energy storage device; each online EV maintains its own energy state and carbon attribute state.

[0052] 1.2.1 Decision Reference Electric Bus Carbon Intensity vs. Actual Electric Bus Dynamic Carbon Intensity In each control period, the carbon intensity of the electric bus is divided into the decision reference carbon intensity and the actual dynamic carbon intensity of the electric bus. The decision reference carbon intensity is determined before the control action of the current control period is generated, and is used to construct the reinforcement learning control state, generate microgrid device control actions, and allocate the overall charging and discharging target of the EV to individual vehicles.

[0053] The actual dynamic carbon intensity of the power bus is determined after the control action is executed during the current control period, based on the actual electrical energy input to the power bus by various power sources and its corresponding carbon intensity. This is used to update the carbon properties of the electrical energy actually charged into the EV and the fixed electrical energy storage during the control period.

[0054] Control period t The decision reference for the carbon strength of the electric bus is expressed as: (1) In the formula, To control the time period t Decision reference: dynamic carbon intensity of the electric bus; The set of reference power sources determined before the control action is generated; For the first Similar electrical energy sources during control periods t Reference power supply; This is the reference carbon intensity corresponding to this type of electrical energy source.

[0055] In a simplified implementation, the actual dynamic carbon intensity of the electric bus in the previous control period is used as the decision reference carbon intensity of the electric bus in the current control period, that is: (2) In a preferred embodiment, the decision reference bus carbon intensity for the current control period is determined based on the public grid carbon intensity, wind and solar power forecast output, load forecast results, equipment operating status of the previous control period, and the actual dynamic carbon intensity of the power bus in the previous control period.

[0056] The reinforcement learning control model generates the initial control actions for the current control period based on the control state, including the carbon intensity of the decision reference bus. After completing the target allocation for each vehicle and the correction of safety actions, each energy device and charging facility executes the corresponding control commands.

[0057] After the control period ends, the control period is determined based on the actual power of various power sources input to the power bus and their corresponding carbon intensity. t Actual dynamic carbon strength of electric bus: (3) In the formula, To control the time period t The actual dynamic carbon intensity of the power bus, expressed as the carbon emissions per unit of electricity; To control the time period t The collection of electrical energy sources that actually supply power to the power bus; For the first j The actual power supplied by the similar electrical energy source; This represents the actual carbon intensity corresponding to this type of electrical energy source.

[0058] 1.2.2 Combined state of energy and carbon properties of a single vehicle Establish a single-vehicle status record associated with a unique vehicle identifier for each EV connected to the charging facility. i EVs during control period t The combined state of energy and carbon properties is represented as: (4) In the formula, For the first i EVs during control period t The combined energy and carbon properties of the first state, for the first i An EV, its core functionality includes at least energy storage. Carbon property stock and average carbon strength .

[0059] Among them, energy storage and carbon property stock The basic state of a single vehicle, average carbon intensity This represents the average carbon attribute corresponding to a unit of electrical energy stored in a vehicle, and all three conditions must be met: (5) In the formula, when When the value is greater than zero, the average carbon intensity is determined based on the ratio of carbon property stock to stored energy. When When the value is zero, its average carbon intensity is set to a preset value, and the vehicle is prohibited from executing discharge commands.

[0060] The carbon attribute status of a single vehicle is bound to its unique identifier and remains unchanged regardless of the arrival, departure, or charging / discharging of other vehicles. Different vehicles with the same stored energy or the same state of charge can have different carbon attribute reserves and average carbon intensity, thus distinguishing the differences in stored energy generated during charging at different carbon intensity periods. This joint status is used to address the problem that using only the state of charge cannot reflect the carbon attribute of a vehicle's stored energy.

[0061] 1.2.3 Determination of the initial state of the vehicle upon arrival After the vehicle connects to the charging facility, the EV aggregation management unit determines the initial stored energy of the vehicle upon arrival at the station based on the vehicle identification, rated battery capacity, and current state of charge. (6) In the formula, For the first i The rated battery capacity of an EV This refers to the state of charge of the vehicle when it arrives at the station.

[0062] The initial carbon attributes carried by a vehicle upon arrival are determined based on the source information of the electrical energy stored in the vehicle before arrival. If historical charging information is available, the initial carbon attribute inventory is determined based on the historical charging period, the amount of electricity charged, and the corresponding grid carbon intensity. If complete historical charging information is unavailable, the initial average carbon intensity of the vehicle is determined based on the vehicle's most recent charging location, the most recent charging period, grid carbon intensity records, or a preset initial carbon intensity.

[0063] The initial carbon inventory of the vehicle upon arrival at the station is expressed as follows: (7) In the formula, The initial average carbon intensity for the stored electrical energy when the vehicle arrives at the station. The initial stored energy. The initial carbon property stock and the initial average carbon intensity together constitute the initial combined state of the vehicle after it is connected to the microgrid.

[0064] 1.3 Single-vehicle EV energy and carbon attribute migration update The energy and carbon attribute migration update for a single EV includes the processes of vehicle arrival, charging, parking, V2G discharge, and departure. The status record of each EV is associated with its unique vehicle identifier, and the vehicle's stored energy, carbon attribute inventory, and average carbon intensity are updated synchronously based on the actual charging and discharging power measured by the charging facility. During the update process, the aggregated average status of online vehicles is not used to replace the individual vehicle status, nor is the carbon attribute carried away by departing vehicles estimated based on the average carbon intensity of other online vehicles.

[0065] 1.3.1 Uniform update of bicycle energy and carbon properties Let the first i The actual charging power and actual V2G discharging power of the EV during the control period t are respectively and The actual charging power and actual V2G discharging power are both measured using the actual power output obtained from the AC side of the charging facility.

[0066] No. i The stored energy of an EV is updated according to the following formula: (8) In the formula, and The first i EVs during control period t Start and control period t Energy storage after the end For charging efficiency, For discharge efficiency, To control the length of the time period.

[0067] When a vehicle is charging, the carbon attributes corresponding to the electrical energy supplied by the power bus are included in the vehicle's carbon attribute inventory. The carbon attributes corresponding to charging losses are borne by the newly added energy actually stored in the battery. When the vehicle is discharging, the carbon attribute inventory that migrates out as the battery energy decreases is determined based on the average carbon intensity of the vehicle's stored electrical energy before discharge. Therefore, the first... i The carbon footprint of an EV is updated according to the following formula: (9) In the formula, and The first i EVs during control period t Start and control period t Carbon inventory remaining after the event The average carbon intensity of the vehicle before discharge.

[0068] After updating the stored energy and carbon property stock, the average carbon intensity of a vehicle is expressed as: (10) when When the value is greater than zero, the average carbon intensity of the updated vehicle is determined according to equation (10). When the value is zero, the vehicle's average carbon intensity is set to a preset value, and the vehicle's dischargeable state is set to unavailable.

[0069] For the same EV to not simultaneously perform charging and discharging within the same control period, the following condition must be met: (11) Standard EVs are only allowed to perform charging operations, and their discharge power is always set to zero. V2G EVs are allowed to perform discharging operations when they obtain discharge authorization and meet the requirements for access status, energy boundary, power boundary, and off-site operation.

[0070] When the vehicle is connected but not charging or discharging, and Both are zero. According to equations (8) and (9), the vehicle's stored energy and carbon properties remain constant between adjacent control periods.

[0071] The vehicle's energy and carbon properties are updated based on the actual power output, without using the original control power output by the reinforcement learning model but not actually executed, or the planned power before the safety action correction.

[0072] 1.3.2 V2G Discharge Energy Carbon Intensity No. i V2G type EV during control period t When discharging to the power bus, the electrical energy output from the AC side of the charging facility is: (12) After considering vehicle discharge efficiency, the energy reduction in the vehicle battery is: (13) When charging batch carbon attribute records are not used, the amount of carbon attribute inventory migrating out during the discharge process is determined based on the average carbon intensity of the vehicle before discharge: (14) The actual V2G discharge energy carbon intensity entering the power bus is expressed as: (15) In the formula, For the first i EVs during control period t The actual discharge energy carbon intensity of the input busbar.

[0073] The carbon properties corresponding to discharge losses are allocated to the actual discharge energy entering the electrical bus. Therefore, the carbon intensity of V2G discharge energy includes the loss effect caused by discharge efficiency. The carbon intensity of V2G discharge energy is determined by the carbon properties of the vehicle's historical stored energy, and does not directly use the dynamic carbon intensity of the electrical bus at the moment of discharge.

[0074] When multiple EVs discharge to the power bus during the same control period, the overall carbon intensity of the EV discharge energy is determined based on the output power and discharge energy carbon intensity of each actual discharging vehicle: (16) In the formula, To control the time period t The set of vehicles actually performing V2G discharge. The comprehensive carbon intensity is the carbon intensity corresponding to the EV discharge energy source in the dynamic carbon intensity calculation of the power bus.

[0075] 1.3.3 Vehicle arrival and departure status updates No. i Once an EV arrives at the charging area and connects to the charging facility, the vehicle is added to the online vehicle collection. Based on the initial stored energy, initial carbon attribute inventory, and initial average carbon intensity determined in section 1.2, a single-vehicle status record associated with the vehicle's unique identifier is established.

[0076] Upon vehicle arrival, the system simultaneously records vehicle type, rated battery capacity, actual arrival time, estimated departure time, departure energy requirement, maximum charging power, maximum discharging power, upper limit of allowable energy, lower limit of allowable energy, and V2G permissions. V2G permissions for standard EVs are set to unavailable. V2G EVs determine their ability to discharge to the power bus based on their authorization status.

[0077] The original stored energy and carbon properties of the arriving vehicle are added to the online vehicle set as the vehicle's initial state, and are not merged with the stored energy or carbon property states of other vehicles.

[0078] Once a vehicle reaches its actual departure time, its single-vehicle status record is removed from the online vehicle set. If the vehicle performs charging or discharging during the last control period before departure, the energy and carbon properties shown in equations (8) to (15) are updated first based on the actual power of that control period, and then the vehicle is removed from the station.

[0079] Let the set of online vehicles during the control period t be . The arrival and departure vehicle sets for the next control period are respectively and The online vehicle set is then updated according to the following formula: (17) The status removed when a vehicle leaves the station includes the vehicle's stored energy, carbon credits, average carbon intensity, energy required for departure, rechargeable capacity, dischargeable energy, remaining access time, charge / discharge power limits, and V2G permissions.

[0080] The energy and carbon properties carried away by departing vehicles are determined based on the updated single-vehicle status of the actual departing vehicle, without using the average status of other online vehicles for estimation, nor are they deducted from the aggregated energy or aggregated carbon properties of online vehicles according to an average ratio.

[0081] When a vehicle arrives at or departs from a station during the control period, the energy and carbon attributes of that control period are updated based on the actual charge and discharge capacity measured by the charging facility. If the actual charge cannot be obtained directly, the charge and discharge capacity is determined based on the actual access duration and actual power of the vehicle during the control period.

[0082] After the online vehicle set is updated, the status of vehicles that have already left the station will no longer participate in the dynamic EV status representation, reinforcement learning control decision-making, and single-vehicle charging and discharging target allocation during subsequent control periods.

[0083] 1.3.4 Preferred method for recording carbon attributes of charging batches In a preferred embodiment, in addition to storing the energy stored in a single vehicle, the carbon attribute inventory, and the average carbon intensity, a charging batch carbon attribute record associated with the vehicle's unique identifier is also established according to the charging process at different times of the vehicle.

[0084] Each charging batch includes at least a batch identifier, charging period, actual stored energy, batch carbon intensity, and batch remaining energy. The batch carbon intensity represents the carbon properties corresponding to the energy stored per unit battery side. Taking vehicle charging efficiency into account, the batch carbon intensity of a newly established charging batch is determined based on the actual dynamic carbon intensity of the power bus during the corresponding charging period and the vehicle charging efficiency.

[0085] The initial stored energy carried by the vehicle upon arrival can also be set as an initial energy batch. The batch carbon intensity of the initial energy batch is determined using the initial average carbon intensity of the vehicle upon arrival, as defined in section 1.2.

[0086] Let the first i EVs during control period t The set of retained charging batches is The energy stored in the vehicle is then expressed as: (18) Vehicle carbon inventory is represented as follows: (19) In the formula, For the first k The remaining energy of each charging batch during the control period t. For the first k The carbon intensity corresponding to each charging batch.

[0087] Vehicles during control period t After charging, a new charging batch is established based on the actual increase in energy stored in the battery: (20) (twenty one) In the formula, To control the time period t Newly established charging batches, The carbon intensity on the battery side corresponds to this charging batch. According to Equations (20) and (21), the carbon attribute inventory added by the new charging batch is equal to the product of the actual dynamic carbon intensity of the power bus and the actual charging capacity on the AC side of the charging facility, so that the carbon attribute corresponding to the charging loss is included in the new energy actually stored in the battery.

[0088] When the battery-side carbon intensity formed by the vehicle during a continuous control period is the same, adjacent charging records can be merged into the same charging batch according to preset data processing rules.

[0089] When a vehicle performs V2G discharge, the remaining energy and carbon inventory of the corresponding batch are reduced according to a pre-set batch deduction rule that remains consistent within the same carbon accounting cycle. If the remaining energy of a batch is insufficient to meet the energy reduction on the battery side corresponding to this discharge, the deduction continues for the next batch until the actual discharge amount is reached.

[0090] Batch deduction rules include first-charge-first-deduction, last-charge-first-deduction, or other preset carbon accounting rules. The batch deduction order is used to determine the carbon attribute accounting records during the discharge process and does not indicate that the electrical energy inside the battery is physically stored in layers.

[0091] The amount of carbon property stored during discharge is calculated based on the remaining energy of the actual batch after deduction and the batch carbon intensity: (twenty two) In the formula, This is the set of charging batches invoked for this discharge. For from the first k Energy deducted from each charging batch.

[0092] After the batch deduction is completed, the vehicle's stored energy, carbon inventory, and average carbon intensity are re-determined based on the energy and carbon properties of the remaining batches.

[0093] When no charging batch carbon attribute record is set, the energy and carbon attributes are updated synchronously according to the methods described in 1.3.1 and 1.3.2 based on the average carbon intensity of the vehicle before discharge.

[0094] 1.4 Characterization of the migration state of carbon properties in dynamic EVs The online vehicle set changes with vehicle arrivals and departures, and the number and state input order of online vehicles are not fixed in different control periods. To enable the dynamically changing state of individual vehicles to be input into a reinforcement learning control model with a preset input dimension, this invention constructs individual vehicle control features based on the joint state of individual vehicle energy and carbon attributes established in 1.2 and the state update results obtained in 1.3, and performs set-based encoding on the online vehicle states to form a fixed-dimensional dynamic EV carbon attribute migration state representation.

[0095] The EV aggregation management unit is used to collect the status information of each online EV and generate the dynamic EV status representation. The aggregation encoding process does not change the correspondence between the individual vehicle status and the vehicle's unique identifier, nor does it equate online vehicles to aggregated batteries with a uniform energy state and a uniform carbon attribute state.

[0096] 1.4.1 Single vehicle status characteristics and adjustability Based on the joint state of vehicle energy and carbon properties established in 1.2 and the state update results completed in 1.3, the corresponding vehicle state features are constructed: (twenty three) In the formula, For the first i EVs during control period t The characteristics of the single vehicle status, This represents the remaining access time for the vehicle until its estimated departure time. This refers to the amount of stored energy required for a vehicle to leave the station. This represents the current energy deficit for the vehicle before it leaves the station. This represents the maximum charging power that the vehicle can currently perform. This represents the current maximum V2G discharge power that the vehicle can perform. This indicates the vehicle's V2G permission status.

[0097] The energy gap for vehicle departure is expressed as: (twenty four) In the formula, [a] + express m ax(a,0). When the vehicle's current stored energy is lower than the energy required for departure, the departure energy gap is the difference between the two. When the vehicle's current stored energy is not lower than the energy required for departure, the departure energy gap is zero.

[0098] The vehicle's current charging power is limited by both the charging infrastructure's power limit and the vehicle's energy limit, as shown below: (25) In the formula, For the first i Maximum charging power of EVs The maximum allowable energy storage capacity for a vehicle. For charging efficiency, To control the length of the time period.

[0099] To ensure that the vehicle can meet the departure requirements at the expected departure time, the lower bound of the safe energy that the vehicle needs to retain after the current control period ends is determined: (26) In the formula, is the th i The lower limit of safe energy that an EV needs to retain after the current control period ends. This is the lower limit of the energy storage allowed for the vehicle. Equation (26) determines the range of electrical energy that the vehicle is allowed to release during the current control period based on the remaining rechargeable time and maximum charging capacity before the vehicle leaves the station.

[0100] The vehicle's current V2G discharge power is expressed as follows: (27) In the formula, For the firsti The maximum V2G discharge power of an EV For vehicle discharge efficiency.

[0101] When the vehicle does not have V2G permissions Setting it to 0 means the vehicle's maximum discharge power is zero. This applies when the vehicle has V2G permissions. Choose 1, and determine its executable discharge power based on the vehicle's stored energy, lower limit of safe energy, and maximum discharge power.

[0102] Standard EVs retain only the executable charging power. V2G EVs retain the corresponding executable charging and discharging power, provided that the access status, V2G permissions, energy storage boundaries, and off-site requirements are met.

[0103] The vehicle unique identifier is used to bind the single-vehicle status record formed in 1.2 and 1.3, and is used to receive subsequent assigned charging and discharging commands. The vehicle unique identifier is not used as a numerical input in the single-vehicle status characteristics, nor is it used as a fixed arrangement basis in the dynamic EV status representation.

[0104] 1.4.2 Generation of Dynamic EV State Characterization During the current control period, the individual vehicle status characteristics of each online EV collectively constitute the individual vehicle status set: (28) Set of single vehicle states Feature extraction and aggregation are performed to form a dynamic EV state representation with preset dimensions: (29) In the formula, For dynamic EV state representation function, To control the time period t The corresponding dynamic EV state representation.

[0105] The dynamic EV state representation function adopts a set processing method that is insensitive to the order of vehicle inputs and satisfies: (30) In the formula, N t To control the time period t The number of online vehicles, This allows for arbitrary arrangement and transformation of online vehicles.

[0106] Equation (30) indicates that changing the input order of vehicle states will not alter the dynamic EV state representation results while keeping the individual vehicle state unchanged. This avoids the impact of differences in vehicle arrival order, data upload order, and vehicle number on the input of the reinforcement learning control model.

[0107] After a vehicle arrives or departs from a station, the online vehicle set is updated in accordance with the method described in 1.3. And regenerate a dynamic set of bicycle states based on the updated online vehicles. Changes in the number of vehicles only alter the number of state features of individual vehicles in the set; they do not change the output dimension of the dynamic EV state representation. .

[0108] Dynamic EV state characterization is used to retain the stored energy distribution, carbon attribute distribution, off-site urgency, and charge / discharge adjustability of online vehicles. Vehicles with the same stored energy but different carbon attribute reserves or average carbon intensity are retained in different carbon attribute states within the set. Vehicles with the same carbon attributes but different remaining access time, off-site energy gap, or executable power are retained in different regulation characteristics within the set.

[0109] During the ensemble processing, a single aggregated average carbon intensity is not used to replace the carbon attribute status of each vehicle. The aggregated result is only used as a fixed-dimensional input to the reinforcement learning control model, and the energy and carbon attribute status of each EV are still saved and updated separately according to the vehicle's unique identifier.

[0110] During the control period t When there are no online vehicles, the dynamic single-vehicle state set is empty. In this case, the dynamic EV state representation is set to the preset state corresponding to the empty vehicle set, and the overall rechargeable power and dischargeable power of the EV are set to 0.

[0111] 1.4.3 Parameter-sharing encoding and carbon property attention In a preferred embodiment, a parameter-sharing single-vehicle encoder is used to perform feature encoding on each online EV in the dynamic single-vehicle state set.

[0112] No. i The single-vehicle coding characteristics of an EV are represented as follows: (31) In the formula, For the first i The vehicle coding characteristics of an EV For single-vehicle encoders with shared parameters, These are shared parameters for single-vehicle encoders.

[0113] All online EVs use the same single-vehicle encoder and encoding parameters. Newly arrived vehicles can be directly added to the encoding process, and departing vehicles can be directly removed from the encoding object, without needing to adjust encoder parameters or input structure based on the number of online vehicles.

[0114] Based on the vehicle coding features, a vehicle attention score is generated according to the vehicle's average carbon intensity, off-site energy gap, remaining access time, and available charging / discharging power. (32) In the formula, e i,t For the first i Attention rating of EVs For attention scoring function, These are the parameters of the attention scoring function.

[0115] Based on the attention scores of each online EV, normalized attention weights are determined: (33) In the formula, For the first i EVs during control period t Attention weights. The encoded features of a single vehicle are weighted and summarized according to the vehicle's attention weights: (34) In the formula, The weighted encoding result for the online vehicle set.

[0116] Carbon attribute attention is used to characterize the relative importance of different vehicle states to the current microgrid control decisions. The average carbon intensity of the vehicle's stored energy, off-site demand, remaining access time, and adjustability all influence the attention weight. This attention weight is only used to form a dynamic EV state representation and is not directly used as the charging power or V2G discharging power of a specific vehicle.

[0117] To preserve the overall size and adjustability of the online vehicle set, the following statistical characteristics of the set are constructed: (35) In the formula, Statistical characteristics of online vehicle sets, For the number of online vehicles, This refers to the number of online vehicles with V2G permissions.

[0118] The total stored energy and total carbon inventory in the ensemble statistical characteristics reflect the overall energy and carbon footprint of online vehicles. The total off-site energy gap reflects the overall charging demand of online vehicles. The sum of the executable charging power and executable discharging power reflects the overall adjustable capability of EVs during the current control period.

[0119] The weighted coding results are fused with ensemble statistical features to form the final dynamic EV carbon property migration state characterization: (36) In the formula, Concat represents the feature join operation. This is the feature fusion function.

[0120] Weighted coding results are used to preserve the differences between individual vehicle energy state, carbon attribute state, departure urgency, and adjustability, while aggregated statistical features are used to supplement the online vehicle scale and overall adjustability. The fusion of the two results forms a dynamic EV state representation with preset dimensions.

[0121] The dynamic EV state representation and the microgrid operating state are used together as inputs to the subsequent reinforcement learning control model to generate microgrid device control commands, as well as the overall EV charging power and overall V2G discharging power.

[0122] 1.5 Microgrid Control and Vehicle Command Execution Based on Reinforcement Learning The reinforcement learning control model receives the microgrid operating status during the current control period and the dynamic EV carbon attribute migration state representation formed in section 1.4, and generates microgrid device control actions and overall EV charging and discharging targets. After being allocated to individual vehicles and corrected for safety actions, the overall EV charging and discharging targets are executed by the EV aggregation management unit and charging facilities.

[0123] After the control period ends, the microgrid operating status is updated based on the actual execution results of the equipment and vehicles. Each EV updates its stored energy, carbon attribute inventory, and average carbon intensity according to the method described in 1.3, and regenerates a dynamic EV state representation based on the updated set of online vehicles.

[0124] 1.5.1 Reinforcement Learning Control State Control period t The reinforcement learning input state is composed of the microgrid operating state and the dynamic EV state representation: (37) In the formula, This refers to the microgrid operating status that can be obtained at the start of the control period; Characterization of the dynamic carbon property migration state of EVs; Carbon intensity of the electric bus serves as a decision-making reference during the current control period; The actual dynamic carbon intensity of the electric busbar during the previous control period.

[0125] The microgrid's operating status includes wind and solar power output, electricity, heat and cooling loads, public grid interaction status, energy prices, public grid carbon intensity, stationary energy storage status, and energy conversion equipment operating status. It does not include the current decision reference bus carbon intensity and the actual dynamic carbon intensity of the bus in the previous control period.

[0126] Stationary electrical energy storage status includes current stored energy, carbon property stock, average carbon intensity, permissible charge / discharge power, and carbon intensity corresponding to discharged electrical energy. Thermal and cold energy storage status includes current stored energy and permissible charge / discharge power. The operating status of energy conversion equipment includes the current output and adjustable range of combined heat and power units, gas-fired boilers, electric chillers, and absorption chillers.

[0127] Dynamic EV state characterization preserves the energy distribution, carbon attribute distribution, off-site urgency, and adjustability of online vehicles, enabling the energy and carbon attribute migration results of individual vehicles to directly participate in microgrid control decisions.

[0128] Reinforcement learning control models generate initial control actions based on input states: (38) In the formula, To reinforce the original control actions output by the learning control model, For parameters The reinforcement learning control strategy.

[0129] The original control action is represented as: (39) In the formula, For power exchange with the public power grid, For the operating power of combined heat and power units, For the heating power of the gas boiler, Provides cooling power to the electric chiller. The cooling capacity supplied to the absorption chiller.

[0130] and These are the charging power and discharging power of the fixed energy storage, respectively. and These are the thermal energy storage charging power and the heat release power, respectively. and These are the charging power and discharging power of the cold energy storage system, respectively.

[0131] and These are the overall charging power target and the overall V2G discharging power target for all online EVs, respectively. The overall EV power target is not directly used as an execution command for individual vehicles; it needs to be further allocated to specific vehicles based on their online vehicle status.

[0132] 1.5.2 Control Evaluation and Strategy Update The reinforcement learning control model evaluates control actions based on the microgrid's operating costs, carbon emission levels, and the satisfaction of operating constraints.

[0133] The microgrid operating cost during control period t is expressed as: (40) In the formula, For microgrid operating costs, and These are the electricity purchase price and the electricity sales price from the public power grid. and These are the power purchased and the power transmitted, respectively. For natural gas prices, This represents the flow rate of natural gas consumption. For equipment operation and maintenance costs, Costs associated with charging and discharging EVs.

[0134] The carbon emissions of the microgrid during the control period t are expressed as: (41) In the formula, For microgrid carbon emissions, Carbon intensity of purchasing electricity from the public grid, where G is the collection of energy devices that consume fuel. For the first g Fuel consumption rate of such equipment This represents the corresponding fuel carbon emission factor.

[0135] Changes in carbon properties caused by EV charging and V2G discharging are used to update the carbon property status of individual vehicles and the dynamic carbon intensity of the power bus. Carbon emissions already included in public grid electricity purchases or fuel consumption are not counted again as new physical carbon emissions due to EV charging and discharging, thus avoiding double counting of the same portion of carbon emissions.

[0136] Construct a reinforcement learning reward function based on microgrid operating costs, carbon emissions, and the degree of constraint violation: (42) In the formula, To control the time period t The reward value, For violations of operational constraints, , and These are the reward weights for operating costs, carbon emissions, and violations of constraints, respectively.

[0137] Violations of operational constraints include imbalances in the supply and demand of electricity, heat, cooling, and natural gas; exceeding the output limits of energy equipment; exceeding the limits of stationary energy storage; conflicts in charging and discharging states; exceeding the limits of public grid interaction power; exceeding the limits of single-vehicle charging and discharging power; and failure to meet vehicle departure requirements.

[0138] The reinforcement learning control model constructs a reward function based on the microgrid's operating costs, carbon emission levels, and the satisfaction of operating constraints, and uses the reward signal to optimize the control strategy. During the actual control phase, the trained control strategy is invoked to generate the original control actions for each control period.

[0139] This invention does not limit the specific policy learning algorithm used in the reinforcement learning control model. Any reinforcement learning algorithm capable of receiving microgrid operating states and dynamic EV state representations and outputting continuous control actions can be used to implement this invention. In a preferred embodiment, a near-end policy optimization algorithm is employed. The policy network takes the microgrid operating states and dynamic EV state representations as inputs and outputs microgrid device control actions and overall EV charging and discharging targets. The value network is used to evaluate the current control state. During the training phase, the policy network and value network are updated based on the states, actions, reward values, and next state samples formed during the control period. After training is completed, the updated policy network is used to generate actual control actions.

[0140] 1.5.3 Allocation of overall EV control objectives to individual vehicles After the reinforcement learning control model outputs the overall EV charging power and overall V2G discharging power, the EV aggregation management unit allocates the overall power target to specific vehicles based on the current online vehicle status.

[0141] When allocating charging targets, from the online vehicle set Vehicles that are in the connected state, have not reached their energy storage limit, and are allowed to charge will be selected.

[0142] No. i The charging priority of each EV is expressed as follows: (43) In the formula, For the first i The charging priority of EVs , and Assign weights to charging. It is a preset positive number.

[0143] The closer a vehicle is to its expected departure time and the larger its energy deficit before departure, the higher its charging priority. Taking vehicle charging efficiency into account, This represents the carbon intensity of the newly added energy storage battery side, estimated based on the carbon intensity of the decision reference bus during the current control period. When the carbon intensity of the newly added energy storage battery side is lower than the vehicle's current average carbon intensity, it is expected that charging the vehicle will reduce its updated average carbon intensity, and the corresponding difference in carbon attributes is included in the charging allocation criteria. The higher the vehicle's current available charging power, the stronger its ability to participate in the current charging target allocation.

[0144] When the carbon intensity of the vehicle's V2G discharge energy is lower than the carbon intensity of the decision reference bus during the current control period, it is expected that the vehicle can input relatively low-carbon energy into the bus.

[0145] No. i The priority of discharge allocation for each EV is expressed as follows: (44) In the formula, For the first i The priority of discharge allocation for EVs , and Assign weights to discharges. The carbon intensity of vehicle V2G discharge energy is defined in 1.3.

[0146] When the carbon intensity of a vehicle's V2G discharge energy is lower than the current dynamic carbon intensity of the power bus, the vehicle can input relatively low-carbon energy into the power bus. The carbon attribute difference of the vehicle, the executable discharge power, the off-site energy gap, and the remaining access time jointly determine the discharge allocation priority, and the vehicle is not forced to discharge solely based on carbon attributes.

[0147] Based on the actual achievable capabilities of the online vehicle, the overall EV objective output by the reinforcement learning control model is revised: (45) (46) In the formula, and These are the revised overall EV charging power target and overall V2G discharging power target, respectively.

[0148] In a preferred embodiment, the charging and discharging power of each EV is determined by the following objectives: (47) The power distribution of the single vehicle satisfies: (48) (49) Equation (49) is used to ensure that the same EV does not perform charging and discharging at the same time during the same control period.

[0149] Standard EVs only enter the charging power allocation range and do not receive V2G discharge commands. V2G EVs enter the discharge power allocation range only if they meet V2G permissions, stored energy boundaries, power boundaries, and off-site requirements.

[0150] Once a single vehicle reaches its power or energy boundary, any remaining unallocated power is redistributed to other online vehicles that still have adjustment capabilities. Once all candidate vehicles have reached their executable boundaries, the unfulfilled overall EV power target is no longer allocated to vehicles.

[0151] 1.5.4 Two-level safety action correction and status feedback After the microgrid equipment control actions and single-vehicle charging and discharging commands are generated, the microgrid layer safety action correction and the single-vehicle layer safety action correction are performed sequentially.

[0152] The microgrid layer safety action correction is used to check the supply and demand balance of electricity, heat, cooling and natural gas, the power boundary of the public grid interaction, the output range of each energy conversion device, the energy boundary of fixed energy storage, and the mutual exclusion conditions of charging and discharging.

[0153] The microgrid layer safety action correction is expressed as follows: (50) In the formula, The control actions are corrected by the microgrid layer. W represents the set of possible actions that satisfy the multi-energy balance, equipment output range, fixed energy storage boundary, and public grid interaction boundary under the current microgrid state, and W is the weight matrix corresponding to the correction cost of each control action.

[0154] When the original control action exceeds the equipment's operating range, the corresponding control quantity is adjusted to fall within the set of possible actions. If an energy deviation still exists after the action correction, compensation is provided based on the public power grid, stationary energy storage, and energy conversion equipment with residual regulation capabilities.

[0155] The single-vehicle layer safety action correction is used to check the actual access status, vehicle type, V2G permissions, executable charging and discharging power, upper and lower limits of stored energy, remaining access time, and departure requirements of each EV.

[0156] The correction for a single-car-level safety action is expressed as follows: (51) In the formula, The power command for each vehicle is generated after the overall EV target is initially allocated to each vehicle. This is the executable power command after single-vehicle layer correction. A set of executable instructions to meet the requirements of single-vehicle access status, V2G permissions, power boundaries, energy boundaries, and off-site requirements. The weight matrix is ​​adjusted for single-vehicle power.

[0157] Charge and discharge commands that do not meet the operating conditions of a single vehicle are reduced or canceled, and the resulting surplus power is redistributed to other online vehicles that meet the conditions.

[0158] If, after redistribution, the actual total charging and discharging power of the EVs still does not match the microgrid layer target, compensation will be provided by the public grid, stationary energy storage, or other adjustable energy devices within their operating boundaries. If the compensation capacity is insufficient, the overall charging power of the EVs or the overall V2G discharging power will be reduced, and the microgrid energy balance will be rechecked.

[0159] The control action after completing the two-level safety action correction is recorded as follows: The control actions are sent to the public grid interface, energy conversion equipment, fixed energy storage controller, and charging facilities, respectively. The EV aggregation management unit sends individual vehicle charging and discharging commands to the corresponding vehicle's charging facility based on the vehicle's unique identifier.

[0160] After the control period ends, the microgrid status is updated based on the actual power output fed back by the equipment controller and metering device. Each EV updates its stored energy, carbon attribute inventory, and average carbon intensity according to the method described in 1.3, based on its actual charging power or actual V2G discharging power.

[0161] After a vehicle actually arrives or departs from a station, the online vehicle set is updated in accordance with the method described in 1.3, and the dynamic EV state representation is regenerated according to the method described in 1.4.

[0162] The system state for the next control period is represented as follows: (52) In the formula, F This provides functions for updating the microgrid state and individual vehicle state. d t+1 This is to monitor changes in external conditions such as renewable energy output, load demand, energy prices, vehicle arrivals and departures during the next control period.

[0163] The updated microgrid operating status and dynamic EV status representation are used together as inputs to the reinforcement learning control model for the next control period, enabling the carbon attribute transfer results of individual vehicles to continuously participate in the microgrid continuous control decision-making.

[0164] The innovation of this invention lies in: (1) Realize the identifiable characterization of carbon properties of stored electrical energy in a single vehicle.

[0165] To address the issue that existing EV status metrics primarily reflect state of charge (SOC) and fail to accurately reflect the carbon attributes of stored energy, this technology sets stored energy, carbon attribute reserves, and average carbon intensity for each EV, and links these statuses to a unique vehicle identifier. This approach differentiates the carbon attributes of different vehicles based on their historical charging history, allowing vehicles with the same stored energy but different charging sources and times to exhibit distinct carbon attribute statuses. Furthermore, by recording the amount of electricity charged and the corresponding bus carbon intensity for each charging cycle, the carbon attributes of different charging batches within a single vehicle are preserved.

[0166] (2) Realize the synchronous migration and updating of energy and carbon properties throughout the entire EV process.

[0167] The dynamic carbon intensity of the power bus is calculated based on actual power sources such as public power grid, wind power, photovoltaic, fuel cell power generation equipment, stationary energy storage discharge, and V2G discharge. This carbon intensity is then used to determine the carbon attributes of the newly added charging energy of the EV. An initial state is established when the vehicle arrives at the station. During charging, energy and carbon attribute inventory are increased simultaneously. The correspondence between the two is maintained during parking. During V2G discharge, energy and carbon attributes are simultaneously transferred out based on the carbon attributes of the vehicle's historical stored energy. Upon departure, the actual departing vehicle's state is removed. This technique achieves continuous updating of a single vehicle's carbon attributes during arrival, charging, parking, discharging, and departure. It avoids using the current power bus carbon intensity to replace the actual carbon attributes of V2G discharge energy and also avoids deducting the carbon attributes of departing vehicles based on the average online vehicle state.

[0168] (3) Realize the transformation of the dynamic vehicle set into the preset dimension control state.

[0169] To address the issue of the constantly changing number and order of online EVs upon arrival and departure, a set of features is extracted for each online EV, including stored energy, carbon attribute status, remaining access time, departure demand, rechargeable capacity, dischargeable energy, V2G permissions, and power limitations, forming a dynamic EV state representation with preset dimensions. This technique achieves adaptation between the changing individual vehicle states and a fixed-input-dimensional control model, while preserving the energy distribution, carbon attribute distribution, departure urgency, and adjustability of online vehicles in the state representation. A parameter-sharing individual vehicle encoder and carbon attribute attention are preferably used to complete the individual vehicle feature encoding and aggregation.

[0170] (4) Enable the carbon attribute migration state of a single vehicle to directly participate in the reinforcement learning control of the microgrid.

[0171] The dynamic EV state characterization, along with wind and solar power output, electrical and thermal loads, energy prices, public grid carbon intensity, dynamic carbon intensity of the power bus, stationary energy storage status, and multi-energy device operating status, are input into a reinforcement learning control model. The model outputs public grid interactive power, multi-energy device output, stationary energy storage charging and discharging power, and the overall EV charging and discharging target. This technique transforms the carbon attributes of a single vehicle from accounting information to control status, enabling the historical carbon attributes of the vehicle's stored energy to continuously influence microgrid equipment operation and EV charging and discharging decisions. In a preferred embodiment, a reinforcement learning algorithm suitable for continuous control actions is used to generate microgrid equipment control actions and the overall EV charging and discharging target.

[0172] (5) To realize the overall control target of EV to the executable allocation of specific vehicles.

[0173] Based on the carbon attribute status, current stored energy, charge / discharge capacity, remaining access time, off-site requirements, V2G permissions, and power boundaries of each online EV, the overall EV charging target and overall V2G discharging target output by the reinforcement learning model are allocated to specific vehicles. Ordinary EVs only receive charging commands, while V2G EVs receive charging or discharging commands only if permissions, energy boundaries, and off-site requirements are met. This technology realizes the conversion of microgrid-level control targets into vehicle-level execution commands, and through two-level safety action correction at the microgrid and vehicle levels, adjusts commands that do not meet energy balance, equipment boundaries, or vehicle operating conditions, ensuring that the control results formed with carbon attribute participation are implemented at the specific vehicle level.

[0174] The following examples are used to illustrate specific implementations of the present invention in different application scenarios, but do not constitute a limitation on the scope of protection of the present invention.

[0175] Multi-energy microgrid application scenarios in industrial parks: This embodiment is applicable to grid-connected multi-energy microgrids equipped with wind power generation, photovoltaic power generation, fuel power generation equipment, fixed energy storage devices, cold and heat energy equipment and electric vehicle charging facilities, such as industrial parks, commercial parks or integrated energy stations.

[0176] The specific implementation process is as follows.

[0177] (1) Vehicle access and initial state establishment After an electric vehicle connects to a charging facility, the EV aggregation management unit obtains the vehicle's unique identifier, rated battery capacity, current state of charge, actual arrival time, estimated departure time, departure power demand, charging and discharging power limits, vehicle type, and V2G permissions.

[0178] The EV aggregation management unit determines the vehicle's initial stored energy based on its current state of charge and the initial carbon properties of the stored energy based on the vehicle's historical charging information. This historical charging information may include historical charging periods, charging locations, charged amounts, and the corresponding grid carbon intensity.

[0179] If complete historical charging information cannot be obtained, the initial carbon attributes can be determined based on the regional power grid carbon intensity corresponding to the vehicle's most recent charging location and charging time. If the above information cannot be obtained, the preset regional average carbon intensity can be used to complete the initial state setting of the vehicle.

[0180] The vehicle's stored energy, carbon credits, and average carbon intensity are all stored in association with the vehicle's unique identifier and are not merged with the status of other vehicles.

[0181] (2) Determination of carbon strength of electric busbar Before the start of each control period, the microgrid energy management system determines the decision reference bus carbon intensity for the current control period based on the public grid carbon intensity, predicted output of wind and photovoltaic power generation, load forecast results, energy storage device status, and energy conversion equipment operating status.

[0182] After the control action is executed, the actual dynamic carbon intensity of the power bus during the current control period is determined based on the actual power supply sources, such as the public power grid, wind power generation, photovoltaic power generation, fuel power generation equipment, stationary energy storage discharge, and V2G discharge.

[0183] The decision reference bus carbon intensity is used to generate control actions and allocate single-vehicle charging and discharging targets, while the actual bus dynamic carbon intensity is used to update the carbon properties of the electricity actually charged by vehicles and stationary energy storage devices during the current control period.

[0184] (3) Single vehicle status update When a vehicle is charging, the vehicle's stored energy is increased based on the actual charging amount measured by the charging facility. The newly stored energy is then incorporated into the actual dynamic carbon intensity of the busbar during the charging period, thereby synchronously updating the vehicle's carbon attribute inventory and average carbon intensity.

[0185] When the vehicle is in a connected state but not charging or discharging, the vehicle's stored energy and carbon properties remain unchanged.

[0186] When a vehicle performs V2G discharge, the carbon properties of the released energy are determined based on the carbon properties of the energy stored before discharge, and the vehicle's stored energy and carbon property balance are reduced simultaneously. The carbon intensity of the V2G discharge energy is determined by the carbon properties of the vehicle's historical stored energy, and not by directly using the dynamic carbon intensity of the electrical bus at the moment of discharge.

[0187] When a vehicle actually leaves the station, its energy and carbon properties are first updated based on the actual charging and discharging results of the last control period, and then its state is removed from the online vehicle set. The energy and carbon properties carried away by the departing vehicle are determined based on its own state, and are not estimated using the average state of online vehicles.

[0188] (4) Dynamic vehicle state representation The EV aggregation management unit constructs the single-vehicle status characteristics based on the stored energy, carbon attribute inventory, average carbon intensity, remaining access time, off-site requirements, charging capacity, discharging capacity, and V2G permissions of each online vehicle.

[0189] Since the number of online vehicles changes constantly as vehicles arrive and depart, an aggregate processing method that is insensitive to the order of vehicle input is adopted to encode and summarize the individual vehicle status features of all online vehicles, forming a dynamic EV status representation with a preset dimension.

[0190] The dynamic EV status characterization preserves the differences in energy status, carbon properties, urgency of departure, and charging / discharging regulation capabilities between vehicles, while maintaining the correspondence between the individual vehicle status and the vehicle's unique identifier.

[0191] (5) Generation of microgrid control actions The dynamic EV state characterization is input into the control model along with wind and solar power output, electrical and thermal loads, energy prices, public grid carbon intensity, power bus dynamic carbon intensity, stationary energy storage status, and the operating status of each energy conversion device.

[0192] The control model generates public grid interaction, energy conversion equipment operation, stationary energy storage charging and discharging, and EV overall charging and discharging targets.

[0193] In a preferred embodiment, a reinforcement learning control model is used to generate continuous control actions. The control model comprehensively considers operating costs, carbon emission levels, renewable energy utilization, and vehicle departure requirements, while satisfying the balance of multiple energy supply and demand and equipment operating constraints.

[0194] (6) Allocation of overall objectives to specific vehicles After receiving the overall charging target for EVs, the EV aggregation management unit selects vehicles that are currently connected, have not reached their energy limit, and are allowed to charge from the currently online vehicles.

[0195] When allocating charging, the system comprehensively considers the vehicle's energy deficit before departure, remaining access time, available charging power, and the relationship between the current carbon intensity of the power bus and the average carbon intensity of the vehicles. Vehicles with closer departure times and larger energy deficits are given priority to meet their basic usage needs. After meeting their departure needs, other vehicles are then prioritized for charging during low-carbon periods.

[0196] When allocating V2G discharges, only vehicles that have obtained V2G authorization and meet the energy boundary, power boundary, and off-site requirements will be selected. Priority will be given to vehicles that can output relatively low-carbon electrical energy, have a large feasible discharge capacity, and whose off-site requirements are not urgent.

[0197] Ordinary electric vehicles only participate in charging power distribution and do not receive V2G discharge commands.

[0198] (7) Safety action correction and execution feedback After the control action is generated, the first step is to perform safety action correction at the microgrid layer, checking the supply and demand balance of electricity, heat, cold and natural gas, the interaction boundary of the public power grid, the output range of energy equipment, the energy boundary of fixed energy storage, and the mutual exclusion conditions of charging and discharging.

[0199] Subsequently, single-vehicle layer safety action corrections were performed, checking the actual access status, vehicle type, V2G permissions, upper and lower limits of stored energy, remaining access time, off-site requirements, and charging and discharging power boundaries of each vehicle.

[0200] Instructions for individual vehicles that do not meet the operating conditions are reduced or canceled, and the remaining power is redistributed to other vehicles that meet the conditions. When all candidate vehicles have reached the executable boundary, the overall EV charging and discharging target is adjusted accordingly.

[0201] The revised control commands are sent to the microgrid energy devices, stationary energy storage controllers, and corresponding charging facilities. After the control period ends, the microgrid status and the status of each vehicle are updated based on the actual execution results fed back by the device controllers and charging facilities, and the control inputs for the next control period are generated.

[0202] Application scenarios for public charging stations: This embodiment is applicable to shopping malls, transportation hubs, public parking lots, or urban public charging and battery swapping stations. In these scenarios, vehicle arrivals and departures are frequent, and vehicle access and departure times are highly uncertain.

[0203] After the vehicle is connected, the station-level EV aggregation management unit obtains the vehicle's current battery level, estimated departure time, target battery level, charging power boundary, and V2G permissions, and establishes an independent energy and carbon attribute status record for the vehicle.

[0204] The online vehicle set is updated at each control session and after a vehicle arrives or departs. The dynamic vehicle set encoding method can handle varying numbers of online vehicles without changing the input dimensions of the control model, thus eliminating the need to rebuild the control model based on changes in the number of vehicles.

[0205] To address the service demands of public charging and battery swapping stations, when allocating charging for a single vehicle, priority is given to ensuring the vehicle's power needs when leaving the station. The charging sequence is then adjusted based on the carbon intensity of the power bus and the vehicle's carbon properties. Vehicles are only permitted to participate in V2G discharge when they have met their off-station requirements, obtained V2G authorization, and possess sufficient discharge capacity.

[0206] When a vehicle enters or leaves a station during a control period, the vehicle status is updated based on the actual charging and discharging amount measured by the charging facility. If segmented metering data cannot be obtained directly, the charging and discharging amount during that period is determined based on the vehicle's actual entry time and actual power output.

[0207] For public charging stations that do not have V2G functionality, V2G permissions for all vehicles can be set to unavailable, and only single-vehicle charging carbon attribute updates, dynamic vehicle set characterization, and low-carbon charging control can be implemented.

[0208] Application scenarios for bus or logistics fleet depots: This embodiment applies to parking and charging stations for buses, logistics vehicles, official vehicles, or other centrally operated vehicles. The routes, return times, and restart times of these vehicles are relatively stable, making them suitable for implementing batch carbon attribute management and planned V2G control.

[0209] After a vehicle returns to the depot, its individual energy and carbon attributes are restored or established based on its unique identifier. The EV aggregation management unit determines the departure requirement based on the vehicle's next departure time, planned mileage, and usage task, and schedules vehicle charging based on the renewable energy output and the carbon intensity of the power bus within the depot.

[0210] In a preferred embodiment, in addition to storing the vehicle's total stored energy, carbon attribute inventory, and average carbon intensity, a charging batch record is also established according to the charging process of the vehicle at different times. Each charging batch includes the charging period, actual energy charged, batch carbon intensity, and batch remaining energy.

[0211] When a vehicle performs V2G discharge, the carbon attributes migrated out during this discharge are determined according to a preset batch deduction rule. The batch deduction rule can adopt a first-charge-first-deduction, last-charge-first-deduction, low-carbon batch priority deduction, or other preset rules, but it should remain consistent within the same carbon accounting cycle.

[0212] The charging batch is only used to record and calculate the historical carbon properties of the vehicle's stored electrical energy, and does not indicate that the electrical energy inside the battery is physically stored in layers.

[0213] When a fleet depot lacks the capability to record charging batches, the vehicle's carbon attributes can be updated based on the average carbon intensity before discharge. This method is relatively simple to implement, but it cannot preserve the differences in carbon attributes between different historical charging periods within the vehicle.

[0214] Simulation implementation scenario: This embodiment can also be implemented in a multi-energy microgrid simulation platform. The simulation system includes a public power grid, wind power generation, photovoltaic power generation, fuel power generation equipment, stationary energy storage, cooling and heating energy equipment, electrical and heating loads, and an EV aggregation management unit.

[0215] The wind and solar power output, load, energy prices, and public grid carbon intensity required for the simulation can be obtained from historical or predicted data. Vehicle arrival time, departure time, initial state of charge, departure demand, vehicle type, and V2G license status can be obtained from real charging records or generated based on historical statistical distributions.

[0216] Within each simulation control period, the following steps are executed sequentially: vehicle set update, determination of carbon intensity of decision reference electric bus, generation of dynamic EV state characterization, generation of control actions, allocation of overall target to individual vehicles, correction of safety actions, calculation of actual electric bus dynamic carbon intensity, update of individual vehicle energy and carbon properties, and generation of state for the next control period.

[0217] The simulation process examines the vehicle's energy storage boundary, off-site requirements, V2G permissions, charging and discharging mutual exclusion conditions, microgrid multi-energy balance, and the consistency of single-vehicle energy and carbon properties, thereby verifying the complete implementation process of the control method of this invention.

[0218] As alternative implementation methods, the encoding of the dynamic vehicle ensemble can employ parameter-shared encoders and attention aggregation, or it can utilize summation pooling, mean pooling, max pooling, ensemble neural networks, graph neural networks, fixed-length truncation and masking, or state partitioning statistics. Reinforcement learning control models are the preferred control method. Without altering the representation of individual vehicle carbon attribute migration states, dynamic vehicle ensemble processing, and individual vehicle command allocation methods, model predictive control, rolling optimization, or other control models can also be used to generate microgrid control objectives. When using other control methods, the individual vehicle carbon attribute migration states are still used as control inputs or optimization parameters. When allocating the overall EV control objective to specific vehicles, priority ranking can be used, or linear programming, quadratic programming, mixed integer programming, heuristic search, or vehicle-by-vehicle allocation can be employed. Safety action correction can be performed at the microgrid layer and the individual vehicle layer respectively, or energy device constraints and vehicle constraints can be constructed into a unified set of actionable actions, uniformly completed through action projection or constraint optimization. The EV aggregation management unit can be centrally deployed on the microgrid energy management server or distributed across edge controllers at various charging stations. When communication is interrupted, operation can be maintained using the most recent valid vehicle status and local safety control rules, and the vehicle's energy and carbon attributes can be updated based on the charging facility's metering data after communication is restored.

[0219] The above description is only a preferred embodiment of the present invention. It should be noted that for those skilled in the art, several improvements and modifications can be made without departing from the technical principles of the present invention, and these improvements and modifications should also be considered within the scope of protection of the present invention.

Claims

1. A microgrid intelligent control method based on the carbon attribute migration state characterization of electric vehicles, characterized in that, include: At the beginning of each control period, microgrid operation data and vehicle status records of each online EV after the end of the previous control period are collected. The vehicle status records include at least stored energy, carbon attribute inventory, and average carbon intensity. The vehicle status records are continuously updated based on the pre-acquired initial EV arrival status. For each online EV, the vehicle status features are constructed based on the vehicle status record after the end of the previous control period, which represents the energy and carbon attribute status; the vehicle's remaining access time and current departure energy gap, which represent the urgency of departure; the vehicle's current maximum charge and discharge power, which represents the adjustable capability; and the vehicle's V2G permission status. A single vehicle state set is jointly constructed based on the single vehicle state characteristics of each online EV; features are extracted and aggregated from the single vehicle state set to form a dynamic EV state representation; The reinforcement learning input state for the current control period is constructed based on the microgrid operation data, dynamic EV state characterization, pre-acquired decision reference bus carbon intensity, and actual bus dynamic carbon intensity from the previous control period. The reinforcement learning input state of the current control period is input into the reinforcement learning control model to generate microgrid equipment control actions and EV overall charging and discharging targets. The EV overall charging and discharging targets are allocated to each online EV that is allowed to charge and discharge and individual vehicle charging and discharging instructions are generated. After the microgrid equipment control actions and single vehicle charging and discharging commands are generated, the microgrid layer safety action correction and single vehicle layer safety action correction are performed in sequence, and the corrected control commands are sent to the microgrid equipment and charging facilities. The microgrid operation data is determined based on the actual execution results, the individual vehicle status records of each vehicle are updated synchronously, and the updated status is used as the input for the next control period.

2. The intelligent control method for microgrids based on the carbon attribute migration state characterization of electric vehicles according to claim 1, characterized in that, The online EVs are managed in the form of an online vehicle set, which is updated in real time according to the vehicle's arrival and departure status. When a vehicle arrives at the station, the vehicle type, rated battery capacity, actual arrival time, estimated departure time, departure energy requirement, maximum charging power, maximum discharging power, upper limit of allowed energy, lower limit of allowed energy, and V2G permissions are recorded simultaneously.

3. The intelligent control method for microgrids based on the carbon attribute migration state characterization of electric vehicles according to claim 1, characterized in that, The single vehicle status record is associated with the vehicle's unique identifier; The single-vehicle status record is continuously updated based on the initial state of the EV upon arrival, including: No. i The stored energy of an EV is updated according to the following formula: ; In the formula, and The first i EVs during control period t Start and control period t Energy storage after the end For charging efficiency, For discharge efficiency, To control the length of the time period; the first i The actual charging power and actual V2G discharging power of the EV during the control period t are respectively and ; No. i The carbon footprint of an EV is updated according to the following formula: ; In the formula, and The first i EVs during control period t Start and control period t Carbon inventory remaining after the event The average carbon strength of the vehicle before discharge; Average carbon intensity after updating energy storage and carbon property stock Represented as: 。 4. The intelligent control method for microgrids based on the carbon property migration state characterization of electric vehicles according to claim 1, characterized in that, Also includes: Establish a charging batch carbon attribute record associated with the vehicle's unique identifier based on the charging process at different times of the vehicle. The vehicle's stored energy is calculated by accumulating the remaining energy of all charging batches retained by the vehicle during the control period; The carbon inventory of a vehicle is calculated by multiplying the batch carbon intensity and the batch remaining energy of all charging batches retained by the vehicle during the control period. When a vehicle performs V2G discharge, the remaining energy and carbon attribute inventory of the corresponding batch are reduced according to the pre-set batch deduction rules that remain consistent within the same carbon accounting cycle. If the remaining energy of a batch is insufficient to meet the energy reduction of the battery side corresponding to this discharge, the next batch will continue to be deducted until the actual discharge amount is reached. The batch deduction rules include first-charge-first-deduction, last-charge-first-deduction, or other pre-set carbon accounting rules.

5. The intelligent control method for microgrids based on the carbon property migration state characterization of electric vehicles according to claim 1, characterized in that, No. i EVs during control period t The bicycle status record is represented as follows: ; In the formula, This records the single-vehicle status of the i-th EV during the control period t. Indicates energy storage, Indicates the carbon stock; Indicates average carbon intensity; when When the value is greater than zero, the average carbon intensity is determined based on the ratio of carbon property stock to stored energy. When the value is zero, its average carbon intensity is set to a preset state value, and the vehicle is prohibited from executing discharge commands. The single-vehicle state characteristics are represented as follows: ; In the formula, For the first i EVs during control period t The characteristics of the single vehicle status, This represents the remaining access time for the vehicle until its estimated departure time. This refers to the amount of stored energy required for a vehicle to leave the station. This represents the current energy deficit for the vehicle before it leaves the station. This represents the maximum charging power that the vehicle can currently perform. This represents the current maximum V2G discharge power that the vehicle can perform. This indicates the vehicle's V2G permission status.

6. The intelligent control method for microgrids based on the carbon attribute migration state characterization of electric vehicles according to claim 1, characterized in that, The dynamic EV state is represented as follows: ; In the formula, For dynamic EV state representation function, To represent the dynamic EV state corresponding to control time period t, This represents the set of vehicle states.

7. The intelligent control method for microgrids based on the carbon property migration state characterization of electric vehicles according to claim 1, characterized in that, Feature extraction and aggregation of individual vehicle state sets are performed to form a dynamic EV state representation, including: A single-vehicle encoder with shared parameters is used to perform feature encoding on each online EV in the dynamic single-vehicle state set to obtain the corresponding single-vehicle encoding features; Based on the vehicle coding features, a vehicle attention score is generated according to the vehicle's average carbon intensity, off-site energy gap, remaining access time, and available charging and discharging power. Based on the attention scores of each online EV, normalized attention weights are determined; the weighted coding results are obtained by weighting and summing the coding features of each vehicle according to the vehicle attention weights. A set of statistical features is constructed based on the number of online EVs, the number of online EVs with V2G permissions, the sum of the stored energy of each online EV, the sum of the carbon attribute inventory of each online EV, the sum of the current off-site energy gap of each online EV, the sum of the current maximum charging power of each online EV, and the sum of the current maximum V2G discharge power of each online EV. After performing feature concatenation operations on the weighted encoding results and set statistical features, the results are input into a feature fusion function to obtain a dynamic EV state representation.

8. The intelligent control method for microgrids based on the carbon attribute migration state characterization of electric vehicles according to claim 1, characterized in that, The reinforcement learning control model constructs a reward function based on the microgrid's operating costs, carbon emission levels, and the satisfaction of operating constraints, and uses the reward signal to optimize the control strategy. In the actual control phase, the trained control strategy is invoked to generate the original control actions for each control period.

9. The intelligent control method for microgrids based on the carbon property migration state characterization of electric vehicles according to claim 1, characterized in that, The overall charging and discharging target of EVs is allocated to each online EV that is allowed to charge and discharge, and individual vehicle charging and discharging instructions are generated, including: When allocating charging targets, vehicles that are in the access state, have not reached their energy storage limit, and are allowed to charge are selected from the online vehicle set. The charging priority determination method includes: The closer a vehicle is to its expected departure time and the greater its energy deficit before departure, the higher its charging priority. The carbon intensity of the new energy storage battery is added based on the ratio of the carbon intensity of the power bus to the vehicle charging efficiency during the current control period. The greater the difference between the average carbon intensity and the carbon intensity of the new energy storage battery, the higher the charging priority. The higher the current maximum charging power of a vehicle, the higher its charging priority. When allocating discharge targets, vehicles that are in the access state and allowed to discharge are selected from the online vehicle set. The discharge priority determination method includes: The greater the difference between the dynamic carbon intensity of the power bus and the carbon intensity of the discharge energy actually input to the power bus by the vehicle during the control period, the higher the discharge priority. The higher the current maximum V2G discharge power that a vehicle can perform, the higher its discharge priority. The higher the ratio of the vehicle's current energy deficit before departure to the remaining access time before the vehicle's expected departure time, the lower the discharge priority.

10. A microgrid intelligent control system based on the carbon attribute migration state characterization of electric vehicles, characterized in that, include: The data acquisition module is used to collect microgrid operation data and individual vehicle status records of each online EV at the beginning of each control period and after the end of the previous control period. The individual vehicle status records include at least stored energy, carbon attribute inventory, and average carbon intensity. The individual vehicle status records are continuously updated based on the pre-acquired initial EV arrival status. The vehicle status feature construction module is used to construct vehicle status features for each online EV based on the vehicle status record after the end of the previous control period, which represents the energy and carbon attribute status; the vehicle's remaining access time and current departure energy gap, which represents the urgency of departure; the vehicle's current maximum charge and discharge power, which represents the adjustable capability; and the vehicle's V2G permission status. The extraction module is used to jointly construct a set of vehicle states based on the individual vehicle state characteristics of each online EV; and to extract features from and aggregate the set of vehicle states to form a dynamic EV state representation. The reinforcement learning input state construction module is used to construct the reinforcement learning input state for the current control period based on the microgrid operation data, dynamic EV state characterization, pre-acquired decision reference bus carbon intensity, and actual bus dynamic carbon intensity of the previous control period. The generation module is used to input the reinforcement learning input state of the current control period into the reinforcement learning control model to generate microgrid equipment control actions and EV overall charging and discharging targets, allocate the EV overall charging and discharging targets to each online EV that is allowed to charge and discharge, and generate individual vehicle charging and discharging instructions. The correction and distribution module is used to correct the safety actions of the microgrid layer and the safety actions of the single vehicle layer after the microgrid equipment control actions and single vehicle charging and discharging commands are generated, and then distribute the corrected control commands to the microgrid equipment and charging facilities. The microgrid operation data is determined based on the actual execution results, the individual vehicle status records of each vehicle are updated synchronously, and the updated status is used as the input for the next control period.

Citation Information

Patent Citations

  • V2G system based on direct-current micro-grid

    CN105186549A

  • Distributed energy system autonomous control method and system based on deep reinforcement learning

    CN112186799A