A power adapter, comprising: a first rectifier circuit, configured to rectify an input alternating current and output a voltage with a first pulsating waveform; a switch unit, configured to modulate the voltage with the first pulsating waveform according to a control signal; a transformer, configured to output a voltage with a second pulsating waveform according to the modulated voltage with the first pulsating waveform; a second rectification unit, configured to rectify the voltage with the second pulsating waveform to output a voltage with a third pulsating waveform; a first charging interface, coupled to the second rectification unit, configured to apply the voltage with the third pulsating waveform to a battery in a device via a second charging interface of the device when the first charging interface is coupled to the second charging interface, in which the second charging interface is coupled to the battery; a sampling unit configured to sample a voltage and/or a current outputted by the second rectification unit so as to obtain a voltage sampling value and/or a current sampling value; and a control unit, coupled to the switch unit, and configured to output the control signal to the switch unit and to adjust a duty ratio of the control signal according to the current sampling value and/or the voltage sampling value, such that the voltage with the third pulsating waveform meets a charging requirement of the device, and the control unit is further configured to, during a process that the power adaptor charges the battery by outputting the voltage with the third pulsating waveform to the battery, adjust the duty ratio of the control signal to decrease a length of a valley of the voltage with the third pulsating waveform, such that a voltage difference between a voltage peak and a valley point voltage is reduced, thereby decreasing a fluctuation value of the voltage of the battery and contributing to sampling the peak value of the voltage of the battery through the battery voltage sampling unit. a first rectifier circuit, configured to rectify an input alternating current and output a voltage with a first pulsating waveform; a switch unit, configured to modulate the voltage with the first pulsating waveform according to a control signal; a transformer, configured to output a voltage with a second pulsating waveform according to the modulated voltage with the first pulsating waveform; a second rectification unit, configured to rectify the voltage with the second pulsating waveform to output a voltage with a third pulsating waveform; a first charging interface, coupled to the second rectification unit, configured to apply the voltage with the third pulsating waveform to a battery in a device via a second charging interface of the device when the first charging interface is coupled to the second charging interface, in which the second charging interface is coupled to the battery; a sampling unit configured to sample a voltage and/or a current outputted by the second rectification unit so as to obtain a voltage sampling value and/or a current sampling value; and a control unit, coupled to the switch unit, and configured to output the control signal to the switch unit and to adjust a duty ratio of the control signal according to the current sampling value and/or the voltage sampling value, such that the voltage with the third pulsating waveform meets a charging requirement of the device, and the control unit is further configured to, during a process that the power adaptor charges the battery by outputting the voltage with the third pulsating waveform to the battery, adjust the duty ratio of the control signal to decrease a length of a valley of the voltage with the third pulsating waveform, such that a voltage difference between a voltage peak and a valley point voltage is reduced, thereby decreasing a fluctuation value of the voltage of the battery and contributing to sampling the peak value of the voltage of the battery through the battery voltage sampling unit.