A terminal discovery method performed by a first proximity service, ProSe, entity, the method comprising: • receiving a first message sent by a first terminal, wherein the first message carries a group identifier of a group in which a terminal to be monitored by the first terminal is located and the group identifier is a temporary identifier allocated by an application server to the group in which the terminal to be monitored by the first terminal is located (S 901); • obtaining according to the group identifier a group code word of the group in which the terminal to be monitored by the first terminal is located (S 902); • sending a second message to the first terminal, wherein the second message carries the group code word (S 903); • receiving a third message sent by the first terminal, wherein the third message carries at least one first broadcast code word, wherein each of the at least one first broadcast code word is a broadcast code word among broadcast code words detected by the first terminal and that comprises the group code word, and each first broadcast code word further comprises a user code word of a terminal that broadcasts the corresponding first broadcast code word (S 904); and • obtaining, for each of the at least one user code word, according to the user code word a terminal identifier of the terminal that broadcasts the corresponding first broadcast code word, and sending a fourth message to the first terminal, wherein the fourth message carries at least one terminal identifier, wherein each of the at least one terminal identifier is a temporary identifier allocated by the application server to the corresponding terminal that broadcasts the corresponding first broadcast code word (S 905), • wherein when the first terminal and a second terminal belong to different home public land mobile networks, HPLMNs, and the second terminal is a group management device of the group in which the terminal to be monitored by the first terminal is located, the obtaining according to the group identifier, the group code word of the group in which the terminal to be monitored by the first terminal is located comprises: ∘ sending a fifth message to a second ProSe entity, wherein the fifth message carries the group identifier, the fifth message is used to request the second ProSe entity to allocate a code word to the group in which the terminal to be monitored by the first terminal is located, and the second ProSe entity is a ProSe entity in an HPLMN of the second terminal; and ∘ receiving a sixth message sent by the second ProSe entity, wherein the sixth message carries the group code word. • receiving a first message sent by a first terminal, wherein the first message carries a group identifier of a group in which a terminal to be monitored by the first terminal is located and the group identifier is a temporary identifier allocated by an application server to the group in which the terminal to be monitored by the first terminal is located (S 901); • obtaining according to the group identifier a group code word of the group in which the terminal to be monitored by the first terminal is located (S 902); • sending a second message to the first terminal, wherein the second message carries the group code word (S 903); • receiving a third message sent by the first terminal, wherein the third message carries at least one first broadcast code word, wherein each of the at least one first broadcast code word is a broadcast code word among broadcast code words detected by the first terminal and that comprises the group code word, and each first broadcast code word further comprises a user code word of a terminal that broadcasts the corresponding first broadcast code word (S 904); and • obtaining, for each of the at least one user code word, according to the user code word a terminal identifier of the terminal that broadcasts the corresponding first broadcast code word, and sending a fourth message to the first terminal, wherein the fourth message carries at least one terminal identifier, wherein each of the at least one terminal identifier is a temporary identifier allocated by the application server to the corresponding terminal that broadcasts the corresponding first broadcast code word (S 905), • wherein when the first terminal and a second terminal belong to different home public land mobile networks, HPLMNs, and the second terminal is a group management device of the group in which the terminal to be monitored by the first terminal is located, the obtaining according to the group identifier, the group code word of the group in which the terminal to be monitored by the first terminal is located comprises: ∘ sending a fifth message to a second ProSe entity, wherein the fifth message carries the group identifier, the fifth message is used to request the second ProSe entity to allocate a code word to the group in which the terminal to be monitored by the first terminal is located, and the second ProSe entity is a ProSe entity in an HPLMN of the second terminal; and ∘ receiving a sixth message sent by the second ProSe entity, wherein the sixth message carries the group code word. ∘ sending a fifth message to a second ProSe entity, wherein the fifth message carries the group identifier, the fifth message is used to request the second ProSe entity to allocate a code word to the group in which the terminal to be monitored by the first terminal is located, and the second ProSe entity is a ProSe entity in an HPLMN of the second terminal; and ∘ receiving a sixth message sent by the second ProSe entity, wherein the sixth message carries the group code word.