Control system and method for v2g charging pile

CN122788560APending Publication Date: 2026-09-22YONG LIAN KE JI (CHANG SHU) YOU XIAN GONG SI
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202611313775.3
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2026-08-27
Publication Date
2026-09-22

Smart Images

  • Figure CN122788560A_ABST
    Figure CN122788560A_ABST
Patent Text Reader

Abstract

The application discloses a control system and method of a V2G charging pile, comprising a power grid on-off state detection module, which is used for acquiring power grid on-off information of the V2G charging pile; an electric energy quality detection module, which is used for acquiring electric energy quality information of the power grid; a main controller, which is used for identifying a power supply state of the control system according to the power grid on-off information and the electric energy quality information; when it is identified that the power supply state is a protocol pre-switching state, an emergency power supply module is enabled; when it is identified that the power supply state is a power-off state and a vehicle connected to the V2G charging pile is in communication connection with the main controller, a charging loop between the power grid and the V2G charging pile is disconnected, a discharge instruction is sent to a guide resistance switching module to make the guide resistance switch to a discharge state, and the vehicle is powered to the power grid. The application realizes accurate judgment of the power supply state of the control system, and in the case that the external power grid is powered off, an external power supply is not needed to be introduced, the power supply loop is directly switched, and the vehicle is powered to the power grid.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of electric vehicle charging infrastructure technology, and in particular to a control system and method for a V2G charging pile. Background Technology

[0002] V2G (Vehicle-to-Grid) charging stations enable bidirectional energy exchange between electric vehicles and the power grid. Charging during off-peak hours and discharging during peak hours achieves peak shaving and valley filling, while also providing benefits to vehicle owners. V2G can be integrated into microgrids, using vehicle batteries as energy storage units, eliminating the need for additional large-capacity energy storage batteries and significantly reducing the installation cost of integrated photovoltaic-storage-charging microgrids. The system can use daytime photovoltaic power generation to supply power to the grid or charge vehicles; during peak nighttime hours, vehicle batteries are prioritized for powering homes, with charging resumed during off-peak hours. When the microgrid experiences voltage drops or power outages, vehicle batteries can maintain power supply stability, ensuring the operation of the regional base load.

[0003] However, according to the GB / T 18487.1-2023 standard, V2G vehicles require the charging pile to switch the guiding resistor and communicate with the vehicle during charging and discharging. When the microgrid suddenly loses power, the charging pile is also in a power-off state and cannot automatically switch the guiding resistor or complete communication. Discharging must be manually controlled at the vehicle end, which seriously affects the convenience of use in power outage scenarios. Summary of the Invention

[0004] This application provides a control system and method for a V2G charging pile, which can accurately determine the power supply status of the control system. In the event of an external power grid failure, the power supply circuit can be switched directly without introducing an external power source, enabling the vehicle to supply power to the grid.

[0005] On the one hand, this application provides a control system for a V2G charging pile, including: A power grid on / off status detection module is provided, the output of which is connected to the first input of the main controller. This module is used to acquire power grid on / off information for the V2G charging pile. The power grid on / off information includes the voltage monitoring signal of the power grid. The voltage monitoring signal is determined by comparing the stepped-down DC voltage (output from the power grid by reducing and rectifying it) with a preset voltage threshold. A power quality detection module, the output of which is connected to the second input of the main controller, is used to acquire power quality information of the power grid; A guide resistor switching module, wherein the input terminal of the guide resistor switching module is connected to the output terminal of the main controller; An emergency power supply module, the output of which is connected to the third input of the main controller, is used to supply power to the main controller and the guide resistor switching module when the control system is in a power failure state; The main controller is used to, during the power supply process from the power grid, when it identifies that the voltage monitoring signal is high, the power grid on / off information indicates a power grid anomaly, and the power supply status of the control system is in a protocol pre-switching state, activate the emergency power supply module to enable the main controller to obtain backup power; and continuously acquire the power grid on / off information and the power quality information; when it identifies that both the power grid on / off information and the power quality information indicate a power grid failure, the power supply status is a power outage state, and the vehicle connected to the V2G charging pile is in communication connection with the main controller, control the charging circuit between the power grid and the V2G charging pile to disconnect, and send a discharge command to the guide resistor switching module to switch the guide resistor to a discharge state to enable the vehicle to supply power to the power grid; and when it identifies that the power supply status is a discharge establishment state, control the emergency power supply module to exit power supply.

[0006] In one exemplary embodiment, the power grid on / off information includes at least the zero-crossing cycle of the power grid and the voltage monitoring signal of the power grid; The power grid on / off status detection module includes: A step-down rectifier unit, wherein the input terminal of the step-down rectifier unit is connected to the output terminal of the power grid, and the step-down rectifier unit is used to step down and rectify the AC voltage output by the power grid to output the stepped-down DC voltage; A zero-crossing detection unit is provided, the input of which is connected to the first output of the buck rectifier unit; the zero-crossing detection unit is used to identify the zero-crossing cycle of the power grid based on the bucked DC voltage. A voltage detection unit is provided, the input of which is connected to the second output of the step-down rectifier unit. The voltage detection unit is used to compare the stepped-down DC voltage with the preset voltage threshold to obtain and output the voltage monitoring signal.

[0007] In one exemplary embodiment, the buck rectifier unit includes: A transformer; the input terminal of the transformer is connected to the output terminal of the power grid; the transformer is used to reduce the AC voltage output by the power grid to obtain a stepped-down AC voltage; A full-bridge rectifier circuit; the input terminal of the full-bridge rectifier circuit is connected to the output terminal of the transformer; the first output terminal of the full-bridge rectifier circuit is connected to the input terminal of the zero-crossing detection unit; the second output terminal of the full-bridge rectifier circuit is connected to the input terminal of the voltage detection unit; the full-bridge rectifier circuit is used to rectify the stepped-down AC voltage into the stepped-down DC voltage.

[0008] In one exemplary embodiment, the voltage detection unit includes: A voltage threshold adjustment circuit is provided, the output of which is connected to the second output of the step-down rectifier unit; the voltage threshold adjustment circuit is used to divide the stepped-down DC voltage to obtain the divided voltage. A voltage monitoring circuit is provided, the input of which is connected to the output of the voltage threshold adjustment circuit. The voltage monitoring circuit is used to adjust the output level of the voltage monitoring signal based on the comparison result between the voltage after voltage division and the preset voltage threshold.

[0009] In one exemplary embodiment, the voltage monitoring circuit includes: A voltage monitoring chip, the input terminal of which is connected to the output terminal of the voltage threshold adjustment circuit; the voltage monitoring chip is used to adjust the output level of the reset pin according to the voltage value comparison result; An optocoupler is provided, the input of which is connected to the output of the voltage monitoring chip; the optocoupler is used to adjust the output level of the voltage monitoring signal according to the output level of the reset pin.

[0010] In one exemplary embodiment, the power quality detection module includes: A voltage divider sampling network is used to divide the AC voltage output by the power grid to obtain a voltage divider voltage. The input terminal of the voltage divider sampling network is connected to the live wire of the power grid. Shunt; the input terminal of the shunt is connected to the neutral wire of the power grid; the shunt is used to generate a differential voltage based on the current output by the power grid; An energy metering chip; the energy metering chip is connected to the shunt and the voltage divider sampling network respectively; the energy metering chip is used to determine the energy quality information based on the voltage divider voltage and the differential voltage.

[0011] In one exemplary embodiment, the emergency power supply module includes: A supercapacitor, wherein the input terminal of the supercapacitor is connected to the output terminal of the supercapacitor boost circuit; The supercapacitor boost circuit has its input terminal connected to the output terminal of the optocoupler; the supercapacitor boost circuit is used to control the supercapacitor to switch between a startup state and a standby state according to the voltage monitoring signal.

[0012] In one exemplary embodiment, the control system further includes a vehicle communication module; The first input terminal of the vehicle communication module is connected to the output terminal of the main controller; the second input terminal of the vehicle communication module is connected to the output terminal of the vehicle; the vehicle communication module is used to control the communication connection between the main controller and the vehicle when the guiding resistor switches to the discharge state.

[0013] In one exemplary embodiment, the control system further includes a contactor drive module, a charging contactor, and a discharging contactor; The input terminal of the contactor drive module is connected to the output terminal of the main controller; the first output terminal of the contactor drive module is connected to one side of the charging contactor; the other side of the charging contactor is connected to the power grid; the second output terminal of the contactor drive module is connected to one side of the discharging contactor; the other side of the discharging contactor is connected to the vehicle; the contactor drive module is used to control the charging contactor to open when the power supply state is a power-off state; and to control the discharging contactor to close when the power supply state is a discharge establishment state.

[0014] On the other hand, a control method for a V2G charging pile is provided, applied to the control system of the V2G charging pile as described above, the method comprising: The system acquires grid connection / disconnection information of the V2G charging pile detected by the grid connection / disconnection status detection module, and power quality information of the grid detected by the power quality detection module; the grid connection / disconnection information refers to the connection / disconnection information of the grid connected to the V2G charging pile. The power supply status of the control system is determined based on the power grid on / off information and the power quality information. When the power supply is in a power failure state, the emergency power supply module is activated to supply power to the V2G charging pile. The charging circuit between the power grid and the V2G charging pile is disconnected, and a discharge command is sent to the guide resistor switching module to switch the guide resistor to the discharge state; Obtain the communication status between the V2G charging pile and the vehicle connected to the V2G charging pile; If the communication status indicates that the V2G charging pile is in communication connection with the vehicle, the charging circuit between the vehicle and the V2G charging pile is closed to enable the vehicle to supply power to the power grid.

[0015] On the other hand, an electronic device is provided, the device including a processor and a memory, the memory storing at least one instruction or at least one program, the at least one instruction or the at least one program being loaded by the processor and executed as described above for the control method of the V2G charging pile.

[0016] On the other hand, a computer-readable storage medium is provided, wherein at least one instruction or at least one program is stored therein, the at least one instruction or at least one program being loaded and executed by a processor to implement the control method for the V2G charging pile as described above.

[0017] On the other hand, a computer program product or computer program is provided, which includes computer instructions stored in a computer-readable storage medium. A processor of a computer device reads the computer instructions from the computer-readable storage medium and executes the computer instructions, causing the computer device to perform the control method for the V2G charging pile as described above.

[0018] This application provides a control system and method for a V2G charging pile, which has the following technical effects: The application includes a power grid on / off status detection module, the output of which is connected to the first input of a main controller, for acquiring power grid on / off information of the V2G charging pile; the power grid on / off information is the on / off information of the power grid connected to the V2G charging pile; the power grid on / off information includes a voltage monitoring signal of the power grid; the voltage monitoring signal is determined by comparing the stepped-down DC voltage (after reducing and rectifying the AC voltage output from the power grid) with a preset voltage threshold; a power quality detection module, the output of which is connected to the second input of the main controller, for acquiring power quality information of the power grid; a guide resistor switching module, the input of which is connected to the output of the main controller; and an emergency power supply module, the output of which is connected to the third input of the main controller, for... In the event that the control system is in a power-off state, the main controller and the guide resistor switching module are supplied with power. The main controller, during the power supply process from the grid, when it detects that the voltage monitoring signal is high, the grid connection / disconnection information indicates a grid anomaly, and the power supply status of the control system is in a protocol pre-switching state, activates the emergency power supply module to provide backup power to the main controller. It also continuously acquires the grid connection / disconnection information and the power quality information. When it detects that both the grid connection / disconnection information and the power quality information indicate a grid failure, the power supply status is a power-off state, and the vehicle connected to the V2G charging pile is in communication connection with the main controller, it controls the charging circuit between the grid and the V2G charging pile to disconnect, sends a discharge command to the guide resistor switching module to switch the guide resistor to a discharge state, enabling the vehicle to supply power to the grid. When it detects that the power supply status is in a discharge establishment state, it controls the emergency power supply module to exit power supply. A grid on / off status detection module and a power quality detection module are designed into the control system of the V2G charging pile. This allows the main controller to analyze the power supply status of the V2G charging pile control system by combining grid on / off information and power quality information. When the power supply status is in the protocol pre-switching state, the emergency power supply module is activated. When the power supply status is in the power failure state, the charging circuit between the grid and the V2G charging pile is disconnected, and the guide resistor switching module is used to switch the guide resistor to the discharge state, thereby enabling the vehicle to supply power to the grid. When the power supply status is in the discharge establishment state, the emergency power supply module is controlled to exit the power supply. This achieves accurate judgment of the power supply status of the control system. In the event of an external grid power failure, there is no need to introduce an external power source; the power supply circuit is directly switched to enable the vehicle to supply power to the grid, improving the convenience of using the V2G charging pile when the grid is down. Attached Figure Description

[0019] To more clearly illustrate the technical solutions and advantages in the embodiments or prior art of this specification, the drawings used in the description of the embodiments or prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of this application. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.

