A method for measuring an intensity of ambient light at an electronic device, the electronic device comprising an ambient light sensor, configured to collect mixed light including ambient light and screen leakage light; and a screen, the screen being configured to be dimmed at a dimming frequency, the method comprising: collecting mixed light including the ambient light and screen leakage light using the ambient light sensor; obtaining a direct current, DC, mean value of the mixed light, including: converting the mixed light from a time domain into a frequency domain through a fast Fourier transform; and obtaining, from a waveform of the mixed light in the frequency domain, a frequency point amplitude corresponding to 0Hz of the mixed light and a frequency point amplitude corresponding to the dimming frequency of the mixed light; wherein the frequency point amplitude corresponding to the 0Hz of the mixed light is the DC mean value of the mixed light; obtaining a DC mean value of the screen leakage light according to the frequency point amplitude corresponding to the dimming frequency of the mixed light and at least one calibration parameter, wherein the frequency point amplitude corresponding to the dimming frequency of the mixed light is equal to a frequency point amplitude corresponding to the dimming frequency of the screen leakage light, and the DC mean value of the screen leakage light represents a frequency point amplitude corresponding to 0Hz of the screen leakage light; and determining a DC mean value of the ambient light by subtracting the DC mean value of the screen leakage light from the DC mean value of the mixed light; wherein the DC mean value of the ambient light is indicative of the intensity of the ambient light. collecting mixed light including the ambient light and screen leakage light using the ambient light sensor; obtaining a direct current, DC, mean value of the mixed light, including: converting the mixed light from a time domain into a frequency domain through a fast Fourier transform; and obtaining, from a waveform of the mixed light in the frequency domain, a frequency point amplitude corresponding to 0Hz of the mixed light and a frequency point amplitude corresponding to the dimming frequency of the mixed light; wherein the frequency point amplitude corresponding to the 0Hz of the mixed light is the DC mean value of the mixed light; obtaining a DC mean value of the screen leakage light according to the frequency point amplitude corresponding to the dimming frequency of the mixed light and at least one calibration parameter, wherein the frequency point amplitude corresponding to the dimming frequency of the mixed light is equal to a frequency point amplitude corresponding to the dimming frequency of the screen leakage light, and the DC mean value of the screen leakage light represents a frequency point amplitude corresponding to 0Hz of the screen leakage light; and determining a DC mean value of the ambient light by subtracting the DC mean value of the screen leakage light from the DC mean value of the mixed light; wherein the DC mean value of the ambient light is indicative of the intensity of the ambient light. converting the mixed light from a time domain into a frequency domain through a fast Fourier transform; and obtaining, from a waveform of the mixed light in the frequency domain, a frequency point amplitude corresponding to 0Hz of the mixed light and a frequency point amplitude corresponding to the dimming frequency of the mixed light; wherein the frequency point amplitude corresponding to the 0Hz of the mixed light is the DC mean value of the mixed light; obtaining a DC mean value of the screen leakage light according to the frequency point amplitude corresponding to the dimming frequency of the mixed light and at least one calibration parameter, wherein the frequency point amplitude corresponding to the dimming frequency of the mixed light is equal to a frequency point amplitude corresponding to the dimming frequency of the screen leakage light, and the DC mean value of the screen leakage light represents a frequency point amplitude corresponding to 0Hz of the screen leakage light; and determining a DC mean value of the ambient light by subtracting the DC mean value of the screen leakage light from the DC mean value of the mixed light; wherein the DC mean value of the ambient light is indicative of the intensity of the ambient light.