An apparatus for controlling a solar power system, comprising: a solar panel and a capacitor connected in series; a buck-boost converter having a first input/output terminal connected to one terminal of the capacitor, a second input/output terminal connected to a common node of one terminal of the solar panel and another terminal of the capacitor, and a third input/output terminal connected to another terminal of the solar panel, wherein the buck-boost converter comprises a first high-side switch, a first low-side switch, a second high-side switch, a second low-side switch and an inductor 411, wherein: the first high-side switch and the first low-side switch are connected in series between the second input/output terminal and the third input/output terminal of the buck-boost converter; the second high-side switch and the second low-side switch are connected in series between the first input/output terminal and the second input/output terminal; and the inductor is coupled between the common node of the first high-side switch S 1 and the first low-side switch, and the common node of the second high-side switch and the second low-side switch; wherein the buck-boost converter further comprises a pulse width modulation controller that is configured to detect the output voltage of the solar panel and the current flowing through the solar panel, and to generate a plurality of gate drive signals for driving the first high-side switch, the first low-side switch, the second high-side switch and the second low-side switch. a solar panel and a capacitor connected in series; a buck-boost converter having a first input/output terminal connected to one terminal of the capacitor, a second input/output terminal connected to a common node of one terminal of the solar panel and another terminal of the capacitor, and a third input/output terminal connected to another terminal of the solar panel, wherein the buck-boost converter comprises a first high-side switch, a first low-side switch, a second high-side switch, a second low-side switch and an inductor 411, wherein: the first high-side switch and the first low-side switch are connected in series between the second input/output terminal and the third input/output terminal of the buck-boost converter; the second high-side switch and the second low-side switch are connected in series between the first input/output terminal and the second input/output terminal; and the inductor is coupled between the common node of the first high-side switch S 1 and the first low-side switch, and the common node of the second high-side switch and the second low-side switch; the first high-side switch and the first low-side switch are connected in series between the second input/output terminal and the third input/output terminal of the buck-boost converter; the second high-side switch and the second low-side switch are connected in series between the first input/output terminal and the second input/output terminal; and the inductor is coupled between the common node of the first high-side switch S 1 and the first low-side switch, and the common node of the second high-side switch and the second low-side switch; wherein the buck-boost converter further comprises a pulse width modulation controller that is configured to detect the output voltage of the solar panel and the current flowing through the solar panel, and to generate a plurality of gate drive signals for driving the first high-side switch, the first low-side switch, the second high-side switch and the second low-side switch.