[0020] Figure 1 This is a schematic diagram of the control system of a V2G charging pile provided in the embodiments of this specification; Figure 2 This is a schematic diagram of the structure of a power grid on / off status detection module provided in the embodiments of this specification; Figure 3 This is a schematic diagram of the specific structure of a power grid on / off status detection module and a supercapacitor boost circuit provided in the embodiments of this specification; Figure 4 This is a schematic diagram of the structure of a power quality detection module provided in the embodiments of this specification; Figure 5 This is a flowchart illustrating a control method for a V2G charging pile provided in the embodiments of this specification; Figure 6 This is a flowchart illustrating a dual-path detection and state switching process provided in the embodiments of this specification; Figure 7 This is a timing diagram illustrating a power switching and restoration process provided in an embodiment of this specification; Figure 8 This is a schematic diagram of the control device for the V2G charging pile provided in the embodiments of this specification; Figure 9 This is a schematic diagram of the server structure for a V2G charging pile control method provided in the embodiments of this specification. Detailed Implementation

[0021] The technical solutions in the embodiments of this specification will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of this application, and not all embodiments. Based on the embodiments of this application, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of this application.

[0022] It should be noted that the terms "first," "second," etc., in the specification, claims, and accompanying drawings of this application are used to distinguish similar objects and are not necessarily used to describe a specific order or sequence. It should be understood that such data can be interchanged where appropriate so that the embodiments of this application described herein can be implemented in orders other than those illustrated or described herein. Furthermore, the terms "comprising" and "having," and any variations thereof, are intended to cover non-exclusive inclusion; for example, a process, method, system, product, or server that comprises a series of steps or units is not necessarily limited to those steps or units explicitly listed, but may include other steps or units not explicitly listed or inherent to such processes, methods, products, or devices.

[0023] According to the GB / T 18487.1-2023 standard, when V2G (Vehicle-to-Grid) vehicles switch between charging and discharging, the charging pile needs to switch the guiding resistor and communicate with the vehicle to achieve the switching. If the microgrid suddenly loses power, the V2G charging pile will also be in a power-off state and will not be able to switch the guiding resistor to achieve automatic switching and communication between charging and discharging. The vehicle needs to manually control the discharge to the V2G charging pile, which greatly affects the convenience of using V2G charging piles when the network is down.

[0024] Therefore, this application restructures the system architecture and control strategy for V2G charging piles, specifically, as follows: Figure 1-4 As shown, the present invention provides a control system for a V2G charging pile, comprising: A power grid on / off status detection module is provided, the output of which is connected to the first input of the main controller. This module is used to acquire power grid on / off information for the V2G charging pile. The power grid on / off information includes the voltage monitoring signal of the power grid. The voltage monitoring signal is determined by comparing the stepped-down DC voltage (output from the power grid by reducing and rectifying it) with a preset voltage threshold. A power quality detection module, the output of which is connected to the second input of the main controller, is used to acquire power quality information of the power grid; A guide resistor switching module, wherein the input terminal of the guide resistor switching module is connected to the output terminal of the main controller; An emergency power supply module, the output of which is connected to the third input of the main controller, is used to supply power to the main controller and the guide resistor switching module when the control system is in a power failure state; The main controller is used to, during the power supply process from the power grid, when it identifies that the voltage monitoring signal is high, the power grid on / off information indicates a power grid anomaly, and the power supply status of the control system is in a protocol pre-switching state, activate the emergency power supply module to enable the main controller to obtain backup power; and continuously acquire the power grid on / off information and the power quality information; when it identifies that both the power grid on / off information and the power quality information indicate a power grid failure, the power supply status is a power outage state, and the vehicle connected to the V2G charging pile is in communication connection with the main controller, control the charging circuit between the power grid and the V2G charging pile to disconnect, and send a discharge command to the guide resistor switching module to switch the guide resistor to a discharge state to enable the vehicle to supply power to the power grid; and when it identifies that the power supply status is a discharge establishment state, control the emergency power supply module to exit power supply.

[0025] In some embodiments, a power grid on / off status detection module and a power quality detection module are designed in the control system of the V2G charging pile to form a dual-path power grid anomaly identification structure. The output of the power grid on / off status detection module is connected to the first input of the main controller to acquire the power grid on / off information of the V2G charging pile, i.e., the on / off information of the power grid connected to the V2G charging pile, so as to quickly determine whether the AC power input from the external power grid exists, whether the zero-crossing signal is continuous, and whether the AC cycle is interrupted. The power grid on / off information includes the voltage monitoring signal of the power grid. The power grid on / off status detection module reduces the 220V high-voltage AC voltage output from the power grid by a preset ratio and rectifies it into a stepped-down DC voltage for subsequent circuit detection. It compares the stepped-down DC voltage with a preset voltage threshold to obtain and output the voltage monitoring signal. In actual use, when the external AC voltage continues to decrease, the output level of the voltage monitoring signal is high. The output of the power quality detection module is connected to the second input of the main controller to obtain the power quality information of the power grid connected to the V2G charging pile, thereby determining whether the voltage amplitude, frequency, zero-crossing cycle and voltage change trend of the power grid output exceed the allowable range. The two detection results from the power grid on / off status detection module and the power quality detection module are not directly equivalent to the final conclusion of the power supply status of the V2G charging pile control system. Instead, they serve as input conditions for judging the power supply status of the control system. Based on the triggering sequence, consistency, duration, and anomaly type of the two detection results, the power supply status of the control system is judged. The control system is then divided into normal charging state, disturbance observation state, protocol pre-switching state, power outage state, and discharge establishment state. The input terminal of the guide resistor switching module is connected to the output terminal of the main controller to receive control commands output by the main controller, thereby adjusting the state (charging / discharging) of the guide resistor. The output of the emergency power supply module is connected to the third input of the main controller. It is used to start when there is an abnormality in the power grid, that is, when the control system is in the protocol pre-switching state. When the control system is in the power failure state, it only supplies power to the main controller, the pilot resistor switching module, the vehicle communication module in the control system and the contactor drive module, and does not supply power to the rest. The main controller is used to identify the power supply status of the control system (normal charging state / disturbance observation state / protocol pre-switching state / power failure state / discharge establishment state) based on grid on / off information and power quality information. Specifically, during grid power supply, when the main controller detects a high-level voltage monitoring signal, grid on / off information indicating a grid anomaly, and the control system's power supply status is in protocol pre-switching state, the emergency power supply module is activated to provide backup power to the main controller. It also continuously acquires grid on / off information and power quality information. When both grid on / off information and power quality information indicate grid failure, specifically, grid on / off information indicates grid failure / disconnection, and power quality information indicates a grid anomaly, the main controller continuously acquires grid on / off information and power quality information. If the power outage duration exceeds the preset threshold (the upper limit of the grid power outage duration), the power supply status of the control system is in a power outage state. The charging circuit between the grid and the V2G charging pile is disconnected, and a discharge command is sent to the guide resistor switching module to switch the guide resistor from the charging state to the discharging state. When the vehicle connected to the V2G charging pile communicates with the main controller, the charging circuit between the vehicle and the V2G charging pile is closed to allow the vehicle to supply power to the grid. After the vehicle discharge is established, the power supply status of the control system is identified as the discharge establishment state. At this time, a control power feedback path is formed through the vehicle output side to continue supplying power to the main control module. At this time, the emergency power supply module is either disconnected from power supply or enters the replenishment state. The guiding resistors, in accordance with the national standard GB / T 18487, are distributed in V2G charging piles and vehicle plugs (charging gun heads). Figure 1 The V2G charging station has four locations: the V2G interface / charging gun, the vehicle socket, and inside the vehicle. Furthermore, one V2G charging station can have multiple charging guns, allowing it to charge multiple vehicles. Figure 1 There are two vehicles in the diagram; we will use one of them as an example here.

[0026] In the embodiments of this specification, the power grid on / off information includes at least the zero-crossing cycle of the power grid and the voltage monitoring signal of the power grid; The power grid on / off status detection module includes: A step-down rectifier unit, wherein the input terminal of the step-down rectifier unit is connected to the output terminal of the power grid, and the step-down rectifier unit is used to step down and rectify the AC voltage output by the power grid to output the stepped-down DC voltage; A zero-crossing detection unit is provided, the input of which is connected to the first output of the buck rectifier unit; the zero-crossing detection unit is used to identify the zero-crossing cycle of the power grid based on the bucked DC voltage. A voltage detection unit is provided, the input of which is connected to the second output of the step-down rectifier unit. The voltage detection unit is used to compare the stepped-down DC voltage with the preset voltage threshold to obtain and output the voltage monitoring signal.

[0027] In some embodiments, the grid on / off information includes at least the zero-crossing cycle of the grid output voltage and the grid voltage monitoring signal; Based on this, such as Figure 2 As shown, Figure 2 This is a schematic diagram of the structure of a power grid on / off status detection module provided in the embodiments of this specification. The power grid on / off status detection module includes: The step-down rectifier unit has its input terminal connected to the output terminal of the power grid (including the live wire (L line), neutral wire (N line), and ground wire (PE) of the power grid). The step-down rectifier unit is used to reduce the 220V high-voltage AC voltage output from the power grid by a preset ratio and then rectify it into a stepped-down DC voltage for subsequent circuit detection. Since the AC power output from the power grid crosses zero twice per cycle, namely from positive to negative and from negative to positive, in order to extract the zero-crossing moments and convert them into digital level signals that the main controller can recognize, a zero-crossing detection unit is set up to generate a level jump at the output of the zero-crossing detection unit at the zero-crossing moment, thereby generating a square wave with a frequency twice that of the AC voltage output from the power grid. The input terminal of the zero-crossing detection unit is connected to the first output terminal of the buck rectifier unit; specifically, as shown below... Figure 3 As shown, Figure 3 This is a schematic diagram of the specific structure of a power grid on / off state detection module and a supercapacitor boost circuit provided in the embodiments of this specification; the zero-crossing detection unit includes a current-limiting resistor R12, an optocoupler U5, and a pull-up resistor R23; the optocoupler U5 includes a light-emitting diode and a phototransistor; the input terminal of the current-limiting resistor R12 is connected to the first output terminal of the buck rectifier unit, the output terminal of the current-limiting resistor R12 is connected to the input terminal of the optocoupler U5 (the anode of the light-emitting diode), and the cathode of the light-emitting diode is connected to the full-bridge rectifier circuit in the buck rectifier unit; the output terminal of the optocoupler U5 is connected to one side of the pull-up resistor R23, the other side of the pull-up resistor R23 is connected to a voltage (which can be 3.3V / 5V), and the node on the side where the output terminal of the optocoupler is connected to the pull-up resistor R23 is used as the output terminal VP of the zero-crossing detection unit, and this node is connected to the input terminal of the main controller; The stepped-down DC voltage output from the buck rectifier unit is current-limited by the current-limiting resistor R12 and then drives the LED of optocoupler U5 (if the current is not limited, a huge current may be generated in the LED of optocoupler U5, which may burn out the LED). This causes the phototransistor to be turned on / off by the light of the LED, thereby outputting signals of different levels to obtain pulse signals. The zero-crossing period of the grid output voltage is calculated based on the pulse signals. More specifically, the frequency value, zero-crossing period, and zero-crossing loss judgment result of the grid output AC voltage can be calculated based on the pulse signals. The zero-crossing loss judgment result indicates whether zero-crossing loss has occurred. By setting a current-limiting resistor to limit the current on the input side of the optocoupler, it is possible to prevent the DC voltage after step-down from being too high, which could cause the LED to burn out due to overcurrent when input to the optocoupler. A pull-up resistor is set so that when the phototransistor in the optocoupler is cut off, its output terminal is pulled up to a high level by the pull-up resistor; when the phototransistor in the optocoupler is turned on, its output terminal is pulled up to a level close to GND. The input terminal of the voltage detection unit is connected to the second output terminal of the step-down rectifier unit. The voltage detection unit is used to compare the stepped-down DC voltage with a preset voltage threshold to obtain and output a voltage monitoring signal. The step-down rectifier unit realizes the electrical isolation between the high-voltage AC voltage output from the power grid and the low-voltage control circuit, eliminating the risk of electric shock, and converts the high-voltage AC voltage output from the power grid into a stepped-down DC voltage for easy detection in subsequent stages. A zero-crossing detection unit is designed so that the main controller can identify cycle integrity and zero-crossing loss. The voltage detection unit is designed to directly enable the emergency power supply module in the event of undervoltage / power failure, providing short-term bootstrapping power to the main controller, contactor drive module, etc., to ensure reliable completion of protection actions.

[0028] In the embodiments described in this specification, the step-down rectifier unit includes: A transformer; the input terminal of the transformer is connected to the output terminal of the power grid; the transformer is used to reduce the AC voltage output by the power grid to obtain a stepped-down AC voltage; A full-bridge rectifier circuit; the input terminal of the full-bridge rectifier circuit is connected to the output terminal of the transformer; the first output terminal of the full-bridge rectifier circuit is connected to the input terminal of the zero-crossing detection unit; the second output terminal of the full-bridge rectifier circuit is connected to the input terminal of the voltage detection unit; the full-bridge rectifier circuit is used to rectify the stepped-down AC voltage into the stepped-down DC voltage.

