A method for device discovery, comprising: acquiring, by a first device, a user identification of a target user of a second device, wherein the second device is an object of the device discovery, and acquiring, according to the user identification of the target user, broadcast information of the second device, wherein the broadcast information of the second device is a broadcast code assigned by a short distance server and is sent by the second device so that other devices can discover the second device, further wherein the target user of the second device logs in an application server by using a certain application on the second device; and when broadcast information of another device besides the first device is monitored through a device-to-device, D2D, function, matching, by the first device, the monitored broadcast information with the broadcast information of the second device, and if the match is successful, determining, by the first device, that the second device and the first device are within a preset distance; wherein the acquiring, according to the user identification of the target user, the broadcast information of the second device, comprises: sending, by the first device, the user identification of the target user to the application server, to trigger the application server to query a device identity of the second device and acquire the broadcast information of the second device according to the device identity of the second device; and receiving, by the first device, the broadcast information of the second device acquired by the application server according to the device identity of the second device and returned by the application server; or, sending, by the first device, the user identification of the target user to the application server, to trigger the application server to query a device identity of the second device; receiving, by the first device, the device identity of the second device returned by the application server; querying, by the first device, the broadcast information of the second device to the short distance server according to the device identity of the second device; and receiving, by the first device, the broadcast information of the second device returned by the short distance server. acquiring, by a first device, a user identification of a target user of a second device, wherein the second device is an object of the device discovery, and acquiring, according to the user identification of the target user, broadcast information of the second device, wherein the broadcast information of the second device is a broadcast code assigned by a short distance server and is sent by the second device so that other devices can discover the second device, further wherein the target user of the second device logs in an application server by using a certain application on the second device; and when broadcast information of another device besides the first device is monitored through a device-to-device, D2D, function, matching, by the first device, the monitored broadcast information with the broadcast information of the second device, and if the match is successful, determining, by the first device, that the second device and the first device are within a preset distance; wherein the acquiring, according to the user identification of the target user, the broadcast information of the second device, comprises: sending, by the first device, the user identification of the target user to the application server, to trigger the application server to query a device identity of the second device and acquire the broadcast information of the second device according to the device identity of the second device; and receiving, by the first device, the broadcast information of the second device acquired by the application server according to the device identity of the second device and returned by the application server; or, sending, by the first device, the user identification of the target user to the application server, to trigger the application server to query a device identity of the second device; receiving, by the first device, the device identity of the second device returned by the application server; querying, by the first device, the broadcast information of the second device to the short distance server according to the device identity of the second device; and receiving, by the first device, the broadcast information of the second device returned by the short distance server.