Patent Publication Number: US-2021168658-A1

Title: Communication Method and Communications Apparatus

Description:
CROSS-REFERENCE TO RELATED APPLICATIONS 
     This application is a continuation of International Application No. PCT/CN2019/100063, filed on Aug. 9, 2019, which claims priority to Chinese Patent Application No. 201810918006.5, filed on Aug. 13, 2018 and Chinese Patent Application No. 201811169219.9, filed on Oct. 8, 2018. The disclosures of the aforementioned applications are hereby incorporated by reference in their entireties. 
    
    
     TECHNICAL FIELD 
     This application relates to the communications field, and more specifically, to a communication method and a communications apparatus. 
     BACKGROUND 
     Currently, in the communications field, a communications technology for interworking between a 3rd generation partnership project (3 rd  generation partnership project, 3GPP) network and a time sensitive network (TSN) is proposed. In a scenario in which a 3GPP core network interworks with a TSN, a terminal device (UE) may be used as a flow service recipient (listener) to receive a flow sent by a flow service provider (talker) of the TSN. Alternatively, the UE may serve as a flow service provider to send a flow to a flow service recipient in the TSN, for example, an ultra-reliable low-latency communication (URLLC) flow. As a boundary between the TSN and the 3GPP network, a user plane function (UPF) network element may have a basic function of a bridge in the TSN. 
     To implement interworking between the 3GPP network and the TSN, an accumulated latency of transmitting a flow between the UE and the UPF network element in the 3GPP network needs to be calculated. 
     Therefore, how to determine the accumulated latency of transmission between the UE and the UPF network element is a technical problem that urgently needs to be resolved. 
     SUMMARY 
     This application provides a communication method and a communications apparatus, to determine an accumulated latency of transmitting a flow between UE and a UPF network element. 
     According to a first aspect, this application provides a communication method. The communication method includes: receiving, by a session management function (SMF) network element, first latency information of a flow from a UPF network element, where the first latency information is used to indicate a first latency of transmitting the flow from a flow service provider in a TSN to the UPF network element; determining, by the SMF network element according to a policy and charging control (PCC) rule of the flow, a third latency of transmitting the flow from the UPF network element to UE; determining, by the SMF network element based on the first latency and the third latency, a second latency of transmitting the flow from the flow service provider in the TSN to the UE; and sending, by the SMF network element, second latency information to the UPF network element, where the second latency information is used to indicate the second latency. 
     In the communication method, the SMF network element determines, according to the PCC rule, the third latency of transmitting the flow from the UPF network element to the UE, and uses the third latency as an accumulated latency of transmitting the flow from the UPF network element to the UE, so that the SMF network element can determine, based on the third latency and the first latency of transmitting the flow from the flow provider in the TSN to the UPF network element, the second latency of transmitting the flow from the flow service provider in the TSN to the UE. In this way, in a communications network in which a 3GPP network interworks with the TSN, it can be determined, based on the second latency, that QoS of the flow can be ensured, and the flow can be transmitted. 
     In addition, the SMF network element determines, according to the PCC rule, the third latency of transmitting the flow from the UPF network element to the UE, and uses the third latency as the accumulated latency of transmitting the flow from the UPF network element to the UE. However, in the prior art, clock synchronization needs to be performed between every two adjacent nodes between the UPF network element and the UE, and finally, clock synchronization between all nodes between the UPF network element and the UE is implemented, to support the TSN network on all transmission nodes between the UPF network element and the UE, so as to calculate the accumulated latency of transmitting the flow from the UPF network element to the UE. Compared with that in the prior art, the solution for the communication method is simple and easy to implement. 
     The third latency may be a maximum transmission latency of transmitting the flow from the UPF network element to the UE. 
     With reference to the first aspect, in a first possible implementation, the determining, by the SMF network element based on the first latency and the third latency, a second latency of transmitting the flow from the flow service provider in the TSN to the UE includes: determining, by the SMF network element, a sum of the first latency and the third latency as the second latency. 
     With reference to the first aspect or the first possible implementation, in a second possible implementation, the communication method further includes: determining, by the SMF network element according to the PCC rule, that a bandwidth resource can be reserved for the flow. 
     For example, before sending the second latency information to the UPF network element, the SMF network element may determine, according to the PCC rule corresponding to the flow, whether the bandwidth resource can be reserved for the flow. If determining, according to the PCC rule corresponding to the flow, that the bandwidth resource can be reserved for the flow, the SMF network element may send the second latency information to the UPF network element; otherwise, the SMF network element may not send the second latency information to the UPF network element. 
     For example, before determining the second latency based on the first latency and the third latency, the SMF network element may determine, according to the PCC rule corresponding to the flow, whether the bandwidth resource can be reserved for the flow. If determining, according to the PCC rule corresponding to the flow, that a core network and an access network can reserve the bandwidth resource for the flow, the SMF network element may determine the second latency based on the first latency and the third latency, and perform a subsequent operation. Otherwise, the SMF network element may not determine the second latency based on the first latency and the third latency, and may not perform a subsequent operation. 
     For example, before determining the third latency according to the PCC rule, the SMF network element may determine, according to the PCC rule corresponding to the flow, whether the bandwidth resource can be reserved for the flow. If determining, according to the PCC rule corresponding to the flow, that the core network and the access network can reserve the bandwidth resource for the flow, the SMF network element may determine the third latency according to the PCC rule, and perform a subsequent operation. Otherwise, the SMF network element may not determine the third latency according to the PCC rule, and may not perform a subsequent operation. 
     The SMF network element performs a subsequent related operation only when determining that the bandwidth resource can be reserved for the flow, thereby improving execution efficiency of the SMF network element. 
     Certainly, alternatively, the SMF network element may determine, only after sending the second latency information to the UPF network element, whether the UPF network element can reserve the bandwidth resource for the flow. This is not limited in this application. 
     With reference to the first aspect or the first or the second possible implementation, in a third possible implementation, the communication method further includes: sending, by the SMF network element, bandwidth requirement information of the flow to the UPF network element. 
     The SMF network element sends the bandwidth requirement message of the flow to the UPF network element, so that the UPF network element reserves the bandwidth resource for the flow based on the bandwidth requirement information. In this way, when the flow is transmitted to the UPF network element, the UPF network element may have a corresponding bandwidth resource to transmit the flow, thereby improving transmission reliability of the flow. 
     Optionally, the SMF network element may send the bandwidth requirement message of the flow to the UPF network element only when determining that the bandwidth resource can be reserved for the flow. 
     With reference to any one of the first aspect or the foregoing possible implementations, in a fourth possible implementation, the communication method further includes: sending, by the SMF network element, the bandwidth requirement information of the flow to an access network device corresponding to the UE. 
     The access network device reserves the bandwidth resource for the flow based on the bandwidth requirement information, so that the access network may have a corresponding bandwidth resource to transmit the flow, thereby improving transmission reliability of the flow. 
     It should be understood that, in this implementation, the access network device corresponding to the UE is a device that provides an access network service for the UE. 
     Optionally, the SMF network element may send the bandwidth requirement message of the flow to the access network device serving the UE only when determining that the bandwidth resource can be reserved for the flow. 
     With reference to the fourth possible implementation, in a fifth possible implementation, the communication method further includes: receiving, by the SMF network element, first information from the access network device, where the first information is used to indicate whether the access network device successfully reserves the bandwidth resource for the flow based on the bandwidth requirement information of the flow. 
     For example, before sending the second latency information to the UPF network element, the SMF network element may detect whether the first information is received from the access network device. If the SMF network element receives the first information and the first information indicates that the AN device successfully reserves the resource for the flow, the SMF network element may send the second latency information to the UPF network element. Otherwise, the SMF network element may not send the second latency information to the UPF network element. 
     For example, before determining the second latency based on the first latency and the third latency, the SMF network element may detect whether the first information is received from the access network device. If receiving the first information, the SMF network element may determine the second latency based on the first latency and the third latency, and perform a subsequent operation. Otherwise, the SMF network element may not determine the second latency based on the first latency and the third latency, and may not perform a subsequent operation. 
     For example, before determining the third latency according to the PCC rule, the SMF network element may detect whether the first information is received from the access network device. If receiving the first information, the SMF network element may determine the third latency according to the PCC rule, and perform a subsequent operation. Otherwise, the SMF network element may not determine the third latency according to the PCC rule, and does not perform a subsequent operation. 
     The SMF network element performs a subsequent related operation only when determining that the access network device can successfully reserve the bandwidth resource for the flow, thereby improving execution efficiency of the SMF network element. 
     Certainly, the SMF network element may receive the first information from the access network device only after sending the second latency information to the UPF network element. This is not limited in this application. 
     With reference to any one of the first aspect or the foregoing possible implementations, in a sixth possible implementation, the communication method further includes: sending, by the SMF network element, information about the flow to a policy control function (PCF) network element, where the information about the flow is used to determine a PCC rule of the flow; and receiving, by the SMF network element, the PCC rule from the PCF network element. 
     In this implementation, the SMF network element obtains, from the PCF network element, the PCC rule used by the SMF network element to determine the third latency or determine whether the UPF network element can reserve the bandwidth resource for the flow. 
     After obtaining the PCC rule corresponding to the flow from the PCF network element, the SMF network element may buffer the PCC rule. In this way, when the SMF network element needs to use the PCC rule corresponding to the flow next time, the PCC rule may be directly obtained from the SMF network element rather than from the PCF network element, thereby improving efficiency. 
     With reference to the sixth possible implementation, in a seventh possible implementation, the information about the flow includes at least one of the following: an identifier ID of the flow, a source address and a destination address of the flow, a size of a maximum frame used for transmitting the flow, an interval between frames used for transmitting the flow, a priority of the flow, a maximum allowable latency of transmitting a single frame of the flow from a talker to a listener, or a reliability requirement of the flow. 
     In other words, the SMF network element may send one or more pieces of the information to the PCF network element, so that the PCF network element can determine the corresponding PCC rule based on the one or more pieces of the information and return the corresponding PCC rule to the SMF network element. 
     According to a second aspect, this application provides a communication method. The communication method includes: receiving, by an SMF network element, first latency information of a flow from UE, where the first latency information is used to indicate a first latency; determining, by the SMF network element according to a PCC rule of the flow, a third latency of transmitting the flow from the UE to a UPF network element; determining, by the SMF network element based on the first latency and the third latency, a second latency of transmitting the flow from the UE to the UPF network element; and sending, by the SMF network element, second latency information to the UPF network element, where the second latency information is used to indicate the second latency. 
     In the communication method, the SMF network element receives the first latency information from the UE, and learns, based on the first latency information, of the first latency that is determined by the UE and that is of transmitting the flow from the UE to the UPF network element. In addition, the SMF network element determines, according to the PCC rule, the third latency of transmitting the flow from the UE to the UPF network element, and then, the SMF network element adjusts the first latency determined by the UE and the third latency determined by the SMF network element, to obtain the second latency of transmitting the flow from the UE to the UPF network element, so that it can be determined, based on the second latency in a communications network in which a 3GPP network interworks with the TSN, that QoS of the flow can be ensured, and the flow can be transmitted. 
     In addition, the SMF network element determines, based on the third latency of transmitting the flow from the UE to the UPF network element and the first latency that is determined by the UE, an accumulated latency of transmitting the flow from the UE to the UPF network element. However, in the prior art, clock synchronization needs to be performed between every two adjacent nodes between the UE and the UPF network element, and finally, clock synchronization between all nodes between the UE and the UPF network element is implemented, to support the TSN network on all transmission nodes between the UPF network element and the UE, so as to calculate the accumulated latency of transmitting the flow from the UE to the UPF network element. Compared with that in the prior art, the solution for the communication method is simple and easy to implement. 
     Optionally, the third latency may be a maximum transmission latency of transmitting the flow from the UE to the UPF network element. 
     With reference to the second aspect, in a first possible implementation, the determining, by the SMF network element based on the first latency and the third latency, a second latency of transmitting the flow from the UE to the UPF includes: determining, by the SMF network element, a value obtained by subtracting a default value of a transmission latency of transmitting the flow from the UE to the UPF network element from a sum of the first latency and the third latency as the second latency. 
     An example of the default value of the transmission latency of transmitting the flow from the UE to the UPF network element is 500 nanoseconds (nm). To be specific, a value obtained by subtracting 500 nm from the sum of the first latency and the third latency is determined as the second latency. 
     With reference to the second aspect or the first possible implementation, in a second possible implementation, the communication method further includes: determining, by the SMF network element according to the PCC rule, that a bandwidth resource can be reserved for the flow. 
     For example, before sending the second latency information to the UPF network element, the SMF network element may determine, according to the PCC rule corresponding to the flow, whether the bandwidth resource can be reserved for the flow. If determining, according to the PCC rule corresponding to the flow, that a core network and an access network can reserve the bandwidth resource for the flow, the SMF network element may send the second latency information to the UPF network element; otherwise, the SMF network element may not send the second latency information to the UPF network element. 
     For example, before determining the second latency based on the first latency and the third latency, the SMF network element may determine, according to the PCC rule corresponding to the flow, whether the bandwidth resource can be reserved for the flow. If determining, according to the PCC rule corresponding to the flow, that the core network and the access network can reserve the bandwidth resource for the flow, the SMF network element may determine the second latency based on the first latency and the third latency, and perform a subsequent operation. Otherwise, the SMF network element may not determine the second latency based on the first latency and the third latency, and may not perform a subsequent operation. 
     For example, before determining the third latency according to the PCC rule, the SMF network element may determine, according to the PCC rule corresponding to the flow, whether the bandwidth resource can be reserved for the flow. If determining, according to the PCC rule corresponding to the flow, that the core network and the access network can reserve the bandwidth resource for the flow, the SMF network element may determine the third latency according to the PCC rule, and perform a subsequent operation. Otherwise, the SMF network element may not determine the third latency according to the PCC rule, and may not perform a subsequent operation. 
     In this implementation, the SMF network element performs a subsequent related operation only when determining that the bandwidth resource can be reserved for the flow, thereby improving execution efficiency of the SMF network element. 
     With reference to the second possible implementation, in a third possible implementation, the communication method further includes: sending, by the SMF network element, bandwidth requirement information of the flow to the UPF network element. 
     In other words, when determining that the bandwidth resource can be reserved for the flow, the SMF network element may send the bandwidth requirement message of the flow to the UPF network element, so that the UPF network element reserves the bandwidth resource for the flow based on the bandwidth requirement information. In this way, when the flow is transmitted to the UPF network element, the UPF network element may have a corresponding bandwidth resource to transmit the flow, thereby improving transmission reliability of the flow. 
     With reference to the second or third possible implementation, in a fourth possible implementation, the communication method further includes: sending, by the SMF network element, the bandwidth requirement information of the flow to an access network device corresponding to the UE. 
     In other words, when determining that the bandwidth resource can be reserved for the flow, the SMF network element may send the bandwidth requirement message of the flow to the access network device serving the UE, so that the access network device reserves the bandwidth resource for the flow based on the bandwidth requirement information. In this way, the access network may have a corresponding bandwidth resource to transmit the flow, thereby improving transmission reliability of the flow. 
     It should be understood that, in this implementation, the access network device corresponding to the UE is a device that provides an access network service for the UE. 
     With reference to the fourth possible implementation, in a fifth possible implementation, the communication method further includes: receiving, by the SMF network element, first information from the access network device, where the first information is used to indicate whether the access network device successfully reserves the bandwidth resource for the flow based on the bandwidth requirement information of the flow. 
     For example, before sending the second latency information to the UPF network element, the SMF network element may detect whether the first information is received from the access network device. If the SMF network element receives the first information and the first information indicates that the AN device successfully reserves the resource for the flow, the SMF network element may send the second latency information to the UPF network element. Otherwise, the SMF network element may not send the second latency information to the UPF network element. 
     For example, before determining the second latency based on the first latency and the third latency, the SMF network element may detect whether the first information is received from the access network device. If receiving the first information, the SMF network element may determine the second latency based on the first latency and the third latency, and perform a subsequent operation. Otherwise, the SMF network element may not determine the second latency based on the first latency and the third latency, and may not perform a subsequent operation. 
     For example, before determining the third latency according to the PCC rule, the SMF network element may detect whether the first information is received from the access network device. If the SMF network element receives the first information, and the first information indicates that the AN device successfully reserves the resource for the flow, the SMF network element may determine the third latency according to the PCC rule, and perform a subsequent operation. Otherwise, the SMF network element may not determine the third latency according to the PCC rule, and does not perform a subsequent operation. 
     In this implementation, the SMF network element performs a subsequent related operation only when determining that the access network device can successfully reserve the bandwidth resource for the flow, thereby improving execution efficiency of the SMF network element. 
     With reference to any one of the second aspect or the foregoing possible implementations, in a sixth possible implementation, the communication method further includes: sending, by the SMF network element, information about the flow to a PCF network element, where the information about the flow is used to determine a PCC rule of the flow; and receiving, by the SMF network element, the PCC rule from the PCF network element. 
     In this implementation, the SMF network element obtains, from the PCF network element, the PCC rule used by the SMF network element to determine the third latency or determine whether the UPF network element can reserve the bandwidth resource for the flow. 
     After obtaining the PCC rule corresponding to the flow from the PCF network element, the SMF network element may buffer the PCC rule. In this way, when the SMF network element needs to use the PCC rule corresponding to the flow next time, the PCC rule may be directly obtained from the SMF network element rather than from the PCF network element, thereby improving efficiency. 
     With reference to the sixth possible implementation, in a seventh possible implementation, the information about the flow includes at least one of the following: an identifier ID of the flow, a source address and a destination address of the flow, a size of a maximum frame used for transmitting the flow, an interval between frames used for transmitting the flow, or a priority of the flow. 
     In other words, the SMF network element may send one or more pieces of the information to the PCF network element, so that the PCF network element can determine the corresponding PCC rule based on the one or more pieces of the information and return the corresponding PCC rule to the SMF network element. 
     According to a third aspect, this application provides a communication method. The communication method includes: receiving, by an SMF network element, information about a flow from UE; determining, by the SMF network element based on the information about the flow and a PCC rule of the flow, a third latency of transmitting the flow from the UE to a user plane function UPF network element; and sending, by the SMF network element, first latency information to the UE, where the first latency information is used to indicate the third latency. 
     In the communication method, the SMF network element determines, according to the PCC rule, the third latency of transmitting the flow from the UE to the UPF network element, and indicates the third latency to the UE, so that the UE can determine, based on the third latency, an accumulated latency of transmitting the flow from the UE to the UPF network element. In this way, in a communications network in which a 3GPP network interworks with the TSN, it can be determined, based on the accumulated latency, that QoS of the flow can be ensured, and the flow can be transmitted. It can be determined that QoS of the flow can be ensured, and the flow can be transmitted. 
     In addition, the SMF network element determines, according to the PCC rule, the third latency of transmitting the flow from the UE to the UPF network element, and indicates the third latency to the UE, so that the UE can determine, based on the third latency, the accumulated latency of transmitting the flow from the UE to the UPF network element. However, in the prior art, clock synchronization needs to be performed between every two adjacent nodes between the UE and the UPF network element, and finally, clock synchronization between all nodes between the UE and the UPF network element is implemented, to support the TSN network on all transmission nodes between the UPF network element and the UE, so as to calculate the accumulated latency of transmitting the flow from the UE to the UPF network element. Compared with that in the prior art, the solution for the communication method is simple and easy to implement. 
     Optionally, the third latency may be a maximum transmission latency of transmitting the flow from the UE to the UPF network element. 
     The information about the flow may include one or more of the following: an identifier ID of the flow, a source address and a destination address of the flow, a size of a maximum frame used for transmitting the flow, an interval between frames used for transmitting the flow, a priority of the flow, or information about a latency that is determined by the UE and that is of transmitting the flow from the UE to the UPF network element. 
     With reference to the third aspect, in a first possible implementation, the communication method further includes: determining, by the SMF network element according to the PCC rule, that a bandwidth resource can be reserved for the flow. 
     For example, before sending the latency information to the UE, the SMF network element may determine, according to the PCC rule corresponding to the flow, whether the bandwidth resource can be reserved for the flow. If determining, according to the PCC rule corresponding to the flow, that a core network and an access network can reserve the bandwidth resource for the flow, the SMF network element may send the latency information to the UE; otherwise, the SMF network element may not send the latency information to the UE. 
     For example, before determining the third latency according to the PCC rule, the SMF network element may determine, according to the PCC rule corresponding to the flow, whether the bandwidth resource can be reserved for the flow. If determining, according to the PCC rule corresponding to the flow, that the core network and the access network can reserve the bandwidth resource for the flow, the SMF network element may determine the third latency according to the PCC rule, and perform a subsequent operation. Otherwise, the SMF network element may not determine the third latency according to the PCC rule, and may not perform a subsequent operation. 
     In this implementation, the SMF network element performs a subsequent related operation only when determining that the bandwidth resource can be reserved for the flow, thereby improving execution efficiency of the SMF network element. 
     With reference to the first possible implementation, in a second possible implementation, the communication method further includes: sending, by the SMF network element, bandwidth requirement information of the flow to the UPF network element. 
     In other words, when determining that the bandwidth resource can be reserved for the flow, the SMF network element may send the bandwidth requirement message of the flow to the UPF network element, so that the UPF network element reserves the bandwidth resource for the flow based on the bandwidth requirement information. In this way, when the flow is transmitted to the UPF network element, the UPF network element may have a corresponding bandwidth resource to transmit the flow, thereby improving transmission reliability of the flow. 
     With reference to the first or second possible implementation, in a third possible implementation, the communication method further includes: sending, by the SMF network element, the bandwidth requirement information of the flow to an access network device corresponding to the UE. 
     In other words, when determining that the bandwidth resource can be reserved for the flow, the SMF network element may send the bandwidth requirement message of the flow to the access network device serving the UE, so that the access network device reserves the bandwidth resource for the flow based on the bandwidth requirement information. In this way, the access network may have a corresponding bandwidth resource to transmit the flow, thereby improving transmission reliability of the flow. 
     It should be understood that, in this implementation, the access network device corresponding to the UE is a device that provides an access network service for the UE. 
     With reference to the third possible implementation, in a fourth possible implementation, the communication method further includes: receiving, by the SMF network element, first information from the access network device, where the first information is used to indicate whether the access network device successfully reserves the bandwidth resource for the flow based on the bandwidth requirement information of the flow. 
     For example, before sending the latency information to the UE, the SMF network element may detect whether the first information is received from the access network device. If the SMF network element receives the first information and the first information indicates that the AN device successfully reserves the resource for the flow, the SMF network element may send the latency information to the UE. Otherwise, the SMF network element may not send the latency information to the UE. 
     For example, before determining the third latency according to the PCC rule, the SMF network element may detect whether the first information is received from the access network device. If receiving the first information, the SMF network element may determine the third latency according to the PCC rule, and perform a subsequent operation. Otherwise, the SMF network element may not determine the third latency according to the PCC rule, and does not perform a subsequent operation. 
     In this implementation, the SMF network element performs a subsequent related operation only when determining that the access network device can successfully reserve the bandwidth resource for the flow, thereby improving execution efficiency of the SMF network element. 
     With reference to any one of the third aspect or the foregoing possible implementations, in a fifth possible implementation, the communication method further includes: sending, by the SMF network element, information about the flow to a PCF network element, where the information about the flow is used to determine a PCC rule of the flow; and receiving, by the SMF network element, the PCC rule from the PCF network element. 
     In this implementation, the SMF network element obtains, from the PCF network element, the PCC rule used by the SMF network element to determine the third latency or determine whether the UPF network element can reserve the bandwidth resource for the flow. 
     After obtaining the PCC rule corresponding to the flow from the PCF network element, the SMF network element may buffer the PCC rule. In this way, when the SMF network element needs to use the PCC rule corresponding to the flow next time, the PCC rule may be directly obtained from the SMF network element rather than from the PCF network element, thereby improving efficiency. 
     With reference to the fifth possible implementation, in a sixth possible implementation, the information about the flow includes at least one of the following: an identifier ID of the flow, a source address and a destination address of the flow, a size of a maximum frame used for transmitting the flow, an interval between frames used for transmitting the flow, or a priority of the flow. 
     In other words, the SMF network element may send one or more pieces of the information to the PCF network element, so that the PCF network element can determine the corresponding PCC rule based on the one or more pieces of the information and return the corresponding PCC rule to the SMF network element. 
     According to a fourth aspect, this application provides a communication method. The communication method includes: receiving, by a UPF network element, first latency information of a flow from a TSN, where the first latency information is used to indicate a first latency of transmitting the flow from a flow service provider in the TSN to the UPF network element; sending, by the UPF network element, the first latency information to an SMF network element, where the first latency information is used to determine a second latency, and the second latency is a latency of transmitting the flow from the flow service provider in the TSN network to a terminal device UE; receiving, by the UPF network element, second latency information from the SMF network element, where the second latency information is used to indicate the second latency; and sending, by the UPF network element, the second latency information to the UE. 
     In the communication method, the UPF network element obtains, from the SMF network element, the second latency of transmitting the flow from the UPF network element to the UE, and sends the second latency to the UE, so that the flow can be transmitted based on the second latency in a communications network in which a 3GPP network interworks with the TSN. 
     In addition, in the communication method, a third latency used to determine the second latency is determined by the SMF network element according to a PCC rule corresponding to the flow. However, in the prior art, clock synchronization needs to be performed between every two adjacent nodes between the UPF network element and the UE, and finally, clock synchronization between all nodes between the UPF network element and the UE is implemented, to calculate an accumulated latency of transmitting the flow from the UPF network element to the UE. Compared with that in the prior art, the solution for the communication method is simple and easy to implement. 
     With reference to the fourth aspect, in a first possible implementation, the communication method includes: receiving, by the UPF network element, bandwidth requirement information of the flow from the SMF network element; and reserving, by the UPF network element, a bandwidth resource for the flow based on the bandwidth requirement information of the flow. 
     In the communication method, the UPF network element may reserve the bandwidth resource for the flow based on the bandwidth requirement information indicated by the SMF network element, so that when the flow is transmitted to the UPF network element, the UPF network element has a corresponding bandwidth resource to transmit the flow, thereby improving transmission reliability of the flow. 
     With reference to the first possible implementation of the fourth aspect, in a second possible implementation, the communication method further includes: receiving, by the UPF network element, first information from the SMF network element, where the first information is used to indicate whether an access network device corresponding to the UE successfully reserves the bandwidth resource for the flow based on the bandwidth requirement information of the flow. 
     If the UPF network element receives the first information from the SMF network element, and the first information indicates that the AN device successfully reserves the resource for the flow, the UPF network element may send the second latency information to the TSN, and notify the TSN network that the resource is successfully reserved. 
     According to a fifth aspect, this application provides a communication method. The communication method includes: sending, by UE, information about a flow to an SMF network element, where the information about the flow is used to determine a third latency of transmitting the flow from the UE to a UPF network element; receiving, by the UE, first latency information from the SMF network element, where the first latency information is used to indicate the third latency; determining, by the UE based on the third latency, a target latency of transmitting the flow from the UE to the UPF network element; and sending, by the UE, second latency information to the UPF network element, where the second latency information is used to indicate the target latency. 
     In the communication method, the UE obtains, from the SMF network element, the third latency of transmitting the flow from the UE to the UPF network element, and determines, based on the third latency, the target latency of transmitting the flow from the UE to the UPF network element. Compared with a method in which clock synchronization is performed between every two adjacent nodes between the UE and the UPF network element, and finally, clock synchronization of all nodes between the UE and the UPF network element is implemented, to calculate an accumulated latency of transmitting the flow from the UE to the UPF network element, the solution is simple and easy to implement. 
     According to a sixth aspect, this application provides a communication method. The communication method includes: receiving, by a UPF network element, first latency information of a flow from a TSN, where the first latency information is used to indicate a first latency of transmitting the flow from a flow service provider in the TSN to the UPF network element; sending, by the UPF network element, information about the flow to an SMF network element, where the information about the flow is used to determine a third latency of transmitting the flow from the UPF network element to UE; receiving, by the UPF network element, third latency information from the SMF network element, where the third latency information is used to indicate the third latency; determining, by the UPF network element based on the first latency and the third latency, a second latency of transmitting the flow from the flow service provider in the TSN network to the UE; and sending, by the UPF network element, second latency information to the UE, where the second latency information is used to indicate the second latency. 
     In the communication method, the UPF network element uses, as an accumulated latency of transmitting the flow from the UPF network element to the UE, the third latency that is determined by the SMF network element and that is of transmitting the flow from the UPF network element to the UE. Compared with a method in which clock synchronization is performed between every two adjacent nodes between the UPF network element and the UE, and finally, clock synchronization of all nodes between the UPF network element and the UE is implemented, to calculate the accumulated latency of transmitting the flow from the UPF network element to the UE, the solution is simple and easy to implement. 
     Optionally, the third latency may be a maximum transmission latency of transmitting the flow from the UPF network element to the UE. 
     With reference to the sixth aspect, in a first possible implementation, the determining, by the UPF network element based on the first latency and the third latency, a second latency of transmitting the flow from the flow service provider in the TSN network to the UE includes: determining, by the UPF network element, a sum of the first latency and the third latency as the second latency. 
     With reference to the sixth aspect or the first possible implementation, in a second possible implementation, the communication method includes: receiving, by the UPF network element, bandwidth requirement information of the flow from the SMF network element; and reserving, by the UPF network element, a bandwidth resource for the flow based on the bandwidth requirement information of the flow. 
     In the communication method, the UPF network element may reserve the bandwidth resource for the flow based on the bandwidth requirement information indicated by the SMF network element, so that when the flow is transmitted to the UPF network element, the UPF network element has a corresponding bandwidth resource to transmit the flow, thereby improving transmission reliability of the flow. 
     With reference to the first or the second possible implementation of the sixth aspect, in a third possible implementation, the communication method further includes: receiving, by the UPF network element, first information from the SMF network element, where the first information is used to indicate whether an access network device corresponding to the UE successfully reserves the bandwidth resource for the flow based on the bandwidth requirement information of the flow. 
     If the UPF network element receives the first information from the SMF network element, and the first information indicates that the AN device successfully reserves the resource for the flow, the UPF network element may send the second latency information to the TSN, and notify the TSN network that the resource is successfully reserved. 
     With reference to any one of the sixth aspect or the foregoing possible implementations, in a fourth possible implementation, the information about the flow includes at least one of the following: an identifier ID of the flow, a source address and a destination address of the flow, a size of a maximum frame used for transmitting the flow, an interval between frames used for transmitting the flow, a priority of the flow, a maximum allowable latency of transmitting a single frame of the flow from a talker to a listener, or a reliability requirement of the flow. 
     According to a seventh aspect, this application provides a communications apparatus. The communications apparatus includes a receiving module, a processing module, and a sending module, where the receiving module is configured to receive first latency information of a flow from a UPF network element, where the first latency information is used to indicate a first latency of transmitting the flow from a flow service provider in a TSN to the UPF network element; the processing module is configured to determine, according to a PCC rule of the flow, a third latency of transmitting the flow from the UPF network element to UE, and the processing module is configured to determine, based on the first latency and the third latency, a second latency of transmitting the flow from the flow service provider in the TSN to the UE; and the sending module is configured to send second latency information to the UPF network element, where the second latency information is used to indicate the second latency. 
     The communications apparatus determines, according to the PCC rule, the third latency of transmitting the flow from the UPF network element to the UE and uses the third latency as an accumulated latency of transmitting the flow from the UPF network element to the UE, so that the communications apparatus can determine, based on the third latency and the first latency of transmitting the flow from the flow provider in the TSN to the UPF network element, the second latency of transmitting the flow from the flow service provider in the TSN to the UE. In this way, in a communications network in which a 3GPP network interworks with the TSN, it can be determined, based on the second latency, that QoS of the flow can be ensured, and the flow can be transmitted. 
     In addition, the communications apparatus determines, according to the PCC rule, the third latency of transmitting the flow from the UPF network element to the UE, and uses the third latency as the accumulated latency of transmitting the flow from the UPF network element to the UE. However, in the prior art, clock synchronization needs to be performed between every two adjacent nodes between the UPF network element and the UE, and finally, clock synchronization between all nodes between the UPF network element and the UE is implemented, to support the TSN network on all transmission nodes between the UPF network element and the UE, so as to calculate the accumulated latency of transmitting the flow from the UPF network element to the UE. Compared with that in the prior art, the solution for the communications apparatus is simple and easy to implement. 
     The third latency may be a maximum transmission latency of transmitting the flow from the UPF network element to the UE. 
     With reference to the seventh aspect, in a first possible implementation, the processing module is specifically configured to determine a sum of the first latency and the third latency as the second latency. 
     With reference to the seventh aspect or the first possible implementation, in a second possible implementation, the processing module is configured to determine, according to the PCC rule, that a bandwidth resource can be reserved for the flow. 
     For example, before sending the second latency information to the UPF network element, the communications apparatus may determine, according to the PCC rule corresponding to the flow, that a core network and an access network reserve the bandwidth resource for the flow. If determining, according to the PCC rule corresponding to the flow, that the bandwidth resource can be reserved for the flow, the communications apparatus may send the second latency information to the UPF network element; otherwise, the communications apparatus may not send the second latency information to the UPF network element. 
     For example, before determining the second latency based on the first latency and the third latency, the communications apparatus may determine, according to the PCC rule corresponding to the flow, whether the bandwidth resource can be reserved for the flow. If determining, according to the PCC rule corresponding to the flow, that the core network and the access network can reserve the bandwidth resource for the flow, the communications apparatus may determine the second latency based on the first latency and the third latency, and perform a subsequent operation. Otherwise, the communications apparatus may not determine the second latency based on the first latency and the third latency, and may not perform a subsequent operation. 
     For example, before determining the third latency according to the PCC rule, the communications apparatus may determine, according to the PCC rule corresponding to the flow, whether the bandwidth resource can be reserved for the flow. If determining, according to the PCC rule corresponding to the flow, that the core network and the access network can reserve the bandwidth resource for the flow, the communications apparatus may determine the third latency according to the PCC rule, and perform a subsequent operation. Otherwise, the communications apparatus may not determine the third latency according to the PCC rule, and may not perform a subsequent operation. 
     The communications apparatus performs a subsequent related operation only when determining that the bandwidth resource can be reserved for the flow, thereby improving execution efficiency of the communications apparatus. 
     Certainly, alternatively, the communications apparatus may determine, only after sending the second latency information to the UPF network element, whether the bandwidth resource can be reserved for the flow. This is not limited in this application. 
     With reference to the seventh aspect or the first or the second possible implementation, in a third possible implementation, the sending module is configured to send bandwidth requirement information of the flow to the UPF network element. 
     The communications apparatus sends the bandwidth requirement message of the flow to the UPF network element, so that the UPF network element reserves the bandwidth resource for the flow based on the bandwidth requirement information. In this way, when the flow is transmitted to the UPF network element, the UPF network element may have a corresponding bandwidth resource to transmit the flow, thereby improving transmission reliability of the flow. 
     Optionally, the communications apparatus may send the bandwidth requirement message of the flow to the UPF network element only when determining that the bandwidth resource can be reserved for the flow. 
     With reference to any one of the seventh aspect or the foregoing possible implementations, in a fourth possible implementation, the sending module is configured to send the bandwidth requirement information of the flow to an access network device corresponding to the UE. 
     The access network device reserves the bandwidth resource for the flow based on the bandwidth requirement information, so that the access network may have a corresponding bandwidth resource to transmit the flow, thereby improving transmission reliability of the flow. 
     It should be understood that, in this implementation, the access network device corresponding to the UE is a device that provides an access network service for the UE. 
     Optionally, the communications apparatus may send the bandwidth requirement message of the flow to the access network device serving the UE only when determining that the bandwidth resource can be reserved for the flow. 
     With reference to the fourth possible implementation, in a fifth possible implementation, the receiving module is configured to receive first information from the access network device, where the first information is used to indicate whether the access network device successfully reserves the bandwidth resource for the flow based on the bandwidth requirement information of the flow. 
     For example, before sending the second latency information to the UPF network element, the communications apparatus may detect whether the first information is received from the access network device. If the communications apparatus receives the first information and the first information indicates that the AN device successfully reserves the resource for the flow, the communications apparatus may send the second latency information to the UPF network element. Otherwise, the communications apparatus may not send the second latency information to the UPF network element. 
     For example, before determining the second latency based on the first latency and the third latency, the communications apparatus may detect whether the first information is received from the access network device. If receiving the first information, the communications apparatus may determine the second latency based on the first latency and the third latency, and perform a subsequent operation. Otherwise, the communications apparatus may not determine the second latency based on the first latency and the third latency, and may not perform a subsequent operation. 
     For example, before determining the third latency according to the PCC rule, the communications apparatus may detect whether the first information is received from the access network device. If receiving the first information, the communications apparatus may determine the third latency according to the PCC rule, and perform a subsequent operation. Otherwise, the communications apparatus may not determine the third latency according to the PCC rule, and does not perform a subsequent operation. 
     The communications apparatus performs a subsequent related operation only when determining that the access network device can successfully reserve the bandwidth resource for the flow, thereby improving execution efficiency of the communications apparatus. 
     Certainly, the communications apparatus may receive the first information from the access network device only after sending the second latency information to the UPF network element. This is not limited in this application. 
     With reference to any one of the seventh aspect or the foregoing possible implementations, in a sixth possible implementation, the sending module is configured to send information about the flow to a PCF network element, where the information about the flow is used to determine a PCC rule of the flow; and the receiving module is configured to receive the PCC rule from the PCF network element. 
     In this implementation, the communications apparatus obtains, from the PCF network element, the PCC rule used by the communications apparatus to determine the third latency or determine whether the UPF network element can reserve the bandwidth resource for the flow. 
     After obtaining the PCC rule corresponding to the flow from the PCF network element, the communications apparatus may buffer the PCC rule. In this way, when the communications apparatus needs to use the PCC rule corresponding to the flow next time, the PCC rule may be directly obtained from the communications apparatus rather than from the PCF network element, thereby improving efficiency. 
     With reference to the sixth possible implementation, in a seventh possible implementation, the information about the flow includes at least one of the following: an identifier ID of the flow, a source address and a destination address of the flow, a size of a maximum frame used for transmitting the flow, an interval between frames used for transmitting the flow, a priority of the flow, a maximum allowable latency of transmitting a single frame of the flow from a talker to a listener, or a reliability requirement of the flow. 
     In other words, the communications apparatus may send one or more pieces of the information to the PCF network element, so that the PCF network element can determine the corresponding PCC rule based on the one or more pieces of the information and return the corresponding PCC rule to the SMF network element. 
     The modules included in the communications apparatus in the seventh aspect may be implemented in a software and/or hardware manner. 
     For example, the receiving module may be a receiver, the sending module may be a transmitter, and the processing module may be a processor. The receiver and the transmitter may be integrated together and referred to as a transceiver. In this case, the communications apparatus may be an SMF network element. 
     For another example, the processing module may be a processor, and the receiving module and the sending module may be communications interfaces. In this case, the communications apparatus may be a chip, for example, may be a chip that can be integrated into the SMF network element. 
     Optionally, the communications apparatus may further include a memory, configured to store program code executed by the processor. 
     According to an eighth aspect, this application provides a communications apparatus. The communications apparatus includes a receiving module, a processing module, and a sending module, where the receiving module is configured to receive first latency information of a flow from UE, where the first latency information is used to indicate a first latency; the processing module is configured to determine, according to a PCC rule of the flow, a third latency of transmitting the flow from the UE to a UPF network element; the processing module is configured to determine, based on the first latency and the third latency, a second latency of transmitting the flow from the UE to the UPF network element; and the sending module is configured to send second latency information to the UPF network element, where the second latency information is used to indicate the second latency. 
     The communications apparatus receives the first latency information from the UE, and learns, based on the first latency information, of the first latency that is determined by the UE and that is of transmitting the flow from the UE to the UPF network element. In addition, the communications apparatus determines, according to the PCC rule, the third latency of transmitting the flow from the UE to the UPF network element, and then, adjusts the first latency determined by the UE and the third latency determined by the communications apparatus, to obtain the second latency of transmitting the flow from the UE to the UPF network element, so that it can be determined, based on the second latency in a communications network in which a 3GPP network interworks with the TSN, that QoS of the flow can be ensured, and the flow can be transmitted. 
     In addition, the communications apparatus determines, based on the third latency of transmitting the flow from the UE to the UPF network element and the first latency that is determined by the UE, an accumulated latency of transmitting the flow from the UE to the UPF network element. However, in the prior art, clock synchronization needs to be performed between every two adjacent nodes between the UE and the UPF network element, and finally, clock synchronization between all nodes between the UE and the UPF network element is implemented, to support the TSN network on all transmission nodes between the UPF network element and the UE, so as to calculate the accumulated latency of transmitting the flow from the UE to the UPF network element. Compared with that in the prior art, the solution for the communications apparatus is simple and easy to implement. 
     Optionally, the third latency may be a maximum transmission latency of transmitting the flow from the UE to the UPF network element. 
     With reference to the eighth aspect, in a first possible implementation, the processing module is specifically configured to determine a value obtained by subtracting a default value of a transmission latency of transmitting the flow from the UE to the UPF network element from a sum of the first latency and the third latency as the second latency. 
     An example of the default value of the transmission latency of transmitting the flow from the UE to the UPF network element is 500 nanoseconds (nm). To be specific, a value obtained by subtracting 500 nm from the sum of the first latency and the third latency is determined as the second latency. 
     With reference to the eighth aspect or the first possible implementation, in a second possible implementation, the processing module is configured to determine, according to the PCC rule, that a bandwidth resource can be reserved for the flow. 
     For example, before sending the second latency information to the UPF network element, the communications apparatus may determine, according to the PCC rule corresponding to the flow, whether the bandwidth resource can be reserved for the flow. If determining, according to the PCC rule corresponding to the flow, that a core network and an access network can reserve the bandwidth resource for the flow, the communications apparatus may send the second latency information to the UPF network element; otherwise, the communications apparatus may not send the second latency information to the UPF network element. 
     For example, before determining the second latency based on the first latency and the third latency, the communications apparatus may determine, according to the PCC rule corresponding to the flow, whether the bandwidth resource can be reserved for the flow. If determining, according to the PCC rule corresponding to the flow, that the core network and the access network can reserve the bandwidth resource for the flow, the communications apparatus may determine the second latency based on the first latency and the third latency, and perform a subsequent operation. Otherwise, the communications apparatus may not determine the second latency based on the first latency and the third latency, and may not perform a subsequent operation. 
     For example, before determining the third latency according to the PCC rule, the communications apparatus may determine, according to the PCC rule corresponding to the flow, whether the bandwidth resource can be reserved for the flow. If determining, according to the PCC rule corresponding to the flow, that the core network and the access network can reserve the bandwidth resource for the flow, the communications apparatus may determine the third latency according to the PCC rule, and perform a subsequent operation. Otherwise, the communications apparatus may not determine the third latency according to the PCC rule, and may not perform a subsequent operation. 
     In this implementation, the communications apparatus performs a subsequent related operation only when determining that the bandwidth resource can be reserved for the flow, thereby improving execution efficiency of the communications apparatus. 
     With reference to the second possible implementation, in a third possible implementation, the sending module is configured to send bandwidth requirement information of the flow to the UPF network element. 
     In other words, when determining that the bandwidth resource can be reserved for the flow, the communications apparatus may send the bandwidth requirement message of the flow to the UPF network element, so that the UPF network element reserves the bandwidth resource for the flow based on the bandwidth requirement information. In this way, when the flow is transmitted to the UPF network element, the UPF network element may have a corresponding bandwidth resource to transmit the flow, thereby improving transmission reliability of the flow. 
     With reference to the second or the third possible implementation, in a fourth possible implementation, the sending module is configured to send the bandwidth requirement information of the flow to an access network device corresponding to the UE. 
     In other words, when determining that the bandwidth resource can be reserved for the flow, the communications apparatus may send the bandwidth requirement message of the flow to the access network device serving the UE, so that the access network device reserves the bandwidth resource for the flow based on the bandwidth requirement information. In this way, the access network may have a corresponding bandwidth resource to transmit the flow, thereby improving transmission reliability of the flow. 
     It should be understood that, in this implementation, the access network device corresponding to the UE is a device that provides an access network service for the UE. 
     With reference to the fourth possible implementation, in a fifth possible implementation, the receiving module is configured to receive first information from the access network device, where the first information is used to indicate whether the access network device successfully reserves the bandwidth resource for the flow based on the bandwidth requirement information of the flow. 
     For example, before sending the second latency information to the UPF network element, the communications apparatus may detect whether the first information is received from the access network device. If the communications apparatus receives the first information and the first information indicates that the AN device successfully reserves the resource for the flow, the communications apparatus may send the second latency information to the UPF network element. Otherwise, the communications apparatus may not send the second latency information to the UPF network element. 
     For example, before determining the second latency based on the first latency and the third latency, the communications apparatus may detect whether the first information is received from the access network device. If receiving the first information, the communications apparatus may determine the second latency based on the first latency and the third latency, and perform a subsequent operation. Otherwise, the communications apparatus may not determine the second latency based on the first latency and the third latency, and may not perform a subsequent operation. 
     For example, before determining the third latency according to the PCC rule, the communications apparatus may detect whether the first information is received from the access network device. If receiving the first information, the communications apparatus may determine the third latency according to the PCC rule, and perform a subsequent operation. Otherwise, the communications apparatus may not determine the third latency according to the PCC rule, and does not perform a subsequent operation. 
     In this implementation, the communications apparatus performs a subsequent related operation only when determining that the access network device can successfully reserve the bandwidth resource for the flow, thereby improving execution efficiency of the SMF network element. 
     With reference to any one of the eighth aspect or the foregoing possible implementations, in a sixth possible implementation, the sending module is configured to send information about the flow to a PCF network element, where the information about the flow is used to determine a PCC rule of the flow; and the SMF network element receives the PCC rule from the PCF network element. 
     In this implementation, the communications apparatus obtains, from the PCF network element, the PCC rule used by the communications apparatus to determine the third latency or determine whether the UPF network element can reserve the bandwidth resource for the flow. 
     After obtaining the PCC rule corresponding to the flow from the PCF network element, the communications apparatus may buffer the PCC rule. In this way, when the communications apparatus needs to use the PCC rule corresponding to the flow next time, the PCC rule may be directly obtained from the communications apparatus rather than from the PCF network element, thereby improving efficiency. 
     With reference to the sixth possible implementation, in a seventh possible implementation, the information about the flow includes at least one of the following: an identifier ID of the flow, a source address and a destination address of the flow, a size of a maximum frame used for transmitting the flow, an interval between frames used for transmitting the flow, or a priority of the flow. 
     In other words, the communications apparatus may send one or more pieces of the information to the PCF network element, so that the PCF network element can determine the corresponding PCC rule based on the one or more pieces of the information and return the corresponding PCC rule to the communications apparatus. 
     The modules included in the communications apparatus in the eighth aspect may be implemented in a software and/or hardware manner. 
     For example, the receiving module may be a receiver, the sending module may be a transmitter, and the processing module may be a processor. The receiver and the transmitter may be integrated together and referred to as a transceiver. In this case, the communications apparatus may be an SMF network element. 
     For another example, the processing module may be a processor, and the receiving module and the sending module may be communications interfaces. In this case, the communications apparatus may be a chip, for example, may be a chip that can be integrated into the SMF network element. 
     Optionally, the communications apparatus may further include a memory, configured to store program code executed by the processor. 
     According to a ninth aspect, this application provides a communications apparatus. The communications apparatus includes a receiving module, a processing module, and a sending module, where the receiving module is configured to receive information about a flow from UE; the processing module is configured to: determine, based on the information about the flow and a PCC rule of the flow, a third latency of transmitting the flow from the UE to a user plane function UPF network element; and the sending module is configured to send first latency information to the UE, where the first latency information is used to indicate the third latency. 
     The communications apparatus determines, according to the PCC rule, the third latency of transmitting the flow from the UE to the UPF network element, and indicates the third latency to the UE, so that the UE can determine, based on the third latency, an accumulated latency of transmitting the flow from the UE to the UPF network element. In this way, in a communications network in which a 3GPP network interworks with the TSN, it can be determined, based on the accumulated latency, that QoS of the flow can be ensured, and the flow can be transmitted. It can be determined that QoS of the flow can be ensured, and the flow can be transmitted. 
     In addition, the communications apparatus determines, according to the PCC rule, the third latency of transmitting the flow from the UE to the UPF network element, and indicates the third latency to the UE, so that the UE can determine, based on the third latency, the accumulated latency of transmitting the flow from the UE to the UPF network element. However, in the prior art, clock synchronization needs to be performed between every two adjacent nodes between the UE and the UPF network element, and finally, clock synchronization between all nodes between the UE and the UPF network element is implemented, to support the TSN network on all transmission nodes between the UPF network element and the UE, so as to calculate the accumulated latency of transmitting the flow from the UE to the UPF network element. Compared with that in the prior art, the solution for the communications apparatus is simple and easy to implement. 
     Optionally, the third latency may be a maximum transmission latency of transmitting the flow from the UE to the UPF network element. 
     The information about the flow may include one or more of the following: an identifier ID of the flow, a source address and a destination address of the flow, a size of a maximum frame used for transmitting the flow, an interval between frames used for transmitting the flow, a priority of the flow, or information about a latency that is determined by the UE and that is of transmitting the flow from the UE to the UPF network element. 
     With reference to the ninth aspect, in a first possible implementation, the processing module is configured to determine, according to the PCC rule, that a bandwidth resource can be reserved for the flow. 
     For example, before sending the latency information to the UE, the communications apparatus may determine, according to the PCC rule corresponding to the flow, whether the bandwidth resource can be reserved for the flow. If determining, according to the PCC rule corresponding to the flow, that a core network and an access network can reserve the bandwidth resource for the flow, the communications apparatus may send the latency information to the UE; otherwise, the communications apparatus may not send the latency information to the UE. 
     For example, before determining the third latency according to the PCC rule, the communications apparatus may determine, according to the PCC rule corresponding to the flow, whether the bandwidth resource can be reserved for the flow. If determining, according to the PCC rule corresponding to the flow, that the core network and the access network can reserve the bandwidth resource for the flow, the communications apparatus may determine the third latency according to the PCC rule, and perform a subsequent operation. Otherwise, the communications apparatus may not determine the third latency according to the PCC rule, and may not perform a subsequent operation. 
     In this implementation, the communications apparatus performs a subsequent related operation only when determining that the bandwidth resource can be reserved for the flow, thereby improving execution efficiency of the communications apparatus. 
     With reference to the first possible implementation, in a second possible implementation, the sending module is configured to send bandwidth requirement information of the flow to the UPF network element. 
     In other words, when determining that the bandwidth resource can be reserved for the flow, the communications apparatus may send the bandwidth requirement message of the flow to the UPF network element, so that the UPF network element reserves the bandwidth resource for the flow based on the bandwidth requirement information. In this way, when the flow is transmitted to the UPF network element, the UPF network element may have a corresponding bandwidth resource to transmit the flow, thereby improving transmission reliability of the flow. 
     With reference to the first or the second possible implementation, in a third possible implementation, the sending module is configured to send the bandwidth requirement information of the flow to an access network device corresponding to the UE. 
     In other words, when determining that the bandwidth resource can be reserved for the flow, the communications apparatus may send the bandwidth requirement message of the flow to the access network device serving the UE, so that the access network device reserves the bandwidth resource for the flow based on the bandwidth requirement information. In this way, the access network may have a corresponding bandwidth resource to transmit the flow, thereby improving transmission reliability of the flow. 
     It should be understood that, in this implementation, the access network device corresponding to the UE is a device that provides an access network service for the UE. 
     With reference to the third possible implementation, in a fourth possible implementation, the receiving module is configured to receive first information from the access network device, where the first information is used to indicate whether the access network device successfully reserves the bandwidth resource for the flow based on the bandwidth requirement information of the flow. 
     For example, before sending the latency information to the UE, the communications apparatus may detect whether the first information is received from the access network device. If the communications apparatus receives the first information and the first information indicates that the AN device successfully reserves the resource for the flow, the communications apparatus may send the latency information to the UE. Otherwise, the communications apparatus may not send the latency information to the UE. 
     For example, before determining the third latency according to the PCC rule, the communications apparatus may detect whether the first information is received from the access network device. If receiving the first information, the communications apparatus may determine the third latency according to the PCC rule, and perform a subsequent operation. Otherwise, the communications apparatus may not determine the third latency according to the PCC rule, and does not perform a subsequent operation. 
     In this implementation, the communications apparatus performs a subsequent related operation only when determining that the access network device can successfully reserve the bandwidth resource for the flow, thereby improving execution efficiency of the communications apparatus. 
     With reference to any one of the ninth aspect or the foregoing possible implementations, in a fifth possible implementation, the sending module is configured to send information about the flow to a PCF network element, where the information about the flow is used to determine a PCC rule of the flow; and the receiving module is configured to receive the PCC rule from the PCF network element. 
     In this implementation, the communications apparatus obtains, from the PCF network element, the PCC rule used by the communications apparatus to determine the third latency or determine whether the UPF network element can reserve the bandwidth resource for the flow. 
     After obtaining the PCC rule corresponding to the flow from the PCF network element, the communications apparatus may buffer the PCC rule. In this way, when the communications apparatus needs to use the PCC rule corresponding to the flow next time, the PCC rule may be directly obtained from the communications apparatus rather than from the PCF network element, thereby improving efficiency. 
     With reference to the fifth possible implementation, in a sixth possible implementation, the information about the flow includes at least one of the following: an identifier ID of the flow, a source address and a destination address of the flow, a size of a maximum frame used for transmitting the flow, an interval between frames used for transmitting the flow, or a priority of the flow. 
     In other words, the communications apparatus may send one or more pieces of the information to the PCF network element, so that the PCF network element can determine the corresponding PCC rule based on the one or more pieces of the information and return the corresponding PCC rule to the communications apparatus. 
     The modules included in the communications apparatus in the ninth aspect may be implemented in a software and/or hardware manner. 
     For example, the receiving module may be a receiver, the sending module may be a transmitter, and the processing module may be a processor. The receiver and the transmitter may be integrated together and referred to as a transceiver. In this case, the communications apparatus may be an SMF network element. 
     For another example, the processing module may be a processor, and the receiving module and the sending module may be communications interfaces. In this case, the communications apparatus may be a chip, for example, may be a chip that can be integrated into the SMF network element. 
     Optionally, the communications apparatus may further include a memory, configured to store program code executed by the processor. 
     According to a tenth aspect, this application provides a communications apparatus. The communications apparatus includes a receiving module and a sending module, where the receiving module is configured to receive first latency information of a flow from a TSN, where the first latency information is used to indicate a first latency of transmitting the flow from a flow service provider in the TSN to the UPF network element; the sending module is configured to send the first latency information to an SMF network element, where the first latency information is used to determine a second latency, and the second latency is a latency of transmitting the flow from the flow service provider in the TSN network to a terminal device UE; the receiving module is configured to receive second latency information from the SMF network element, where the second latency information is used to indicate the second latency; and the sending module is configured to send the second latency information to the UE. 
     The communications apparatus obtains, from the SMF network element, the second latency of transmitting the flow from the UPF network element to the UE, and sends the second latency to the UE, so that the flow can be transmitted based on the second latency in a communications network in which a 3GPP network interworks with the TSN. 
     In addition, in the communications apparatus, a third latency used to determine the second latency is determined by the SMF network element according to a PCC rule corresponding to the flow. However, in the prior art, clock synchronization needs to be performed between every two adjacent nodes between the UPF network element and the UE, and finally, clock synchronization between all nodes between the UPF network element and the UE is implemented, to calculate an accumulated latency of transmitting the flow from the UPF network element to the UE. Compared with that in the prior art, the solution for the communications apparatus is simple and easy to implement. 
     The third latency may be a maximum transmission latency of transmitting the flow from the UPF network element to the UE. 
     With reference to the tenth aspect, in a first possible implementation, the receiving module is configured to receive bandwidth requirement information of the flow from the SMF network element; and the communications apparatus further includes a processing module, where the processing module is configured to reserve a bandwidth resource for the flow based on the bandwidth requirement information of the flow. 
     The communications apparatus may reserve the bandwidth resource for the flow based on the bandwidth requirement information indicated by the SMF network element, so that when the flow is transmitted to the UPF network element, the communications apparatus has a corresponding bandwidth resource to transmit the flow, thereby improving transmission reliability of the flow. 
     With reference to the tenth aspect or the first possible implementation, in a second possible implementation, the receiving module is configured to receive first information from the SMF network element, where the first information is used to indicate whether an access network device corresponding to the UE successfully reserves the bandwidth resource for the flow based on the bandwidth requirement information of the flow. 
     If the communications apparatus receives the first information from the SMF network element, and the first information indicates that the AN device successfully reserves the resource for the flow, the communications apparatus may send the second latency information to the TSN, and notify the TSN network that the resource is successfully reserved. 
     The modules included in the communications apparatus in the tenth aspect may be implemented in a software and/or hardware manner. 
     For example, the receiving module may be a receiver, the sending module may be a transmitter, and the processing module may be a processor. The receiver and the transmitter may be integrated together and referred to as a transceiver. In this case, the communications apparatus may be a UPF network element. 
     For another example, the processing module may be a processor, and the receiving module and the sending module may be communications interfaces. In this case, the communications apparatus may be a chip, for example, may be a chip that can be integrated into the UPF network element. 
     Optionally, the communications apparatus may further include a memory, configured to store program code executed by the processor. 
     According to an eleventh aspect, this application provides a communications apparatus. The communications apparatus includes a sending module, a receiving module, and a processing module, where the sending module is configured to send information about a flow to an SMF network element, where the information about the flow is used to determine a third latency of transmitting the flow from the UE to a UPF network element; the receiving module is configured to receive first latency information from the SMF network element, where the first latency information is used to indicate the third latency; the processing module is configured to determine, based on the third latency, a target latency of transmitting the flow from the UE to the UPF network element; and the sending module is configured to send second latency information to the UPF network element, where the second latency information is used to indicate the target latency. 
     The communications apparatus obtains, from the SMF network element, the third latency of transmitting the flow from the UE to the UPF network element, and determines, based on the third latency, the target latency of transmitting the flow from the UE to the UPF network element. Compared with a method in which clock synchronization is performed between every two adjacent nodes between the UE and the UPF network element, and finally, clock synchronization of all nodes between the UE and the UPF network element is implemented, to calculate an accumulated latency of transmitting the flow from the UE to the UPF network element, the solution is simple and easy to implement. 
     The third latency may be a maximum transmission latency of transmitting the flow from the UE to the UPF network element. 
     The modules included in the communications apparatus in the eleventh aspect may be implemented in a software and/or hardware manner. 
     For example, the receiving module may be a receiver, the sending module may be a transmitter, and the processing module may be a processor. The receiver and the transmitter may be integrated together and referred to as a transceiver. In this case, the communications apparatus may be UE. 
     For another example, the processing module may be a processor, and the receiving module and the sending module may be communications interfaces. In this case, the communications apparatus may be a chip, for example, may be a chip that can be integrated into the UE. 
     Optionally, the communications apparatus may further include a memory, configured to store program code executed by the processor. 
     According to a twelfth aspect, this application provides a communications apparatus. The communications apparatus includes a receiving module, a sending module, and a processing module, where the receiving module is configured to receive first latency information of a flow from a TSN, where the first latency information is used to indicate a first latency of transmitting the flow from a flow service provider in the TSN to the UPF network element; the sending module is configured to send information about the flow to an SMF network element, where the information about the flow is used to determine a third latency of transmitting the flow from the UPF network element to UE; the processing module is configured to receive third latency information from the SMF network element, where the third latency information is used to indicate the third latency; the processing module is configured to determine, based on the first latency and the third latency, a second latency of transmitting the flow from the flow service provider in the TSN network to the UE; and the sending module is configured to send second latency information to the UE, where the second latency information is used to indicate the second latency. 
     The communications apparatus uses, as an accumulated latency of transmitting the flow from the UPF network element to the UE, the third latency that is determined by the SMF network element and that is of transmitting the flow from the UPF network element to the UE. Compared with a method in which clock synchronization is performed between every two adjacent nodes between the UPF network element and the UE, and finally, clock synchronization of all nodes between the UPF network element and the UE is implemented, to calculate the accumulated latency of transmitting the flow from the UPF network element to the UE, the solution is simple and easy to implement. 
     The third latency may be a maximum transmission latency of transmitting the flow from the UPF network element to the UE. 
     With reference to the twelfth aspect, in a first possible implementation, the processing module is specifically configured to determine a sum of the first latency and the third latency as the second latency. 
     With reference to the twelfth aspect or the first possible implementation, in a second possible implementation, the receiving module is configured to receive bandwidth requirement information of the flow from the SMF network element; and the processing module is configured to reserve a bandwidth resource for the flow based on the bandwidth requirement information of the flow. 
     The communications apparatus may reserve the bandwidth resource for the flow based on the bandwidth requirement information indicated by the SMF network element, so that when the flow is transmitted to the communications apparatus, the communications apparatus has a corresponding bandwidth resource to transmit the flow, thereby improving transmission reliability of the flow. 
     With reference to the twelfth aspect or the first or the second possible implementation, in a third possible implementation, the receiving module is configured to receive first information from the SMF network element, where the first information is used to indicate whether an access network device corresponding to the UE successfully reserves the bandwidth resource for the flow based on the bandwidth requirement information of the flow. 
     If the communications apparatus receives the first information from the SMF network element, and the first information indicates that the AN device successfully reserves the resource for the flow, the communications apparatus may send the second latency information to the TSN, and notify the TSN network that the resource is successfully reserved. 
     With reference to any one of the twelfth aspect or the foregoing possible implementations, in a fourth possible implementation, the information about the flow includes at least one of the following: an identifier ID of the flow, a source address and a destination address of the flow, a size of a maximum frame used for transmitting the flow, an interval between frames used for transmitting the flow, a priority of the flow, a maximum allowable latency of transmitting a single frame of the flow from a talker to a listener, or a reliability requirement of the flow. 
     The modules included in the communications apparatus in the twelfth aspect may be implemented in a software and/or hardware manner. 
     For example, the receiving module may be a receiver, the sending module may be a transmitter, and the processing module may be a processor. The receiver and the transmitter may be integrated together and referred to as a transceiver. In this case, the communications apparatus may be a UPF network element. 
     For another example, the processing module may be a processor, and the receiving module and the sending module may be communications interfaces. In this case, the communications apparatus may be a chip, for example, may be a chip that can be integrated into the UPF network element. 
     Optionally, the communications apparatus may further include a memory, configured to store program code executed by the processor. 
     According to a thirteenth aspect, this application provides a computer-readable storage medium. The computer-readable storage medium stores program code to be executed by the communications apparatus. The program code includes an instruction used to perform the communication method in any one of the first aspect to the sixth aspect or the possible implementations of the first aspect to the sixth aspect. 
     According to a fourteenth aspect, this application provides a computer program product that includes an instruction. When the computer program product runs on a communications apparatus, the communications apparatus is enabled to perform the communication method in any one of the first aspect to the sixth aspect or the possible implementations of the first aspect to the sixth aspect. 
     According to a fifteenth aspect, this application provides a communication method. The communication method includes: receiving, by an SMF network element, first latency information of a flow from a first communications device, where the first latency information is used to indicate a first latency of transmitting the flow from a flow service provider in a TSN to the first communications device; determining, by the SMF network element according to a PCC rule of the flow, a first target latency of transmitting the flow from the first communications device to a second communications device; determining, by the SMF network element based on the first latency, the first target latency, and a second target latency, a third latency of transmitting the flow from the flow service provider to a target network element that is in the TSN and that is used as a next hop of the second communications device, and the second target latency is a latency of transmitting the flow from the second communications device to the target network element; and sending, by the SMF network element, third latency information to the first communications device, where the third latency information is used to indicate the third latency, where the first communications device is a UPF network element, and the second communications device is UE, or the first communications device is the UE, and the second communications device is the UPF network element. 
     In the communication method, an accumulated latency of transmitting the flow from the flow service provider to the target network element that is in the TSN network and that is used as the next hop of the second communications device may be obtained, and a method for obtaining the accumulated latency is relatively simple, because in the communication method, the accumulated latency can also be obtained through calculation without requiring that the UE or the UPF network element and each device between the UE and the UPF network element are synchronized with a master clock source. 
     In a possible implementation, the determining, by the SMF network element, a third latency based on the first latency, the first target latency, and a second target latency includes: using, by the SMF network element, a sum of the first latency, the first target latency, and the second target latency as the third latency. 
     In a possible implementation, the first target latency is a maximum transmission latency of the flow between the UPF network element and the UE. 
     In a possible implementation, the communication method further includes: determining, by the SMF network element according to the PCC rule, that a bandwidth resource can be reserved for the flow. 
     In a possible implementation, the communication method further includes: sending, by the SMF network element, bandwidth requirement information of the flow to the UPF network element. 
     In a possible implementation, the communication method further includes: sending, by the SMF network element, the bandwidth requirement information of the flow to an access network device corresponding to the UE. 
     In a possible implementation, the communication method further includes: receiving, by the SMF network element, first information from the access network device, where the first information is used to indicate whether the access network device successfully reserves the bandwidth resource for the flow based on the bandwidth requirement information of the flow. 
     In a possible implementation, the communication method further includes: sending, by the SMF network element, information about the flow to a PCF network element, where the information about the flow is used to determine a PCC rule of the flow; and receiving, by the SMF network element, the PCC rule from the PCF network element. 
     For the communication method in the fifteenth aspect, refer to the steps performed by the SMF network element in the communication method described in  FIG. 24  or  FIG. 30 . 
     According to a sixteenth aspect, this application provides a communication method. The communication method includes: receiving, by an SMF network element, first latency information of a flow from a UPF network element or UE, where the first latency information is used to indicate a first latency of transmitting the flow from a flow service provider in a TSN to a first communications device; determining, by the SMF network element according to a PCC rule of the flow, a first target latency of transmitting the flow between the UPF network element and the UE; determining, by the SMF network element based on the first latency and the first target latency, a second latency of transmitting the flow from the flow service provider in the TSN to a second communications device; and sending, by the SMF network element, second latency information to the UPF network element or the UE, where the second latency information is used to indicate the second latency, where the first communications device is the UPF network element, and the second communications device is the UE, or the first communications device is the UE, and the second communications device is the UPF network element. 
     In the communication method, an accumulated latency of transmitting the flow from the flow service provider to the second communications device that is in 3GPP and that is used as an output port may be obtained, so that the second communications device can calculate, based on the accumulated latency, a total latency of transmitting the flow from the flow service provider to the target network element that is in the TSN and that is used as a next hop of the second communications device, and a method for obtaining the accumulated latency is relatively simple, because in the communication method, the accumulated latency can also be obtained through calculation without requiring that the UE or the UPF network element and each device between the UE and the UPF network element are synchronized with a master clock source. 
     In a possible implementation, the determining, by the SMF network element, a second latency based on the first latency and the first target latency includes: using a sum of the first latency and the first target latency as the second latency. 
     In a possible implementation, the first target latency is a maximum transmission latency of the flow between the UPF network element and the UE. 
     In a possible implementation, the communication method further includes: determining, by the SMF network element according to the PCC rule, that a bandwidth resource can be reserved for the flow. 
     In a possible implementation, the communication method further includes: sending, by the SMF network element, bandwidth requirement information of the flow to the UPF network element. 
     In a possible implementation, the communication method further includes: sending, by the SMF network element, the bandwidth requirement information of the flow to an access network device corresponding to the UE. 
     In a possible implementation, the communication method further includes: receiving, by the SMF network element, first information from the access network device, where the first information is used to indicate whether the access network device successfully reserves the bandwidth resource for the flow based on the bandwidth requirement information of the flow. 
     In a possible implementation, the communication method further includes: sending, by the SMF network element, information about the flow to a PCF network element, where the information about the flow is used to determine a PCC rule of the flow; and receiving, by the SMF network element, the PCC rule from the PCF network element. 
     For the communication method in the sixteenth aspect, refer to the steps performed by the SMF network element in the communication method described in  FIG. 20 ,  FIG. 22 ,  FIG. 26 ,  FIG. 28 ,  FIG. 32 , or  FIG. 33 . 
     According to a seventeenth aspect, this application provides a communication method. The communication method includes: receiving, by a UPF network element, first latency information of a flow from a TSN, where the first latency information is used to indicate a first latency of transmitting the flow from a flow service provider in the TSN to the UPF network element; sending, by the UPF network element, information about the flow to an SMF network element, where the information about the flow is used to determine a quality of service parameter corresponding to the flow; receiving, by the UPF network element, the quality of service parameter from the SMF network element; determining, by the UPF network element based on the quality of service parameter, a first target latency of transmitting the flow from the UPF network element to the UE; determining, by the UPF network element, a second latency based on the first latency and the first target latency, where the second latency is a latency of transmitting the flow from the flow service provider to the UE; and sending, by the UPF network element, second latency information to the UE, where the second latency information is used to indicate the second latency. 
     In the communication method, an accumulated latency of transmitting the flow from the flow service provider to the UE that is in 3GPP and that is used as an output port may be obtained, so that the UPF network element can calculate, based on the accumulated latency, a total latency of transmitting the flow from the flow service provider to the target network element that is in the TSN and that is used as a next hop of the UPF network element, and a method for obtaining the accumulated latency is relatively simple, because in the communication method, the accumulated latency can also be obtained through calculation without requiring that the UE or the UPF network element and each device between the UE and the UPF network element are synchronized with a master clock source. 
     In a possible implementation, the determining, by the UPF network element, a second latency based on the first latency and the first target latency includes: using a sum of the first latency and the first target latency as the second latency. 
     In a possible implementation, the first target latency is a maximum transmission latency of the flow between the UPF network element and the UE. 
     In a possible implementation, the communication method includes: receiving, by the UPF network element, bandwidth requirement information of the flow from the SMF network element; and reserving, by the UPF network element, a bandwidth resource for the flow based on the bandwidth requirement information of the flow. 
     In a possible implementation, the communication method further includes: receiving, by the UPF network element, first information from the SMF network element, where the first information is used to indicate whether an access network device corresponding to the UE successfully reserves the bandwidth resource for the flow based on the bandwidth requirement information of the flow. 
     For the communication method in the seventeenth aspect, refer to the steps performed by the UPF network element in the communication method described in  FIG. 23 . 
     According to an eighteenth aspect, this application provides a communication method. The communication method includes: receiving, by a UPF network element, first latency information of a flow from a TSN or UE, where the first latency information is used to indicate a first latency of transmitting the flow from a flow service provider in the TSN to a first communications device; sending, by the UPF network element, information about the flow to an SMF network element, where the information about the flow is used to determine a quality of service parameter corresponding to the flow; receiving, by the UPF network element, the quality of service parameter corresponding to the flow from the SMF network element; determining, by the UPF network element, a first target latency based on the quality of service parameter corresponding to the flow, where the first target latency is a latency of transmitting the flow between the terminal device UE and the UPF network element; determining, by the UPF network element, a third latency based on the first latency, the first target latency, and a second target latency, where the second target latency is a latency of transmitting the flow from a second communications device to a target network element that is in the TSN network and that is used as a next hop of the second communications device, and the third latency is a latency of transmitting the flow from the flow service provider to the target network element; and sending, by the UPF network element, third latency information, where the third latency information is used to indicate the third latency, where the first communications device is the UPF network element, and the second communications device is the UE, or the first communications device is the UE, and the second communications device is the UPF network element. 
     In the communication method, an accumulated latency of transmitting the flow from the flow service provider to the target network element that is in the TSN network and that is used as the next hop of the second communications device may be obtained, and a method for obtaining the accumulated latency is relatively simple, because in the communication method, the accumulated latency can also be obtained through calculation without requiring that the UE or the UPF network element and each device between the UE and the UPF network element are synchronized with a master clock source. 
     In a possible implementation, the determining, by the UPF network element, a third latency based on the first latency, the first target latency, and a second target latency includes: using a sum of the first latency, the first target latency, and the second target latency as the third latency. 
     In a possible implementation, the first target latency is a maximum transmission latency of the flow between the UPF network element and the UE. 
     In a possible implementation, the communication method includes: receiving, by the UPF network element, bandwidth requirement information of the flow from the SMF network element; and reserving, by the UPF network element, a bandwidth resource for the flow based on the bandwidth requirement information of the flow. 
     In a possible implementation, the communication method further includes: receiving, by the UPF network element, first information from the SMF network element, where the first information is used to indicate whether an access network device corresponding to the UE successfully reserves the bandwidth resource for the flow based on the bandwidth requirement information of the flow. 
     For the communication method in the eighteenth aspect, refer to the steps performed by the UPF network element in the communication method described in  FIG. 25  or  FIG. 27 . 
     According to a nineteenth aspect, this application provides a communication method. The communication method includes: receiving, by a UPF network element, second latency information of a flow from UE or an SMF network element, where the second latency information is used to indicate a second latency of transmitting the flow from a flow service provider in a time sensitive network TSN to the UPF network element; determining, by the UPF network element, a third latency based on the second latency and a second target latency, where the second target latency is a latency of transmitting the flow from the UPF network element to a target network element that is in the TSN network and that is used as a next hop of the UPF network element, and the third latency is a latency of transmitting the flow from the flow service provider to the target network element; and sending, by the UPF network element, third latency information to the target network element, where the third latency information is used to indicate the third latency. 
     In the communication method, an accumulated latency of transmitting the flow from the flow service provider to the target network element that is in the TSN network and that is used as the next hop of the UPF network element may be obtained, and a method for obtaining the accumulated latency is relatively simple, because in the communication method, the accumulated latency can also be obtained through calculation without requiring that the UE or the UPF network element and each device between the UE and the UPF network element are synchronized with a master clock source. 
     In a possible implementation, the determining, by the UPF network element, a third latency based on the second latency and a second target latency includes: using a sum of the second latency and the second target latency as the third latency. 
     In a possible implementation, the communication method includes: receiving, by the UPF network element, bandwidth requirement information of the flow from the SMF network element; and reserving, by the UPF network element, a bandwidth resource for the flow based on the bandwidth requirement information of the flow. 
     In a possible implementation, the communication method further includes: receiving, by the UPF network element, first information from the SMF network element, where the first information is used to indicate whether an access network device corresponding to the UE successfully reserves the bandwidth resource for the flow based on the bandwidth requirement information of the flow. 
     For the communication method in the nineteenth aspect, refer to the steps performed by the UPF network element in the communication method described in  FIG. 26 ,  FIG. 28 .  FIG. 29 , or  FIG. 33 . 
     According to a twentieth aspect, this application provides a communication method. The communication method includes: receiving, by UE, second latency information of a flow from an SMF network element or a UPF network element, where the second latency information is used to indicate a second latency of transmitting the flow from a flow service provider in a TSN to the UE; determining, by the UE, a third latency based on the second latency and a second target latency, where the second target latency is a latency of transmitting the flow from the UE to a target network element that is in the TSN network and that is used as a next hop of the UE, and the third latency is a latency of transmitting the flow from the flow service provider to the target network element; and sending, by the UE, third latency information to the target network element, where the third latency information is used to indicate the third latency. 
     In the communication method, an accumulated latency of transmitting the flow from the flow service provider to the target network element that is in the TSN network and that is used as the next hop of the UE may be obtained, and a method for obtaining the accumulated latency is relatively simple, because in the communication method, the accumulated latency can also be obtained through calculation without requiring that the UE or the UPF network element and each device between the UE and the UPF network element are synchronized with a master clock source. 
     In a possible implementation, the determining, by the UE, a third latency based on the second latency and a second target latency includes: using a sum of the second latency and the second target latency as the third latency. 
     For the communication method in the twentieth aspect, refer to the steps performed by the UE in the communication method described in  FIG. 20 ,  FIG. 22 ,  FIG. 23 , or  FIG. 32 . 
     According to a twenty-first aspect, this application provides a communication method. The communication method includes: receiving, by UE, first latency information of a flow, where the first latency information is used to indicate a first latency of transmitting the flow from a flow service provider in a time sensitive network TSN to a first communications device; sending, by the UE, information about the flow to a session management function SMF network element, where the information about the flow is used to determine a quality of service parameter corresponding to the flow; receiving, by the UE, the quality of service parameter corresponding to the flow from the SMF network element; determining, by the UE, a first target latency based on the quality of service parameter corresponding to the flow, where the first target latency is a latency of transmitting the flow between the UE and a user plane function UPF network element; determining, by the UE, a third latency based on the first latency, the first target latency, and a second target latency, where the second target latency is a latency of transmitting the flow from a second communications device to a target network element that is in the TSN network and that is used as a next hop of the second communications device, and the third latency is a latency of transmitting the flow from the flow service provider to the target network element; and sending, by the UE, third latency information, where the third latency information is used to indicate the third latency, where the first communications device is the UPF network element, and the second communications device is the UE, or the first communications device is the UE, and the second communications device is the UPF network element. 
     In the communication method, an accumulated latency of transmitting the flow from the flow service provider to the target network element that is in the TSN network and that is used as the next hop of the second communications device may be obtained, and a method for obtaining the accumulated latency is relatively simple, because in the communication method, the accumulated latency can also be obtained through calculation without requiring that the UE or the UPF network element and each device between the UE and the UPF network element are synchronized with a master clock source. 
     In a possible implementation, the determining, by the UE, a third latency based on the first latency, the first target latency, and a second target latency includes: using a sum of the first latency, the first target latency, and the second target latency as the third latency. 
     In a possible implementation, the first target latency is a maximum transmission latency of the flow between the UPF network element and the UE. 
     For the communication method in the twenty-first aspect, refer to the steps performed by the UE in the communication method described in  FIG. 21  or  FIG. 31 . 
     According to a twenty-second aspect, this application provides a communication method. The communication method includes: receiving, by UE, first latency information of a flow, where the first latency information is used to indicate a first latency of transmitting the flow from a flow service provider in a TSN to the UE; sending, by the UE, information about the flow to an SMF network element, where the information about the flow is used to determine a quality of service parameter corresponding to the flow; receiving, by the UE, the quality of service parameter corresponding to the flow from the SMF network element; determining, by the UE, a first target latency based on the quality of service parameter corresponding to the flow, where the first target latency is a latency of transmitting the flow between the UE and a user plane function UPF network element; determining, by the UE, a second latency based on the first latency and the first target latency, where the second latency is a latency of transmitting the flow from the flow service provider to the UPF network element; and sending, by the UE, second latency information to the UPF network element, where the second latency information is used to indicate the second latency. 
     In the communication method, an accumulated latency of transmitting the flow from the flow service provider to the UPF network element that is in 3GPP and that is used as an output port may be obtained, so that the UPF network element can calculate, based on the accumulated latency, a total latency of transmitting the flow from the flow service provider to the target network element that is in the TSN and that is used as a next hop of the UPF network element, and a method for obtaining the accumulated latency is relatively simple, because in the communication method, the accumulated latency can also be obtained through calculation without requiring that the UE or the UPF network element and each device between the UE and the UPF network element are synchronized with a master clock source. 
     In a possible implementation, the determining, by the UE, a second latency based on the first latency and the first target latency includes: determining a sum of the first latency and the first target latency as the second latency. 
     In a possible implementation, the first target latency is a maximum transmission latency of the flow between the UPF network element and the UE. 
     For the communication method in the twenty-second aspect, refer to the steps performed by the UE in the communication method described in  FIG. 29 . 
     According to a twenty-third aspect, this application provides a communications apparatus. The communications apparatus includes modules configured to implement the communication method in any one of the fifteenth aspect to the twenty-second aspect. 
     The modules included in the communications apparatus in the twenty-third aspect may be implemented in a software and/or hardware manner. 
     For example, the receiving module may be a receiver, the sending module may be a transmitter, and the processing module may be a processor. The receiver and the transmitter may be integrated together and referred to as a transceiver. In this case, the communications apparatus may be an SMF network element, a UPF network element, or a terminal device. 
     For another example, the processing module may be a processor, and the receiving module and the sending module may be communications interfaces. In this case, the communications apparatus may be a chip, for example, may be a chip that can be integrated into the SMF network element, the UPF network element, or the UE. 
     Optionally, the communications apparatus may further include a memory, configured to store program code executed by the processor. 
     According to a twenty-fourth aspect, this application provides a computer-readable storage medium. The computer-readable storage medium stores program code to be executed by the communications apparatus. The program code includes an instruction used to perform the communication method in any one of the fifteenth aspect to the twenty-second aspect or the possible implementations of the fifteenth aspect to the twenty-second aspect. 
     According to a twenty-fifth aspect, this application provides a computer program product that includes an instruction. When the computer program product runs on a communications apparatus, the communications apparatus is enabled to perform the communication method in any one of the fifteenth aspect to the twenty-second aspect or the possible implementations of the fifteenth aspect to the twenty-second aspect. 
    
    
     
       BRIEF DESCRIPTION OF THE DRAWINGS 
         FIG. 1  is a schematic diagram of an application scenario to which a communication method according to an embodiment of this application may be applied; 
         FIG. 2  is a schematic flowchart of a communication method according to an embodiment of this application; 
         FIG. 3  is a schematic flowchart of a communication method according to another embodiment of this application; 
         FIG. 4  is a schematic flowchart of a communication method according to another embodiment of this application; 
         FIG. 5  is a schematic flowchart of a communication method according to another embodiment of this application; 
         FIG. 6  is a schematic flowchart of a communication method according to another embodiment of this application; 
         FIG. 7  is a schematic flowchart of a communication method according to another embodiment of this application; 
         FIG. 8  is a schematic flowchart of a communication method according to another embodiment of this application; 
         FIG. 9  is a schematic flowchart of a communication method according to another embodiment of this application; 
         FIG. 10  is a schematic flowchart of a communication method according to another embodiment of this application; 
         FIG. 11  is a schematic flowchart of a communication method according to another embodiment of this application; 
         FIG. 12  is a schematic flowchart of a communication method according to another embodiment of this application; 
         FIG. 13  is a schematic flowchart of a communication method according to another embodiment of this application; 
         FIG. 14  is a schematic flowchart of a communication method according to another embodiment of this application; 
         FIG. 15  is a schematic flowchart of a communication method according to another embodiment of this application; 
         FIG. 16  is a schematic flowchart of a communication method according to another embodiment of this application; 
         FIG. 17  is a schematic flowchart of a communication method according to another embodiment of this application; 
         FIG. 18  is a schematic structural diagram of a communications apparatus according to an embodiment of this application; 
         FIG. 19  is a schematic diagram of an application scenario to which a communication method according to an embodiment of this application may be applied; 
         FIG. 20  is a schematic flowchart of a communication method according to another embodiment of this application; 
         FIG. 21  is a schematic flowchart of a communication method according to another embodiment of this application; 
         FIG. 22  is a schematic flowchart of a communication method according to another embodiment of this application; 
         FIG. 23  is a schematic flowchart of a communication method according to another embodiment of this application; 
         FIG. 24  is a schematic flowchart of a communication method according to another embodiment of this application; 
         FIG. 25  is a schematic flowchart of a communication method according to another embodiment of this application; 
         FIG. 26  is a schematic flowchart of a communication method according to another embodiment of this application; 
         FIG. 27  is a schematic flowchart of a communication method according to another embodiment of this application; 
         FIG. 28  is a schematic flowchart of a communication method according to another embodiment of this application; 
         FIG. 29  is a schematic flowchart of a communication method according to another embodiment of this application; 
         FIG. 30  is a schematic flowchart of a communication method according to another embodiment of this application; 
         FIG. 31  is a schematic flowchart of a communication method according to another embodiment of this application; 
         FIG. 32  is a schematic flowchart of a communication method according to another embodiment of this application; and 
         FIG. 33  is a schematic flowchart of a communication method according to another embodiment of this application. 
     
    
    
     DETAILED DESCRIPTION OF ILLUSTRATIVE EMBODIMENTS 
     The following describes technical solutions of this application with reference to the accompanying drawings. 
     As shown in  FIG. 1 , an application scenario to which a communication method according to an embodiment of this application may be applied may include UE  101 , an access network (AN) device  102 , a UPF network element  103 , an access and mobility management function (AMF) network element  104 , an SMF network element  105 , a PCF network element  106 , and a TSN  107 . 
     The communications system shown in  FIG. 1  may be a 5th generation (5G) communications network. 
     The UE may also be referred to as a terminal device. The terminal device may communicate with one or more core networks (CN) through the AN device. The terminal device may also be referred to as an access terminal, a terminal, a subscriber unit, a subscriber station, a mobile station, a mobile console, a remote station, a remote terminal, a mobile device, a user terminal, a wireless network device, a user agent, or a user apparatus. The terminal may be a cellular phone, a cordless phone, a session initiation protocol (SIP) phone, a wireless local loop (WLL) station, a personal digital assistant (PDA), a handheld device having a wireless communication function, a computing device, another device connected to a wireless modem, a vehicle-mounted device, a wearable device, or a terminal device in the Internet of Things and a vehicle network, any form of terminal device in a future network, and the like. 
     The AN device may be a radio access network (RAN) device. An example of the RAN device is a base station (BS). 
     The base station may also be referred to as a base station device, is a device that connects a terminal to a wireless network, and includes but is not limited to: a transmission reception point (TRP), a 5G NodeB (gNB), an evolved NodeB (eNB), a radio network controller (RNC), a NodeB (NB), a base station controller (BSC), a base transceiver station (BTS), a home base station (for example, a home evolved nodeB, or a home node B, HNB), a baseband unit (BBU), a Wi-Fi access point (AP), a small cell device (pico), and the like. 
     It should be understood that a specific type of the base station is not limited in this specification. In systems using different radio access technologies, names of devices having functions of the base station may be different. For ease of description, in all the embodiments of this application, all the foregoing apparatuses that provide a wireless communication function for the terminal are collectively referred to as the base station. 
     The UPF network element has functions such as packet forwarding, encapsulation, and statistics collection of the terminal device. 
     The AMF network element is responsible for access and mobility management of the terminal device, for example, responsible for UE location update, UE registration with a network, or UE handover. 
     The SMF network element is responsible for selection and reselection of the UPF network element, assignment of an internet protocol (IP) address, and the like, and may be further responsible for establishment, modification, release, and the like of a session. 
     The PCF network element is configured to implement functions such as managing a unified policy framework of network behavior, providing, for a control plane, a policy rule that needs to be executed, and obtaining subscription information related to a policy decision. 
     The TSN has constraint characteristics such as controlled latency, jitter, bandwidth, and reliability. In any case, the TSN can meet requirements of bounded end-to-end latency, jitter, and high reliability. 
     It should be understood that the embodiments of this application are not limited to the system architecture shown in  FIG. 1 . For example, a communications system to which the communication method in this embodiment of this application may be applied may include more or fewer network elements or devices. The devices or the network elements in  FIG. 1  may be hardware, or may be software obtained through functional division, or a combination thereof. The devices or the network elements in  FIG. 1  may communicate with each other through another device or network element. 
     In the communications system shown in  FIG. 1 , the UE may serve as a flow service recipient to receive a flow sent by a flow service provider in the TSN. Alternatively, the UE may serve as a flow service provider to send a flow to a flow service recipient in the TSN. 
     As a boundary between the TSN and a 3GPP network, the UPF network element may have a basic function of a bridge in the TSN. For example, the UPF network element may process a stream reservation protocol (SRP) message from the TSN. 
     For example, the UE may receive a URLLC flow sent by the flow service provider in the TSN, or the UE may send a URLLC flow to the flow service recipient in the TSN. 
     The flow in this embodiment of this application may be a quality of service (QoS) flow. The QoS flow may be a QoS flow with a deterministic transmission requirement. 
     A schematic flowchart of a communication method according to an embodiment of this application is shown in  FIG. 2 . It should be understood that  FIG. 2  shows steps or operations of the communication method, but these steps or operations are merely examples. In this embodiment of this application, other operations or variations of the operations in  FIG. 2  may be further performed. 
     S 201 : A UPF network element receives first latency information of a flow from a TSN, where the first latency information is used to indicate a first latency of transmitting the flow from a flow service provider in the TSN to the UPF network element. Alternatively, in other words, the first latency is an accumulated latency (AccumulatedLatency) of transmitting the flow from the flow service provider in the TSN to the UPF network element. 
     The flow service provider refers to a host or a server that provides the flow, and is a source of the flow. 
     The UPF network element may be the UPF network element  103  in  FIG. 1 , and the TSN may be the TSN  107  in  FIG. 1 . 
     The first latency information may be carried in a flow service provider broadcast declaration (Talk Advertise Declaration) message. The flow service provider broadcast declaration message may be used to broadcast a QoS requirement corresponding to the flow. 
     The flow service provider broadcast declaration message may further carry a flow identifier (stream identity, Stream ID) in addition to the first latency information. In addition, the flow service provider broadcast declaration message may further carry one or more of the following information: a destination address (destination_address), a source address (source_address), a maximum frame size (MaxFrameSize), a maximum frame interval (MaxIntervalFrames), a priority of a frame (PriorityAndRank), a maximum allowable latency of transmitting a single frame of the flow from a talker to a listener, a reliability requirement of the flow, or a resource reservation failure cause (FailureInformation). 
     S 202 : The UPF network element sends the first latency information to an SMF network element. Correspondingly, the SMF network element receives the first latency information from the UPF network element. 
     The SMF network element may be the SMF network element  105  in  FIG. 1 . 
     The UPF network element may forward, to the SMF network element, the flow service provider broadcast declaration message that is received by the UPF network element from the TSN. The flow service provider broadcast declaration message carries the first latency information. 
     Certainly, the UPF network element may alternatively obtain the first latency information from the flow service provider broadcast declaration message, and then include the first latency information in another message and send the another message to the SMF network element. A manner in which the UPF network element sends the first latency information to the SMF network element is not limited in this embodiment of this application. 
     S 203 : The SMF network element determines, according to a PCC rule of the flow, a third latency of transmitting the flow from the UPF network element to UE. 
     The UE may be the UE  101  in  FIG. 1 . The third latency may be a maximum transmission latency of transmitting the flow from the UPF network element to the UE. 
     The PCC rule is a rule related to policy and charging. 
     For example, the SMF network element determines, according to the PCC rule, a 5G QoS identifier (5QI) corresponding to the flow, and further determines a packet delay budget (PDB) that is between the UPF and the UE and that corresponds to the 5QI. The PDB is used as a maximum transmission latency of transmitting the flow from the UPF to the UE. 
     Alternatively, after receiving information about the flow from the UE, the SMF network element obtains the PCC rule of the flow based on the information about the flow, determines, according to the PCC rule of the flow, the 5QI corresponding to the flow, and sends the 5QI to the UPF. The UPF determines, based on the 5QI, the PDB that is between the UPF and the UE and that corresponds to the 5QI. The PDB is used as a maximum transmission latency of transmitting the flow from the UPF network element to the UE. 
     S 204 : The SMF network element determines, based on the first latency of transmitting the flow from the flow service provider in the TSN to the UPF network element and the third latency of transmitting the flow from the UPF network element to the UE, a second latency of transmitting the flow from the flow service provider in the TSN to the UE. 
     The SMF network element first obtains, from the first latency information, the first latency indicated by the first latency information, and then determines the second latency based on the first latency and the third latency. 
     A possible implementation in which the SMF network element determines the second latency based on the first latency and the third latency may include: determining, by the SMF network element, a sum of the first latency and the third latency as the second latency. 
     Certainly, the SMF network element may alternatively determine the second latency based on the first latency and the third latency in another manner. For example, after adding the first latency and the third latency, the SMF network element may correct (for example, add a specified or default value, for example, add a latency of processing, by the UPF, the flow to) a sum that is obtained by adding the first latency and the third latency, to obtain the second latency. A manner of determining the second latency based on the first latency and the third latency is not limited in this embodiment of this application. 
     S 205 : The SMF network element sends second latency information to the UPF network element, where the second latency information is used to indicate the second latency. 
     For example, after determining the second latency, the SMF network element may modify, to the second latency information, the first latency information that is in the flow service provider broadcast declaration message and that is received by the SMF network element from the UPF network element, to modify the first latency recorded in the flow service provider broadcast declaration message to the second latency. Then, the SMF network element may send, to the UPF network element, a flow service provider broadcast declaration message obtained after modification. 
     In other words, the SMF network element may send the second latency information to the UPF network element through the flow service provider broadcast declaration message. In this way, the UPF network element may send the second latency information to the UE by forwarding the flow service provider broadcast declaration message to the UE. 
     Alternatively, the SMF network element may send, to the UPF network element, a flow service recipient ready (Listen Ready) message carrying the second latency information, that is, send the second latency information to the UPF network element through the flow service recipient message. In this way, the UPF network element may send the second latency information by sending the flow service recipient message to the TSN. 
     S 206 : The UPF network element sends the second latency information to the UE. After receiving the second latency information from the UPF network element, the UE may determine whether the second latency exceeds a requirement of a maximum transmission latency of transmitting the flow from the flow service provider in the TSN to a flow service recipient. 
     When sending the second latency information to the UE, the UPF network element may further send identification information of the flow. 
     For example, the UPF network element may forward, to the UE, the flow service provider broadcast declaration message that is received by the UPF network element from the SMF network element in S 205 , where the message carries the second latency information and the identification information of the flow. 
     It should be understood that the UPF network element may determine, according to an indication of the SMF network element, whether to send the flow service provider broadcast declaration message to the SMF network element or the UE. 
     It should be understood that S 206  is not a step that needs to be performed. In other words, the UPF network element may not send the second latency information to the UE. 
     For example, if the first latency exceeds the requirement of the maximum transmission latency of transmitting the flow from the flow service provider in the TSN to the flow service recipient, the UPF network element may not send the second latency information to the UE. 
     In the communication method in this embodiment of this application, the SMF network element determines, according to the PCC rule, the maximum transmission latency of transmitting the flow from the UPF network element to the UE, and uses the maximum transmission latency as an accumulated latency of transmitting the flow from the UPF network element to the UE, so that the SMF network element can determine, based on the maximum transmission latency and the first latency of transmitting the flow from the flow provider in the TSN to the UPF network element, the second latency of transmitting the flow from the flow service provider in the TSN to the UE. In this way, in a communications network in which a 3GPP network interworks with the TSN, it can be determined, based on the second latency, that QoS of the flow can be ensured, and the flow can be transmitted. 
     In addition, according to the solution in this application, the SMF network element determines, according to the PCC rule, the maximum transmission latency of transmitting the flow from the UPF network element to the UE, and uses the maximum transmission latency as the accumulated latency of transmitting the flow from the UPF network element to the UE. However, in the prior art, clock synchronization needs to be performed between every two adjacent nodes between the UPF network element and the UE, to finally implement clock synchronization between all nodes between the UPF network element and the UE, to support the TSN network on all transmission nodes between the UPF network element and the UE, so as to calculate the accumulated latency of transmitting the flow from the UPF network element to the UE. Compared with the method in the prior art, the solution in this application is simple and easy to implement. 
     A schematic flowchart of a communication method according to another embodiment of this application is shown in  FIG. 3 . It should be understood that  FIG. 3  shows steps or operations of the communication method, but these steps or operations are merely examples. In this embodiment of this application, other operations or variations of the operations in  FIG. 3  may be further performed. In addition, the steps in  FIG. 3  may be performed in a sequence different from that presented in  FIG. 3 , and possibly, not all operations in  FIG. 3  need to be performed. 
     S 301 : A UPF network element receives first latency information from a TSN, where the first latency information is used to indicate a first latency of transmitting a flow from a flow service provider in the TSN to the UPF network element. 
     For this step, refer to S 201 . Details are not described herein again. 
     S 302 : The UPF network element sends the first latency information to an SMF network element. Correspondingly, the SMF network element receives the first latency information from the UPF network element. 
     For this step, refer to S 202 . Details are not described herein again. 
     S 303 : The SMF network element obtains, from a policy control function (policy control function, PCF) network element, a PCC rule corresponding to the flow. 
     For example, the SMF network element sends information about the flow to the PCF network element, and the PCF network element receives the information about the flow from the SMF network element. The PCF network element determines, based on the information about the flow, the PCC rule corresponding to the flow, and the PCC rule may include a 5QI corresponding to the flow. The SMF network element receives, from the PCF network element, the PCC rule corresponding to the flow. 
     For example, that the PCC network element determines, based on the information about the flow, the PCC rule corresponding to the flow includes: determining, by the PCC network element based on the information that is about the flow and that is sent by the SMF network element, at least one of a bandwidth requirement, a latency requirement, or a reliability requirement of the flow, and generates the PCC rule of the flow for the UE based on subscription information of the UE. 
     The information that is about the flow and that is sent by the SMF network element to the PCF network element may include at least one or more of the following: an identifier ID of the flow, a source address and a destination address of the flow, a size of a maximum frame used for transmitting the flow, an interval between frames used for transmitting the flow, a priority of the flow, a maximum allowable latency of transmitting a single frame of the flow from a talker to a listener, or a reliability requirement of the flow. 
     In other words, the SMF network element may send one or more pieces of the information to the PCF network element, so that the PCF network element can determine the corresponding PCC rule based on the one or more pieces of the information and return the corresponding PCC rule to the SMF network element. 
     Optionally, S 303  may not be performed in the communication method in this embodiment of this application. 
     For example, the PCC rule may be locally configured on the SMF network element, and the SMF network element matches the corresponding PCC rule based on the information about the flow. For another example, after obtaining the PCC rule corresponding to the flow from the PCF network element, the SMF network element may buffer the PCC rule. In this way, when the SMF network element needs to use the PCC rule corresponding to the flow next time, the SMF network element may directly obtain the PCC rule from the SMF network element instead of performing S 303 , thereby improving efficiency. 
     S 304 : The SMF network element determines, according to the PCC rule of the flow, a third latency of transmitting the flow from the UPF network element to UE. For this step, refer to S 203 . Details are not described herein again. 
     S 305 : The SMF network element determines, based on the third latency determined in S 304  and the first latency indicated by the first latency information, a second latency of transmitting the flow from the flow service provider in the TSN to the UE. 
     For this step, refer to S 204 . Details are not described herein again. 
     S 306 : The SMF network element determines, according to the PCC rule corresponding to the flow, whether a bandwidth resource can be reserved for the flow. If determining, according to the PCC rule corresponding to the flow, that the bandwidth resource can be reserved for the flow, the SMF network element may perform S 307 ; otherwise, may perform the communication method in  FIG. 7 . 
     That the SMF network element determines, according to the PCC rule corresponding to the flow, whether a bandwidth resource can be reserved for the flow may be understood as follows: The SMF network element determines, according to the PCC rule corresponding to the flow, whether a core network and a radio access network can meet a bandwidth requirement and a latency requirement of the flow. 
     That the SMF network element determines, according to the PCC rule corresponding to the flow, whether the core network and the radio access network can reserve the bandwidth resource for the flow may include: determining, by the SMF network element according to the PCC rule corresponding to the flow, the bandwidth requirement of the flow and determining whether the core network and the radio access network can meet the bandwidth requirement and the latency requirement of the flow. 
     That the SMF network element determines, according to the PCC rule corresponding to the flow, whether the core network and the radio access network can meet the bandwidth requirement and the latency requirement of the flow may include: determining, by the SMF network element according to the PCC rule corresponding to the flow, whether the UPF network element can meet the bandwidth requirement and/or the latency requirement of the flow. 
     Optionally, in the method in this embodiment of this application, S 306  may not be performed. To be specific, after determining the second latency in S 305 , the SMF network element may directly perform S 307 . 
     S 307 : The SMF network element sends second latency information to the UPF network element, where the second latency information is used to indicate the second latency. The SMF network element may also send identification information of the flow to the UPF network element. 
     For example, the SMF network element may modify, to the second latency information, the first latency information that is in a flow service provider broadcast declaration message and that is received by the SMF network element from the UPF network element in S 302 , to modify the first latency recorded in the flow service provider broadcast declaration message to the second latency. Then, the SMF network element may send, to the UPF network element, a flow service provider broadcast declaration message obtained after modification. 
     S 308 : The UPF network element sends the second latency information to the UE. Correspondingly, the UE receives the second latency information from the UPF network element. The SMF network element may also send the identification information of the flow to the UPF network element. 
     For example, the UPF network element may forward, to the UE, the flow service provider broadcast declaration message that is received from the SMF network element in S 307 . 
     Optionally, S 308  may not be performed in the communication method in this embodiment of this application. Correspondingly, S 309  to S 311  may not be performed. 
     S 309 : The UE determines, based on the second latency information received in S 308 , whether the second latency can meet a latency requirement of the flow. 
     For example, the latency requirement of the flow may be a maximum allowable latency of transmitting a single frame of the flow from the flow service provider to a flow service recipient, and the latency requirement of the flow may be carried in the flow service provider broadcast declaration message as the information about the flow. 
     If it is determined that the second latency can meet the latency requirement of the flow, S 310  may be performed. Otherwise, the UE may initiate a flow service recipient inquiry failure declaration (Listener Asking Failed declaration) message to the UPF network element, and then the UPF network element forwards the flow service recipient inquiry failure declaration message to the flow service provider in the TSN. 
     Optionally, the UE may further determine whether the UE is interested in the flow. If it is determined that the UE is interested in the flow, and that the second latency can meet the latency requirement of the flow, S 310  may be performed. Otherwise, the UE may initiate a flow service recipient inquiry failure declaration message to the UPF network element, and then the UPF network element forwards the flow service recipient inquiry failure declaration message to the flow service provider in the TSN. 
     Whether the UE is interested means whether the UE is willing to receive the flow. For example, the UE may prompt a user whether the flow needs to be received, and determine, based on an input of the user, whether the flow needs to be received. If the user selects that the flow needs to be received, it is determined that the UE is interested; otherwise, it is determined that the UE is not interested. 
     S 310 : The UE sends a message to the UPF network element, to indicate that the UE can receive the flow. The message may include the identification information of the flow. Optionally, the message may further include the second latency information. 
     For example, the UE may send a flow service recipient ready (Listener Ready) message to the UPF network element, and the message includes the identification information of the flow and the second latency information. 
     S 311 : The UPF network element sends, to the SMF network element, the message that is received by the UPF network element from the UE in S 310 , to indicate that the UE can receive the flow. 
     For example, the UPF network element may forward, to the SMF network element, the flow service recipient ready message that is received by the UPF network element from the UE in S 310 . 
     S 312 : The SMF network element sends bandwidth requirement information of the flow to the UPF network element. In addition, the SMF network element may further update a credit scheduling parameter of the UPF network element. 
     After receiving the bandwidth requirement message of the flow from the SMF network element, the UPF network element may reserve the bandwidth resource for the flow based on the bandwidth requirement information. In this way, when the flow is transmitted to the UPF network element, the UPF network element may have a corresponding bandwidth resource to transmit the flow, thereby improving transmission reliability of the flow. 
     Optionally, S 312  may not be performed in the communication method in this embodiment of this application. In other words, the bandwidth resource does not need to be reserved for the flow on the UPF network element in advance. 
     S 313 : The SMF network element sends the bandwidth requirement information of the flow to an AN device corresponding to the UE, to indicate the AN device to reserve the bandwidth resource for the flow. 
     After receiving the bandwidth requirement information from the SMF network element, the AN device may reserve the bandwidth resource for the flow based on the bandwidth requirement information, so that an access network may have a corresponding bandwidth resource to transmit the flow, thereby improving transmission reliability of the flow. 
     It should be understood that, in this implementation, the AN device corresponding to the UE is a device that provides an access network service for the UE. 
     Optionally, S 313  may not be performed in the communication method in this embodiment of this application. In other words, the bandwidth resource does not need to be reserved for the flow on the AN device in advance. 
     If S 313  is not performed in the communication method in this embodiment of this application, correspondingly, S 314  and S 315  may not be performed. 
     S 314 : The AN device sends first information to the SMF network element, where the first information is used to indicate whether the access network device successfully reserves the bandwidth resource for the flow based on the bandwidth requirement information of the flow. 
     Optionally, in the communication method, when S 313  is performed, S 314  and S 315  may not be performed. 
     S 315 : If the SMF network element receives the first information from the AN device, and the first information indicates that the AN device successfully reserves the resource for the flow, the SMF network element sends, to the UPF network element, information indicating that the resource is successfully reserved. 
     If the first information indicates that the AN device fails to reserve the resource for the flow, the communication method shown in  FIG. 7  may be performed. 
     S 316 : The UPF network element sends the identification information of the flow and the second latency information to the TSN. 
     For example, if S 310  is further performed in the communication method, the UPF network element may forward, to the TSN, the flow service recipient ready message that is received by the UPF network element from the UE in S 310 , and the flow service recipient ready message carries the identification information of the flow and the second latency information. 
     For example, if S 310  is not performed in the communication method, the UPF network element may send, to the TSN, the identification information of the flow and the second latency information that are received by the UPF network element from the SMF network element in S 307 . 
     For example, if S 315  is performed in the communication method, after receiving, from the SMF network element, the information indicating that the resource is successfully reserved, the UPF network element sends the identification information of the flow and the second latency information to the TSN. 
     For example, if S 315  is not performed in the communication method, after receiving the identification information of the flow and the second latency information from the SMF network element, the UPF network element may send the identification information of the flow and the second latency information to the TSN. 
     It should be understood that an execution sequence of S 306  is not limited in the communication method in this embodiment of this application. For example, S 306  may be performed before S 305 , or S 306  may be performed before S 304 . 
     It should be understood that an execution sequence of S 312  is not limited in the communication method in this embodiment of this application, provided that S 312  is performed after S 306 . 
     It should be understood that an execution sequence of S 313  is not limited in the communication method in this embodiment of this application, provided that S 313  is performed after S 306 , and is performed before S 314 . 
       FIG. 4  is a schematic flowchart of a communication method according to another embodiment of this application. It should be understood that  FIG. 4  shows steps or operations of the communication method, but these steps or operations are merely examples. In this embodiment of this application, other operations or variations of the operations in  FIG. 4  may be further performed. In addition, the steps in  FIG. 4  may be performed in a sequence different from that presented in  FIG. 4 , and possibly, not all operations in  FIG. 4  need to be performed. 
     For S 401  to S 405 , refer to S 301  to S 305 . Details are not described herein again. 
     S 406 : The SMF network element determines, according to the PCC rule corresponding to the flow, whether a bandwidth resource can be reserved for the flow. If determining, according to the PCC rule corresponding to the flow, that the bandwidth resource can be reserved for the flow, the SMF network element may perform S 407 ; otherwise, may perform the communication method in  FIG. 7 . 
     That the SMF network element determines, according to the PCC rule corresponding to the flow, whether a bandwidth resource can be reserved for the flow may be understood as follows: The SMF network element determines, according to the PCC rule corresponding to the flow, whether a core network and a radio access network can meet a bandwidth requirement of the flow. 
     That the SMF network element determines, according to the PCC rule corresponding to the flow, whether the core network and the radio access network can reserve the bandwidth resource for the flow may include: determining, by the SMF network element according to the PCC rule corresponding to the flow, the bandwidth requirement of the flow and determining whether the core network and the radio access network can meet the bandwidth requirement of the flow. 
     S 407 : The SMF network element sends bandwidth requirement information of the flow to the UPF network element. In addition, the SMF network element may further update a credit scheduling parameter of the UPF network element. 
     After receiving the bandwidth requirement message of the flow from the SMF network element, the UPF network element may reserve the bandwidth resource for the flow based on the bandwidth requirement information. In this way, when the flow is transmitted to the UPF network element, the UPF network element may have a corresponding bandwidth resource to transmit the flow, thereby improving transmission reliability of the flow. 
     S 408 : The SMF network element sends the bandwidth requirement information of the flow to an AN device corresponding to the UE, to indicate the AN device to reserve the bandwidth resource for the flow. 
     After receiving the bandwidth requirement information from the SMF network element, the AN device may reserve the bandwidth resource for the flow based on the bandwidth requirement information, so that an access network may have a corresponding bandwidth resource to transmit the flow, thereby improving transmission reliability of the flow. 
     It should be understood that, in this implementation, the AN device corresponding to the UE is a device that provides an access network service for the UE. 
     S 409 : The AN device sends first information to the SMF network element, where the first information is used to indicate whether the access network device successfully reserves the bandwidth resource for the flow based on the bandwidth requirement information of the flow. 
     S 410 : If the SMF network element receives the first information from the AN device, and the first information indicates that the AN device successfully reserves the resource for the flow, the SMF network element sends, to the UPF network element, information indicating that the resource is successfully reserved. 
     If the first information indicates that the AN device fails to reserve the resource for the flow, the communication method shown in  FIG. 7  may be performed. 
     S 411 : The SMF network element sends second latency information to the UPF network element, where the second latency information is used to indicate the second latency. The SMF network element may also send identification information of the flow to the UPF network element. 
     For example, the SMF network element may modify, to the second latency information, the first latency information that is in a flow service provider broadcast declaration message and that is received by the SMF network element from the UPF network element in S 402 , to modify the first latency recorded in the flow service provider broadcast declaration message to the second latency. Then, the SMF network element may send, to the UPF network element, a flow service provider broadcast declaration message obtained after modification. 
     Optionally, the information indicating that the resource is successfully reserved in S 410  and the second latency information in S 411  may be sent to the UPF together. Alternatively, S 410  may not be performed. After the SMF receives the first information sent by the AN device, and the first information indicates that the AN device successfully reserves the resource for the flow, the SMF performs step S 411 . The UPF receives the second latency information sent by the SMF, that is, determines that the resource is successfully reserved, and performs step S 412 . 
     S 412 : The UPF network element sends the second latency information to the UE. Correspondingly, the UE receives the second latency information from the UPF network element. The SMF network element may also send the identification information of the flow to the UPF network element. 
     For example, the UPF network element may forward, to the UE, the flow service provider broadcast declaration message that is received from the SMF network element in S 411 . 
     S 413 : The UE determines, based on the second latency information received in S 412 , whether the second latency can meet a latency requirement of the flow. 
     If it is determined that the second latency can meet the latency requirement of the flow, S 414  may be performed. Otherwise, the UE may initiate a flow service recipient inquiry failure declaration (Listener Asking Failed declaration) message to the UPF network element, and then the UPF network element forwards the flow service recipient inquiry failure declaration message to the flow service provider in the TSN. 
     Optionally, the UE may further determine whether the UE is interested in the flow. If it is determined that the UE is interested in the flow, and that the second latency can meet the latency requirement of the flow, S 414  may be performed. Otherwise, the UE may initiate a flow service recipient inquiry failure declaration message to the UPF network element, and then the UPF network element forwards the flow service recipient inquiry failure declaration message to the flow service provider in the TSN. 
     S 414 : The UE sends a message to the UPF network element, to indicate that the UE can receive the flow. The message may include the identification information of the flow and the second latency information. 
     For example, the UE may send a flow service recipient ready (Listener Ready) message to the UPF network element, and the message includes the identification information of the flow and the second latency information. 
     S 415 : The UPF network element sends the identification information of the flow and the second latency information to the TSN. 
     For example, the UPF network element may forward, to the TSN, the flow service recipient ready message that is received by the UPF network element from the UE in S 414 , and the flow service recipient ready message carries the identification information of the flow and the second latency information. 
       FIG. 5  is a schematic flowchart of a communication method according to another embodiment of this application. It should be understood that  FIG. 5  shows steps or operations of the communication method, but these steps or operations are merely examples. In this embodiment of this application, other operations or variations of the operations in  FIG. 5  may be further performed. In addition, the steps in  FIG. 5  may be performed in a sequence different from that presented in  FIG. 5 , and possibly, not all operations in  FIG. 5  need to be performed. 
     For S 501  to S 505 , refer to S 301  to S 305 . Details are not described herein again. 
     S 506 : The SMF network element determines, according to the PCC rule corresponding to the flow, whether a session modification procedure or a session establishment procedure can be triggered for the flow, to establish a corresponding QoS flow for the flow. If determining, according to the PCC rule corresponding to the flow, that the corresponding QoS flow can be established for the flow, the SMF network element may perform S 507 ; otherwise, may perform the communication method in  FIG. 7 . 
     That the SMF network element determines, according to the PCC rule corresponding to the flow, whether the corresponding QoS flow can be established for the flow may be understood as follows: The SMF network element determines, according to the PCC rule corresponding to the flow, whether a core network and a radio access network can meet a bandwidth requirement and a latency requirement of the flow. 
     S 507 : The SMF network element sends second latency information to the UPF network element, where the second latency information is used to indicate the second latency. The SMF network element may also send identification information of the flow to the UPF network element. 
     For example, the SMF network element may modify, to the second latency information, the first latency information that is in a flow service provider broadcast declaration message and that is received by the SMF network element from the UPF network element in S 502 , to modify the first latency recorded in the flow service provider broadcast declaration message to the second latency. Then, the SMF network element may send, to the UPF network element, a flow service provider broadcast declaration message obtained after modification. 
     S 508 : The UPF network element sends the second latency information to the UE. Correspondingly, the UE receives the second latency information from the UPF network element. The UPF network element also sends the identification information of the flow to the UE. 
     For example, the UPF network element may forward, to the UE, the flow service provider broadcast declaration message that is received from the SMF network element in S 507 . 
     S 509 : The UE determines, based on the second latency information received in S 508 , whether the second latency can meet a latency requirement of the flow. 
     If it is determined that the second latency can meet the latency requirement of the flow, S 510  may be performed. Otherwise, the UE may initiate a flow service recipient inquiry failure declaration (Listener Asking Failed declaration) message to the UPF network element, and then the UPF network element forwards the flow service recipient inquiry failure declaration message to the flow service provider in the TSN. 
     Optionally, the UE may further determine whether the UE is interested in the flow. If it is determined that the UE is interested in the flow, and that the second latency can meet the latency requirement of the flow, S 510  may be performed. Otherwise, the UE may initiate a flow service recipient inquiry failure declaration message to the UPF network element, and then the UPF network element forwards the flow service recipient inquiry failure declaration message to the flow service provider in the TSN. 
     S 510 : The UE sends a message to the UPF network element, to indicate that the UE can receive the flow. The message may include the identification information of the flow and the second latency information. 
     For example, the UE may send a flow service recipient ready (Listener Ready) message to the UPF network element, and the message includes the identification information of the flow and the second latency information. 
     S 511 : The UPF network element sends the identification information of the flow and the second latency information to the TSN. 
     For example, the UPF network element may forward, to the TSN, the flow service recipient ready message that is received by the UPF network element from the UE in S 510 , and the flow service recipient ready message carries the identification information of the flow and the second latency information. 
       FIG. 6  is a schematic flowchart of a communication method according to another embodiment of this application. It should be understood that  FIG. 6  shows steps or operations of the communication method, but these steps or operations are merely examples. In this embodiment of this application, other operations or variations of the operations in  FIG. 6  may be further performed. In addition, the steps in  FIG. 6  may be performed in a sequence different from that presented in  FIG. 6 , and possibly, not all operations in  FIG. 6  need to be performed. 
     S 601 : A UPF network element receives first latency information from a TSN, where the first latency information is used to indicate a first latency of transmitting a flow from a flow service provider in the TSN to the UPF network element. 
     For this step, refer to S 201 . Details are not described herein again. 
     S 602 : The UPF network element sends the first latency information to an SMF network element. Correspondingly, the SMF network element receives the first latency information from the UPF network element. 
     For this step, refer to S 202 . Details are not described herein again. 
     S 603 : The SMF network element obtains, from a PCF network element, a PCC rule corresponding to the flow. 
     For this step, refer to S 303 . Details are not described herein again. 
     Optionally, S 603  may not be performed in the communication method in this embodiment of this application. 
     For example, the PCC rule may be locally configured on the SMF network element, and the SMF network element matches the corresponding PCC rule based on the information about the flow. 
     For another example, after obtaining the PCC rule corresponding to the flow from the PCF network element, the SMF network element may buffer the PCC rule. In this way, when the SMF network element needs to use the PCC rule corresponding to the flow next time, the SMF network element may directly obtain the PCC rule from the SMF network element instead of performing S 603 , thereby improving efficiency. 
     S 604 : The SMF network element determines, according to the PCC rule of the flow, a third latency of transmitting the flow from the UPF network element to UE. For this step, refer to S 203 . Details are not described herein again. 
     S 605 : The SMF network element determines, based on the third latency determined in S 604  and the first latency indicated by the first latency information, a second latency of transmitting the flow from the flow service provider in the TSN to the UE. 
     For this step, refer to S 204 . Details are not described herein again. 
     S 606 : The SMF network element determines, according to the PCC rule corresponding to the flow, whether a bandwidth resource can be reserved for the flow. 
     For this step, refer to S 306 . Details are not described herein again. 
     If determining, according to the PCC rule corresponding to the flow, that a core network and an access network can reserve the bandwidth resource for the flow, the SMF network element may perform S 607 ; otherwise, may perform the communication method in  FIG. 7 . 
     Optionally, in the method in this embodiment of this application, S 406  may not be performed. To be specific, after determining the second latency in S 605 , the SMF network element may directly perform S 607 . 
     S 607 : The SMF network element sends identification information of the flow to the UPF network element. 
     For example, the SMF network element sends a flow service provider broadcast declaration message to the UPF network element, and the message carries only the identification information of the flow. 
     Optionally, S 607  may not be performed in the communication method in this embodiment of this application. Correspondingly, S 608  to S 611  may not be performed. 
     S 608 : The UPF network element sends, to the UE, the identification information of the flow that is received by the UPF network element in S 607 . 
     For example, the UPF network element forwards, to the UE, the flow service provider broadcast declaration message received from the SMF network element, and the message carries the identification information of the flow. 
     Optionally, S 608  may not be performed in the communication method in this embodiment of this application. Correspondingly, S 609  to S 611  may not be performed. 
     S 609 : The UE determines whether the UE is interested in the flow, and if the UE is interested in the flow, the UE performs S 610 . Otherwise, the UE may initiate a flow service recipient inquiry failure declaration message to the UPF network element, and then the UPF network element forwards the flow service recipient inquiry failure declaration message to the flow service provider in the TSN. 
     For example, the UE determines whether the UE is interested in the flow indicated by the identification information that is of the flow and that is carried in the flow service provider broadcast declaration message. 
     S 610 : The UE sends a message to the UPF network element, to indicate that the UE can receive the flow. The message may include the identification information of the flow. 
     For example, the UE sends a flow service recipient ready message to the UPF network element, and the message includes the identification information of the flow. 
     S 611 : The UPF network element sends a message to the SMF network element, to indicate that the UE can receive the flow. 
     For example, the UPF network element may forward, to the SMF network element, the flow service recipient ready message that is received by the UPF network element from the UE in S 610 . 
     S 612 : The SMF network element sends bandwidth requirement information of the flow to the UPF network element. In addition, the SMF network element may further update a credit scheduling parameter of the UPF network element. 
     For this step, refer to S 312 . Details are not described herein again. 
     Optionally, S 612  may not be performed in the communication method in this embodiment of this application. In other words, the bandwidth resource does not need to be reserved for the flow on the UPF network element in advance. 
     S 613 : The SMF network element sends the bandwidth requirement information of the flow to an AN device corresponding to the UE, to indicate the AN device to reserve the bandwidth resource for the flow. 
     For this step, refer to S 313 . Details are not described herein again. 
     Optionally, S 613  may not be performed in the communication method in this embodiment of this application. In other words, the bandwidth resource does not need to be reserved for the flow on the AN device in advance. 
     If S 613  is not performed in the communication method in this embodiment of this application, correspondingly, S 614  and S 615  may not be performed. 
     S 614 : The AN device sends first information to the SMF network element, where the first information is used to indicate whether the access network device successfully reserves the bandwidth resource for the flow based on the bandwidth requirement information of the flow. 
     Optionally, in the communication method, when S 613  is performed, S 614  may not be performed. S 615 : The SMF network element sends the identification information of the flow and the second latency information to the UPF network element. 
     For example, the SMF network element may send, to the UPF network element, the flow service recipient ready message, and the flow service recipient ready message carries the identification information of the flow and the second latency information. 
     If S 614  is performed in the communication method, the SMF network element may perform S 615  after the SMF network element receives the first information, and the first information indicates that the AN device successfully reserves the resource for the flow. If S 614  is not performed in the communication method, the SMF network element may perform S 615  after S 611 . 
     Further, if S 607  is not performed in the communication method, the SMF network element may perform S 615  after S 606 . 
     If the SMF network element does not receive the first information sent by the AN device, or receives, from the AN device, information indicating that the resource fails to be reserved, the SMF network element may perform the communication method shown in  FIG. 7 . 
     S 616 : The UPF network element sends the identification information of the flow and the second latency information to the TSN. 
     The UPF network element sends, to the TSN, the flow service recipient ready message that is received by the UPF network element from the SMF network element in S 615 . 
     It should be understood that an execution sequence of S 606  is not limited in the communication method in this embodiment of this application. For example, S 606  may be performed before S 605 , or S 606  may be performed before S 604 . 
     It should be understood that an execution sequence of S 612  is not limited in the communication method in this embodiment of this application, provided that S 612  is performed after S 606 . 
     It should be understood that an execution sequence of S 613  is not limited in the communication method in this embodiment of this application, provided that S 613  is performed after S 605 , and is performed before S 614 . 
       FIG. 7  is a schematic flowchart of a communication method according to another embodiment of this application. It should be understood that  FIG. 7  shows steps or operations of the communication method, but these steps or operations are merely examples. In this embodiment of this application, other operations or variations of the operations in  FIG. 7  may be further performed. In addition, the steps in  FIG. 7  may be performed in a sequence different from that presented in  FIG. 7 , and possibly, not all operations in  FIG. 7  need to be performed. 
     S 701 : An SMF network element sends a flow service provider failure declaration (Talker failed declaration) message to a UPF network element, where the message is used to indicate that a flow service cannot be provided due to a bandwidth limitation or another limitation. 
     For example, when determining that the UPF network element or an AN device cannot reserve a bandwidth resource for a flow or cannot meet a QoS requirement of the flow, the SMF network element may send the flow service provider failure declaration message to the UPF network element. 
     For example, when a flow with a higher priority needs to be transmitted, or after UE moves and is handed over to a new base station, an output port corresponding to the UPF network element changes, and consequently, the output port exceeds an upper limit of reservation. Alternatively, when a PCF does not allow a bandwidth resource to be reserved for the flow, the SMF network element may determine that the QoS requirement of the flow cannot be met. 
     S 702 : The UPF network element forwards the flow service provider failure declaration message to the UE. 
     S 703 : UE initiates a flow service recipient inquiry failure declaration (Listener Asking Failed Declaration) message to the UPF network element. 
     S 704 : The UPF network element forwards the flow service provider inquiry failure declaration message to a flow service provider in a TSN. 
     It should be understood that message names shown in  FIG. 7  are merely examples. Any message that can implement a response function in the communication method falls within the protection scope of the embodiments of this application. 
     A schematic flowchart of a communication method according to an embodiment of this application is shown in  FIG. 8 . It should be understood that  FIG. 8  shows steps or operations of the communication method, but these steps or operations are merely examples. In this embodiment of this application, other operations or variations of the operations in  FIG. 8  may be further performed. 
     S 801 : UE sends first latency information of a flow to an SMF network element, and the SMF network element receives the first latency information from the UE, where the first latency information is used to indicate a first latency. 
     The first latency is an accumulated latency that is determined by the UE and that is of transmitting the flow from the UE to a UPF network element. In this case, the UE serves as a flow service provider, and a network element in a TSN serves as a flow service recipient. 
     In some possible implementations, the first latency is obtained by the UE by adding a latency of locally processing a single frame of the flow and a default value of a transmission latency of transmitting the flow from the UE to the UPF network element. An example of the default value of the transmission latency of transmitting the flow from the UE to the UPF network element is 500 nanoseconds. 
     The UPF network element may be the UPF network element  103  in  FIG. 1 , the UE may be the UE  101  in  FIG. 1 , and the SMF network element may be the SMF network element  105  in  FIG. 1 . 
     The first latency information may be carried in a flow service provider broadcast declaration message. The flow service provider broadcast declaration message may be used to broadcast the flow and a QoS requirement corresponding to the flow. 
     The flow service provider broadcast declaration message may further carry a flow identifier in addition to the first latency information. In addition, the flow service provider broadcast declaration message may further carry one or more of the following information: a destination address, a source address, a maximum frame size, a maximum frame interval, a priority of a frame, a maximum allowable latency of transmitting a single frame of the flow from a talker to a listener, a reliability requirement of the flow, or a resource reservation failure cause. 
     An implementation in which the UE sends the first latency information of the flow to the SMF network element may include: The UE directly sends the first latency information to the SMF network element. For example, the UE sends the flow service provider broadcast declaration message to the SMF network element through an AMF network element, and the flow service provider broadcast declaration message carries the first latency information. 
     Another implementation in which the UE sends the first latency information of the flow to the SMF network element may include: The UE sends the first latency information to the UPF network element, and then the UPF network element sends the first latency information to the SMF network element. For example, the UE sends the flow service provider broadcast declaration message to the UPF network element, and the UPF network element forwards the flow service provider broadcast declaration message to the SMF network element. The flow service provider broadcast declaration message carries the first latency information. 
     S 802 : The SMF network element determines, according to a PCC rule of the flow, a third latency of transmitting the flow from the UE to the UPF network element. The third latency may be a maximum transmission latency of transmitting the flow from the UE to the UPF network element. 
     The maximum transmission latency of transmitting the flow from the UE to the UPF network element may be equivalent to a maximum transmission latency of transmitting the flow from the UPF network element to the UE. Therefore, for this step, refer to S 203 . For brevity, details are not described herein again. 
     S 803 : The SMF network element determines, based on the first latency and the third latency, a second latency of transmitting the flow from the UE to the UPF network element. 
     In some possible implementations, the determining, by the SMF network element based on the first latency and the third latency, a second latency of transmitting the flow from the UE to the UPF may include: determining, by the SMF network element, a value obtained by subtracting a default value of a transmission latency of transmitting the flow from the UE to the UPF network element from a sum of the first latency and the third latency as the second latency. 
     The default value of the transmission latency of transmitting the flow from the UE to the UPF network element may be preconfigured. 
     For example, an example of the default value of the transmission latency of transmitting the flow from the UE to the UPF network element is 500 nanoseconds. In this case, a value obtained by subtracting 500 nanoseconds from the sum of the first latency and the third latency may be determined as the second latency. 
     S 804 : The SMF network element sends second latency information to the UPF network element, where the second latency information is used to indicate the second latency. 
     For example, the SMF network element may send the second latency information to the UPF network element through the flow service provider broadcast declaration message. In this way, the UPF network element may send the second latency information to the TSN by forwarding the flow service provider broadcast declaration message to the TSN. 
     S 805 : The UPF network element sends fourth latency information and identification information of the flow to the TSN. After receiving the fourth latency information, a node in the TSN may determine whether a fourth latency exceeds a requirement of a maximum transmission latency of transmitting the flow from the UE to the flow service recipient in the TSN. 
     For example, the UPF network element sends, to the TSN, the flow service provider broadcast declaration message that is received by the UPF in S 804 , and the UPF updates the second latency carried in the flow service provider broadcast declaration message to the fourth latency. 
     The fourth latency information is a value obtained after the UPF network element adds a latency of transmitting the flow from the UPF to a next-hop bridge (Bridge) in the TSN to the second latency information. If a next hop of the UPF is the flow service recipient, the fourth latency information is a value obtained after the UPF network element adds the second latency information and a latency of transmitting the flow from the UPF to the flow service recipient. 
     In the communication method, the SMF network element receives the first latency information from the UE, and learns, based on the first latency information, of the first latency that is determined by the UE and that is of transmitting the flow from the UE to the UPF network element. In addition, the SMF network element determines, according to the PCC rule, the maximum transmission latency of transmitting the flow from the UE to the UPF network element, and then, the SMF network element adjusts the first latency determined by the UE and the maximum transmission latency determined by the SMF network element, to obtain the second latency of transmitting the flow from the UE to the UPF network element, so that the flow can be transmitted based on the second latency in a communications network in which a 3GPP network interworks with the TSN. 
     In addition, the SMF network element determines, based on the maximum transmission latency of transmitting the flow from the UE to the UPF network element and the first latency that is determined by the UE, an accumulated latency of transmitting the flow from the UE to the UPF network element. However, in the prior art, clock synchronization needs to be performed between every two adjacent nodes between the UE and the UPF network element, and finally, clock synchronization between all nodes between the UE and the UPF network element is implemented, to support the TSN network on all transmission nodes between the UPF network element and the UE, so as to calculate the accumulated latency of transmitting the flow from the UE to the UPF network element. Compared with that in the prior art, the solution for the communication method is simple and easy to implement. 
       FIG. 9  is a schematic flowchart of a communication method according to an embodiment of this application. It should be understood that  FIG. 9  shows steps or operations of the communication method, but these steps or operations are merely examples. In this embodiment of this application, other operations or variations of the operations in  FIG. 9  may be further performed. In addition, the steps in  FIG. 9  may be performed in a sequence different from that presented in  FIG. 9 , and possibly, not all operations in  FIG. 9  need to be performed. 
     S 901 : UE sends first latency information of a flow to an SMF network element, and the SMF network element receives the first latency information from the UE, where the first latency information is used to indicate a first latency. 
     For this step, refer to S 801 . Details are not described herein again. 
     S 902 : The SMF network element obtains, from a PCF network element, a PCC rule corresponding to the flow. For this step, refer to S 303 . Details are not described herein again. 
     Optionally, S 902  may not be performed in the communication method in this embodiment of this application. 
     For example, the SMF network element may obtain, from another network element, the PCC rule corresponding to the flow. 
     For another example, after obtaining the PCC rule corresponding to the flow from the PCF network element or another network element, the SMF network element may buffer the PCC rule. In this way, when the SMF network element needs to use the PCC rule corresponding to the flow next time, the SMF network element may directly obtain the PCC rule from the SMF network element instead of performing S 902 , thereby improving efficiency. 
     S 903 : The SMF network element determines, according to a PCC rule of the flow, a third latency of transmitting the flow from the UE to the UPF network element. The third latency may be a maximum transmission latency of transmitting the flow from the UE to the UPF network element. 
     The maximum transmission latency of transmitting the flow from the UE to the UPF network element may be equivalent to a maximum transmission latency of transmitting the flow from the UPF network element to the UE. Therefore, for this step, refer to S 203 . Details are not described herein again. 
     S 904 : The SMF network element determines, based on the third latency determined in S 903  and the first latency indicated by the first latency information, a second latency of transmitting the flow from UE to the UPF. 
     For this step, refer to S 803 . Details are not described herein again. 
     S 905 : The SMF network element determines, according to the PCC rule corresponding to the flow, whether a bandwidth resource can be reserved for the flow. 
     For this step, refer to S 306 . Details are not described herein again. 
     If determining, according to the PCC rule corresponding to the flow, that a core network and an access network can reserve the bandwidth resource for the flow, the SMF network element may perform S 906 ; otherwise, may not perform S 906  to S 908 . 
     Optionally, in the method in this embodiment of this application, S 905  may not be performed. To be specific, after determining the second latency in S 904 , the SMF network element may directly perform S 906 , S 907 , or S 909 . 
     S 906 : The SMF network element sends bandwidth requirement information of the flow to the UPF network element. In addition, the SMF network element may further update a credit scheduling parameter of the UPF network element. 
     For this step, refer to S 312 . Details are not described herein again. 
     Optionally, S 906  may not be performed in the communication method in this embodiment of this application. In other words, the bandwidth resource does not need to be reserved for the flow on the UPF network element in advance. 
     S 907 : The SMF network element sends the bandwidth requirement information of the flow to an AN device corresponding to the UE, to indicate the AN device to reserve the bandwidth resource for the flow. 
     For this step, refer to S 313 . Details are not described herein again. 
     Optionally, S 907  may not be performed in the communication method in this embodiment of this application. In other words, the bandwidth resource does not need to be reserved for the flow on the AN device in advance. 
     If S 907  is not performed in the communication method in this embodiment of this application, correspondingly, S 908  may not be performed. 
     S 908 : The AN device sends first information to the SMF network element, where the first information is used to indicate whether the access network device successfully reserves the bandwidth resource for the flow based on the bandwidth requirement information of the flow. 
     Optionally, in the communication method, when S 907  is performed, S 908  may not be performed. 
     S 909 : The SMF network element sends second latency information to the UPF network element. 
     For example, the SMF network element sends a flow service provider broadcast declaration message to the UPF network element, and the message carries the second latency information. 
     If S 908  is performed in the communication method, the SMF network element may perform S 909  after the SMF network element receives the first information, and the first information indicates that the AN device successfully reserves the resource for the flow. If the SMF network element does not receive the first information sent by the AN device, or receives, from the AN device, information indicating that the resource fails to be reserved, the SMF network element may perform the communication method shown in  FIG. 7 . 
     S 910 : The UPF network element sends fourth latency information and identification information of the flow to the TSN. After receiving the fourth latency information, a node in the TSN may determine whether a fourth latency exceeds a requirement of a maximum transmission latency of transmitting the flow from the UE to the flow service recipient in the TSN. 
     For example, the UPF network element sends, to the TSN, the flow service provider broadcast declaration message that is received by the UPF in S 910 , and the UPF updates the second latency carried in the flow service provider broadcast declaration message to the fourth latency. 
     The fourth latency information is a value obtained after the UPF network element adds a latency of transmitting the flow from the UPF to a next-hop bridge (Bridge) in the TSN to the second latency information. If a next hop of the UPF is the flow service recipient, the fourth latency information is a value obtained after the UPF network element adds the second latency information and a latency of transmitting the flow from the UPF to the flow service recipient. 
     It should be understood that an execution sequence of S 905  is not limited in the communication method in this embodiment of this application. For example, S 905  may be performed before S 904 , or S 905  may be performed before S 903 . 
     It should be understood that an execution sequence of S 906  is not limited in the communication method in this embodiment of this application, provided that S 906  is performed after S 905 . 
     It should be understood that an execution sequence of S 907  is not limited in the communication method in this embodiment of this application, provided that S 907  is performed after S 904 , and is performed before S 908 . 
       FIG. 10  is a schematic flowchart of a communication method according to an embodiment of this application. It should be understood that  FIG. 10  shows steps or operations of the communication method, but these steps or operations are merely examples. In this embodiment of this application, other operations or variations of the operations in  FIG. 10  may be further performed. In addition, the steps in  FIG. 10  may be performed in a sequence different from that presented in  FIG. 10 , and possibly, not all the operations in  FIG. 10  need to be performed. 
     For S 1001  to S 1004 , refer to S 901  to S 904 . Details are not described herein again. 
     S 1005 : The SMF network element determines, according to the PCC rule corresponding to the flow, whether a session modification procedure or a session establishment procedure can be triggered for the flow, to establish a corresponding QoS flow (QoS Flow) for the flow. If the SMF network element determines, according to the PCC rule corresponding to the flow, that the corresponding QoS flow can be established for the flow, S 1006  may be performed; otherwise, the communication method in  FIG. 7  may be performed. 
     That the SMF network element determines, according to the PCC rule corresponding to the flow, whether the corresponding QoS flow can be established for the flow may be understood as follows: The SMF network element determines, according to the PCC rule corresponding to the flow, whether a core network and a radio access network can meet a bandwidth requirement and a latency requirement of the flow. 
     S 1006 : The SMF network element sends second latency information to the UPF network element. 
     For example, the SMF network element sends a flow service provider broadcast declaration message to the UPF network element, and the message carries the second latency information. 
     S 1007 : The UPF network element sends fourth latency information and identification information of the flow to the TSN. After receiving the fourth latency information, a node in the TSN may determine whether a fourth latency exceeds a requirement of a maximum transmission latency of transmitting the flow from the UE to the flow service recipient in the TSN. 
     For example, the UPF network element sends, to the TSN, the flow service provider broadcast declaration message that is received by the UPF in S 1006 , and the UPF updates the second latency carried in the flow service provider broadcast declaration message to the fourth latency. 
     The fourth latency information is a value obtained after the UPF network element adds a latency of transmitting the flow from the UPF to a next-hop bridge in the TSN to the second latency information. If a next hop of the UPF is the flow service recipient, the fourth latency information is a value obtained after the UPF network element adds the second latency information and a latency of transmitting the flow from the UPF to the flow service recipient. 
     A schematic flowchart of a communication method according to an embodiment of this application is shown in  FIG. 11 . It should be understood that  FIG. 11  shows steps or operations of the communication method, but these steps or operations are merely examples. In this embodiment of this application, other operations or variations of the operations in  FIG. 11  may be further performed. 
     S 1101 : UE sends information about a flow to an SMF network element. Correspondingly, the SMF network element receives the information about the flow from the UE. 
     The information about the flow may include at least one or more of the following: an identifier ID of the flow, a source address and a destination address of the flow, a size of a maximum frame used for transmitting the flow, an interval between frames used for transmitting the flow, a priority of the flow, a maximum allowable latency of transmitting a single frame of the flow from a talker to a listener, a reliability requirement of the flow, or information about a latency that is determined by the UE and that is of transmitting the flow from the UE to a UPF network element. 
     The UE sends the information about the flow to the SMF network element, to request the SMF network element to reserve a bandwidth resource for the flow and/or update the latency information. In this case, the UE serves as a flow service provider, and a network element in a TSN serves as a flow service recipient. 
     For example, the UE may send a resource reservation request message to the SMF network element, to request the SMF network element to reserve the bandwidth resource for the flow. The message carries the information about the flow. 
     The SMF network element may be the SMF network element  105  in  FIG. 1 , and the UE may be the UE  101  in  FIG. 1 . 
     S 1102 : The SMF network element determines, based on the information about the flow and a PCC rule of the flow, a third latency of transmitting the flow from the UE to the UPF network element. The third latency may be a maximum transmission latency of transmitting the flow from the UE to the UPF network element. 
     The maximum transmission latency of transmitting the flow from the UE to the UPF network element may be equivalent to a maximum transmission latency of transmitting the flow from the UPF network element to the UE. Therefore, for this step, refer to S 203 . Details are not described herein again. 
     S 1103 : The SMF network element sends first latency information to the UE, where the first latency information is used to indicate the third latency determined by the SMF network element. Correspondingly, the UE receives the first latency information from the SMF network element. 
     For example, the SMF network element may send a resource reservation response message to the UE, and the message carries the first latency information. 
     The SMF network element may send the first latency information to the UE through an AMF network element, or may send the first latency information to the UE through the UPF network element. 
     S 1104 : The UE determines, based on the third latency indicated by the first latency information, a target latency of transmitting the flow from the UE to the UPF network element. 
     In some possible implementations, that the UE determines, based on the third latency indicated by the first latency information, a target latency of transmitting the flow from the UE to the UPF network element may include: determining, by the UE, a sum of the third latency and a latency of locally processing a single frame of the flow as the target latency. 
     S 1105 : The UE sends second latency information to the UPF network element, where the second latency information is used to indicate the target latency determined by the UE. 
     For example, the UE may send a flow service provider broadcast declaration message to the UPF network element, and the message carries the second latency information. Certainly, the message may further carry other information, for example, the information about the flow mentioned in S 101 . 
     S 1106 : The UPF network element sends fourth latency information and identification information of the flow to the TSN. After receiving the fourth latency information, a node in the TSN may determine whether a fourth latency exceeds a requirement of a maximum transmission latency of transmitting the flow from the UE to the flow service recipient in the TSN. 
     For example, the UPF network element may send, to the TSN, the flow service provider broadcast declaration message that is received by the UPF network element from the UE in S 1105 , and the UPF updates a second latency carried in the flow service provider broadcast declaration message to a fourth latency. 
     The fourth latency information is a value obtained after the UPF network element adds a latency of transmitting the flow from the UPF to a next-hop bridge (Bridge) in the TSN to the second latency information. If a next hop of the UPF is the flow service recipient, the fourth latency information is a value obtained after the UPF network element adds the second latency information and a latency of transmitting the flow from the UPF to the flow service recipient. 
     In the communication method, the SMF network element determines, according to the PCC rule, the maximum transmission latency of transmitting the flow from the UE to the UPF network element, and indicates the maximum transmission latency to the UE, so that the UE can determine, based on the maximum transmission latency, an accumulated latency of transmitting the flow from the UE to the UPF network element. In this way, in a communications network in which a 3GPP network interworks with the TSN, the flow can be transmitted based on the accumulated latency. 
     In addition, the SMF network element determines, according to the PCC rule, the maximum transmission latency of transmitting the flow from the UE to the UPF network element, and indicates the maximum transmission latency to the UE, so that the UE can determine, based on the maximum transmission latency, the accumulated latency of transmitting the flow from the UE to the UPF network element. However, in the prior art, clock synchronization needs to be performed between every two adjacent nodes between the UE and the UPF network element, and finally, clock synchronization between all nodes between the UE and the UPF network element is implemented, to support the TSN network on all transmission nodes between the UPF network element and the UE, so as to calculate the accumulated latency of transmitting the flow from the UE to the UPF network element. Compared with that in the prior art, the solution for the communication method is simple and easy to implement. 
     A schematic flowchart of a communication method according to another embodiment of this application is shown in  FIG. 12 . It should be understood that  FIG. 12  shows steps or operations of the communication method, but these steps or operations are merely examples. In this embodiment of this application, other operations or variations of the operations in  FIG. 12  may be further performed. In addition, the steps in  FIG. 12  may be performed in a sequence different from that presented in  FIG. 12 , and possibly, not all the operations in  FIG. 12  need to be performed. 
     S 1201 : UE sends information about a flow to an SMF network element. Correspondingly, the SMF network element receives the information about the flow from the UE. For this step, refer to S 1101 . Details are not described herein again. 
     S 1202 : The SMF network element obtains, from a PCF network element, a PCC rule corresponding to the flow. For this step, refer to S 303 . Details are not described herein again. 
     Optionally, S 1202  may not be performed in the communication method in this embodiment of this application. 
     For example, the SMF network element may obtain, from another network element, the PCC rule corresponding to the flow. 
     For another example, after obtaining the PCC rule corresponding to the flow from the PCF network element or another network element, the SMF network element may buffer the PCC rule. In this way, when the SMF network element needs to use the PCC rule corresponding to the flow next time, the SMF network element may directly obtain the PCC rule from the SMF network element instead of performing S 1202 , thereby improving efficiency. 
     S 1203 : The SMF network element determines, according to a PCC rule of the flow, a third latency of transmitting the flow from the UE to the UPF network element. The third latency may be a maximum transmission latency of transmitting the flow from the UE to the UPF network element. 
     The maximum transmission latency of transmitting the flow from the UE to the UPF network element may be equivalent to a maximum transmission latency of transmitting the flow from the UPF network element to the UE. Therefore, for this step, refer to S 203 . Details are not described herein again. 
     S 1204 : The SMF network element determines, according to the PCC rule corresponding to the flow, whether a bandwidth resource can be reserved for the flow. 
     For this step, refer to S 306 . Details are not described herein again. 
     If determining, according to the PCC rule corresponding to the flow, that a core network and an access network can reserve the bandwidth resource for the flow, the SMF network element may perform S 1205 ; otherwise, may not perform S 1205  to S 1206 . 
     S 1205 : The SMF network element sends bandwidth requirement information of the flow to the UPF network element. In addition, the SMF network element may further update a credit scheduling parameter of the UPF network element. 
     For this step, refer to S 312 . Details are not described herein again. 
     Optionally, S 1205  may not be performed in the communication method in this embodiment of this application. In other words, the bandwidth resource does not need to be reserved for the flow on the UPF network element in advance. 
     S 1206 : The SMF network element sends the bandwidth requirement information of the flow to an AN device corresponding to the UE, to indicate the AN device to reserve the bandwidth resource for the flow. 
     For this step, refer to S 313 . Details are not described herein again. 
     Optionally, S 1206  may not be performed in the communication method in this embodiment of this application. In other words, the bandwidth resource does not need to be reserved for the flow on the AN device in advance. 
     If S 1206  is not performed in the communication method in this embodiment of this application, correspondingly, S 1207  may not be performed. 
     S 1207 : The AN device sends first information to the SMF network element, where the first information is used to indicate whether the access network device successfully reserves the bandwidth resource for the flow based on the bandwidth requirement information of the flow. 
     Optionally, in the communication method, when S 1206  is performed, S 1207  may not be performed. 
     S 1208 : The SMF network element sends first latency information and identification information of the flow to the UE. The first latency information is used to indicate a maximum transmission latency that is determined by the SMF network element in step S 1203  and that is of transmitting the flow from the UPF network element to the UE. Correspondingly, the UE receives the first latency information and the identification information of the flow from the SMF network element. For this step, refer to S 1103 . Details are not described herein again. 
     If S 1207  is performed in the communication method, the SMF network element may perform S 1208  after the SMF network element receives the first information, and the first information indicates that the AN device successfully reserves the resource for the flow. If the SMF network element does not receive the first information sent by the AN device, or receives, from the AN device, information indicating that the resource fails to be reserved, the SMF network element may not perform S 1208  to S 1210 . 
     S 1209 : The UE determines, based on the maximum transmission latency indicated by the first latency information, a target latency of transmitting the flow from the UE to the UPF network element. For this step, refer to S 1104 . Details are not described herein again. 
     S 1210 : The UE sends second latency information to the UPF network element, where the second latency information is used to indicate the target latency in S 1209 . For this step, refer to S 1105 . Details are not described herein again. 
     S 1211 : The UPF network element sends fourth latency information and identification information of the flow to the TSN. After receiving the fourth latency information, a node in the TSN may determine whether a fourth latency exceeds a requirement of a maximum transmission latency of transmitting the flow from the UE to the flow service recipient in the TSN. 
     For example, the UPF network element sends, to the TSN, the flow service provider broadcast declaration message that is received by the UPF network element from the UE in S 1210 , and the UPF updates a second latency carried in the flow service provider broadcast declaration message to a fourth latency. 
     The fourth latency information is a value obtained after the UPF network element adds a latency of transmitting the flow from the UPF to a next-hop bridge in the TSN to the second latency information. If a next hop of the UPF is the flow service recipient, the fourth latency information is a value obtained after the UPF network element adds the second latency information and a latency of transmitting the flow from the UPF to the flow service recipient. 
     It should be understood that an execution sequence of S 1204  is not limited in the communication method in this embodiment of this application. For example, S 1204  may be performed before S 1203 . 
     It should be understood that an execution sequence of S 1205  is not limited in the communication method in this embodiment of this application, provided that S 1205  is performed after S 1204 . 
     It should be understood that an execution sequence of S 1206  is not limited in the communication method in this embodiment of this application, provided that S 1206  is performed before S 1203  and before S 1207 . 
     A schematic flowchart of a communication method according to another embodiment of this application is shown in  FIG. 13 . It should be understood that  FIG. 13  shows steps or operations of the communication method, but these steps or operations are merely examples. In this embodiment of this application, other operations or variations of the operations in  FIG. 13  may be further performed. In addition, the steps in  FIG. 13  may be performed in a sequence different from that presented in  FIG. 13 , and possibly, not all the operations in  FIG. 13  need to be performed. 
     For S 1301  to S 1303 , refer to S 1201  to S 1203 . Details are not described herein again. 
     S 1304 : The SMF network element determines, according to the PCC rule corresponding to the flow, whether a session modification procedure or a session establishment procedure can be triggered for the flow, to establish a corresponding QoS flow for the flow. If the SMF network element determines, according to the PCC rule corresponding to the flow, that the corresponding QoS flow can be established for the flow, S 1305  may be performed; otherwise, the communication method in  FIG. 7  may be performed. 
     That the SMF network element determines, according to the PCC rule corresponding to the flow, whether the corresponding QoS flow can be established for the flow may be understood as follows: The SMF network element determines, according to the PCC rule corresponding to the flow, whether a core network and a radio access network can meet a bandwidth requirement and a latency requirement of the flow. 
     S 1305 : The SMF network element sends first latency information to the UE. Correspondingly, the UE receives the first latency information from the SMF network element. For this step, refer to S 1208 . Details are not described herein again. 
     For S 1306  to S 1308 , refer to S 1209  to S 1211 . Details are not described herein again. 
     A schematic flowchart of a communication method according to an embodiment of this application is shown in  FIG. 14 . It should be understood that  FIG. 14  shows steps or operations of the communication method, but these steps or operations are merely examples. In this embodiment of this application, other operations or variations of the operations in  FIG. 14  may be further performed. 
     S 1401 : A UPF network element receives first latency information of a flow from a TSN, where the first latency information is used to indicate a first latency of transmitting the flow from a flow service provider in the TSN to the UPF network element. 
     For this step, refer to S 201 . Details are not described herein again. 
     S 1402 : The UPF network element sends information about the flow to an SMF network element. Correspondingly, the SMF network element receives the information about the flow from the UPF network element. 
     The information about the flow includes at least one of the following: an identifier ID of the flow, a source address and a destination address of the flow, a size of a maximum frame used for transmitting the flow, an interval between frames used for transmitting the flow, a priority of the flow, a maximum allowable latency of transmitting a single frame of the flow from a talker to a listener, or a reliability requirement of the flow. 
     For example, the UPF network element may forward, to the SMF network element, the flow service provider broadcast declaration message that is received by the UPF network element from the TSN in S 1401 . 
     S 1403 : The SMF network element sends third latency information to the UPF network element based on the information about the flow, where the third latency information is used to indicate a third latency of transmitting the flow from the UPF network element to UE. The third latency may be a maximum transmission latency of transmitting the flow from the UPF network element to the UE. Correspondingly, the UPF network element receives the third latency information from the SMF network element. For example, after receiving the information about the flow from the UE, the SMF network element obtains a PCC rule of the flow based on the information about the flow, determines, according to the PCC rule of the flow, a 5QI corresponding to the flow, and further determines a PDB that is between the UPF and the UE and that corresponds to the 5QI, where the PDB is used as a maximum transmission latency of transmitting the flow from the UPF network element to the UE, and sends the third latency information to the UPF network element. 
     Alternatively, after receiving information about the flow from the UE, the SMF network element obtains the PCC rule of the flow based on the information about the flow, determines, according to the PCC rule of the flow, the 5QI corresponding to the flow, and sends the 5QI to the UPF. The UPF determines, based on the 5QI, the PDB that is between the UPF and the UE and that corresponds to the 5QI. The PDB is used as the maximum transmission latency of transmitting the flow from the UPF network element to the UE. For an implementation in which the SMF network element obtains the PCC rule of the flow, refer to S 303 . For an implementation in which the SMF network element determines the maximum transmission latency according to the PCC rule, refer to S 304 . Details are not described herein again. 
     For example, the SMF network element may send the flow service provider broadcast declaration message to the UPF network element, and the message carries the third latency information. 
     The UE may be the UE  101  in  FIG. 1 . 
     S 1404 : The UPF network element determines, based on the first latency indicated by the first latency information and the third latency indicated by the third latency information, a second latency of transmitting the flow from the flow service provider in the TSN to the UE. 
     For this step, refer to an implementation in which the SMF network element determines the second latency in S 204 . Details are not described herein again. 
     S 1405 : The UPF network element sends second latency information and identification information of the flow to the UE. 
     For example, the UPF network element may send the flow service provider broadcast declaration message to the UE, and the message carries the second latency information and the identification information of the flow. The identification information of the flow is used to indicate an identifier of the flow. 
     It should be understood that S 1405  is not a step that needs to be performed. In other words, the UPF network element may not send the second latency information to the UE. 
     Optionally, the UPF network element may send the second latency information to the TSN. For example, the UPF network element may send a flow service recipient ready message to the TSN, and the message carries the second latency information and the identification information of the flow. 
     In the communication method, the UPF network element uses, as an accumulated latency of transmitting the flow from the UPF network element to the UE, the maximum transmission latency that is determined by the SMF network element and that is of transmitting the flow from the UPF network element to the UE. However, in the prior art, clock synchronization needs to be performed between every two adjacent nodes between the UPF network element and the UE, and finally, clock synchronization between all nodes between the UPF network element and the UE is implemented, to support the TSN network on all transmission nodes between the UPF network element and the UE, so as to calculate the accumulated latency of transmitting the flow from the UPF network element to the UE. Compared with that in the prior art, the solution for the communication method is simple and easy to implement. 
     A schematic flowchart of a communication method according to another embodiment of this application is shown in  FIG. 15 . It should be understood that  FIG. 15  shows steps or operations of the communication method, but these steps or operations are merely examples. In this embodiment of this application, other operations or variations of the operations in  FIG. 15  may be further performed. In addition, the steps in  FIG. 15  may be performed in a sequence different from that presented in  FIG. 15 , and possibly, not all operations in  FIG. 15  need to be performed. 
     S 1501 : A UPF network element receives first latency information from a TSN, where the first latency information is used to indicate a first latency of transmitting a flow from a flow service provider in the TSN to the UPF network element. 
     For this step, refer to S 201 . Details are not described herein again. 
     S 1502 : The UPF network element sends information about the flow to an SMF network element. Correspondingly, the SMF network element receives the information about the flow from the UPF network element. 
     For this step, refer to S 1402 . Details are not described herein again. 
     S 1503 : The SMF network element sends third latency information to the UPF network element based on the information about the flow, where the third latency information is used to indicate a maximum transmission latency of transmitting the flow from the UPF network element to UE. Correspondingly, the UPF network element receives the third latency information from the SMF network element. 
     For this step, refer to S 1403 . Details are not described herein again. 
     S 1504 : The UPF network element determines, based on the maximum transmission latency in S 1503  and the first latency indicated by the first latency information, a second latency of transmitting the flow from the flow service provider in the TSN to the UE. 
     For this step, refer to S 204 . Details are not described herein again. 
     S 1505 : The UPF network element sends second latency information and identification information of the flow to the UE, where the second latency information is used to indicate the second latency. Correspondingly, the UE receives the second latency information from the UPF network element, and the identification information of the flow is used to indicate an identifier of the flow. 
     For example, the UPF network element may modify, to the second latency information, the first latency information that is in the flow service provider broadcast declaration message and that is received by the UPF network element from the TSN, to modify the first latency recorded in the flow service provider broadcast declaration message to the second latency. Then, the UPF network element may send, to the UE, a flow service provider broadcast declaration message obtained after modification. 
     S 1506 : The UE determines, based on the second latency information received in S 1505 , whether the second latency can meet a latency requirement of the flow. 
     For this step, refer to S 309 . Details are not described herein again. 
     S 1507 : The UE sends a message to the UPF network element, to indicate that the UE can receive the flow. The message may include the identification information of the flow. Optionally, the message may further include the second latency information. 
     For this step, refer to S 310 . Details are not described herein again. 
     S 1508 : The UPF network element reserves a bandwidth resource for the flow based on a bandwidth requirement of the flow. The bandwidth requirement of the flow may be received by the UPF network element from the SMF network element. The SMF network element may determine the bandwidth requirement of a flow according to a PCC rule of the flow. 
     Optionally, S 1508  may not be performed in the communication method in this embodiment of this application. In other words, the bandwidth resource does not need to be reserved for the flow on the UPF network element in advance. 
     S 1509 : If the UPF network element successfully reserves the bandwidth resource for the flow, the UPF network element sends, to the SMF network element, information indicating that the UPF network element successfully reserves the bandwidth resource, so that the SMF network element sends bandwidth requirement information of the flow to an AN device corresponding to the UE. In addition, the UPF network element may further update a credit scheduling parameter of the UPF network element. 
     The UPF network element reserves the bandwidth resource for the flow based on the bandwidth requirement information of the flow. In this way, when the flow is transmitted to the UPF network element, the UPF network element may have a corresponding bandwidth resource to transmit the flow, thereby improving transmission reliability of the flow. 
     S 1510 : The SMF network element sends the bandwidth requirement information of the flow to the AN device corresponding to the UE, to indicate the AN device to reserve the bandwidth resource for the flow. 
     For this step, refer to S 313 . Details are not described herein again. 
     Optionally, S 1510  may not be performed in the communication method in this embodiment of this application. In other words, the bandwidth resource does not need to be reserved for the flow on the AN device in advance. 
     If S 1510  is not performed in the communication method in this embodiment of this application, correspondingly, S 1511  and S 1512  may not be performed. 
     S 1511 : The AN device sends first information to the SMF network element, where the first information is used to indicate whether the access network device successfully reserves the bandwidth resource for the flow based on the bandwidth requirement information of the flow. 
     Optionally, in the communication method, when S 1510  is performed, S 1511  and S 1512  may not be performed. 
     S 1512 : If the SMF network element receives the first information from the AN device, the SMF network element sends the first information to the UPF network element. 
     S 1513 : The UPF network element sends the identification information of the flow and the second latency information to the TSN. 
     For example, the UPF network element may send, to the TSN, the flow service recipient ready message, and the flow service recipient ready message carries the identification information of the flow and the second latency information. 
     If S 1512  is performed in the communication method, the UPF network element may perform S 1513  after the UPF network element receives the first information from the SMF network element, and the first information indicates that the AN device successfully reserves the resource for the flow. If the UPF network element does not receive the first information sent by the SMF, the UPF network element may perform the communication method shown in  FIG. 17 . 
     It should be understood that, in the communication method in this embodiment of this application, an execution sequence of S 1508  to S 1512  is not limited. For example, S 1508  to S 1512  may be performed before S 1505  or S 1504 . 
       FIG. 16  is a schematic flowchart of a communication method according to another embodiment of this application. It should be understood that  FIG. 16  shows steps or operations of the communication method, but these steps or operations are merely examples. In this embodiment of this application, other operations or variations of the operations in  FIG. 16  may be further performed. In addition, the steps in  FIG. 16  may be performed in a sequence different from that presented in  FIG. 16 , and possibly, not all operations in  FIG. 16  need to be performed. 
     S 1601 : A UPF network element receives first latency information from a TSN, where the first latency information is used to indicate a first latency of transmitting a flow from a flow service provider in the TSN to the UPF network element. 
     For this step, refer to S 201 . Details are not described herein again. 
     S 1602 : The UPF network element sends information about the flow to an SMF network element. Correspondingly, the SMF network element receives the information about the flow from the UPF network element. 
     For this step, refer to S 202 . Details are not described herein again. 
     S 1603 : The SMF network element sends third latency information to the UPF network element based on the information about the flow, where the third latency information is used to indicate a maximum transmission latency of transmitting the flow from the UPF network element to UE. Correspondingly, the UPF network element receives the third latency information from the SMF network element. 
     For this step, refer to S 1403 . Details are not described herein again. 
     S 1604 : The UPF network element determines, based on the maximum transmission latency in S 1603  and the first latency indicated by the first latency information, a second latency of transmitting the flow from the flow service provider in the TSN to the UE. 
     For this step, refer to S 204 . Details are not described herein again. 
     S 1605 : The UPF network element sends identification information of the flow to the UE. Correspondingly, the UE receives the identification information of the flow from the UPF network element. 
     For this step, refer to S 608 . Details are not described herein again. 
     S 1606 : The UE determines, based on the identification information that is of the flow and that is received in S 1605 , whether the UE is interested in the flow. For this step, refer to S 609 . Details are not described herein again. 
     S 1607 : The UE sends a message to the UPF network element, to indicate that the UE can receive the flow. The message may include the identification information of the flow. 
     For this step, refer to S 610 . Details are not described herein again. 
     S 1608 : The UPF network element reserves a bandwidth resource for the flow based on a bandwidth requirement of the flow. The bandwidth requirement of the flow may be received by the UPF network element from the SMF network element. The SMF network element may determine the bandwidth requirement of a flow according to a PCC rule of the flow. 
     Optionally, S 1608  may not be performed in the communication method in this embodiment of this application. In other words, the bandwidth resource does not need to be reserved for the flow on the UPF network element in advance. 
     S 1609 : If the UPF network element successfully reserves the bandwidth resource for the flow, the UPF network element sends, to the SMF network element, information indicating that the UPF network element successfully reserves the bandwidth resource, so that the SMF network element sends bandwidth requirement information of the flow to an AN device corresponding to the UE. In addition, the UPF network element may further update a credit scheduling parameter of the UPF network element. 
     The UPF network element reserves the bandwidth resource for the flow based on the bandwidth requirement information of the flow. In this way, when the flow is transmitted to the UPF network element, the UPF network element may have a corresponding bandwidth resource to transmit the flow, thereby improving transmission reliability of the flow. 
     S 1610 : The SMF network element sends the bandwidth requirement information of the flow to the AN device corresponding to the UE, to indicate the AN device to reserve the bandwidth resource for the flow. 
     For this step, refer to S 313 . Details are not described herein again. 
     Optionally, S 1610  may not be performed in the communication method in this embodiment of this application. In other words, the bandwidth resource does not need to be reserved for the flow on the AN device in advance. 
     If S 1610  is not performed in the communication method in this embodiment of this application, correspondingly, S 1611  and S 1612  may not be performed. 
     S 1611 : The AN device sends first information to the SMF network element, where the first information is used to indicate whether the access network device successfully reserves the bandwidth resource for the flow based on the bandwidth requirement information of the flow. 
     Optionally, in the communication method, when S 1610  is performed, S 1611  and S 1612  may not be performed. 
     S 1612 : If the SMF network element receives the first information from the AN device, the SMF network element sends the first information to the UPF network element. 
     S 1613 : The UPF network element sends the identification information of the flow and the second latency information to the TSN. 
     For example, the UPF network element may send, to the TSN, the flow service recipient ready message, and the flow service recipient ready message carries the identification information of the flow and the second latency information. 
     If S 1612  is performed in the communication method, the UPF network element may perform S 1613  after the UPF network element receives the first information from the SMF network element, and the first information indicates that the AN device successfully reserves the resource for the flow. If the UPF network element does not receive the first information sent by the SMF, the UPF network element may perform the communication method shown in  FIG. 17 . 
     It should be understood that, in the communication method in this embodiment of this application, an execution sequence of S 1608  to S 1612  is not limited. For example, S 1608  to S 1612  may be performed before S 1605  or S 1604 . 
       FIG. 17  is a schematic flowchart of a communication method according to another embodiment of this application. It should be understood that  FIG. 17  shows steps or operations of the communication method, but these steps or operations are merely examples. In this embodiment of this application, other operations or variations of the operations in  FIG. 17  may be further performed. In addition, the steps in  FIG. 17  may be performed in a sequence different from that presented in  FIG. 17 , and possibly, not all operations in  FIG. 17  need to be performed. 
     S 1701 : A UPF network element sends a flow service provider failure declaration message to UE, where the message is used to indicate that a flow service cannot be provided due to a bandwidth limitation or another limitation. 
     For example, when determining that the UPF network element or an AN device cannot reserve a bandwidth resource for a flow or cannot meet a QoS requirement of the flow, the UPF network element may send the flow service provider failure declaration message to the UE. 
     For example, when a flow with a higher priority needs to be transmitted, or after UE moves and is handed over to a new base station, an output port corresponding to the UPF network element changes, and consequently, the output port exceeds an upper limit of reservation. Alternatively, when a PCF does not allow a bandwidth resource to be reserved for the flow, the UPF network element may determine that the QoS requirement of the flow cannot be met. 
     S 1702 : The UE initiates a flow service recipient request failure declaration message to the UPF network element. 
     S 1703 : The UPF network element forwards the flow service provider request failure declaration to a flow service provider in a TSN. 
     A function of the flow service recipient request failure declaration message is to notify the flow service provider in the TSN of a resource reservation failure and a cause of the failure. 
     It should be understood that message names shown in  FIG. 17  are merely examples. Any message that can implement a corresponding function in the communication method falls within the protection scope of the embodiments of this application. 
     As shown in  FIG. 19 , another application scenario to which the communication method in the embodiments of this application may be applied may include UE  1901 , an access network device  1902 , a UPF network element  1903 , an AMF network element  1904 , an SMF network element  1905 , a PCF network element  1906 , a communications device  1907 , and a communications device  1908 . 
     The communications device  1907  and the communications device  1908  may be respectively a flow service provider or a flow service recipient in a TSN. A communications system to which the UE  1901 , the access network device  1902 , the UPF network element  1903 , the AMF network element  1904 , the SMF network element  1905 , and the PCF network element  1906  belong may be a 3GPP communications system (for example, a 5G communications system). A communications system to which the UE  1901 , the access network device  1902 , the UPF network element  1903 , the AMF network element  1904 , the SMF network element  1905 , and the PCF network element  1906  belong may be used as a bridge of the TSN. 
     For example, when the communications device  1907  is used as the flow service provider in the TSN, and the communications device  1908  is used as the flow service recipient, the UE  1901  may be used as an input port of the bridge of the TSN, and the UPF network element  1903  may be used as an output port of the bridge of the TSN. Similarly, when the communications device  1908  is used as the flow service provider in the TSN, and the communications device  1907  is used as the flow service recipient, the UPF network element  1903  may be used as an input port of the bridge of the TSN, and the UE  1901  may be used as an output port of the bridge of the TSN. A network element or device that is in the TSN and that communicates with a communications device used as an output port in a 3GPP communications system may be referred to as a next-hop network element of the communications device used as the output port in the 3GPP communications system. The communications device  1907  may be integrated with the UE  1901 . 
     In the application scenario shown in  FIG. 19 , an accumulated latency between the flow service provider and the next-hop network element of the communications device used as the output port in the 3GPP communications system needs to be calculated. For this problem, this application provides the following communication method. 
       FIG. 20  is a schematic flowchart of a communication method according to an embodiment of this application. It should be understood that  FIG. 20  shows steps or operations of the communication method, but these steps or operations are merely examples. In this embodiment of this application, other operations or variations of the operations in  FIG. 20  may be further performed. In addition, the steps in  FIG. 20  may be performed in a sequence different from that presented in  FIG. 20 , and possibly, not all operations in  FIG. 20  need to be performed. 
     S 2001 : A UPF network element receives first latency information from a TSN, where the first latency information is used to indicate a first latency, and the first latency is an accumulated latency of transmitting the flow from a flow service provider in the TSN to the UPF network element. 
     For example, the UPF network element  1903  receives a flow service provider broadcast declaration message from a network element that is in the TSN and that is used as a previous hop of the UPF network element  1903 . The message may be used to broadcast a flow and a QoS requirement corresponding to the flow, and the message may include identification information of the flow and the first latency information. In this case, the first latency is an accumulated latency of transmitting the flow from the communications device  1908  used as the flow service provider to the UPF network element  1903 . The previous-hop network element of the UPF network element  1903  may be the communications device  1908 , or may be a device or a network element between the UPF network element  1903  and the communications device  1908 . 
     Optionally, the message may further include one or more of the following information: a destination address, a source address, a maximum frame size, a maximum frame interval, a priority of a frame, a maximum allowable latency of transmitting a single frame of the flow from the flow service provider to a flow service recipient, a reliability requirement of the flow, or a resource reservation failure cause. 
     It should be understood that, in this embodiment of this application, for ease of description, all information other than the first latency information in information related to the flow is referred to as information about the flow. For example, the destination address, the source address, the maximum frame size, the maximum frame interval, the priority of the frame, the maximum allowable latency of transmitting the single frame of the flow from the flow service provider to the flow service recipient, the reliability requirement of the flow, the resource reservation failure cause, an identifier of the flow, a QoS parameter of the flow, or the like is referred to as the information about the flow. 
     S 2002 : The UPF network element sends the first latency information to UE. Correspondingly, the UE receives the first latency information from the UPF network element. 
     For example, after receiving the flow service provider broadcast declaration message from the TSN, the UPF network element  1903  forwards the flow service provider broadcast declaration message to the UE  1901 . The flow service provider broadcast declaration message carries the first latency information and the information about the flow. 
     For example, after receiving the flow service provider broadcast declaration message from the TSN, the UPF network element  1903  obtains the first latency information and the information about the flow that are in the flow service provider broadcast declaration message, and sends the first latency information and the information about the flow to the UE  1901 . 
     S 2003 : The UE sends the first latency information to an SMF network element. Correspondingly, the SMF network element receives the first latency information from the UE. 
     For example, after receiving the flow service provider broadcast declaration message from the UPF network element  1903 , the UE  1901  forwards the flow service provider broadcast declaration message to the SMF network element  1905 . The flow service provider broadcast declaration message carries the first latency information and the information about the flow. 
     For example, after receiving the flow service provider broadcast declaration message from the UPF network element  1903 , the UE  1901  obtains the first latency information and the information about the flow that are in the flow service provider broadcast declaration message, and sends the first latency information and the information about the flow to the SMF network element  1905 . 
     S 2004 : The SMF network element obtains, from a PCF network element, a PCC rule corresponding to the flow. 
     For example, the SMF network element sends the information about the flow to the PCF network element. The information about the flow may include identification information of the flow, a QoS parameter of the flow, or the like. Correspondingly, the PCF network element receives the information about the flow from the SMF network element. 
     Then, the PCF network element sends the PCC rule corresponding to the flow to the SMF network element. Correspondingly, the SMF network element receives the PCC rule corresponding to the flow from the PCF network element. 
     It should be understood that S 2004  is not a step that needs to be performed. This step is performed to enable the SMF network element to obtain the PCC rule corresponding to the flow. An implementation in which the SMF network element obtains the PCC rule corresponding to the flow is not limited in this embodiment of this application. 
     S 2006 : The SMF network element determines a first target latency according to the PCC rule corresponding to the flow, and the first target latency is a transmission latency of the flow from the UPF network element to the UE. 
     In this embodiment of this application, the first target latency may also be referred to as an accumulated latency of transmitting the flow between the UPF network element and the UE. 
     An example of the first target latency may be a maximum transmission latency of the flow from the UPF network element to the UE. For example, the SMF network element may determine the maximum transmission latency of the flow from the UPF network element to the UE based on a 5QI in the PCC rule. For example, the SMF network element may use a PDB that is between the UPF and the UE and that corresponds to the 5QI as the maximum transmission latency of transmitting the flow from the UPF to the UE. 
     Optionally, after obtaining the PCC rule, the SMF network element may trigger a packet data unit (PDU) session modification process, to establish a QoS flow for the flow, to reserve a resource for the flow. 
     S 2007 : The SMF network element determines a second latency based on the first latency and the first target latency, where the second latency is a transmission latency of the flow from the flow service provider to the UE. 
     For example, the SMF network element determines the second latency based on the first latency indicated by the first latency information carried in the flow service provider broadcast declaration message and the maximum transmission latency that is determined in S 2006 . 
     If the first latency is denoted as an accumulated latency 1, the first target latency is denoted as T1, and the second latency is denoted as an accumulated latency 2, the accumulated latency 2=the accumulated latency 1+T1. 
     S 2008 : The SMF network element sends second latency information to the UE, where the second latency information is used to indicate the second latency. Correspondingly, the UE receives the second latency information from the SMF network element. 
     For example, the SMF network element modifies, to the second latency information, the first latency information that is in the flow service provider broadcast declaration message and that is received by the SMF network element from the UE, and sends, to the UE, a flow service provider broadcast declaration message obtained through modification. 
     Alternatively, the SMF network element sends the second latency information to the UE through another message. 
     S 2009 : The UE determines a third latency based on the second latency and a second target latency, where the second target latency is a latency of transmitting the flow from the UE to a target network element that is in the TSN network and that is used as a next hop of the UE, and the third latency is a latency of transmitting the flow from the flow service provider to the target network element that is in the TSN and that is used as the next hop of the UE. 
     For example, the second target latency is an accumulated transmission latency of the flow from the UE  1901  to the target network element that is in the TSN and that is used as the next hop of the UE. The third latency is an accumulated transmission latency of the flow from the communications device  108  to the next-hop network element. The next-hop network element may be the communications device  1907  or may be a communications device between the UE  1901  and the communications device  1907 . 
     An implementation in which the UE determines the third latency based on the second latency and the second target latency may include: The UE adds the second target latency to the second latency. For example, if the second target latency is denoted as T2, the second latency is denoted as an accumulated latency 2, and the third latency is denoted as an accumulated latency 3, the accumulated latency 3=the accumulated latency 2+T2. 
     The second target latency may be obtained by the UE from the target network element, or may be configured. A manner in which the UE obtains the second target latency is not limited in this embodiment of this application. 
     S 2010 : The UE sends third latency information to the target network element that is in the TSN and that is used as the next hop of the UE, where the third latency information is used to indicate the third latency. 
     For example, the UE modifies, to the third latency information, the first latency information that is in the flow service provider broadcast declaration message and that is received by the UE from the UPF network element, or the UE modifies, to the third latency information, the second latency information that is in the flow service provider broadcast declaration message and that is received by the UE from the SMF network element, and sends, to the target network element, a flow service provider broadcast declaration message obtained through modification. 
     If the target network element is the flow service recipient, the target network element may determine whether the target network element is interested in the flow, and if the target network element is interested in the flow, determine whether the third latency can meet a latency requirement of the flow. If the third latency can meet the latency requirement of the flow, the target network element sends the third latency information to the UE. 
     For example, the target network element sends, to the UE, a flow service recipient ready message, and the flow service recipient ready message includes the identification information of the flow and the third latency information. Then, the UE may forward the flow service recipient ready message to the UPF network element, and then the UPF network element forwards the flow service recipient ready message to a next-hop network element of the UPF network element in the TSN. 
     In the communication method shown in  FIG. 20 , the SMF network element learns, from the UE, of the first latency of the flow from the flow service provider to the UPF network element, determines, according to the PCC rule of the flow, the first target latency of transmitting the flow between the UPF network element and the UE, determines, based on the first latency and the first target latency, the second latency of transmitting the flow from the flow service provider to the UE, and notifies the UE of the second latency. Then, the UE determines, based on the second latency and the second target latency of the flow from the UE to the network element that is in the TSN and that is used as the next hop of the UE, the third latency of the flow from the flow service provider to the next-hop network element. 
     It should be understood that names of messages shown in  FIG. 20  are merely examples. Any message that can implement a corresponding function in the communication method falls within the protection scope of the embodiments of this application. 
     In the communication method shown in  FIG. 20 , an accumulated latency of transmitting the flow from the flow service provider to the target network element that is in the TSN network and that is used as the next hop of the UE may be obtained, and a method for obtaining the accumulated latency is relatively simple, because in the communication method, the accumulated latency can also be obtained through calculation without requiring that the UE or the UPF network element and each device between the UE and the UPF network element are synchronized with a master clock source. 
     In addition, in the communication method shown in  FIG. 20 , a 3GPP system is considered as a bridge in the TSN network, and may receive a flow reservation protocol message (an SRP message) from a node that is in the TSN network and that is used as a previous node of the bridge, provide a method for processing the SRP message, and send the SRP message to a node that is in the TSN and that is used as a next hop of the bridge, so that a latency requirement of a URLLC service flow can be ensured and a bandwidth resource can be reserved in a scenario in which the 3GPP network interworks with the TSN network. 
       FIG. 21  is a schematic flowchart of a communication method according to an embodiment of this application. It should be understood that  FIG. 21  shows steps or operations of the communication method, but these steps or operations are merely examples. In this embodiment of this application, other operations or variations of the operations in  FIG. 21  may be further performed. In addition, the steps in  FIG. 21  may be performed in a sequence different from that presented in  FIG. 21 , and possibly, not all operations in  FIG. 21  need to be performed. 
     S 2101 : A UPF network element receives first latency information from a TSN, where the first latency information is used to indicate a first latency, and the first latency is an accumulated latency of transmitting a flow from a flow service provider in the TSN to the UPF network element. 
     For example, the UPF network element  1903  receives a flow service provider broadcast declaration message from a network element that is in the TSN and that is used as a previous hop of the UPF network element  1903 . The message may be used to broadcast a flow and a QoS requirement corresponding to the flow, and the message includes identification information of the flow and the first latency information. In this case, the first latency is an accumulated latency of transmitting the flow from the communications device  1908  used as the flow service provider to the UPF network element  1903 . The previous-hop network element of the UPF network element  1903  may be the communications device  1908 , or may be a device or a network element between the UPF network element  1903  and the communications device  1908 . 
     Optionally, the message may further include one or more of the following information: a destination address, a source address, a maximum frame size, a maximum frame interval, a priority of a frame, a maximum allowable latency of transmitting a single frame of the flow from the flow service provider to a flow service recipient, a reliability requirement of the flow, or a resource reservation failure cause. 
     It should be understood that, in this embodiment of this application, for ease of description, all information other than the first latency information in information related to the flow is referred to as information about the flow. For example, the destination address, the source address, the maximum frame size, the maximum frame interval, the priority of the frame, the maximum allowable latency of transmitting the single frame of the flow from the flow service provider to the flow service recipient, the reliability requirement of the flow, the resource reservation failure cause, an identifier of the flow, a QoS parameter of the flow, or the like is referred to as the information about the flow. 
     S 2102 : The UPF network element sends the first latency information to UE. Correspondingly, the UE receives the first latency information from the UPF network element. 
     For example, after receiving the flow service provider broadcast declaration message from the TSN, the UPF network element  1903  forwards the flow service provider broadcast declaration message to the UE  1901 . The flow service provider broadcast declaration message carries the first latency information and the information about the flow. 
     For example, after receiving the flow service provider broadcast declaration message from the TSN, the UPF network element  1903  obtains the first latency information and the information about the flow that are in the flow service provider broadcast declaration message, and sends the first latency information and the information about the flow to the UE  1901 . 
     S 2103 : UE sends information about a flow to an SMF network element. Correspondingly, the SMF network element receives the information about the flow from the UE. 
     For example, after receiving the flow service provider broadcast declaration message from the UPF network element  1903 , the UE  1901  forwards the flow service provider broadcast declaration message to the SMF network element  1905 . The flow service provider broadcast declaration message carries the information about the flow. 
     For example, after receiving the flow service provider broadcast declaration message from the UPF network element  1903 , the UE  1901  obtains the information about the flow in the flow service provider broadcast declaration message, and sends the information about the flow to the SMF network element  1905 . 
     S 2104 : The SMF network element obtains, from a PCF network element, a PCC rule corresponding to the flow. 
     For example, the SMF network element sends the information about the flow to the PCF network element. The information about the flow may include identification information of the flow and the like. Correspondingly, the PCF network element receives the information about the flow from the SMF network element. 
     The PCF network element sends the PCC rule corresponding to the flow to the SMF network element. Correspondingly, the SMF network element receives the PCC rule corresponding to the flow from the PCF network element. 
     It should be understood that S 2104  is not a step that needs to be performed. This step is performed to enable the SMF network element to obtain the PCC rule corresponding to the flow. An implementation in which the SMF network element obtains the PCC rule corresponding to the flow is not limited in this embodiment of this application. 
     S 2106 : The SMF network element sends, to the UE according to the PCC rule, a quality of service parameter corresponding to the flow. Correspondingly, the UE network element receives the quality of service parameter from the SMF network element. 
     For example, the SMF network element determines, according to the PCC rule, a 5QI corresponding to the flow, or determines a PDB between the UPF network element and the UE according to the PCC rule, and sends the 5QI or the PDB to the UE. Alternatively, the SMF network element sends, to the UE, QoS flow identification information corresponding to the flow. 
     Optionally, after obtaining the PCC rule, the SMF network element may trigger a PDU session modification process, to establish a QoS flow for the flow, to reserve a resource for the flow. 
     S 2107 : The UE determines a first target latency based on the quality of service parameter corresponding to the flow, where the first target latency is a latency of transmitting the flow between the UPF network element and the UE. 
     An example of the first target latency may be a maximum transmission latency of the flow from the UPF network element to the UE. For example, the UE may determine the maximum transmission latency of the flow from the UPF network element to the UE based on the 5QI, the PDB, or the QoS flow identification information received from the SMF network element. 
     For example, if the UE obtains the PDB from the SMF network element, the UE may use the PDB as the first target latency. 
     For example, if the UE obtains the QoS flow identification information from the SMF network element, the UE may obtain a PDB in a corresponding QoS parameter based on the QoS flow identification information, and use the PDB as the first target latency. 
     For example, if the UE obtains the 5QI corresponding to the flow from the SMF network element, the UE may obtain the PDB in the corresponding QoS parameter based on the 5QI, and use the PDB as the first target latency. 
     S 2108 : The UE determines a third latency based on the first latency, the first target latency, and a second target latency, where the second target latency is a latency of transmitting the flow from the UE to a target network element that is in the TSN network and that is used as a next hop of the UE, and the third latency is a latency of transmitting the flow from the flow service provider to the target network element that is in the TSN and that is used as the next hop of the UE. 
     If the first latency is denoted as an accumulated latency 1, the first target latency is denoted as T1, the second target latency is denoted as T2, and the third latency is denoted as an accumulated latency 3, a possible implementation in which the UE determines the third latency based on the first latency, the first target latency, and the second target latency is as follows: The accumulated latency 3=the accumulated latency 1+T1+T2. 
     The second target latency may be obtained by the UE from the target network element, or may be configured. A manner in which the UE obtains the second target latency is not limited in this embodiment of this application. 
     S 2109 : The UE sends third latency information to the target network element, where the third latency information is used to indicate the third latency. 
     For example, the UE modifies, to the third latency information, the first latency information that is in the flow service provider broadcast declaration message and that is received by the UE from the UPF network element, and sends, to the target network element, a flow service provider broadcast declaration message obtained through modification. 
     If the target network element is the flow service recipient, the target network element may determine whether the target network element is interested in the flow, and if the target network element is interested in the flow, determine whether the third latency can meet a latency requirement of the flow. If the third latency can meet the latency requirement of the flow, the target network element sends the third latency information to the UE. 
     For example, the target network element sends, to the UE, a flow service recipient ready message, and the flow service recipient ready message includes the identification information of the flow and the third latency information. Then, the UE may forward the flow service recipient ready message to the UPF network element, and then the UPF network element forwards the flow service recipient ready message to a next-hop network element of the UPF network element in the TSN. 
     In the communication method shown in  FIG. 21 , the SMF network element learns of the information about the flow from the UE, sends, to the UE based on the information about the flow, the QoS parameter corresponding to the flow, and sends the QoS parameter to the UE. The UE determines, based on the QoS parameter, the first target latency of transmitting the flow between the UPF network element and the UE, and determines, based on the first latency of transmitting the flow from the flow service provider to the UPF network element, the first target latency, and the second target latency of the flow from the UE to the target network element that is in the TSN and that is used as the next hop of the UE, the third latency of the flow from the flow service provider to the target network element. 
     It should be understood that names of messages shown in  FIG. 21  are merely examples. Any message that can implement a corresponding function in the communication method falls within the protection scope of the embodiments of this application. 
     In the communication method shown in  FIG. 21 , an accumulated latency of transmitting the flow from the flow service provider to the target network element that is in the TSN network and that is used as the next hop of the UE may be obtained, and a method for obtaining the accumulated latency is relatively simple, because in the communication method, the accumulated latency can also be obtained through calculation without requiring that the UE or the UPF network element and each device between the UE and the UPF network element are synchronized with a master clock source. 
     In addition, in the communication method shown in  FIG. 21 , a 3GPP system is considered as a bridge in the TSN network, and may receive a flow reservation protocol message (an SRP message) from a node that is in the TSN network and that is used as a previous node of the bridge, provide a method for processing the SRP message, and send the SRP message to a node that is in the TSN and that is used as a next hop of the bridge, so that a latency requirement of a URLLC service flow can be ensured and a bandwidth resource can be reserved in a scenario in which the 3GPP network interworks with the TSN network. 
       FIG. 22  is a schematic flowchart of a communication method according to an embodiment of this application. It should be understood that  FIG. 22  shows steps or operations of the communication method, but these steps or operations are merely examples. In this embodiment of this application, other operations or variations of the operations in  FIG. 22  may be further performed. In addition, the steps in  FIG. 22  may be performed in a sequence different from that presented in  FIG. 22 , and possibly, not all operations in  FIG. 22  need to be performed. 
     S 2201 : A UPF network element receives first latency information from a TSN, where the first latency information is used to indicate a first latency, and the first latency is an accumulated latency of transmitting a flow from a flow service provider in the TSN to the UPF network element. 
     For example, the UPF network element  1903  receives a flow service provider broadcast declaration message from a network element that is in the TSN and that is used as a previous hop of the UPF network element  1903 . The message may be used to broadcast a flow and a QoS requirement corresponding to the flow, and the message includes identification information of the flow and the first latency information. In this case, the first latency is an accumulated latency of transmitting the flow from the communications device  1908  used as the flow service provider to the UPF network element  1903 . The previous-hop network element of the UPF network element  1903  may be the communications device  1908 , or may be a device or a network element between the UPF network element  1903  and the communications device  1908 . 
     Optionally, the message may further include one or more of the following information: a destination address, a source address, a maximum frame size, a maximum frame interval, a priority of a frame, a maximum allowable latency of transmitting a single frame of the flow from the flow service provider to a flow service recipient, a reliability requirement of the flow, or a resource reservation failure cause. 
     It should be understood that, in this embodiment of this application, for ease of description, all information other than the first latency information in information related to the flow is referred to as information about the flow. For example, the destination address, the source address, the maximum frame size, the maximum frame interval, the priority of the frame, the maximum allowable latency of transmitting the single frame of the flow from the flow service provider to the flow service recipient, the reliability requirement of the flow, the resource reservation failure cause, an identifier of the flow, a QoS parameter of the flow, or the like is referred to as the information about the flow. 
     S 2202 : The UPF network element sends the first latency information to an SMF network element. Correspondingly, the SMF network element receives the first latency information from the UPF network element. In addition, the UPF network element may further send the information about the flow to the SMF network element. 
     For example, after receiving the flow service provider broadcast declaration message from the TSN, the UPF network element  1903  forwards the flow service provider broadcast declaration message to the SMF network element  1905 . The flow service provider broadcast declaration message carries the first latency information and the information about the flow. 
     For example, after receiving the flow service provider broadcast declaration message from the TSN, the UPF network element  1903  obtains the first latency information and the information about the flow that are in the flow service provider broadcast declaration message, and sends the first latency information and the information about the flow to the SMF network element  1905 . 
     S 2203 : The SMF network element obtains, from a PCF network element, a PCC rule corresponding to the flow. 
     For example, the SMF network element sends the information about the flow to the PCF network element. The information about the flow may include identification information of the flow, a QoS parameter of the flow, or the like. Correspondingly, the PCF network element receives the information about the flow from the SMF network element. 
     The PCF network element sends the PCC rule corresponding to the flow to the SMF network element. Correspondingly, the SMF network element receives the PCC rule corresponding to the flow from the PCF network element. 
     It should be understood that S 2203  is not a step that needs to be performed. This step is performed to enable the SMF network element to obtain the PCC rule corresponding to the flow. An implementation in which the SMF network element obtains the PCC rule corresponding to the flow is not limited in this embodiment of this application. 
     S 2205 : The SMF network element determines a first target latency according to the PCC rule corresponding to the flow, and the first target latency is a transmission latency of the flow from the UPF network element to the UE. 
     In this embodiment of this application, the first target latency may also be referred to as an accumulated latency of transmitting the flow between the UPF network element and the UE. 
     An example of the first target latency may be a maximum transmission latency of the flow from the UPF network element to the UE. For example, the SMF network element may determine the maximum transmission latency of the flow from the UPF network element to the UE based on a 5QI in the PCC rule. For example, the SMF network element may use a PDB that is between the UPF and the UE and that corresponds to the 5QI as the maximum transmission latency of transmitting the flow from the UPF to the UE. 
     Optionally, after obtaining the PCC rule, the SMF network element may trigger a PDU session modification process, to establish a QoS flow for the flow, to reserve a resource for the flow. 
     S 2206 : The SMF network element determines a second latency based on the first latency and the first target latency, where the second latency is a transmission latency of the flow from the flow service provider to the UE. 
     For example, the SMF network element determines the second latency based on the first latency indicated by the first latency information carried in the flow service provider broadcast declaration message and the maximum transmission latency that is determined in S 2205 . 
     If the first latency is denoted as an accumulated latency 1, the first target latency is denoted as T1, and the second latency is denoted as an accumulated latency 2, the accumulated latency 2=the accumulated latency 1+T1. 
     S 2207 : The SMF network element sends second latency information to the UPF network element, where the second latency information is used to indicate the second latency. Correspondingly, the UPF network element receives the second latency information from the SMF network element. 
     For example, the SMF network element modifies, to the second latency information, the first latency information that is in the flow service provider broadcast declaration message and that is received by the SMF network element from the UPF network element, and sends, to the UPF network element, a flow service provider broadcast declaration message obtained through modification. 
     Alternatively, the SMF network element may send the second latency information to the UPF network element in another manner. 
     S 2208 : The UPF network element sends the second latency information to the UE. Correspondingly, the UE receives the second latency information from the UPF network element. 
     For example, the UPF network element sends, to the UE, the flow service provider broadcast declaration message received from the SMF network element, and the flow service provider broadcast declaration message carries the second latency information. 
     Alternatively, the UPF network element sends, to the UE, the flow service provider broadcast declaration message that is received by the UPF network element from the TSN, and the first latency information in the flow service provider broadcast declaration message is modified to the second latency information. 
     S 2209 : The UE determines a third latency based on the second latency and a second target latency, where the second target latency is a latency of transmitting the flow from the UE to a target network element that is in the TSN network and that is used as a next hop of the UE, and the third latency is a latency of transmitting the flow from the flow service provider to the target network element that is in the TSN and that is used as the next hop of the UE. 
     For example, the second target latency is an accumulated transmission latency of the flow from the UE  1901  to the target network element that is in the TSN and that is used as the next hop of the UE. The third latency is an accumulated transmission latency of the flow from the communications device  108  to the next-hop network element. The next-hop network element may be the communications device  107  or may be a communications device between the UE  1901  and the communications device  1907 . 
     An implementation in which the UE determines the third latency based on the second latency and the second target latency may include: The UE adds the second target latency to the second latency. For example, if the second target latency is denoted as T2, the second latency is denoted as an accumulated latency 2, and the third latency is denoted as an accumulated latency 3, the accumulated latency 3=the accumulated latency 2+T2. 
     The second target latency may be obtained by the UE from the target network element, or may be configured. A manner in which the UE obtains the second target latency is not limited in this embodiment of this application. 
     S 2210 : The UE sends third latency information to the target network element. 
     For example, the UE modifies, to the third latency information, the second latency information that is in the flow service provider broadcast declaration message and that is received by the UE from the UPF network element, and sends, to the target network element, a flow service provider broadcast declaration message obtained through modification. 
     If the target network element is the flow service recipient, the target network element may determine whether the target network element is interested in the flow, and if the target network element is interested in the flow, determine whether the third latency can meet a latency requirement of the flow. If the third latency can meet the latency requirement of the flow, the target network element sends the third latency information to the UE. 
     For example, the target network element sends, to the UE, a flow service recipient ready message, and the flow service recipient ready message includes the identification information of the flow and the third latency information. Then, the UE may forward the flow service recipient ready message to the UPF network element, and then the UPF network element forwards the flow service recipient ready message to a next-hop network element of the UPF network element in the TSN. 
     In the communication method shown in  FIG. 22 , the SMF network element learns, from the UPF network element, of the first latency of the flow from the flow service provider to the UPF network element, determines, according to the PCC rule of the flow, the first target latency of transmitting the flow between the UPF network element and the UE, determines, based on the first latency and the first target latency, the second latency of transmitting the flow from the flow service provider to the UE, and sends the second latency to the UE through the UPF network element. The UE determines, based on the second latency and the second target latency of the flow from the UE to the network element that is in the TSN and that is used as the next hop of the UE, the third latency of the flow from the flow service provider to the next-hop network element. 
     It should be understood that names of messages shown in  FIG. 22  are merely examples. Any message that can implement a corresponding function in the communication method falls within the protection scope of the embodiments of this application. 
     In the communication method shown in  FIG. 22 , an accumulated latency of transmitting the flow from the flow service provider to the target network element that is in the TSN network and that is used as the next hop of the UE may be obtained, and a method for obtaining the accumulated latency is relatively simple, because in the communication method, the accumulated latency can also be obtained through calculation without requiring that the UE or the UPF network element and each device between the UE and the UPF network element are synchronized with a master clock source. 
     In addition, in the communication method shown in  FIG. 22 , a 3GPP system is considered as a bridge in the TSN network, and may receive a flow reservation protocol message (an SRP message) from a node that is in the TSN network and that is used as a previous node of the bridge, provide a method for processing the SRP message, and send the SRP message to a node that is in the TSN and that is used as a next hop of the bridge, so that a latency requirement of a URLLC service flow can be ensured and a bandwidth resource can be reserved in a scenario in which the 3GPP network interworks with the TSN network. 
       FIG. 23  is a schematic flowchart of a communication method according to an embodiment of this application. It should be understood that  FIG. 23  shows steps or operations of the communication method, but these steps or operations are merely examples. In this embodiment of this application, other operations or variations of the operations in  FIG. 23  may be further performed. In addition, the steps in  FIG. 23  may be performed in a sequence different from that presented in  FIG. 23 , and possibly, not all operations in  FIG. 23  need to be performed. 
     S 2301 : A UPF network element receives first latency information from a TSN, where the first latency information is used to indicate a first latency, and the first latency is an accumulated latency of transmitting a flow from a flow service provider in the TSN to the UPF network element. 
     For example, the UPF network element  1903  receives a flow service provider broadcast declaration message from a network element that is in the TSN and that is used as a previous hop of the UPF network element  1903 . The message may be used to broadcast a flow and a QoS requirement corresponding to the flow, and the message includes identification information of the flow and the first latency information. In this case, the first latency is an accumulated latency of transmitting the flow from the communications device  1908  used as the flow service provider to the UPF network element  1903 . The previous-hop network element of the UPF network element  1903  may be the communications device  1908 , or may be a device or a network element between the UPF network element  1903  and the communications device  1908 . 
     Optionally, the message may further include one or more of the following information: a destination address, a source address, a maximum frame size, a maximum frame interval, a priority of a frame, a maximum allowable latency of transmitting a single frame of the flow from the flow service provider to a flow service recipient, a reliability requirement of the flow, or a resource reservation failure cause. 
     It should be understood that, in this embodiment of this application, for ease of description, all information other than the first latency information in information related to the flow is referred to as information about the flow. For example, the destination address, the source address, the maximum frame size, the maximum frame interval, the priority of the frame, the maximum allowable latency of transmitting the single frame of the flow from the flow service provider to the flow service recipient, the reliability requirement of the flow, the resource reservation failure cause, an identifier of the flow, a QoS parameter of the flow, or the like is referred to as the information about the flow. 
     S 2302 : The UPF network element sends information about the flow to an SMF network element. Correspondingly, the SMF network element receives the information about the flow from the UPF network element. 
     For example, after receiving the flow service provider broadcast declaration message from the TSN, the UPF network element  1903  forwards the flow service provider broadcast declaration message to the SMF network element  1905 . The flow service provider broadcast declaration message carries the information about the flow. 
     For example, after receiving the flow service provider broadcast declaration message from the TSN, the UPF network element  1903  obtains the information about the flow in the flow service provider broadcast declaration message, and sends the information about the flow to the SMF network element  1905 . 
     S 2303 : The SMF network element obtains, from a PCF network element, a PCC rule corresponding to the flow. 
     For example, the SMF network element sends the information about the flow to the PCF network element. The information about the flow may include identification information of the flow and the like. Correspondingly, the PCF network element receives the information about the flow from the SMF network element. 
     The PCF network element sends the PCC rule corresponding to the flow to the SMF network element. Correspondingly, the SMF network element receives the PCC rule corresponding to the flow from the PCF network element. 
     It should be understood that S 2303  is not a step that needs to be performed. This step is performed to enable the SMF network element to obtain the PCC rule corresponding to the flow. An implementation in which the SMF network element obtains the PCC rule corresponding to the flow is not limited in this embodiment of this application. 
     S 2305 : The SMF network element sends, to the UPF network element according to the PCC rule, a quality of service parameter corresponding to the flow. Correspondingly, the UPF network element receives the quality of service parameter from the SMF network element. 
     For example, the SMF network element determines, according to the PCC rule, a 5QI corresponding to the flow, or determines a PDB between the UPF network element and the UE according to the PCC rule, and sends the 5QI or the PDB to the UPF network element. Alternatively, the SMF network element sends, to the UPF network element, QoS flow identification information corresponding to the flow. 
     Optionally, after obtaining the PCC rule, the SMF network element may trigger a PDU session modification process, to establish a QoS flow for the flow, to reserve a resource for the flow. 
     S 2306 : The UPF network element determines a first target latency based on the quality of service parameter corresponding to the flow, where the first target latency is a latency of transmitting the flow between the UPF network element and the UE. 
     An example of the first target latency may be a maximum transmission latency of the flow from the UPF network element to the UE. For example, the UPF network element may determine the maximum transmission latency of the flow from the UPF network element to the UE based on the 5QI, the PDB, or the QoS flow identification information received from the SMF network element. 
     For example, if the UPF network element obtains the PDB from the SMF network element, the UPF network element may use the PDB as the first target latency. 
     For example, if the UPF network element obtains the QoS flow identification information from the SMF network element, the UPF network element may obtain a PDB in a corresponding QoS parameter based on the QoS flow identification information, and use the PDB as the first target latency. 
     For example, if the UPF network element obtains the 5QI corresponding to the flow from the SMF network element, the UPF network element may obtain the PDB in the corresponding QoS parameter based on the 5QI, and use the PDB as the first target latency. 
     S 2307 : The UPF network element determines a second latency based on the first latency and the first target latency, where the second latency is a transmission latency of the flow from the flow service provider to the UE. 
     For example, the UPF network element determines the second latency based on the first latency indicated by the first latency information carried in the flow service provider broadcast declaration message and the maximum transmission latency that is determined in S 2306 . 
     If the first latency is denoted as an accumulated latency 1, the first target latency is denoted as T1, and the second latency is denoted as an accumulated latency 2, the accumulated latency 2=the accumulated latency 1+T1. 
     S 2308 : The UPF network element sends second latency information to the UE. 
     Correspondingly, the UE receives the second latency information from the UPF network element. 
     For example, the UPF network element sends, to the UE, the flow service provider broadcast declaration message, and the flow service provider broadcast declaration message carries the second latency information. 
     S 2309 : The UE determines a third latency based on the second latency and a second target latency, where the second target latency is a latency of transmitting the flow from the UE to a target network element that is in the TSN network and that is used as a next hop of the UE, and the third latency is a latency of transmitting the flow from the flow service provider to the target network element that is in the TSN and that is used as the next hop of the UE. 
     For example, the second target latency is an accumulated transmission latency of the flow from the UE  1901  to the target network element that is in the TSN and that is used as the next hop of the UE. The third latency is an accumulated transmission latency of the flow from the communications device  108  to the next-hop network element. The next-hop network element may be the communications device  1907  or may be a communications device between the UE  1901  and the communications device  1907 . 
     An implementation in which the UE determines the third latency based on the second latency and the second target latency may include: The UE adds the second target latency to the second latency. For example, if the second target latency is denoted as T2, the second latency is denoted as an accumulated latency 2, and the third latency is denoted as an accumulated latency 3, the accumulated latency 3=the accumulated latency 2+T2. 
     The second target latency may be obtained by the UE from the target network element, or may be configured. A manner in which the UE obtains the second target latency is not limited in this embodiment of this application. 
     S 2310 : The UE sends third latency information to the target network element. 
     For example, the UE modifies, to the third latency information, the second latency information that is in the flow service provider broadcast declaration message and that is received by the UE from the UPF network element, and sends, to the target network element, a flow service provider broadcast declaration message obtained through modification. 
     If the target network element is the flow service recipient, the target network element may determine whether the target network element is interested in the flow, and if the target network element is interested in the flow, determine whether the third latency can meet a latency requirement of the flow. If the third latency can meet the latency requirement of the flow, the target network element sends the third latency information to the UE. 
     For example, the target network element sends, to the UE, a flow service recipient ready message, and the flow service recipient ready message includes the identification information of the flow and the third latency information. Then, the UE may forward the flow service recipient ready message to the UPF network element, and then the UPF network element forwards the flow service recipient ready message to a next-hop network element of the UPF network element in the TSN. 
     In the communication method shown in  FIG. 23 , the UPF network element learns, from the SMF network element, of the QoS parameter corresponding to the flow, determines, based on the QoS parameter, the first target latency of transmitting the flow between the UPF network element and the UE, determines, based on the first target latency and the first latency of transmitting the flow from the flow service provider to the UPF network element, the second latency of transmitting the latency from the flow service provider to the UE, and notifies the UE of the second latency. The UE determines, based on the second latency and the second target latency of the flow from the UE to the network element that is in the TSN and that is used as the next hop of the UE, the third latency of the flow from the flow service provider to the next-hop network element. 
     It should be understood that names of messages shown in  FIG. 23  are merely examples. Any message that can implement a corresponding function in the communication method falls within the protection scope of the embodiments of this application. 
     In the communication method shown in  FIG. 23 , an accumulated latency of transmitting the flow from the flow service provider to the target network element that is in the TSN network and that is used as the next hop of the UE may be obtained, and a method for obtaining the accumulated latency is relatively simple, because in the communication method, the accumulated latency can also be obtained through calculation without requiring that the UE or the UPF network element and each device between the UE and the UPF network element are synchronized with a master clock source. 
     In addition, in the communication method shown in  FIG. 23 , a 3GPP system is considered as a bridge in the TSN network, and may receive a flow reservation protocol message (an SRP message) from a node that is in the TSN network and that is used as a previous node of the bridge, provide a method for processing the SRP message, and send the SRP message to a node that is in the TSN and that is used as a next hop of the bridge, so that a latency requirement of a URLLC service flow can be ensured and a bandwidth resource can be reserved in a scenario in which the 3GPP network interworks with the TSN network. 
       FIG. 24  is a schematic flowchart of a communication method according to an embodiment of this application. It should be understood that  FIG. 24  shows steps or operations of the communication method, but these steps or operations are merely examples. In this embodiment of this application, other operations or variations of the operations in  FIG. 24  may be further performed. In addition, the steps in  FIG. 24  may be performed in a sequence different from that presented in  FIG. 24 , and possibly, not all operations in  FIG. 24  need to be performed. 
     S 2401 : A UPF network element receives first latency information from a TSN, where the first latency information is used to indicate a first latency, and the first latency is an accumulated latency of transmitting a flow from a flow service provider in the TSN to the UPF network element. 
     For example, the UPF network element  1903  receives a flow service provider broadcast declaration message from a network element that is in the TSN and that is used as a previous hop of the UPF network element  1903 . The message may be used to broadcast a flow and a QoS requirement corresponding to the flow, and the message includes identification information of the flow and the first latency information. In this case, the first latency is an accumulated latency of transmitting the flow from the communications device  1908  used as the flow service provider to the UPF network element  1903 . The previous-hop network element of the UPF network element  1903  may be the communications device  1908 , or may be a device or a network element between the UPF network element  1903  and the communications device  1908 . 
     Optionally, the message may further include one or more of the following information: a destination address, a source address, a maximum frame size, a maximum frame interval, a priority of a frame, a maximum allowable latency of transmitting a single frame of the flow from the flow service provider to a flow service recipient, a reliability requirement of the flow, or a resource reservation failure cause. 
     It should be understood that, in this embodiment of this application, for ease of description, all information other than the first latency information in information related to the flow is referred to as information about the flow. For example, the destination address, the source address, the maximum frame size, the maximum frame interval, the priority of the frame, the maximum allowable latency of transmitting the single frame of the flow from the flow service provider to the flow service recipient, the reliability requirement of the flow, the resource reservation failure cause, an identifier of the flow, a QoS parameter of the flow, or the like is referred to as the information about the flow. 
     S 2402 : The UPF network element sends the first latency information to an SMF network element. Correspondingly, the SMF network element receives the first latency information from the UPF network element. In addition, the UPF network element may further send the information about the flow to the SMF network element. 
     For example, after receiving the flow service provider broadcast declaration message from the TSN, the UPF network element  1903  forwards the flow service provider broadcast declaration message to the SMF network element  1905 . The flow service provider broadcast declaration message carries the first latency information and the information about the flow. 
     For example, after receiving the flow service provider broadcast declaration message from the TSN, the UPF network element  1903  obtains the first latency information and the information about the flow that are in the flow service provider broadcast declaration message, and sends the first latency information and the information about the flow to the SMF network element  1905 . 
     S 2403 : The SMF network element obtains, from a PCF network element, a PCC rule corresponding to the flow. 
     For example, the SMF network element sends the information about the flow to the PCF network element. The information about the flow may include identification information of the flow and the like. Correspondingly, the PCF network element receives the information about the flow from the SMF network element. 
     The PCF network element sends the PCC rule corresponding to the flow to the SMF network element. Correspondingly, the SMF network element receives the PCC rule corresponding to the flow from the PCF network element. 
     It should be understood that S 2403  is not a step that needs to be performed. This step is performed to enable the SMF network element to obtain the PCC rule corresponding to the flow. An implementation in which the SMF network element obtains the PCC rule corresponding to the flow is not limited in this embodiment of this application. 
     S 2405 : The SMF network element determines a first target latency according to the PCC rule corresponding to the flow, and the first target latency is a transmission latency of the flow from the UPF network element to the UE. 
     In this embodiment of this application, the first target latency may also be referred to as an accumulated latency of transmitting the flow between the UPF network element and the UE. 
     An example of the first target latency may be a maximum transmission latency of the flow from the UPF network element to the UE. For example, the SMF network element may determine the maximum transmission latency of the flow from the UPF network element to the UE based on a 5QI in the PCC rule. For example, the SMF network element may use a PDB that is between the UPF and the UE and that corresponds to the 5QI as the maximum transmission latency of transmitting the flow from the UPF to the UE. 
     Optionally, after obtaining the PCC rule, the SMF network element may trigger a PDU session modification process, to establish a QoS flow for the flow, to reserve a resource for the flow. 
     S 2406 : The SMF network element determines a third latency based on the first latency, the first target latency, and a second target latency, where the second target latency is a latency of transmitting the flow from the UE to a target network element that is in the TSN network and that is used as a next hop of the UE, and the third latency is a latency of transmitting the flow from the flow service provider to the target network element that is in the TSN and that is used as the next hop of the UE. 
     If the first latency is denoted as an accumulated latency 1, the first target latency is denoted as T1, the second target latency is denoted as T2, and the third latency is denoted as an accumulated latency 3, a possible implementation in which the SMF network element determines the third latency based on the first latency, the first target latency, and the second target latency is as follows: The accumulated latency 3=the accumulated latency 1+T1+T2. 
     The second target latency may be obtained by the SMF network element from the UE, or may be configured. A manner in which the SMF network element obtains the second target latency is not limited in this embodiment of this application. 
     S 2407 : The SMF network element sends third latency information to the UPF network element. Correspondingly, the UPF network element receives the third latency information from the SMF network element. 
     For example, the SMF network element modifies, to the third latency information, the first latency information that is in the flow service provider broadcast declaration message and that is received by the SMF network element from the UPF network element, and sends, to the UPF network element, a flow service provider broadcast declaration message obtained through modification. 
     Alternatively, the SMF network element may send the third latency information to the UPF network element in another manner. 
     S 2408 : The UPF network element sends the third latency information to the UE. Correspondingly, the UE receives the third latency information from the UPF network element. 
     For example, the UPF network element sends, to the UE, the flow service provider broadcast declaration message that is received by the UPF network element from the SMF network element, and the flow service provider broadcast declaration message carries the third latency information. 
     S 2409 : The UE sends third latency information to the target network element. 
     For example, the UE forwards, to the target network element, the flow service provider broadcast declaration message that is received by the UE from the UPF network element, and the flow service provider broadcast declaration message carries the third latency information. 
     If the target network element is the flow service recipient, the target network element may determine whether the target network element is interested in the flow, and if the target network element is interested in the flow, determine whether the third latency can meet a latency requirement of the flow. If the third latency can meet the latency requirement of the flow, the target network element sends the third latency information to the UE. 
     For example, the target network element sends, to the UE, a flow service recipient ready message, and the flow service recipient ready message includes the identification information of the flow and the third latency information. Then, the UE may forward the flow service recipient ready message to the UPF network element, and then the UPF network element forwards the flow service recipient ready message to a next-hop network element of the UPF network element in the TSN. 
     In the communication method shown in  FIG. 24 , the SMF network element learns, from the UPF network element, of the first latency of transmitting the flow from the flow service provider to the UPF network element, determines the first target latency of transmitting the flow between the UPF network element and the UE, and determines, based on the first latency, the first target latency, and the second target latency of the flow from the UE to the target network element that is in the TSN and that is used as the next hop of the UE, the third latency of the flow from the flow service provider to the target network element. 
     It should be understood that names of messages shown in  FIG. 24  are merely examples. Any message that can implement a corresponding function in the communication method falls within the protection scope of the embodiments of this application. 
     In the communication method shown in  FIG. 24 , an accumulated latency of transmitting the flow from the flow service provider to the target network element that is in the TSN network and that is used as the next hop of the UE may be obtained, and a method for obtaining the accumulated latency is relatively simple, because in the communication method, the accumulated latency can also be obtained through calculation without requiring that the UE or the UPF network element and each device between the UE and the UPF network element are synchronized with a master clock source. 
     In addition, in the communication method shown in  FIG. 24 , a 3GPP system is considered as a bridge in the TSN network, and may receive a flow reservation protocol message (an SRP message) from a node that is in the TSN network and that is used as a previous node of the bridge, provide a method for processing the SRP message, and send the SRP message to a node that is in the TSN and that is used as a next hop of the bridge, so that a latency requirement of a URLLC service flow can be ensured and a bandwidth resource can be reserved in a scenario in which the 3GPP network interworks with the TSN network. 
       FIG. 25  is a schematic flowchart of a communication method according to an embodiment of this application. It should be understood that  FIG. 25  shows steps or operations of the communication method, but these steps or operations are merely examples. In this embodiment of this application, other operations or variations of the operations in  FIG. 25  may be further performed. In addition, the steps in  FIG. 25  may be performed in a sequence different from that presented in  FIG. 25 , and possibly, not all operations in  FIG. 25  need to be performed. 
     S 2501 : A UPF network element receives first latency information from a TSN, where the first latency information is used to indicate a first latency, and the first latency is an accumulated latency of transmitting a flow from a flow service provider in the TSN to the UPF network element. 
     For example, the UPF network element  1903  receives a flow service provider broadcast declaration message from a network element that is in the TSN and that is used as a previous hop of the UPF network element  1903 . The message may be used to broadcast a flow and a QoS requirement corresponding to the flow, and the message includes identification information of the flow and the first latency information. In this case, the first latency is an accumulated latency of transmitting the flow from the communications device  1908  used as the flow service provider to the UPF network element  1903 . The previous-hop network element of the UPF network element  1903  may be the communications device  1908 , or may be a device or a network element between the UPF network element  1903  and the communications device  1908 . 
     Optionally, the message may further include one or more of the following information: a destination address, a source address, a maximum frame size, a maximum frame interval, a priority of a frame, a maximum allowable latency of transmitting a single frame of the flow from the flow service provider to a flow service recipient, a reliability requirement of the flow, or a resource reservation failure cause. 
     It should be understood that, in this embodiment of this application, for ease of description, all information other than the first latency information in information related to the flow is referred to as information about the flow. For example, the destination address, the source address, the maximum frame size, the maximum frame interval, the priority of the frame, the maximum allowable latency of transmitting the single frame of the flow from the flow service provider to the flow service recipient, the reliability requirement of the flow, the resource reservation failure cause, an identifier of the flow, a QoS parameter of the flow, or the like is referred to as the information about the flow. 
     S 2502 : The UPF network element sends information about the flow to an SMF network element. Correspondingly, the SMF network element receives the information about the flow from the UPF network element. 
     For example, after receiving the flow service provider broadcast declaration message from the TSN, the UPF network element  1903  forwards the flow service provider broadcast declaration message to the SMF network element  1905 . The flow service provider broadcast declaration message carries the information about the flow. 
     For example, after receiving the flow service provider broadcast declaration message from the TSN, the UPF network element  1903  obtains the information about the flow in the flow service provider broadcast declaration message, and sends the information about the flow to the SMF network element  1905 . 
     S 2503 : The SMF network element obtains, from a PCF network element, a PCC rule corresponding to the flow. 
     For example, the SMF network element sends the information about the flow to the PCF network element. The information about the flow may include identification information of the flow and the like. Correspondingly, the PCF network element receives the information about the flow from the SMF network element. 
     The PCF network element sends the PCC rule corresponding to the flow to the SMF network element. Correspondingly, the SMF network element receives the PCC rule corresponding to the flow from the PCF network element. 
     It should be understood that S 2503  is not a step that needs to be performed. The two steps are performed to enable the SMF network element to obtain the PCC rule corresponding to the flow. An implementation in which the SMF network element obtains the PCC rule corresponding to the flow is not limited in this embodiment of this application. 
     S 2505 : The SMF network element sends, to the UPF network element according to the PCC rule, a quality of service parameter corresponding to the flow. Correspondingly, the UPF network element receives the quality of service parameter from the SMF network element. 
     For example, the SMF network element determines, according to the PCC rule, a 5QI corresponding to the flow, or determines a PDB between the UPF network element and the UE according to the PCC rule, and sends the 5QI or the PDB to the UPF network element. Alternatively, the SMF network element sends, to the UPF network element, QoS flow identification information corresponding to the flow. 
     Optionally, after obtaining the PCC rule, the SMF network element may trigger a PDU session modification process, to establish a QoS flow for the flow, to reserve a resource for the flow. 
     The SMF network element may further send, to the UPF network element, a second target latency corresponding to the flow. The second target latency is a latency of transmitting the flow from the UE to a target network element that is in the TSN network and that is used as a next hop of the UE. 
     S 2506 : The UPF network element determines a first target latency based on the quality of service parameter corresponding to the flow, where the first target latency is a latency of transmitting the flow between the UPF network element and the UE. 
     An example of the first target latency may be a maximum transmission latency of the flow from the UPF network element to the UE. For example, the UPF network element may determine the maximum transmission latency of the flow from the UPF network element to the UE based on the 5QI, the PDB, or the QoS flow identification information received from the SMF network element. 
     For example, if the UPF network element obtains the PDB from the SMF network element, the UPF network element may use the PDB as the first target latency. 
     For example, if the UPF network element obtains the QoS flow identification information from the SMF network element, the UPF network element may obtain a PDB in a corresponding QoS parameter based on the QoS flow identification information, and use the PDB as the first target latency. 
     For example, if the UPF network element obtains the 5QI corresponding to the flow from the SMF network element, the UPF network element may obtain the PDB in the corresponding QoS parameter based on the 5QI, and use the PDB as the first target latency. 
     S 2507 : The UPF network element determines a third latency based on the first latency, the first target latency, and a second target latency, where the second target latency is a latency of transmitting the flow from the UE to a target network element that is in the TSN network and that is used as a next hop of the UE, and the third latency is a latency of transmitting the flow from the flow service provider to the target network element that is in the TSN and that is used as the next hop of the UE. 
     If the first latency is denoted as an accumulated latency 1, the first target latency is denoted as T1, the second target latency is denoted as T2, and the third latency is denoted as an accumulated latency 3, a possible implementation in which the UPF network element determines the third latency based on the first latency, the first target latency, and the second target latency is as follows: The accumulated latency 3=the accumulated latency 1+T1+T2. 
     The second target latency may be obtained by the SMF network element from the UE, or may be configured, or may be obtained in another manner. A manner in which the SMF network element obtains the second target latency is not limited in this embodiment of this application. 
     S 2508 : The UPF network element sends the third latency information to the UE. Correspondingly, the UE receives the third latency information from the UPF network element. 
     For example, the UPF network element sends, to the UE, the flow service provider broadcast declaration message that is received by the UPF network element from the TSN, and the first latency information in the flow service provider broadcast declaration message is modified to carrying the third latency information. 
     S 2509 : The UE sends third latency information to the target network element. 
     For example, the UE forwards, to the target network element, the flow service provider broadcast declaration message that is received by the UE from the UPF network element, and the flow service provider broadcast declaration message carries the third latency information. 
     If the target network element is the flow service recipient, the target network element may determine whether the target network element is interested in the flow, and if the target network element is interested in the flow, determine whether the third latency can meet a latency requirement of the flow. If the third latency can meet the latency requirement of the flow, the target network element sends the third latency information to the UE. 
     For example, the target network element sends, to the UE, a flow service recipient ready message, and the flow service recipient ready message includes the identification information of the flow and the third latency information. Then, the UE may forward the flow service recipient ready message to the UPF network element, and then the UPF network element forwards the flow service recipient ready message to a next-hop network element of the UPF network element in the TSN. 
     In the communication method shown in  FIG. 25 , the UPF network element determines, based on the QoS parameter obtained from the SMF network element, the first target latency of transmitting the flow between the UPF network element and the UE, and determines, based on the first latency of transmitting the flow from the flow service provider to the UPF network element, the first target latency, and the second target latency of the flow from the UE to the target network element that is in the TSN and that is used as the next hop of the UE, the third latency of the flow from the flow service provider to the target network element. 
     It should be understood that names of messages shown in  FIG. 25  are merely examples. Any message that can implement a corresponding function in the communication method falls within the protection scope of the embodiments of this application. 
     In the communication method shown in  FIG. 25 , an accumulated latency of transmitting the flow from the flow service provider to the target network element that is in the TSN network and that is used as the next hop of the UE may be obtained, and a method for obtaining the accumulated latency is relatively simple, because in the communication method, the accumulated latency can also be obtained through calculation without requiring that the UE or the UPF network element and each device between the UE and the UPF network element are synchronized with a master clock source. 
     In addition, in the communication method shown in  FIG. 25 , a 3GPP system is considered as a bridge in the TSN network, and may receive a flow reservation protocol message (an SRP message) from a node that is in the TSN network and that is used as a previous node of the bridge, provide a method for processing the SRP message, and send the SRP message to a node that is in the TSN and that is used as a next hop of the bridge, so that a latency requirement of a URLLC service flow can be ensured and a bandwidth resource can be reserved in a scenario in which the 3GPP network interworks with the TSN network. 
       FIG. 26  is a schematic flowchart of a communication method according to an embodiment of this application. It should be understood that  FIG. 26  shows steps or operations of the communication method, but these steps or operations are merely examples. In this embodiment of this application, other operations or variations of the operations in  FIG. 26  may be further performed. In addition, the steps in  FIG. 26  may be performed in a sequence different from that presented in  FIG. 26 , and possibly, not all operations in  FIG. 26  need to be performed. 
     S 2601 : UE receives first latency information from a TSN, where the first latency information is used to indicate a first latency, and the first latency is an accumulated latency of transmitting the flow from a flow service provider in the TSN to the UE. 
     For example, the UE  1901  receives a flow service provider broadcast declaration message from a network element that is in the TSN and that is used as a previous hop of the UE  1901 . The message may be used to broadcast a flow and a QoS requirement corresponding to the flow, and the message includes identification information of the flow and the first latency information. In this case, the first latency is an accumulated latency of transmitting the flow from the communications device  1907  used as the flow service provider to the UE  1901 . The previous-hop network element of the UE  1901  may be the communications device  1907 , or may be a device or a network element between the UE  1901  and the communications device  1907 . 
     Optionally, the message may further include one or more of the following information: a destination address, a source address, a maximum frame size, a maximum frame interval, a priority of a frame, a maximum allowable latency of transmitting a single frame of the flow from the flow service provider to a flow service recipient, a reliability requirement of the flow, or a resource reservation failure cause. 
     It should be understood that, in this embodiment of this application, for ease of description, all information other than the first latency information in information related to the flow is referred to as information about the flow. For example, the destination address, the source address, the maximum frame size, the maximum frame interval, the priority of the frame, the maximum allowable latency of transmitting the single frame of the flow from the flow service provider to the flow service recipient, the reliability requirement of the flow, the resource reservation failure cause, an identifier of the flow, a QoS parameter of the flow, or the like is referred to as the information about the flow. 
     S 2602 : The UE sends the first latency information to a UPF network element. Correspondingly, the UPF network element receives the first latency information from the UE. 
     For example, the UE forwards, to the UPF network element, the flow service provider broadcast declaration message that is received by the UE from the TSN, and the flow service provider broadcast declaration message carries the first latency information and the information about the flow. 
     For example, after receiving the flow service provider broadcast declaration message from the TSN, the UE obtains the first latency information and the information about the flow that are in the flow service provider broadcast declaration message, and sends the first latency information and the information about the flow to the UPF network element. 
     S 2603 : The UPF network element sends the first latency information to an SMF network element. Correspondingly, the SMF network element receives the first latency information from the UPF network element. In addition, the UPF network element may further send the information about the flow to the SMF network element. 
     For example, after receiving the flow service provider broadcast declaration message from the UE  1901 , the UPF network element  1903  forwards the flow service provider broadcast declaration message to the SMF network element  1905 . The flow service provider broadcast declaration message carries the first latency information and the information about the flow. 
     For example, after receiving the flow service provider broadcast declaration message from the UE  1901 , the UPF network element  1903  obtains the first latency information and the information about the flow that are in the flow service provider broadcast declaration message, and sends the first latency information and the information about the flow to the SMF network element  1905 . 
     S 2604 : The SMF network element obtains, from a PCF network element, a PCC rule corresponding to the flow. 
     For example, the SMF network element sends the information about the flow to the PCF network element. The information about the flow may include identification information of the flow, a QoS parameter of the flow, or the like. Correspondingly, the PCF network element receives the information about the flow from the SMF network element. 
     The PCF network element sends the PCC rule corresponding to the flow to the SMF network element. Correspondingly, the SMF network element receives the PCC rule corresponding to the flow from the PCF network element. 
     It should be understood that S 2604  is not a step that needs to be performed. This step is performed to enable the SMF network element to obtain the PCC rule corresponding to the flow. An implementation in which the SMF network element obtains the PCC rule corresponding to the flow is not limited in this embodiment of this application. 
     S 2606 : The SMF network element determines a first target latency according to the PCC rule corresponding to the flow, and the first target latency is a transmission latency of the flow from the UE to the UPF network element. 
     In this embodiment of this application, the first target latency may also be referred to as an accumulated latency of transmitting the flow between the UE and the UPF network element. 
     An example of the first target latency may be a maximum transmission latency of the flow from the UE to the UPF network element. For example, the SMF network element may determine the maximum transmission latency of the flow from the UE to the UPF network element based on a 5QI in the PCC rule. For example, the SMF network element may use a PDB that is between the UE and the UPF and that corresponds to the 5QI as the maximum transmission latency of transmitting the flow from the UE to the UPF network element. 
     Optionally, after obtaining the PCC rule, the SMF network element may trigger a PDU session modification process, to establish a QoS flow for the flow, to reserve a resource for the flow. 
     S 2607 : The SMF network element determines a second latency based on the first latency and the first target latency, where the second latency is a transmission latency of the flow from the flow service provider to the UE. 
     For example, the SMF network element determines the second latency based on the first latency indicated by the first latency information carried in the flow service provider broadcast declaration message and the maximum transmission latency that is determined in S 2606 . 
     If the first latency is denoted as an accumulated latency 1, the first target latency is denoted as T1, and the second latency is denoted as an accumulated latency 2, the accumulated latency 2=the accumulated latency 1+T1. 
     S 2608 : The SMF network element sends second latency information to the UPF network element, where the second latency information is used to indicate the second latency. Correspondingly, the UPF network element receives the second latency information from the SMF network element. 
     For example, the SMF network element modifies, to the second latency information, the first latency information that is in the flow service provider broadcast declaration message and that is received by the SMF network element from the UPF network element, and sends, to the UPF network element, a flow service provider broadcast declaration message obtained through modification. 
     Alternatively, the SMF network element may send the second latency information to the UPF network element in another manner. 
     S 2609 : The UPF network element determines a third latency based on the second latency and a second target latency, where the second target latency is a latency of transmitting the flow from the UPF network element to a target network element that is in the TSN network and that is used as a next hop of the UPF network element, and the third latency is a latency of transmitting the flow from the flow service provider to the target network element that is in the TSN and that is used as the next hop of the UPF network element. 
     For example, the second target latency is an accumulated transmission latency of the flow from the UPF network element  1903  to the target network element that is in the TSN and that is used as the next hop of the UPF network element  1903 . The third latency is an accumulated transmission latency of the flow from the communications device  107  to the target network element. The target network element may be the communications device  1908  or may be a communications device between the UPF network element and the communications device  1908 . 
     An implementation in which the UPF network element determines the third latency based on the second latency and the second target latency may include: The UPF network element adds the second target latency to the second latency, to obtain the third latency. For example, if the second target latency is denoted as T2, the second latency is denoted as an accumulated latency 2, and the third latency is denoted as an accumulated latency 3, the accumulated latency 3=the accumulated latency 2+T2. 
     The second target latency may be obtained by the UPF network element from the target network element, or may be configured, or may be obtained in another manner. A manner in which the UPF network element obtains the second target latency is not limited in this embodiment of this application. 
     S 2610 : The UPF network element sends third latency information to the target network element. 
     For example, the UPF network element sends, to the target network element, the flow service provider broadcast declaration message that is received by the UPF network element from the UE, and the first latency information in the flow service provider broadcast declaration message is modified to carrying the third latency information. 
     Alternatively, the UPF network element may send, to the target network element, the flow service provider broadcast declaration message that is received by the UPF network element from the SMF network element, and the second latency information in the flow service provider broadcast declaration message is modified to carrying the third latency information. 
     In the communication method shown in  FIG. 26 , the SMF network element learns, from the UPF network element, of the first latency of the flow from the flow service provider to the UE, determines, according to the PCC rule of the flow, the first target latency of transmitting the flow between the UPF network element and the UE, determines, based on the first latency and the first target latency, the second latency of transmitting the flow from the flow service provider to the UPF network element, and sends the second latency to the UPF network element. The UPF network element determines, based on the second latency and the second target latency of the flow from the UPF network element to the network element that is in the TSN and that is used as the next hop of the UPF network element, the third latency of the flow from the flow service provider to the next-hop network element. 
     It should be understood that names of messages shown in  FIG. 26  are merely examples. Any message that can implement a corresponding function in the communication method falls within the protection scope of the embodiments of this application. 
     In the communication method shown in  FIG. 26 , an accumulated latency of transmitting the flow from the flow service provider to the target network element that is in the TSN network and that is used as the next hop of the UPF network element may be obtained, and a method for obtaining the accumulated latency is relatively simple, because in the communication method, the accumulated latency can also be obtained through calculation without requiring that the UE or the UPF network element and each device between the UE and the UPF network element are synchronized with a master clock source. 
     In addition, in the communication method shown in  FIG. 26 , a 3GPP system is considered as a bridge in the TSN network, and may receive a flow reservation protocol message (an SRP message) from a node that is in the TSN network and that is used as a previous node of the bridge, provide a method for processing the SRP message, and send the SRP message to a node that is in the TSN and that is used as a next hop of the bridge, so that a latency requirement of a URLLC service flow can be ensured and a bandwidth resource can be reserved in a scenario in which the 3GPP network interworks with the TSN network. 
       FIG. 27  is a schematic flowchart of a communication method according to an embodiment of this application. It should be understood that  FIG. 27  shows steps or operations of the communication method, but these steps or operations are merely examples. In this embodiment of this application, other operations or variations of the operations in  FIG. 27  may be further performed. In addition, the steps in  FIG. 27  may be performed in a sequence different from that presented in  FIG. 27 , and possibly, not all operations in  FIG. 27  need to be performed. 
     S 2701 : UE receives first latency information from a TSN, where the first latency information is used to indicate a first latency, and the first latency is an accumulated latency of transmitting a flow from a flow service provider in the TSN to the UE. 
     For example, the UE  1901  receives a flow service provider broadcast declaration message from a network element that is in the TSN and that is used as a previous hop of the UE  1901 . The message may be used to broadcast a flow and a QoS requirement corresponding to the flow, and the message includes identification information of the flow and the first latency information. In this case, the first latency is an accumulated latency of transmitting the flow from the communications device  1907  used as the flow service provider to the UE  1901 . The previous-hop network element of the UE  1901  may be the communications device  1907 , or may be a device or a network element between the UE  1901  and the communications device  1907 . 
     Optionally, the message may further include one or more of the following information: a destination address, a source address, a maximum frame size, a maximum frame interval, a priority of a frame, a maximum allowable latency of transmitting a single frame of the flow from the flow service provider to a flow service recipient, a reliability requirement of the flow, or a resource reservation failure cause. 
     It should be understood that, in this embodiment of this application, for ease of description, all information other than the first latency information in information related to the flow is referred to as information about the flow. For example, the destination address, the source address, the maximum frame size, the maximum frame interval, the priority of the frame, the maximum allowable latency of transmitting the single frame of the flow from the flow service provider to the flow service recipient, the reliability requirement of the flow, the resource reservation failure cause, an identifier of the flow, a QoS parameter of the flow, or the like is referred to as the information about the flow. 
     S 2702 : The UE sends the first latency information to a UPF network element. Correspondingly, the UE receives the first latency information from the UPF network element. 
     For example, the UE forwards, to the UPF network element, the flow service provider broadcast declaration message that is received by the UE from the TSN, and the flow service provider broadcast declaration message carries the first latency information. The flow service provider broadcast declaration message carries the first latency information and the information about the flow. 
     For example, after receiving the flow service provider broadcast declaration message from the TSN, the UE obtains the first latency information and the information about the flow that are in the flow service provider broadcast declaration message, and sends the first latency information and the information about the flow to the UPF network element. 
     S 2703 : The UPF network element sends information about the flow to an SMF network element. Correspondingly, the SMF network element receives the information about the flow from the UPF network element. 
     For example, after receiving the flow service provider broadcast declaration message from the TSN, the UPF network element  1903  forwards the flow service provider broadcast declaration message to the SMF network element  1905 . The flow service provider broadcast declaration message carries the information about the flow. 
     For example, after receiving the flow service provider broadcast declaration message from the TSN, the UPF network element  1903  obtains the first latency information and the information about the flow that are in the flow service provider broadcast declaration message, and sends the first latency information and the information about the flow to the SMF network element  1905 . 
     S 2704 : The SMF network element obtains, from a PCF network element, a PCC rule corresponding to the flow. 
     For example, the SMF network element sends the information about the flow to the PCF network element. The information about the flow may include identification information of the flow and the like. Correspondingly, the PCF network element receives the information about the flow from the SMF network element. 
     The PCF network element sends the PCC rule corresponding to the flow to the SMF network element. Correspondingly, the SMF network element receives the PCC rule corresponding to the flow from the PCF network element. 
     It should be understood that S 2704  is not a step that needs to be performed. This step is performed to enable the SMF network element to obtain the PCC rule corresponding to the flow. An implementation in which the SMF network element obtains the PCC rule corresponding to the flow is not limited in this embodiment of this application. 
     S 2706 : The SMF network element sends, to the UPF network element according to the PCC rule, a quality of service parameter corresponding to the flow. Correspondingly, the UPF network element receives the quality of service parameter from the SMF network element. 
     For example, the SMF network element determines, according to the PCC rule, a 5QI corresponding to the flow, or determines a PDB between the UPF network element and the UE according to the PCC rule, and sends the 5QI or the PDB to the UPF network element. Alternatively, the SMF network element sends, to the UPF network element, QoS flow identification information corresponding to the flow. 
     Optionally, after obtaining the PCC rule, the SMF network element may trigger a PDU session modification process, to establish a QoS flow for the flow, to reserve a resource for the flow. 
     S 2707 : The UPF network element determines a first target latency based on the quality of service parameter corresponding to the flow, where the first target latency is a latency of transmitting the flow between the UE and the UPF network element. 
     An example of the first target latency may be a maximum transmission latency of the flow from the UPF network element to the UE. For example, the UPF network element may determine the maximum transmission latency of the flow from the UE to the UPF network element based on the 5QI, the PDB, or the QoS flow identification information received from the SMF network element. 
     For example, if the UPF network element obtains the PDB from the SMF network element, the UPF network element may use the PDB as the first target latency. 
     For example, if the UPF network element obtains the QoS flow identification information from the SMF network element, the UPF network element may obtain a PDB in a corresponding QoS parameter based on the QoS flow identification information, and use the PDB as the first target latency. 
     For example, if the UPF network element obtains the 5QI corresponding to the flow from the SMF network element, the UPF network element may obtain the PDB in the corresponding QoS parameter based on the 5QI, and use the PDB as the first target latency. 
     S 2708 : The UPF network element determines a third latency based on the first latency, the first target latency, and a second target latency, where the second target latency is a latency of transmitting the flow from the UPF network element to a target network element that is in the TSN network and that is used as a next hop of the UPF network element, and the third latency is a latency of transmitting the flow from the flow service provider to the target network element that is in the TSN and that is used as the next hop of the UPF network element. 
     If the first latency is denoted as an accumulated latency 1, the first target latency is denoted as T1, the second target latency is denoted as T2, and the third latency is denoted as an accumulated latency 3, a possible implementation in which the UPF network element determines the third latency based on the first latency, the first target latency, and the second target latency is as follows: The accumulated latency 3=the accumulated latency 1+T1+T2. 
     The second target latency may be obtained by the UPF network element from the target network element, or may be configured, or may be obtained in another manner. A manner in which the UPF network element obtains the second target latency is not limited in this embodiment of this application. 
     S 2709 : The UPF network element sends third latency information to the target network element. 
     For example, the UPF network element sends, to the target network element, the flow service provider broadcast declaration message that is received by the UPF network element from the UE, and the first latency information in the flow service provider broadcast declaration message is modified to carrying the third latency information. 
     In the communication method shown in  FIG. 27 , the UPF network element determines, based on the QoS parameter obtained from the SMF network element, the first target latency of transmitting the flow between the UPF network element and the UE, and determines, based on the first latency of transmitting the flow from the flow service provider to the UE, the first target latency, and the second target latency of the flow from the UPF network element to the target network element that is in the TSN and that is used as the next hop of the UPF network element, the third latency of the flow from the flow service provider to the target network element. 
     It should be understood that names of messages shown in  FIG. 27  are merely examples. Any message that can implement a corresponding function in the communication method falls within the protection scope of the embodiments of this application. 
     In the communication method shown in  FIG. 27 , an accumulated latency of transmitting the flow from the flow service provider to the target network element that is in the TSN network and that is used as the next hop of the UPF network element may be obtained, and a method for obtaining the accumulated latency is relatively simple, because in the communication method, the accumulated latency can also be obtained through calculation without requiring that the UE or the UPF network element and each device between the UE and the UPF network element are synchronized with a master clock source. 
     In addition, in the communication method shown in  FIG. 27 , a 3GPP system is considered as a bridge in the TSN network, and may receive a flow reservation protocol message (an SRP message) from a node that is in the TSN network and that is used as a previous node of the bridge, provide a method for processing the SRP message, and send the SRP message to a node that is in the TSN and that is used as a next hop of the bridge, so that a latency requirement of a URLLC service flow can be ensured and a bandwidth resource can be reserved in a scenario in which the 3GPP network interworks with the TSN network. 
       FIG. 28  is a schematic flowchart of a communication method according to an embodiment of this application. It should be understood that  FIG. 28  shows steps or operations of the communication method, but these steps or operations are merely examples. In this embodiment of this application, other operations or variations of the operations in  FIG. 28  may be further performed. In addition, the steps in  FIG. 28  may be performed in a sequence different from that presented in  FIG. 28 , and possibly, not all operations in  FIG. 28  need to be performed. 
     S 2801 : UE receives first latency information from a TSN, where the first latency information is used to indicate a first latency, and the first latency is an accumulated latency of transmitting a flow from a flow service provider in the TSN to the UE. 
     For example, the UE  1901  receives a flow service provider broadcast declaration message from a network element that is in the TSN and that is used as a previous hop of the UE  1901 . The message may be used to broadcast a flow and a QoS requirement corresponding to the flow, and the message includes identification information of the flow and the first latency information. In this case, the first latency is an accumulated latency of transmitting the flow from the communications device  1907  used as the flow service provider to the UE  1901 . The previous-hop network element of the UE  1901  may be the communications device  1907 , or may be a device or a network element between the UE  1901  and the communications device  1907 . 
     Optionally, the message may further include one or more of the following information: a destination address, a source address, a maximum frame size, a maximum frame interval, a priority of a frame, a maximum allowable latency of transmitting a single frame of the flow from the flow service provider to a flow service recipient, a reliability requirement of the flow, or a resource reservation failure cause. 
     It should be understood that, in this embodiment of this application, for ease of description, all information other than the first latency information in information related to the flow is referred to as information about the flow. For example, the destination address, the source address, the maximum frame size, the maximum frame interval, the priority of the frame, the maximum allowable latency of transmitting the single frame of the flow from the flow service provider to the flow service recipient, the reliability requirement of the flow, the resource reservation failure cause, an identifier of the flow, a QoS parameter of the flow, or the like is referred to as the information about the flow. 
     S 2802 : The UE sends the first latency information to an SMF network element. Correspondingly, the SMF network element receives the first latency information from the UE. In addition, the UE may further send the information about the flow to the SMF network element. 
     For example, after receiving the flow service provider broadcast declaration message from the TSN, the UE  1901  forwards the flow service provider broadcast declaration message to the SMF network element  1905 . The flow service provider broadcast declaration message carries the first latency information and the information about the flow. 
     For example, after receiving the flow service provider broadcast declaration message from the TSN, the UE  1901  obtains the first latency information and the information about the flow that are in the flow service provider broadcast declaration message, and sends the first latency information and the information about the flow to the SMF network element  1905 . 
     S 2803 : The SMF network element obtains, from a PCF network element, a PCC rule corresponding to the flow. 
     For example, the SMF network element sends the information about the flow to the PCF network element. The information about the flow may include identification information of the flow, a QoS parameter of the flow, or the like. Correspondingly, the PCF network element receives the information about the flow from the SMF network element. 
     The PCF network element sends the PCC rule corresponding to the flow to the SMF network element. Correspondingly, the SMF network element receives the PCC rule corresponding to the flow from the PCF network element. 
     It should be understood that S 2803  is not a step that needs to be performed. This step is performed to enable the SMF network element to obtain the PCC rule corresponding to the flow. An implementation in which the SMF network element obtains the PCC rule corresponding to the flow is not limited in this embodiment of this application. 
     S 2805 : The SMF network element determines a first target latency according to the PCC rule corresponding to the flow, and the first target latency is a transmission latency of the flow from the UE to the UPF network element. 
     In this embodiment of this application, the first target latency may also be referred to as an accumulated latency of transmitting the flow between the UE and the UPF network element. 
     An example of the first target latency may be a maximum transmission latency of the flow from the UE to the UPF network element. For example, the SMF network element may determine the maximum transmission latency of the flow from the UE to the UPF network element based on a 5QI in the PCC rule. For example, the SMF network element may use a PDB that is between the UE and the UPF network element and that corresponds to the 5QI as the maximum transmission latency of transmitting the flow from the UE to the UPF network element. 
     Optionally, after obtaining the PCC rule, the SMF network element may trigger a PDU session modification process, to establish a QoS flow for the flow, to reserve a resource for the flow. 
     S 2806 : The SMF network element determines a second latency based on the first latency and the first target latency, where the second latency is a transmission latency of the flow from the flow service provider to the UPF network element. 
     For example, the SMF network element determines the second latency based on the first latency indicated by the first latency information carried in the flow service provider broadcast declaration message and the maximum transmission latency that is determined in S 2805 . 
     If the first latency is denoted as an accumulated latency 1, the first target latency is denoted as T1, and the second latency is denoted as an accumulated latency 2, the accumulated latency 2=the accumulated latency 1+T1. 
     S 2807 : The SMF network element sends second latency information to the UE, where the second latency information is used to indicate the second latency. Correspondingly, the UE receives the second latency information from the SMF network element. 
     For example, the SMF network element sends, to the UE, the flow service provider broadcast declaration message that is received by the SMF network element from the UE, and the first latency information carried in the flow service provider broadcast declaration message is modified to the second latency information. 
     Alternatively, the SMF network element sends the second latency information to the UE through another message. 
     S 2808 : The UE sends the second latency information to a UPF network element. Correspondingly, the UPF network element receives the second latency information from the UE. 
     For example, the UE sends, to the UPF network element, the flow service provider broadcast declaration message that is received by the UE from the SMF network element, and the first latency information in the flow service provider broadcast declaration message is modified to the second latency information. 
     For example, the UE sends, to the UPF network element, the flow service provider broadcast declaration message that is received by the UE from the TSN, and the first latency information in the flow service provider broadcast declaration message is modified to the second latency information that is received by the UE from the SMF network element. 
     S 2809 : The UPF network element determines a third latency based on the second latency and a second target latency, where the second target latency is a latency of transmitting the flow from the UPF network element to a target network element that is in the TSN network and that is used as a next hop of the UPF network element, and the third latency is a latency of transmitting the flow from the flow service provider to the target network element that is in the TSN and that is used as the next hop of the UPF network element. 
     For example, the second target latency is an accumulated transmission latency of the flow from the UPF network element  1903  to the target network element that is in the TSN and that is used as the next hop of the UPF network element  1903 . The third latency is an accumulated transmission latency of the flow from the communications device  107  to the next-hop network element. The next-hop network element may be the communications device  1908  or may be a communications device between the UPF network element  1903  and the communications device  1908 . 
     An implementation in which the UPF network element determines the third latency based on the second latency and the second target latency may include: The UPF network element adds the second target latency to the second latency. For example, if the second target latency is denoted as T2, the second latency is denoted as an accumulated latency 2, and the third latency is denoted as an accumulated latency 3, the accumulated latency 3=the accumulated latency 2+T2. 
     The second target latency may be obtained by the UPF network element from the target network element, or may be configured, or may be obtained in another manner. A manner in which the UPF network element obtains the second target latency is not limited in this embodiment of this application. 
     S 2810 : The UPF network element sends third latency information to the target network element. 
     For example, the UPF network element modifies, to the third latency information, the second latency information that is in the flow service provider broadcast declaration message and that is received by the UPF network element from the UE, and sends, to the target network element, a flow service provider broadcast declaration message obtained through modification. 
     In the communication method shown in  FIG. 28 , the SMF network element learns, from the UE, of the first latency of the flow from the flow service provider to the UE, determines, according to the PCC rule of the flow, the first target latency of transmitting the flow between the UPF network element and the UE, determines, based on the first latency and the first target latency, the second latency of transmitting the flow from the flow service provider to the UPF network element, and sends the second latency to the UPF network element through the UE. The UPF network element determines, based on the second latency and the second target latency of the flow from the UPF network element to the network element that is in the TSN and that is used as the next hop of the UPF network element, the third latency of the flow from the flow service provider to the next-hop network element. 
     It should be understood that names of messages shown in  FIG. 28  are merely examples. Any message that can implement a corresponding function in the communication method falls within the protection scope of the embodiments of this application. 
     In the communication method shown in  FIG. 28 , an accumulated latency of transmitting the flow from the flow service provider to the target network element that is in the TSN network and that is used as the next hop of the UPF network element may be obtained, and a method for obtaining the accumulated latency is relatively simple, because in the communication method, the accumulated latency can also be obtained through calculation without requiring that the UE or the UPF network element and each device between the UE and the UPF network element are synchronized with a master clock source. 
     In addition, in the communication method shown in  FIG. 28 , a 3GPP system is considered as a bridge in the TSN network, and may receive a flow reservation protocol message (an SRP message) from a node that is in the TSN network and that is used as a previous node of the bridge, provide a method for processing the SRP message, and send the SRP message to a node that is in the TSN and that is used as a next hop of the bridge, so that a latency requirement of a URLLC service flow can be ensured and a bandwidth resource can be reserved in a scenario in which the 3GPP network interworks with the TSN network. 
       FIG. 29  is a schematic flowchart of a communication method according to an embodiment of this application. It should be understood that  FIG. 29  shows steps or operations of the communication method, but these steps or operations are merely examples. In this embodiment of this application, other operations or variations of the operations in  FIG. 29  may be further performed. In addition, the steps in  FIG. 29  may be performed in a sequence different from that presented in  FIG. 29 , and possibly, not all operations in  FIG. 29  need to be performed. 
     S 2901 : UE receives first latency information from a TSN, where the first latency information is used to indicate a first latency, and the first latency is an accumulated latency of transmitting a flow from a flow service provider in the TSN to the UE. 
     For example, the UE  1901  receives a flow service provider broadcast declaration message from a network element that is in the TSN and that is used as a previous hop of the UE  1901 . The message may be used to broadcast a flow and a QoS requirement corresponding to the flow, and the message includes identification information of the flow and the first latency information. In this case, the first latency is an accumulated latency of transmitting the flow from the communications device  1907  used as the flow service provider to the UE  1901 . The previous-hop network element of the UE  1901  may be the communications device  1907 , or may be a device or a network element between the UE  1901  and the communications device  1907 . 
     Optionally, the message may further include one or more of the following information: a destination address, a source address, a maximum frame size, a maximum frame interval, a priority of a frame, a maximum allowable latency of transmitting a single frame of the flow from the flow service provider to a flow service recipient, a reliability requirement of the flow, or a resource reservation failure cause. 
     It should be understood that, in this embodiment of this application, for ease of description, all information other than the first latency information in information related to the flow is referred to as information about the flow. For example, the destination address, the source address, the maximum frame size, the maximum frame interval, the priority of the frame, the maximum allowable latency of transmitting the single frame of the flow from the flow service provider to the flow service recipient, the reliability requirement of the flow, the resource reservation failure cause, an identifier of the flow, a QoS parameter of the flow, or the like is referred to as the information about the flow. 
     S 2902 : The UE sends information about the flow to an SMF network element. Correspondingly, the SMF network element receives the information about the flow from the UE. 
     For example, after receiving the flow service provider broadcast declaration message from the TSN, the UE  1901  forwards the flow service provider broadcast declaration message to the SMF network element  1905 . The flow service provider broadcast declaration message carries the information about the flow. 
     For example, after receiving the flow service provider broadcast declaration message from the TSN, the UE  1901  obtains the information about the flow in the flow service provider broadcast declaration message, and sends the information about the flow to the SMF network element  1905 . 
     S 2903 : The SMF network element obtains, from a PCF network element, a PCC rule corresponding to the flow. 
     For example, the SMF network element sends the information about the flow to the PCF network element. The information about the flow may include identification information of the flow and the like. Correspondingly, the PCF network element receives the information about the flow from the SMF network element. 
     The PCF network element sends the PCC rule corresponding to the flow to the SMF network element. Correspondingly, the SMF network element receives the PCC rule corresponding to the flow from the PCF network element. 
     It should be understood that S 2903  is not a step that needs to be performed. This step is performed to enable the SMF network element to obtain the PCC rule corresponding to the flow. An implementation in which the SMF network element obtains the PCC rule corresponding to the flow is not limited in this embodiment of this application. 
     S 2905 : The SMF network element sends, to the UE according to the PCC rule, a quality of service parameter corresponding to the flow. Correspondingly, the UE receives the quality of service parameter from the SMF network element. 
     For example, the SMF network element determines, according to the PCC rule, a 5QI corresponding to the flow, or determines a PDB between the UPF network element and the UE according to the PCC rule, and sends the 5QI or the PDB to the UE. Alternatively, the SMF network element sends, to the UE, QoS flow identification information corresponding to the flow. 
     Optionally, after obtaining the PCC rule, the SMF network element may trigger a PDU session modification process, to establish a QoS flow for the flow, to reserve a resource for the flow. 
     S 2906 : The UE determines a first target latency based on the quality of service parameter corresponding to the flow, where the first target latency is a latency of transmitting the flow between the UE and the UPF network element. 
     An example of the first target latency may be a maximum transmission latency of the flow from the UE to the UPF network element. For example, the UE may determine the maximum transmission latency of the flow from the UE to the UPF network element based on the 5QI, the PDB, or the QoS flow identification information received from the SMF network element. 
     For example, if the UE obtains the PDB from the SMF network element, the UE may use the PDB as the first target latency. 
     For example, if the UE obtains the QoS flow identification information from the SMF network element, the UE may obtain a PDB in a corresponding QoS parameter based on the QoS flow identification information, and use the PDB as the first target latency. 
     For example, if the UE obtains the 5QI corresponding to the flow from the SMF network element, the UE may obtain the PDB in the corresponding QoS parameter based on the 5QI, and use the PDB as the first target latency. 
     S 2907 : The UE determines a second latency based on the first latency and the first target latency, where the second latency is a transmission latency of the flow from the flow service provider to the UPF network element. 
     For example, the UE determines the second latency based on the first latency indicated by the first latency information carried in the flow service provider broadcast declaration message and the maximum transmission latency that is determined in S 2906 . 
     If the first latency is denoted as an accumulated latency 1, the first target latency is denoted as T1, and the second latency is denoted as an accumulated latency 2, the accumulated latency 2=the accumulated latency 1+T1. 
     S 2908 : The UE sends the second latency information to a UPF network element. Correspondingly, the UPF network element receives the second latency information from the UE. 
     For example, the UE sends, to the UPF network element, a flow service provider broadcast declaration message obtained through modification, and the first latency information carried in the flow service provider broadcast declaration message is modified to the second latency information. 
     S 2909 : The UPF network element determines a third latency based on the second latency and a second target latency, where the second target latency is a latency of transmitting the flow from the UPF network element to a target network element that is in the TSN network and that is used as a next hop of the UPF network element, and the third latency is a latency of transmitting the flow from the flow service provider to the target network element that is in the TSN and that is used as the next hop of the UPF network element. 
     For example, the second target latency is an accumulated transmission latency of the flow from the UPF network element  1903  to the target network element that is in the TSN and that is used as the next hop of the UPF network element  1903 . The third latency is an accumulated transmission latency of the flow from the communications device  107  to the next-hop network element. The next-hop network element may be the communications device  108  or may be a communications device between the UPF network element  1903  and the communications device  1908 . 
     An implementation in which the UPF network element determines the third latency based on the second latency and the second target latency may include: The UPF network element adds the second target latency to the second latency. For example, if the second target latency is denoted as T2, the second latency is denoted as an accumulated latency 2, and the third latency is denoted as an accumulated latency 3, the accumulated latency 3=the accumulated latency 2+T2. 
     The second target latency may be obtained by the UPF network element from the target network element, or may be configured, or may be obtained in another manner. A manner in which the UPF network element obtains the second target latency is not limited in this embodiment of this application. 
     S 2910 : The UPF network element sends third latency information to the target network element. 
     For example, the UPF network element modifies, to the third latency information, the second latency information that is in the flow service provider broadcast declaration message and that is received by the UPF network element from the UE, and sends, to the target network element, a flow service provider broadcast declaration message obtained through modification. 
     In the communication method shown in  FIG. 29 , the UE determines the first target latency of transmitting the flow between the UPF network element and the UE, determines the second latency of the flow from the flow service provider to the UPF network element based on the first target latency and the first latency of the flow from the flow service provider to the UE, and sends the second latency to the UPF network element. The UPF network element determines, based on the second latency and the second target latency of the flow from the UPF network element to the network element that is in the TSN and that is used as the next hop of the UPF network element, the third latency of the flow from the flow service provider to the next-hop network element. 
     It should be understood that names of messages shown in  FIG. 29  are merely examples. Any message that can implement a corresponding function in the communication method falls within the protection scope of the embodiments of this application. 
     In the communication method shown in  FIG. 29 , an accumulated latency of transmitting the flow from the flow service provider to the target network element that is in the TSN network and that is used as the next hop of the UPF network element may be obtained, and a method for obtaining the accumulated latency is relatively simple, because in the communication method, the accumulated latency can also be obtained through calculation without requiring that the UE or the UPF network element and each device between the UE and the UPF network element are synchronized with a master clock source. 
     In addition, in the communication method shown in  FIG. 29 , a 3GPP system is considered as a bridge in the TSN network, and may receive a flow reservation protocol message (an SRP message) from a node that is in the TSN network and that is used as a previous node of the bridge, provide a method for processing the SRP message, and send the SRP message to a node that is in the TSN and that is used as a next hop of the bridge, so that a latency requirement of a URLLC service flow can be ensured and a bandwidth resource can be reserved in a scenario in which the 3GPP network interworks with the TSN network. 
       FIG. 30  is a schematic flowchart of a communication method according to an embodiment of this application. It should be understood that  FIG. 30  shows steps or operations of the communication method, but these steps or operations are merely examples. In this embodiment of this application, other operations or variations of the operations in  FIG. 30  may be further performed. In addition, the steps in  FIG. 30  may be performed in a sequence different from that presented in  FIG. 30 , and possibly, not all operations in  FIG. 30  need to be performed. 
     S 3001 : UE receives first latency information from a TSN, where the first latency information is used to indicate a first latency, and the first latency is an accumulated latency of transmitting a flow from a flow service provider in the TSN to the UE. 
     For example, the UE  1901  receives a flow service provider broadcast declaration message from a network element that is in the TSN and that is used as a previous hop of the UE  1901 . The message may be used to broadcast a flow and a QoS requirement corresponding to the flow, and the message includes identification information of the flow and the first latency information. In this case, the first latency is an accumulated latency of transmitting the flow from the communications device  1907  used as the flow service provider to the UE  1901 . The previous-hop network element of the UE  1901  may be the communications device  1907 , or may be a device or a network element between the UE  1901  and the communications device  1907 . 
     Optionally, the message may further include one or more of the following information: a destination address, a source address, a maximum frame size, a maximum frame interval, a priority of a frame, a maximum allowable latency of transmitting a single frame of the flow from the flow service provider to a flow service recipient, a reliability requirement of the flow, or a resource reservation failure cause. 
     It should be understood that, in this embodiment of this application, for ease of description, all information other than the first latency information in information related to the flow is referred to as information about the flow. For example, the destination address, the source address, the maximum frame size, the maximum frame interval, the priority of the frame, the maximum allowable latency of transmitting the single frame of the flow from the flow service provider to the flow service recipient, the reliability requirement of the flow, the resource reservation failure cause, an identifier of the flow, a QoS parameter of the flow, or the like is referred to as the information about the flow. 
     S 3002 : The UE sends the first latency information to an SMF network element. Correspondingly, the SMF network element receives the first latency information from the UE. In addition, the UE may further send the information about the flow to the SMF network element. 
     For example, after receiving the flow service provider broadcast declaration message from the TSN, the UE  1901  forwards the flow service provider broadcast declaration message to the SMF network element  1905 . The flow service provider broadcast declaration message carries the first latency information and the information about the flow. 
     For example, after receiving the flow service provider broadcast declaration message from the TSN, the UE  1901  obtains the first latency information and the information about the flow that are in the flow service provider broadcast declaration message, and sends the first latency information and the information about the flow to the SMF network element  1905 . 
     S 3003 : The SMF network element obtains, from a PCF network element, a PCC rule corresponding to the flow. 
     For example, the SMF network element sends the information about the flow to the PCF network element. The information about the flow may include identification information of the flow, a QoS parameter of the flow, or the like. Correspondingly, the PCF network element receives the information about the flow from the SMF network element. 
     The PCF network element sends the PCC rule corresponding to the flow to the SMF network element. Correspondingly, the SMF network element receives the PCC rule corresponding to the flow from the PCF network element. 
     It should be understood that S 3003  is not a step that needs to be performed. This step is performed to enable the SMF network element to obtain the PCC rule corresponding to the flow. An implementation in which the SMF network element obtains the PCC rule corresponding to the flow is not limited in this embodiment of this application. 
     S 3005 : The SMF network element determines a first target latency according to the PCC rule corresponding to the flow, and the first target latency is a transmission latency of the flow from the UE to the UPF network element. 
     In this embodiment of this application, the first target latency may also be referred to as an accumulated latency of transmitting the flow between the UE and the UPF network element. 
     An example of the first target latency may be a maximum transmission latency of the flow from the UE to the UPF network element. For example, the SMF network element may determine the maximum transmission latency of the flow from the UE to the UPF network element based on a 5QI in the PCC rule. For example, the SMF network element may use a PDB that is between the UE and the UPF network element and that corresponds to the 5QI as the maximum transmission latency of transmitting the flow from the UE to the UPF network element. 
     Optionally, after obtaining the PCC rule, the SMF network element may trigger a PDU session modification process, to establish a QoS flow for the flow, to reserve a resource for the flow. 
     S 3006 : The SMF network element determines a third latency based on the first latency, the first target latency, and a second target latency, where the second target latency is a latency of transmitting the flow from the UPF network element to a target network element that is in the TSN network and that is used as a next hop of the UPF network element, and the third latency is a latency of transmitting the flow from the flow service provider to the target network element that is in the TSN and that is used as the next hop of the UPF network element. 
     If the first latency is denoted as an accumulated latency 1, the first target latency is denoted as T1, the second target latency is denoted as T2, and the third latency is denoted as an accumulated latency 3, a possible implementation in which the SMF network element determines the third latency based on the first latency, the first target latency, and the second target latency is as follows: The accumulated latency 3=the accumulated latency 1+T1+T2. 
     The second target latency may be obtained by the SMF network element from the UPF network element, or may be configured, or may be obtained in another manner. A manner in which the SMF network element obtains the second target latency is not limited in this embodiment of this application. 
     S 3007 : The SMF network element sends the third latency information to the UE. Correspondingly, the UE receives the third latency information from the SMF network element. 
     For example, the SMF network element sends, to the UE, the flow service provider broadcast declaration message that is received by the SMF network element from the UE, and the first latency information in the flow service provider broadcast declaration message is modified to the third latency information. 
     Alternatively, the SMF network element sends the second latency information to the UE through another message. 
     S 3008 : The UE network element sends third latency information to the UPF network element. Correspondingly, the UPF network element receives the third latency information from the UE. 
     For example, the UE sends, to the UPF network element, the flow service provider broadcast declaration message that is received by the UE from the SMF network element, and the flow service provider broadcast declaration message carries the third latency information. 
     Alternatively, the UE modifies, to the third latency information, the first latency information that is in the flow service provider broadcast declaration message and that is received by the UE from the TSN network, and sends, to the UPF network element, a flow service provider broadcast declaration message obtained through modification. 
     S 3009 : The UPF network element sends the third latency information to the target network element. 
     For example, the UPF network element sends, to the target network element, the flow service provider broadcast declaration message that is received by the UPF network element from the UE, and the flow service provider broadcast declaration message carries the third latency information. 
     In the communication method shown in  FIG. 30 , the SMF network element learns, from the UE, of the first latency of transmitting the flow from the flow service provider to the UE, determines the first target latency of transmitting the flow between the UE and the UPF network element, and determines, based on the first latency, the first target latency, and the second target latency of the flow from the UPF network element to the target network element that is in the TSN and that is used as the next hop of the UPF network element, the third latency of the flow from the flow service provider to the target network element. 
     It should be understood that names of messages shown in  FIG. 30  are merely examples. Any message that can implement a corresponding function in the communication method falls within the protection scope of the embodiments of this application. 
     In the communication method shown in  FIG. 30 , an accumulated latency of transmitting the flow from the flow service provider to the target network element that is in the TSN network and that is used as the next hop of the UPF network element may be obtained, and a method for obtaining the accumulated latency is relatively simple, because in the communication method, the accumulated latency can also be obtained through calculation without requiring that the UE or the UPF network element and each device between the UE and the UPF network element are synchronized with a master clock source. 
     In addition, in the communication method shown in  FIG. 30 , a 3GPP system is considered as a bridge in the TSN network, and may receive a flow reservation protocol message (an SRP message) from a node that is in the TSN network and that is used as a previous node of the bridge, provide a method for processing the SRP message, and send the SRP message to a node that is in the TSN and that is used as a next hop of the bridge, so that a latency requirement of a URLLC service flow can be ensured and a bandwidth resource can be reserved in a scenario in which the 3GPP network interworks with the TSN network. 
       FIG. 31  is a schematic flowchart of a communication method according to an embodiment of this application. It should be understood that  FIG. 31  shows steps or operations of the communication method, but these steps or operations are merely examples. In this embodiment of this application, other operations or variations of the operations in  FIG. 31  may be further performed. In addition, the steps in  FIG. 31  may be performed in a sequence different from that presented in  FIG. 31 , and possibly, not all operations in  FIG. 31  need to be performed. 
     S 3101 : UE receives first latency information from a TSN, where the first latency information is used to indicate a first latency, and the first latency is an accumulated latency of transmitting a flow from a flow service provider in the TSN to the UE. 
     For example, the UE  1901  receives a flow service provider broadcast declaration message from a network element that is in the TSN and that is used as a previous hop of the UE  1901 . The message may be used to broadcast a flow and a QoS requirement corresponding to the flow, and the message includes identification information of the flow and the first latency information. In this case, the first latency is an accumulated latency of transmitting the flow from the communications device  1907  used as the flow service provider to the UE  1901 . The previous-hop network element of the UE  1901  may be the communications device  1907 , or may be a device or a network element between the UE  1901  and the communications device  1907 . 
     Optionally, the message may further include one or more of the following information: a destination address, a source address, a maximum frame size, a maximum frame interval, a priority of a frame, a maximum allowable latency of transmitting a single frame of the flow from the flow service provider to a flow service recipient, a reliability requirement of the flow, or a resource reservation failure cause. 
     It should be understood that, in this embodiment of this application, for ease of description, all information other than the first latency information in information related to the flow is referred to as information about the flow. For example, the destination address, the source address, the maximum frame size, the maximum frame interval, the priority of the frame, the maximum allowable latency of transmitting the single frame of the flow from the flow service provider to the flow service recipient, the reliability requirement of the flow, the resource reservation failure cause, an identifier of the flow, a QoS parameter of the flow, or the like is referred to as the information about the flow. 
     S 3102 : The UE sends information about the flow to an SMF network element. Correspondingly, the SMF network element receives the information about the flow from the UE. 
     For example, after receiving the flow service provider broadcast declaration message from the TSN, the UE  1901  forwards the flow service provider broadcast declaration message to the SMF network element  1905 . The flow service provider broadcast declaration message carries the information about the flow. 
     For example, after receiving the flow service provider broadcast declaration message from the TSN, the UE obtains the information about the flow in the flow service provider broadcast declaration message, and sends the information about the flow to the SMF network element  1905 . 
     S 3103 : The SMF network element obtains, from a PCF network element, a PCC rule corresponding to the flow. 
     For example, the SMF network element sends the information about the flow to the PCF network element. The information about the flow may include identification information of the flow and the like. Correspondingly, the PCF network element receives the information about the flow from the SMF network element. 
     The PCF network element sends the PCC rule corresponding to the flow to the SMF network element. Correspondingly, the SMF network element receives the PCC rule corresponding to the flow from the PCF network element. 
     It should be understood that S 3103  is not a step that needs to be performed. This step is performed to enable the SMF network element to obtain the PCC rule corresponding to the flow. An implementation in which the SMF network element obtains the PCC rule corresponding to the flow is not limited in this embodiment of this application. 
     S 3105 : The SMF network element sends, to the UE according to the PCC rule, a quality of service parameter corresponding to the flow. Correspondingly, the UE receives the quality of service parameter from the SMF network element. 
     For example, the SMF network element determines, according to the PCC rule, a 5QI corresponding to the flow, or determines a PDB between the UPF network element and the UE according to the PCC rule, and sends the 5QI or the PDB to the UE. Alternatively, the SMF network element sends, to the UE, QoS flow identification information corresponding to the flow. 
     Optionally, after obtaining the PCC rule, the SMF network element may trigger a PDU session modification process, to establish a QoS flow for the flow, to reserve a resource for the flow. 
     The SMF network element may further send, to the UE, a second target latency corresponding to the flow. The second target latency is a latency of transmitting the flow from the UPF network element to a target network element that is in the TSN network and that is used as a next hop of the UPF network element. The second target latency may be obtained by the SMF network element from the UPF network element, or may be configured, or may be obtained in another manner. A manner in which the SMF network element obtains the second target latency is not limited in this embodiment of this application. 
     S 3106 : The UE determines a first target latency based on the quality of service parameter corresponding to the flow, where the first target latency is a latency of transmitting the flow between the UE and the UPF network element. 
     An example of the first target latency may be a maximum transmission latency of the flow from the UE to the UPF network element. For example, the UE may determine the maximum transmission latency of the flow from the UE to the UPF network element based on the 5QI, the PDB, or the QoS flow identification information received from the SMF network element. 
     For example, if the UE obtains the PDB from the SMF network element, the UE may use the PDB as the first target latency. 
     For example, if the UE obtains the QoS flow identification information from the SMF network element, the UE may obtain a PDB in a corresponding QoS parameter based on the QoS flow identification information, and use the PDB as the first target latency. 
     For example, if the UE obtains the 5QI corresponding to the flow from the SMF network element, the UE may obtain the PDB in the corresponding QoS parameter based on the 5QI, and use the PDB as the first target latency. 
     S 3107 : The UE determines a third latency based on the first latency, the first target latency, and a second target latency, where the second target latency is a latency of transmitting the flow from the UPF network element to a target network element that is in the TSN network and that is used as a next hop of the UPF network element, and the third latency is a latency of transmitting the flow from the flow service provider to the target network element that is in the TSN and that is used as the next hop of the UPF network element. 
     If the first latency is denoted as an accumulated latency 1, the first target latency is denoted as T1, the second target latency is denoted as T2, and the third latency is denoted as an accumulated latency 3, a possible implementation in which the UE determines the third latency based on the first latency, the first target latency, and the second target latency is as follows: The accumulated latency 3=the accumulated latency 1+T1+T2. 
     S 3108 : The UE network element sends third latency information to the UPF network element. Correspondingly, the UPF network element receives the third latency information from the UE. 
     For example, the UE sends, to the UPF network element, the flow service provider broadcast declaration message that is received by the UE from the TSN, and the flow service provider broadcast declaration message carries the third latency information. 
     S 3109 : The UPF network element sends the third latency information to the target network element. 
     For example, the UPF network element sends, to the target network element, the flow service provider broadcast declaration message that is received by the UPF network element from the UE, and the flow service provider broadcast declaration message carries the third latency information. 
     In the communication method shown in  FIG. 31 , the SMF network element learns of the information about the flow from the UE, sends, to the UE based on the information about the flow, the QoS parameter corresponding to the flow, and sends the QoS parameter to the UE. The UE determines, based on the QoS parameter, the first target latency of transmitting the flow between the UE and the UPF network element, and determines, based on the first latency of transmitting the flow from the flow service provider to the UE, the first target latency, and the second target latency of the flow from the UPF network element to the target network element that is in the TSN and that is used as the next hop of the UPF network element, the third latency of the flow from the flow service provider to the target network element. 
     It should be understood that names of messages shown in  FIG. 31  are merely examples. Any message that can implement a corresponding function in the communication method falls within the protection scope of the embodiments of this application. 
     In the communication method shown in  FIG. 31 , an accumulated latency of transmitting the flow from the flow service provider to the target network element that is in the TSN network and that is used as the next hop of the UPF network element may be obtained, and a method for obtaining the accumulated latency is relatively simple, because in the communication method, the accumulated latency can also be obtained through calculation without requiring that the UE or the UPF network element and each device between the UE and the UPF network element are synchronized with a master clock source. 
     In addition, in the communication method shown in  FIG. 31 , a 3GPP system is considered as a bridge in the TSN network, and may receive a flow reservation protocol message (an SRP message) from a node that is in the TSN network and that is used as a previous node of the bridge, provide a method for processing the SRP message, and send the SRP message to a node that is in the TSN and that is used as a next hop of the bridge, so that a latency requirement of a URLLC service flow can be ensured and a bandwidth resource can be reserved in a scenario in which the 3GPP network interworks with the TSN network. 
       FIG. 32  is a schematic flowchart of a communication method according to an embodiment of this application. It should be understood that  FIG. 32  shows steps or operations of the communication method, but these steps or operations are merely examples. In this embodiment of this application, other operations or variations of the operations in  FIG. 32  may be further performed. In addition, the steps in  FIG. 32  may be performed in a sequence different from that presented in  FIG. 32 , and possibly, not all operations in  FIG. 32  need to be performed. 
     S 3201 : A UPF network element receives first latency information from a TSN, where the first latency information is used to indicate a first latency, and the first latency is an accumulated latency of transmitting a flow from a flow service provider in the TSN to the UPF network element. 
     For example, the UPF network element  1903  receives a flow service provider broadcast declaration message from a network element that is in the TSN and that is used as a previous hop of the UPF network element  1903 . The message may be used to broadcast a flow and a QoS requirement corresponding to the flow, and the message includes identification information of the flow and the first latency information. In this case, the first latency is an accumulated latency of transmitting the flow from the communications device  1908  used as the flow service provider to the UPF network element  1903 . The previous-hop network element of the UPF network element  1903  may be the communications device  1908 , or may be a device or a network element between the UPF network element  1903  and the communications device  1908 . 
     Optionally, the message may further include one or more of the following information: a destination address, a source address, a maximum frame size, a maximum frame interval, a priority of a frame, a maximum allowable latency of transmitting a single frame of the flow from the flow service provider to a flow service recipient, a reliability requirement of the flow, or a resource reservation failure cause. 
     It should be understood that, in this embodiment of this application, for ease of description, all information other than the first latency information in information related to the flow is referred to as information about the flow. For example, the destination address, the source address, the maximum frame size, the maximum frame interval, the priority of the frame, the maximum allowable latency of transmitting the single frame of the flow from the flow service provider to the flow service recipient, the reliability requirement of the flow, the resource reservation failure cause, an identifier of the flow, a QoS parameter of the flow, or the like is referred to as the information about the flow. 
     S 3202 : The UPF network element sends the first latency information to an SMF network element. Correspondingly, the SMF network element receives the first latency information from the UPF network element. In addition, the UPF network element may further send the information about the flow to the SMF network element. 
     For example, after receiving the flow service provider broadcast declaration message from the TSN, the UPF network element  1903  forwards the flow service provider broadcast declaration message to the SMF network element  1905 . The flow service provider broadcast declaration message carries the first latency information and the information about the flow. 
     For example, after receiving the flow service provider broadcast declaration message from the TSN, the UPF network element  1903  obtains the first latency information and the information about the flow that are in the flow service provider broadcast declaration message, and sends the first latency information and the information about the flow to the SMF network element  1905 . 
     S 3203 : The SMF network element obtains, from a PCF network element, a PCC rule corresponding to the flow. 
     For example, the SMF network element sends the information about the flow to the PCF network element. The information about the flow may include identification information of the flow, a QoS parameter of the flow, or the like. Correspondingly, the PCF network element receives the information about the flow from the SMF network element. 
     The PCF network element sends the PCC rule corresponding to the flow to the SMF network element. Correspondingly, the SMF network element receives the PCC rule corresponding to the flow from the PCF network element. 
     It should be understood that S 3203  is not a step that needs to be performed. This step is performed to enable the SMF network element to obtain the PCC rule corresponding to the flow. An implementation in which the SMF network element obtains the PCC rule corresponding to the flow is not limited in this embodiment of this application. 
     S 3205 : The SMF network element determines a first target latency according to the PCC rule corresponding to the flow, and the first target latency is a transmission latency of the flow from the UPF network element to the UE. 
     In this embodiment of this application, the first target latency may also be referred to as an accumulated latency of transmitting the flow between the UPF network element and the UE. 
     An example of the first target latency may be a maximum transmission latency of the flow from the UPF network element to the UE. For example, the SMF network element may determine the maximum transmission latency of the flow from the UPF network element to the UE based on a 5QI in the PCC rule. For example, the SMF network element may use a PDB that is between the UPF network element and the UE and that corresponds to the 5QI as the maximum transmission latency of transmitting the flow from the UPF network element to the UE. 
     Optionally, after obtaining the PCC rule, the SMF network element may trigger a PDU session modification process, to establish a QoS flow for the flow, to reserve a resource for the flow. 
     S 3206 : The SMF network element determines a second latency based on the first latency and the first target latency, where the second latency is a transmission latency of the flow from the flow service provider to the UPF network element. 
     For example, the SMF network element determines the second latency based on the first latency indicated by the first latency information carried in the flow service provider broadcast declaration message and the maximum transmission latency that is determined in S 3205 . 
     If the first latency is denoted as an accumulated latency 1, the first target latency is denoted as T1, and the second latency is denoted as an accumulated latency 2, the accumulated latency 2=the accumulated latency 1+T1. 
     S 3207 : The SMF network element sends second latency information to the UE, where the second latency information is used to indicate the second latency. Correspondingly, the UE receives the second latency information from the SMF network element. 
     For example, the SMF network element sends, to the UE, the flow service provider broadcast declaration message that is received by the SMF network element from the UE, and the first latency information carried in the flow service provider broadcast declaration message is modified to the second latency information. 
     Alternatively, the SMF network element may send the second latency information to the UE in another manner. 
     S 3208 : The UE determines a third latency based on the second latency and a second target latency, where the second target latency is a latency of transmitting the flow from the UE to a target network element that is in the TSN network and that is used as a next hop of the UE, and the third latency is a latency of transmitting the flow from the flow service provider to the target network element that is in the TSN and that is used as the next hop of the UE. 
     For example, the second target latency is an accumulated transmission latency of the flow from the UE  1901  to the target network element that is in the TSN and that is used as the next hop of the UE  1901 . The third latency is an accumulated transmission latency of the flow from the communications device  108  to the next-hop network element. The next-hop network element may be the communications device  1907  or may be a communications device between the UE  1901  and the communications device  1907 . 
     An implementation in which the UE determines the third latency based on the second latency and the second target latency may include: The UE adds the second target latency to the second latency. For example, if the second target latency is denoted as T2, the second latency is denoted as an accumulated latency 2, and the third latency is denoted as an accumulated latency 3, the accumulated latency 3=the accumulated latency 2+T2. 
     The second target latency may be obtained by the UE from the target network element, or may be configured, or may be obtained in another manner. A manner in which the UE obtains the second target latency is not limited in this embodiment of this application. 
     S 3209 : The UE sends third latency information to the target network element. 
     For example, the UE modifies, to the third latency information, the second latency information that is in the flow service provider broadcast declaration message and that is received by the UE from the SMF network element, and sends, to the target network element, a flow service provider broadcast declaration message obtained through modification. 
     If the target network element is the flow service recipient, the target network element may determine whether the target network element is interested in the flow, and if the target network element is interested in the flow, determine whether the third latency can meet a latency requirement of the flow. If the third latency can meet the latency requirement of the flow, the target network element sends the third latency information to the UE. 
     For example, the target network element sends, to the UE, a flow service recipient ready message, and the flow service recipient ready message includes the identification information of the flow and the third latency information. Then, the UE may forward the flow service recipient ready message to the UPF network element, and then the UPF network element forwards the flow service recipient ready message to a next-hop network element of the UPF network element in the TSN. 
     In the communication method shown in  FIG. 32 , the SMF network element learns, from the UPF network element, of the first latency of the flow from the flow service provider to the UE, determines, according to the PCC rule of the flow, the first target latency of transmitting the flow between the UPF network element and the UE, determines, based on the first latency and the first target latency, the second latency of transmitting the flow from the flow service provider to the UE, and sends the second latency to the UE. The UE determines, based on the second latency and the second target latency of the flow from the UE to the network element that is in the TSN and that is used as the next hop of the UE, the third latency of the flow from the flow service provider to the next-hop network element. 
     It should be understood that names of messages shown in  FIG. 32  are merely examples. Any message that can implement a corresponding function in the communication method falls within the protection scope of the embodiments of this application. 
     In the communication method shown in  FIG. 32 , an accumulated latency of transmitting the flow from the flow service provider to the target network element that is in the TSN network and that is used as the next hop of the UE may be obtained, and a method for obtaining the accumulated latency is relatively simple, because in the communication method, the accumulated latency can also be obtained through calculation without requiring that the UE or the UPF network element and each device between the UE and the UPF network element are synchronized with a master clock source. 
     In addition, in the communication method shown in  FIG. 32 , a 3GPP system is considered as a bridge in the TSN network, and may receive a flow reservation protocol message (an SRP message) from a node that is in the TSN network and that is used as a previous node of the bridge, provide a method for processing the SRP message, and send the SRP message to a node that is in the TSN and that is used as a next hop of the bridge, so that a latency requirement of a URLLC service flow can be ensured and a bandwidth resource can be reserved in a scenario in which the 3GPP network interworks with the TSN network. 
       FIG. 33  is a schematic flowchart of a communication method according to an embodiment of this application. It should be understood that  FIG. 33  shows steps or operations of the communication method, but these steps or operations are merely examples. In this embodiment of this application, other operations or variations of the operations in  FIG. 33  may be further performed. In addition, the steps in  FIG. 33  may be performed in a sequence different from that presented in  FIG. 33 , and possibly, not all operations in  FIG. 33  need to be performed. 
     S 3301 : UE receives first latency information from a TSN, where the first latency information is used to indicate a first latency, and the first latency is an accumulated latency of transmitting a flow from a flow service provider in the TSN to the UE. 
     For example, the UE  1901  receives a flow service provider broadcast declaration message from a network element that is in the TSN and that is used as a previous hop of the UE  1901 . The message may be used to broadcast a flow and a QoS requirement corresponding to the flow, and the message includes identification information of the flow and the first latency information. In this case, the first latency is an accumulated latency of transmitting the flow from the communications device  1907  used as the flow service provider to the UE  1901 . The previous-hop network element of the UE  1901  may be the communications device  1907 , or may be a device or a network element between the UE  1901  and the communications device  1907 . 
     Optionally, the message may further include one or more of the following information: a destination address, a source address, a maximum frame size, a maximum frame interval, a priority of a frame, a maximum allowable latency of transmitting a single frame of the flow from the flow service provider to a flow service recipient, a reliability requirement of the flow, or a resource reservation failure cause. 
     It should be understood that, in this embodiment of this application, for ease of description, all information other than the first latency information in information related to the flow is referred to as information about the flow. For example, the destination address, the source address, the maximum frame size, the maximum frame interval, the priority of the frame, the maximum allowable latency of transmitting the single frame of the flow from the flow service provider to the flow service recipient, the reliability requirement of the flow, the resource reservation failure cause, an identifier of the flow, a QoS parameter of the flow, or the like is referred to as the information about the flow. 
     S 3302 : The UE sends the first latency information to an SMF network element. Correspondingly, the SMF network element receives the first latency information from the UE. In addition, the UE may further send the information about the flow to the SMF network element. 
     For example, after receiving the flow service provider broadcast declaration message from the TSN, the UE  1901  forwards the flow service provider broadcast declaration message to the SMF network element  1905 . The flow service provider broadcast declaration message carries the first latency information and the information about the flow. 
     For example, after receiving the flow service provider broadcast declaration message from the TSN, the UE  1901  obtains the first latency information and the information about the flow that are in the flow service provider broadcast declaration message, and sends the first latency information and the information about the flow to the SMF network element  1905 . 
     S 3303 : The SMF network element obtains, from a PCF network element, a PCC rule corresponding to the flow. 
     For example, the SMF network element sends the information about the flow to the PCF network element. The information about the flow may include identification information of the flow, a QoS parameter of the flow, or the like. Correspondingly, the PCF network element receives the information about the flow from the SMF network element. 
     The PCF network element sends the PCC rule corresponding to the flow to the SMF network element. Correspondingly, the SMF network element receives the PCC rule corresponding to the flow from the PCF network element. 
     It should be understood that S 3303  is not a step that needs to be performed. This step is performed to enable the SMF network element to obtain the PCC rule corresponding to the flow. An implementation in which the SMF network element obtains the PCC rule corresponding to the flow is not limited in this embodiment of this application. 
     S 3305 : The SMF network element determines a first target latency according to the PCC rule corresponding to the flow, and the first target latency is a transmission latency of the flow from the UE to the UPF network element. 
     In this embodiment of this application, the first target latency may also be referred to as an accumulated latency of transmitting the flow between the UE and the UPF network element. 
     An example of the first target latency may be a maximum transmission latency of the flow from the UE to the UPF network element. For example, the SMF network element may determine the maximum transmission latency of the flow from the UE to the UPF network element based on a 5QI in the PCC rule. For example, the SMF network element may use a PDB that is between the UPF and the UE and that corresponds to the 5QI as the maximum transmission latency of transmitting the flow from the UE to the UPF. 
     Optionally, after obtaining the PCC rule, the SMF network element may trigger a PDU session modification process, to establish a QoS flow for the flow, to reserve a resource for the flow. 
     S 3306 : The SMF network element determines a second latency based on the first latency and the first target latency, where the second latency is a transmission latency of the flow from the flow service provider to the UE. 
     For example, the SMF network element determines the second latency based on the first latency indicated by the first latency information carried in the flow service provider broadcast declaration message and the maximum transmission latency that is determined in S 3305 . 
     If the first latency is denoted as an accumulated latency 1, the first target latency is denoted as T1, and the second latency is denoted as an accumulated latency 2, the accumulated latency 2=the accumulated latency 1+T1. 
     S 3307 : The SMF network element sends second latency information to the UPF network element, where the second latency information is used to indicate the second latency. Correspondingly, the UPF network element receives the second latency information from the SMF network element. 
     For example, the SMF network element sends, to the UPF network element, a flow service provider broadcast declaration message obtained through modification, and the first latency information carried in the flow service provider broadcast declaration message obtained through modification is modified to the second latency information. 
     Alternatively, the SMF network element may send the second latency information to the UPF network element in another manner. 
     S 3308 : The UPF network element determines a third latency based on the second latency and a second target latency, where the second target latency is a latency of transmitting the flow from the UPF network element to a target network element that is in the TSN network and that is used as a next hop of the UPF network element, and the third latency is a latency of transmitting the flow from the flow service provider to the target network element that is in the TSN and that is used as the next hop of the UPF network element. 
     For example, the second target latency is an accumulated transmission latency of the flow from the UPF network element  1903  to the target network element that is in the TSN and that is used as the next hop of the UPF network element  1903 . The third latency is an accumulated transmission latency of the flow from the communications device  1907  to the target network element. The target network element may be the communications device  1908  or may be a communications device between the UPF network element and the communications device  1908 . 
     An implementation in which the UPF network element determines the third latency based on the second latency and the second target latency may include: The UPF network element adds the second target latency to the second latency, to obtain the third latency. For example, if the second target latency is denoted as T2, the second latency is denoted as an accumulated latency 2, and the third latency is denoted as an accumulated latency 3, the accumulated latency 3=the accumulated latency 2+T2. 
     The second target latency may be obtained by the UPF network element from the target network element, or may be configured, or may be obtained in another manner. A manner in which the UPF network element obtains the second target latency is not limited in this embodiment of this application. 
     S 3309 : The UPF network element sends the third latency information to the target network element. 
     For example, the UPF network element sends, to the target network element, the flow service provider broadcast declaration message that is received by the UPF network element from the UE, and the first latency information carried in the flow service provider broadcast declaration message is modified to carrying the third latency information. 
     In the communication method shown in  FIG. 33 , the SMF network element learns, from the UE, of the first latency of the flow from the flow service provider to the UE, determines, according to the PCC rule of the flow, the first target latency of transmitting the flow between the UE and the UPF network element, determines, based on the first latency and the first target latency, the second latency of transmitting the flow from the flow service provider to the UPF network element, and sends the second latency to the UPF network element. The UPF network element determines, based on the second latency and the second target latency of the flow from the UPF network element to the network element that is in the TSN and that is used as the next hop of the UPF network element, the third latency of the flow from the flow service provider to the next-hop network element. 
     It should be understood that names of messages shown in  FIG. 33  are merely examples. Any message that can implement a corresponding function in the communication method falls within the protection scope of the embodiments of this application. 
     In the communication method shown in  FIG. 33 , an accumulated latency of transmitting the flow from the flow service provider to the target network element that is in the TSN network and that is used as the next hop of the UPF network element may be obtained, and a method for obtaining the accumulated latency is relatively simple, because in the communication method, the accumulated latency can also be obtained through calculation without requiring that the UE or the UPF network element and each device between the UE and the UPF network element are synchronized with a master clock source. 
     In addition, in the communication method shown in  FIG. 33 , a 3GPP system is considered as a bridge in the TSN network, and may receive a flow reservation protocol message (an SRP message) from a node that is in the TSN network and that is used as a previous node of the bridge, provide a method for processing the SRP message, and send the SRP message to a node that is in the TSN and that is used as a next hop of the bridge, so that a latency requirement of a URLLC service flow can be ensured and a bandwidth resource can be reserved in a scenario in which the 3GPP network interworks with the TSN network. 
     Optionally, any communication method shown in  FIG. 20  to  FIG. 33  may further include: sending, by the SMF network element, the bandwidth requirement information of the flow to the UPF network element. Correspondingly, the UPF network element receives the bandwidth requirement information of the flow from the SMF network element, and reserves the bandwidth resource for the flow based on the bandwidth requirement information of the flow. 
     In other words, when determining that the bandwidth resource can be reserved for the flow, the SMF network element may send the bandwidth requirement message of the flow to the UPF network element, so that the UPF network element reserves the bandwidth resource for the flow based on the bandwidth requirement information. In this way, when the flow is transmitted to the UPF network element, the UPF network element may have a corresponding bandwidth resource to transmit the flow, thereby improving transmission reliability of the flow. 
     Optionally, any communication method shown in  FIG. 20  to  FIG. 33  may further include: sending, by the SMF network element, the bandwidth requirement information of the flow to an access network device corresponding to the UE. Correspondingly, the access network device receives the bandwidth requirement information, and reserves bandwidth for the flow based on the bandwidth requirement information. 
     In other words, when determining that the bandwidth resource can be reserved for the flow, the SMF network element may send the bandwidth requirement message of the flow to the access network device serving the UE, so that the access network device reserves the bandwidth resource for the flow based on the bandwidth requirement information. In this way, the access network may have a corresponding bandwidth resource to transmit the flow, thereby improving transmission reliability of the flow. 
     Optionally, when the SMF network element sends the bandwidth requirement information of the flow to the access network device corresponding to the UE, any communication method shown in  FIG. 20  to  FIG. 33  may further include: receiving, by the SMF network element, first information from the access network device, where the first information is used to indicate whether the access network device successfully reserves the bandwidth resource for the flow based on the bandwidth requirement information of the flow. 
     For example, before sending any latency information to the UE or the UPF network element, the SMF network element may detect whether the first information is received from the access network device. If the SMF network element receives the first information and the first information indicates that the AN device successfully reserves the resource for the flow, the SMF network element may send, to the UE or the UPF network element, latency information that needs to be sent. Otherwise, the SMF network element may not send, to the UE or the UPF network element, the latency information that needs to be sent. 
     In this implementation, the SMF network element performs a subsequent related operation only when determining that the access network device can successfully reserve the bandwidth resource for the flow, thereby improving execution efficiency of the SMF network element. 
       FIG. 18  is a schematic structural diagram of a communications apparatus according to an embodiment of this application. It should be understood that a communications apparatus  1800  shown in  FIG. 18  is merely an example. The communications apparatus in this embodiment of this application may further include other modules or units, or include modules having functions similar to those of modules in  FIG. 18 , or does not need to include all the modules in  FIG. 18 . 
     The communications apparatus  1800  shown in  FIG. 18  may include a receiving module  1810 , a processing module  1820 , and a sending module  1830 . The modules included in the communications apparatus  1800  may be implemented in a software and/or hardware manner. 
     For example, the receiving module  1810  may be a receiver, the sending module  1830  may be a transmitter, and the processing module  1820  may be a processor. The receiver and the transmitter may be integrated together and referred to as a transceiver. 
     For another example, the processing module  1820  may be a processor, and the receiving module  1810  and the sending module  1830  may be communications interfaces. In this case, the communications apparatus  1800  may be a chip. 
     Optionally, the communications apparatus  1800  may further include a memory, configured to store program code executed by the processor. 
     In a possible implementation, the communications apparatus  1800  may be configured to perform the steps performed by the SMF network element in the communication method described in any one of  FIG. 2  to  FIG. 7 . 
     In this case, the communications apparatus may be an SMF network element, or may be a chip that can be integrated into the SMF network element. 
     For example, in the communications apparatus  1800 , the receiving module  1810  may be configured to receive first latency information of a flow from a UPF network element, where the first latency information is used to indicate a first latency of transmitting the flow from a flow service provider in a TSN to the UPF network element; the processing module  1820  may be configured to determine, according to a PCC rule of the flow, a third latency of transmitting the flow from the UPF network element to UE, and the processing module  1820  may be configured to determine, based on the first latency and the third latency, a second latency of transmitting the flow from the flow service provider in the TSN to the UE; and the sending module  1830  may be configured to send second latency information to the UPF network element, where the second latency information is used to indicate the second latency. 
     Optionally, the third latency may be a maximum transmission latency of transmitting the flow from the UPF network element to the UE. 
     Optionally, the processing module may be specifically configured to determine a sum of the first latency and the third latency as the second latency. 
     Optionally, the processing module may be configured to determine, according to the PCC rule, that a bandwidth resource can be reserved for the flow. 
     Optionally, the sending module may be configured to send bandwidth requirement information of the flow to the UPF network element. 
     Optionally, the sending module may be configured to send the bandwidth requirement information of the flow to an access network device corresponding to the UE. 
     Optionally, the receiving module may be configured to receive first information from the access network device, where the first information is used to indicate that the access network device successfully reserves the bandwidth resource for the flow based on the bandwidth requirement information of the flow. 
     Optionally, the sending module may be configured to send information about the flow to a PCF network element, where the information about the flow is used to determine a PCC rule of the flow; and the receiving module may be configured to receive the PCC rule from the PCF network element. 
     Optionally, the information about the flow may include at least one of the following: an identifier ID of the flow, a source address and a destination address of the flow, a size of a maximum frame used for transmitting the flow, an interval between frames used for transmitting the flow, a priority of the flow, a maximum allowable latency of transmitting a single frame of the flow from the flow service provider to a flow service recipient, or a reliability requirement of the flow. 
     In some other possible implementations, the communications apparatus  1800  may be configured to perform the steps performed by the SMF network element in the communication method described in any one of  FIG. 8  to  FIG. 10 . In this case, the communications apparatus  1800  may be an SMF network element, or may be a chip that can be integrated into the SMF network element. 
     For example, in the communications apparatus  1800 , the receiving module  1810  may be configured to receive first latency information of a flow from UE, where the first latency information is used to indicate a first latency; the processing module  1820  may be configured to determine, according to a PCC rule of the flow, a maximum transmission latency of transmitting the flow from the UE to a UPF network element; the processing module  1820  may be configured to determine, based on the first latency and the maximum transmission latency, a second latency of transmitting the flow from the UE to the UPF network element; and the sending module  1830  may be configured to send second latency information to the UPF network element, where the second latency information is used to indicate the second latency. 
     Optionally, the processing module  1820  may be specifically configured to determine a value obtained by subtracting a default value of a transmission latency of transmitting the flow from the UE to the UPF network element from a sum of the first latency and the maximum transmission latency as the second latency. 
     Optionally, the processing module may be configured to determine, according to the PCC rule, that a bandwidth resource can be reserved for the flow. 
     Optionally, the sending module  1830  may be configured to send bandwidth requirement information of the flow to the UPF network element. 
     Optionally, the sending module  1830  may be configured to send the bandwidth requirement information of the flow to an access network device corresponding to the UE. 
     Optionally, the receiving module  1810  may be configured to receive first information from the access network device, where the first information is used to indicate that the access network device successfully reserves the bandwidth resource for the flow based on the bandwidth requirement information of the flow. 
     Optionally, the sending module  1830  may be configured to send information about the flow to a PCF network element, where the information about the flow is used to determine a PCC rule of the flow; and the SMF network element receives the PCC rule from the PCF network element. 
     Optionally, the information about the flow may include at least one of the following: an identifier ID of the flow, a source address and a destination address of the flow, a size of a maximum frame used for transmitting the flow, an interval between frames used for transmitting the flow, or a priority of the flow. 
     In some other possible implementations, the communications apparatus  1800  may be configured to perform the steps performed by the SMF network element in the communication method described in any one of  FIG. 11  to  FIG. 13 . In this case, the communications apparatus  1800  may be an SMF network element, or may be a chip that can be integrated into the SMF network element. 
     For example, in the communications apparatus  1800 , the receiving module  1810  may be configured to receive information about a flow from UE; the processing module  1820  may be configured to: determine, based on the information about the flow and a PCC rule of the flow, a maximum transmission latency of transmitting the flow from the UE to a user plane function UPF network element; and the sending module  1830  may be configured to send first latency information to the UE, where the first latency information is used to indicate the maximum transmission latency. 
     Optionally, the information about the flow may include one or more of the following: an identifier ID of the flow, a source address and a destination address of the flow, a size of a maximum frame used for transmitting the flow, an interval between frames used for transmitting the flow, a priority of the flow, or information about a latency that is determined by the UE and that is of transmitting the flow from the UE to the UPF network element. 
     Optionally, the processing module  1820  may be configured to determine, according to the PCC rule, that the UPF network element can reserve a bandwidth resource for the flow. 
     Optionally, the sending module  1830  may be configured to send bandwidth requirement information of the flow to the UPF network element. 
     Optionally, the sending module  1830  may be configured to send the bandwidth requirement information of the flow to an access network device corresponding to the UE. 
     Optionally, the receiving module  1810  may be configured to receive first information from the access network device, where the first information is used to indicate that the access network device successfully reserves the bandwidth resource for the flow based on the bandwidth requirement information of the flow. 
     Optionally, the sending module  1830  may be configured to send information about the flow to a PCF network element, where the information about the flow is used to determine a PCC rule of the flow; and the receiving module  1810  may be configured to receive the PCC rule from the PCF network element. 
     Optionally, the information about the flow may include at least one of the following: an identifier ID of the flow, a source address and a destination address of the flow, a size of a maximum frame used for transmitting the flow, an interval between frames used for transmitting the flow, or a priority of the flow. 
     In some other possible implementations, the communications apparatus  1800  may be configured to perform the steps performed by the UPF network element in the communication method described in any one of  FIG. 2  to  FIG. 7 . In this case, the communications apparatus  1800  may be a UPF network element, or may be a chip that can be integrated into the UPF network element. 
     For example, in the communications apparatus  1800 , the receiving module  1810  may be configured to receive first latency information of a flow from a TSN, where the first latency information is used to indicate a first latency of transmitting the flow from a flow service provider in the TSN to the UPF network element; the sending module  1830  may be configured to send the first latency information to an SMF network element, where the first latency information is used to determine a second latency, and the second latency is a latency of transmitting the flow from the flow service provider in the TSN network to a terminal device UE; the receiving module  1810  may be configured to receive second latency information from the SMF network element, where the second latency information is used to indicate the second latency; and the sending module  1830  may be configured to send the second latency information to the UE. 
     Optionally, the receiving module  1810  may be configured to receive bandwidth requirement information of the flow from the SMF network element; and the processing module  1820  may be configured to reserve a bandwidth resource for the flow based on the bandwidth requirement information of the flow. 
     Optionally, the receiving module may be configured to receive first information from the SMF network element, where the first information is used to indicate that an access network device corresponding to the UE successfully reserves the bandwidth resource for the flow based on the bandwidth requirement information of the flow. 
     In some other possible implementations, the communications apparatus  1800  may be configured to perform the steps performed by the UE in the communication method described in any one of  FIG. 8  to  FIG. 10 . In this case, the communications apparatus  1800  may be UE, or may be a chip that can be integrated into the UE. 
     For example, in the communications apparatus  1800 , the sending module  1830  may be configured to send information about a flow to an SMF network element, where the information about the flow is used to determine a maximum transmission latency of transmitting the flow from the UE to a UPF network element; the receiving module  1810  may be configured to receive first latency information from the SMF network element, where the first latency information is used to indicate the maximum transmission latency; the processing module  1810  may be configured to determine, based on the maximum transmission latency, a target latency of transmitting the flow from the UE to the UPF network element; and the sending module  1830  may be configured to send second latency information to the UPF network element, where the second latency information is used to indicate the target latency. 
     In some other possible implementations, the communications apparatus  1800  may be configured to perform the steps performed by the UPF network element in the communication method described in any one of  FIG. 14  to  FIG. 17 . In this case, the communications apparatus  1800  may be a UPF network element, or may be a chip that can be integrated into the UPF network element. 
     For example, in the communications apparatus  1800 , the receiving module  1810  may be configured to receive first latency information of a flow from a TSN, where the first latency information is used to indicate a first latency of transmitting the flow from a flow service provider in the TSN to the UPF network element; the sending module  1830  may be configured to send information about the flow to an SMF network element, where the information about the flow is used to determine a third latency of transmitting the flow from the UPF network element to UE; the processing module  1820  may be configured to receive third latency information from the SMF network element, where the third latency information is used to indicate the third latency; the processing module  1820  may be configured to determine, based on the first latency and the third latency, a second latency of transmitting the flow from the flow service provider in the TSN network to the UE; and the sending module  1830  may be configured to send second latency information to the UE, where the second latency information is used to indicate the second latency. 
     Optionally, the processing module  1820  may be specifically configured to determine a sum of the first latency and the third latency as the second latency. 
     Optionally, the receiving module  1810  may be configured to receive bandwidth requirement information of the flow from the SMF network element; and the processing module  1820  may be configured to reserve a bandwidth resource for the flow based on the bandwidth requirement information of the flow. 
     Optionally, the receiving module  1810  may be configured to receive first information from the SMF network element, where the first information is used to indicate that an access network device corresponding to the UE successfully reserves the bandwidth resource for the flow based on the bandwidth requirement information of the flow. 
     Optionally, the information about the flow may include at least one of the following: an identifier ID of the flow, a source address and a destination address of the flow, a size of a maximum frame used for transmitting the flow, an interval between frames used for transmitting the flow, a priority of the flow, a maximum allowable latency of transmitting a single frame of the flow from the flow service provider to a flow service recipient, or a reliability requirement of the flow. 
     In another possible implementation, the communications apparatus  1800  may be configured to perform the steps performed by the SMF network element in the communication method described in  FIG. 24  or  FIG. 30 . In this case, the communications apparatus may be an SMF network element, or may be a chip that can be integrated into the SMF network element. 
     For example, in the communications apparatus  1800 , the receiving module  1810  may be configured to receive first latency information of a flow from a first communications device, where the first latency information is used to indicate a first latency of transmitting the flow from a flow service provider in a TSN to the first communications device; the processing module  1820  may be configured to determine, according to a PCC rule of the flow, a first target latency of transmitting the flow from the first communications device to a second communications device; the processing module  1820  may be configured to determine, based on the first latency, the first target latency, and a second target latency, a third latency of transmitting the flow from the flow service provider to a target network element that is in the TSN and that is used as a next hop of the second communications device, and the second target latency is a latency of transmitting the flow from the second communications device to the target network element; and the sending module  1830  may be configured to send third latency information to the first communications device, where the third latency information is used to indicate the third latency, where the first communications device is a UPF network element, and the second communications device is UE, or the first communications device is the UE, and the second communications device is the UPF network element. 
     Optionally, the processing module  1820  is specifically configured to use a sum of the first latency, the first target latency, and the second target latency as the third latency. 
     Optionally, the first target latency is a maximum transmission latency of the flow between the UPF network element and the UE. 
     Optionally, the processing module  1820  is further configured to determine, according to the PCC rule, that a bandwidth resource can be reserved for the flow. 
     Optionally, the sending module  1830  is further configured to send bandwidth requirement information of the flow to the UPF network element. 
     Optionally, the sending module  1830  is further configured to send the bandwidth requirement information of the flow to an access network device corresponding to the UE. 
     Optionally, the receiving module  1810  is further configured to receive first information from the access network device, where the first information is used to indicate whether the access network device successfully reserves the bandwidth resource for the flow based on the bandwidth requirement information of the flow. 
     Optionally, the sending module is further configured to send information about the flow to a PCF network element, where the information about the flow is used to determine a PCC rule of the flow; and the receiving module  1810  is further configured to receive the PCC rule from the PCF network element. 
     Optionally, the information about the flow may include at least one of the following: an identifier ID of the flow, a source address and a destination address of the flow, a size of a maximum frame used for transmitting the flow, an interval between frames used for transmitting the flow, a priority of the flow, a maximum allowable latency of transmitting a single frame of the flow from a talker to a listener, or a reliability requirement of the flow. 
     In another possible implementation, the communications apparatus  1800  may be configured to perform the steps performed by the SMF network element in the communication method described in any one of  FIG. 20 ,  FIG. 22 ,  FIG. 26 ,  FIG. 28 ,  FIG. 32 , and  FIG. 33 . In this case, the communications apparatus  1800  may be an SMF network element, or may be a chip that can be integrated into the SMF network element. 
     For example, in the communications apparatus  1800 , the receiving module  1810  is configured to receive first latency information of a flow from a UPF network element or UE, where the first latency information is used to indicate a first latency of transmitting the flow from a flow service provider in a TSN to a first communications device; the processing module  1820  is configured to determine, according to a PCC rule of the flow, a first target latency of transmitting the flow between the UPF network element and the UE; the processing module  1820  is configured to determine, based on the first latency and the first target latency, a second latency of transmitting the flow from the flow service provider in the TSN to a second communications device; and the sending module  1830  is configured to send second latency information to the UPF network element or the UE, where the second latency information is used to indicate the second latency, where the first communications device is the UPF network element, and the second communications device is the UE, or the first communications device is the UE, and the second communications device is the UPF network element. 
     Optionally, the processing module  1820  is specifically configured to use a sum of the first latency and the first target latency as the second latency. 
     Optionally, the first target latency is a maximum transmission latency of the flow between the UPF network element and the UE. 
     Optionally, the processing module  1820  is further configured to determine, according to the PCC rule, that a bandwidth resource can be reserved for the flow. 
     Optionally, the sending module  1830  is further configured to send bandwidth requirement information of the flow to the UPF network element. 
     Optionally, the sending module  1830  is further configured to send the bandwidth requirement information of the flow to an access network device corresponding to the UE. 
     Optionally, the receiving module  1810  is further configured to receive first information from the access network device, where the first information is used to indicate whether the access network device successfully reserves the bandwidth resource for the flow based on the bandwidth requirement information of the flow. 
     Optionally, the sending module is further configured to send information about the flow to a PCF network element, where the information about the flow is used to determine a PCC rule of the flow; and the receiving module  1810  is further configured to receive the PCC rule from the PCF network element. 
     Optionally, the information about the flow may include at least one of the following: an identifier ID of the flow, a source address and a destination address of the flow, a size of a maximum frame used for transmitting the flow, an interval between frames used for transmitting the flow, a priority of the flow, a maximum allowable latency of transmitting a single frame of the flow from the flow service provider to a flow service recipient, or a reliability requirement of the flow. 
     In some other possible implementations, the communications apparatus  1800  may be configured to perform the steps performed by the UPF network element in the communication method described in  FIG. 23 . In this case, the communications apparatus  1800  may be a UPF network element, or may be a chip that can be integrated into the UPF network element. 
     For example, in the communications apparatus  1800 , the receiving module  1810  may be configured to receive first latency information of a flow from a TSN, where the first latency information is used to indicate a first latency of transmitting the flow from a flow service provider in the TSN to the UPF network element; the sending module  1830  may be configured to send information about the flow to an SMF network element, where the information about the flow is used to determine a quality of service parameter corresponding to the flow; the receiving module  1810  may be configured to receive the quality of service parameter from the SMF network element; the processing module  1820  may be configured to determine, based on the quality of service parameter, a first target latency of transmitting the flow from the UPF network element to the UE; the processing module  1820  may configured to determine a second latency based on the first latency and the first target latency, where the second latency is a latency of transmitting the flow from the flow service provider to the UE; and the sending module may be configured to send second latency information to the UE, where the second latency information is used to indicate the second latency. 
     Optionally, the processing module  1820  is specifically configured to use a sum of the first latency and the first target latency as the second latency. 
     Optionally, the first target latency is a maximum transmission latency of the flow between the UPF network element and the UE. 
     Optionally, the receiving module  1810  is further configured to receive bandwidth requirement information of the flow from the SMF network element; and the processing module  1820  is further configured to reserve a bandwidth resource for the flow based on the bandwidth requirement information of the flow. 
     Optionally, the receiving module  1810  is further configured to receive first information from the SMF network element, where the first information is used to indicate whether an access network device corresponding to the UE successfully reserves the bandwidth resource for the flow based on the bandwidth requirement information of the flow. 
     In some other possible implementations, the communications apparatus  1800  may be configured to perform the steps performed by the UPF network element in the communication method described in  FIG. 25  or  FIG. 27 . In this case, the communications apparatus  1800  may be a UPF network element, or may be a chip that can be integrated into the UPF network element. 
     In the communications apparatus  1800 , the receiving module  1810  may be configured to receive first latency information of a flow from a TSN or UE, where the first latency information is used to indicate a first latency of transmitting the flow from a flow service provider in the TSN to a first communications device; the sending module  1830  may be configured to send information about the flow to an SMF network element, where the information about the flow is used to determine a quality of service parameter corresponding to the flow; the receiving module  1810  may be configured to receive the quality of service parameter corresponding to the flow from the SMF network element; the processing module  1820  may be configured to determine a first target latency based on the quality of service parameter corresponding to the flow, where the first target latency is a latency of transmitting the flow between the terminal device UE and the UPF network element; the processing module  1820  may be configured to determine a third latency based on the first latency, the first target latency, and a second target latency, where the second target latency is a latency of transmitting the flow from a second communications device to a target network element that is in the TSN network and that is used as a next hop of the second communications device, and the third latency is a latency of transmitting the flow from the flow service provider to the target network element; and the sending module  1830  may be configured to send third latency information, where the third latency information is used to indicate the third latency, where the first communications device is the UPF network element, and the second communications device is the UE, or the first communications device is the UE, and the second communications device is the UPF network element. 
     Optionally, the processing module  1820  is specifically configured to use a sum of the first latency, the first target latency, and the second target latency as the third latency. 
     Optionally, the first target latency is a maximum transmission latency of the flow between the UPF network element and the UE. 
     Optionally, the receiving module  1810  is further configured to receive bandwidth requirement information of the flow from the SMF network element; and the processing module  1820  is further configured to reserve a bandwidth resource for the flow based on the bandwidth requirement information of the flow. 
     Optionally, the receiving module  1810  is further configured to receive first information from the SMF network element, where the first information is used to indicate whether an access network device corresponding to the UE successfully reserves the bandwidth resource for the flow based on the bandwidth requirement information of the flow. 
     In some other possible implementations, the communications apparatus  1800  may be configured to perform the steps performed by the UPF network element in the communication method described in  FIG. 26 ,  FIG. 28 ,  FIG. 29 , or  FIG. 33 . In this case, the communications apparatus  1800  may be a UPF network element, or may be a chip that can be integrated into the UPF network element. 
     In the communications apparatus  1800 , the receiving module  1810  may be configured to receive second latency information of a flow from UE or an SMF network element, where the second latency information is used to indicate a second latency of transmitting the flow from a flow service provider in a time sensitive network TSN to the UPF network element; the processing module  1820  may be configured to determine a third latency based on the second latency and a second target latency, where the second target latency is a latency of transmitting the flow from the UPF network element to a target network element that is in the TSN network and that is used as a next hop of the UPF network element, and the third latency is a latency of transmitting the flow from the flow service provider to the target network element; and the sending module  1830  may be configured to send third latency information to the target network element, where the third latency information is used to indicate the third latency. 
     Optionally, the processing module  1820  is specifically configured to use a sum of the second latency and the second target latency as the third latency. 
     Optionally, the receiving module  1810  is further configured to receive bandwidth requirement information of the flow from the SMF network element; and the processing module  1820  is further configured to reserve a bandwidth resource for the flow based on the bandwidth requirement information of the flow. 
     Optionally, the receiving module  1810  is further configured to receive first information from the SMF network element, where the first information is used to indicate whether an access network device corresponding to the UE successfully reserves the bandwidth resource for the flow based on the bandwidth requirement information of the flow. 
     In some other possible implementations, the communications apparatus  1800  may be configured to perform the steps performed by the UE in the communication method described in  FIG. 20 ,  FIG. 22 ,  FIG. 23 , or  FIG. 32 . In this case, the communications apparatus  1800  may be UE, or may be a chip that can be integrated into the UE. 
     For example, in the communications apparatus  1800 , the receiving module  1810  may be configured to receive second latency information of a flow from an SMF network element or a UPF network element, where the second latency information is used to indicate a second latency of transmitting the flow from a flow service provider in a TSN to the UE; the processing module  1820  may be configured to determine a third latency based on the second latency and a second target latency, where the second target latency is a latency of transmitting the flow from the UE to a target network element that is in the TSN network and that is used as a next hop of the UE, and the third latency is a latency of transmitting the flow from the flow service provider to the target network element; and the sending module  1830  may be configured to send third latency information to the target network element, where the third latency information is used to indicate the third latency. 
     Optionally, the processing module  1820  is specifically configured to use a sum of the second latency and the second target latency as the third latency. 
     In some other possible implementations, the communications apparatus  1800  may be configured to perform the steps performed by the UE in the communication method described in  FIG. 21  or  FIG. 31 . In this case, the communications apparatus  1800  may be UE, or may be a chip that can be integrated into the UE. 
     For example, in the communications apparatus  1800 , the receiving module  1810  may be configured to receive first latency information of a flow, where the first latency information is used to indicate a first latency of transmitting the flow from a flow service provider in the time sensitive network TSN to a first communications device; the sending module  1830  may be configured to send information about the flow to a session management function SMF network element, where the information about the flow is used to determine a quality of service parameter corresponding to the flow; the receiving module  1810  may be configured to receive the quality of service parameter corresponding to the flow from the SMF network element; the processing module  1820  may be configured to determine a first target latency based on the quality of service parameter corresponding to the flow, where the first target latency is a latency of transmitting the flow between the UE and the user plane function UPF network element; the processing module  1820  may be configured to determine a third latency based on the first latency, the first target latency, and a second target latency, where the second target latency is a latency of transmitting the flow from a second communications device to a target network element that is in the TSN network and that is used as a next hop of the second communications device, and the third latency is a latency of transmitting the flow from the flow service provider to the target network element; and the sending module  1830  may be configured to send third latency information, where the third latency information is used to indicate the third latency, where the first communications device is the UPF network element, and the second communications device is the UE, or the first communications device is the UE, and the second communications device is the UPF network element. 
     Optionally, the processing module  1820  is specifically configured to use a sum of the first latency, the first target latency, and the second target latency as the third latency. 
     Optionally, the first target latency is a maximum transmission latency of the flow between the UPF network element and the UE. 
     In some other possible implementations, the communications apparatus  1800  may be configured to perform the steps performed by the UE in the communication method described in  FIG. 29 . In this case, the communications apparatus  1800  may be UE, or may be a chip that can be integrated into the UE. 
     For example, in the communications apparatus  1800 , the receiving module  1810  may be configured to receive first latency information of a flow, where the first latency information is used to indicate a first latency of transmitting the flow from a flow service provider in a TSN to the UE; the sending module  1830  may be configured to send information about the flow to an SMF network element, where the information about the flow is used to determine a quality of service parameter corresponding to the flow; the receiving module  1810  may be configured to receive the quality of service parameter corresponding to the flow from the SMF network element; the processing module  1820  may be configured to determine a first target latency based on the quality of service parameter corresponding to the flow, where the first target latency is a latency of transmitting the flow between the UE and a user plane function UPF network element; the processing module  1820  may be configured to determine a second latency based on the first latency and the first target latency, where the second latency is a latency of transmitting the flow from the flow service provider to the UPF network element; and the sending module  1830  may be configured to send second latency information to the UPF network element, where the second latency information is used to indicate the second latency. 
     Optionally, the processing module  1820  is specifically configured to determine a sum of the first latency and the first target latency as the second latency. 
     Optionally, the first target latency is a maximum transmission latency of the flow between the UPF network element and the UE. 
     A person of ordinary skill in the art may be aware that, units and algorithm steps in the examples described with reference to the embodiments disclosed in this application can be implemented by electronic hardware or a combination of electronic hardware and computer software. Whether the functions are performed by hardware or software depends on particular applications and design constraints of the technical solutions. A person skilled in the art may use a different method to implement the described function for each particular application, but it should not be considered that the implementation goes beyond the scope of this application. 
     It may be clearly understood by a person skilled in the art that, for the purpose of convenient and brief description, for a detailed working process of the foregoing system, apparatus, and unit, refer to a corresponding process in the foregoing method embodiments. Details are not described herein again. 
     In the several embodiments provided in this application, it should be understood that the disclosed system, apparatus, and method may be implemented in other manners. For example, the described apparatus embodiments are merely examples. For example, division into units is merely division of logical functions and may be other division in an actual implementation. For example, a plurality of units or components may be combined or integrated into another system, or some features may be ignored or not performed. In addition, the displayed or discussed mutual couplings or direct couplings or communication connections may be implemented through some interfaces. The indirect couplings or communication connections between the apparatuses or units may be implemented in electrical, mechanical, or other forms. 
     The units described as separate components may or may not be physically separate, and components displayed as units may or may not be physical units, in other words, may be located at one position, or may be distributed on a plurality of network units. Some or all of the units may be selected based on an actual requirement to achieve the objectives of the solutions of the embodiments. 
     In addition, functional units in the embodiments of this application may be integrated into one processing unit, or each of the units may exist alone physically, or two or more units may be integrated into one unit. 
     It should be understood that in the embodiments of this application, the processor may be a central processing unit (CPU), or the processor may be another general-purpose processor, a digital signal processor (DSP), an application-specific integrated circuit (ASIC), a field programmable gate array (FPGA) or another programmable logic device, a discrete gate or transistor logic device, a discrete hardware component, or the like. The general-purpose processor may be a microprocessor, or the processor may be any conventional processor or the like. 
     When the functions are implemented in a form of a software functional unit and sold or used as an independent product, the functions may be stored in a computer-readable storage medium. Based on such an understanding, the technical solutions of this application essentially, or the part contributing to the prior art, or some of the technical solutions may be implemented in a form of a software product. The computer software product is stored in a storage medium, and includes several instructions for instructing a computer device (which may be a personal computer, a server, or a network device) to perform all or some of the steps of the methods described in the embodiments of this application. The storage medium includes any medium that can store program code, such as a USB flash drive, a removable hard disk, a read-only memory (ROM), a random access memory (RAM), a magnetic disk, or an optical disc. 
     The foregoing descriptions are merely specific implementations of this application, but are not intended to limit the protection scope of this application. Any variation or replacement readily figured out by a person skilled in the art within the technical scope disclosed in this application shall fall within the protection scope of this application. Therefore, the protection scope of this application shall be subject to the protection scope of the claims.