DIRECT LINK-BASED DATA TRANSMISSION METHOD AND APPARATUS, AND TERMINAL
20200374738 ยท 2020-11-26
Inventors
Cpc classification
H04W28/0242
ELECTRICITY
H04W72/0453
ELECTRICITY
International classification
H04W28/02
ELECTRICITY
Abstract
This application provides a direct link-based data transmission method and apparatus, and a terminal, and relates to the field of communications technologies. The method includes: obtaining configuration information that includes at least one carrier identifier and a load threshold corresponding to the at least one carrier identifier; selecting, based on a load capacity of each first transmission carrier and the load threshold corresponding to the first transmission carrier, at least one transmission carrier from all the first transmission carriers as a second transmission carrier, where each first transmission carrier corresponds to one carrier identifier; and transmitting direct link data on the second transmission carrier. In this application, the load threshold is set for the transmission carrier, so that the transmission carrier can be selected based on the load capacity of the transmission carrier and the corresponding load threshold, thereby improving data transmission quality.
Claims
1. A direct link-based data transmission method, wherein the data transmission method comprises: obtaining configuration information, wherein the configuration information comprises at least one carrier identifier and a load threshold corresponding to the at least one carrier identifier; selecting, based on a load capacity of each first transmission carrier corresponding to the at least one carrier identifier and the load threshold, at least one transmission carrier from all the first transmission carriers as a second transmission carrier; and transmitting direct link data on the second transmission carrier.
2. The data transmission method according to claim 1, wherein the selecting, based on the load capacity of each first transmission carrier corresponding to the at least one carrier identifier and the load threshold, the at least one transmission carrier from all the first transmission carriers as the second transmission carrier comprises: selecting at least one third transmission carrier as the second transmission carrier, wherein the at least one third transmission carrier is any transmission carrier of the first transmission carriers whose load capacity is less than or equal to the load threshold.
3. The data transmission method according to claim 2, wherein the selecting the at least one third transmission carrier as the second transmission carrier comprises: sequentially selecting, in ascending order of load capacities, the at least one third transmission carrier as the second transmission carrier; randomly selecting the at least one third transmission carrier as the second transmission carrier; or sequentially selecting, in descending order of load capacities, the at least one third transmission carrier as the second transmission carrier.
4. The data transmission method according to of claim 1, wherein the selecting, based on the load capacity of each first transmission carrier corresponding to the at least one carrier identifier and the load threshold, the at least one transmission carrier from all the first transmission carriers as the second transmission carrier comprises: sequentially selecting, in ascending order of the load capacities, the at least one transmission carrier from all the first transmission carriers as the second transmission carrier; sequentially selecting, in descending order of the load capacities, the at least one transmission carrier from all the first transmission carriers as the second transmission carrier; or randomly selecting the at least one transmission carrier from all the first transmission carriers as the second transmission carrier, wherein the load capacities of all the first transmission carriers are greater than or equal to the load threshold.
5. The data transmission method according to claim 1, wherein the configuration information further comprises a probability threshold corresponding to the at least one carrier identifier, and the selecting, based on the load capacity of each first transmission carrier corresponding to the at least one carrier identifier and the load threshold, the at least one transmission carrier from all the first transmission carriers as the second transmission carrier comprises: selecting at least one fourth transmission carrier as the second transmission carrier, wherein the at least one fourth transmission carrier comprises any of the first transmission carriers whose load capacity is less than or equal to the load threshold, and any of the first transmission carriers whose load capacity is greater than or equal to the load threshold and whose corresponding random number is less than or equal to the probability threshold; or the at least one fourth transmission carrier comprises any of the first transmission carriers whose load capacity is less than or equal to the load threshold, and any of the first transmission carriers whose load capacity is greater than or equal to the corresponding load threshold and whose corresponding random number is greater than or equal to the probability threshold.
6. The data transmission method according to claim 1, wherein the configuration information further comprises a data type identifier corresponding to the at least one carrier identifier; and wherein the selecting, based on the load capacity of each first transmission carrier corresponding to the at least one carrier identifier and the load threshold, the at least one transmission carrier from all the first transmission carriers as the second transmission carrier comprises: selecting, as the second transmission carrier, the at least one transmission carrier from all the first transmission carriers that have a data type identifier corresponding to the direct link data.
7. The data transmission method according to claim 1, wherein the configuration information further comprises transmission resource pool configuration information corresponding to the at least one carrier identifier, the transmission resource pool configuration information comprises location information of a time-frequency resource block, and the load capacity of each first transmission carrier is a load capacity of a transmission resource pool corresponding to the corresponding transmission resource pool configuration information.
8. A direct link-based data transmission apparatus, wherein the data transmission apparatus comprises: an obtaining unit, configured to obtain configuration information, wherein the configuration information comprises at least one carrier identifier and a load threshold corresponding to the at least one carrier identifier; a selection unit, configured to select, based on a load capacity of each first transmission carrier corresponding to the at least one carrier identifier and the load threshold, at least one transmission carrier from all the first transmission carriers as a second transmission carrier; and a transmission unit, configured to transmit direct link data on the second transmission carrier selected by the selection unit.
9. The data transmission apparatus according to claim 8, wherein the selection unit is configured to: select at least one third transmission carrier as the second transmission carrier, wherein the at least one third transmission carrier is any transmission carrier of the first transmission carriers whose load capacity is less than or equal to the load threshold.
10. The data transmission apparatus according to claim 9, wherein the selection unit is configured to: sequentially select, in ascending order of load capacities, the at least one third transmission carrier as the second transmission carrier; randomly select the at least one third transmission carrier as the second transmission carrier; or sequentially select, in descending order of load capacities, the at least one third transmission carrier as the second transmission carrier.
11. The data transmission apparatus according to claim 8, wherein the selection unit is configured to: sequentially select, in ascending order of the load capacities, the at least one transmission carrier from the first transmission carriers as the second transmission carrier; sequentially select, in descending order of the load capacities, the at least one transmission carrier from the first transmission carriers as the second transmission carrier; or randomly select the at least one transmission carrier from the first transmission carriers as the second transmission carrier, wherein the load capacities of all the first transmission carriers are greater than or equal to the load threshold.
12. The data transmission apparatus according to claim 8, wherein the configuration information further comprises a probability threshold corresponding to the at least one carrier identifier, and the selection unit is configured to select at least one fourth transmission carrier as the second transmission carrier, wherein the at least one fourth transmission carrier comprises any of the first transmission carriers whose load capacity is less than or equal to the load threshold, and any of the first transmission carriers whose load capacity is greater than or equal to the load threshold and whose corresponding random number is less than or equal to the probability threshold; or the fourth transmission carrier comprises any of the first transmission carriers whose load capacity is less than or equal to the load threshold, and any of the first transmission carriers whose load capacity is greater than or equal to the load threshold and whose corresponding random number is greater than or equal to the probability threshold.
13. The data transmission apparatus according to claim 8, wherein the configuration information further comprises a data type identifier corresponding to the at least one carrier identifier, and the selection unit is configured to select, as the second transmission carrier, the at least one transmission carrier from all the first transmission carriers that have a data type identifier corresponding to the direct link data.
14. The data transmission apparatus according to claim 8, wherein the configuration information further comprises transmission resource pool configuration information corresponding to the at least one carrier identifier, the transmission resource pool configuration information comprises location information of a time-frequency resource block, and the load capacity of each first transmission carrier is a load capacity of a transmission resource pool corresponding to the corresponding transmission resource pool configuration information.
15. A terminal, wherein the terminal comprises a memory and a processor connected to the memory, the memory is configured to store program code, and when the processor is configured to run or execute the program code stored in the memory, the terminal performs the method according to claim 1.
16. A computer-readable storage medium, wherein the computer-readable storage medium stores an instruction, and when the computer-readable storage medium is run on a computer, the computer is enabled to perform the method according to claim 1.
Description
BRIEF DESCRIPTION OF DRAWINGS
[0031]
[0032]
[0033]
[0034]
[0035]
[0036]
[0037]
DESCRIPTION OF EMBODIMENTS
[0038] To make the objectives, technical solutions, and advantages of this application clearer, the embodiments of this application are described below in further detail with reference to the accompanying drawings.
[0039] In this embodiment of the present invention, A and/or B indicates that there are three cases: A, B, and a combination of A and B.
[0040] An application scenario of an embodiment of the present invention is described below by using a V2V direct communication scenario as an example. This embodiment of the present invention is applicable to a V2V direct communication scenario with network coverage, and is also applicable to a V2V direct communication scenario without network coverage.
[0041]
[0042]
[0043] It should be noted that, although V2V is used as an example in
[0044]
[0045] The processor 21 is a control center of the terminal 20, is connected to all parts of the entire terminal 20 through various interfaces and lines, and performs various functions of the terminal 20 and data processing by running or executing a software program stored in the memory 22 and invoking data stored in the memory 22. In this way, the terminal 20 is monitored as a whole. Optionally, the processor 21 may include one or more processing units. The processing unit may be a CPU (Central Processing Unit, central processing unit), an NP (Network Processor, network processor), or the like.
[0046] The memory 22 may be configured to store various data, for example, various configuration parameters and a computer instruction, and the computer instruction may be executed by the processor 21. The memory 22 may include a high-speed random access memory, and may further include a nonvolatile memory such as at least one magnetic disk or a flash memory, or another volatile solid-state storage device. Correspondingly, the memory 22 may further include a memory controller, to provide the processor 21 with access to the memory 22.
[0047] The communications interface 23 may be a transceiver or a network interface. The transceiver may include a receiver Rx and a transmitter Tx. The transceiver may further be implemented as a communications chip. The communications chip may include a receiving module, a transmitting module, a modulation and demodulation module, or the like, and is configured to: modulate and demodulate information, and receive or send the information by using a radio signal.
[0048] In this embodiment of this application, the processor 21 is configured to receive and send direct link data through the communications interface 23, and is configured to execute the instruction in the memory 22, to implement the steps that need to be performed by the terminal in
[0049] To improve performance of data transmission between terminals in direct communication, an embodiment of the present invention provides a direct link-based data transmission method.
[0050] Step 31: The terminal obtains first configuration information.
[0051] The first configuration information may include at least one carrier identifier and a load threshold corresponding to the at least one carrier identifier.
[0052] Optionally, the carrier identifier and the load threshold may be in a many-to-one relationship, that is, at least two carrier identifiers may correspond to a same load threshold. Alternatively, the carrier identifier and the load threshold may be in a one-to-one relationship, that is, each carrier identifier corresponds to one load threshold, and load thresholds corresponding to different carrier identifiers may be the same or may be different. Certainly, the correspondence between the carrier identifier and the load threshold may alternatively be a combination of a many-to-one relationship and a one-to-one relationship.
[0053] In this embodiment, the first configuration information in step 31 may be configured by a network. For example, the terminal may obtain the first configuration information by receiving a system message or RRC (Radio Resource Control, radio resource control) dedicated signaling sent by a base station. Alternatively, the first configuration information in step 31 may be pre-configured or specified in a protocol. In this case, the terminal may obtain the first configuration information by using pre-configured information or based on the protocol.
[0054] Step 32: The terminal compares a load capacity of each first transmission carrier with a corresponding load threshold, and performs step 33 when there is at least one third transmission carrier (that is, there is at least one first transmission carrier whose load capacity is less than the corresponding load threshold) in all the first transmission carriers; or performs step 34 when load capacities of all the first transmission carriers are greater than or equal to respective corresponding load thresholds.
[0055] Each first transmission carrier corresponds to one carrier identifier in the first configuration information. In other words, the first transmission carriers are all selected from transmission carriers corresponding to all the carrier identifiers in the first configuration information. In an implementation of this embodiment, the transmission carriers corresponding to all the carrier identifiers in the first configuration information are the first transmission carriers. However, in another implementation of this embodiment, the transmission carriers corresponding to some carrier identifiers in the first configuration information are the first transmission carriers. The third transmission carrier is a transmission carrier whose load capacity is less than a corresponding load threshold in the first transmission carriers.
[0056] Correspondingly, in the latter implementation, the method may further include:
[0057] The terminal obtains second configuration information, where the second configuration information includes at least one carrier identifier. The second configuration information may be configured by an upper-layer protocol layer of an access stratum of the terminal, indicating that data of an application needs to be transmitted by using a transmission carrier indicated by the carrier identifier in the second configuration information. The terminal determines the first transmission carriers based on the first configuration information and the second configuration information. For example, the first transmission carrier is a transmission carrier indicated by a same carrier identifier in the carrier identifiers in the first configuration information and the carrier identifiers in the second configuration information. For example, if carrier identifiers included in the first configuration information are F1, F2, and F3, and carrier identifiers included in the second configuration information are F1, F2, and F5, the first transmission carriers include transmission carriers indicated by the carrier identifiers F1 and F2.
[0058] It should be noted that when the first configuration information is obtained from the base station, the second configuration information may also be pre-configured or specified in a protocol.
[0059] Further, step 32 may include:
[0060] calculating the load capacity of each first transmission carrier; and
[0061] comparing, with the corresponding load threshold, the load capacity of the first transmission carrier that is obtained through calculation.
[0062] The load capacity may be a channel congestion level value, a channel congestion percentage, a resource load level value, a resource load percentage, a resource load capacity, or the like. This is not limited herein.
[0063] For example, the load capacity of a single first transmission carrier may be calculated in the following manner: The terminal measures and collects statistics about a total value of transmission resources occupied on the first transmission carrier in a specified time length, or a percentage of the total value of the occupied transmission resources in a value of all transmission resources, and the total value of the occupied transmission resources and/or the ratio are/is used as the load capacity.
[0064] The transmission resource is a time-frequency resource. The terminal may determine whether the time-frequency resource is occupied by performing energy detection on the time-frequency resource. For example, when it is detected that an energy value of a particular time-frequency resource exceeds a specified threshold, it indicates that the time-frequency resource is occupied.
[0065] Optionally, in an implementation of this embodiment of the present invention, the first configuration information may further include transmission resource pool configuration information corresponding to the at least one carrier identifier, and the transmission resource pool configuration information includes location information of a time-frequency resource block. In other words, a transmission resource corresponding to the transmission carrier indicated by the carrier identifier may further be specified in the first configuration information. In this case, the load capacity of the first transmission carrier is a load capacity of a transmission resource pool corresponding to the corresponding transmission resource pool configuration information. For example, for a transmission carrier whose carrier identifier is F1, corresponding transmission resource pool configuration information includes five time-frequency resource blocks, which are respectively F11, F12, F13, F14, and F15, indicating the first to fifth symbols on the transmission carrier, and in this case, the load capacity of the transmission carrier F1 is determined based on occupancy of the five time-frequency resource blocks.
[0066] Optionally, the first configuration information may further include a transmit power parameter corresponding to the load threshold. Correspondingly, step 32 may further include: The terminal compares the load capacity of each first transmission carrier with the corresponding load threshold, and performs step 33 when there is at least one third transmission carrier in all the first transmission carriers and a corresponding transmit power parameter is a dedicated value 1; or performs step 34 when the load capacities of all the first transmission carriers are greater than or equal to respective corresponding load thresholds.
[0067] Optionally, the first configuration information may further include a percentage parameter of resources that can be occupied corresponding to the load threshold. Correspondingly, step 32 may further include: The terminal compares the load capacity of each first transmission carrier with the corresponding load threshold, and performs step 33 when there is at least one third transmission carrier in all the first transmission carriers and a corresponding percentage parameter of resources that can be occupied is a dedicated value 2; or performs step 34 when the load capacities of all the first transmission carriers are greater than or equal to respective corresponding load thresholds.
[0068] Optionally, the first configuration information may further include a maximum available modulation and coding scheme index parameter and a minimum available modulation and coding scheme index parameter that correspond to the load threshold. Correspondingly, step 32 may further include: The terminal compares the load capacity of each first transmission carrier with the corresponding load threshold, and performs step 33 when there is at least one third transmission carrier in all the first transmission carriers and a corresponding maximum modulation and coding scheme index parameter is a dedicated value 3 and/or the maximum modulation and coding scheme index parameter is a dedicated value 4; or performs step 34 when the load capacities of all the first transmission carriers are greater than or equal to respective corresponding load thresholds.
[0069] The foregoing dedicated values 1 to 4 may be obtained through pre-configuration, network configuration, or specification in a protocol.
[0070] Step 33: The terminal selects at least one third transmission carrier from the third transmission carrier as a second transmission carrier.
[0071] The at least one third transmission carrier may be selected from the third transmission carrier in any one of the following manners: sequentially selecting, in ascending order of the load capacities, the at least one third transmission carrier as the second transmission carrier; or randomly selecting the at least one third transmission carrier as the second transmission carrier; or sequentially selecting, in descending order of the load capacities, the at least one third transmission carrier as the second transmission carrier. It should be noted that, in addition to the foregoing manners, the terminal may also select the second transmission carrier from the third transmission carrier according to another rule. This is not limited in this embodiment of the present invention.
[0072] Further, a quantity of second transmission carriers that need to be selected by the terminal may be obtained through network configuration, pre-configuration, or specification in a protocol, and there may be one or more second transmission carriers.
[0073] When K1 second transmission carriers need to be selected, and a quantity of third transmission carriers with a minimum (or maximum) load capacity exceeds K1, K1 third transmission carriers may be randomly selected as the second transmission carriers. Certainly, the second transmission carriers may alternatively be selected according to any rule other than the random selection, and K1 is an integer greater than 1. For example, if one second transmission carrier needs to be selected, and there are three third transmission carriers with a minimum load capacity (for example, the load capacities are all 0.5), one transmission carrier is randomly selected from the three third transmission carriers as the second transmission carrier.
[0074] In addition, it is assumed that there are K1 second transmission carriers that need to be selected by the terminal, and if a quantity N of third transmission carriers is less than K1, the terminal may select only N third transmission carriers as the second transmission carriers; or if the quantity N of third transmission carriers is greater than K1, the terminal may select K1 third transmission carriers as the second transmission carriers in the foregoing manner.
[0075] Step 34: The terminal selects at least one first transmission carrier from all the first transmission carriers as the second transmission carrier according to a specified rule.
[0076] For example, the specified rule may be any one of the following rules:
[0077] sequentially selecting, in ascending order of the load capacities, the at least one first transmission carrier as the second transmission carrier; or randomly selecting the at least one first transmission carrier as the second transmission carrier; or sequentially selecting, in descending order of the load capacities, the at least one first transmission carrier as the second transmission carrier. It should be noted that, in addition to the foregoing manners, the terminal may also select the second transmission carrier according to another rule. This is not limited in this embodiment of the present invention.
[0078] Further, a quantity of second transmission carriers that need to be selected by the terminal may be obtained through network configuration, pre-configuration, or specification in a protocol, and there may be one or more second transmission carriers. The obtaining through network configuration may be that the terminal obtains the second transmission carrier by receiving dedicated control signaling and/or system broadcast information sent by the base station.
[0079] When K2 second transmission carriers need to be selected, and a quantity of first transmission carriers with a minimum (or maximum) load capacity exceeds K2, K2 first transmission carriers may be randomly selected as the second transmission carriers. Certainly, the second transmission carriers may alternatively be selected according to any rule other than the random selection, and K2 is an integer greater than 1. For example, if one second transmission carrier needs to be selected, and there are three third transmission carriers with a maximum load capacity (for example, the load capacities are all 0.9), one transmission carrier is randomly selected from the three third transmission carriers as the second transmission carrier.
[0080] In addition, it is assumed that there are K2 second transmission carriers that need to be selected by the terminal, and if a quantity N of first transmission carriers is less than K2, the terminal may select only N first transmission carriers as the second transmission carriers; or if the quantity N of first transmission carriers is greater than K2, the terminal may select K2 first transmission carriers as the second transmission carriers in the foregoing manner.
[0081] During implementation, K1 may be equal or not equal to K2.
[0082] When the load capacities of all the first transmission carriers are greater than or equal to respective corresponding load thresholds, each terminal selects the second transmission load according to a same rule, so that transmission carriers at different transmit ends in a system converge to several same transmission carriers as much as possible, and therefore the receiving end only needs to simultaneously receive data on the several carriers, thereby reducing a requirement on a receiving capability of the terminal.
[0083] It should be noted that step 32 to step 34 are performed when the terminal is triggered to perform transmission carrier selection. An occasion when the terminal is triggered to perform the transmission carrier selection includes but is not limited to, for example, when the terminal needs to send the direct link data, or when the terminal needs to perform transmission resource selection, or when the terminal needs to perform transmission resource reselection. According to the foregoing step 32 to step 32, the at least one transmission carrier can be selected from the first transmission carriers as the second transmission carrier based on the load capacity of each first transmission carrier and the load threshold corresponding to the first transmission carrier.
[0084] Step 35: The terminal sends the direct link data by using the second transmission carrier.
[0085] The method shown in
TABLE-US-00001 TABLE 1 Carrier identifier Load threshold F1 0.6 F2 0.7 F3 0.5
[0086] In one case, when the terminal is triggered to perform transmission carrier selection, and assuming that load capacities that are of transmission carriers indicated by the carrier identifiers F1, F2, and F3 and that are measured by the terminal are respectively 0.7, 0.4, and 0.3, the load capacities of the transmission carriers indicated by the carrier identifiers F2 and F3 are less than corresponding load thresholds, and the third transmission carriers include the transmission carriers indicated by the carrier identifiers F2 and F3. If the terminal needs to select a third transmission carrier with a minimum load capacity as the second transmission carrier, the terminal may select the transmission carrier indicated by the carrier identifier F3 as the second transmission carrier to transmit the direct link data.
[0087] In another case, when the terminal is triggered to perform transmission carrier selection, and assuming that load capacities that are of transmission carriers indicated by the carrier identifiers F1, F2, and F3 and that are measured by the terminal are respectively 0.7, 0.8, and 0.9, the load capacities of the transmission carriers indicated by all the carrier identifiers are greater than corresponding load thresholds. If the terminal needs to select a first transmission carrier with a minimum load capacity as the second transmission carrier, the terminal may select the transmission carrier indicated by the carrier identifier F1 as the second transmission carrier to transmit the direct link data.
[0088] It should be noted that, in an optional implementation, in this embodiment, the third transmission carrier is a transmission carrier whose load capacity is less than the corresponding load threshold in the first transmission carriers. In another embodiment, the third transmission carrier may alternatively be a transmission carrier whose load capacity is less than or equal to the corresponding load threshold in the first transmission carriers. In this case, correspondingly, step 34 needs to be performed when the load capacities of all the first transmission carriers are greater than respective corresponding load thresholds.
[0089]
[0090] Step 41: The terminal obtains first configuration information.
[0091] The first configuration information may include at least one carrier identifier, and a load threshold and a data type identifier that correspond to the at least one carrier identifier. The data type identifier corresponding to the carrier identifier is used to indicate a type of data that can be transmitted by using the transmission carrier indicated by the carrier identifier, and the load threshold corresponding to the carrier identifier is a corresponding load threshold when the data of the data type is transmitted by using the transmission carrier indicated by the carrier identifier. When subsequently selecting the transmission carrier, the terminal needs to select the transmission carrier for to-be-transmitted direct link data based on a data type identifier corresponding to the to-be-transmitted direct link data. Specifically, the terminal selects the transmission carrier from the transmission carriers that have the data type identifier corresponding to the to-be-transmitted data based on a corresponding load threshold.
[0092] During implementation, the data type identifier may include at least one of the following identifiers: a PPPP (ProSe Per-Packet Priority, near field communication data packet priority) identifier, a QCI (QoS Class Identifier, quality of service class identifier), a service type identifier, a delay identifier, a reliability identifier, and a transmission rate identifier. The service type identifier includes but is not limited to a destination address, an ITS-AID (Intelligent Transport Systems-Application Identifier, intelligent transport systems-application service identifier), a PSID (Provider Service Identifier, provider service identifier), and an AID (Application Identifier, application service identifier).
[0093] Further, each carrier identifier may correspond to one or more types of data type identifiers. In other words, each transmission carrier may be used for transmitting data corresponding to the one or more types of data type identifiers. When one carrier identifier corresponds to one type of data type identifiers, the carrier identifier may further correspond to at least two data type identifiers in the type of data type identifiers. The PPPP identifier is used as an example below for description with reference to Table 2. As shown in Table 2, a PPPP identifier corresponding to a carrier identifier F1 is PPPP 1, PPPP identifiers corresponding to a carrier identifier F2 are PPPP 1 and PPPP 2, and PPPP identifiers corresponding to a carrier identifier F3 are PPPP 1 and PPPP 4. That is, in Table 2, each carrier identifier corresponds to a same type of data type identifier, the carrier identifier F1 corresponds to one PPPP identifier, and the carrier identifiers F2 and F3 each correspond to two PPPP identifiers.
TABLE-US-00002 TABLE 2 Carrier identifier Load threshold PPPP identifier F1 0.6 PPPP 1 F2 0.7 PPPP 1, PPPP 2 F3 0.5 PPPP 1, PPPP 4
[0094] When a PPPP identifier of to-be-transmitted data is PPPP 1, the load threshold used to determine whether to select the transmission carrier F1 is 0.6, the load threshold used to determine whether to select the transmission carrier F2 is 0.7, and the load threshold used to determine whether to select the transmission carrier F3 is 0.5.
[0095] In addition, for a correspondence between the carrier identifier and the load threshold and a manner of obtaining the first configuration information, refer to step 31. Details are not described herein again.
[0096] Step 42: The terminal determines a first transmission carrier based on the data type identifier corresponding to the to-be-transmitted direct link data.
[0097] During implementation, an upper-layer application of the terminal transfers the to-be-sent direct link data and the corresponding data type identifier to the terminal. The terminal can determine, based on a correspondence between a data type identifier and a carrier identifier, the carrier identifier corresponding to the data type identifier, to determine a transmission carrier corresponding to the direct link data. The data type identifier may be included in a primitive corresponding to the direct link data.
[0098] In an implementation, the terminal uses transmission carriers corresponding to all the determined carrier identifiers as the first transmission carriers. In another implementation, the terminal uses transmission carriers corresponding to some carrier identifiers in the determined carrier identifiers as the first transmission carriers.
[0099] Correspondingly, in the latter implementation, the method may further include:
[0100] The terminal obtains second configuration information, and the second configuration information includes at least one carrier identifier and a data type identifier corresponding to the at least one carrier identifier. The second configuration information may be configured by an upper-layer protocol layer of an access stratum of the terminal, indicating that data that is of an application and that corresponds to the data type identifier needs to be transmitted by using a transmission carrier indicated by a carrier identifier corresponding to the data type identifier. The terminal determines the first transmission carriers based on the first configuration information and the second configuration information. For example, the first transmission carrier is a transmission carrier indicated by a same carrier identifier in carrier identifiers that are in the first configuration information and that correspond to the first data type identifiers and in carrier identifiers that are in the second configuration information and that correspond to the first data type identifiers, where the first data type identifier may be a data type identifier of current to-be-transmitted direct link data.
[0101] For example, if carrier identifiers corresponding to the data type identifier PPPP 1 in the first configuration information are F1, F2, and F3, and carrier identifiers corresponding to the data type identifier PPPP 1 in the second configuration information are F1, F2, and F5, the first transmission carrier is a transmission carrier whose carrier identifiers are F1 and F2.
[0102] Step 43: The terminal compares a load capacity of each first transmission carrier with a corresponding load threshold, and performs step 44 when there is at least one third transmission carrier in all the first transmission carriers; or performs step 45 when load capacities of all the first transmission carriers are greater than or equal to respective corresponding load thresholds.
[0103] The third transmission carrier is a transmission carrier whose load capacity is less than a corresponding load threshold in the first transmission carriers.
[0104] Further, for an implementation in which the terminal compares the load capacity of the first transmission carrier with the corresponding load threshold, refer to step 32. Details are not described herein again.
[0105] Step 44: The terminal selects at least one third transmission carrier from the third transmission carrier as a second transmission carrier.
[0106] For an implementation of step 44, refer to step 33. Detailed descriptions are omitted herein.
[0107] Step 45: The terminal selects at least one first transmission carrier from all the first transmission carriers as the second transmission carrier according to a specified rule.
[0108] For an implementation of step 45, refer to step 34. Detailed descriptions are omitted herein.
[0109] According to the foregoing step 42 to step 45, the at least one transmission carrier can be selected from all the first transmission carriers that have a data type identifier corresponding to the direct link data as the second transmission carrier.
[0110] Step 46: The terminal sends the direct link data by using the second transmission carrier.
[0111]
[0112] Step 51: The terminal obtains first configuration information.
[0113] The first configuration information includes at least one carrier identifier, and a load threshold and a probability threshold that correspond to the at least one carrier identifier. In this embodiment, the probability threshold is greater than 0 and less than 1.
[0114] Further, for the correspondence between the carrier identifier and the load threshold, refer to the foregoing step 31. Detailed descriptions are omitted herein. Similarly, the carrier identifier and the probability threshold may be in a many-to-one relationship, that is, probability thresholds corresponding to at least two carrier identifiers may be equal to each other. Alternatively, the carrier identifier and the probability threshold may alternatively be in a one-to-one relationship, that is, each carrier identifier corresponds to one probability threshold, and probability thresholds corresponding to different carrier identifiers may be the same or may be different. Certainly, the correspondence between the carrier identifier and the probability threshold may alternatively be a combination of a many-to-one relationship and a one-to-one relationship.
[0115] Optionally, the first configuration information may further include a data type identifier corresponding to the at least one carrier identifier. For a correspondence between the carrier identifier and the data type identifier and a related description of the data type identifier, refer to the foregoing step 41. Detailed descriptions are omitted herein.
[0116] Step 52: The terminal generates a random number for each first transmission carrier.
[0117] In step 52, for each first transmission carrier, a number may be randomly selected from an interval [0, 1] as a random number corresponding to the first transmission carrier.
[0118] For a manner of determining the first transmission carrier, refer to step 32 or step 42. Detailed descriptions are omitted herein.
[0119] Step 53: The terminal selects at least one fourth transmission carrier from fourth transmission carriers as a second transmission carrier according to a specified rule.
[0120] The fourth transmission carrier includes the first transmission carrier whose load capacity is less than or equal to the corresponding load threshold, and the first transmission carrier whose load capacity is greater than or equal to the corresponding load threshold and whose corresponding random number is less than or equal to the probability threshold; or the fourth transmission carrier includes the first transmission carrier whose load capacity is less than or equal to the corresponding load threshold, and the first transmission carrier whose load capacity is greater than or equal to the corresponding load threshold and whose corresponding random number is greater than or equal to the probability threshold.
[0121] For the specified rule, refer to the rule in which the first transmission carrier is selected from the first transmission carriers as the second transmission carrier in step 33. Details are not described herein again.
[0122] In addition to the first transmission carrier whose load capacity is less than or equal to the corresponding load threshold, the fourth transmission carrier further includes at least a part of first transmission carrier whose load capacity is greater than or equal to the corresponding load threshold, so that a selection range of transmission resources that can be used by the terminal to transmit direct link data can be increased. In this way, a probability that the terminal selects an idle resource to perform data transmission increases, thereby improving transmission performance.
[0123] It should be noted that step 52 and step 53 are performed when the terminal is triggered to perform transmission carrier selection.
[0124] Step 54: The terminal sends the direct link data by using the second transmission carrier.
[0125] An embodiment of the present invention further provides a direct link-based data transmission apparatus. The data transmission apparatus may be implemented as all or a part of the foregoing terminal by using a dedicated hardware circuit or a combination of software and hardware. Referring to
[0126] Optionally, in an implementation, the selection unit 602 is configured to: when there is at least one third transmission carrier in the first transmission carriers, select at least one third transmission carrier from the third transmission carrier as the second transmission carrier, where the third transmission carrier is a transmission carrier whose load capacity is less than or equal to the corresponding load threshold in the first transmission carriers.
[0127] Further, the selection unit 602 is configured to sequentially select, in ascending order of load capacities, the at least one third transmission carrier as the second transmission carrier; or randomly select the at least one third transmission carrier as the second transmission carrier; or sequentially select, in descending order of load capacities, the at least one third transmission carrier as the second transmission carrier.
[0128] Optionally, the selection unit 602 is configured to: when the load capacities of the first transmission carriers are greater than or equal to respective corresponding load thresholds, sequentially select, in ascending order of the load capacities, the at least one transmission carrier from the first transmission carriers as the second transmission carrier; or when the load capacities of the first transmission carriers are greater than or equal to respective corresponding load thresholds, sequentially select, in descending order of the load capacities, the at least one transmission carrier from the first transmission carriers as the second transmission carrier; or when the load capacities of the first transmission carriers are greater than or equal to respective corresponding load thresholds, randomly select the at least one transmission carrier from the first transmission carriers as the second transmission carrier.
[0129] In another implementation, the configuration information further includes a probability threshold corresponding to the at least one carrier identifier. The selection unit 602 is configured to select at least one fourth transmission carrier from all fourth transmission carriers as the second transmission carrier, where the fourth transmission carrier includes the first transmission carrier whose load capacity is less than or equal to the corresponding load threshold, and the first transmission carrier whose load capacity is greater than or equal to the corresponding load threshold and whose corresponding random number is less than or equal to the probability threshold; or the fourth transmission carrier includes the first transmission carrier whose load capacity is less than or equal to the corresponding load threshold, and the first transmission carrier whose load capacity is greater than or equal to the corresponding load threshold and whose corresponding random number is greater than or equal to the probability threshold.
[0130] In still another implementation manner, the configuration information further includes a data type identifier corresponding to the at least one carrier identifier. The selection unit 602 is configured to select the at least one transmission carrier from all the first transmission carriers that have a data type identifier corresponding to the direct link data as the second transmission carrier.
[0131] Optionally, the configuration information further includes transmission resource pool configuration information corresponding to the at least one carrier identifier, the transmission resource pool configuration information includes location information of a time-frequency resource block, and the load capacity of the first transmission carrier is a load capacity of a transmission resource pool corresponding to the corresponding transmission resource pool configuration information.
[0132] For related details, refer to the method embodiments in
[0133] It should be noted that the obtaining unit 601 may be implemented by a processor, or implemented by a processor in combination with a communications interface. The selection unit 602 may be implemented by a processor, or implemented by a processor executing a program instruction in a memory. The transmission unit 603 may be implemented by a communications interface, or implemented by a communications interface in combination with a processor.
[0134] It should be noted that when the data transmission apparatus provided in the foregoing embodiment performs data transmission, division of the foregoing functional modules is merely used as an example for description. In an actual application, the foregoing functions may be allocated to different functional modules for implementation according to a requirement, that is, an internal structure of the device is divided into different functional modules, to implement all or some of the functions described above. In addition, the data transmission apparatus provided in the foregoing embodiments and the data transmission method embodiment pertain to a same concept. For a specific implementation process of the data transmission apparatus, refer to the method embodiments. Details are not repeatedly described herein.
[0135] All or some of the foregoing embodiments may be implemented by using software, hardware, or a combination thereof. When a software program is used to implement the embodiments, all or some of the embodiments may be implemented in a form of a computer program product. The computer program product includes one or more computer instructions. When the computer instructions are loaded and executed on a computer, the procedures or functions according to the embodiments of the present invention are all or partially generated. The computer may be a general-purpose computer, a special-purpose computer, a computer network, or another programmable apparatus. The computer instruction may be stored in a computer-readable storage medium, or transmitted from a computer-readable storage medium to another computer-readable storage medium. For example, the computer instruction may be transmitted from a website, computer, server, or data center to another website, computer, server, or data center in a wired (for example, a coaxial cable, a twisted pair, or an optical fiber) or wireless (for example, infrared or microwave) manner. The computer-readable storage medium may be any usable medium accessible by the computer, or a data storage device, such as a server or a data center, integrating one or more usable media. The usable medium may be a magnetic medium (for example, a floppy disk, a hard disk, or a magnetic tape), an optical medium, a semiconductor medium (for example, a solid-state drive (SSD)), or the like.
[0136] A person of ordinary skill in the art may understand that all or some of the steps of the embodiments may be implemented by hardware or a program instructing related hardware. The program may be stored in a computer-readable storage medium. The storage medium may be a read-only memory, a magnetic disk, or an optical disc.
[0137] The foregoing descriptions are merely optional embodiments of this application, but are not intended to limit this application. Any modification, equivalent replacement, or improvement made without departing from the spirit and principle of this application should fall within the protection scope of this application.