First of all, people's movement state must be fed back to the mobile phone through the sensor inside the mobile phone. Motion information sensors are generally nothing more than gyroscopes (acquiring angular velocity), acceleration sensors (acquiring acceleration), barometers (acquiring height), magnetometers and so on. With the rapid development of microelectronics technology, these sensors can be directly integrated into a chip the size of a fingernail. For example, the common mpu6050 integrates a gyroscope and an accelerometer, and the mpu series integrated chips are used in general mobile phones.
Now some mobile phones hand over the task of processing these sensor data to the coprocessor, which can be regarded as a process of assisting cpu. Because the current co-processing power consumption can be very low, it can always work and complete common motion statistics functions in the background, such as step counting. Let's talk about it. How can a mobile phone tell whether you are dumping your mobile phone or really leaving again? In fact, what the sensor sends to the processor is some data of the motion direction. By comparing the collected data with the real walking data, if the characteristics of an action conform to the characteristics of walking, it is judged as walking. Some mobile phones can also distinguish whether they are pretending to walk or really walking by whether there is gps displacement. The algorithm of these judgments may be different for each company, but the final judgment effect is similar. There is also a stair climbing floor in the mobile phone, which is a typical barometer application to obtain height data. If you take the elevator up, although the height changes but there is no movement, it is not climbing the stairs, which is the subtlety of the algorithm.
Now, Apple's iOS 10 has added a new mobile phone wake-up operation, that is, the mobile phone automatically lights up when it is picked up and automatically locks when it is put down. These can also be recognized by this sensor. For example, when picking up a mobile phone, there must be an acceleration or speed towards the mobile phone. By analyzing the data of mobile phone operation, we can get the general data of the picked-up mobile phone and use these data to complete the function.
Therefore, it is natural to recognize walking or driving.