A method of battery charging, applied to a charging and discharging device, wherein the charging and discharging device comprises 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 method comprises:
- receiving 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,
- setting 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,
- acquiring a state of charge (SOC) of the battery of the energy storage unit,
- turning 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,
- acquiring a bus voltage of the charging and discharging device in real time, and
- adjust the output power of the second DC/DC converter to first output power of the second DC/DC converter under the condition that the battery is charged by the energy storage unit, 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, the first output power of the second DC/DC converter being less than or equal to the 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 after the output power of the second DC/DC converter is adjusted to the first output power of the second DC/DC converter.