An eye open or closed state detection method carried out by an electronic device, comprising: obtaining a grayscale image of an eye in a human face in a to-be-processed face image; extracting an eye feature in the grayscale image, wherein the eye feature comprises an eye opening feature for determining an eye opening degree, and the eye feature further comprises a vertical direction feature; and identifying an eye open or closed state based on the eye feature, wherein extracting the vertical direction feature in the eye feature comprises: for each of N selected horizontal coordinates obtaining, among the pixels comprised in the grayscale image having a respective selected horizontal coordinate in the image coordinate system, the pixel having the smallest pixel value, referred to as the N smallest pixels; and obtaining the vertical direction feature based on vertical coordinates of the N smallest pixels, wherein the obtaining the vertical direction feature based on vertical coordinates of the N smallest pixels comprises: obtaining an absolute value of a difference between vertical coordinates of every two pixels with adjacent horizontal coordinates in the N smallest pixels; determining a feature score corresponding to each absolute value according to: if A < V j ≤ B, then score V j = V j − A; if B < V j ≤ C, then score V j = k 1 ∗ V j − A; if C < V j, then score V j = k 2 ∗ V j − A; wherein V j represents the absolute value, score V j represents the feature score corresponding to V j, all of A, B, C, k1 and k2 are positive numbers, k1 < k2, and A < B < C; and using a sum of the feature scores corresponding to the absolute values as the vertical direction feature. obtaining a grayscale image of an eye in a human face in a to-be-processed face image; extracting an eye feature in the grayscale image, wherein the eye feature comprises an eye opening feature for determining an eye opening degree, and the eye feature further comprises a vertical direction feature; and identifying an eye open or closed state based on the eye feature, wherein extracting the vertical direction feature in the eye feature comprises: for each of N selected horizontal coordinates obtaining, among the pixels comprised in the grayscale image having a respective selected horizontal coordinate in the image coordinate system, the pixel having the smallest pixel value, referred to as the N smallest pixels; and obtaining the vertical direction feature based on vertical coordinates of the N smallest pixels, wherein the obtaining the vertical direction feature based on vertical coordinates of the N smallest pixels comprises: obtaining an absolute value of a difference between vertical coordinates of every two pixels with adjacent horizontal coordinates in the N smallest pixels; determining a feature score corresponding to each absolute value according to: if A < V j ≤ B, then score V j = V j − A; if B < V j ≤ C, then score V j = k 1 ∗ V j − A; if C < V j, then score V j = k 2 ∗ V j − A; wherein V j represents the absolute value, score V j represents the feature score corresponding to V j, all of A, B, C, k1 and k2 are positive numbers, k1 < k2, and A < B < C; and using a sum of the feature scores corresponding to the absolute values as the vertical direction feature. for each of N selected horizontal coordinates obtaining, among the pixels comprised in the grayscale image having a respective selected horizontal coordinate in the image coordinate system, the pixel having the smallest pixel value, referred to as the N smallest pixels; and obtaining the vertical direction feature based on vertical coordinates of the N smallest pixels, wherein the obtaining the vertical direction feature based on vertical coordinates of the N smallest pixels comprises: obtaining an absolute value of a difference between vertical coordinates of every two pixels with adjacent horizontal coordinates in the N smallest pixels; determining a feature score corresponding to each absolute value according to: if A < V j ≤ B, then score V j = V j − A; if B < V j ≤ C, then score V j = k 1 ∗ V j − A; if C < V j, then score V j = k 2 ∗ V j − A; wherein V j represents the absolute value, score V j represents the feature score corresponding to V j, all of A, B, C, k1 and k2 are positive numbers, k1 < k2, and A < B < C; and using a sum of the feature scores corresponding to the absolute values as the vertical direction feature. obtaining an absolute value of a difference between vertical coordinates of every two pixels with adjacent horizontal coordinates in the N smallest pixels; determining a feature score corresponding to each absolute value according to: if A < V j ≤ B, then score V j = V j − A; if B < V j ≤ C, then score V j = k 1 ∗ V j − A; if C < V j, then score V j = k 2 ∗ V j − A; wherein V j represents the absolute value, score V j represents the feature score corresponding to V j, all of A, B, C, k1 and k2 are positive numbers, k1 < k2, and A < B < C; and using a sum of the feature scores corresponding to the absolute values as the vertical direction feature.