Disclosure of Invention
To solve the problems in the prior art, embodiments of the present invention provide a method and a terminal for selecting transmission resources.
In a first aspect, an embodiment of the present invention provides a method for selecting transmission resources, where the method includes:
acquiring the number of sub-channels required by a service to be sent and occupied time-frequency resources at the current moment;
acquiring a candidate resource set occupied by the sending time of each frame in a time window according to all existing frequency domain resources and the number of the subchannels, wherein the time window is acquired according to the current time;
removing the candidate resource set overlapped with the time frequency resource, and taking the removed candidate resource set as an available sub-channel set;
forming a candidate sending time set by sending times corresponding to the resource number of an available sub-channel set which is more than or equal to x times of the candidate resource number in the candidate resource set, wherein x is a decimal between 0 and 1;
generating a random number according to the candidate sending time set, the time window and a preset rule, and determining the transmission time of the service to be sent according to the random number;
selecting transmission resources occupied by the service to be sent in the available subchannel set according to the transmission time;
the transmission time comprises an initial transmission time and a retransmission time; correspondingly, the generating a random number according to the candidate sending time set, the time window and a preset rule, and determining the transmission time of the service to be sent according to the random number includes:
randomly generating a first random number a in the candidate sending time set T;
generating a second random number b according to the candidate sending time set T, the first random number a, the time window and a preset variable, wherein the second random number b is different from the first random number a;
taking min [ a, b ] as the initial transmission time; let max [ a, b ] be the retransmission time.
In a second aspect, an embodiment of the present invention provides a terminal for selecting transmission resources, where the terminal includes:
the first acquiring unit is used for acquiring the number of the sub-channels required by the service to be sent and occupied time-frequency resources at the current moment;
a second obtaining unit, configured to obtain, according to existing all frequency domain resources and the number of subchannels, a candidate resource set occupied by a sending time of each frame in a time window, where the time window is obtained according to the current time;
the removing unit is used for removing the candidate resource set overlapped with the time frequency resource and taking the removed candidate resource set as an available sub-channel set;
a forming unit, configured to form a candidate sending time set from sending times corresponding to resource numbers of available sub-channel sets that are greater than or equal to x times of the candidate resource number in the candidate resource set, where x is a decimal number between 0 and 1;
a determining unit, configured to generate a random number according to the candidate sending time set, the time window, and a preset rule, and determine a transmission time of the service to be sent according to the random number;
a selecting unit, configured to select, according to the transmission time, a transmission resource occupied by the service to be sent in the available subchannel set;
the transmission time comprises an initial transmission time and a retransmission time; correspondingly, the determining unit is specifically configured to:
randomly generating a first random number a in the candidate sending time set T;
generating a second random number b according to the candidate sending time set T, the first random number a, the time window and a preset variable, wherein the second random number b is different from the first random number a;
taking min [ a, b ] as the initial transmission time; let max [ a, b ] be the retransmission time.
In a third aspect, an embodiment of the present invention provides another terminal for selecting transmission resources, including: a processor, a memory, and a bus, wherein,
the processor and the memory are communicated with each other through the bus;
the memory stores program instructions executable by the processor, the processor invoking the program instructions to perform a method comprising:
acquiring the number of sub-channels required by a service to be sent and occupied time-frequency resources at the current moment;
acquiring a candidate resource set occupied by the sending time of each frame in a time window according to all existing frequency domain resources and the number of the subchannels, wherein the time window is acquired according to the current time;
removing the candidate resource set overlapped with the time frequency resource, and taking the removed candidate resource set as an available sub-channel set;
forming a candidate sending time set by sending times corresponding to the resource number of an available sub-channel set which is more than or equal to x times of the candidate resource number in the candidate resource set, wherein x is a decimal between 0 and 1;
generating a random number according to the candidate sending time set, the time window and a preset rule, and determining the transmission time of the service to be sent according to the random number;
selecting transmission resources occupied by the service to be sent in the available subchannel set according to the transmission time;
the transmission time comprises an initial transmission time and a retransmission time; correspondingly, the generating a random number according to the candidate sending time set, the time window and a preset rule, and determining the transmission time of the service to be sent according to the random number includes:
randomly generating a first random number a in the candidate sending time set T;
generating a second random number b according to the candidate sending time set T, the first random number a, the time window and a preset variable, wherein the second random number b is different from the first random number a;
taking min [ a, b ] as the initial transmission time; let max [ a, b ] be the retransmission time.
In a fourth aspect, an embodiment of the present invention provides a non-transitory computer-readable storage medium, including:
the non-transitory computer readable storage medium stores computer instructions that cause the computer to perform a method comprising:
acquiring the number of sub-channels required by a service to be sent and occupied time-frequency resources at the current moment;
acquiring a candidate resource set occupied by the sending time of each frame in a time window according to all existing frequency domain resources and the number of the subchannels, wherein the time window is acquired according to the current time;
removing the candidate resource set overlapped with the time frequency resource, and taking the removed candidate resource set as an available sub-channel set;
forming a candidate sending time set by sending times corresponding to the resource number of an available sub-channel set which is more than or equal to x times of the candidate resource number in the candidate resource set, wherein x is a decimal between 0 and 1;
generating a random number according to the candidate sending time set, the time window and a preset rule, and determining the transmission time of the service to be sent according to the random number;
selecting transmission resources occupied by the service to be sent in the available subchannel set according to the transmission time;
the transmission time comprises an initial transmission time and a retransmission time; correspondingly, the generating a random number according to the candidate sending time set, the time window and a preset rule, and determining the transmission time of the service to be sent according to the random number includes:
randomly generating a first random number a in the candidate sending time set T;
generating a second random number b according to the candidate sending time set T, the first random number a, the time window and a preset variable, wherein the second random number b is different from the first random number a;
taking min [ a, b ] as the initial transmission time; let max [ a, b ] be the retransmission time.
The method and the terminal for selecting the transmission resources provided by the embodiment of the invention can avoid resource collision caused in the information transmission process, thereby improving the performance of a communication network.
Detailed Description
In order to make the objects, technical solutions and advantages of the embodiments of the present invention clearer, the technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the drawings in the embodiments of the present invention, and it is obvious that the described embodiments are some, but not all, embodiments of the present invention. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present invention.
Fig. 1 is a flowchart illustrating a method for selecting transmission resources according to an embodiment of the present invention, and as shown in fig. 1, a method for selecting transmission resources according to an embodiment of the present invention includes the following steps:
s1: and acquiring the number of sub-channels required by the service to be sent and occupied time-frequency resources at the current moment.
Specifically, the terminal obtains the number of subchannels and occupied time-frequency resources required by the service to be sent at the current moment. The terminal may be a vehicle-mounted terminal, and the service to be sent may be understood as a service sent by the terminal to other vehicle-mounted terminals, and may include information such as a traffic congestion condition of a road section where the terminal travels, whether there is traffic control, and the like, but is not particularly limited. The method for acquiring the number of subchannels required by the service to be transmitted may adopt the following manner: acquiring data quantity to be transmitted of a service to be transmitted (the data quantity to be transmitted is different due to different services to be transmitted), searching the block number of a Physical Resource Block (PRB) required for completing transmission of the data quantity to be transmitted according to a reference Modulation and Coding Scheme (MCS, the MCS takes concerned factors influencing the communication rate as a list column and takes an MCS index as a list row to form a list which can reflect the change condition of the communication rate) and a configured list (the PRB is used for short) and calculating the number of sub-channels required by the service to be transmitted according to the pre-configured number of the PRB blocks in each sub-channel. Examples are as follows: the data amount to be transmitted is Q, transmission of the data amount to be transmitted Q is completed, the total required PRBs is 30, and the number of PRB blocks in each preconfigured subchannel is 8, then the number of calculated subchannels required by the service to be transmitted is 4 (30/8 is rounded up to a value equal to 4), if the required number of subchannels is less than the maximum number of subchannels in the resource pool, the steps of the following embodiment are continuously performed, and if the required number of subchannels is greater than or equal to the maximum number of subchannels in the resource pool, it is further necessary to determine whether all resources in the resource pool can be allocated to the required number of subchannels (for this case, discussion in the embodiment of the present invention is omitted). The occupied time frequency resource can be obtained by sensing and analyzing control information (SCI), and the specific method is not discussed in the embodiment of the invention.
S2: and acquiring a candidate resource set occupied by the sending time of each frame in a time window according to the existing all frequency domain resources and the number of the subchannels, wherein the time window is acquired according to the current time.
Specifically, the terminal obtains a candidate resource set occupied by the sending time of each frame in a time window according to all existing frequency domain resources and the number of the subchannels, wherein the time window is obtained according to the current time. The existing all frequency domain resources may be all frequency domain resources in the resource pool, and the time window may be represented as [ n + T1, n + T2 ], where n is the current time, n + T1 is the start time of the time window, n + T2 is the end time of the time window, and T1 and T2 are configuration parameters of the time window, and T1 and T2 may be set autonomously according to an actual situation, traverse the transmission time of each frame within [ n + T1, n + T2 ], divide all frequency domain resources of each transmission time according to the number of subchannels, and obtain the candidate resource set SM occupied by each transmission time, respectively. It should be noted that: the transmission time of each frame within [ n + T1, n + T2 ] may be converted from a usual "hour: minute: second" representation to a numerical representation, such as: the value converted at the point 01 min 00 s on day 09 of month 10 and 1 in 2016 is 10100, and the value converted at the point 02 min 00 s on day 09 of month 10 and 1 in 2016 is 10120, and the specific conversion method is a general technology and is not described any further. For example: the candidate resource sets occupied by the transmission time with the value of 10100 are m1, m2, m3, m4 and m 5; the candidate resource sets occupied by the transmission time with the value of 10120 are m2, m3, m6, m7, m8 (PRB in each subchannel is 5 blocks).
S3: and eliminating the candidate resource set overlapped with the time frequency resource, and taking the eliminated candidate resource set as an available sub-channel set.
Specifically, the terminal eliminates a candidate resource set overlapped with the time frequency resource, and takes the candidate resource set after elimination as an available sub-channel set. With reference to the above examples: for the transmission time corresponding to the value 10100, if the candidate resources overlapped with the time-frequency resources are m1, m2, m3, then m1, m2, m3 are removed, and m4, m5 are used as the available subchannel sets (the removed candidate resource sets), similarly: for the transmission time with the value of 10120, if the candidate resources overlapped with the time-frequency resources are m2 and m3, m2 and m3 are removed, and then m6, m7 and m8 are used as the available subchannel sets (the removed candidate resource sets).
S4: and forming a candidate sending time set by sending times corresponding to the resource number of the available sub-channel set which is more than or equal to x times of the candidate resource number in the candidate resource set, wherein x is a decimal between 0 and 1.
Specifically, the terminal makes the sending time corresponding to the resource number of the available sub-channel set which is larger than or equal to x times of the candidate resource number in the candidate resource set into a candidate sending time set, wherein x is a decimal number between 0 and 1. x can be set autonomously according to the actual situation, and the above example is referred to continuously: x is 0.5, for the transmission time corresponding to the value 10100, the number of candidate resources in the candidate resource set is 5, the available subchannel set is m4 or m5, the number of resources is 2, and 5 × 0.5 is 2.5, since 2<2.5 (that is, the number of resources in the available subchannel set does not satisfy the condition that x times or more the number of candidate resources in the candidate resource set), the transmission times corresponding to the number of resources in the available subchannel set cannot be formed into the candidate transmission time set; the same principle is that: for the transmission time corresponding to the value 10120, the number of the candidate resources in the candidate resource set is 5, the available subchannel set is m6, m7, m8, the number of the resources is 3, and 5 × 0.5 is 2.5, since 3>2.5 (that is, the number of the resources in the available subchannel set satisfies the condition that x times or more of the number of the candidate resources in the candidate resource set), the transmission times corresponding to the number of the resources in the available subchannel set constitute the candidate transmission time set, and all the transmission times in [ n + T1, n + T2 ] are traversed to obtain the candidate transmission time set.
S5: and generating a random number according to the candidate sending time set, the time window and a preset rule, and determining the transmission time of the service to be sent according to the random number.
Specifically, the terminal generates a random number according to the candidate sending time set, the time window and a preset rule, and determines the transmission time of the service to be sent according to the random number. Examples are as follows: assuming that the candidate transmission time instant set T includes transmission times 10102, 10103, 10109, 10111, 10117, a first random number a (e.g., 10117) is randomly generated in the candidate transmission time instant set T, and a value range is determined according to the following formula:
max[n+T1,a-y],min[n+T2,a+y]
wherein the range of values is represented by values between max [ n + T1, a-y ] and min [ n + T2, a + y ]; n is the current time, n + T1 is the starting time of the time window, n + T2 is the ending time of the time window, and T1 and T2 are configuration parameters of the time window; a is a first random number; y is a preset variable, y can be selected to be 15, the sending time corresponding to n + T1 can be selected to be 10100, and the sending time corresponding to n + T2 can be selected to be 10120; the value range is 10108-10120.
A second random number b (which is different from the first random number a) is randomly generated in the set of candidate transmission moments T (10109, 10111, 10117) within the range of values (10108-10120) (the second random number b may be randomly selected between 10109 and 10111, for example 10109).
Taking min [ a, b ] as the initial transmission time (10109); max [ a, b ] is taken as the retransmission time (10117).
S6: selecting transmission resources occupied by the service to be sent in the available subchannel set according to the transmission time; the transmission time comprises an initial transmission time and a retransmission time; correspondingly, the generating a random number according to the candidate sending time set, the time window and a preset rule, and determining the transmission time of the service to be sent according to the random number includes: randomly generating a first random number a in the candidate sending time set T; generating a second random number b according to the candidate sending time set T, the first random number a, the time window and a preset variable, wherein the second random number b is different from the first random number a; taking min [ a, b ] as the initial transmission time; let max [ a, b ] be the retransmission time.
Specifically, the terminal selects the transmission resource occupied by the service to be sent in the available sub-channel set according to the transmission time; the transmission time comprises an initial transmission time and a retransmission time; correspondingly, the generating a random number according to the candidate sending time set, the time window and a preset rule, and determining the transmission time of the service to be sent according to the random number includes: randomly generating a first random number a in the candidate sending time set T; generating a second random number b according to the candidate sending time set T, the first random number a, the time window and a preset variable, wherein the second random number b is different from the first random number a; taking min [ a, b ] as the initial transmission time; let max [ a, b ] be the retransmission time. The determination of the initial transmission time and the retransmission time may refer to the above embodiments, and will not be described again. The transmission time may include an initial transmission time and a retransmission time, and the transmission resource may include an initial transmission resource and a retransmission resource; retransmission can be understood as retransmission after failure of initial transmission; randomly selecting transmission resources as initial transmission resources occupied by a service to be transmitted in an available sub-channel corresponding to the initial transmission moment; deducting transmission resources used for initial transmission; and randomly selecting residual resources as retransmission resources in the available sub-channels corresponding to the retransmission time, wherein the residual resources are transmission resources in the available sub-channels corresponding to the retransmission time after the resources used for initial transmission are deducted. Examples are as follows: the available sub-channels corresponding to the initial transmission time 10109 are m31, m32, m33, m34 and m 35; m41, m42, m43, m44 and m 45; the transmission resources (initial transmission resources) can be randomly selected to be m31, m32 and m33, and the available sub-channels corresponding to the retransmission time 10117 are m32, m33, m34 and m 35; m41, m42, m 43; the residual resources after deducting the resources (m32, m33) used in the initial transmission are (m34, m 35; m41, m42, m 43; and the retransmission resources can be randomly selected to be m35, m41, m 42.
The method for selecting transmission resources provided by the embodiment of the invention can avoid resource collision caused in the information transmission process, thereby improving the performance of a communication network.
On the basis of the foregoing embodiment, the generating a second random number b according to the candidate sending time set T, the first random number a, the time window, and a preset variable includes:
the numerical range is determined according to the following formula:
max[n+T1,a-y],min[n+T2,a+y];
wherein the range of values is represented by values between max [ n + T1, a-y ] and min [ n + T2, a + y ]; n is the current time, n + T1 is the starting time of the time window, n + T2 is the ending time of the time window, and T1 and T2 are configuration parameters of the time window; a is a first random number; y is a preset variable.
Specifically, the terminal determines the value range according to the following formula:
max[n+T1,a-y],min[n+T2,a+y];
wherein the range of values is represented by values between max [ n + T1, a-y ] and min [ n + T2, a + y ]; n is the current time, n + T1 is the starting time of the time window, n + T2 is the ending time of the time window, and T1 and T2 are configuration parameters of the time window; a is a first random number; y is a preset variable. Reference may be made to the above embodiments, which are not described in detail.
And randomly generating the second random number b in the candidate sending time set T in the numerical range.
Specifically, the terminal randomly generates the second random number b in the candidate sending time set T in the numerical range. Reference may be made to the above embodiments, which are not described in detail.
The method for selecting transmission resources provided by the embodiment of the invention can further avoid resource collision caused in the information transmission process by generating the first random number a and the second random number b, thereby improving the performance of a communication network.
On the basis of the above embodiment, the transmission time includes an initial transmission time and a retransmission time, and the transmission resource includes an initial transmission resource and a retransmission resource; correspondingly, the selecting, according to the transmission time, the transmission resource occupied by the service to be transmitted in the available subchannel set includes:
and randomly selecting transmission resources as the initial transmission resources occupied by the service to be transmitted in the available sub-channels corresponding to the initial transmission time.
Specifically, the terminal randomly selects a transmission resource as an initial transmission resource occupied by the service to be transmitted in an available sub-channel corresponding to the initial transmission time. Reference may be made to the above embodiments, which are not described in detail.
And deducting the transmission resource used for initial transmission.
Specifically, the terminal deducts the transmission resource used for initial transmission. Reference may be made to the above embodiments, which are not described in detail.
And randomly selecting residual resources as retransmission resources in the available sub-channels corresponding to the retransmission time, wherein the residual resources are transmission resources in the available sub-channels corresponding to the retransmission time after the resources used for initial transmission are deducted.
Specifically, the terminal randomly selects a residual resource as a retransmission resource in an available sub-channel corresponding to the retransmission time, where the residual resource is a transmission resource in the available sub-channel corresponding to the retransmission time after deducting the resource used for initial transmission. Reference may be made to the above embodiments, which are not described in detail.
The method for selecting transmission resources provided by the embodiment of the invention can avoid resource collision caused in the process of information retransmission, thereby improving the performance of a communication network.
On the basis of the foregoing embodiment, the removing the candidate resource set overlapped with the time-frequency resource includes:
and taking each sending time as an initial transmission time, and acquiring a reserved time corresponding to the initial transmission time, wherein the reserved time is a time corresponding to information sent by the initial transmission time in a circulating manner.
Specifically, the terminal takes each sending time as an initial sending time, and obtains a reserved time corresponding to the initial sending time, wherein the reserved time is a time corresponding to the information sent by the initial sending time in a circulating manner. Examples are as follows: the initial transmission time is 2016, 10, month, 1 and day 9:00, the information transmitted at the initial transmission time is circularly transmitted every 24 hours, and the reserved time corresponding to the initial transmission time 2016, 10, month, 1 and day 9:00 is 2016, 10, month, 2 and day 9: 00.
And if the candidate resource set occupied by the reserved time is judged and known to be overlapped with the time frequency resource, the overlapped candidate resource set occupied by the reserved time is removed at the initial transmission time corresponding to the reserved time.
Specifically, if the terminal judges that the candidate resource set occupied by the reserved time is overlapped with the time-frequency resource, the overlapped candidate resource set occupied by the reserved time is removed at the initial transmission time corresponding to the reserved time. Referring to the above example, the overlapping candidate resource sets occupied by 2016, month 10, day 2, day 9:00 may be eliminated at the time of the initial delivery of 2016, month 10, day 1, day 9: 00.
According to the method for selecting the transmission resources, the overlapped candidate resource sets occupied by the reserved time are removed at the initial transmission time, so that resource collision caused in the information transmission process can be avoided in advance, and the performance of a communication network is improved.
On the basis of the above embodiment, before the step of obtaining the number of subchannels and occupied time-frequency resources required by the service to be sent at the current time, the method further includes:
and acquiring the data volume to be transmitted of the service to be transmitted.
Specifically, the terminal obtains the amount of data to be transmitted of the service to be transmitted. Reference may be made to the above embodiments, which are not described in detail.
And acquiring the number of physical resource blocks required for finishing the data volume to be transmitted according to a reference modulation and coding strategy and the data volume to be transmitted.
Specifically, the terminal obtains the number of physical resource blocks required for completing the data volume to be transmitted according to a reference modulation and coding strategy and the data volume to be transmitted. Reference may be made to the above embodiments, which are not described in detail.
And calculating the number of the sub-channels required by the service to be sent according to the number of the physical resource blocks in each pre-configured sub-channel.
Specifically, the terminal calculates the number of subchannels required by the service to be sent according to the number of physical resource blocks in each preconfigured subchannel. Reference may be made to the above embodiments, which are not described in detail.
The method for selecting transmission resources provided by the embodiment of the invention can acquire the number of sub-channels required by the service to be sent and occupied time-frequency resources, and ensures the smooth operation of selecting transmission resources.
On the basis of the above embodiment, the method further includes:
and if judging that the resource quantity of the available subchannel set which is more than or equal to x times of the candidate resource quantity of the candidate resource set does not exist, adjusting the data transmission rate in the reference modulation and coding strategy.
Specifically, if the terminal determines that the resource number of the available subchannel set, which is greater than or equal to x times the candidate resource number of the candidate resource set, does not exist, the data transmission rate in the reference modulation and coding strategy is adjusted up. That is, the number of available subchannel sets at each transmission time within the time window [ n + T1, n + T2 ] is smaller than x times the number of candidate resources in the candidate resource set, which indicates that the candidate transmission time set cannot be obtained, and then the data transmission rate in the MCS may be increased to ensure that there is a greater probability of obtaining more available subchannel sets.
And re-executing the step from the step of acquiring the number of the sub-channels required by the service to be sent and the occupied time-frequency resources at the current moment to the step of selecting the transmission resources occupied by the service to be sent in the available sub-channel set according to the transmission moment.
Specifically, the terminal re-executes the step from the step of obtaining the number of subchannels and occupied time-frequency resources required by the service to be sent at the current time to the step of selecting the transmission resources occupied by the service to be sent in the available subchannel set according to the transmission time. The re-execution process is the same and will not be described again.
The method for selecting transmission resources provided by the embodiment of the invention can ensure that more available subchannel sets can be obtained with higher probability by increasing the data transmission rate in the MCS.
Fig. 2 is a schematic structural diagram of a terminal for selecting transmission resources according to an embodiment of the present invention, and as shown in fig. 2, an embodiment of the present invention provides a terminal for selecting transmission resources, which includes a first obtaining unit 1, a second obtaining unit 2, a removing unit 3, a forming unit 4, a determining unit 5, and a selecting unit 6, where:
the first obtaining unit 1 is configured to obtain, at a current time, the number of subchannels and occupied time-frequency resources required by a service to be sent; the second obtaining unit 2 is configured to obtain a candidate resource set occupied by the sending time of each frame in a time window according to all existing frequency domain resources and the number of subchannels, where the time window is obtained according to the current time; the eliminating unit 3 is configured to eliminate a candidate resource set that overlaps with the time-frequency resource, and use the eliminated candidate resource set as an available sub-channel set; the composition unit 4 is configured to compose a candidate sending time set from sending times corresponding to resource numbers of available sub-channel sets that are greater than or equal to x times of the candidate resource number in the candidate resource set, where x is a decimal between 0 and 1; the determining unit 5 is configured to generate a random number according to the candidate sending time set, the time window, and a preset rule, and determine a transmission time of the service to be sent according to the random number; the selecting unit 6 is configured to select, according to the transmission time, a transmission resource occupied by the service to be sent in the available subchannel set; the transmission time comprises an initial transmission time and a retransmission time; correspondingly, the determining unit 5 is specifically configured to: randomly generating a first random number a in the candidate sending time set T; generating a second random number b according to the candidate sending time set T, the first random number a, the time window and a preset variable, wherein the second random number b is different from the first random number a; taking min [ a, b ] as the initial transmission time; let max [ a, b ] be the retransmission time.
Specifically, the first obtaining unit 1 is configured to obtain, at a current time, the number of subchannels and occupied time-frequency resources required by a service to be sent; the second obtaining unit 2 is configured to obtain a candidate resource set occupied by the sending time of each frame in a time window according to all existing frequency domain resources and the number of subchannels, where the time window is obtained according to the current time; the eliminating unit 3 is configured to eliminate a candidate resource set that overlaps with the time-frequency resource, and use the eliminated candidate resource set as an available sub-channel set; the composition unit 4 is configured to compose a candidate sending time set from sending times corresponding to resource numbers of available sub-channel sets that are greater than or equal to x times of the candidate resource number in the candidate resource set, where x is a decimal between 0 and 1; the determining unit 5 is configured to generate a random number according to the candidate sending time set, the time window, and a preset rule, and determine a transmission time of the service to be sent according to the random number; the selecting unit 6 is configured to select, according to the transmission time, a transmission resource occupied by the service to be sent in the available subchannel set; the transmission time comprises an initial transmission time and a retransmission time; correspondingly, the determining unit 5 is specifically configured to: randomly generating a first random number a in the candidate sending time set T; generating a second random number b according to the candidate sending time set T, the first random number a, the time window and a preset variable, wherein the second random number b is different from the first random number a; taking min [ a, b ] as the initial transmission time; let max [ a, b ] be the retransmission time.
The terminal for selecting transmission resources provided by the embodiment of the invention can avoid resource collision caused in the information transmission process, thereby improving the performance of a communication network.
The terminal for selecting transmission resources provided in the embodiments of the present invention may be specifically configured to execute the processing flows of the above-mentioned method embodiments, and its functions are not described herein again, and refer to the detailed description of the above-mentioned method embodiments.
Fig. 3 is a schematic structural diagram of a terminal entity provided in an embodiment of the present invention, and as shown in fig. 3, the terminal includes: a processor (processor)301, a memory (memory)302, and a bus 303;
the processor 301 and the memory 302 complete communication with each other through a bus 303;
the processor 301 is configured to call program instructions in the memory 302 to perform the methods provided by the above-mentioned method embodiments, including: acquiring the number of sub-channels required by a service to be sent and occupied time-frequency resources at the current moment; acquiring a candidate resource set occupied by the sending time of each frame in a time window according to all existing frequency domain resources and the number of the subchannels, wherein the time window is acquired according to the current time; removing the candidate resource set overlapped with the time frequency resource, and taking the removed candidate resource set as an available sub-channel set; forming a candidate sending time set by sending times corresponding to the resource number of an available sub-channel set which is more than or equal to x times of the candidate resource number in the candidate resource set, wherein x is a decimal between 0 and 1; generating a random number according to the candidate sending time set, the time window and a preset rule, and determining the transmission time of the service to be sent according to the random number; selecting transmission resources occupied by the service to be sent in the available subchannel set according to the transmission time; the transmission time comprises an initial transmission time and a retransmission time; correspondingly, the generating a random number according to the candidate sending time set, the time window and a preset rule, and determining the transmission time of the service to be sent according to the random number includes: randomly generating a first random number a in the candidate sending time set T; generating a second random number b according to the candidate sending time set T, the first random number a, the time window and a preset variable, wherein the second random number b is different from the first random number a; taking min [ a, b ] as the initial transmission time; let max [ a, b ] be the retransmission time.
The present embodiment discloses a computer program product comprising a computer program stored on a non-transitory computer readable storage medium, the computer program comprising program instructions which, when executed by a computer, enable the computer to perform the method provided by the above-mentioned method embodiments, for example, comprising: acquiring the number of sub-channels required by a service to be sent and occupied time-frequency resources at the current moment; acquiring a candidate resource set occupied by the sending time of each frame in a time window according to all existing frequency domain resources and the number of the subchannels, wherein the time window is acquired according to the current time; removing the candidate resource set overlapped with the time frequency resource, and taking the removed candidate resource set as an available sub-channel set; forming a candidate sending time set by sending times corresponding to the resource number of an available sub-channel set which is more than or equal to x times of the candidate resource number in the candidate resource set, wherein x is a decimal between 0 and 1; generating a random number according to the candidate sending time set, the time window and a preset rule, and determining the transmission time of the service to be sent according to the random number; selecting transmission resources occupied by the service to be sent in the available subchannel set according to the transmission time; the transmission time comprises an initial transmission time and a retransmission time; correspondingly, the generating a random number according to the candidate sending time set, the time window and a preset rule, and determining the transmission time of the service to be sent according to the random number includes: randomly generating a first random number a in the candidate sending time set T; generating a second random number b according to the candidate sending time set T, the first random number a, the time window and a preset variable, wherein the second random number b is different from the first random number a; taking min [ a, b ] as the initial transmission time; let max [ a, b ] be the retransmission time.
The present embodiments provide a non-transitory computer-readable storage medium storing computer instructions that cause the computer to perform the methods provided by the above method embodiments, for example, including: acquiring the number of sub-channels required by a service to be sent and occupied time-frequency resources at the current moment; acquiring a candidate resource set occupied by the sending time of each frame in a time window according to all existing frequency domain resources and the number of the subchannels, wherein the time window is acquired according to the current time; removing the candidate resource set overlapped with the time frequency resource, and taking the removed candidate resource set as an available sub-channel set; forming a candidate sending time set by sending times corresponding to the resource number of an available sub-channel set which is more than or equal to x times of the candidate resource number in the candidate resource set, wherein x is a decimal between 0 and 1; generating a random number according to the candidate sending time set, the time window and a preset rule, and determining the transmission time of the service to be sent according to the random number; selecting transmission resources occupied by the service to be sent in the available subchannel set according to the transmission time; the transmission time comprises an initial transmission time and a retransmission time; correspondingly, the generating a random number according to the candidate sending time set, the time window and a preset rule, and determining the transmission time of the service to be sent according to the random number includes: randomly generating a first random number a in the candidate sending time set T; generating a second random number b according to the candidate sending time set T, the first random number a, the time window and a preset variable, wherein the second random number b is different from the first random number a; taking min [ a, b ] as the initial transmission time; let max [ a, b ] be the retransmission time.
Those of ordinary skill in the art will understand that: all or part of the steps for implementing the method embodiments may be implemented by hardware related to program instructions, and the program may be stored in a computer readable storage medium, and when executed, the program performs the steps including the method embodiments; and the aforementioned storage medium includes: various media that can store program codes, such as ROM, RAM, magnetic or optical disks.
The above-described embodiments of the terminal and the like are merely illustrative, where the units described as separate parts may or may not be physically separate, and the parts displayed as units may or may not be physical units, may be located in one place, or may be distributed on multiple network units. Some or all of the modules may be selected according to actual needs to achieve the purpose of the solution of the present embodiment. One of ordinary skill in the art can understand and implement it without inventive effort.
Through the above description of the embodiments, those skilled in the art will clearly understand that each embodiment can be implemented by software plus a necessary general hardware platform, and certainly can also be implemented by hardware. With this understanding in mind, the above-described technical solutions may be embodied in the form of a software product, which can be stored in a computer-readable storage medium such as ROM/RAM, magnetic disk, optical disk, etc., and includes instructions for causing a computer device (which may be a personal computer, a server, or a network device, etc.) to execute the methods described in the embodiments or some parts of the embodiments.
Finally, it should be noted that: the above embodiments are only used for illustrating the technical solutions of the embodiments of the present invention, and are not limited thereto; although embodiments of the present invention have been described in detail with reference to the foregoing embodiments, those skilled in the art will understand that: the technical solutions described in the foregoing embodiments may still be modified, or some or all of the technical features may be equivalently replaced; and the modifications or the substitutions do not make the essence of the corresponding technical solutions depart from the scope of the technical solutions of the embodiments of the present invention.