A method for detecting a melody of an audio signal, comprising dividing (S 1) the audio signal into a plurality of audio segments based on a beat; detecting a pitch frequency of each frame of audio sub-signal in each of the audio segments, and estimating a pitch value of each of the audio segments based on the pitch frequency; determining a pitch name corresponding to each of the audio segments based on a frequency range of the pitch value; acquiring a musical scale of the audio signal by estimating a tonality of the audio signal based on the pitch name of each of the audio segments; and determining a melody of the audio signal based on a frequency interval of the pitch value of each of the audio segments in the musical scale; characterised in that, prior to the step of dividing the audio signal into the plurality of audio segments based on the beat, the method further comprises: performing Short-Time Fourier Transform, STFT, on the audio signal, wherein the audio signal is a humming or cappella audio signal; acquiring a pitch frequency by pitch frequency detection on a result of the STFT, wherein the pitch frequency is configured to detect the pitch value; inputting an interpolation frequency at a signal position corresponding to each frame of audio sub-signal in response to detecting no pitch frequency; and determining the interpolation frequency corresponding to the frame as the pitch frequency of the audio signal. dividing (S 1) the audio signal into a plurality of audio segments based on a beat; detecting a pitch frequency of each frame of audio sub-signal in each of the audio segments, and estimating a pitch value of each of the audio segments based on the pitch frequency; determining a pitch name corresponding to each of the audio segments based on a frequency range of the pitch value; acquiring a musical scale of the audio signal by estimating a tonality of the audio signal based on the pitch name of each of the audio segments; and determining a melody of the audio signal based on a frequency interval of the pitch value of each of the audio segments in the musical scale; characterised in that, prior to the step of dividing the audio signal into the plurality of audio segments based on the beat, the method further comprises: performing Short-Time Fourier Transform, STFT, on the audio signal, wherein the audio signal is a humming or cappella audio signal; acquiring a pitch frequency by pitch frequency detection on a result of the STFT, wherein the pitch frequency is configured to detect the pitch value; inputting an interpolation frequency at a signal position corresponding to each frame of audio sub-signal in response to detecting no pitch frequency; and determining the interpolation frequency corresponding to the frame as the pitch frequency of the audio signal. performing Short-Time Fourier Transform, STFT, on the audio signal, wherein the audio signal is a humming or cappella audio signal; acquiring a pitch frequency by pitch frequency detection on a result of the STFT, wherein the pitch frequency is configured to detect the pitch value; inputting an interpolation frequency at a signal position corresponding to each frame of audio sub-signal in response to detecting no pitch frequency; and determining the interpolation frequency corresponding to the frame as the pitch frequency of the audio signal.