CN114866196B - Data packet retransmission method, device, electronic equipment and storage medium - Google Patents

Data packet retransmission method, device, electronic equipment and storage medium Download PDF

Info

Publication number
CN114866196B
CN114866196B CN202110070708.4A CN202110070708A CN114866196B CN 114866196 B CN114866196 B CN 114866196B CN 202110070708 A CN202110070708 A CN 202110070708A CN 114866196 B CN114866196 B CN 114866196B
Authority
CN
China
Prior art keywords
preset
data packet
data packets
time threshold
packet
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
CN202110070708.4A
Other languages
Chinese (zh)
Other versions
CN114866196A (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.)
Beijing Shenzhou Digital Cloud Information Technology Co ltd
Shenzhou Kuntai Xiamen Information Technology Co ltd
Original Assignee
Shenzhou Kuntai Xiamen Information Technology Co ltd
Beijing Shenzhou Digital Cloud 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 Shenzhou Kuntai Xiamen Information Technology Co ltd, Beijing Shenzhou Digital Cloud Information Technology Co ltd filed Critical Shenzhou Kuntai Xiamen Information Technology Co ltd
Priority to CN202110070708.4A priority Critical patent/CN114866196B/en
Publication of CN114866196A publication Critical patent/CN114866196A/en
Application granted granted Critical
Publication of CN114866196B publication Critical patent/CN114866196B/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
    • H04L1/00Arrangements for detecting or preventing errors in the information received
    • H04L1/12Arrangements for detecting or preventing errors in the information received by using return channel
    • H04L1/16Arrangements for detecting or preventing errors in the information received by using return channel in which the return channel carries supervisory signals, e.g. repetition request signals
    • H04L1/1607Details of the supervisory signal
    • H04L1/1671Details of the supervisory signal the supervisory signal being transmitted together with control information
    • H04L1/1678Details of the supervisory signal the supervisory signal being transmitted together with control information where the control information is for timing, e.g. time stamps
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L69/00Network arrangements, protocols or services independent of the application payload and not provided for in the other groups of this subclass
    • H04L69/16Implementation or adaptation of Internet protocol [IP], of transmission control protocol [TCP] or of user datagram protocol [UDP]
    • H04L69/164Adaptation or special uses of UDP protocol

