CN106603214B - Data transmission method and device - Google Patents

Data transmission method and device Download PDF

Info

Publication number
CN106603214B
CN106603214B CN201611155069.7A CN201611155069A CN106603214B CN 106603214 B CN106603214 B CN 106603214B CN 201611155069 A CN201611155069 A CN 201611155069A CN 106603214 B CN106603214 B CN 106603214B
Authority
CN
China
Prior art keywords
channel
data
sub
data input
channel unit
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN201611155069.7A
Other languages
Chinese (zh)
Other versions
CN106603214A (en
Inventor
李克华
刘振杰
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Jiangxi Tianli Technology Co.,Ltd.
Original Assignee
BEIJING WIRELESS TIANLI MOBILE INFORMATION TECHNOLOGY Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by BEIJING WIRELESS TIANLI MOBILE INFORMATION TECHNOLOGY Co Ltd filed Critical BEIJING WIRELESS TIANLI MOBILE INFORMATION TECHNOLOGY Co Ltd
Priority to CN201611155069.7A priority Critical patent/CN106603214B/en
Publication of CN106603214A publication Critical patent/CN106603214A/en
Application granted granted Critical
Publication of CN106603214B publication Critical patent/CN106603214B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L5/00Arrangements affording multiple use of the transmission path
    • H04L5/003Arrangements for allocating sub-channels of the transmission path
    • H04L5/0044Arrangements for allocating sub-channels of the transmission path allocation of payload
    • H04L5/0046Determination of how many bits are transmitted on different sub-channels
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L5/00Arrangements affording multiple use of the transmission path
    • H04L5/0001Arrangements for dividing the transmission path

Abstract

The invention relates to a data transmission method and a device, wherein the method comprises the following steps: dividing a data transmission channel into I sub-channels, wherein the number of the sub-channels is the same as that of the data input sources, and the bandwidth of each sub-channel in the I sub-channels is set according to the occupied bandwidth weight value of data input by the data input sources; dividing each subchannel in the I subchannels into K channel units respectively; adding data input by the same data input source into K channel units of a sub-channel corresponding to the data input source according to a first preset sequence for caching; and sequentially outputting data input by different data input sources according to a second preset sequence, wherein K and I are positive integers greater than or equal to 1, and the first preset sequence and the second preset sequence are different sequencing sequences.

Description

Data transmission method and device
Technical Field
The present invention relates to the field of communications technologies, and in particular, to a data transmission method and apparatus.
Background
During data transmission, a first-in first-out sequence is often advocated. However, this first-in first-out approach is not suitable for all data transmission scenarios. For example, both client a and client B need to transmit data over the same data transmission channel. If the client a first issues a request to transmit data in a first-out manner, the client a first starts to occupy the data transmission channel to transmit data. However, the amount of data to be transmitted by the client a is very large, and the time for occupying the transmission channel is too long, so that great trouble is likely to be brought to the client B. How to reasonably arrange the occupation time of the data transmission channel for the client a and the client B and allocate the resources for transmitting data is an urgent technical problem to be solved.
Disclosure of Invention
The technical problem to be solved by the present invention is to provide a data transmission method and apparatus, which enable different clients to simultaneously transmit data at the same time by dynamically allocating bandwidth, thereby avoiding the problem that a certain user occupies a transmission channel for too long time, which results in that other clients cannot occupy the transmission channel to transmit data.
The technical scheme for solving the technical problems is as follows:
in a first aspect, an embodiment of the present invention provides a data transmission method, where the method includes: dividing a data transmission channel into I sub-channels, wherein the number of the sub-channels is the same as that of the data input sources, and the bandwidth of each sub-channel in the I sub-channels is set according to the occupied bandwidth weight value of data input by the data input sources;
dividing each subchannel in the I subchannels into K channel units respectively;
adding data input by the same data input source into K channel units of a sub-channel corresponding to the data input source according to a first preset sequence for caching;
and sequentially outputting data input by different data input sources according to a second preset sequence, wherein K and I are positive integers greater than or equal to 1, and the first preset sequence and the second preset sequence are different sequencing sequences.
The invention has the beneficial effects that: the data transmission channel is divided into I sub-channels, and different sub-channels transmit data input by different data input sources. And through a second predetermined sequence, inputting and outputting different data input sources, so that the data transmission channel can be simultaneously occupied by a plurality of data input parties. And a first-in first-out sequence is not adopted, so that the problem that other data input parties cannot use the data transmission channel at the same time because the data transmission channel is completely occupied by only one data input party is avoided. Moreover, the bandwidth of each sub-channel is set according to the weight of the bandwidth occupied by the data input party, so that the data input party with higher priority can transmit data quickly.
Further, according to different data input sources, adding data input by the same data input source into K channel units of a sub-channel corresponding to the data input source according to a first predetermined sequence, specifically comprising:
determining an ith sub-channel corresponding to the data input source according to the data input source to which the ith piece of data belongs, wherein I is a positive integer which is greater than or equal to 1 and less than or equal to I, and h is a positive integer which is greater than or equal to 2;
when determining that the ith sub-channel has created a variable set corresponding to the ith sub-channel, determining whether the current stored data amount of a kth channel unit storing the h-1 th piece of data is greater than the total stored data amount of the kth channel unit, and adding the h piece of data into the kth channel unit or adding the h piece of data into the k +1 channel unit, wherein the variable set is a parameter set created when the first piece of data of the data input source is added into the ith sub-channel, and the variable set comprises: the position indication information corresponding to the kth channel unit, the current storage data volume of the kth channel unit, the total storage data volume of the kth channel unit and the total storage data volume of the ith sub-channel, wherein K is a positive integer which is greater than or equal to 1 and less than or equal to K.
The beneficial technical effect of adopting the further scheme is that the sub-channels are divided into different channel units, and the data input by the data input source are sequentially added into the channel units according to the first preset sequence. Before joining, first, it is determined whether the current channel unit has reached a predetermined amount of storage, and if the channel unit is "full", it is joined to the next channel unit. Meanwhile, the total storage capacity of the sub-channel needs to be judged, and data input by the data input end is prevented from being accumulated in the sub-channel as much as possible.
Further, determining that the h-th data is added to the k-th channel unit or the h-th data is added to the (k + 1) -th channel unit according to whether the current stored data amount of the k-th channel unit storing the h-1-th data is larger than the total stored data amount of the k-th channel unit, specifically comprising:
when the current storage data volume of the kth channel unit is smaller than the total storage data volume of the kth channel unit, adding the kth data into the kth channel unit, and adding 1 to the total storage data volume value of the ith sub-channel;
and when the current storage data volume of the kth channel unit is larger than or equal to the total storage data volume of the kth channel unit, adding the kth data into the (k + 1) th channel unit, and adding 1 to the total storage data volume value of the ith sub-channel.
The beneficial technical effect of adopting the further technical scheme is that by the above mode, the data input by the input source can be added to each channel unit in turn, and only after the previous channel unit is full of data, the next channel unit can be used for storing data.
Further, before adding the h-th data to the (k + 1) -th channel unit, the method further includes: determining whether the total storage data volume of the (k + 1) th channel unit is zero or not, wherein the total storage data volume of the channel unit is obtained by calculation according to the occupied bandwidth weight value of data input by a data input source corresponding to the sub-channel to which the channel unit belongs;
when the total storage data amount of the (k + 1) th channel unit is determined to be not zero, adding the h-th data into the (k + 1) th channel unit;
and when the total stored data volume of the (k + 1) th channel unit is zero, adding the h-th data into the first channel unit with the non-zero total stored data volume after the (k + 1) th channel unit.
The beneficial technical effect of adopting the further technical scheme is that the total storage data volume of each channel unit is obtained by calculation according to the weight value of the bandwidth occupied by the input data of the data input source corresponding to the sub-channel to which the channel unit belongs. Therefore, the total stored data amount of the channel unit is likely to be 0, and even if the channel unit is likely to be unable to store data, the total stored data amount of other channel units after the channel unit needs to be calculated continuously until the channel unit with the first total stored data amount after the channel unit being not zero is obtained according to the calculation, and the h-th piece of data is added into the channel unit.
Further, according to different data input sources, adding data input by the same data input source into K channel units of a sub-channel corresponding to the data input source according to a first predetermined order, specifically including:
determining an ith sub-channel corresponding to the data input source according to the data input source to which the ith piece of data belongs, wherein I is a positive integer which is greater than or equal to 1 and less than or equal to I;
when the ith sub-channel is determined not to create the corresponding variable set, creating the variable set corresponding to the ith sub-channel;
determining a channel unit with a first total storage data amount not being zero in the ith sub-channel;
and storing the h-th data to a channel unit with a first total stored data volume not equal to zero in the ith sub-channel, wherein the total stored data volume of the channel unit is obtained by calculation according to the occupied bandwidth weight value of the data input by the data input source corresponding to the sub-channel to which the channel unit belongs, and the value of h is 1.
The beneficial technical effect of adopting the further technical scheme is that when the ith sub-channel is judged not to have created the corresponding variable set, a variable set needs to be created for storing the parameter information related to the data input by the corresponding data input source. And storing the h-th data to a channel unit with the first total stored data amount not being zero in the i-th sub-channel, wherein the value of h is 1. That is, when the first piece of data is added to the ith sub-channel, a set of variables corresponding to the channel needs to be created.
Further, outputting the data input by the different data input sources in sequence according to a second predetermined sequence, specifically comprising:
sequentially outputting the data in the (n-1) th channel unit of each subchannel in the I subchannels according to a second preset sequence;
and after the data in the nth-1 channel unit of each sub-channel in the I sub-channels are completely output, sequentially outputting the data in the nth channel unit of each sub-channel in the I sub-channels according to a second preset sequence, wherein n is a positive integer greater than or equal to 2, and the initial value of n is 2.
The technical effect of the further technical scheme is that in the data output process, the data of other channels are output after all the data of the same sub-channel are output, but each channel sequentially outputs the data according to a preset sequence. Of course, in the output process, if the current fixed output position of a certain channel has no data output, the data at the same position of the next channel is ignored and output.
Further, when all data in any sub-channel of the I sub-channels are completely output, all parameters in the variable set corresponding to the sub-channel with all data output are initialized.
The beneficial technical effect of adopting the further technical scheme is that when all data of the current input source in the sub-channel are completely output, all parameters of the variable set are initialized. So that other subsequent data input sources may input data using the channel. And, according to the weight of the occupied bandwidth of the input data, the bandwidth of the subchannel is reset.
In a second aspect, an embodiment of the present invention provides a data transmission apparatus, where the apparatus includes: the processing unit is used for dividing the data transmission channel into I sub-channels, wherein the number of the sub-channels is the same as that of the data input sources, and the bandwidth of each sub-channel in the I sub-channels is set according to the occupied bandwidth weight value of the data input by the data input sources;
dividing each subchannel in the I subchannels into K channel units respectively;
the processing unit is used for adding data input by the same data input source into K channel units of a sub-channel corresponding to the data input source according to a first preset sequence for caching;
and sequentially outputting data input by different data input sources according to a second preset sequence, wherein K and I are positive integers which are greater than or equal to 1, and the first preset sequence and the second preset sequence are different sequencing sequences.
The beneficial technical effect of the scheme is that the data transmission channel is divided into I sub-channels, and different sub-channels transmit data input by different data input sources. And inputting and outputting the input and output of different data input sources through a second predetermined sequence, so that the data transmission channel can be simultaneously occupied by a plurality of data input parties. And a first-in first-out sequence is not adopted, so that the problem that other data input parties cannot use the data transmission channel at the same time because the data transmission channel is completely occupied by only one data input party is avoided. Moreover, the bandwidth of each sub-channel is set according to the weight of the bandwidth occupied by the data input party, so that the data input party with higher priority can transmit data quickly.
Further, the processing unit is specifically configured to: determining an ith sub-channel corresponding to the data input source according to the data input source to which the ith piece of data belongs, wherein I is a positive integer which is greater than or equal to 1 and less than or equal to I, and h is a positive integer which is greater than or equal to 2;
when determining that the ith sub-channel has created a variable set corresponding to the ith sub-channel, determining whether the current stored data amount of a kth channel unit storing the h-1 th piece of data is greater than the total stored data amount of the kth channel unit, and adding the h piece of data into the kth channel unit or adding the h piece of data into the k +1 channel unit, wherein the variable set is a parameter set created when the first piece of data of the data input source is added into the ith sub-channel, and the variable set comprises: the position indication information corresponding to the kth channel unit, the current storage data volume of the kth channel unit, the total storage data volume of the kth channel unit and the total storage data volume of the ith sub-channel, wherein K is a positive integer which is greater than or equal to 1 and less than or equal to K.
The beneficial technical effect of adopting the further scheme is that the sub-channels are divided into different channel units, and the data input by the data input source are sequentially added into the channel units according to the first preset sequence. Before joining, first, it is determined whether the current channel unit has reached a predetermined amount of storage, and if the channel unit is "full", it is joined to the next channel unit. Meanwhile, the total storage capacity of the sub-channel needs to be judged, and data input by the data input end is prevented from being accumulated in the sub-channel as much as possible.
Further, the processing unit is specifically configured to: when the current storage data volume of the kth channel unit is smaller than the total storage data volume of the kth channel unit, adding the kth data into the kth channel unit, and adding 1 to the total storage data volume value of the ith sub-channel;
and when the current storage data volume of the kth channel unit is larger than or equal to the total storage data volume of the kth channel unit, adding the kth data into the (k + 1) th channel unit, and adding 1 to the total storage data volume value of the ith sub-channel.
The beneficial technical effect of adopting the further technical scheme is that by the above mode, the data input by the input source can be added to each channel unit in turn, and only after the previous channel unit is full of data, the next channel unit can be used for storing data.
Further, the processing unit is further configured to determine whether a total stored data volume of the (k + 1) th channel unit is zero, where the total stored data volume of the channel unit is obtained by calculation according to an occupied bandwidth weight value of data input by a data input source corresponding to a sub-channel to which the channel unit belongs;
when the total storage data amount of the (k + 1) th channel unit is determined to be not zero, adding the h-th data into the (k + 1) th channel unit;
and when the total stored data volume of the (k + 1) th channel unit is zero, adding the h-th data into the first channel unit with the non-zero total stored data volume after the (k + 1) th channel unit.
The beneficial technical effect of adopting the above further technical scheme is that the total stored data volume of each channel unit needs to be calculated and obtained according to the weight value of the bandwidth occupied by the input data of the data input source corresponding to the sub-channel to which the channel unit belongs. Therefore, the total stored data amount of the channel unit is likely to be 0, and even if the channel unit is likely to be unable to store data, the total stored data amount of other channel units after the channel unit needs to be calculated continuously until the channel unit with the first total stored data amount after the channel unit being not zero is obtained according to the calculation, and the h-th piece of data is added into the channel unit.
Further, the processing unit is specifically configured to: determining an ith sub-channel corresponding to the data input source according to the data input source to which the ith piece of data belongs, wherein I is a positive integer which is greater than or equal to 1 and less than or equal to I;
when the ith sub-channel is determined not to create the corresponding variable set, creating the variable set corresponding to the ith sub-channel;
determining a channel unit with a first total storage data amount not being zero in the ith sub-channel;
and storing the h-th data to a channel unit with a first total stored data volume not equal to zero in the ith sub-channel, wherein the total stored data volume of the channel unit is obtained by calculation according to the occupied bandwidth weight value of the data input by the data input source corresponding to the sub-channel to which the channel unit belongs, and the value of h is 1.
The beneficial technical effect of adopting the above further technical solution is that when it is judged that the corresponding variable set has not been created for the ith sub-channel, a variable set needs to be created for storing parameter information related to data input by the corresponding data input source. And storing the h-th data to a channel unit with the first total stored data amount not being zero in the i-th sub-channel, wherein the value of h is 1. That is, when the first piece of data is added to the ith sub-channel, a set of variables corresponding to the channel needs to be created.
Further, the output unit is specifically configured to: sequentially outputting the data in the (n-1) th channel unit of each subchannel in the I subchannels according to a second preset sequence;
and after the data in the nth-1 channel unit of each sub-channel in the I sub-channels are completely output, sequentially outputting the data in the nth channel unit of each sub-channel in the I sub-channels according to a second preset sequence, wherein n is a positive integer greater than or equal to 1, and the initial value of n is 2.
The beneficial technical effect of adopting the further technical scheme is that in the data output process, the data of other channels are output after all the data of the same sub-channel are output, but each channel outputs the data in turn according to the second predetermined sequence. Of course, in the output process, if the current fixed output position of a certain channel has no data output, the data at the same position of the next channel is ignored and output.
Further, the processing unit is further configured to initialize all parameters in the variable set corresponding to the sub-channel with all output data when all output data in any one of the I sub-channels is completed.
The beneficial technical effect of adopting the further technical scheme is that when all data of the current input source in the sub-channel are completely output, all parameters of the variable set are initialized. So that other subsequent data input sources may input data using the channel. And, according to the weight of the occupied bandwidth of the input data, the bandwidth of the subchannel is reset.
Drawings
Fig. 1 is a schematic flow chart of a data transmission method according to an embodiment of the present invention;
FIG. 2 is a schematic diagram of data from different data input sources being sequentially added to sub-channels corresponding to the data input sources;
fig. 3 is a schematic structural diagram of a data transmission device according to an embodiment of the present invention.
Detailed Description
In the following description, for purposes of explanation and not limitation, specific details are set forth such as the particular system architecture, interfaces, techniques, etc., in order to provide a thorough understanding of the present invention. It will be apparent, however, to one skilled in the art that the present invention may be practiced in other embodiments that depart from these specific details. In other instances, detailed descriptions of well-known devices, circuits, and methods are omitted so as not to obscure the description of the present invention with unnecessary detail.
Fig. 1 is a schematic flowchart of a data transmission method according to an embodiment of the present invention.
As shown in fig. 1, the method includes:
step 110, the data transmission channel is divided into I subchannels.
Specifically, in order to enable different data input parties to transmit data required to be transmitted when needed, and not to queue the data, according to a first-in first-out mode, the data can be transmitted only when the data input party applying for occupying a data transmission channel at first finishes transmission. Therefore, the data transmission channel may be divided into I subchannels. The number of the I sub-channels is the same as that of the data input sources, the bandwidth of each sub-channel in the I sub-channels is set according to the occupied bandwidth weight value q of the data input by the data input sources, and I is a positive integer greater than or equal to 1.
It should be noted that the number of sub-channels is not fixed, but can be changed according to the need at any time. For example, if there is a data input party that has already transmitted data, the occupied channel can also be released, and if there is no data input party that needs to transmit data, the sub-channel divided by the data transmission channel is automatically reduced by 1, and then the channel bandwidth is reallocated. Or, a new data input party needs to be added to transmit data currently. The bandwidth of the sub-channel is still set according to the occupied bandwidth weight value q of the data input by the data input source.
Step 120, each of the I subchannels is divided into K channel units, respectively.
Specifically, each of the I subchannels is divided into K channel elements. When data is added to the sub-channel, the data can be stored in the next channel unit again by taking the channel unit as a unit until the data stored in each channel unit reaches the limit. Wherein K is a positive integer greater than or equal to 1.
Step 130, adding the data input by the same data input source into K channel units of the sub-channel corresponding to the data input source according to a first predetermined sequence for buffering.
Specifically, the first predetermined order here may be a first-in first-out order. That is, the data is added to the sub-channels corresponding to the data input sources in sequence according to the sequence of the data input sources outputting the data. Different data input sources correspond to different sub-channels. And each sub-channel only stores the data input by the data input source corresponding to the sub-channel currently. The data is stored in K channel elements.
And determining the corresponding sub-channel according to the data input source of the data to be stored at present. For example, the currently stored data is the h-th data, and the subchannel corresponding to the data input source to which the h-th data belongs is the ith subchannel. Then the h-th piece of data is input into the i-th sub-channel. And specifically to which channel element in the ith sub-channel, further determination is required.
The specific process can comprise the following steps:
in one case, when it is determined that the ith sub-channel has created a variable set corresponding to the ith sub-channel, it is determined whether the h-th data is added to the k-th channel unit or the h-th data is added to the k +1 channel units according to whether a current stored data amount of a k-th channel unit storing the h-1-th data is greater than a total stored data amount of the k-th channel unit, wherein the variable set is a parameter set created when the first piece of data of the data input source is added to the ith sub-channel. And the set of variables may include at least the following parameters: the position indication information corresponding to the kth channel element, the current storage data volume of the kth channel element, the total storage data volume of the kth channel element, and the total storage data volume of the ith sub-channel, wherein I is a positive integer greater than or equal to 1 and less than or equal to I, and h is a positive integer greater than or equal to 2. K is a positive integer greater than or equal to 1 and less than or equal to K.
And determining that the h-th data is added to the k-th channel unit or the h-th data is added to the (k + 1) -th channel unit according to whether the current stored data amount of the k-th channel unit storing the h-1-th data is larger than the total stored data amount of the k-th channel unit, specifically comprising:
and when the current storage data volume of the kth channel unit is smaller than the total storage data volume of the kth channel unit, adding the h piece of data into the kth channel unit, and adding 1 to the total storage data volume value of the ith sub-channel.
Or, when the current storage data amount of the kth channel unit is greater than or equal to the total storage data amount of the kth channel unit, adding the h piece of data into the (k + 1) th channel unit, and adding 1 to the total storage data amount value of the ith sub-channel.
It is further preferred that the weighting of the bandwidth occupied by the input data at the input side is set by human. In many cases, the channel bandwidth occupied by different data input parties that have been allocated before is set, for example, according to the data input by the data input parties with different levels, or the number of data input parties that currently input data is too large. But it takes a lot of time and effort if readjusted. Then, the occupied bandwidth can be reduced when the data input side with low priority level transmits data through another mode. The method is that when the channel occupied by the data input side with lower priority level transmits data, part of the channel units in the sub-channel do not store data. I.e. the total amount of data stored is zero. Therefore, before the total stored data amount of the kth channel unit is "full" and the h-th data is added to the (k + 1) th channel unit, it is first determined whether the total stored data amount of the (k + 1) th channel unit is zero. The total storage data volume of the channel unit is obtained by calculation according to the occupied bandwidth weight value of the data input by the data input source corresponding to the sub-channel to which the channel unit belongs. Therefore, the formula for specifically calculating the total stored data amount of the (k + 1) th channel unit is as follows:
wik+1=int(norm(qi))
wherein, wik+1The total amount of data stored in the kth channel unit of the (k + 1) th sub-channel; norm (q)i) To return to being q on averageiIs too distributed.
And adding the h-th data into the (k + 1) -th channel unit when the total stored data amount of the (k + 1) -th channel unit is determined not to be zero. Or, when the total stored data amount of the (k + 1) th channel unit is zero, adding the h-th data to the first channel unit with the non-zero total stored data amount after the (k + 1) th channel unit.
In another case, the subchannel has the input party joining data for the first time. Then it may be determined that the subchannel has not created a set of variables corresponding thereto. That is, after the ith sub-channel corresponding to the data input source is determined according to the data input source to which the h-th piece of data belongs, it may be determined that the ith sub-channel does not create the corresponding variable set. Therefore, it is necessary to create a variable set corresponding to the ith sub-channel, determine a channel unit with a first total stored data amount not zero in the ith sub-channel, and store the h-th piece of data to the channel unit with the first total stored data amount not zero in the ith sub-channel. And the value of h at this time is actually 1. And I is also a positive integer greater than or equal to 1 and less than or equal to I. The formula for calculating the total stored data amount of the channel unit is introduced above, and is not described herein again.
And 140, sequentially outputting the data input by different data input sources according to a second preset sequence.
Specifically, sequentially outputting the data input by the different data input sources according to the second predetermined order may specifically include: and sequentially outputting the data in the Kth channel unit of each subchannel in the I subchannels according to a second preset sequence. And after the data in the nth-1 channel unit of each sub-channel in the I sub-channels are completely output, sequentially outputting the data in the nth channel unit of each sub-channel in the I sub-channels according to a second preset sequence, wherein n is a positive integer greater than or equal to 2, and the initial value of n is 2. Specifically, as shown in fig. 2, fig. 2 is a schematic diagram illustrating that data of different data input sources are sequentially added to a sub-channel corresponding to the data input source. Each subchannel is divided into a plurality of channel units (for example, 1-K + 1-n-K channel units in fig. 2), because when data is output, data of the same channel unit of different subchannels is sequentially output according to a second predetermined order, that is, the 1 st column of data in fig. 2 is preferentially output according to the second predetermined order (a column of data is output completely, it can be understood that a round of data output is completed), then the 2 nd column of data is output according to the second predetermined order, … …, the n-1 th column of data is output according to the second predetermined order, the n nth column of data is output according to the second predetermined order, and so on. And the second predetermined order may be upside down right or bottom up, which is not limited herein. The output is from top to bottom in fig. 2.
And when all data in any sub-channel of the I sub-channels are output, the method further comprises the following steps: and 150, initializing all parameters in the variable set corresponding to the sub-channel with all data output.
Only after initialization, the sub-channel can continue to transmit data that the channel data input needs to transmit. Moreover, the system memory occupied by the variable set can be reduced by initializing the variable set. The workload of the system is reduced, and the working efficiency is further improved.
In the data transmission method provided in this embodiment, a data transmission channel is divided into I sub-channels, and different sub-channels transmit data input by different data input sources. And through a second predetermined sequence, inputting and outputting different data input sources, so that the data transmission channel can be simultaneously occupied by a plurality of data input parties. And a first-in first-out sequence is not adopted, so that the problem that other data input parties cannot use the data transmission channel at the same time because the data transmission channel is completely occupied by only one data input party is avoided. Moreover, the bandwidth of each sub-channel is set according to the weight of the bandwidth occupied by the data input party, so that the data input party with higher priority can transmit data quickly.
Correspondingly, the embodiment of the invention also provides a data transmission device. Fig. 3 is a schematic structural diagram of a data transmission device according to an embodiment of the present invention. As shown in fig. 3 in detail, the apparatus includes: a processing unit 301 and an output unit 302.
The processing unit 301 is configured to divide the data transmission channel into I sub-channels, where the number of the sub-channels is the same as the number of the data input sources, and a bandwidth of each sub-channel in the I sub-channels is set according to an occupied bandwidth weight value of data input by the data input source; dividing each subchannel in the I subchannels into K channel units respectively; and adding the data input by the same data input source into K channel units of the sub-channel corresponding to the data input source according to a first preset sequence for caching.
The output unit 302 is configured to output data input by different data input sources sequentially according to a second predetermined order, where K and I are positive integers greater than or equal to 1, and the first predetermined order and the second predetermined order are different sorting orders.
In one case, the processing unit 301 is specifically configured to determine, according to a data input source to which an h-th piece of data belongs, an I-th sub-channel corresponding to the data input source, where I is a positive integer greater than or equal to 1 and less than or equal to I, and h is a positive integer greater than or equal to 2;
when determining that the ith sub-channel has created a variable set corresponding to the ith sub-channel, determining whether the current stored data amount of a kth channel unit storing the h-1 th piece of data is greater than the total stored data amount of the kth channel unit, and adding the h piece of data into the kth channel unit or adding the h piece of data into the k +1 channel unit, wherein the variable set is a parameter set created when the first piece of data of the data input source is added into the ith sub-channel, and the variable set comprises: the position indication information corresponding to the kth channel unit, the current storage data volume of the kth channel unit, the total storage data volume of the kth channel unit and the total storage data volume of the ith sub-channel, wherein K is a positive integer which is greater than or equal to 1 and less than or equal to K.
Specifically, when the current storage data volume of the kth channel unit is smaller than the total storage data volume of the kth channel unit, the h piece of data is added to the kth channel unit, and the total storage data volume value of the ith sub-channel is added by 1;
and when the current storage data volume of the kth channel unit is larger than or equal to the total storage data volume of the kth channel unit, adding the kth data into the (k + 1) th channel unit, and adding 1 to the total storage data volume value of the ith sub-channel.
It is further preferred that the weighting of the bandwidth occupied by the input data at the input side is set by human. In many cases, the channel bandwidth occupied by different data input parties that have been allocated before is set, for example, according to the data input by the data input parties with different levels, or the number of data input parties that currently input data is too large. But it takes a lot of time and effort if readjusted. Then, the processing unit 301 is further configured to determine whether a total stored data amount of the (k + 1) th channel unit is zero, where the total stored data amount of the channel unit is obtained by calculating an occupied bandwidth weight value of data input by a data input source corresponding to the sub-channel to which the channel unit belongs.
When the total storage data amount of the (k + 1) th channel unit is determined to be not zero, adding the h-th data into the (k + 1) th channel unit; and when the total stored data volume of the (k + 1) th channel unit is zero, adding the h-th data into the first channel unit with the non-zero total stored data volume after the (k + 1) th channel unit.
In another case, the processing unit 301 is specifically configured to: when the ith sub-channel is determined not to create the corresponding variable set, creating the variable set corresponding to the ith sub-channel; determining a channel unit with a first total storage data amount not being zero in the ith sub-channel; and storing the h-th data to a channel unit with the first total stored data quantity not being zero in the ith sub-channel, wherein the value of h is 1.
The output unit 302 is specifically configured to sequentially output data in the (n-1) th channel unit of each of the I subchannels according to a second predetermined order; and after the data in the nth-1 channel unit of each sub-channel in the I sub-channels are completely output, sequentially outputting the data in the nth channel unit of each sub-channel in the I sub-channels according to a second preset sequence, wherein n is a positive integer greater than or equal to 2, and the initial value of n is 2.
The functions performed by the components of the apparatus have been described in detail in the data transmission method in the above embodiment, and are not described again here.
The data transmission device provided by the embodiment of the invention divides the data transmission channel into I sub-channels, and different sub-channels transmit data input by different data input sources. And inputting and outputting the input and output of different data input sources through a second predetermined sequence, so that the data transmission channel can be simultaneously occupied by a plurality of data input parties. And a first-in first-out sequence is not adopted, so that the problem that other data input parties cannot use the data transmission channel at the same time because the data transmission channel is completely occupied by only one data input party is avoided. Moreover, the bandwidth of each sub-channel is set according to the weight of the bandwidth occupied by the data input party, so that the data input party with higher priority can transmit data quickly.
The reader should understand that in the description of this specification, reference to the description of the terms "one embodiment," "some embodiments," "an example," "a specific example," or "some examples," etc., means that a particular feature, structure, material, or characteristic described in connection with the embodiment or example is included in at least one embodiment or example of the invention. In this specification, the schematic representations of the terms used above are not necessarily intended to refer to the same embodiment or example. Furthermore, the particular features, structures, materials, or characteristics described may be combined in any suitable manner in any one or more embodiments or examples. Furthermore, various embodiments or examples and features of different embodiments or examples described in this specification can be combined and combined by one skilled in the art without contradiction.
Although embodiments of the present invention have been shown and described above, it is understood that the above embodiments are exemplary and should not be construed as limiting the present invention, and that variations, modifications, substitutions and alterations can be made to the above embodiments by those of ordinary skill in the art within the scope of the present invention.

