A data transmission method, comprising: obtaining, by a terminal, transmission resource occupation status information broadcast by a base station, wherein the transmission resource occupation status information comprises a status that at least one transmission resource unit in a transmission resource within preset duration is occupied by another terminal, information about at least one target transmission resource unit in the transmission resource within the preset duration, and at least one pilot cyclic shift and/or orthogonal cover code allowed to be used when each target transmission resource unit is occupied to transmit a data packet, the target transmission resource unit is a transmission resource unit that has been occupied by another terminal, and a quantity of other terminals occupying the target transmission resource unit is less than a maximum quantity of terminals that are allowed to simultaneously occupy one transmission resource unit; determining, by the terminal based on the transmission resource occupation status information, a transmission resource unit used to send a first data packet, wherein a size of the first data packet is not greater than a maximum size of data that one transmission resource unit is allowed to carry, a transmission resource unit corresponding to information about a target transmission resource unit used to send the first data packet, and a pilot cyclic shift and/or an orthogonal cover code used to send the first data packet; and sending, by the terminal, the first data packet by using the determined transmission resource unit and the determined pilot cyclic shift and/or orthogonal cover code used to send the first data packet. obtaining, by a terminal, transmission resource occupation status information broadcast by a base station, wherein the transmission resource occupation status information comprises a status that at least one transmission resource unit in a transmission resource within preset duration is occupied by another terminal, information about at least one target transmission resource unit in the transmission resource within the preset duration, and at least one pilot cyclic shift and/or orthogonal cover code allowed to be used when each target transmission resource unit is occupied to transmit a data packet, the target transmission resource unit is a transmission resource unit that has been occupied by another terminal, and a quantity of other terminals occupying the target transmission resource unit is less than a maximum quantity of terminals that are allowed to simultaneously occupy one transmission resource unit; determining, by the terminal based on the transmission resource occupation status information, a transmission resource unit used to send a first data packet, wherein a size of the first data packet is not greater than a maximum size of data that one transmission resource unit is allowed to carry, a transmission resource unit corresponding to information about a target transmission resource unit used to send the first data packet, and a pilot cyclic shift and/or an orthogonal cover code used to send the first data packet; and sending, by the terminal, the first data packet by using the determined transmission resource unit and the determined pilot cyclic shift and/or orthogonal cover code used to send the first data packet.