With reference to the third aspect, in a second possible implementation of the third aspect, an obtaining unit is further included, where the obtaining unit is configured to obtain the resource configuration information, where the resource configuration information includes information about the S resources, and the resource configuration information is configured by a base station or preconfigured.
With reference to the third aspect, in a third possible implementation of the third aspect, the determining unit is specifically configured to detect energy or power of a signal carried on each of the S resources, and if the energy of the signal carried on the resource is less than a threshold m or the power of the signal carried on the resource is less than a threshold n, determine that the resource is the available resource, where m and n are positive numbers, or detect a sequence carried on each of the S resources, and if the resource carries no preset sequence, determine that the resource is the available resource.
With reference to the third aspect, in a fourth possible implementation of the third aspect, the determining unit is specifically configured to after determining the N available resources from the S resources, determine the M resources according to the N available resources after an interval of preset duration T, or redetermine, by the first UE, N available resources from the S resources after an interval of preset duration T, where T is determined according to at least one of a quantity N of available resources, a quantity N-S of unavailable resources, a proportion N/S of the available resources, a quantity c of conflicts of the first UE, a conflict time w, a service priority Q of the first UE, or a priority of the first UE, c is an integer greater than or equal to 0, and w is a positive number.