Claims (8)

1. A method of data transmission, the method comprising:
dividing a data transmission channel into I sub-channels, wherein the number of the sub-channels is the same as that of data input sources, and the bandwidth of each sub-channel in the I sub-channels is set according to the occupied bandwidth weight value of data input by the data input sources;
dividing each subchannel in the I subchannels into K channel units respectively;
according to different data input sources, adding data input by the same data input source into K channel units of a sub-channel corresponding to the data input source according to a first preset sequence for caching;
sequentially outputting the data in the (n-1) th channel unit of each subchannel in the I subchannels according to a second preset sequence;
after all the data in the nth-1 channel unit of each sub-channel in the I sub-channels are output, sequentially outputting the data in the nth channel unit of each sub-channel in the I sub-channels according to a second preset sequence, wherein n is a positive integer greater than or equal to 2, and the initial value of n is 2;
wherein K and I are positive integers greater than or equal to 1, and the first predetermined order and the second predetermined order are different ordering orders from each other.
2. The method according to claim 1, wherein the adding data belonging to the same data input source to K channel units of a sub-channel corresponding to the data input source according to a first predetermined order according to different data input sources specifically comprises:
determining an ith sub-channel corresponding to the data input source according to the data input source to which the ith piece of data belongs, wherein I is a positive integer which is greater than or equal to 1 and less than or equal to I, and h is a positive integer which is greater than or equal to 2;
when determining that the ith sub-channel has created a variable set corresponding to the ith sub-channel, determining whether the h-th data is added to the k-th channel unit or the h-th data is added to k +1 channel units according to whether the current stored data amount of the k-th channel unit storing the h-1-th data is greater than the total stored data amount of the k-th channel unit, wherein the variable set is a parameter set created when the first piece of data of the data input source is added to the ith sub-channel, and includes: the position indication information corresponding to the kth channel element, the current storage data volume of the kth channel element, the total storage data volume of the kth channel element, and the total storage data volume of the ith sub-channel, wherein K is a positive integer greater than or equal to 1 and less than or equal to K.
3. The method according to claim 2, wherein the determining that the h-th data is added to the k-th channel unit or the h-th data is added to the (k + 1) -th channel unit according to whether a current stored data amount of a k-th channel unit storing the h-1-th data is larger than a total stored data amount of the k-th channel unit, specifically comprises:
when the current storage data volume of the kth channel unit is smaller than the total storage data volume of the kth channel unit, adding the h piece of data into the kth channel unit, and adding 1 to the total storage data volume value of the ith sub-channel;
and when the current storage data volume of the kth channel unit is larger than or equal to the total storage data volume of the kth channel unit, adding the kth data into the (k + 1) th channel unit, and adding 1 to the total storage data volume value of the ith sub-channel.
4. The method of claim 3, wherein before adding the h data to the (k + 1) th channel element, the method further comprises: determining whether the total storage data volume of the (k + 1) th channel unit is zero or not, wherein the total storage data volume of the channel unit is obtained by calculation according to the occupied bandwidth weight value of data input by a data input source corresponding to the sub-channel to which the channel unit belongs;
when the total storage data amount of the (k + 1) th channel unit is determined to be not zero, adding the h-th data into the (k + 1) th channel unit;
and when the total stored data volume of the (k + 1) th channel unit is zero, adding the h-th data into a first channel unit with the non-zero total stored data volume after the (k + 1) th channel unit.
5. The method according to claim 1, wherein the adding data belonging to the same data input source to K channel units of a sub-channel corresponding to the data input source according to a first predetermined order according to different data input sources specifically comprises:
determining an ith sub-channel corresponding to the data input source according to the data input source to which the ith piece of data belongs, wherein I is a positive integer which is greater than or equal to 1 and less than or equal to I;
when the fact that the ith sub-channel does not create the corresponding variable set is determined, creating the variable set corresponding to the ith sub-channel;
determining a channel unit with a first total storage data amount not being zero in the ith sub-channel;
and storing the h-th data to a channel unit with a first total storage data volume not equal to zero in the i-th sub-channel, wherein the total storage data volume of the channel unit is obtained by calculation according to an occupied bandwidth weight value of data input by a data input source corresponding to the sub-channel to which the channel unit belongs, and the value of h is 1.
6. The method according to claim 1, wherein when all data in any of the I sub-channels is completely output, all parameters in the variable set corresponding to the sub-channel for which all data is completely output are initialized.
7. A data transmission apparatus, characterized in that the apparatus comprises:
the processing unit is used for dividing the data transmission channel into I sub-channels, wherein the number of the sub-channels is the same as that of the data input sources, and the bandwidth of each sub-channel in the I sub-channels is set according to the occupied bandwidth weight value of the data input by the data input sources;
dividing each subchannel in the I subchannels into K channel units respectively;
according to different data input sources, adding data input by the same data input source into K channel units of a sub-channel corresponding to the data input source according to a first preset sequence for caching;
the output unit is used for sequentially outputting the data in the (n-1) th channel unit of each subchannel in the I subchannels according to a second preset sequence;
after all the data in the nth-1 channel unit of each sub-channel in the I sub-channels are output, sequentially outputting the data in the nth channel unit of each sub-channel in the I sub-channels according to a second preset sequence, wherein n is a positive integer greater than or equal to 2, and the initial value of n is 2;
wherein K and I are positive integers greater than or equal to 1, and the first predetermined order and the second predetermined order are different ordering orders from each other.
8. The apparatus according to claim 7, wherein the processing unit is specifically configured to:
determining an ith sub-channel corresponding to the data input source according to the data input source to which the ith piece of data belongs, wherein I is a positive integer which is greater than or equal to 1 and less than or equal to I, and h is a positive integer which is greater than or equal to 2;
when determining that the ith sub-channel has created a variable set corresponding to the ith sub-channel, determining whether the h-th data is added to the k-th channel unit or the h-th data is added to k +1 channel units according to whether the current stored data amount of the k-th channel unit storing the h-1-th data is greater than the total stored data amount of the k-th channel unit, wherein the variable set is a parameter set created when the first piece of data of the data input source is added to the ith sub-channel, and includes: the position indication information corresponding to the kth channel element, the current storage data volume of the kth channel element, the total storage data volume of the kth channel element, and the total storage data volume of the ith sub-channel, wherein K is a positive integer greater than or equal to 1 and less than or equal to K.
CN201611155069.7A 2016-12-14 2016-12-14 Data transmission method and device Active CN106603214B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201611155069.7A CN106603214B (en) 2016-12-14 2016-12-14 Data transmission method and device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201611155069.7A CN106603214B (en) 2016-12-14 2016-12-14 Data transmission method and device

