In a preferred embodiment of the present invention, the determining, by the first UE, the M resources according to the N available resources after an interval of preset duration T includes randomly selecting, by the first UE, the M resources from the N available resources, obtaining, by the first UE, L resources according to the N available resources, and randomly selecting, by the first UE, the M resources from the L available resources, or redetermining, by the first UE, N available resources from the S resources, and randomly selecting, by the first UE, the M resources from the redetermined N available resources.
Further, the obtaining, by the first UE, L resources according to the N available resources specifically includes obtaining, by the first UE, the L resources after performing an operation on the N available resources by using a preset rule. For example, the obtaining the L resources after performing an operation on the N available resources by using a preset rule may be obtaining the L resources by means of calculation by using a frequency hopping formula.
In a preferred embodiment of the present invention, the sending, by the first UE, data to at least one second UE by using the M resources includes sending, by the first UE, the data to the at least one second UE on the M resources. That is, the first UE adds to-be-sent data to the M resources and sends the to-be-sent data to the at least one UE.