A charging and discharging device, comprising an alternating current/direct current, AC/DC, converter, a first direct current/direct current, DC/DC, converter, a second DC/DC converter and a control unit, wherein one end of the second DC/DC converter is connected between the first DC/DC converter and the AC/DC converter and the other end of the second DC/DC converter is connected to an energy storage unit; and the control unit is configured to: receive a first charging request transmitted by a battery management system, BMS, of a battery, the first charging request comprising a first charging voltage and a first charging current, set output power of the first DC/DC converter as first output power of the first DC/DC converter based on the first charging voltage and the first charging current, acquire a state of charge of the battery of the energy storage unit, turn on the second DC/DC converter under the condition that the SOC of the energy storage unit is greater than a first threshold, to charge the battery by the energy storage unit through the first DC/DC converter and the second DC/DC converter, acquire a bus voltage of the charging and discharging device in real time, and adjust output power of the second DC/DC converter to the first output power of the second DC/DC converter under the condition that the bus voltage is less than a bus balance voltage and a difference between the bus voltage and the bus balance voltage exceeds a preset value in the process of charging the battery by the energy storage unit, the first output power of the second DC/DC converter being less than or equal to a maximum output power of the second DC/DC converter, wherein the difference between the bus voltage and the bus balance voltage is less than or equal to the preset value when the second DC/DC converter works on the basis of the first output power of the second DC/DC converter. receive a first charging request transmitted by a battery management system, BMS, of a battery, the first charging request comprising a first charging voltage and a first charging current, set output power of the first DC/DC converter as first output power of the first DC/DC converter based on the first charging voltage and the first charging current, acquire a state of charge of the battery of the energy storage unit, turn on the second DC/DC converter under the condition that the SOC of the energy storage unit is greater than a first threshold, to charge the battery by the energy storage unit through the first DC/DC converter and the second DC/DC converter, acquire a bus voltage of the charging and discharging device in real time, and adjust output power of the second DC/DC converter to the first output power of the second DC/DC converter under the condition that the bus voltage is less than a bus balance voltage and a difference between the bus voltage and the bus balance voltage exceeds a preset value in the process of charging the battery by the energy storage unit, the first output power of the second DC/DC converter being less than or equal to a maximum output power of the second DC/DC converter, wherein the difference between the bus voltage and the bus balance voltage is less than or equal to the preset value when the second DC/DC converter works on the basis of the first output power of the second DC/DC converter.