A method for service discovery in a neighbor awareness network NAN, comprising: receiving, by a first device, a first service discovery message sent by a second device, wherein the first service discovery message carries service identifier information and first path information, the service identifier information indicates a service queried by a service initiating device or a service supported by the service initiating device, the second device is the service initiating device or a service forwarding device, and the first path information comprises identifier information of the service initiating device, or identifier information of the second device and the service initiating device; determining, by the first device, second path information according to the first path information, wherein the second path information comprises the identifier information of the service initiating device and identifier information of the first device; and sending, by the first device, a second service discovery message, wherein the second service discovery message carries the service identifier information and the second path information, characterized in that the sending, by the first device, a second service discovery message comprises: if the first device is not located in any NAN data cluster NDC in the NAN, sending, by the first device, the second service discovery message in a discovery window DW of the NAN; or if the first device is located in a first NDC, sending, by the first device, the second service discovery message in the first NDC; or if the first device is located in at least two NDCs, sending, by the first device, the second service discovery message in at least one of the at least two NDCs. receiving, by a first device, a first service discovery message sent by a second device, wherein the first service discovery message carries service identifier information and first path information, the service identifier information indicates a service queried by a service initiating device or a service supported by the service initiating device, the second device is the service initiating device or a service forwarding device, and the first path information comprises identifier information of the service initiating device, or identifier information of the second device and the service initiating device; determining, by the first device, second path information according to the first path information, wherein the second path information comprises the identifier information of the service initiating device and identifier information of the first device; and sending, by the first device, a second service discovery message, wherein the second service discovery message carries the service identifier information and the second path information, characterized in that the sending, by the first device, a second service discovery message comprises: if the first device is not located in any NAN data cluster NDC in the NAN, sending, by the first device, the second service discovery message in a discovery window DW of the NAN; or if the first device is located in a first NDC, sending, by the first device, the second service discovery message in the first NDC; or if the first device is located in at least two NDCs, sending, by the first device, the second service discovery message in at least one of the at least two NDCs. if the first device is not located in any NAN data cluster NDC in the NAN, sending, by the first device, the second service discovery message in a discovery window DW of the NAN; or if the first device is located in a first NDC, sending, by the first device, the second service discovery message in the first NDC; or if the first device is located in at least two NDCs, sending, by the first device, the second service discovery message in at least one of the at least two NDCs.