A method of preventing illegal attack on user identity authentication, comprising: when a user feature of a user is successfully identified, determining whether a living body detection result for the user feature indicates a failure or not; wherein the method further comprises: in a case where the living body detection result for the user feature indicates failure, when a feature ID of the user feature is not locked and a locking condition of the feature ID is satisfied currently, locking the feature ID, wherein when at least N living body detections performed continuously on the user feature corresponding to the feature ID fail, it is determined that the locking condition for locking the feature ID is satisfied, N being an integer greater than 1; and in a case where the living-body detection result for the user feature indicates success, when the feature ID of the user feature is locked and an unlocking condition of the locked feature ID is satisfied currently, unlocking the locked feature ID, wherein when at least M living body detections performed continuously on the user feature corresponding to the locked feature ID succeed, it is determined that the unlocking condition for unlocking the feature ID is satisfied, M being an integer greater than 1; and when the feature ID of the user feature is not locked, determining that the user feature passes the identity authentication, wherein each user feature has a unique feature ID. when a user feature of a user is successfully identified, determining whether a living body detection result for the user feature indicates a failure or not; wherein the method further comprises: in a case where the living body detection result for the user feature indicates failure, when a feature ID of the user feature is not locked and a locking condition of the feature ID is satisfied currently, locking the feature ID, wherein when at least N living body detections performed continuously on the user feature corresponding to the feature ID fail, it is determined that the locking condition for locking the feature ID is satisfied, N being an integer greater than 1; and in a case where the living-body detection result for the user feature indicates success, when the feature ID of the user feature is locked and an unlocking condition of the locked feature ID is satisfied currently, unlocking the locked feature ID, wherein when at least M living body detections performed continuously on the user feature corresponding to the locked feature ID succeed, it is determined that the unlocking condition for unlocking the feature ID is satisfied, M being an integer greater than 1; and when the feature ID of the user feature is not locked, determining that the user feature passes the identity authentication, wherein each user feature has a unique feature ID. in a case where the living body detection result for the user feature indicates failure, when a feature ID of the user feature is not locked and a locking condition of the feature ID is satisfied currently, locking the feature ID, wherein when at least N living body detections performed continuously on the user feature corresponding to the feature ID fail, it is determined that the locking condition for locking the feature ID is satisfied, N being an integer greater than 1; and in a case where the living-body detection result for the user feature indicates success, when the feature ID of the user feature is locked and an unlocking condition of the locked feature ID is satisfied currently, unlocking the locked feature ID, wherein when at least M living body detections performed continuously on the user feature corresponding to the locked feature ID succeed, it is determined that the unlocking condition for unlocking the feature ID is satisfied, M being an integer greater than 1; and when the feature ID of the user feature is not locked, determining that the user feature passes the identity authentication, when the feature ID of the user feature is locked and an unlocking condition of the locked feature ID is satisfied currently, unlocking the locked feature ID, wherein when at least M living body detections performed continuously on the user feature corresponding to the locked feature ID succeed, it is determined that the unlocking condition for unlocking the feature ID is satisfied, M being an integer greater than 1; and when the feature ID of the user feature is not locked, determining that the user feature passes the identity authentication, wherein each user feature has a unique feature ID.