Publications (2)

Publication Number Publication Date
CN106603214A CN106603214A (en) 2017-04-26
CN106603214B true CN106603214B (en) 2019-12-27

Family

ID=58801272

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201611155069.7A Active CN106603214B (en) 2016-12-14 2016-12-14 Data transmission method and device

Country Status (1)

Country Link
CN (1) CN106603214B (en)

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1517895A (en) * 2003-01-18 2004-08-04 ���ǵ�����ʽ���� System and method for distributing multisource to multi-channel
CN1630293A (en) * 2003-12-19 2005-06-22 华为技术有限公司 A method and apparatus for multi-path data transmission in communication system
CN103580842A (en) * 2013-11-04 2014-02-12 惠州Tcl移动通信有限公司 Method and system for conducting parallel transmission through multiple types of wireless links
CN104394095A (en) * 2014-11-07 2015-03-04 北京奇虎科技有限公司 Data transmission method, data transmission system and source server

Family Cites Families (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101778476B (en) * 2009-01-08 2012-07-04 华为技术有限公司 Resource assignment method and mobile terminal

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1517895A (en) * 2003-01-18 2004-08-04 ���ǵ�����ʽ���� System and method for distributing multisource to multi-channel
CN1630293A (en) * 2003-12-19 2005-06-22 华为技术有限公司 A method and apparatus for multi-path data transmission in communication system
CN103580842A (en) * 2013-11-04 2014-02-12 惠州Tcl移动通信有限公司 Method and system for conducting parallel transmission through multiple types of wireless links
CN104394095A (en) * 2014-11-07 2015-03-04 北京奇虎科技有限公司 Data transmission method, data transmission system and source server

Also Published As

Publication number Publication date
CN106603214A (en) 2017-04-26

Similar Documents

Publication Publication Date Title
CN109740735B (en) Multi-neural-network output method and device, server and computer readable medium
CN110708377A (en) Data transmission method, device and storage medium
US10547856B2 (en) Constant-slope bitrate allocation for distributed encoding
EP3255553A1 (en) Transmission control method and device for direct memory access
CN107239347B (en) Equipment resource allocation method and device in virtual scene
CN112035266A (en) Resource allocation method, device, equipment and storage medium
CN106954043A (en) The method for allocating tasks and system of cloud service in monitoring system
CN110944388A (en) Frequency domain resource indicating and determining method, network equipment and terminal
CN104486442A (en) Method and device for transmitting data of distributed storage system
AU2024201415A1 (en) Device, method, and system that virtualize a network
CN106603214B (en) Data transmission method and device
CN110351843B (en) Resource allocation indicating method, resource allocation obtaining method, base station and user terminal
CN110831220B (en) Method and device for scheduling Transport Block (TB)
CN109951506B (en) Method and equipment for evaluating performance of storage cluster
KR102547755B1 (en) Adaptive Video Direct Memory Access Module
CN112367708B (en) Network resource allocation method and device
CN110266814B (en) Transmission method and transmission device
EP2926609A1 (en) Wireless backhaul system
US8832309B2 (en) Generating packets with low overhead or selectable sequence number generation
CN110113269B (en) Flow control method based on middleware and related device
CN115878309A (en) Resource allocation method, device, processing core, equipment and computer readable medium
KR20220048471A (en) Feedback channel mapping method and device, equipment and storage medium
CN108011704B (en) Half-duplex communication device, communication method thereof and half-duplex communication device
SE522876C2 (en) Method for assigning time slots in a data communication system
CN106230748A (en) A kind of packet sending, receiving method and equipment

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant
CP03 Change of name, title or address
CP03 Change of name, title or address

Address after: 334000 room 139, building 2, cultural and creative center, Chasheng East Road, Shangrao High Speed Railway Economic Experimental Zone, Jiangxi Province

Patentee after: Jiangxi Tianli Technology Co.,Ltd.

Patentee after: Li Kehua

Patentee after: Liu Zhenjie

Address before: 100144 9th floor, building 6, yard 30, Shixing street, Shijingshan District, Beijing

Patentee before: BEIJING WIRELESS TIANLI MOBILE INFORMATION TECHNOLOGY Co.,Ltd.

Patentee before: Li Kehua

Patentee before: Liu Zhenjie