The invention is applicable to the technical field of computers, and relates to a gait detection algorithm, device and system. The gait detection algorithm comprises the following steps: resetting a climbing number and a downhill number to 0 until a resultant acceleration module value is larger than a preset threshold value; updating the climbing number and the downhill number until the climbing number is larger than a preset threshold value, wherein the resultant acceleration module value is at a peak value; resetting the downhill number to 0, and updating the downhill number until the downhill number is larger than a preset threshold value, wherein the resultant acceleration module value is at a valley value; and resetting the uphill number to 0, and updating the uphill number until theuphill number is larger than the preset threshold value, wherein the resultant acceleration module value meets a preset requirement, and the step number is increased by 1. According to the gait detection algorithm disclosed by the invention, the difference value between the resultant acceleration module value and the resultant acceleration module value at the adjacent time are compared with a plurality of preset threshold values, and each state in a walking period is determined, so that a complete walking period is obtained, step counting is realized, and the gait detection algorithm is more accurate than a conventional step counting algorithm.