An anti-shake method for a camera, wherein the camera comprises a lens, a shake detector and an image sensor, the lens comprising a movable anti-shake lens; wherein the method comprises: for each of preset periods, acquiring shake data of the camera in this preset period by the shake detector, wherein the shake data comprises position change data of the camera when the camera shakes, which is an angle variation of the camera in a current period relative to a previous period; determining a first camera state of the camera in a previous period of the current period; and when the first camera state is the standstill state, determining whether the camera shakes in the current period, by comparing a preset shake threshold with the angle variation contained in the shake data of the camera in the current period; and determining whether the camera shakes continuously in a preset number of periods; if the camera shakes continuously in the preset number of periods, determining that a second camera state of the camera in the current period is the shake state, and enabling the anti-shake function; if the camera does not shake continuously in the preset number of periods, determining that the second camera state of the camera in the current period is the standstill state; when the anti-shake function is enabled, determining position change data of the anti-shake lens based on the current shake data of the camera and a preset relationship between position change of the anti-shake lens for shake compensation and shake data; and adjusting a position of the anti-shake lens based on the position change data of the anti-shake lens, so as to cause the image sensor to capture a shake-compensated image. for each of preset periods, acquiring shake data of the camera in this preset period by the shake detector, wherein the shake data comprises position change data of the camera when the camera shakes, which is an angle variation of the camera in a current period relative to a previous period; determining a first camera state of the camera in a previous period of the current period; and when the first camera state is the standstill state, determining whether the camera shakes in the current period, by comparing a preset shake threshold with the angle variation contained in the shake data of the camera in the current period; and determining whether the camera shakes continuously in a preset number of periods; if the camera shakes continuously in the preset number of periods, determining that a second camera state of the camera in the current period is the shake state, and enabling the anti-shake function; if the camera does not shake continuously in the preset number of periods, determining that the second camera state of the camera in the current period is the standstill state; when the anti-shake function is enabled, determining position change data of the anti-shake lens based on the current shake data of the camera and a preset relationship between position change of the anti-shake lens for shake compensation and shake data; and adjusting a position of the anti-shake lens based on the position change data of the anti-shake lens, so as to cause the image sensor to capture a shake-compensated image.