The invention discloses a method for obtaining an intelligent device ID online, and belongs to the field of intelligent device communication. The method comprises the following steps: step 1: initializing a network connection of a device; step 2: sending, by the device, an identity identification request comprising a wireless communication signal to a server; step 3: performing, by the server, anti-data packet adhesion processing according to the identity identification request to obtain a qualified request; step 4: judging, by the server, whether the wireless communication signal in the qualified request is present and authorized, and if yes, controlling, the server, a cloud platform to send a unique device ID number to the device by using a distributed ID generation algorithm; if not, ending the present request, and skipping to the step 2 to continue the request after waiting for an interval time; and step 5: receiving, by the device, the device ID to complete the online acquisition.By adoption of the method disclosed by the invention, by overcoming the data packet adhesion and ensuring the uniqueness of the device ID, the problem that the existing device adopts offline identityauthentication, resulting in low communication security is solved, and the effects of improving the security of the device communication and improving the production efficiency are achieved.