An electronic device for recognizing a real face, comprising: a face image acquisition device , configured to acquire a plurality of face images of a face at a plurality of focal lengths within a first focal length range, wherein the plurality of face images corresponds to a plurality of focus planes respectively; characterized in that the electronic device further comprises a processor connected to the face image acquisition device and configured to: determine whether a region of the face of which a definition is higher than a second preset threshold value exists in the focus plane in each of the plurality of face images: when it is determined that at least one of the plurality of face images has a region of which a definition is higher than the second preset threshold value, acquire a focal length corresponding to the at least one of the plurality of face images; form a second focal length range with the acquired focal lengths, wherein the second focal length range is a range from a focal length minimum value to focal length maximum value in the at least one face image, the second focal length range is smaller than the first focal length range, and the second focal length range is capable of making a face image sharp; determine whether the second focal length range is larger than a preset range; and when it is determined that the second focal length range is larger than or equal to the preset range, determine that the face is the real face. a face image acquisition device , configured to acquire a plurality of face images of a face at a plurality of focal lengths within a first focal length range, wherein the plurality of face images corresponds to a plurality of focus planes respectively; characterized in that the electronic device further comprises a processor connected to the face image acquisition device and configured to: determine whether a region of the face of which a definition is higher than a second preset threshold value exists in the focus plane in each of the plurality of face images: when it is determined that at least one of the plurality of face images has a region of which a definition is higher than the second preset threshold value, acquire a focal length corresponding to the at least one of the plurality of face images; form a second focal length range with the acquired focal lengths, wherein the second focal length range is a range from a focal length minimum value to focal length maximum value in the at least one face image, the second focal length range is smaller than the first focal length range, and the second focal length range is capable of making a face image sharp; determine whether the second focal length range is larger than a preset range; and when it is determined that the second focal length range is larger than or equal to the preset range, determine that the face is the real face. when it is determined that at least one of the plurality of face images has a region of which a definition is higher than the second preset threshold value, acquire a focal length corresponding to the at least one of the plurality of face images; form a second focal length range with the acquired focal lengths, wherein the second focal length range is a range from a focal length minimum value to focal length maximum value in the at least one face image, the second focal length range is smaller than the first focal length range, and the second focal length range is capable of making a face image sharp; determine whether the second focal length range is larger than a preset range; and when it is determined that the second focal length range is larger than or equal to the preset range, determine that the face is the real face. <EOS>