A data processing method, comprising: receiving, by a terminal device, first configuration information sent by a network device, wherein the first configuration information comprises preemption indication information, and the preemption indication information indicates a preemption capability of a first logical channel; before multiplexing of a Media Access Control, MAC, protocol data unit, PDU, is completed or a MAC PDU generated by multiplexing is transmitted to a physical layer, when a MAC layer has a first data unit, preempting, by the terminal device for the first data unit based on the preemption indication information, a resource allocated by the terminal device for a second data unit, wherein the first data unit corresponds to the first logical channel, and the second data unit corresponds to a second logical channel; and multiplexing, by the terminal device, the first data unit by using the preempted resource; characterized in that the multiplexing, by the terminal device, the first data unit by using the preempted resource comprises re-multiplexing, by the terminal device, a MAC data unit by using the preempted resource and the first data unit, to generate a MAC PDU; and in that after the receiving, by a terminal device, first configuration information sent by a network device, the method further comprises: allocating, by the terminal device by using the MAC layer, a resource for all logical channels corresponding to the MAC data unit that has not been multiplexed, wherein all the logical channels comprise the second logical channel; and generating, by the terminal device based on the resource, the MAC data unit that has not been multiplexed, where the MAC data unit that has not been multiplexed includes a data unit corresponding to the second logical channel. receiving, by a terminal device, first configuration information sent by a network device, wherein the first configuration information comprises preemption indication information, and the preemption indication information indicates a preemption capability of a first logical channel; before multiplexing of a Media Access Control, MAC, protocol data unit, PDU, is completed or a MAC PDU generated by multiplexing is transmitted to a physical layer, when a MAC layer has a first data unit, preempting, by the terminal device for the first data unit based on the preemption indication information, a resource allocated by the terminal device for a second data unit, wherein the first data unit corresponds to the first logical channel, and the second data unit corresponds to a second logical channel; and multiplexing, by the terminal device, the first data unit by using the preempted resource; characterized in that the multiplexing, by the terminal device, the first data unit by using the preempted resource comprises re-multiplexing, by the terminal device, a MAC data unit by using the preempted resource and the first data unit, to generate a MAC PDU; and in that after the receiving, by a terminal device, first configuration information sent by a network device, the method further comprises: allocating, by the terminal device by using the MAC layer, a resource for all logical channels corresponding to the MAC data unit that has not been multiplexed, wherein all the logical channels comprise the second logical channel; and generating, by the terminal device based on the resource, the MAC data unit that has not been multiplexed, where the MAC data unit that has not been multiplexed includes a data unit corresponding to the second logical channel. allocating, by the terminal device by using the MAC layer, a resource for all logical channels corresponding to the MAC data unit that has not been multiplexed, wherein all the logical channels comprise the second logical channel; and generating, by the terminal device based on the resource, the MAC data unit that has not been multiplexed, where the MAC data unit that has not been multiplexed includes a data unit corresponding to the second logical channel.