[0029] In some embodiments, such as Figure 3 As shown, the step-down rectifier unit includes: Transformer; the input terminal of the transformer is connected to the output terminal of the power grid; specifically, the transformer is an isolation transformer; the primary side of the transformer is connected to the live wire (L line) and neutral wire (N line) of the power grid, and the secondary side of the transformer is connected to the input terminal of the full-bridge rectifier circuit; The transformer is used to convert the 220V AC voltage output from the power grid into a preset low-voltage AC voltage, i.e., a stepped-down AC voltage. Specifically, the 220V AC voltage output from the power grid is stepped down according to the turns ratio between the secondary coil and the primary coil of the transformer. For example, if the turns ratio is 12:220, the 220V AC voltage output from the power grid is reduced to 12V. On the one hand, the transformer reduces the AC voltage output from the power grid, and on the other hand, it electrically isolates the downstream detection circuit from the external high-voltage power grid. That is, the primary and secondary sides of the transformer are only magnetically coupled and not electrically connected. This ensures that even if there is a fault in the downstream circuit, the high voltage of the power grid cannot enter the low-voltage side and damage the control circuits in the main controller and other control systems, thereby improving the safety performance of the control system. The full-bridge rectifier circuit consists of four diodes; the secondary side of the transformer is connected to the full-bridge rectifier circuit, so that no matter whether the secondary side of the transformer is in the positive or negative half-cycle, the full-bridge rectifier circuit will keep the pulsating DC voltage of the downstream detection node of the same polarity. That is, no matter how the voltage fluctuates after stepping down, the output of the full-bridge rectifier circuit is always the pulsating DC of the same polarity. Therefore, when the 220V AC voltage output by the power grid decreases, the AC voltage after step-down on the secondary side of the transformer and the DC voltage after step-down after rectification by the full-bridge rectifier circuit also decrease in proportion (the ratio of the number of turns of the coil on the secondary side to the number of turns of the coil on the primary side). The subsequent circuit can determine the voltage status of the power grid by detecting the DC voltage after step-down. Furthermore, since the full-bridge rectifier circuit outputs pulsating DC, in actual circuits, based on the response speed and anti-interference requirements of undervoltage detection, appropriate filter capacitors or RC filter networks can be set at the detection node to ensure a relatively stable voltage at the input of the voltage detection unit, while avoiding an excessively large filter time constant that would affect the undervoltage response speed. A transformer is used to reduce the high-voltage AC output from the grid to a safe step-down AC voltage according to a preset ratio, while simultaneously achieving high-low voltage isolation. A full-bridge rectifier circuit is used to rectify the step-down AC voltage into a step-down DC voltage with unchanged polarity. The voltage level of this step-down DC voltage is proportional to the grid voltage level, allowing subsequent circuits to safely and accurately determine the voltage status of the external grid simply by detecting the step-down DC voltage.

[0030] Based on this, the working principle of the zero-crossing detection unit is explained in detail: 1. When the AC voltage is far from the zero-crossing point When the AC voltage on the secondary side of the transformer is far from zero, the output voltage of the full-bridge rectifier circuit is high, and the current flowing through the current-limiting resistor R12 and the input LED of the optocoupler U5 is greater than the current required for the optocoupler to conduct.

[0031] At this time, the LED on the input side of optocoupler U5 is turned on; the phototransistor on the output side of optocoupler is turned on; and the output terminal VP of the zero-crossing detection unit is pulled low. Therefore, VP remains low for most of the AC voltage cycle.

[0032] 2. When the AC voltage approaches zero crossing point When the AC waveform approaches zero, the voltage on the secondary side of the transformer and the output voltage of the full-bridge rectifier circuit decrease accordingly. When the current flowing through the input LED of optocoupler U5 is lower than its conduction sustaining current, the input side of the optocoupler stops emitting light, and the output transistor is cut off.

[0033] At this time, the VP terminal is pulled high by the control-side pull-up resistor R23, thus forming a zero-crossing pulse. Due to the use of a full-bridge rectifier circuit, a VP high-level pulse is generated when the AC voltage crosses zero during both the positive and negative half-cycles. For a 50Hz AC mains, the theoretical interval between adjacent zero-crossing pulses is approximately 10ms, and the VP pulse frequency is approximately 100Hz.

[0034] The main controller can obtain the following information based on the VP signal: 1. The interval between adjacent zero-crossing pulses is used to calculate the power grid frequency; 2. Whether the zero-crossing pulse is continuous is used to determine whether alternating current exists; 3. Whether the zero-crossing pulse interval is lengthened is used to determine frequency drift or period abnormality; 4. Whether no zero-crossing pulses are detected for several consecutive cycles is used to determine if there is a power outage; 5. Whether the zero-crossing pulse width increases is used to help determine the voltage amplitude decrease.

[0035] When the mains voltage drops, the time that the optocoupler's input current can maintain conduction shortens, and the width of the VP high-level pulse usually gradually increases. Therefore, in addition to detecting the zero-crossing cycle, the change in the VP pulse width can also be used to help determine whether the external mains voltage is continuously decreasing.

[0036] The actual width of the zero-crossing pulse is related to the transformer output voltage, the voltage drop of the full-bridge rectifier circuit, the resistance value of the current-limiting resistor R12, the forward voltage drop of the optocoupler input, the optocoupler current transfer ratio, and the input threshold on the control side. The normal pulse width range can be determined during calibration.

[0037] In the embodiments described in this specification, the voltage detection unit includes: A voltage threshold adjustment circuit is provided, the output of which is connected to the second output of the step-down rectifier unit; the voltage threshold adjustment circuit is used to divide the stepped-down DC voltage to obtain the divided voltage. A voltage monitoring circuit is provided, the input of which is connected to the output of the voltage threshold adjustment circuit. The voltage monitoring circuit is used to adjust the output level of the voltage monitoring signal based on the comparison result between the voltage after voltage division and the preset voltage threshold.

[0038] In some embodiments, the AC voltage output from the power grid is converted into a DC voltage after being stepped down and rectified. If the stepped-down DC voltage is directly connected to the voltage monitoring circuit, there is only one voltage threshold that can be used for judgment. However, in order to take into account the differences in external power grid fluctuations in different regions and at different times, the voltage detection threshold can be adjusted according to the current external power grid fluctuations to avoid activating the emergency power supply module due to power grid fluctuations. Based on this, a voltage threshold adjustment circuit is set up, such as... Figure 3 As shown, the output of the voltage threshold adjustment circuit is connected to the second output of the buck rectifier unit. Specifically, the voltage threshold adjustment circuit includes an analog switch, configuration resistors, and voltage divider resistors. The analog switch can be the classic CMOS 8-channel analog multiplexer / demultiplexer chip CD4051B, which is an 8-to-1 analog switch with eight input channels (channels 0-7), one common output terminal (COM), and three address control pins (A / B / C). The number of configuration resistors is the same as the number of input channels, i.e., the voltage threshold adjustment circuit includes eight configuration resistors R1-R8, each with a different resistance value. Each input channel is connected to one configuration resistor. The main controller selects one input channel from the eight input channels through the address selection terminals A / B / C of the CD4051B to connect to the voltage monitoring circuit. There are eight combinations of three address signals, so up to eight different input channels can be selected. The correspondence between the resistance value of each configuration resistor and the input channel can be adjusted according to the PCB layout. However, the main controller selects one of the resistors R1 to R8 through the three address selection terminals, so that it forms a voltage divider network together with the voltage divider resistor. Since R1 to R8 are selected with different resistance values, the voltage division ratio of the input voltage monitoring circuit is different after selecting different resistors. Therefore, the undervoltage trigger threshold corresponding to the external power grid voltage is also different.

[0039] The input terminal of the voltage monitoring circuit is connected to the output terminal of the voltage threshold adjustment circuit. After being stepped down, the DC voltage is divided by the voltage threshold adjustment circuit to obtain a divided voltage, which is then input to the voltage monitoring circuit. The voltage monitoring circuit adjusts the output level of the voltage monitoring signal based on the comparison between the divided voltage and the preset voltage threshold. By switching the configuration resistor used for voltage division via the address lines controlled by the main controller, the attenuation ratio of the mains detection voltage to the input pin of the voltage monitoring circuit is changed. This allows a single fixed-threshold voltage monitoring chip to cover multiple voltage levels, balancing the speed of hardware protection with the flexibility of system adaptation, and significantly reducing BOM cost and PCB area.

[0040] In the embodiments described in this specification, the voltage monitoring circuit includes: A voltage monitoring chip, the input terminal of which is connected to the output terminal of the voltage threshold adjustment circuit; the voltage monitoring chip is used to adjust the output level of the reset pin according to the voltage value comparison result; An optocoupler is provided, the input of which is connected to the output of the voltage monitoring chip; the optocoupler is used to adjust the output level of the voltage monitoring signal according to the output level of the reset pin.

[0041] In some embodiments, such as Figure 3 As shown, the voltage monitoring circuit includes a voltage monitoring chip and an optocoupler U1. The voltage monitoring chip can be the SGM809B, a low-power microprocessor monitoring / reset chip from SGMICRO. The input terminal of the voltage monitoring chip (the VDD terminal of the SGM809B) is connected to the output terminal of the voltage threshold adjustment circuit. The voltage monitoring chip has a reset pin RESET, which is active low. The input terminal of the optocoupler is connected to the output terminal of the voltage monitoring chip. The voltage monitoring chip itself has a fixed internal reset threshold of 2.93V, which is the preset voltage threshold; the voltage monitoring chip is used to adjust the output level of the reset pin based on the voltage value comparison result; When the mains voltage is normal, the external 220V AC voltage is higher than the currently selected threshold, and the transformer secondary voltage is within the normal range. The rectified and stepped-down DC voltage is within the normal range. After passing through the voltage divider resistor network selected by the analog switch CD4051B, when the voltage at the input terminal VDD of the voltage monitoring chip SGM809B (the voltage after voltage division) is greater than the internal reset threshold of 2.93V, the reset pin is in the unreset state. When the mains voltage drops below the threshold, when the external AC voltage continues to drop, the transformer secondary voltage and the stepped-down DC voltage also drop synchronously. The voltage at the input terminal VDD of the voltage monitoring chip SGM809B also drops accordingly. When the voltage at the input terminal VDD of the voltage monitoring chip (the voltage after voltage division) is less than the internal reset threshold of 2.93V, the reset pin is pulled low. The optocoupler is used to adjust the output level of the voltage monitoring signal according to the output level of the reset pin. Specifically, when the RESET pin of the voltage monitoring chip SGM809B is at a high level or the reset state is released, the output level of the reset pin is driven by the subsequent driving circuit to turn on the light-emitting diode in the optocoupler and the transistor in the optocoupler. The output terminal of the optocoupler, i.e. the Power node, is pulled low to a low level by the output side of the optocoupler, that is, the output level of the voltage monitoring signal is low. When the RESET pin of the SGM809B voltage monitoring chip is pulled low, the subsequent driver devices stop driving the optocoupler. The LED in the optocoupler no longer conducts, the transistor in the optocoupler is cut off, and the output terminal of the optocoupler, i.e., the Power node, is no longer pulled low by the optocoupler. At this time, the Power node is pulled high by the pull-up resistor, meaning the output level of the voltage monitoring signal is high. This voltage monitoring chip with a preset voltage threshold achieves accurate, fast, and reliable hardware detection of grid undervoltage / power failure. When the voltage after voltage division drops below the preset voltage threshold, the RESET pin is immediately pulled low, thereby changing the output level of the voltage monitoring signal and directly triggering the emergency power supply module, ensuring that protection actions are initiated immediately in the event of grid anomalies.

[0042] In the embodiments described in this specification, the power quality detection module includes: A voltage divider sampling network is used to divide the AC voltage output by the power grid to obtain a voltage divider voltage. The input terminal of the voltage divider sampling network is connected to the live wire of the power grid. Shunt; the input terminal of the shunt is connected to the neutral wire of the power grid; the shunt is used to generate a differential voltage based on the current output by the power grid; An energy metering chip; the energy metering chip is connected to the shunt and the voltage divider sampling network respectively; the energy metering chip is used to determine the energy quality information based on the voltage divider voltage and the differential voltage.

