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 (S1), a first low-side switch (S2), a second high-side switch (S4), a second low-side switch (S3) and an inductor 411, wherein: the first high-side switch (S1) and the first low-side switch (S2) 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 (S4) and the second low-side switch (S3) are connected in series between the first input/output terminal and the second input/output terminal ; and the inductor (L1) is coupled between the common node of the first high-side switch S 1 and the first low-side switch (S2), and the common node of the second high-side switch (S4) and the second low-side switch (S3); 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 (S1), the first low-side switch (S2), the second high-side switch (S4) and the second low-side switch (S3). 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 (S1), a first low-side switch (S2), a second high-side switch (S4), a second low-side switch (S3) and an inductor 411, wherein: the first high-side switch (S1) and the first low-side switch (S2) 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 (S4) and the second low-side switch (S3) are connected in series between the first input/output terminal and the second input/output terminal ; and the inductor (L1) is coupled between the common node of the first high-side switch S 1 and the first low-side switch (S2), and the common node of the second high-side switch (S4) and the second low-side switch (S3); the first high-side switch (S1) and the first low-side switch (S2) 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 (S4) and the second low-side switch (S3) are connected in series between the first input/output terminal and the second input/output terminal ; and the inductor (L1) is coupled between the common node of the first high-side switch S 1 and the first low-side switch (S2), and the common node of the second high-side switch (S4) and the second low-side switch (S3); 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 (S1), the first low-side switch (S2), the second high-side switch (S4) and the second low-side switch (S3). <EOS>