Landscapes

  • Engineering & Computer Science (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Data Exchanges In Wide-Area Networks (AREA)
  • Communication Control (AREA)

Abstract

The embodiment of the invention discloses a data packet retransmission method, a data packet retransmission device, electronic equipment and a storage medium. The method comprises the following steps: receiving a transmission request of a transmission data packet in a current period; judging whether the transmission time of each data packet uploaded to a buffer queue is greater than or equal to a preset enqueue time threshold value; if the transmission time of the data packet is greater than or equal to a preset enqueue time threshold value, retransmitting the data packet; the data packets with the transmission time smaller than the preset enqueue time threshold value are subjected to retention verification, the data packets meeting the retention verification are uploaded to a client according to the serial numbers of the data packets, the data packets not meeting the retention verification are cleared, and the data packets not meeting the retention verification are retransmitted; the data packets which do not meet the retention check are the data packets with the minimum sequence number, the retention time of which is greater than or equal to a preset retention time threshold value, and the data packets with the minimum sequence number. The effect of retransmitting the lost data packet is achieved, and user experience is improved.

Description

Data packet retransmission method, device, electronic equipment and storage medium
Technical Field
Embodiments of the present invention relate to computer technologies, and in particular, to a method, an apparatus, an electronic device, and a storage medium for retransmitting a data packet.
Background
With the development of streaming media technology, the quality requirements of users on audio and video are higher and higher, and under the condition of poor network, a large amount of packet loss conditions (namely, the condition of audio and video data loss) occur in audio and video data, so that the situation that the users watch videos and clip and drop frames occurs, and the watching experience of the users is seriously influenced.
The conventional transmission of network data uses the UDP protocol, which is an unreliable transmission protocol. When a data packet is lost in the process of transmitting the data packet, a packet loss retransmission strategy needs to be realized by the data packet. The conventional packet loss retransmission strategy has the following two problems:
(1) The packet loss check result is inaccurate: the conventional packet loss retransmission strategy judges whether the packet loss exists or not based on a continuous mode of the sequence number of the data packet, and when the sequence number of the received data packet is discontinuous, the packet loss is considered to occur. Under the condition of poor network quality, the phenomenon of data packet disorder is common, so that a large number of normal data packets are misidentified as network packet loss, thereby increasing network burden. (2) fixed cache queue length: the traditional packet loss retransmission strategy adopts a buffer queue with fixed length, when the packet loss rate is larger due to the poor network, a large number of retransmission packets are retained in the buffer queue, so that the network is further deteriorated, and the user experience is affected.
Disclosure of Invention
The embodiment of the invention provides a data packet retransmission method, a device, electronic equipment and a storage medium, which are used for realizing better effect of retransmitting lost data packets faster and better under the condition of poor network and improving user experience.
In a first aspect, an embodiment of the present invention provides a method for retransmitting a data packet, where the method includes:
receiving a transmission request of a transmission data packet in a current period, wherein the transmission request comprises at least one data packet to be transmitted, and two adjacent data packets are respectively provided with continuous serial numbers;
Judging whether the transmission time of uploading each data packet to a cache queue is greater than or equal to a preset enqueue time threshold value or not;
If the transmission time is greater than or equal to the preset enqueue time threshold, retransmitting the data packet which is greater than or equal to the preset enqueue time threshold;
if the transmission time is smaller than the preset enqueue time threshold, carrying out retention check on the data packets with the transmission time smaller than the preset enqueue time threshold, uploading the data packets meeting the retention check to a client according to the serial numbers of the data packets, clearing the data packets not meeting the retention check, and retransmitting the data packets not meeting the retention check; the data packets which do not meet the retention check are the data packets with the minimum sequence number, the retention time of which is greater than or equal to a preset retention time threshold value, and the data packets with the sequence number which is greater than the minimum sequence number.
In a second aspect, an embodiment of the present invention further provides a data packet retransmission apparatus, where the apparatus includes:
A transmission request receiving module, configured to receive a transmission request of a transmission data packet in a current period, where the transmission request includes at least one data packet to be transmitted, and two adjacent data packets are respectively provided with continuous serial numbers;
The judging module is used for judging whether the transmission time of each data packet uploaded to the buffer queue is greater than or equal to a preset enqueue time threshold value;
A first retransmission policy determining module, configured to retransmit the data packet greater than or equal to the preset enqueue time threshold if the transmission time is greater than or equal to the preset enqueue time threshold;
The second retransmission strategy determining module is used for carrying out retention check on the data packets with the transmission time smaller than the preset enqueue time threshold value if the transmission time is smaller than the preset enqueue time threshold value, uploading the data packets meeting the retention check to the client according to the serial numbers of the data packets, clearing the data packets not meeting the retention check, and retransmitting the data packets not meeting the retention check; the data packets which do not meet the retention check are the data packets with the minimum sequence number, the retention time of which is greater than or equal to a preset retention time threshold value, and the data packets with the sequence number which is greater than the minimum sequence number.
In a third aspect, an embodiment of the present invention further provides an electronic device, including:
One or more processors;
A storage means for storing one or more programs;
When the one or more programs are executed by the one or more processors, the one or more processors implement the method for retransmitting a data packet according to any one of the embodiments of the present invention.
In a fourth aspect, embodiments of the present invention also provide a storage medium containing computer-executable instructions, which when executed by a computer processor, are configured to perform a method for retransmitting a data packet according to any of the embodiments of the present invention.
According to the technical scheme, whether the transmission time of each data packet to be transmitted to the buffer queue is larger than or equal to the preset enqueuing time threshold is judged, the data packets with the transmission time larger than or equal to the preset enqueuing time threshold are retransmitted, the data packets with the transmission time smaller than the preset enqueuing time threshold are subjected to retention check, the data packets meeting the retention check are uploaded to a client according to the serial numbers of the data packets, the data packets with the retention time larger than or equal to the minimum serial number of the preset retention time threshold and the data packets with the retention time larger than the minimum serial number are cleared, and the data packets not meeting the retention check are retransmitted, so that the data packets are rearranged effectively, the unordered data packets and the really lost data packets can be distinguished more accurately, the effect of retransmitting the lost data packets faster and better under the condition of poor network is achieved, and the viewing experience of users is enhanced.
Drawings
Fig. 1 is a flowchart of a data packet retransmission method according to a first embodiment of the present invention;
Fig. 2 is a flowchart of a data packet retransmission method in a second embodiment of the present invention;
fig. 3 is a flowchart of a data packet retransmission method in a third embodiment of the present invention;
fig. 4 is a flowchart of a data packet retransmission method in a fourth embodiment of the present invention;
fig. 5 is a flowchart of a packet retransmission method according to a fifth embodiment of the present invention;
Fig. 6 is a schematic structural diagram of a packet retransmission apparatus according to a sixth embodiment of the present invention;
fig. 7 is a schematic structural diagram of an electronic device in a seventh embodiment of the present invention.
Detailed Description
The invention is described in further detail below with reference to the drawings and examples. It is to be understood that the specific embodiments described herein are merely illustrative of the invention and are not limiting thereof. It should be further noted that, for convenience of description, only some, but not all of the structures related to the present invention are shown in the drawings.
Example 1
Fig. 1 is a flowchart of a data packet retransmission method according to an embodiment of the present invention, where the method may be applicable to a case of retransmitting a lost data packet, and the method may be performed by a data packet retransmission apparatus, and the data packet retransmission apparatus may be implemented by software and/or hardware, and the data packet retransmission apparatus may be configured on an electronic computing device, and specifically includes the following steps:
S110, receiving a transmission request of a transmission data packet in the current period, wherein the transmission request comprises at least one data packet to be transmitted, and two adjacent data packets are respectively provided with continuous serial numbers.
The current period may be, for example, a period during which the data packet is currently to be transmitted.
The data packets may be audio-visual data packets.
The transmission request may be a request for a data packet to be transmitted in the current period.
In the embodiment of the present invention, a period indicates from the start of the transmission of the previous data packet (e.g., an audio/video data packet) to the transmission of the current data packet (e.g., an audio/video data packet). I.e. the last audio-video data packet to be transmitted starts to be transmitted until the current audio-video data packet to be transmitted is transmitted.
In the embodiment of the present invention, the transmission request includes at least one data packet to be transmitted. Two adjacent data packets may each be provided with a consecutive sequence number. For example, a period of audio data is to be transmitted in the current period, where the audio data has 7 packets of A, B, C, D, E, F and G, then consecutive sequence numbers are set for two adjacent packets, respectively, that is, 7 packets of A, B, C, D, E, F and G are set to consecutive sequence numbers, respectively, such as sets of 1, 2, 3, 4,5, 6, and 7 for the 7 packets of A, B, C, D, E, F and G, respectively.
S120, judging whether the transmission time of each data packet uploaded to the buffer queue is greater than or equal to a preset enqueue time threshold.
The preset enqueue time threshold may be a preset transmission time threshold for uploading each data packet to the buffer queue.
And after receiving each data packet to be transmitted, judging whether the transmission time of uploading each data packet to a buffer queue is greater than or equal to a preset enqueue time threshold value.
In the embodiment of the present invention, the preset enqueue time threshold may be determined based on the packet loss rate of the previous cycle of the current cycle. How to determine the preset enqueuing time of the current period according to the packet loss rate of the previous period is described in detail in the following embodiments.
And S130, if the transmission time is greater than or equal to a preset enqueue time threshold, retransmitting the data packet which is greater than or equal to the preset enqueue time threshold.
For example, when it is determined that the transmission time of the data packet is greater than or equal to the preset enqueue time threshold, it is indicated that the data packet is not transmitted into the buffer queue within the preset enqueue time threshold, and retransmission is performed on the data packet greater than or equal to the preset enqueue time threshold.
In the embodiment of the present invention, taking the case that the data packets have 7 data packets of 1,2,3, 4, 5,6 and 7, the preset enqueuing time threshold is 2 seconds as an example, when transmitting the 7 data packets of 1,2,3, 4, 5,6 and 7 into the buffer queue, if the data packets do not transmit into the buffer queue within the preset enqueuing time threshold, for example, assume that the 3 data packets of 1,2 and 3 are not transmitted into the buffer queue, the 3 data packets of 1,2 and 3 are retransmitted.
Continuing with the above example, in the embodiment of the present invention, the 3 data packets 1,2 and 3 are not transmitted into the buffer queue within the preset enqueue time threshold, which may be caused by a network outage, etc., so that the 3 data packets 1,2 and 3 may be retransmitted.
Therefore, the problem that the data packets cannot be transmitted to the buffer queue due to network interruption or network failure is avoided, and the normal transmission of all the data packets is ensured.
S140, if the transmission time is smaller than a preset enqueue time threshold, carrying out retention check on the data packets with the transmission time smaller than the preset enqueue time threshold, uploading the data packets meeting the retention check to a client according to the serial numbers of the data packets, clearing the data packets not meeting the retention check, and retransmitting the data packets not meeting the retention check; the data packets which do not meet the retention check are the data packets with the minimum sequence number, the retention time of which is greater than or equal to a preset retention time threshold value, and the data packets with the minimum sequence number.
The preset residence time threshold may be a preset threshold of time for which the data packet is held in the buffer queue, for example.
In the embodiment of the present invention, the preset residence time threshold may be determined based on the packet loss rate of the previous cycle of the current cycle. How to determine the preset residence time threshold of the current period according to the packet loss rate of the previous period is described in detail in the following embodiments.
When the transmission time of the data packets is smaller than the preset enqueuing time threshold value, the data packets are transmitted into the buffer queue within the preset enqueuing time threshold value. For the data packet entering the buffer queue, retention verification can be performed on the data packet, and then the data packet meeting the retention verification is uploaded to the client according to the serial number of the data packet, so that a user can receive the data packet at the client.
And clearing the data packets which do not meet the retention check, and retransmitting the data packets which do not meet the retention check.
In the embodiment of the invention, the retention verification is performed on the data packet entering the buffer queue, specifically, the retention time of the data packet in the buffer queue is calculated, and more preferably, the retention time of the data packet with the minimum sequence number in the buffer queue is calculated in the data packet in the buffer queue.
When the retention time of the data packet in the cache queue is smaller than a preset retention time threshold value, the data packet is proved to meet the retention check, and if the retention time of the data packet in the cache queue is larger than or equal to the preset retention time threshold value, the data packet is proved not to meet the retention check.
In the embodiment of the invention, the data packets which do not meet the retention check are cleared, namely the data packets which do not meet the retention check are cleared from the cache queue. And simultaneously retransmitting the data packets which do not meet the retention check.
It should be noted that, in the embodiment of the present invention, the data packets that do not satisfy the retention check may be the minimum sequence number data packets with the retention time greater than or equal to the preset retention time threshold, and the data packets with the retention time greater than the minimum sequence number.
Specifically, if the data packets in the buffer queue have 4, 5,6 and 7, the retention time of the data packet 4 is calculated, and if the retention time of the data packet 4 is greater than or equal to the preset retention time threshold, the data packet 4 and the data packets 5,6 and 7 with the sequence numbers greater than the minimum sequence number are all cleared from the buffer queue.
Specifically, taking the case that the data packets have 7 data packets of 1,2, 3, 4, 5, 6 and 7, the preset enqueuing time threshold is 2 seconds, the preset residence time threshold is 3 seconds as an example, when the 7 data packets of 1,2, 3, 4, 5, 6 and 7 are transmitted to the buffer queue, assuming that the 3 data packets of 1,2 and 3 are not transmitted to the buffer queue, the 3 data packets of 1,2 and 3 need to be retransmitted, and the data packets of 4, 5, 6 and 7 are already transmitted to the buffer queue. Since 7 packets 1,2, 3, 4, 5, 6 and 7 constitute a complete audio/video, it is preferable to transmit 7 packets 1,2, 3, 4, 5, 6 and 7 together to the client so that the user of the client can hear the complete audio data. Since 3 packets 1,2 and 3 need to be retransmitted, packets 4, 5, 6 and 7 need to wait in the buffer queue, when 3 packets 1,2 and 3 are retransmitted, the retention time of packets 4, 5, 6 and 7 in the buffer queue can be calculated, if the retention time of packets 4, 5, 6 and 7 in the buffer queue is less than the preset retention time threshold, it is proved that 3 packets 1,2 and 3 are retransmitted in 3 seconds into the buffer queue, and then packets 1,2, 3, 4, 5, 6 and 7 can be uploaded to the client.
If the retention time of the data packets 4, 5, 6 and 7 in the buffer queue is greater than or equal to the preset retention time threshold, it is proved that the 3 data packets 1, 2 and 3 are not retransmitted in the buffer queue which is entered in 3 seconds, and then the data packets 4, 5, 6 and 7 in the buffer queue can be cleared from the buffer queue at this time, and meanwhile, the data packets 1, 2, 3, 4, 5, 6 and 7 are re-uploaded.
In the embodiment of the present invention, after the checking of the transmission buffer queue is completed (determining whether the transmission time of the data packet to the buffer queue is greater than or equal to the preset enqueue time threshold) and the retention checking are performed, it is determined whether the data packet currently in the buffer queue is the data packet with the smallest waiting sequence number (i.e. determining whether the data packet with the sequence number is the data packet with the sequence number of 1), if the data packet is the waiting data packet (i.e. the data packet with the sequence number of 1), it indicates that the correct data packet is received, and the data packet with the continuous sequence number after the correct data packet is dequeued until the discontinuous sequence number (i.e. uploading the correct data packet and the data packet with the continuous sequence number after the correct data packet to the client).
In the embodiment of the present invention, the retransmission of the data packet does not mean that the check of the transmission buffer queue is performed again on the data packet (whether the transmission time of uploading the data packet to the buffer queue is greater than or equal to the preset enqueue time threshold value is determined again) and the retention check is performed again. And directly transmitting the data packet to be retransmitted to the client, if the retransmitted data packet is successfully uploaded to the client in the process of being transmitted to the client, the client can receive the retransmitted data packet, and if the retransmitted data packet is failed to be uploaded to the client, discarding the retransmitted data packet, namely, the audio data received by the client may be the audio data of which part of the data packet is lost.
In the embodiment of the present invention, a retransmission number may be preset, for example, 2 times, that is, the data packet to be retransmitted is retransmitted twice, and if both times fail, the retransmitted data packet is discarded. Specifically, the preset retransmission times can be set according to the user requirements, which is not limited herein.
The embodiment of the invention performs the two checks on the data packets to be transmitted, realizes effective rearrangement of the data packets, and can more accurately distinguish the disordered data packets from the truly lost data packets, thereby realizing the effect of ensuring faster and better retransmission of the lost data packets under the condition of poor network and enhancing the viewing experience of users.
According to the technical scheme, whether the transmission time of each data packet to be transmitted to the buffer queue is larger than or equal to the preset enqueuing time threshold is judged, the data packets with the transmission time larger than or equal to the preset enqueuing time threshold are retransmitted, the data packets with the transmission time smaller than the preset enqueuing time threshold are subjected to retention check, the data packets meeting the retention check are uploaded to a client according to the serial numbers of the data packets, the data packets with the retention time larger than or equal to the minimum serial number of the preset retention time threshold and the data packets with the retention time larger than the minimum serial number are cleared, and the data packets not meeting the retention check are retransmitted, so that the data packets are rearranged effectively, the unordered data packets and the really lost data packets can be distinguished more accurately, the effect of retransmitting the lost data packets faster and better under the condition of poor network is achieved, and the viewing experience of users is enhanced.
Example two
Fig. 2 is a flowchart of a data packet retransmission method according to a second embodiment of the present invention, where the embodiments of the present invention may be combined with each of the alternatives in the foregoing embodiments. In an embodiment of the present invention, optionally, after the receiving the transmission request of the transmission data packet of the current period, the method further includes: setting a data packet transmission monitoring event; correspondingly, the transmission time and the retention time are respectively obtained by monitoring based on a data packet retransmission monitoring event.
As shown in fig. 2, the method in the embodiment of the present invention specifically includes the following steps:
s210, receiving a transmission request of a transmission data packet in a current period, wherein the transmission request comprises at least one data packet to be transmitted, and two adjacent data packets are respectively provided with continuous serial numbers.
S220, setting a data packet transmission monitoring event.
For example, a transmission monitoring event of the data packet may be set, so that transmission process data of the data packet may be monitored during transmission of the data packet.
Specifically, the transmission time of each data packet uploaded to the buffer queue in step S230 may be monitored.
In the embodiment of the present invention, before executing S230, the transmission time of each data packet uploaded to the buffer queue is first acquired, where the acquisition of the transmission time of each data packet uploaded to the buffer queue may be monitoring the transmission time of each data packet according to the set data packet transmission monitoring event, so that the transmission time of each data packet uploaded to the buffer queue may be acquired.
Similarly, the packet transmission monitoring event may also monitor the residence time of each packet in the buffer queue in step S250.
In the embodiment of the present invention, when the retention check is performed on the data packets in the buffer queue in step S250, the retention time of each data packet in the buffer queue is first obtained. The acquiring the residence time of each data packet in the buffer queue may be to monitor the residence time of each data packet in the buffer queue according to the set data packet transmission monitoring event, so as to acquire the residence time of each data packet in the buffer queue.
The data packet transmission monitoring event is set to automatically monitor the transmission time of each data packet transmitted to the buffer queue and the retention time of each data packet in the buffer queue, so that the transmission time of each data packet transmitted to the buffer queue and the retention time of each data packet in the buffer queue do not need to be specially calculated, the transmission time and the retention time of each data packet in the buffer queue are saved, and the efficiency is improved.
S230, judging whether the transmission time of each data packet uploaded to the buffer queue is greater than or equal to a preset enqueue time threshold.
S240, if the transmission time is greater than or equal to a preset enqueue time threshold, retransmitting the data packet which is greater than or equal to the preset enqueue time threshold.
S250, if the transmission time is smaller than a preset enqueue time threshold, carrying out retention check on the data packets with the transmission time smaller than the preset enqueue time threshold, uploading the data packets meeting the retention check to a client according to the serial numbers of the data packets, clearing the data packets not meeting the retention check, and retransmitting the data packets not meeting the retention check; the data packets which do not meet the retention check are the data packets with the minimum sequence number, the retention time of which is greater than or equal to a preset retention time threshold value, and the data packets with the minimum sequence number.
According to the technical scheme, the transmission time of each data packet transmitted to the buffer queue can be automatically monitored by setting the data packet transmission monitoring event, and the retention time of each data packet in the buffer queue can be automatically monitored, so that the transmission time of each data packet transmitted to the buffer queue and the retention time of each data packet in the buffer queue do not need to be specially calculated, the transmission time of each data packet and the acquisition time of the retention time of each data packet in the buffer queue are saved, and the efficiency is improved.
Example III
Fig. 3 is a flowchart of a data packet retransmission method according to a third embodiment of the present invention, where the embodiments of the present invention may be combined with each of the alternatives in the foregoing embodiments. In an embodiment of the present invention, optionally, after the data packet that does not satisfy the retention check is cleared and the data packet that does not satisfy the retention check is retransmitted, the method further includes: determining the packet loss rate of the current period based on the data packet expected to be retransmitted in the current period; based on the packet loss rate of the current period, correspondingly adjusting a preset enqueue time threshold and/or a preset residence time threshold.
As shown in fig. 3, the method in the embodiment of the present invention specifically includes the following steps:
S310, receiving a transmission request of a transmission data packet in the current period, wherein the transmission request comprises at least one data packet to be transmitted, and two adjacent data packets are respectively provided with continuous serial numbers.
S320, setting a data packet transmission monitoring event.
S330, judging whether the transmission time of each data packet uploaded to the buffer queue is greater than or equal to a preset enqueue time threshold.
And S340, if the transmission time is greater than or equal to a preset enqueue time threshold, retransmitting the data packet which is greater than or equal to the preset enqueue time threshold.
S350, if the transmission time is smaller than a preset enqueue time threshold, carrying out retention check on the data packets with the transmission time smaller than the preset enqueue time threshold, uploading the data packets meeting the retention check to a client according to the serial numbers of the data packets, clearing the data packets not meeting the retention check, and retransmitting the data packets not meeting the retention check; the data packets which do not meet the retention check are the data packets with the minimum sequence number, the retention time of which is greater than or equal to a preset retention time threshold value, and the data packets with the minimum sequence number.
S360, determining the packet loss rate of the current period based on the data packet expected to be retransmitted in the current period.
For example, after determining the data packet to be retransmitted in the current period, the packet loss rate in the current period may be determined according to the data packet to be retransmitted in the current period.
In the embodiment of the present invention, the packet loss rate of the current period may be determined according to the number of the packets expected to be retransmitted in the current period.
And S370, correspondingly adjusting a preset enqueue time threshold and/or a preset residence time threshold based on the packet loss rate of the current period.
For example, after the packet loss rate of the current period is calculated, the preset enqueue time threshold and/or the preset residence time threshold may be correspondingly adjusted according to the calculated packet loss rate of the current period.
In the embodiment of the invention, specifically, if the packet loss rate in the current period is high, it is indicated that the preset enqueue time threshold and/or the preset residence time threshold set based on the previous period are smaller, so that too many data packets cannot be transmitted to the cache queue within the preset enqueue time threshold, and/or the residence time of the data packets in the cache queue exceeds the preset residence time threshold. Therefore, the preset enqueue time threshold and/or the preset residence time threshold need to be increased, so that as many data packets as possible can be transmitted to the buffer queue within the preset enqueue time threshold, and/or the data packets in the buffer queue cannot exceed the preset residence time threshold when staying in the buffer queue, so that the number of data packets needing to be retransmitted is reduced, the packet loss rate is reduced, and the data packets (such as audio and video data packets) can be ensured to be normally transmitted to the client, so that the client can receive the audio and video data packets as complete as possible.
The method and the device have the advantages that the problem of fixed length of the buffer queue in the prior art is solved, the buffer length of the buffer queue is set to be adjustable, and the buffer queue can be dynamically adjusted, so that when the packet loss rate is large due to poor network, the problem of network deterioration and influence on user experience caused by accumulation of a large number of packets in the buffer queue is avoided.
According to the technical scheme of the embodiment of the invention, the packet loss rate of the current period can be determined based on the data packet expected to be retransmitted in the current period, and the preset enqueue time threshold and/or the preset residence time threshold can be correspondingly adjusted according to the packet loss rate of the current period, so that the quantity of the data packets needing to be retransmitted is reduced, the packet loss rate is reduced, and the data packets (such as audio and video data packets) can be ensured to be normally transmitted to a client, so that the client can be ensured to receive the audio and video data packets as complete as possible. Meanwhile, the problem of fixed length of the buffer queue in the prior art is solved, and the buffer length of the buffer queue is set to be adjustable, so that the buffer queue can be dynamically adjusted, and the problem that when the packet loss rate is large due to poor network, a large number of accumulated packet losses in the buffer queue cause network deterioration and influence user experience is avoided.
Example IV
Fig. 4 is a flowchart of a data packet retransmission method according to a fourth embodiment of the present invention, where the embodiments of the present invention may be combined with each of the alternatives in the foregoing embodiments. In an embodiment of the present invention, optionally, the determining the packet loss rate of the current period based on the data packet expected to be retransmitted in the current period includes: determining the number of accumulated data packets in the current period based on the number of data packets expected to be retransmitted in the current period and the number of data packets in the transmission request; and determining the packet loss rate of the current period based on the number of data packets expected to be retransmitted in the current period and the number of accumulated data packets in the current period.
As shown in fig. 4, the method in the embodiment of the present invention specifically includes the following steps:
s410, receiving a transmission request of a transmission data packet in a current period, wherein the transmission request comprises at least one data packet to be transmitted, and two adjacent data packets are respectively provided with continuous serial numbers.
S420, setting a data packet transmission monitoring event.
S430, judging whether the transmission time of each data packet uploaded to the buffer queue is greater than or equal to a preset enqueue time threshold.
S440, if the transmission time is greater than or equal to the preset enqueue time threshold, retransmitting the data packet which is greater than or equal to the preset enqueue time threshold.
S450, if the transmission time is smaller than a preset enqueue time threshold, carrying out retention check on the data packets with the transmission time smaller than the preset enqueue time threshold, uploading the data packets meeting the retention check to a client according to the serial numbers of the data packets, clearing the data packets not meeting the retention check, and retransmitting the data packets not meeting the retention check; the data packets which do not meet the retention check are the data packets with the minimum sequence number, the retention time of which is greater than or equal to a preset retention time threshold value, and the data packets with the minimum sequence number.
S460, determining the number of accumulated packets in the current period based on the number of packets expected to be retransmitted in the current period and the number of packets in the transmission request.
The number of accumulated packets may be, for example, the number of packets normally transmitted to the client in the current period.
After determining the data packets to be retransmitted in the current period, the number of data packets expected to be retransmitted in the current period, i.e. the number of data packets lost in the current period, may be determined first.
The data of the accumulated data packet of the current period can be determined according to the number of data packets expected to be retransmitted in the current period and the number of data packets to be transmitted in the transmission request.
In the embodiment of the present invention, the number of data packets expected to be retransmitted currently may be the number of data packets lost in uploading each data packet to the buffer queue in the first embodiment, and/or the number of data packets that do not satisfy the retention check in each data packet in the buffer queue.
S470, determining the packet loss rate of the current period based on the number of data packets expected to be retransmitted in the current period and the number of accumulated data packets in the current period.
For example, after determining the number of data packets expected to be retransmitted in the current period and the number of accumulated data packets in the current period, the packet loss rate in the current period may be determined according to the number of data packets expected to be retransmitted in the current period and the number of accumulated data packets in the current period.
In the embodiment of the present invention, the packet loss rate of the current period may be specifically determined according to the following formula:
Packet loss rate = number of lost packets in current period/accumulated number of packets in current period;
The packet loss number in the current period is the number of data packets expected to be retransmitted in the current period, and the accumulated packet number in the current period is the number of accumulated data packets in the current period.
S480, correspondingly adjusting a preset enqueue time threshold and/or a preset residence time threshold based on the packet loss rate of the current period.
For example, after determining the packet loss rate of the current period, the preset enqueue time threshold and/or the preset residence time threshold may be correspondingly adjusted. However, in order to prevent the packet loss rate from being updated frequently, the length of the buffer queue is adjusted too fast, that is, the preset enqueue time threshold and/or the preset residence time threshold are adjusted too fast, a preset condition is required to be set for the adjustment of the preset enqueue time threshold and/or the preset residence time threshold, when the condition is met, the preset enqueue time threshold and/or the preset residence time threshold can be correspondingly adjusted, and when the condition is not met, even if the packet loss rate of the current period is determined, the preset enqueue time threshold and/or the preset residence time threshold are not adjusted.
In the embodiment of the present invention, the preset conditions herein may be the following two cases:
(1) Packet loss rate threshold control;
When the preset condition is packet loss rate threshold control, optionally, the adjusting the preset enqueue time threshold and/or the preset residence time threshold correspondingly based on the packet loss rate of the current period includes: calculating a first difference value of the packet loss rate of the current period and the packet loss rate of the previous period based on the packet loss rate of the current period and the packet loss rate of the previous period; and if the first difference value is greater than or equal to a first preset difference value threshold value, correspondingly adjusting a preset enqueue time threshold value and/or a preset residence time threshold value.
The first difference may be a difference between a packet loss rate of a current period and a packet loss rate of a previous period.
The first preset difference threshold may be a preset threshold of the first difference.
After determining the packet loss rate of the current period, calculating the difference value of the packet loss rate of the previous period of the packet loss rate of the current period according to the packet loss rate of the current period and the packet loss rate of the previous period of the current period, and correspondingly adjusting the preset enqueue time threshold and/or the preset residence time threshold if the difference value is greater than or equal to the first preset difference value threshold.
In the embodiment of the invention, when the difference between the packet loss rate of the current period and the packet loss rate of the previous period is larger, the current period is indicated to have more data packet loss than the previous period, so that the preset enqueue time threshold value and/or the preset residence time threshold value of the current period are required to be adjusted so as to ensure that a large number of data packets are not lost when the data packets of the next period are transmitted.
(2) Time threshold control of packet loss rate;
when the preset condition is time threshold control of the packet loss rate, optionally, the adjusting the preset enqueue time threshold and/or the preset residence time threshold correspondingly based on the packet loss rate of the current period includes: calculating a second difference value between the first time and the second time based on the first time of calculating the packet loss rate of the current period and the second time of calculating the last time of updating the preset enqueue time threshold and/or the preset residence time threshold; and if the second difference value is greater than or equal to a second preset difference value threshold value, correspondingly adjusting a preset enqueue time threshold value and/or a preset residence time threshold value.
For example, the second difference may be a difference between a time when the packet loss rate of the current period is calculated and a time when the preset enqueue time threshold and/or the preset hold-up time threshold was last updated.
The second preset difference threshold may be a preset second difference threshold.
After determining the packet loss rate of the current period, calculating the difference between the calculated time of the packet loss rate of the current period and the time of updating the preset enqueue time threshold and/or the preset residence time threshold last time according to the calculated time of the packet loss rate of the current period and the time of updating the preset enqueue time threshold and/or the preset residence time threshold last time, and correspondingly adjusting the preset enqueue time threshold and/or the preset residence time threshold if the difference is greater than or equal to a second preset difference threshold.
In the embodiment of the invention, when the difference between the calculated time of the packet loss rate in the current period and the time of updating the preset enqueue time threshold value and/or the preset residence time threshold value last time is larger, the time interval between the calculated time of the packet loss rate in the current period and the time of updating the preset enqueue time threshold value and/or the preset residence time threshold value last time is longer, so that the preset enqueue time threshold value and/or the preset residence time threshold value possibly set before are not suitable for the current data packet when the data packet in the subsequent period is transmitted, and therefore, the preset enqueue time threshold value and/or the preset residence time threshold value in the current period need to be adjusted so as to ensure that a large number of data packets are not lost when the data packet in the next period is transmitted.
It should be noted that, in the embodiment of the present invention, when one of the two preset conditions is satisfied, that is, when the difference between the packet loss rate in the current period and the packet loss rate in the previous period is greater than or equal to the first preset difference threshold, or the difference between the calculated time of the packet loss rate in the current period and the time of updating the preset enqueue time threshold and/or the preset residence time threshold last time is greater than or equal to the second preset difference threshold, the preset enqueue time threshold and/or the preset residence time threshold are correspondingly adjusted.
When one of the above preset conditions is not met, then comparing the other preset condition, namely if the difference between the packet loss rate of the current period and the packet loss rate of the previous period is smaller than the first preset difference threshold, judging whether the difference between the calculated time of the packet loss rate of the current period and the time of the last update of the preset enqueue time threshold and/or the preset detention time threshold is greater than or equal to the second preset difference threshold, and if the difference between the calculated time of the packet loss rate of the current period and the time of the last update of the preset enqueue time threshold and/or the preset detention time threshold is greater than or equal to the second preset difference threshold, correspondingly adjusting the preset enqueue time threshold and/or the preset detention time threshold.
Of course, it may also be determined whether the difference between the calculated time of the packet loss rate in the current period and the time of last updating the preset enqueue time threshold and/or the preset residence time threshold is greater than or equal to the second preset difference threshold, if the difference between the calculated time of the packet loss rate in the current period and the time of last updating the preset enqueue time threshold and/or the preset residence time threshold is less than the second preset difference threshold, then it may be determined whether the difference between the packet loss rate in the current period and the packet loss rate in the last period is greater than or equal to the first preset difference threshold, and if the difference between the packet loss rate in the current period and the packet loss rate in the last period is greater than or equal to the first preset difference threshold, then the preset enqueue time threshold and/or the preset residence time threshold are correspondingly adjusted.
When the preset condition is met, the preset enqueue time threshold value and/or the preset residence time threshold value are correspondingly adjusted, and the preset condition is beneficial in that the problem that the length of the buffer memory queue is adjusted too fast, namely the preset enqueue time threshold value and/or the preset residence time threshold value are adjusted too fast, because the packet loss rate is prevented from being updated too frequently is solved.
According to the technical scheme, the number of the accumulated data packets in the current period is calculated according to the number of the data packets expected to be retransmitted in the current period, the packet loss rate in the current period can be accurately determined according to the number of the data packets expected to be retransmitted in the current period and the number of the accumulated data packets in the current period, preset conditions are set according to the packet loss rate in the current period, and when the preset conditions are met, the preset enqueue time threshold and/or the preset residence time threshold are correspondingly adjusted, so that the problem that the length of a cache queue is adjusted too fast, namely the preset enqueue time threshold and/or the preset residence time threshold is adjusted too fast can be prevented.
Example five
The embodiments of the present invention may be combined with the various alternatives in the above embodiments. In the embodiment of the present invention, optionally, the data packet in each embodiment is an audio/video data packet, which is described by way of example:
Referring to the execution flow chart of the data packet retransmission method shown in fig. 5, the data packet retransmission method in the embodiment of the invention can be executed by two modules, namely, an adaptive buffer queue module and a packet loss rate calculating and updating module, wherein the adaptive buffer queue mainly functions to reorder audio and video data packets, prevents the occurrence of the condition of disordered sequence numbers, and can more effectively calculate the packet loss rate. The packet loss rate calculating and updating module is mainly used for calculating the packet loss rate of the current network according to the data information of the self-adaptive cache queue and dynamically updating the length of the cache queue according to the calculated packet loss rate.
The execution logic of the execution flow chart in fig. 5 is described in detail below:
1. packet loss rate calculating and updating module
(1) Calculation of packet loss Rate
The packet loss rate is calculated once in each feedback period, and the packet loss rate of the current period is calculated in each period, wherein one period indicates that the current feedback packet (i.e., the audio/video data packet to be transmitted currently) is sent from the last feedback packet RECEIVER PACKET (i.e., the audio/video data packet to be transmitted last) to the start of the transmission.
Packet loss rate = number of lost packets in current period/accumulated number of packets in current period;
The packet loss number of the current period is represented as the number of data packets which are dequeued due to failure of the single_delay_seconds test and/or failure of the total_delay_seconds test. The accumulated packet number of the current period is expressed as the total number of data packets which are continuously sent to the buffer queue in the sequence number of the current period, namely the number of data packets of the contact sequence number transmitted to the client in the current period.
It should be noted that, the single_delay_seconds check refers to determining a relationship between a transmission time of each data packet to be transmitted to the buffer queue and a preset enqueue time threshold in each of the above embodiments.
The total_delay_seconds test herein refers to the retention test in each of the above embodiments. That is, in the above embodiments, the retention time of each packet in the buffer queue is determined.
(2) Packet loss rate update strategy
After the packet loss rate of the current period is calculated, the packet loss rate is not updated immediately, i.e. the preset enqueue time threshold and/or the preset residence time threshold are not adjusted immediately. The packet loss rate update can be limited by two strategies, so that the packet loss rate update is prevented from being too frequent, and the length of the queue is adjusted too fast. The first strategy is packet loss rate threshold control (i.e., the first preset condition in the fourth embodiment), and when the difference between the packet loss rate in the current period and the packet loss rate in the previous period is greater than or equal to the preset first preset difference, the packet loss rate can be forcedly updated, i.e., the preset enqueue time threshold and/or the preset residence time threshold can be forcedly adjusted. The second strategy is packet loss rate time threshold control (i.e. the second preset condition in the fourth embodiment), that is, when the time from the last update of the packet loss rate exceeds the second preset difference threshold, the packet loss rate is forcedly updated.
2. Self-adaptive cache queue module
(1) Dynamically adjusting the length of a cache queue
The queue length of the adaptive buffer queue is controlled by parameters single_delay_seconds and total_delay_seconds, wherein single_delay_seconds represents the maximum waiting time (i.e. a preset enqueue time threshold) of the data packet with the expected minimum sequence number in the queue, and when the waiting time (i.e. the transmission time) of the data packet with the expected minimum sequence number exceeds the maximum waiting time, the data packet with the waiting time greater than the maximum waiting time is forced to be dequeued (i.e. retransmitted).
It should be noted that, the data packet may be any data packet with all the sequence numbers to be transmitted without being limited to the minimum sequence number, and the reason why the data packet is limited to the minimum sequence number is that: because the whole audio and video data packet is transmitted during transmission, the audio and video data packet is divided into multi-frame data packets, when each frame data packet is transmitted, each frame data packet is respectively provided with a serial number, wherein serial numbers of two adjacent frame data packets are continuous, and when the serial numbers are provided, the serial numbers are preferably set according to the time dimension of the audio and video data packet, so that the data packet with small serial numbers is the front part of the audio and video data packet. In transmitting the audio and video data packet, it is desirable to transmit the complete audio and video data packet to the client, so that it is ensured that the transmission of the data packet with the small sequence number is successful, and therefore, the minimum sequence number is limited. But may be a minimum sequence number as is well known to those skilled in the art. The specific configuration can be set according to the user's requirement, and is not limited herein.
Total_delay_seconds represents the maximum retention time (preset retention time threshold) of the data packet with the minimum sequence number entering the buffer queue in the buffer queue, if the retention time of the data packet in the buffer queue is greater than or equal to the retention time exceeding the maximum retention time, the data packet corresponding to the minimum sequence number and the data packet with the minimum sequence number greater than the minimum sequence number in the buffer queue are forced out of the buffer queue, i.e. the whole buffer queue is emptied.
It should be noted that the present invention is not limited to the minimum sequence number, and may be any packet with all sequence numbers to be transmitted. The specific reasons are the same as those in the transmission packet value buffer queue described above, and will not be described in detail here.
The single_delay_seconds and the total_delay_seconds of the current period are dynamically adjusted according to an algorithm of decreasing the packet loss rate of the previous period based on an index, and a specific calculation formula is as follows:
Wherein, alpha is an initial waiting time value, namely the transmission time of the data packet to be transmitted to a buffer queue, and corresponds to the length of the queue with the packet loss rate of 0; beta is the influence weight coefficient of the packet loss rate generated by the transmission time of the data packet to be transmitted in the previous period to the buffer queue (the larger the value is, the larger the influence of the packet loss rate generated by the transmission time of the data packet to be transmitted in the previous period to the buffer queue on the length of the queue is); x is the packet loss rate of the previous period; alpha m is the weight coefficient of the weighted average of the existing data packets in the buffer queue (the larger the value, the greater the impact of the existing data in the buffer queue); beta m is the influence weight coefficient of the packet loss rate generated by the data packet entering the buffer queue in the previous period (the larger the value is, the larger the influence of the packet loss rate generated by the data packet entering the buffer queue on the buffer queue length is); t is the time for adding the data packet into the queue; c is a constant coefficient value.
For the above formula, the following description is made:
Calculation formula of single_delay_seconds The maximum waiting time of the data packet with the expected minimum sequence number in the buffer queue is reduced exponentially with the packet loss rate of the last period.
When the packet loss rate of the previous cycle is 0,Is 0 and single_delay_seconds is α. When packet loss (namely data packet loss) occurs, and the packet loss rate of the previous period is close to 0, the ratio of the packet loss rate of the last period is equal to/The packet loss rate of the previous period is larger, and the trend index of the packet loss rate of the previous period is decreased, so that the packet loss rate of the previous period is stable.
The advantage of this design is that when packet loss occurs, the buffer queue can react quickly, so when the packet loss rate is small, the growth trend of the buffer queue will be large. When the packet loss rate is sufficiently large, the length of the real buffer queue does not need to be changed obviously, so that the growth trend of the queue is gradually slowed down when the packet loss rate is large.
The calculation formula of total_delay_seconds consists of three parts, namely a first partThe average value representing the residence time of the existing data packet in the buffer queue, multiplied by the weight alpha m represents the effect of the average value on the total length of the buffer queue. Second part/>The influence of the decreasing trend of the packet loss rate on the total length of the buffer queue is shown, and when the packet loss rate is large, the total length of the buffer queue tends to be stable. The third part C represents the initial value of total_delay_seconds.
The reason why total_delay_seconds consists of three parts is: the method has the advantages that the comprehensive information of the existing data packets in the buffer queue is considered, the current packet loss rate is considered, and an initial value is set. Therefore, the first part is to consider the existing data packet of the queue, the second part is to consider the packet loss rate, and the third part is to set an initial value.
(2) Single_delay_seconds check
When receiving an audio/video data packet, firstly performing single_delay_seconds check, calculating whether the transmission time (i.e. the non_expect_min_sequence_time in fig. 5) of the data packet with the minimum sequence number in the data packet to be transmitted to the buffer queue exceeds the single_delay_seconds (i.e. a preset enqueue time threshold), and if the transmission time exceeds the transmission time, retransmitting the data packet with the minimum sequence number, wherein the data packet is represented to be lost.
(3) Total_delay_seconds verification
After the single_delay_seconds check is completed, total_delay_seconds check is performed on the data packets with transmission time smaller than single_delay_seconds. Calculating whether the retention time (i.e., no_ inqueue _min_sequence_time in fig. 5) of the data packet with the smallest sequence number entering the buffer queue in the buffer queue exceeds the total_delay_seconds (i.e., a preset retention time threshold), if the retention time exceeds the retention time, indicating that the data packet in the buffer queue has been retained for too long, losing meaning, forcibly emptying all the data packets in the queue, and restarting buffering the data packet.
(4) Min_sequence dequeue
After the above two checks are completed, it is determined whether the data packet currently in the buffer queue (i.e. inqueue _min_sequence in fig. 5) is the data packet with the smallest waiting Sequence number (i.e. expect_min_sequence in fig. 5), if the data packet is the waiting data packet, the data packet and the data packet with the continuous Sequence number after the data packet are sent out of the buffer queue until the non-continuous Sequence number, that is, the data packet with the correct data packet and the data packet with the continuous Sequence number after the data packet are uploaded to the client.
It should be noted that, in fig. 5, the expect_min_sequence++ may be understood that, after determining that the minimum Sequence number in the buffer queue is the waiting minimum Sequence number packet, the minimum Sequence number packet is output from the buffer queue, then determining whether the current minimum Sequence number packet in the buffer queue is the waiting minimum Sequence number packet, if yes, outputting the current minimum Sequence number packet from the buffer queue again, and repeating this until the Sequence number is discontinuous.
Specifically, for example, there are 7 packets 1, 2, 3, 4, 5, 6 and 7 in the buffer queue, first determine whether packet No. 1 is the smallest sequence number packet to be waited for, if so (because the audio and video packet is not yet uploaded to the client at this time, when uploading the audio and video packet, the user expects to receive the packet with the smallest sequence number first, and therefore, the smallest sequence number expected by the user at this time is 1), then send the packet No. 1 out of the buffer queue. And then judging whether the data packet with the smallest serial number (namely No. 2) is the waiting smallest serial number in 7 data packets of 2, 3, 4, 5, 6 and 7 in the cache queue, if so (because the user has received the data packet with the number 1, the current user expects to receive the data packet with the number 2), then outputting the data packet with the number 2 out of the cache queue. And so on until a non-consecutive sequence number in the cache queue.
The waiting minimum sequence number here varies with the packet going out of the buffer queue.
In the embodiment of the invention, after the self-adaptive buffer queues are dynamically regulated by introducing single_delay_seconds and total_delay_seconds, if the data packets of the buffer queues are sent out by receiving the waiting minimum serial number data packets, the data without packet loss is indicated, and retransmission is not needed. And the data packets of the buffer queue are forcedly removed through the time-out of the single_delay_seconds and the total_delay_seconds, and the data packets are considered to be lost data, and need to be retransmitted.
By introducing the self-adaptive buffer queue, the length of the buffer queue is dynamically adjusted based on an algorithm with the decreasing packet loss rate index, so that the audio data can be effectively rearranged, disordered packets and truly lost packets can be more accurately distinguished, the weak network scene of the audio and video can be better adapted, and the watching experience of a user can be enhanced.
Example six
Fig. 6 is a schematic structural diagram of a data packet retransmission apparatus according to a sixth embodiment of the present invention, as shown in fig. 6, where the apparatus includes: a transmission request receiving module 31, a judging module 32, a first retransmission policy determining module 33 and a second retransmission policy determining module 34.
The transmission request receiving module 31 is configured to receive a transmission request of a transmission data packet in a current period, where the transmission request includes at least one data packet to be transmitted, and two adjacent data packets are respectively provided with continuous serial numbers;
A judging module 32, configured to judge whether a transmission time of each data packet uploaded to the buffer queue is greater than or equal to a preset enqueue time threshold;
A first retransmission policy determining module 33, configured to retransmit the data packet greater than or equal to the preset enqueue time threshold if the transmission time is greater than or equal to the preset enqueue time threshold;
A second retransmission policy determining module 34, configured to, if the transmission time is less than the preset enqueue time threshold, perform retention check on the data packets with the transmission time less than the preset enqueue time threshold, upload each data packet to the client according to the sequence number of each data packet, clear the data packets that do not satisfy the retention check, and retransmit the data packets that do not satisfy the retention check; the data packets which do not meet the retention check are the data packets with the minimum sequence number, the retention time of which is greater than or equal to a preset retention time threshold value, and the data packets with the sequence number which is greater than the minimum sequence number.
On the basis of the technical scheme of the embodiment of the invention, the device further comprises:
And the transmission monitoring event setting module is used for setting the data packet transmission monitoring event.
Optionally, the transmission time and the residence time are obtained by monitoring based on the transmission monitoring event setting module.
Optionally, the preset residence time threshold and the preset enqueue time threshold are respectively determined based on a packet loss rate of a period previous to the current period.
On the basis of the technical scheme of the embodiment of the invention, the device further comprises:
The packet loss rate determining module is used for determining the packet loss rate of the current period based on the data packet expected to be retransmitted in the current period;
and the buffer queue adjusting module is used for correspondingly adjusting the preset enqueue time threshold and/or the preset residence time threshold based on the packet loss rate of the current period.
On the basis of the technical scheme of the embodiment of the invention, the packet loss rate determining module comprises:
a cumulative packet number determining unit configured to determine a cumulative packet number of a current period based on the packet number expected to be retransmitted at the current period and the packet number in the transmission request;
And the packet loss rate determining unit is used for determining the packet loss rate of the current period based on the number of the data packets expected to be retransmitted in the current period and the number of the accumulated data packets in the current period.
On the basis of the technical scheme of the embodiment of the invention, the buffer queue adjusting module comprises:
a first difference determining unit, configured to calculate a first difference between the packet loss rate of the current period and the packet loss rate of the previous period based on the packet loss rate of the current period and the packet loss rate of the previous period;
and the first buffer queue adjusting unit is used for correspondingly adjusting the preset enqueue time threshold and/or the preset residence time threshold if the first difference value is greater than or equal to a first preset difference value threshold.
On the basis of the technical scheme of the embodiment of the invention, the buffer queue adjusting module further comprises:
A second difference determining unit, configured to calculate a second difference between the first time and the second time based on a first time when the packet loss rate of the current period is calculated, and a second time when the preset enqueue time threshold and/or the preset residence time threshold are updated last time;
And the second buffer queue adjusting unit is used for correspondingly adjusting the preset enqueue time threshold and/or the preset residence time threshold if the second difference value is greater than or equal to a second preset difference value threshold.
The data packet retransmission device provided by the embodiment of the invention can execute the data packet retransmission method provided by any embodiment of the invention, and has the corresponding functional modules and beneficial effects of the execution method.
Example seven
Fig. 7 is a schematic structural diagram of an electronic device according to a seventh embodiment of the present invention, and as shown in fig. 7, the electronic device includes a processor 70, a memory 71, an input device 72, and an output device 73; the number of processors 70 in the electronic device may be one or more, one processor 70 being taken as an example in fig. 7; the processor 70, the memory 71, the input means 72 and the output means 73 in the electronic device may be connected by a bus or other means, in fig. 7 by way of example.
The memory 71 is a computer readable storage medium, and may be used to store a software program, a computer executable program, and modules, such as program instructions/modules (e.g., the transmission request receiving module 31, the judging module 32, the first retransmission policy determining module 33, and the second retransmission policy determining module 34) corresponding to the packet retransmission method in the embodiment of the present invention. The processor 70 executes various functional applications of the electronic device and data processing, i.e., implements the above-described packet retransmission method, by running software programs, instructions, and modules stored in the memory 71.
The memory 71 may mainly include a storage program area and a storage data area, wherein the storage program area may store an operating system, at least one application program required for functions; the storage data area may store data created according to the use of the terminal, etc. In addition, memory 71 may include high-speed random access memory, and may also include non-volatile memory, such as at least one magnetic disk storage device, flash memory device, or other non-volatile solid-state storage device. In some examples, memory 71 may further include memory remotely located relative to processor 70, which may be connected to the electronic device via a network. Examples of such networks include, but are not limited to, the internet, intranets, local area networks, mobile communication networks, and combinations thereof.
The input device 72 may be used to receive entered numeric or character information and to generate key signal inputs related to user settings and function control of the electronic device. The output means 73 may comprise a display device such as a display screen.
Example eight
An eighth embodiment of the present invention also provides a storage medium containing computer-executable instructions, which when executed by a computer processor, are for performing a method of data packet retransmission, the method comprising:
receiving a transmission request of a transmission data packet in a current period, wherein the transmission request comprises at least one data packet to be transmitted, and two adjacent data packets are respectively provided with continuous serial numbers;
Judging whether the transmission time of uploading each data packet to a cache queue is greater than or equal to a preset enqueue time threshold value or not;
If the transmission time is greater than or equal to the preset enqueue time threshold, retransmitting the data packet which is greater than or equal to the preset enqueue time threshold;
If the transmission time is smaller than the preset enqueue time threshold, carrying out retention check on the data packets with the transmission time smaller than the preset enqueue time threshold, uploading the data packets meeting the retention check to a client according to the serial numbers of the data packets, clearing the data packets not meeting the retention check, and retransmitting the data packets not meeting the retention check; the data packets which do not meet the retention check are the data packets with the minimum sequence number, the retention time of which is greater than or equal to a preset retention time threshold value, and the data packets with the sequence number which is greater than the minimum sequence number.
Of course, the storage medium containing the computer executable instructions provided in the embodiments of the present invention is not limited to the above-described method operations, and may also perform the related operations in the data packet retransmission method provided in any embodiment of the present invention.
From the above description of embodiments, it will be clear to a person skilled in the art that the present invention may be implemented by means of software and necessary general purpose hardware, but of course also by means of hardware, although in many cases the former is a preferred embodiment. Based on such understanding, the technical solution of the present invention may be embodied essentially or in a part contributing to the prior art in the form of a software product, which may be stored in a computer readable storage medium, such as a floppy disk, a Read-Only Memory (ROM), a random access Memory (Random Access Memory, RAM), a FLASH Memory (FLASH), a hard disk, or an optical disk of a computer, etc., and include several instructions for causing a computer electronic device (which may be a personal computer, a server, or a network device, etc.) to execute the method according to the embodiments of the present invention.
It should be noted that, in the embodiment of the packet retransmission apparatus, each unit and module included are only divided according to the functional logic, but not limited to the above-mentioned division, so long as the corresponding functions can be implemented; in addition, the specific names of the functional units are also only for distinguishing from each other, and are not used to limit the protection scope of the present invention.
Note that the above is only a preferred embodiment of the present invention and the technical principle applied. It will be understood by those skilled in the art that the present invention is not limited to the particular embodiments described herein, but is capable of various obvious changes, rearrangements and substitutions as will now become apparent to those skilled in the art without departing from the scope of the invention. Therefore, while the invention has been described in connection with the above embodiments, the invention is not limited to the embodiments, but may be embodied in many other equivalent forms without departing from the spirit or scope of the invention, which is set forth in the following claims.

Claims (10)

1. A method for retransmitting a data packet, comprising:
receiving a transmission request of a transmission data packet in a current period, wherein the transmission request comprises at least one data packet to be transmitted, and two adjacent data packets are respectively provided with continuous serial numbers;
Judging whether the transmission time of uploading each data packet to a cache queue is greater than or equal to a preset enqueue time threshold value or not;
If the transmission time is greater than or equal to the preset enqueue time threshold, retransmitting the data packet which is greater than or equal to the preset enqueue time threshold;
If the transmission time is smaller than the preset enqueue time threshold, carrying out retention check on the data packets with the transmission time smaller than the preset enqueue time threshold, uploading the data packets meeting the retention check to a client according to the serial numbers of the data packets, clearing the data packets not meeting the retention check, and retransmitting the data packets not meeting the retention check; the data packets which do not meet the retention verification are the data packets with the minimum serial numbers, the retention time of which is more than or equal to a preset retention time threshold value, and the data packets with the serial numbers, the retention time of which is more than the minimum serial numbers;
The retransmission refers to transmitting a data packet to be retransmitted to the client, if the retransmitted data packet is successfully uploaded to the client in the process of being transmitted to the client, the client receives the retransmitted data packet, and if the retransmitted data packet fails to be uploaded to the client, the retransmitted data packet is abandoned.
2. The method of claim 1, wherein after said receiving a transmission request for a transmission data packet of a current period, the method further comprises:
Setting a data packet transmission monitoring event;
Correspondingly, the transmission time and the residence time are respectively obtained by monitoring based on the data packet transmission monitoring event.
3. The method of claim 1, wherein the preset residence time threshold and the preset enqueue time threshold are each determined based on a packet loss rate of a period preceding a current period.
4. The method of claim 1, wherein after the clearing of the data packets that do not satisfy the retention check and the retransmission of the data packets that do not satisfy the retention check, the method further comprises:
Determining the packet loss rate of the current period based on the data packet expected to be retransmitted in the current period;
And correspondingly adjusting the preset enqueue time threshold and/or the preset residence time threshold based on the packet loss rate of the current period.
5. The method of claim 4, wherein the determining the packet loss rate for the current period based on the data packet expected to be retransmitted for the current period comprises:
Determining the number of accumulated data packets in the current period based on the number of data packets expected to be retransmitted in the current period and the number of data packets in the transmission request;
and determining the packet loss rate of the current period based on the number of the data packets expected to be retransmitted in the current period and the number of the accumulated data packets in the current period.
6. The method according to claim 4, wherein the correspondingly adjusting the preset enqueue time threshold and/or the preset hold-up time threshold based on the packet loss rate of the current period comprises:
calculating a first difference value between the packet loss rate of the current period and the packet loss rate of the previous period based on the packet loss rate of the current period and the packet loss rate of the previous period;
and if the first difference value is greater than or equal to a first preset difference value threshold value, correspondingly adjusting the preset enqueue time threshold value and/or the preset residence time threshold value.
7. The method of claim 6, wherein if the first difference is smaller than a first preset difference threshold, correspondingly adjusting the preset enqueue time threshold and/or the preset residence time threshold based on the packet loss rate of the current period, further comprises:
Calculating a second difference value between the first time and the second time based on a first time when the packet loss rate of the current period is calculated and a second time when the preset enqueue time threshold and/or the preset residence time threshold is updated last time;
And if the second difference value is greater than or equal to a second preset difference value threshold value, correspondingly adjusting the preset enqueue time threshold value and/or the preset residence time threshold value.
8. A data packet retransmission apparatus, comprising:
A transmission request receiving module, configured to receive a transmission request of a transmission data packet in a current period, where the transmission request includes at least one data packet to be transmitted, and two adjacent data packets are respectively provided with continuous serial numbers;
The judging module is used for judging whether the transmission time of each data packet uploaded to the buffer queue is greater than or equal to a preset enqueue time threshold value;
A first retransmission policy determining module, configured to retransmit the data packet greater than or equal to the preset enqueue time threshold if the transmission time is greater than or equal to the preset enqueue time threshold;
the second retransmission strategy determining module is used for carrying out retention check on the data packets with the transmission time smaller than the preset enqueue time threshold value if the transmission time is smaller than the preset enqueue time threshold value, uploading the data packets meeting the retention check to the client according to the serial numbers of the data packets, clearing the data packets not meeting the retention check, and retransmitting the data packets not meeting the retention check; the data packets which do not meet the retention verification are the data packets with the minimum serial numbers, the retention time of which is more than or equal to a preset retention time threshold value, and the data packets with the serial numbers, the retention time of which is more than the minimum serial numbers;
The retransmission refers to transmitting a data packet to be retransmitted to the client, if the retransmitted data packet is successfully uploaded to the client in the process of being transmitted to the client, the client receives the retransmitted data packet, and if the retransmitted data packet fails to be uploaded to the client, the retransmitted data packet is abandoned.
9. An electronic device, the electronic device comprising:
One or more processors;
A storage means for storing one or more programs;
the one or more programs, when executed by the one or more processors, cause the one or more processors to implement the method of data packet retransmission as recited in any one of claims 1-7.
10. A storage medium containing computer executable instructions which, when executed by a computer processor, are for performing the method of data packet retransmission as claimed in any one of claims 1 to 7.
CN202110070708.4A 2021-01-19 2021-01-19 Data packet retransmission method, device, electronic equipment and storage medium Active CN114866196B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202110070708.4A CN114866196B (en) 2021-01-19 2021-01-19 Data packet retransmission method, device, electronic equipment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202110070708.4A CN114866196B (en) 2021-01-19 2021-01-19 Data packet retransmission method, device, electronic equipment and storage medium

Publications (2)

Publication Number Publication Date
CN114866196A CN114866196A (en) 2022-08-05
CN114866196B true CN114866196B (en) 2024-05-24

Family

ID=82622853

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202110070708.4A Active CN114866196B (en) 2021-01-19 2021-01-19 Data packet retransmission method, device, electronic equipment and storage medium

Country Status (1)

Country Link
CN (1) CN114866196B (en)

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN116074252B (en) * 2023-03-07 2023-06-06 国仪量子(合肥)技术有限公司 UDP data transmission method and UDP data transmission device

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102149140A (en) * 2011-05-10 2011-08-10 北京邮电大学 End-to-end multi-link parallel transmission network control method
CN107995127A (en) * 2017-12-13 2018-05-04 深圳乐信软件技术有限公司 A kind of method and device for overload protection
CN109560901A (en) * 2018-11-14 2019-04-02 广州虎牙信息科技有限公司 A kind of data repeating method, device, terminal device and storage medium
CN111131075A (en) * 2019-11-21 2020-05-08 武汉兴图新科电子股份有限公司 High-concurrency data packet buffering method
CN111385218A (en) * 2018-12-28 2020-07-07 广州市百果园信息技术有限公司 Packet loss and flow control method, storage medium and equipment for message queue overload

Family Cites Families (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
TWI334293B (en) * 2007-03-06 2010-12-01 Xtera Comm Taiwan Co Ltd Method for transmitting network packets

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102149140A (en) * 2011-05-10 2011-08-10 北京邮电大学 End-to-end multi-link parallel transmission network control method
CN107995127A (en) * 2017-12-13 2018-05-04 深圳乐信软件技术有限公司 A kind of method and device for overload protection
CN109560901A (en) * 2018-11-14 2019-04-02 广州虎牙信息科技有限公司 A kind of data repeating method, device, terminal device and storage medium
CN111385218A (en) * 2018-12-28 2020-07-07 广州市百果园信息技术有限公司 Packet loss and flow control method, storage medium and equipment for message queue overload
CN111131075A (en) * 2019-11-21 2020-05-08 武汉兴图新科电子股份有限公司 High-concurrency data packet buffering method

Also Published As

Publication number Publication date
CN114866196A (en) 2022-08-05

Similar Documents

Publication Publication Date Title
US10542064B2 (en) Method, server side and system for computing bandwidth of network transmission of streaming media
CN107342848B (en) Self-adaptive code stream transmission method, device and equipment
CN109587510B (en) Live broadcast method, device, equipment and storage medium
WO2018058803A1 (en) Network-based real-time video transmission method and device
JP4491257B2 (en) Controlling the admission of data streams to the network based on end-to-end measurements
US8588093B2 (en) Streaming communication device, streaming communication method, and streaming communication system
JP2024509728A (en) Data retransmission processing method, device, computer equipment and computer program
CN110830460B (en) Connection establishing method and device, electronic equipment and storage medium
CN111741249B (en) Network congestion detection method and device
CN112104562A (en) Congestion control method and device, communication network and computer storage medium
CN115037416A (en) Data forward error correction processing method, device, electronic equipment and storage medium
CN114866196B (en) Data packet retransmission method, device, electronic equipment and storage medium
US10044833B2 (en) Data processing method and apparatus used for terminal application
CN110602568B (en) Video stream transmission packet loss retransmission method, device and storage device based on RTP
CN112492646A (en) Congestion control method and device based on congestion cause identification
CN111385218B (en) Packet loss and flow control method for overload of message queue, storage medium and equipment
WO2024109734A1 (en) Data transmission method and apparatus, electronic device, and storage medium
CN108540273B (en) Method and device for retransmitting data packet
CN110022218B (en) Multicast communication method, terminal device and storage medium
CN116920364A (en) Data processing method, device, electronic equipment and storage medium
CN117676695A (en) TCP transmission method, device and system
CN116634187A (en) Video stream processing method, device, equipment and medium based on confluence sending mechanism
CN116318545A (en) Video data transmission method, device, equipment and storage medium
CN112351049B (en) Data transmission method, device, equipment and storage medium
CN115001632A (en) Information transmission method and device, electronic equipment and readable storage medium

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
TA01 Transfer of patent application right
TA01 Transfer of patent application right

Effective date of registration: 20240422

Address after: Room 301, 3rd floor, 9 shangdijiu street, Haidian District, Beijing

Applicant after: Beijing Shenzhou Digital Cloud Information Technology Co.,Ltd.

Country or region after: China

Applicant after: Shenzhou Kuntai (Xiamen) Information Technology Co.,Ltd.

Address before: 430070 room 007, A301, third floor, building B1, software industry phase 4.1, No. 1, Software Park East Road, Donghu New Technology Development Zone, Wuhan City, Hubei Province (Wuhan area of free trade zone)

Applicant before: WUHAN DOUYU YULE NETWORK TECHNOLOGY Co.,Ltd.

Country or region before: China

GR01 Patent grant
GR01 Patent grant