A device-to-device D2D communication method, wherein the method comprises: establishing, by a first terminal, a sidelink between the first terminal and a second terminal, wherein the sidelink corresponds to a sidelink slice; and communicating, by the first terminal, with the second terminal on the sidelink by using a physical transmission resource corresponding to the sidelink slice; wherein the establishing, by a first terminal, a sidelink between the first terminal and a second terminal comprises: sending, by the first terminal, a first request to the second terminal, wherein the first request comprises identification information of the sidelink slice, and the first request is used to establish the sidelink; wherein the sending, by the first terminal, a first request to the second terminal comprises: sending, by the first terminal, the first request to the second terminal if the first terminal determines that the second terminal supports the sidelink slice, characterized in that the method further comprises: sending, by the first terminal, a broadcast message, wherein the broadcast message comprises the identification information of the sidelink slice; and receiving, by the first terminal from the second terminal, a response to the broadcast message, wherein the response to the broadcast message is used to indicate that the second terminal supports the sidelink slice. establishing, by a first terminal, a sidelink between the first terminal and a second terminal, wherein the sidelink corresponds to a sidelink slice; and communicating, by the first terminal, with the second terminal on the sidelink by using a physical transmission resource corresponding to the sidelink slice; wherein the establishing, by a first terminal, a sidelink between the first terminal and a second terminal comprises: sending, by the first terminal, a first request to the second terminal, wherein the first request comprises identification information of the sidelink slice, and the first request is used to establish the sidelink; wherein the sending, by the first terminal, a first request to the second terminal comprises: sending, by the first terminal, the first request to the second terminal if the first terminal determines that the second terminal supports the sidelink slice, characterized in that the method further comprises: sending, by the first terminal, a broadcast message, wherein the broadcast message comprises the identification information of the sidelink slice; and receiving, by the first terminal from the second terminal, a response to the broadcast message, wherein the response to the broadcast message is used to indicate that the second terminal supports the sidelink slice. sending, by the first terminal, a first request to the second terminal, wherein the first request comprises identification information of the sidelink slice, and the first request is used to establish the sidelink; wherein the sending, by the first terminal, a first request to the second terminal comprises: sending, by the first terminal, the first request to the second terminal if the first terminal determines that the second terminal supports the sidelink slice, characterized in that the method further comprises: sending, by the first terminal, a broadcast message, wherein the broadcast message comprises the identification information of the sidelink slice; and receiving, by the first terminal from the second terminal, a response to the broadcast message, wherein the response to the broadcast message is used to indicate that the second terminal supports the sidelink slice. sending, by the first terminal, the first request to the second terminal if the first terminal determines that the second terminal supports the sidelink slice, characterized in that the method further comprises: sending, by the first terminal, a broadcast message, wherein the broadcast message comprises the identification information of the sidelink slice; and receiving, by the first terminal from the second terminal, a response to the broadcast message, wherein the response to the broadcast message is used to indicate that the second terminal supports the sidelink slice. sending, by the first terminal, a broadcast message, wherein the broadcast message comprises the identification information of the sidelink slice; and receiving, by the first terminal from the second terminal, a response to the broadcast message, wherein the response to the broadcast message is used to indicate that the second terminal supports the sidelink slice.