[0043] In some embodiments, such as Figure 4 As shown, Figure 4 This is a schematic diagram of the structure of a power quality detection module provided in the embodiments of this specification; the power quality detection module includes a voltage divider sampling network, a shunt, and a power metering chip; The input of the voltage divider sampling network is connected to the live wire (L line) of the power grid. The 220V high voltage output from the power grid is attenuated to the range that the power metering chip can accept through the high-resistance voltage divider sampling network. That is, the voltage divider sampling network divides the AC voltage output from the power grid to obtain the divided voltage, and inputs the divided voltage into the U channel of the power metering chip. The input of the shunt is connected to the neutral (N) line of the power grid, converting the load current in the AC circuit into a millivolt-level differential voltage and sending it into the IA / IB channel of the power metering chip. The energy metering chip can be the RN8209D single-phase energy metering chip. The energy metering chip is connected to the shunt and the voltage divider sampling network respectively. Specifically, the U channel of the energy metering chip is connected to the output of the voltage divider sampling network, and the IA / IB channel of the energy metering chip is connected to the output of the shunt. The energy metering chip has three independent ADC channels: U channel, IA channel, and IB channel. The U channel receives the voltage divided by the voltage divider sampling network. The IA and IB channels receive the differential voltage output from the shunt. The energy metering chip calculates the actual current value by combining the differential voltage and the shunt resistance. The power metering chip performs synchronous analog-to-digital conversion, digital filtering, RMS calculation, frequency measurement, zero-crossing detection, instantaneous sampling, and event detection on the acquired voltage and current values. Then, it sends the detection results, i.e. power quality information, to the main controller through the SPI interface. In addition, the U channel of the power metering chip also has frequency measurement and zero-crossing detection functions, and supports voltage drop, voltage peak anomaly, and waveform buffering.

[0044] Specifically, the power quality detection module can be divided into an AC voltage sampling branch and a current shunt sampling branch; For the AC voltage sampling branch, it is used to convert the 220V AC voltage between the L line and N line into a small-amplitude differential signal that can be safely acquired by the power metering chip RN8209D. Figure 4 The voltage divider sampling network consists of multiple series resistors. Using multiple resistors in series, instead of a single large-value resistor, serves the following main purposes: proportionally reducing the 220V AC voltage to the allowable input range of the RN8209D power metering chip; distributing the high voltage across multiple resistors, reducing the withstand voltage stress on a single resistor; limiting the current entering the metering chip's input terminal under abnormal surges or overvoltage conditions; reducing the impact of open circuits, breakdowns, or parameter drift of a single resistor on the sampling results; and facilitating the setting of the sampling ratio by adjusting the number and value of the series resistors. In practical circuits, a low-voltage side current-limiting resistor and a filter capacitor should also be set after the high-resistance voltage divider sampling network to suppress switching noise, high-frequency common-mode interference, and high-frequency ripple generated by the power conversion module, preventing high-frequency signals from aliasing into the power frequency sampling results.

[0045] For the current shunt sampling branch, Figure 4A shunt is installed on the neutral (N) line. The shunt is a current sampling resistor with a known small resistance. When the AC load current flows through the shunt, a differential voltage proportional to the current is generated across the shunt. The two ends of the shunt are connected to the current path of the energy metering chip RN8209D via Kelvin sampling lines. Using Kelvin connections reduces the influence of power traces, solder joints, and copper foil resistance on the measurement results. The IA channel of the energy metering chip RN8209D has a programmable gain amplifier, which can be configured with different gains according to the amplitude of the shunt output signal, thus balancing low current detection sensitivity and high current measurement range. The energy metering chip can also simultaneously calculate the RMS current, active power, reactive power, and energy direction. Furthermore, it can make judgments based on current sampling results, for example: 1. A voltage drop and a sudden increase in current may correspond to an external short circuit or a severe load fault; 2. A voltage drop but a current close to zero may correspond to a power outage in the upstream grid; 3. Voltage exists but the power direction is reversed, which may indicate local power backfeeding; 4. A significant current is still detected after the contactor is disconnected, which may indicate contactor sticking or abnormal current sampling. Therefore, the current channel of the energy metering chip is not only used for energy metering but also improves the reliability of grid fault type identification and contactor status diagnosis.

[0046] Furthermore, in practical use, the AC voltage and current signals (calculated using differential voltage and shunt resistance) enter the RN8209D energy metering chip. They first pass through an internal programmable gain amplifier before being sampled at high frequency by an ADC. The digital signal processing module filters, corrects gain, phase, and bias on the ADC data to obtain voltage, current, and power parameters. The main controller MCU can read a relatively complete power frequency waveform from the RN8209D chip for analysis of: voltage peak value; positive and negative half-cycle amplitude; zero-crossing position; cycle length; waveform slope; missing half-cycle; instantaneous drops; waveform distortion; and voltage recovery process. Compared to reading only the effective voltage value, reading the instantaneous waveform can identify rapid anomalies lasting less than a complete cycle. The RN8209D chip can directly calculate the effective voltage value, and the main controller MCU reads the corresponding metering parameters via SPI, eliminating the need to perform squaring, summing, and square root operations on all sampling points within the MCU. The RN8209D chip can directly output line frequency parameters. The measurement bandwidth can reach 250Hz. After reading the frequency parameters, the main controller MCU can determine: whether the grid frequency is within the normal range; whether the frequency is continuously drifting upwards or downwards; whether the grid has an unstable trend; whether the grid has stabilized after recovery; and whether the conditions for resuming grid-connected charging from islanded discharge state are met. For example, when the normal frequency range is set to 49.5Hz~50.5Hz, if the frequency drops to 49.3Hz briefly but recovers immediately, the disturbance observation state can be entered; if the frequency drops continuously and is accompanied by a voltage decrease, the protocol pre-switching state can be entered. The U channel of the energy metering chip RN8209D supports zero-crossing detection. The relevant outputs can be output through multiplexed pins such as IRQ_N / ZX, PF, or QF, or read by the MCU through internal zero-crossing parameters and waveform data. Additionally, the time difference between the command time base and the actual voltage zero-crossing point can be measured using the zero-crossing counter register ZXCNT. Zero-crossing detection can be used to obtain: the interval between adjacent zero-crossing points; the duration of the positive and negative half-cycles; whether the zero-crossing period is lengthening; whether consecutive zero-crossing losses occur; whether voltage phase jumps occur; and to restore the phase relationship between the power grid and the local bus. For 50Hz AC voltage, the theoretical interval between adjacent zero-crossing points is approximately 10ms. If the zero-crossing interval is detected to gradually change to 10.3ms, 10.6ms, and 11ms, it indicates that the power grid frequency is decreasing; if no effective zero-crossing is detected for 20ms to 40ms consecutively, it can be considered that the power grid has experienced a half-cycle loss, periodic interruption, or complete power outage. In addition, the RN8209D power metering chip provides an internal 256×20-bit waveform buffer, which can selectively buffer sampling data from voltage channels, current channels, or multiple channels. The power metering chip supports synchronous sampling rate and fixed sampling rate modes, and can generate corresponding status flags or interrupts when the waveform buffer is half-full, fully full, or when an anomaly occurs. The MCU can read waveforms in the following ways: configure the channels to be buffered; send a waveform buffer start command via SPI; wait for the waveform buffer to reach half-full or fully full; read the corresponding waveform data; analyze the waveforms before and after the anomaly; and save the voltage and current characteristics before and after the fault.

[0047] In actual testing, when the voltage monitoring signal Power goes high, the main controller MCU can immediately lock and read the waveform buffer of the power metering chip RN8209D, thereby obtaining a voltage waveform before and after the undervoltage trigger. This not only determines whether the power grid has lost power, but also identifies whether the fault is a momentary drop, a missing period, a frequency drift, or a continuous voltage decay.

[0048] For voltage dip and peak event detection, the RN8209D energy metering chip supports voltage and current transient event detection, including: voltage dip / voltage channel U overload / current channel A overload / current channel B overload. Voltage dip detection is implemented through the voltage dip threshold register (USAG). After the threshold is written, the chip compares it with the waveform sample value of the voltage synchronous sampling channel. The duration of the dip in half-cycles can be configured via USAG_CFG. When the low voltage state persists for more than the set number of half-cycles, the chip triggers a voltage dip event and generates an interrupt. This function allows for initial threshold judgment within the chip, reducing the burden on the MCU to continuously read the entire waveform. For example, the voltage dip threshold can be set to 85% of the rated voltage, approximately 187V, and the duration can be set to two half-cycles. When the voltage is below 187V and persists for more than approximately 20ms, the RN8209D energy metering chip generates a voltage dip interrupt, and the main controller MCU enters a disturbance observation or protocol pre-switching state. Peak detection can be used to identify: high voltage peaks after lightning surges; overshoot during grid recovery; abnormal pulses caused by contactor switching; and overvoltage caused by power conversion module backfeed.

[0049] Therefore, by integrating the power quality detection module and the grid continuity detection module, when a rapid drop occurs in the external power grid, the grid continuity detection module can first turn the voltage monitoring signal Power to a high level to directly start the emergency power supply module. Subsequently, the main controller MCU, which obtains the backup power supply, reads the power quality information, i.e., the data from the power metering chip RN8209D, through SPI to determine whether it is necessary to perform pilot resistor switching and vehicle discharge negotiation. This enables the grid continuity detection module to take the lead in ensuring power supply, while the power quality detection module is responsible for accurate fault diagnosis.

[0050] In the embodiments described in this specification, the emergency power supply module includes: A supercapacitor, wherein the input terminal of the supercapacitor is connected to the output terminal of the supercapacitor boost circuit; The supercapacitor boost circuit has its input terminal connected to the output terminal of the optocoupler; the supercapacitor boost circuit is used to control the supercapacitor to switch between a startup state and a standby state according to the voltage monitoring signal.

