The invention discloses a battery charging and discharging method and
system suitable for a lamp. The method comprises the steps that the geographic position of the lamp and
electricity price information are acquired according to
longitude and
latitude; a target
electricity price time period is predicted through the day-ahead
electricity price of the place where the lamp is located, whether the current lamp is in the target
electricity price time period or not is judged, and a corresponding charging and discharging strategy is executed, and the target
electricity price time period is the current day lowest
electricity price time period; according to the real-time electricity price and the
actual use condition of the lamp, the strategy of mains supply and battery discharging is dynamically adjusted to optimize the charging and discharging strategy; the maximum
energy storage threshold value of the battery and the remaining capacity of the battery are obtained, the required charging amount is calculated, the charging duration is calculated according to the required charging amount, and charging is carried out according to the charging duration matched with the target electricity price period, so that the problems of short supply of power in the peak
power consumption period and great surplus of power in the valley
power consumption period are solved; the time period with the lowest electricity price is intelligently selected for commercial power supply or charging, and the electricity utilization cost is reduced.