A communication method performed by an apparatus, comprising: determining, based on a quantity of resource elements, REs, that are in a first time-frequency resource and that are used to transmit first information, a quantity of REs that are in the first time-frequency resource and that are used to transmit data, wherein the first time-frequency resource comprises a first time unit in time domain and comprises a data channel resource in frequency domain, and the first information comprises second-stage control information; wherein a quantity N oh _ SCI 2 RE of REs that are in the first time-frequency resource and that are used to transmit the second-stage control information satisfies: N oh _ SCI 2 RE = min O SCI 2 + L SCI 2 ∗ β ̄ R ∗ Q α ∑ l = 0 N syml sh " − 1 M sc PSSCH l − M sc PSCCH l + γ, wherein O SCI2 represents a valid payload size of the second-stage control information, L SCI2 represents a cyclic redundancy check, CRC, bit length of the second-stage control information, R represents a bit rate of a data channel, Q represents a modulation order of a control channel, β represents a scale factor that is of a resource for the second-stage control information and that is indicated by the first control information, α represents the scale factor of the resource used to transmit the second-stage control information, wherein 0<α≤1, γ represents a quantity of REs that is defined to satisfy that the second-stage control information occupies an integer quantity of physical resource block, PRBs, N syml sh " = lengthSLsymbols − N symbol PSFCH − 2, lengthSLsymbols is a quantity of symbols comprised in a sidelink communication slot and that is configured by higher layer RRC, N symbol PSFCH is a quantity of symbols occupied by a PSFCH, N symbol PSFCH = 0 or N symbol PSFCH = 3, M sc PSSCH l is a quantity of subcarriers in a data channel scheduling bandwidth, and M sc PSCCH l is a quantity that is of subcarriers in a control channel bandwidth on symbol l and that is configured by higher layer RRC; the method further comprises: determining, based on the quantity of REs that are in the first time-frequency resource and that are used to transmit the data, a transport block size, TBS for transmitting the data, wherein in a process of determining the TBS, the value of γ is 0; transmitting the data with the determined TBS on the determined quantity of REs that are in the first time-frequency resource. determining, based on a quantity of resource elements, REs, that are in a first time-frequency resource and that are used to transmit first information, a quantity of REs that are in the first time-frequency resource and that are used to transmit data, wherein the first time-frequency resource comprises a first time unit in time domain and comprises a data channel resource in frequency domain, and the first information comprises second-stage control information; wherein a quantity N oh _ SCI 2 RE of REs that are in the first time-frequency resource and that are used to transmit the second-stage control information satisfies: N oh _ SCI 2 RE = min O SCI 2 + L SCI 2 ∗ β ̄ R ∗ Q α ∑ l = 0 N syml sh " − 1 M sc PSSCH l − M sc PSCCH l + γ, wherein O SCI2 represents a valid payload size of the second-stage control information, L SCI2 represents a cyclic redundancy check, CRC, bit length of the second-stage control information, R represents a bit rate of a data channel, Q represents a modulation order of a control channel, β represents a scale factor that is of a resource for the second-stage control information and that is indicated by the first control information, α represents the scale factor of the resource used to transmit the second-stage control information, wherein 0<α≤1, γ represents a quantity of REs that is defined to satisfy that the second-stage control information occupies an integer quantity of physical resource block, PRBs, N syml sh " = lengthSLsymbols − N symbol PSFCH − 2, lengthSLsymbols is a quantity of symbols comprised in a sidelink communication slot and that is configured by higher layer RRC, N symbol PSFCH is a quantity of symbols occupied by a PSFCH, N symbol PSFCH = 0 or N symbol PSFCH = 3, M sc PSSCH l is a quantity of subcarriers in a data channel scheduling bandwidth, and M sc PSCCH l is a quantity that is of subcarriers in a control channel bandwidth on symbol l and that is configured by higher layer RRC; the method further comprises: determining, based on the quantity of REs that are in the first time-frequency resource and that are used to transmit the data, a transport block size, TBS for transmitting the data, wherein in a process of determining the TBS, the value of γ is 0; transmitting the data with the determined TBS on the determined quantity of REs that are in the first time-frequency resource. determining, based on the quantity of REs that are in the first time-frequency resource and that are used to transmit the data, a transport block size, TBS for transmitting the data, wherein in a process of determining the TBS, the value of γ is 0; transmitting the data with the determined TBS on the determined quantity of REs that are in the first time-frequency resource.