A method for determining a transmission link between a path initiation device and a path response device in a Wireless Fidelity, Wi-Fi-based neighbor awareness network, NAN, wherein the path initiation device and the path response device have succeeded in service discovery, comprising: receiving, by a first device, a first path discovery message sent by a second device, wherein the first device is a forwarding device between the path initiation device and the path response device, wherein the first path discovery message is used to determine a service data transmission link between the path initiation device and the path response device, the second device is the path initiation device or another forwarding device, the first path discovery message carries first time-frequency resource information of the second device, and the first time-frequency resource information indicates a first time-frequency resource that is of the second device and that can be used to establish the service data transmission link; determining, by the first device, whether to send a second path discovery message according to the first time-frequency resource information, wherein the second path discovery message carries second time-frequency resource information of the first device, and the second time-frequency resource information indicates a second time-frequency resource that is of the first device and that can be used to establish the service data transmission link; and sending, by the first device, the second path discovery message to a next hop device of the first device, when determining to send the second path discovery message; receiving, by the first device, a path response message sent by a fourth device, wherein the path response message indicates that the fourth device is the path response device of the path initiation device; and forwarding, by the first device, the path response message to the second device. receiving, by a first device, a first path discovery message sent by a second device, wherein the first device is a forwarding device between the path initiation device and the path response device, wherein the first path discovery message is used to determine a service data transmission link between the path initiation device and the path response device, the second device is the path initiation device or another forwarding device, the first path discovery message carries first time-frequency resource information of the second device, and the first time-frequency resource information indicates a first time-frequency resource that is of the second device and that can be used to establish the service data transmission link; determining, by the first device, whether to send a second path discovery message according to the first time-frequency resource information, wherein the second path discovery message carries second time-frequency resource information of the first device, and the second time-frequency resource information indicates a second time-frequency resource that is of the first device and that can be used to establish the service data transmission link; and sending, by the first device, the second path discovery message to a next hop device of the first device, when determining to send the second path discovery message; receiving, by the first device, a path response message sent by a fourth device, wherein the path response message indicates that the fourth device is the path response device of the path initiation device; and forwarding, by the first device, the path response message to the second device.