[0051] In some embodiments, such as Figure 3 As shown, Figure 3 The diagram only illustrates the supercapacitor boost circuit; the emergency power supply module includes a supercapacitor and a supercapacitor boost circuit; the input terminal of the supercapacitor is connected to the output terminal of the supercapacitor boost circuit; and the capacity of the supercapacitor is based on the minimum energy configuration required to complete the guidance switching, communication negotiation and contactor operation. The input terminal of the supercapacitor boost circuit is connected to the output terminal of the optocoupler in the voltage monitoring circuit; the supercapacitor boost circuit is used to control the supercapacitor to switch between the start-up state and the standby state according to the voltage monitoring signal. Specifically, the supercapacitor boost circuit includes a supercapacitor boost chip ( Figure 3 The SGM6614 in the supercapacitor boost chip is the enable terminal ( Figure 3 (EN in the middle) and the output terminal of the optocoupler ( Figure 3 The power connection is as follows: When the voltage monitoring signal is low, the enable terminal of the supercapacitor boost chip remains low, the supercapacitor does not start, or remains in standby mode, so that when the power grid is normal, the system is still powered by the normal auxiliary power supply, and the supercapacitor does not bear the main control power output. When the voltage monitoring signal is high, the high level is directly sent to the enable terminal of the supercapacitor boost chip, and the supercapacitor boost chip starts immediately. After boosting and regulating the voltage, the supercapacitor outputs a stable 12V power supply. This 12V power supply provides short-term bootstrapping power to the main controller, vehicle communication module, pilot resistor switching module, and contactor drive module. The supercapacitor is designed to provide short-term bootstrapping power to the V2G charging pile during a power grid failure, ensuring reliable execution of protection actions. When the external power grid fails and the main and auxiliary power supplies are lost, the supercapacitor quickly and stably outputs a 12V power supply through the supercapacitor boost chip to power the main controller, vehicle communication module, pilot resistor switching module, and contactor drive module. Compared to batteries, supercapacitors have the advantages of high power density, extremely fast response, and long cycle life, perfectly matching the emergency requirement of completing contactor disconnection and notifying vehicle shutdown within a few hundred milliseconds after a power failure, thus improving the safety and reliability of the control system.

[0052] In the embodiments described in this specification, the control system further includes a vehicle communication module; The first input terminal of the vehicle communication module is connected to the output terminal of the main controller; the second input terminal of the vehicle communication module is connected to the output terminal of the vehicle; the vehicle communication module is used to control the communication connection between the main controller and the vehicle when the guiding resistor switches to the discharge state.

[0053] In some embodiments, the control system further includes a vehicle communication module; The first input terminal of the vehicle communication module is connected to the output terminal of the main controller, and the second input terminal is connected to the output terminal of the vehicle. The vehicle communication module is used to control the main controller and the vehicle to communicate via the CAN bus when the guide resistor switches to the discharge state. Specifically, the main controller establishes a discharge communication process with the vehicle's Battery Management System (BMS) through the vehicle communication module. The main controller sends information such as discharge request, target bus voltage, allowable power range, maximum allowable current, and emergency power supply status to the vehicle BMS. The vehicle BMS, in turn, returns information such as vehicle SOC, power battery voltage, allowable discharge current, allowable discharge power, minimum allowable SOC, power battery temperature, insulation status, and vehicle fault status to the main controller. The main controller determines whether the vehicle meets the external discharge conditions based on the information returned by the vehicle BMS. Real-time interaction via the CAN bus of key parameters such as vehicle battery SOC, maximum allowable charge / discharge power, individual cell voltage and temperature, and contactor status ensures that the charge / discharge power does not exceed the safety boundaries between the vehicle and the power grid. The vehicle communication module enables bidirectional energy scheduling of V2G charging piles.

[0054] In the embodiments described in this specification, the control system further includes a contactor drive module, a charging contactor, and a discharging contactor; The input terminal of the contactor drive module is connected to the output terminal of the main controller; the first output terminal of the contactor drive module is connected to one side of the charging contactor; the other side of the charging contactor is connected to the power grid; the second output terminal of the contactor drive module is connected to one side of the discharging contactor; the other side of the discharging contactor is connected to the vehicle; the contactor drive module is used to control the charging contactor to open when the power supply state is a power-off state; and to control the discharging contactor to close when the power supply state is a discharge establishment state.

[0055] In some embodiments, the control system further includes a contactor drive module, a charging contactor, and a discharging contactor; The input terminal of the contactor drive module is connected to the output terminal of the main controller; the first output terminal of the contactor drive module is connected to one side of the charging contactor; the other side of the charging contactor is connected to the power grid; the second output terminal of the contactor drive module is connected to one side of the discharging contactor; the other side of the discharging contactor is connected to the vehicle. The contactor drive module controls the charging contactor to open when the power supply is off, thus disconnecting the charging circuit between the grid and the V2G charging station; and controls the discharging contactor to close when the power supply is in the discharge establishment state, thus closing the discharge circuit between the vehicle and the V2G charging station. The contactor drive module, charging contactor, and discharging contactor enable safe and orderly switching of the bidirectional physical connection and disconnection of the V2G charging station's main circuit. The charging contactor controls the path for the grid to charge the vehicle, while the discharging contactor controls the path for the vehicle to feed energy back to the grid. These two are configured independently to avoid the short-circuit risk caused by sharing the same switch for bidirectional energy flow. The contactor drive module receives commands from the main controller and provides sufficient coil drive current to ensure reliable engagement and rapid release of the charging / discharging contactors. During the discharge establishment process, the contactor drive module ensures that the discharging contactor can only close after CAN communication negotiation is completed and the vehicle's BMS returns a discharge permission message, implementing a safety interlock mechanism of negotiation before power-on, thus improving the safety and reliability of the control system.

[0056] In this embodiment of the specification, the control system further includes a bidirectional power conversion module; the bidirectional power conversion module is used to receive a rectification command issued by the main controller when the power supply state is a normal charging state, and to rectify the AC voltage output by the power grid into DC voltage; and when the power supply state is a discharge establishment state, to receive an inverter command issued by the main controller, and to invert the voltage output by the vehicle into a high-voltage AC voltage.

[0057] The following describes a control method for a V2G charging pile according to this application. Figure 5 This is a flowchart illustrating a control method for a V2G charging pile provided in an embodiment of this specification. This specification provides the operational steps of the method described in the embodiment or flowchart, but based on conventional or non-inventive labor, more or fewer operational steps may be included. The order of steps listed in the embodiment is merely one possible execution order among many and does not represent the only possible execution order. In actual system or server product execution, the method can be executed sequentially or in parallel (e.g., in a parallel processor or multi-threaded processing environment) as shown in the embodiment or accompanying drawings. Specifically, as... Figure 5 As shown, the method can be applied to the control unit in a V2G charging pile, and the method includes: S501: Obtain the grid connection / disconnection information of the V2G charging pile detected by the grid connection / disconnection status detection module, and the power quality information of the grid detected by the power quality detection module; the grid connection / disconnection information is the connection / disconnection information of the grid connected to the V2G charging pile.

[0058] In the embodiments of this specification, during the process of the power grid supplying power to the vehicle, the power grid connection and disconnection information of the V2G charging pile detected by the power grid connection and disconnection status detection module and the power quality information of the power grid detected by the power quality detection module are obtained. Among them, a power grid on / off status detection module is set up to quickly determine whether the external power grid exists, whether the zero-crossing signal is continuous, and the AC cycle; A power quality detection module is set up to determine whether the voltage amplitude, frequency, zero-crossing cycle, and voltage change trend exceed the allowable range.

[0059] S503: Determine the power supply status of the control system based on the power grid on / off information and the power quality information.

[0060] In the embodiments of this specification, the power supply status of the control system is determined by integrating grid on / off information and power quality information; Specifically, the power supply status of the control system includes normal charging status, disturbance observation status, protocol pre-switching status, power failure status, and discharge establishment status.

[0061] If the grid connection information indicates that the grid output voltage is abnormal and the power quality information indicates that the grid output voltage is normal, or if the grid connection information indicates that the grid output voltage is normal and the power quality information indicates that the grid output voltage is abnormal, the power supply state is determined to be a disturbance observation state, and the grid connection information and the power quality information are continuously acquired. If the power grid on / off information indicates that the power grid is continuously abnormal, and the power quality information indicates that the power grid is continuously abnormal, the power supply status is determined to be a protocol pre-switching status, and the power grid on / off information and the power quality information are continuously acquired until the power supply status is determined to be a power outage status.

[0062] It can be explained that when the grid connection or power quality information outputs an abnormality for a short period of time, but the abnormality lasts for a short time, or when the output result represented by the grid connection information is inconsistent with the output result represented by the power quality information, the control system does not immediately switch to the discharge establishment state, but instead enters the disturbance observation state.

[0063] When both grid connection / disconnection information and power quality information indicate that the external grid is continuously deteriorating, or when one of these information has been continuously abnormal while the other shows a clear deterioration trend, the control system enters the protocol pre-switching state. The protocol pre-switching state is designed to prepare the control link in advance before the external grid is completely de-energized, thereby shortening the time required to establish vehicle discharge after a subsequent power outage. Therefore, when the power supply status is in the protocol pre-switching state, the system activates or pre-charges the emergency power supply module, puts the main controller, vehicle communication module, and guide resistor switching module into an immediately actionable state, records the vehicle's current connection and communication status, presets the charging contactor disconnection control conditions, presets the guide resistor switching command, freezes new charging power increase commands, and gradually reduces the current charging power.

[0064] S505: When the power supply status is in a power-off state, activate the emergency power supply module to enable the emergency power supply module to supply power to the V2G charging pile.

[0065] In the embodiments of this specification, when both the power grid on / off information and the power quality information indicate that the external power grid has failed, or when the duration of the external power grid anomaly reaches the power outage judgment threshold (the upper limit of the power outage duration), the power supply status of the control system is in a power outage state. The emergency power supply module is then activated, and the emergency power supply module maintains the operation of the main controller, the guide resistor switching module, the vehicle communication module, and the contactor drive module so that the emergency power supply module supplies power to the V2G charging pile.

[0066] S507: Control the disconnection of the charging circuit between the power grid and the V2G charging pile, and send a discharge command to the guide resistor switching module to switch the guide resistor to the discharge state.

[0067] In the embodiments described in this specification, the charging contactor is controlled to disconnect, thereby disconnecting the charging circuit between the power grid and the V2G charging pile; Obtain the contact detection result of the corresponding contact of the charging contactor; if the contact detection result indicates that the charging contactor has been disconnected, prohibit the bidirectional power switching module from outputting energy to the grid, and send a discharge command to the guiding resistor switching module so that the guiding resistor switches from the charging state to the discharging state.

[0068] S509: Obtain the communication status between the V2G charging pile and the vehicle connected to the V2G charging pile.

[0069] In the embodiments of this specification, the power failure state only indicates that the external power grid has failed and the control system has started to execute the discharge switching procedure. It does not indicate that the vehicle has started to discharge externally. The discharge contactor remains open until the CAN communication is completed and the vehicle has returned the discharge permission information. Therefore, the discharge communication negotiation between the V2G charging pile and the vehicle battery management system (BMS) is initiated through the vehicle communication module, and the communication status between the V2G charging pile and the vehicle connected to the V2G charging pile is obtained.

[0070] S511: If the communication status indicates that the V2G charging pile is in communication connection with the vehicle, control the charging circuit between the vehicle and the V2G charging pile to close; so that the vehicle supplies power to the power grid.

[0071] In the embodiments described in this specification, if the communication status indicates that the V2G charging pile and the vehicle are connected, the discharge contactor is closed to close the charging circuit between the vehicle and the V2G charging pile, and the bidirectional power conversion module is activated so that the vehicle discharge current gradually increases from 0A according to a set slope, and the local AC bus voltage is gradually established. When the local AC bus voltage and frequency reach the set values ​​and remain stable, the system completes the discharge establishment and enters stable discharge operation.

[0072] In this embodiment of the specification, after obtaining the communication status between the V2G charging pile and the vehicle connected to the V2G charging pile, the method further includes: If the communication status indicates that the vehicle's battery level is less than a preset battery level threshold / the vehicle's battery temperature is greater than a preset battery temperature threshold, the emergency power supply module is controlled to supply power to the main controller, the guide resistor switching module, the contactor drive module, and the vehicle communication module. In the embodiments of this specification, the preset power threshold is a preset lower limit value of the vehicle's power level; the preset battery temperature threshold is a preset upper limit value of the vehicle's battery temperature. If the communication status indicates that the vehicle's battery level is less than the preset battery level threshold (vehicle SOC is too low), or the vehicle's battery temperature is greater than the preset battery temperature threshold (battery overheating), or there is an insulation abnormality, or a discharge prohibition fault, the control system will not enter the discharge establishment state. Otherwise, it will remain in a safe waiting state and continue to maintain necessary control and communication functions by the emergency power supply module, or it will safely exit after the preset waiting time has been reached.

[0073] For example, at 0ms, the mains voltage is 220V, and the control system is in normal charging state; At 20ms, the grid voltage briefly dropped to 185V, but the zero-crossing signal was normal, and the control system entered the disturbance observation state. At 40ms, the voltage recovered to 218V, and the system returned to normal charging state; Five seconds later, the grid voltage dropped from 220V to 180V again, the frequency dropped from 50Hz to 49Hz, and the zero-crossing cycle lengthened. The system entered the protocol pre-switching state and started the backup emergency power supply module to prepare. After 150ms, the power grid on / off status detection module failed to detect a valid zero crossing for several consecutive times, the power quality detection module detected that the voltage was below 30V, and the control system entered a power-off state. The main controller MCU disconnects the charging contactor, switches the guiding resistor to the discharge state, and negotiates with the vehicle BMS via CAN communication through the vehicle communication module; after the vehicle returns the discharge permission information, the main controller MCU closes the discharge contactor, the vehicle discharge current gradually increases, and the control system enters the discharge establishment state. Once the local AC bus voltage and frequency stabilize, the control system enters a stable discharge operation state.

[0074] It is evident that the above five states are not simply divided according to voltage values, but rather comprehensively consider the triggering order of the grid on / off state detection module and the power quality detection module, whether the detection results are consistent, whether the anomaly is continuous, and whether the anomaly is of different types such as voltage drop, frequency deviation, zero-crossing loss, or complete power outage. This enables the system to distinguish between transient disturbances, power supply deterioration, and complete power outage, thus avoiding false switching and ensuring that the V2G discharge protocol can be quickly established when a real power outage occurs.

[0075] When the power grid continuity detection module triggers an anomaly first, but the power quality detection module has not yet confirmed a complete power outage, the control system enters a protocol pre-switching state, activating / pre-charging the emergency power supply module, setting the pre-set guide resistor switching module, and freezing the current charging contactor action, without immediately closing the discharge path. Once both the power grid continuity detection module and the power quality detection module confirm that the external power grid has failed or that a continuous anomaly has reached the set conditions, the control system enters a power-down state. Within the power supply window of the emergency power supply module, it performs guide resistor switching, vehicle wake-up, communication negotiation, and sequential control of the discharge contactor. This approach avoids erroneous switching due to instantaneous voltage fluctuations and the inability of the main control unit to execute protocol actions after a complete power outage.

[0076] Furthermore, the emergency power supply module in the embodiments of this specification is not used as a power source for the microgrid load, nor as a continuous operating power source for the V2G charging pile, but rather as a short-term control power source during the V2G discharge protocol establishment phase. Its power supply is limited to the main controller MCU, the pilot resistor switching module, the vehicle communication module, the contactor drive module, and necessary isolation and detection modules.

[0077] When the external power grid malfunctions or completely fails, the emergency power supply module maintains the aforementioned control link within a preset time window. This ensures that even after the external 220V AC input fails, the V2G charging pile can still complete the switching of the guiding resistor, vehicle wake-up, CAN communication negotiation, discharge contactor drive, and output of the bidirectional power conversion module start-up command. Once vehicle discharge is established, the system forms a control power feedback path through the vehicle output side or the bidirectional power conversion module to continue supplying power to the main control module, while the emergency power supply module either exits power supply or enters a recharge state. The emergency power supply module preferably uses a supercapacitor, whose capacity is not configured according to the load power supply time, but rather according to the minimum energy required to complete the guiding switch, communication negotiation, and contactor operation.

[0078] When an external power grid anomaly occurs during vehicle charging, the main controller MCU first controls the external power grid input contactor or charging contactor to disconnect and checks the status of its auxiliary contacts to confirm electrical isolation between the V2G charging pile and the abnormal power grid. Subsequently, the main controller MCU enables the emergency power supply module to take over the control link power supply and controls the guide resistor switching module to switch from charging to discharging state. After successful vehicle BMS communication negotiation and confirmation that the vehicle is allowed to discharge, the main controller MCU then controls the discharge contactor or the bidirectional power conversion module enable switch to close. If any step fails to meet the conditions, the system remains in a safe waiting state and does not close the discharge contactor. This sequential protection avoids directly entering the discharge mode when there is an external power grid anomaly, the vehicle-side contactor is not released, the status of the guide resistor is not confirmed, or communication is not completed, thereby reducing the risks of contactor sticking, surge impact, and vehicle-side malfunction.

[0079] When the system is in vehicle discharge mode, the main controller MCU continuously monitors the recovery status of the external power grid. Only when both power grid on / off information and power quality information confirm the restoration of external AC input, and the voltage amplitude, frequency, and zero-crossing cycle meet normal conditions within a preset stable time, does the main controller MCU execute the discharge exit procedure. The discharge exit procedure includes: first, sending a stop discharge request to the vehicle BMS and waiting for the vehicle-side discharge current to drop below a safe threshold; then, disconnecting the discharge contactor or shutting down the bidirectional power conversion module; subsequently, restoring the guide resistor switching module to charging mode; and finally, re-executing the vehicle charging communication negotiation procedure to restore the V2G charging pile from discharge mode to charging mode. This mechanism avoids backfeeding, inrush current, or charging / discharging state conflicts caused by immediate grid connection upon restoration.

[0080] In one exemplary embodiment, based on the overall architecture of the V2G charging pile control system, the entire process link of dual-path detection and state switching is described, such as... Figure 6 As shown, Figure 6 A flowchart illustrating a dual-path detection and state switching process provided in this embodiment includes: S601: Normal charging status.

[0081] In the embodiments of this specification, a dual-path power grid anomaly identification structure is designed with a hardware continuity detection circuit and a waveform sampling analysis circuit. The hardware continuity detection circuit can be understood as a power grid continuity status detection module, and the waveform sampling analysis circuit can be understood as a power quality detection module. When the hardware continuity detection circuit (power grid continuity status detection module) can continuously detect normal voltage, and the voltage amplitude, frequency and period detected by the waveform sampling and analysis circuit (power quality detection module) are all within the set normal range, the system remains in normal charging state. Specifically, when the hardware continuity detection circuit continuously detects a zero-crossing signal approximately once every 10ms, and the waveform sampling and analysis circuit detects that the mains voltage is 220V and the frequency is 50Hz, with no significant fluctuations for several consecutive cycles, the main controller MCU determines that the external power grid is normal. The charging contactor remains closed, the pilot resistor remains in a charging state, and the backup bootstrap power supply module (i.e., the emergency power supply module) is in standby mode.

[0082] S602: Determine whether a power grid abnormality has been detected; if no power grid abnormality has been detected, proceed to S601.

[0083] In the embodiments described in this specification, the power grid is continuously monitored for any abnormalities during the process of powering the vehicle from the grid.

[0084] S603: Disturbance observation state.

[0085] In the embodiments of this specification, when any detection circuit outputs an abnormality for a short period of time, but the duration of the abnormality is short, or when the two detection results are inconsistent, the system does not immediately switch to the discharge establishment state, but instead enters the disturbance observation state.

[0086] For example, at a certain moment, the waveform sampling and analysis circuit detects that the grid voltage drops from 220V to 185V instantaneously, but only for 20ms, and then recovers to 218V; at the same time, the hardware continuity detection circuit can still continuously detect normal zero-crossing signals without periodic interruption.

[0087] In this situation, the waveform sampling and analysis circuit considers the voltage amplitude abnormal, while the hardware continuity detection circuit believes the external power grid is still present. The two results are inconsistent, and the main controller MCU interprets this abnormality as a momentary voltage drop or short-term disturbance, putting the system into disturbance observation mode. In disturbance observation mode, the main controller MCU continues to collect data for several subsequent AC cycles, but does not initiate the pilot resistor switching, disconnect the charging contactor, or initiate vehicle discharge communication negotiation. If the voltage returns to normal within the set observation time, the system returns to normal charging mode.

[0088] For example, if the hardware continuity detection circuit briefly misses a zero-crossing signal due to electromagnetic interference, but the waveform sampling and analysis circuit still detects a voltage of 220V and a frequency close to 50Hz, the main controller MCU will not immediately determine that the power grid is down. Instead, it will enter a disturbance observation state to avoid false switching caused by single-path mis-triggering.

[0089] S604: Determine if the hardware continuity test is abnormal; In the embodiments of this specification, the hardware continuity test results are judged in real time during the detection process to determine whether they are abnormal.

[0090] S605: Determine if the waveform sampling analysis is abnormal; In the embodiments of this specification, the waveform sampling analysis results are judged in real time during the detection process to determine whether they are abnormal.

[0091] S606: Delayed confirmation / continued observation.

[0092] In the embodiments described in this specification, regardless of whether an anomaly exists, a delayed confirmation is performed, and observation continues.

[0093] S607: Protocol pre-switching state.

[0094] In the embodiments described in this specification, when both detections indicate that the external power grid is continuously deteriorating, or when one of the detections has been continuously abnormal while the other has detected a clear deterioration trend, the system enters the protocol pre-switching state.

[0095] For example, within a continuous 100ms, the waveform sampling and analysis circuit detected that the grid voltage successively decreased from 220V to 205V, 190V, and 175V, while the frequency shifted from 50Hz to 49Hz, and the zero-crossing period gradually lengthened. Although the hardware continuity detection circuit could still detect the voltage and some zero-crossing signals, it showed continuous missed detections, incomplete periods, or significantly abnormal zero-crossing intervals. At this point, although the two detections had not yet simultaneously confirmed a complete power outage, both reflected that the grid's power supply capacity was rapidly decreasing. The main controller MCU judged that there was a high risk of power failure in the external grid, causing the system to enter the protocol pre-switching state.

[0096] In the protocol pre-switching state, the system does not immediately close the discharge contactor, but instead performs the following preparatory actions in advance: 1. Activate or precharge the backup bootstrap power supply module (i.e., emergency power supply module); 2. Put the main controller MCU, CAN communication module (i.e., vehicle communication module), and guide resistor switching module into an immediately operable state; 3. Record the vehicle's current connection and communication status; 4. Preset charging contactor disconnection control conditions; 5. Preset guide resistor switching command; 6. Freeze new charging power increase commands and gradually reduce the current charging power.

[0097] The purpose of entering the protocol pre-switching state is to prepare the control link in advance before the external power grid is completely de-energized, thereby shortening the time required to establish vehicle discharge after a subsequent power outage.

[0098] S608: Determine whether the external power grid has failed / the continuous abnormality has reached the threshold; if the external power grid has not failed / the continuous abnormality has not reached the threshold, proceed to S603.

[0099] In the embodiments of this specification, it is determined whether the external power grid has failed, or whether the duration of the external power grid anomaly has reached the power outage determination threshold.

[0100] S609: Power failure boot state.

[0101] In the embodiments described in this specification, if the external power grid fails or the duration of the external power grid anomaly reaches the power failure determination threshold, the system enters a power failure state. For example, if the hardware continuity detection path fails to detect a valid zero-crossing signal for 40ms, and the waveform sampling and analysis circuit simultaneously detects a voltage below 30V that has not recovered for several consecutive sampling cycles, the two detection results are consistent, and the main controller MCU confirms that the external power grid has failed.

[0102] S610: Disconnect charging path / Isolate from abnormal power grid.

[0103] In the embodiments described in this specification, in the power-off state, the backup bootstrap power supply module maintains the operation of the main controller, vehicle communication module and contactor drive module; controls the charging contactor to disconnect; detects the auxiliary contacts of the charging contactor to confirm that the charging path has been disconnected; and prohibits the bidirectional power conversion module from outputting energy to the external power grid.

[0104] S611: Switch the state of the pilot resistor.

[0105] In the embodiments described in this specification, the guiding resistor is switched from a charging state to a discharging state.

[0106] S612: Negotiates CAN communication with the vehicle's BMS.

[0107] In the embodiments described in this specification, the power failure state only indicates that the external power grid has failed and the system has started executing the discharge switching procedure; it does not indicate that the vehicle has started discharging externally. While CAN communication is not yet complete and the vehicle has not returned a discharge permission message, the discharge contactor remains open; therefore, discharge communication negotiation with the vehicle's BMS is initiated.

[0108] S613: Determine whether the vehicle is allowed to discharge and whether the negotiation is successful; if the negotiation is unsuccessful, proceed to S623.

[0109] In the embodiments described in this specification, it is determined whether the vehicle allows discharge and whether the negotiation is successful.

[0110] S614: Closed discharge contactor.

[0111] In the embodiments described in this specification, when the guiding resistor has been switched to the discharge state, the vehicle BMS communication negotiation is successful, and the vehicle SOC, power battery status, and contactor status all meet the discharge conditions, the system enters the discharge establishment state.

[0112] For example, the main controller MCU obtains through CAN communication that the vehicle's current SOC is 75%, which is higher than the set minimum discharge SOC, which can be 30% for example; the vehicle's power battery temperature is normal, the insulation test is normal, and there is no discharge prohibition fault; the vehicle's maximum allowable discharge power is 20kW, while the current local load requirement is 8kW; at the same time, the charging contactor has been disconnected, and the backup bootstrap power supply voltage is normal.

[0113] At this point, the MCU determines that all discharge conditions are met, controls the discharge contactor to close, and starts the bidirectional power conversion module.

[0114] S615: Discharge establishment state.

[0115] In the embodiments described in this specification, the vehicle discharge current gradually increases from 0A according to a set slope, and the local AC bus voltage is gradually established.

[0116] S616: Discharge operation status.

[0117] In the embodiments described in this specification, once the local bus voltage and frequency reach the set values ​​and remain stable, the system completes the discharge establishment and enters stable discharge operation.

[0118] S617: Determine whether the power grid has returned to stability; if it has not returned to stability, proceed to S616.

[0119] In the embodiments described in this specification, when the system is in a vehicle discharge state, the main controller MCU continuously monitors the recovery status of the external power grid.

[0120] S618: Restored to normal charging status.

[0121] In the embodiments of this specification, after confirming the recovery of external AC input through hardware continuity detection circuit and waveform sampling analysis circuit, and after the voltage amplitude, frequency, and zero-crossing cycle meet the normal conditions within a preset stable time, the power grid can resume normal charging state.

[0122] S619: Re-execute charging communication negotiation.

[0123] In the embodiments described in this specification, charging communication negotiation is re-performed with the vehicle BMS.

[0124] S620: Restore guidance to charging state.

[0125] In the embodiments described in this specification, the guiding resistor is switched to the charging state; S621: Disconnect the discharge path.

[0126] In the embodiments described in this specification, the discharge contactor is disconnected or the bidirectional power conversion module is turned off.

[0127] S622: Stop discharge request.

[0128] In the embodiments described in this specification, a stop discharge request is sent to the vehicle BMS, and the vehicle-side discharge current is waited for to drop below a safe threshold.

[0129] S623: Safe wait / exit.

[0130] In the embodiments described in this specification, if the vehicle does not allow discharge and the negotiation fails, the system does not enter the discharge establishment state, but remains in a safe waiting state, and the emergency power supply module continues to maintain the necessary control and communication functions, or it safely exits after the preset waiting time is reached.

[0131] In one exemplary implementation, such as Figure 7 As shown, Figure 7 A timing diagram illustrating power switching and restoration provided for embodiments of this specification includes: The diagram, from top to bottom, shows the changes in external grid voltage, hardware continuity detection signal (i.e., grid continuity information), waveform sampling and analysis signal (i.e., power quality information), backup bootstrap power supply status (i.e., the status of the emergency power supply module), charging contactor K1 status, pilot resistor status, CAN communication negotiation status, discharge contactor K2 status, and vehicle discharge current. The entire timeline can be divided into the grid normalization phase, power failure detection and bootstrap phase, discharge establishment phase, islanding discharge phase, grid recovery confirmation phase, and charging recovery phase.

[0132] I. Normal Power Grid Phase Before time t0, the external power grid is in a normal power supply state, and the amplitude, frequency, and zero-crossing period of the external power grid voltage are all within the preset normal range. The hardware continuity detection circuit does not detect power failure, loss of zero crossing, or interruption of power supply cycle, so its fault detection signal remains in an untriggered state; the voltage amplitude, frequency offset, and period change collected by the waveform sampling and analysis circuit do not exceed the abnormal threshold, and its analysis results also remain in a normal state.

[0133] At this time, the V2G charging station is powered normally by the external power grid. The backup bootstrap power supply module (i.e., emergency power supply module) is in standby or energy storage mode and does not undertake the power supply task of the main control system. The charging contactor K1 is in the closed state, making the charging path between the external power grid and the bidirectional power conversion module conductive. The guide resistor switching module remains in the charging state, enabling the vehicle to recognize the currently connected device as a charging device. The vehicle and the V2G charging station handshake or maintain connection according to the charging communication process. The discharge contactor K2 is in the open state, the vehicle discharge path is not established, and the vehicle outputs a discharge current of 0A.

[0134] II. Power Grid Loss Detection and Abnormal Triggering at Time t0 At time t0, if the external power grid experiences a power outage, a continuous voltage drop, or other abnormality that meets the criteria for power failure, the external power grid voltage will rapidly drop from its normal value to a power failure state or fall below the set effective power supply threshold.

[0135] The hardware continuity detection circuit first rapidly outputs grid continuity information, including hardware anomaly detection signals, based on the continuity status of the AC input, loss of zero-crossing signals, missing half-cycle cycles, or abnormalities in multiple consecutive power supply cycles. Simultaneously, the waveform sampling and analysis circuit calculates the voltage amplitude, frequency, zero-crossing cycle, and voltage change trend of the external grid based on ADC sampling data or data output from the metering chip, and outputs the grid anomaly analysis results, i.e., power quality information.

[0136] After receiving the hardware continuity detection signal and waveform sampling analysis signal, the main controller MCU cross-confirms the two detection results. When both results meet the power failure judgment condition, or when one of the detection results remains abnormal and reaches a preset time threshold, the main controller MCU confirms that the external power grid can no longer serve as a reliable power source, and the system transitions from normal charging state to power failure bootstrapping state.

[0137] III. Establishment of Backup Power Supply Upon confirming an external power grid anomaly, the main controller MCU activates the backup bootstrap power supply module. This module outputs a stable low-voltage power supply suitable for the main control system via a DC-DC regulator circuit, powering the MCU, pilot resistor switching module, CAN communication module (vehicle communication module), and contactor drive module. The backup bootstrap power supply module is not used to directly supply power to local loads or the microgrid. Its function is to maintain the control link of the V2G charging pile during the short time window between external power grid failure and successful vehicle discharge, enabling the charging pile to continue performing necessary actions such as electrical isolation, pilot resistor state switching, vehicle communication negotiation, and contactor control. With the backup bootstrap power supply activated, even if the external 220V AC input is lost, the MCU and related control circuits can still operate normally, preventing the vehicle from failing to automatically enter discharge mode due to a power failure in the main controller.

[0138] IV. Charging contactor K1 is disconnected. After time t0, the main controller MCU first sends a disconnect command to the drive circuit of charging contactor K1. Charging contactor K1 switches from a closed state to an open state, cutting off the electrical connection between the V2G charging pile and the abnormal external power grid. The main controller MCU can also confirm whether K1 has reliably disconnected via feedback signals from the auxiliary contacts of K1. Only after confirming that the charging path is disconnected is the system allowed to continue executing the pilot resistor switching and vehicle discharge negotiation. This sequence prevents the vehicle from feeding power back into the faulty power grid after it begins discharging, avoids the formation of abnormal circulating current due to simultaneous conduction of the charging and discharging paths, and reduces the impact on the vehicle and charging pile power devices during external power grid voltage fluctuations, recovery, or short-circuit faults.

[0139] 5. The guiding resistor switches from charging state to discharging state. After the charging contactor K1 disconnects and confirms that the abnormal power grid has been isolated, the main controller MCU controls the guide resistor switching module to switch the guide circuit from the charging guide resistor branch to the discharging guide resistor branch. Before time t0, the guide resistor is in the charging state; after time t0, it switches to the discharging state. The vehicle identifies that the charging pile has switched from a charging request state to a vehicle discharging request state by detecting the resistance value, voltage status, or corresponding control guide signals in the guide circuit. After the guide resistor state switch is completed, the discharge power path is not immediately connected. At this time, it only indicates that the charging pile has sent physical layer identification information of the discharge mode to the vehicle. Whether the vehicle can discharge still needs to be negotiated and confirmed by subsequent CAN communication.

[0140] VI. CAN communication negotiation during t0 to t1 After the guide resistor switches to the discharge state, the main controller MCU establishes a discharge communication process with the vehicle BMS via the CAN communication module. During the period from t0 to t1, the system is in the discharge negotiation phase. During this phase, the V2G charging pile can send information such as discharge request, target bus voltage, allowable power range, maximum allowable current, and emergency power supply status to the vehicle BMS; the vehicle BMS, in turn, returns information such as vehicle SOC, power battery voltage, allowable discharge current, allowable discharge power, minimum allowable SOC, power battery temperature, insulation status, and vehicle fault status to the charging pile. The main controller MCU determines whether the vehicle meets the external discharge conditions based on the information returned by the vehicle BMS. Allowable discharge conditions may include: vehicle SOC higher than the set minimum discharge SOC; no overvoltage, undervoltage, overtemperature, insulation abnormality, or other discharge-prohibiting faults in the vehicle's power battery; the allowable discharge voltage and power of the vehicle matching the requirements of the charging pile and local load; charging contactor K1 has been disconnected; the guide resistor has switched to the discharge state; the backup power supply voltage is within the normal range; and the discharge contactor K2 is currently in the disconnected state.

[0141] Before CAN negotiation is completed, the discharge contactor K2 remains open, and the vehicle discharge current remains 0A, thereby preventing the vehicle from directly outputting electrical energy when the discharge parameters, safety status, or contactor status are not confirmed.

[0142] VII. Discharge establishment at time t1 At time t1, the vehicle's BMS and the V2G charging station complete the discharge parameter negotiation, and the vehicle returns confirmation information allowing discharge. After the main controller MCU confirms that the status of the guiding resistor, the vehicle's permitted status, the charging path isolation status, and the bidirectional power conversion module status all meet preset conditions, it controls the discharge contactor K2 to close and initiates the inverter or off-grid output function of the bidirectional power conversion module. After the discharge contactor K2 closes, the discharge path between the vehicle's power battery and the bidirectional power conversion module is established. The bidirectional power conversion module converts the DC power output from the vehicle battery into AC power required by the local AC bus or microgrid load. The vehicle's discharge current does not reach the target value instantaneously, but gradually increases according to a preset current rise slope. By limiting the current rise rate, DC bus surge, contactor contact surge, and local AC bus voltage fluctuations can be reduced. Therefore, time t1 represents the moment when the vehicle discharge protocol negotiation is completed, the discharge contactor K2 closes, and the vehicle discharge process begins.

[0143] 8. Island discharge operation during t1 to t2 During the period from t1 to t2, the external power grid remains de-energized. Charging contactor K1 remains open, the guiding resistor remains in a discharging state, the CAN communication module continues to communicate with the vehicle's BMS, and discharging contactor K2 remains closed. After the vehicle's discharge current rises to the target value and remains relatively stable, the vehicle continuously supplies power to the local AC bus or microgrid loads through the bidirectional power conversion module. At this time, the system enters islanded operation. During islanded operation, the main controller MCU can dynamically adjust the vehicle's discharge power according to the voltage, frequency, and load power of the local AC bus to keep the local bus voltage and frequency stable. At the same time, the MCU continuously monitors the vehicle's SOC, battery temperature, allowable discharge power, bidirectional power conversion module status, and contactor status.

[0144] When the vehicle's State of Charge (SOC) drops to the minimum allowable value, the vehicle experiences a discharge prohibition fault, the local load exceeds the allowable range, or the bidirectional power conversion module malfunctions, the main controller MCU can execute the discharge stop procedure in advance to protect the vehicle's power battery and the V2G charging station. After the vehicle discharge is successfully established, the backup bootstrap power supply module can continue to supply power, or it can be taken over by the main controller power supply from the vehicle's output side via the auxiliary power conversion path, causing the backup bootstrap power supply module to exit or enter the charging state.

[0145] IX. Power Grid Restoration Detection at Time t2 At time t2, the external grid voltage begins to recover. However, when the grid is first restored, there may be voltage oscillations, frequency drift, zero-crossing period instability, or short-term repeated drops. Therefore, the system cannot immediately stop vehicle discharge upon detecting voltage recovery. The hardware continuity detection circuit first detects the reappearance of the external AC input; the waveform sampling and analysis circuit continues to analyze the recovered voltage amplitude, frequency, zero-crossing period, and waveform stability. t2 to t3 constitute the grid recovery stabilization confirmation time window. Within this time window, the charging contactor K1 remains open, the guiding resistor remains in a discharging state, the discharging contactor K2 remains closed, and the vehicle continues to supply power to the local load. Only when the external grid voltage remains within the normal amplitude range, the frequency is within the allowable range, the zero-crossing period is stable, and no voltage drop occurs again within a continuous preset time, does the main controller MCU confirm that the external grid has been stably restored. This recovery confirmation mechanism prevents the grid from frequently switching between charging and discharging states when power is repeatedly restored, momentarily restored, or the voltage is not yet stable.

[0146] 10. Preparations for stopping discharge during t2 to t3 Once the MCU confirms that the external power grid has been restored and entered the stable confirmation phase, the main controller MCU sends a stop-discharge request to the vehicle BMS via CAN communication. Upon receiving the stop-discharge request, the vehicle BMS gradually reduces the output current of the power battery. The bidirectional power conversion module also reduces its output power according to a preset slope, causing the vehicle's discharge current to gradually decrease from its normal discharge value. During the current reduction process, the discharge contactor K2 remains closed to avoid arcing, contact burning, or contactor sticking caused by directly disconnecting the discharge contactor under high current conditions. When the vehicle's discharge current drops below the set safe disconnection threshold, or after the vehicle BMS provides feedback allowing the discharge circuit to be disconnected, the MCU enters the discharge path disconnection phase.

[0147] XI. Discharge Stoppage and Charge Resumption at Time t3 At time t3, the vehicle's discharge current has decreased to near 0A or below the safe disconnection threshold. The main controller MCU controls the discharge contactor K2 to open, disconnecting the discharge path between the vehicle's power battery and the bidirectional power conversion module. After confirming that the discharge contactor K2 has reliably opened, the main controller MCU controls the pilot resistor switching module to return from the discharge state to the charging state, allowing the vehicle to re-identify the charging request status. Subsequently, the main controller MCU re-executes the charging communication handshake with the vehicle's BMS to confirm the vehicle's allowed charging, charging power range, and vehicle battery status. Only after the external power grid remains stable, the discharge path has been disconnected, the pilot resistor has returned to the charging state, and the charging communication negotiation is successful, does the main controller MCU control the charging contactor K1 to close, restoring the charging path between the external power grid and the bidirectional power conversion module.

[0148] At this point, the system has returned from islanded discharge operation to normal charging. The backup bootstrap power supply module has withdrawn from emergency power supply, and power is replenished by the external power grid or main / auxiliary power supply, preparing for the next abnormal switchover.

[0149] By using the above timing sequence, it is ensured that the charging path and the discharging path will not be closed at the same time, that the vehicle will only start discharging after the state of the guide resistor and the CAN communication negotiation are completed, and that the vehicle's discharge current will be reduced to a safe range after the power grid is restored before the discharge path is disconnected, thereby improving the safety, reliability and protocol consistency of the V2G charging and discharging self-switching process.

[0150] This manual also provides the control device for the V2G charging station, such as... Figure 8 As shown, the device includes: The acquisition module 801 is used to acquire the grid connection and disconnection information of the V2G charging pile detected by the grid connection and disconnection status detection module, and the power quality information of the grid detected by the power quality detection module; the grid connection and disconnection information is the connection and disconnection information of the grid connected to the V2G charging pile. The power supply status determination module 802 is used to determine the power supply status of the control system based on the power grid on / off information and the power quality information. The emergency power supply module activation module 803 is used to activate the emergency power supply module when the power supply status is a power failure state, so that the emergency power supply module can supply power to the V2G charging pile. The disconnect module 804 is used to control the disconnection of the charging circuit between the power grid and the V2G charging pile, and to send a discharge command to the guide resistor switching module to switch the guide resistor to the discharge state. The communication status acquisition module 805 is used to acquire the communication status between the V2G charging pile and the vehicle connected to the V2G charging pile. The power supply module 806 is used to control the closing of the charging circuit between the vehicle and the V2G charging pile if the communication status indicates that the V2G charging pile is in communication connection with the vehicle, so that the vehicle supplies power to the power grid.

[0151] The apparatus and method embodiments described herein are based on the same inventive concept.

[0152] This specification provides an electronic device including a processor and a memory. The memory stores at least one instruction or at least one program, which is loaded and executed by the processor to implement the V2G charging pile control method provided in the above method embodiments.

[0153] The embodiments of this application also provide a computer storage medium, which can be disposed in a terminal to store at least one instruction or at least one program related to implementing a V2G charging pile control method in the method embodiments. The at least one instruction or at least one program is loaded and executed by the processor to implement the V2G charging pile control method provided in the above method embodiments.

[0154] Embodiments of this application also provide a computer program product or computer program, which includes computer instructions stored in a computer-readable storage medium. A processor of a computer device reads the computer instructions from the computer-readable storage medium and executes the computer instructions, causing the computer device to perform the control method for the V2G charging pile provided in the above-described method embodiments.

[0155] The memory described in the embodiments of this specification can be used to store software programs and modules. The processor executes various functional applications and data processing by running the software programs and modules stored in the memory. The memory may mainly include a program storage area and a data storage area. The program storage area may store the operating system, application programs required for the functions, etc.; the data storage area may store data created according to the use of the device, etc. In addition, the memory may include high-speed random access memory, and may also include non-volatile memory, such as at least one disk storage device, flash memory device, or other volatile solid-state storage device. Accordingly, the memory may also include a memory controller to provide the processor with access to the memory.

[0156] The V2G charging pile control method embodiments provided in this specification can be executed on a mobile terminal, computer terminal, server, or similar computing device. Taking running on a server as an example, Figure 9 This is a hardware structure block diagram of a server for a V2G charging pile control method provided in the embodiments of this specification. Figure 9 As shown, the server 900 can vary significantly due to different configurations or performance. It may include one or more Central Processing Units (CPUs) 910 (CPUs 910 may include, but are not limited to, microprocessors such as MCUs or programmable logic devices such as FPGAs), a memory 930 for storing data, and one or more storage media 920 (e.g., one or more mass storage devices) for storing application programs 923 or data 922. The memory 930 and storage media 920 may be temporary or persistent storage. The program stored in the storage media 920 may include one or more modules, each module may include a series of instruction operations on the server. Furthermore, the CPU 910 may be configured to communicate with the storage media 920 and execute the series of instruction operations stored in the storage media 920 on the server 900. Server 900 may also include one or more power supplies 960, one or more wired or wireless network interfaces 950, one or more input / output interfaces 940, and / or one or more operating systems 921, such as Windows Server™, Mac OS X™, Unix™, Linux™, FreeBSD™, etc.

[0157] The input / output interface 940 can be used to receive or send data via a network. Specific examples of the network described above may include a wireless network provided by the communication provider of server 900. In one example, the input / output interface 940 includes a network interface controller (NIC), which can connect to other network devices via a base station to communicate with the Internet. In another example, the input / output interface 940 may be a radio frequency (RF) module used for wireless communication with the Internet.

[0158] Those skilled in the art will understand that Figure 9 The structure shown is for illustrative purposes only and does not limit the structure of the aforementioned electronic device. For example, server 900 may also include... Figure 9 The more or fewer components shown, or having the same Figure 9 The different configurations shown.

[0159] As can be seen from the embodiments of the V2G charging pile control system and method provided in this application, this application includes a power grid on / off status detection module. The output terminal of the power grid on / off status detection module is connected to the first input terminal of the main controller, and is used to acquire the power grid on / off information of the V2G charging pile. The power grid on / off information is the on / off information of the power grid connected to the V2G charging pile. The power grid on / off information includes the voltage monitoring signal of the power grid. The voltage monitoring signal is determined by comparing the stepped-down DC voltage and a preset voltage threshold after stepping down and rectifying the AC voltage output by the power grid. A power quality detection module is also included, with its output terminal connected to the second input terminal of the main controller, for acquiring the power quality information of the power grid. A guide resistor switching module is also included, with its input terminal connected to the output terminal of the main controller. An emergency power supply module is also included, with its output terminal connected to the third input terminal of the main controller, for acquiring the power quality information of the power grid. In the event that the control system is in a power-off state, the main controller and the guide resistor switching module are supplied with power. The main controller, during the power supply process from the grid, when it detects that the voltage monitoring signal is high, the grid connection / disconnection information indicates a grid anomaly, and the power supply status of the control system is in a protocol pre-switching state, activates the emergency power supply module to provide backup power to the main controller. It also continuously acquires the grid connection / disconnection information and the power quality information. When it detects that both the grid connection / disconnection information and the power quality information indicate a grid failure, the power supply status is a power-off state, and the vehicle connected to the V2G charging pile is in communication connection with the main controller, it controls the charging circuit between the grid and the V2G charging pile to disconnect, sends a discharge command to the guide resistor switching module to switch the guide resistor to a discharge state, enabling the vehicle to supply power to the grid. When it detects that the power supply status is in a discharge establishment state, it controls the emergency power supply module to exit power supply. This application constructs a dual-path detection architecture including a grid connection / disconnection status detection module and a power quality detection module. One path employs a transformer, a full-bridge rectifier circuit, an analog switch CD4051B, and a voltage monitoring chip SGM809B to achieve eight switchable undervoltage thresholds. When the voltage falls below a preset threshold, it bypasses the main controller MCU and directly activates a supercapacitor to boost the power supply. The other path utilizes an energy metering chip RN8209D to synchronously acquire voltage, current, frequency, zero-crossing cycle, and instantaneous waveforms, identifying sags, frequency drift, zero-crossing loss, and continuous power outages. The main controller MCU integrates the results from both paths and enters disturbance observation, protocol pre-switching, power outage, and discharge setup states. It also completes pilot resistor switching, CAN negotiation, and contactor sequence control, improving V2G power failure response speed, anti-false triggering capability, and power supply safety.

[0160] It should be noted that the order of the embodiments described above is merely for descriptive purposes and does not represent the superiority or inferiority of the embodiments. Furthermore, specific embodiments of this specification have been described above. Other embodiments are within the scope of the appended claims. In some cases, the actions or steps recorded in the claims can be performed in a different order than that shown in the embodiments and still achieve the desired result. Additionally, the processes depicted in the drawings do not necessarily require a specific or sequential order to achieve the desired result. In some embodiments, multitasking and parallel processing are also possible or may be advantageous.

[0161] The various embodiments in this specification are described in a progressive manner. Similar or identical parts between embodiments can be referred to mutually. Each embodiment focuses on describing the differences from other embodiments. In particular, the embodiments of apparatus, devices, and storage media are basically similar to the method embodiments, so the descriptions are relatively simple; relevant parts can be referred to the descriptions of the method embodiments.

[0162] Those skilled in the art will understand that all or part of the steps of the above embodiments can be implemented by hardware or by a program instructing related hardware. The program can be stored in a computer storage medium, such as a read-only memory, a disk, or an optical disk.

[0163] The above description is only a preferred embodiment of this application and is not intended to limit this application. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of this application should be included within the protection scope of this application.

Claims

1. A control system for a V2G charging pile, characterized in that, include: A power grid on / off status detection module is provided, the output of which is connected to the first input of the main controller. This module is used to acquire power grid on / off information for the V2G charging pile. The power grid on / off information includes the voltage monitoring signal of the power grid. The voltage monitoring signal is determined by comparing the stepped-down DC voltage (output from the power grid by reducing and rectifying it) with a preset voltage threshold. A power quality detection module, the output of which is connected to the second input of the main controller, is used to acquire power quality information of the power grid; A guide resistor switching module, wherein the input terminal of the guide resistor switching module is connected to the output terminal of the main controller; An emergency power supply module, the output of which is connected to the third input of the main controller, is used to supply power to the main controller and the guide resistor switching module when the control system is in a power failure state; The main controller is used to activate the emergency power supply module when the voltage monitoring signal is identified as high level, the power grid on / off information indicates that the power grid is abnormal, the power supply status of the control system is in protocol pre-switching state, and the power supply status of the control system is in protocol pre-switching state during the power supply process of the power grid. To enable the main controller to obtain backup power; And continuously acquire the grid on / off information and the power quality information; When the grid connection / disconnection information and the power quality information both indicate a grid failure, the power supply status is a power outage, and the vehicle connected to the V2G charging pile is in communication connection with the main controller, the charging circuit between the grid and the V2G charging pile is disconnected, and a discharge command is sent to the guide resistor switching module to switch the guide resistor to a discharge state; so that the vehicle supplies power to the grid; and when the power supply status is identified as a discharge establishment state, the emergency power supply module is controlled to disconnect from power supply.

2. The control system according to claim 1, characterized in that, The power grid on / off information includes at least the zero-crossing cycle of the power grid and the voltage monitoring signal of the power grid; The power grid on / off status detection module includes: A step-down rectifier unit, wherein the input terminal of the step-down rectifier unit is connected to the output terminal of the power grid, and the step-down rectifier unit is used to step down and rectify the AC voltage output by the power grid to output the stepped-down DC voltage; A zero-crossing detection unit is provided, the input of which is connected to the first output of the buck rectifier unit; the zero-crossing detection unit is used to identify the zero-crossing cycle of the power grid based on the bucked DC voltage. A voltage detection unit is provided, the input of which is connected to the second output of the step-down rectifier unit. The voltage detection unit is used to compare the stepped-down DC voltage with the preset voltage threshold to obtain and output the voltage monitoring signal.

3. The control system according to claim 2, characterized in that, The step-down rectifier unit includes: A transformer; the input terminal of the transformer is connected to the output terminal of the power grid; the transformer is used to reduce the AC voltage output by the power grid to obtain a stepped-down AC voltage; A full-bridge rectifier circuit; the input terminal of the full-bridge rectifier circuit is connected to the output terminal of the transformer; the first output terminal of the full-bridge rectifier circuit is connected to the input terminal of the zero-crossing detection unit; the second output terminal of the full-bridge rectifier circuit is connected to the input terminal of the voltage detection unit; the full-bridge rectifier circuit is used to rectify the stepped-down AC voltage into the stepped-down DC voltage.

4. The control system according to claim 3, characterized in that, The voltage detection unit includes: A voltage threshold adjustment circuit is provided, the output of which is connected to the second output of the step-down rectifier unit; the voltage threshold adjustment circuit is used to divide the stepped-down DC voltage to obtain the divided voltage. A voltage monitoring circuit is provided, the input of which is connected to the output of the voltage threshold adjustment circuit. The voltage monitoring circuit is used to adjust the output level of the voltage monitoring signal based on the comparison result between the voltage after voltage division and the preset voltage threshold.

5. The control system according to claim 4, characterized in that, The voltage monitoring circuit includes: A voltage monitoring chip, the input terminal of which is connected to the output terminal of the voltage threshold adjustment circuit; the voltage monitoring chip is used to adjust the output level of the reset pin according to the voltage value comparison result; An optocoupler is provided, the input of which is connected to the output of the voltage monitoring chip; the optocoupler is used to adjust the output level of the voltage monitoring signal according to the output level of the reset pin.

6. The control system according to claim 5, characterized in that, The power quality detection module includes: A voltage divider sampling network is used to divide the AC voltage output by the power grid to obtain a voltage divider voltage. The input terminal of the voltage divider sampling network is connected to the live wire of the power grid. Shunt; the input terminal of the shunt is connected to the neutral wire of the power grid; the shunt is used to generate a differential voltage based on the current output by the power grid; An energy metering chip; the energy metering chip is connected to the shunt and the voltage divider sampling network respectively; the energy metering chip is used to determine the energy quality information based on the voltage divider voltage and the differential voltage.

7. The control system according to claim 6, characterized in that, The emergency power supply module includes: A supercapacitor, wherein the input terminal of the supercapacitor is connected to the output terminal of the supercapacitor boost circuit; The supercapacitor boost circuit has its input terminal connected to the output terminal of the optocoupler; the supercapacitor boost circuit is used to control the supercapacitor to switch between a startup state and a standby state according to the voltage monitoring signal.

8. The control system according to claim 7, characterized in that, The control system also includes a vehicle communication module; The first input terminal of the vehicle communication module is connected to the output terminal of the main controller; the second input terminal of the vehicle communication module is connected to the output terminal of the vehicle; the vehicle communication module is used to control the communication connection between the main controller and the vehicle when the guiding resistor switches to the discharge state.

9. The control system according to claim 8, characterized in that, The control system also includes a contactor drive module, a charging contactor, and a discharging contactor; The input terminal of the contactor drive module is connected to the output terminal of the main controller; the first output terminal of the contactor drive module is connected to one side of the charging contactor. The other side of the charging contactor is connected to the power grid; the second output terminal of the contactor drive module is connected to one side of the discharging contactor. The other side of the discharge contactor is connected to the vehicle; the contactor drive module is used to control the charging contactor to open when the power supply state is in a power-off state; and to control the discharge contactor to close when the power supply state is in a discharge establishment state.

10. A control method for a V2G charging pile, characterized in that, The method, applied to the control system of the V2G charging pile as described in any one of claims 1-9, comprises: The system acquires grid connection / disconnection information of the V2G charging pile detected by the grid connection / disconnection status detection module, and power quality information of the grid detected by the power quality detection module; the grid connection / disconnection information refers to the connection / disconnection information of the grid connected to the V2G charging pile. The power supply status of the control system is determined based on the power grid on / off information and the power quality information. When the power supply is in a power failure state, the emergency power supply module is activated to supply power to the V2G charging pile. The charging circuit between the power grid and the V2G charging pile is disconnected, and a discharge command is sent to the guide resistor switching module to switch the guide resistor to the discharge state; Obtain the communication status between the V2G charging pile and the vehicle connected to the V2G charging pile; If the communication status indicates that the V2G charging pile is in communication connection with the vehicle, the charging circuit between the vehicle and the V2G charging pile is closed to enable the vehicle to supply power to the power grid.