An iris recognition method implemented in an electronic device, wherein the electronic device comprises an iris recognition module and a motion sensor, the iris recognition module comprises an infrared camera, and the method comprises: detecting motion information of the electronic device by the motion sensor, comprising: detecting acceleration data of the motion sensor at different times and recording the different times; where the motion sensor includes an acceleration sensor; calculating a time difference between an adjacent first acceleration and second acceleration, calculating absolute values of change of acceleration between the first acceleration and the second acceleration on an X, Y, Z axes of the electronic device; determining an average value for a rate of the change of acceleration based on the time difference and the absolute values in accordance to a formula: avg = delta x + delta y + delta z ⋅ C diff, where avg represents the average value for the rate of change of acceleration, delta x, delta y and delta z correspondingly represents the absolute values of change of acceleration on the X, Y, Z axes, diff represents the time difference, and C represents an amplification factor; and determining that a sudden acceleration change occurs when the average value is larger than a preset average threshold; when the number of the sudden acceleration changes during a time period is greater than a preset number of shakes, starting the infrared camera and capturing an image of a user by the infrared camera; and when determining that there is a face contour in the image, performing iris recognition by the iris recognition module. detecting motion information of the electronic device by the motion sensor, comprising: detecting acceleration data of the motion sensor at different times and recording the different times; where the motion sensor includes an acceleration sensor; calculating a time difference between an adjacent first acceleration and second acceleration, calculating absolute values of change of acceleration between the first acceleration and the second acceleration on an X, Y, Z axes of the electronic device; determining an average value for a rate of the change of acceleration based on the time difference and the absolute values in accordance to a formula: avg = delta x + delta y + delta z ⋅ C diff, where avg represents the average value for the rate of change of acceleration, delta x, delta y and delta z correspondingly represents the absolute values of change of acceleration on the X, Y, Z axes, diff represents the time difference, and C represents an amplification factor; and determining that a sudden acceleration change occurs when the average value is larger than a preset average threshold; detecting acceleration data of the motion sensor at different times and recording the different times; where the motion sensor includes an acceleration sensor; calculating a time difference between an adjacent first acceleration and second acceleration, calculating absolute values of change of acceleration between the first acceleration and the second acceleration on an X, Y, Z axes of the electronic device; determining an average value for a rate of the change of acceleration based on the time difference and the absolute values in accordance to a formula: avg = delta x + delta y + delta z ⋅ C diff, where avg represents the average value for the rate of change of acceleration, delta x, delta y and delta z correspondingly represents the absolute values of change of acceleration on the X, Y, Z axes, diff represents the time difference, and C represents an amplification factor; and determining that a sudden acceleration change occurs when the average value is larger than a preset average threshold; when the number of the sudden acceleration changes during a time period is greater than a preset number of shakes, starting the infrared camera and capturing an image of a user by the infrared camera; and when determining that there is a face contour in the image, performing iris recognition by the iris recognition module.