Communication method and device
This application relates to a communication method and device. The method includes receiving a first traffic flow and sending the first traffic flow by using at least two QoS flows. The first traffic flow corresponds to an application transmitted by using the at least two QoS flows. For example, different QoS flows may be used to transmit data packets of different importance degrees. In this way, the data packets of different importance degrees can be separately controlled, for example, sending of a more important data packet is preferentially ensured, to improve transmission reliability of these data packets, and ensure service experience of a user.
1 . A communication method, comprising:
receiving a first traffic flow of an application via a single transport layer connection, the first traffic flow corresponding to a first data packet, the receiving of the first traffic flow comprising receiving the first data packet via the transport layer connection; and
sending the first traffic flow by using at least two quality of service (QoS) flows,
the sending of the first traffic flow comprising:
determining a first rule corresponding to the first data packet, wherein the first rule is a QoS rule or a data packet detection rule; and
mapping the first data packet to a QoS flow that is indicated by the first rule and that matches an importance degree of the first data packet for sending, wherein the QoS flow is one of the at least two QoS flows.
2 . The method according to claim 1 , wherein the at least two QoS flows comprise a first QoS flow and a second QoS flow, an importance degree of a data packet transmitted by using the first QoS flow is higher than that of a data packet transmitted by using the second QoS flow, and the first data packet corresponds to one of an I frame, a P0 frame, a P1 frame, or a P2 frame generated by the application.
3 . The method according to claim 2 , wherein the first rule indicates the first QoS flow and the second QoS flow, and the importance degree of the data packet transmitted by using the first QoS flow is higher than that of the data packet transmitted by using the second QoS flow.
4 . The method according to claim 3 , wherein a first field of the first rule indicates the first QoS flow, and a second field of the first rule indicates the second QoS flow.
5 . The method according to claim 1 , wherein
when the first rule is the QoS rule, the QoS rule comprises a first QoS rule and a second QoS rule, wherein the first QoS rule indicates a first QoS flow in the at least two QoS flows, and the second QoS rule indicates a second QoS flow in the at least two QoS flows; or
when the first rule is the data packet detection rule, the data packet detection rule comprises a first data packet detection rule and a second data packet detection rule, wherein the first data packet detection rule indicates a first QoS flow in the at least two QoS flows, and the second data packet detection rule indicates a second QoS flow in the at least two QoS flows.
6 . The method according to claim 1 , wherein the method further comprises:
sending a first request message to a session management function (SMF), wherein the first request message is used to request to determine correlated QoS flows, and the correlated QoS flows are used to transmit a traffic flow corresponding to the application.
7 . The method according to claim 6 , wherein the first request message further indicates a quantity of created one or more QoS flows; and the created one or more QoS flows and at least one established QoS flow are the correlated QoS flows, or the created one or more QoS flows are the correlated QoS flows.
8 . The method according to claim 6 , wherein the method further comprises:
receiving a correlation rule, wherein the correlation rule indicates information about the traffic flow that allows establishment of the correlated QoS flows.
9 . The method according to claim 1 , wherein the method further comprises:
sending first indication information, wherein the first indication information indicates that a terminal device supports correlated QoS flows.
10 . The method according to claim 9 , wherein an uplink non-access stratum (NAS) message comprises request information, and the request information is used to request to establish a session that supports the correlated QoS flows.
11 . The method according to claim 9 , wherein the method further comprises:
determining the first indication information according to a user equipment route selection rule (URSP), wherein the URSP indicates that a session type of the application is supporting the correlated QoS flows.
12 . A non-transitory computer-readable storage medium, wherein the non-transitory computer-readable storage medium is configured to store a computer program, and when the computer program is run on a computer, the computer is enabled to perform the method according to claim 1 .
13 . A chip, comprising one or more processors and a communication interface, wherein the one or more processors are configured to read instructions, to perform the method according to claim 1 .
14 . A communication method, comprising:
receiving a first request message, wherein the first request message comprises information to request to determine correlated quality of service (QoS) flows, and the correlated QoS flows comprise information to transmit a traffic flow of an application via a single transport layer connection; and
creating one or more QoS flows based on the first request message, wherein the created one or more QoS flows and at least one established QoS flow are the correlated QoS flows, or the created one or more QoS flows are the correlated QoS flows.
15 . The method according to claim 14 , wherein the first request message further indicates a quantity of the created one or more QoS flows.
16 . The method according to claim 14 , wherein
the first request message further comprises description information of the created one or more QoS flows; or
the first request message further comprises description information of the created one or more QoS flows, and comprises an identifier of the at least one established QoS flow.
17 . The method according to claim 16 , wherein the description information of the created one or more QoS flows comprises one or more of the following: a 5G quality of service identifier 5QI of the created one or more QoS flows, a guaranteed flow bit rate GFBR of the created one or more QoS flows, a maximum flow bit rate MFBR of the created one or more QoS flows, or an averaging window of the created one or more QoS flows.
18 . The method according to claim 14 , wherein when a quantity of the created one or more QoS flows is greater than 1, the method further comprises:
setting a first rule corresponding to a first QoS flow, and skipping setting a corresponding rule for a second QoS flow, wherein a first field of the first rule indicates the first QoS flow and a second field of the first rule indicates the second QoS flow, the first QoS flow and the second QoS flow belong to the created one or more QoS flows, an importance degree of a data packet transmitted by using the first QoS flow is higher than that of a data packet transmitted by using the second QoS flow, and the first rule is a QoS rule or a data packet detection rule.
19 . The method according to claim 14 , wherein when a quantity of the created one or more QoS flows is 1, the method further comprises:
setting a first rule corresponding to a first QoS flow, and deleting QoS mapping information corresponding to the application from a second rule, wherein the first QoS flow is the created one or more QoS flows, the second rule corresponds to a second QoS flow, the second QoS flow belongs to the at least one established QoS flow, and an importance degree of a data packet transmitted by using the first QoS flow is higher than that of a data packet transmitted by using the second QoS flow; and
the first rule is a first QoS rule, and the second rule is a second QoS rule; or the first rule is a first data packet detection rule, and the second rule is a second data packet detection rule.
20 . A communication device, comprising:
one or more processors;
one or more memories; and
one or more computer programs, wherein the one or more computer programs are stored in the one or more memories, the one or more computer programs comprise instructions; and when the instructions are executed by the one or more processors of the communication device, the communication device, when executing the instructions, is configured to:
receive a first traffic flow of an application via a single transport layer connection, the first traffic flow corresponding to a first data packet, the receiving of the first traffic flow comprising receiving the first data packet via the transport layer connection; and
send the first traffic flow by using at least two quality of service (QoS) flows, the sending of the first traffic flow comprising:
determine a first rule corresponding to the first data packet, wherein the first rule is a QoS rule or a data packet detection rule, and
map the first data packet to a QoS flow that is indicated by the first rule and that matches an importance degree of the first data packet for sending, wherein the QoS flow is one of the at least two QoS flows.