The invention discloses an 
internet of things (IoT) error 
sensor node location method based on an improved 
Q learning algorithm. The method is characterized in that the traditional 
Q learning method is improved to make calculated Q values adaptively change according to characteristic information such as 
residual energy of a 
sensor node, routing and transmission hop count, a routing path is established by means of a maximal Q value, meanwhile, a background 
server works out a network topological structure, when the node is attached or produces error data, an error range is set by comparison with the Q value of the node of the next period, and when the range is exceeded, the node is judged to be the error node and is located. According to the invention, extra energy of the 
sensor node does not need to be consumed, and when a 
wireless sensor network topological structure changes, higher robustness is also achieved; and the method has the advantages of intelligent property, low 
energy consumption, high adaptive degree and the like, can be used to not only routing, location and 
energy consumption performance evaluation of the sensor node but also accurate location of unknown error nodes, and has wide application values.