CN111917525B - Data transmission method, device, equipment and readable storage medium - Google Patents

Data transmission method, device, equipment and readable storage medium Download PDF

Info

Publication number
CN111917525B
CN111917525B CN202010685990.2A CN202010685990A CN111917525B CN 111917525 B CN111917525 B CN 111917525B CN 202010685990 A CN202010685990 A CN 202010685990A CN 111917525 B CN111917525 B CN 111917525B
Authority
CN
China
Prior art keywords
data
message
time
data frame
time period
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
CN202010685990.2A
Other languages
Chinese (zh)
Other versions
CN111917525A (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.)
Nanjing Leading Technology Co Ltd
Original Assignee
Nanjing Leading 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 Nanjing Leading Technology Co Ltd filed Critical Nanjing Leading Technology Co Ltd
Priority to CN202010685990.2A priority Critical patent/CN111917525B/en
Publication of CN111917525A publication Critical patent/CN111917525A/en
Application granted granted Critical
Publication of CN111917525B publication Critical patent/CN111917525B/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/18Automatic repetition systems, e.g. Van Duuren systems
    • H04L1/1867Arrangements specially adapted for the transmitter end
    • H04L1/188Time-out mechanisms
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L43/00Arrangements for monitoring or testing data switching networks
    • H04L43/08Monitoring or testing based on specific metrics, e.g. QoS, energy consumption or environmental parameters
    • H04L43/0852Delays
    • H04L43/0864Round trip delays
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L43/00Arrangements for monitoring or testing data switching networks
    • H04L43/16Threshold monitoring

Landscapes

  • Engineering & Computer Science (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Environmental & Geological Engineering (AREA)
  • Communication Control (AREA)

Abstract

The application relates to a data transmission method, a device, equipment and a readable storage medium, and belongs to the technical field of streaming media data transmission. According to the method and the device, the average round trip time of the data frame message corresponding to the current time period is determined through each interval of the set time, the average round trip time of the data frame message is adjusted through the preset set time threshold value to obtain the data confirmation time, whether the data confirmation message corresponding to the data frame message returned by the data receiving device is received within the data confirmation time after each frame of the data frame message is sent or not is monitored, if not, the data frame message is resent, the effective utilization rate of bandwidth can be improved, the phenomenon that a sending end waits for a long time after sending data each time according to the overlong confirmation time is avoided, and therefore the real-time performance of data transmission is effectively improved, and meanwhile, the blocking phenomenon of audio and video can be remarkably improved under the weak network environment.

Description

Data transmission method, device, equipment and readable storage medium
Technical Field
The application belongs to the technical field of streaming media data transmission, and particularly relates to a data transmission method, a device, equipment and a readable storage medium.
Background
In the field of streaming media application, RTMP (Real Time Messaging Protocol, real-time messaging protocol) may be currently used to transmit audio and video data.
Because the data transmission quantity of the audio and video data is generally larger, the real-time requirement on the data transmission is also higher. If the real-time performance of data transmission is poor and the bandwidth utilization rate is low, the playing of the audio and the video is discontinuous, and the phenomenon of clamping and stopping occurs. The RTMP protocol is an audio and video data transmission protocol, and is mainly used for transmitting audio and video data between clients/streaming media servers supporting the RTMP protocol. However, in a weak network environment, once network congestion occurs, throughput can be greatly reduced, and audio and video cannot be normally played due to the reduction of real-time performance and bandwidth utilization rate of transmission.
Disclosure of Invention
In order to solve the existing technical problems, the embodiments of the present application provide a data transmission method, apparatus, device, and readable storage medium, which can improve the real-time performance of data transmission, and simultaneously, can significantly improve the blocking phenomenon of audio and video in a weak network environment.
In a first aspect, an embodiment of the present application provides a data transmission method, applied to a data sending device, where the method includes:
In the data transmission process, setting time at each interval, and determining the average round trip time of a data frame message corresponding to the current time period;
if the average round trip time of the data frame message is larger than a set time threshold, the set time threshold is used as the data confirmation duration corresponding to the current time period; or if the average round trip time of the data frame message is smaller than or equal to a set time threshold, taking the average round trip time of the data frame message as the data confirmation time corresponding to the current time period;
after each frame of data frame message is sent, if the data confirmation message corresponding to the data frame message returned by the data receiving equipment is not received within the data confirmation time length, the data frame message is retransmitted.
According to the data transmission method provided by the embodiment of the application, the average round-trip time of the data frame message corresponding to the current time period is determined through each interval of set time, the average round-trip time of the data frame message is adjusted through the preset set time threshold value to obtain the data confirmation time, whether the data confirmation message corresponding to the data frame message returned by the data receiving device is received within the data confirmation time after each frame of data frame message is sent or not is monitored, if not, the data frame message is retransmitted, the data confirmation time can be determined in real time according to the average round-trip time of the data frame message in the network, if the average round-trip time of the real-time data frame message is too large, the set time threshold value can be adopted as the data confirmation time to avoid the overlong of the data confirmation time, so that the data confirmation time can be determined according to the real-time condition of the network, the data confirmation time is prevented from being set too short, the repeated retransmission of the data frame message caused, the effective utilization rate of bandwidth can be improved, and the situation that the sending end waits for a longer time after each time of sending data is avoided according to the confirmation time is overlong, so that the real-time of data transmission can be effectively improved, and meanwhile, the audio and video blocking phenomenon can be remarkably improved under the weak network environment.
In one possible implementation manner, the determining the average round trip time of the data frame message corresponding to the current time period includes:
determining the number of data acknowledgement messages received in a previous time period adjacent to the current time period; each frame data confirmation message carries a time stamp, and the time stamp is used for indicating the sending time of the data frame message corresponding to the data confirmation message;
for each received frame data confirmation message, taking the time difference between the time when the data confirmation message is received and the time stamp in the data confirmation message as the round trip time of the data frame message corresponding to the data confirmation message;
and taking the ratio of the sum of all obtained round trip times to the number of received data confirmation messages as the average round trip time of the data frame messages corresponding to the current time period.
In the data transmission method provided by the embodiment, the data confirmation messages all carry time stamps, which are used for indicating the sending time of the data frame messages corresponding to the data confirmation messages, wherein the time stamps are the same as the time stamps of the data frame messages corresponding to the data confirmation messages; the ratio of the sum of all round trip time to the number of received data confirmation messages is used as the average round trip time of the data frame messages corresponding to the current time period, so that the average round trip time of the data frame messages corresponding to the current time period is determined, the average round trip time of the data frame messages can be accurately calculated, the accuracy is improved, the real-time performance of data transmission is improved, and the blocking phenomenon of the audio and video played by the weak network is improved.
In one possible implementation, the method further includes:
and if the data confirmation message corresponding to any frame data message sent after the current data frame message is received, retransmitting the current frame message.
The data transmission method provided in this embodiment further includes: and if the data confirmation message corresponding to any frame data message sent after the current data frame message is received, retransmitting the current frame message. The method perceives the data frame message which is possibly lost in advance, and retransmits the data confirmation message corresponding to the data frame message in an unequal manner, so that the real-time performance of data transmission can be further improved, and the blocking phenomenon of audio and video can be remarkably improved in a weak network environment.
In one possible implementation, the method further includes:
determining a network bandwidth corresponding to a current time period according to the number of data confirmation messages received in the previous time period adjacent to the current time period, a preset message length upper limit value and the duration of the previous time period;
according to the network bandwidth corresponding to the current time period, determining the network real-time bandwidth corresponding to the current time period;
determining a real-time maximum flow corresponding to the current time period according to the network real-time bandwidth corresponding to the current time period and a preset flow coefficient; the preset flow coefficient is greater than 1;
And stopping sending the data frame message if the actual flow of the data frame message is monitored to reach the real-time maximum flow corresponding to the current time period.
According to the data transmission method provided by the embodiment, according to the network bandwidth corresponding to the current time period, the network real-time bandwidth corresponding to the current time period is determined; according to the network real-time bandwidth corresponding to the current time period and a preset flow coefficient, determining the real-time maximum flow corresponding to the current time period; the preset flow coefficient is larger than 1; and stopping sending the data frame message if the actual flow of the data frame message is monitored to reach the real-time maximum flow corresponding to the current time period. The method monitors the actual flow of the data frame message transmitted every second, and stops transmitting the data frame message when the actual flow reaches the real-time maximum flow corresponding to the current time period, so that the transmission of the data frame is controlled in flow, and excessive preemption of bandwidth is avoided. Meanwhile, the flow value is slightly larger than the real-time bandwidth of the network, so that the bandwidth competitiveness can be improved, and more bandwidth can be preempted under the condition of network congestion.
In one possible implementation manner, the determining, according to the network bandwidth corresponding to the current time period, the network real-time bandwidth corresponding to the current time period includes:
If the network bandwidth corresponding to the current time period is smaller than a preset bandwidth value, taking the preset bandwidth value as the network real-time bandwidth corresponding to the current time period; or if the network bandwidth corresponding to the current time period is greater than or equal to a preset bandwidth value, taking the network bandwidth corresponding to the current time period as the network real-time bandwidth corresponding to the current time period.
The data transmission method provided in this embodiment determines, according to the network bandwidth corresponding to the current time period, the network real-time bandwidth corresponding to the current time period, including: if the network bandwidth corresponding to the current time period is smaller than the preset bandwidth value, taking the preset bandwidth value as the network real-time bandwidth corresponding to the current time period; or if the network bandwidth corresponding to the current time period is greater than or equal to the preset bandwidth value, taking the network bandwidth corresponding to the current time period as the network real-time bandwidth corresponding to the current time period. The method limits the network bandwidth through the preset bandwidth value, thereby obtaining the network real-time bandwidth, ensuring the minimum bandwidth required by data transmission, improving the real-time performance of the data transmission, and remarkably improving the blocking phenomenon of audio and video in a weak network environment.
In one possible implementation manner, the data frame message and the corresponding data confirmation message carry a wave number; the determining the network bandwidth corresponding to the current time period according to the number of the data confirmation messages received in the previous time period adjacent to the current time period, the preset message length upper limit value and the duration of the previous time period comprises the following steps:
taking the time of receiving a first data confirmation message carrying a previous wave number as the starting time of the previous time period, and taking the time of receiving a last data confirmation message carrying the previous wave number before receiving a first data confirmation message carrying a next wave number as the ending time of the previous time period;
determining the duration of the previous time period according to the ending time of the previous time period and the starting time of the previous time period;
determining the number of received data confirmation messages carrying the last wave number as the number of the received data confirmation messages in the last time period;
and obtaining the network bandwidth corresponding to the current time period according to the number of the data confirmation messages received in the previous time period, the preset upper limit value of the message length and the duration of the previous time period.
In the data transmission method provided by the embodiment, the data frame message and the corresponding data confirmation message carry the wave number; according to the number of data confirmation messages received in the previous time period adjacent to the current time period, a preset message length upper limit value and the duration of the previous time period, determining the network bandwidth corresponding to the current time period comprises the following steps: taking the time of receiving the first data confirmation message carrying the previous wave number as the starting time of the previous time period, and taking the time of receiving the last data confirmation message carrying the previous wave number before receiving the first data confirmation message carrying the next wave number as the ending time of the previous time period; determining the duration of the previous time period according to the ending time of the previous time period and the starting time of the previous time period; determining the number of received data confirmation messages carrying the last wave number as the number of the received data confirmation messages in the last time period; and obtaining the network bandwidth corresponding to the current time period according to the number of the data confirmation messages received in the previous time period, the preset message length upper limit value and the duration of the previous time period. According to the method, the wave numbers are set through the data frame messages and the corresponding data confirmation messages, the network bandwidth is accurately calculated through monitoring each wave of the data frame messages, the real-time monitoring of data transmission is improved, the possibility of excessive preemption of the bandwidth caused by overhigh data transmission frequency is provided, and the reliable data transmission is ensured.
In a possible implementation manner, the data frame message and the corresponding data acknowledgement message carry window size information, where the window size information is used to represent an empty space of a local data frame buffer queue, and the method further includes:
before each wave data frame message is sent, window size information carried by a data confirmation message received last time is obtained;
determining the total data quantity of the current wave data frame message to be transmitted according to the window size information, so that the total data quantity of the current wave data frame message is smaller than or equal to the window size information;
and sending the current wave data frame message according to the determined total data quantity of the current wave data frame message.
The data transmission method provided in this embodiment, the data frame message and the corresponding data acknowledgement message carry window size information, where the window size information is used to represent an empty space of a local data frame buffer queue, and the method further includes: before each wave data frame message is sent, window size information carried by a data confirmation message received last time is obtained; determining the total data quantity of the current wave data frame message to be transmitted according to the window size information, so that the total data quantity of the current wave data frame message is smaller than or equal to the window size information; and sending the current wave data frame message according to the determined total data quantity of the current wave data frame message. The method ensures that excessive data cannot be sent by controlling the flow of the end window value, and avoids that data receiving equipment receives the data but does not cache the data.
In a possible implementation manner, the data confirmation message carries a receiving type identifier, and the method further includes:
if a data confirmation message corresponding to the data frame message returned by the data receiving equipment is received within the data confirmation time length, and the receiving type identifier of the data confirmation message is a first type identifier, retransmitting the data frame message; the first type identifier is used for indicating that the data receiving device receives the data frame message and does not store the data frame message; or alternatively, the process may be performed,
if a data confirmation message corresponding to the data frame message returned by the data receiving equipment is received within the data confirmation time length, and the receiving type identifier of the data confirmation message is a second type identifier, deleting the data frame message from a sending cache; the second type identifier is used for indicating that the data receiving device receives and stores the data frame message.
The data transmission method provided in this embodiment, the data confirmation message carries a receiving type identifier, the method further includes: if a data confirmation message corresponding to the data frame message returned by the data receiving equipment is received within the data confirmation time length, and the receiving type identifier of the data confirmation message is a first type identifier, retransmitting the data frame message; the first type identifier is used for indicating that the data receiving equipment receives the data frame message but does not store the data frame message; or if the data confirmation message corresponding to the data frame message returned by the data receiving equipment is received within the data confirmation time length and the receiving type identifier of the data confirmation message is the second type identifier, deleting the data frame message from the sending buffer; the second type of identification is used for indicating that the data receiving device receives and stores the data frame message. In the method, the design of returning the data confirmation message after receiving the data frame message improves the accuracy of network bandwidth calculation, and meanwhile, the data frame is retransmitted when the first type identification is received, so that the reliable transmission of the data is ensured.
In a second aspect, an embodiment of the present application provides a data transmission method, applied to a data receiving device, where the method includes:
in the data transmission process, receiving a data frame message sent by data sending equipment;
transmitting a data confirmation message corresponding to the data frame message to the data transmitting device, so that the data transmitting device retransmits the data frame message when the data confirmation message corresponding to the data frame message returned by the data receiving device is not received within the data confirmation time; the data confirmation time length is the average round trip time of the data frame message corresponding to the current time period or a set time threshold.
In one possible implementation manner, the data confirmation message carries a receiving type identifier, and the sending, to the data sending device, the data confirmation message corresponding to the data frame message includes:
if the data frame message is not stored after the data frame message is received, sending a data confirmation message containing a first type identifier to the data sending equipment; the first type identifier is used for indicating that the data receiving device receives the data frame message and does not store the data frame message; or alternatively, the process may be performed,
If the data frame message is stored after the data frame message is received, sending a data confirmation message containing a second type identifier to the data sending equipment; the second type identifier is used for indicating that the data receiving device receives and stores the data frame message.
In a third aspect, an embodiment of the present application provides a data transmitting apparatus, including:
the data confirmation unit is used for determining the average round trip time of the data frame message corresponding to the current time period every interval set time in the data transmission process; if the average round trip time of the data frame message is larger than a set time threshold, the set time threshold is used as the data confirmation duration corresponding to the current time period; or if the average round trip time of the data frame message is smaller than or equal to a set time threshold, taking the average round trip time of the data frame message as the data confirmation time corresponding to the current time period;
and the data retransmission unit is used for retransmitting the data frame message if the data confirmation message corresponding to the data frame message returned by the data receiving equipment is not received within the data confirmation time after each frame of data frame message is transmitted.
In a possible implementation manner, the data confirmation unit is further configured to:
Determining a network bandwidth corresponding to a current time period according to the number of data confirmation messages received in the previous time period adjacent to the current time period, a preset message length upper limit value and the duration of the previous time period;
according to the network bandwidth corresponding to the current time period, determining the network real-time bandwidth corresponding to the current time period;
determining a real-time maximum flow corresponding to the current time period according to the network real-time bandwidth corresponding to the current time period and a preset flow coefficient; the preset flow coefficient is greater than 1;
and stopping sending the data frame message if the actual flow of the data frame message is monitored to reach the real-time maximum flow corresponding to the current time period.
In a possible implementation manner, the data confirmation message carries a receiving type identifier, and the data confirmation unit is further configured to:
if a data confirmation message corresponding to the data frame message returned by the data receiving equipment is received within the data confirmation time length, and the receiving type identifier of the data confirmation message is a first type identifier, retransmitting the data frame message; the first type identifier is used for indicating that the data receiving device receives the data frame message and does not store the data frame message; or alternatively, the process may be performed,
If a data confirmation message corresponding to the data frame message returned by the data receiving equipment is received within the data confirmation time length, and the receiving type identifier of the data confirmation message is a second type identifier, deleting the data frame message from a sending cache; the second type identifier is used for indicating that the data receiving device receives and stores the data frame message.
In a fourth aspect, an embodiment of the present application provides a data receiving apparatus, including:
the data receiving unit is used for receiving the data frame message sent by the data sending equipment in the data transmission process;
the data feedback unit is used for sending a data confirmation message corresponding to the data frame message to the data sending equipment, so that the data sending equipment retransmits the data frame message when the data confirmation message corresponding to the data frame message returned by the data receiving equipment is not received within the data confirmation time length; the data confirmation time length is the average round trip time of the data frame message corresponding to the current time period or a set time threshold.
In a fifth aspect, embodiments of the present application provide a data transmission device, including a memory and a processor, where the memory stores a computer program executable on the processor, and when the computer program is executed by the processor, causes the processor to implement the method according to any one of the first aspects.
In a sixth aspect, embodiments of the present application provide a data receiving apparatus comprising a memory and a processor, the memory having stored thereon a computer program executable on the processor, which when executed by the processor causes the processor to implement the method of any of the second aspects.
In a seventh aspect, embodiments of the present application provide a computer readable storage medium having a computer program stored therein, which when executed by a processor, implements the method of any one of the first or second aspects.
The technical effects caused by any implementation manner of the second aspect to the seventh aspect may refer to the technical effects caused by the corresponding implementation manner of the first aspect, and are not repeated here.
Drawings
In order to more clearly illustrate the technical solutions of the embodiments of the present application, the drawings that are needed in the description of the embodiments will be briefly described below, it being obvious that the drawings in the following description are only some embodiments of the present application, and that other drawings may be obtained according to these drawings without inventive effort for a person skilled in the art.
Fig. 1 is an application scenario schematic diagram of a data transmission method provided in an embodiment of the present application;
fig. 2 is a flow chart of a data transmission method according to an embodiment of the present application;
fig. 3 is a flow chart of another data transmission method according to an embodiment of the present application;
fig. 4 is a flow chart of another data transmission method according to an embodiment of the present application;
fig. 5 is a flow chart of another data transmission method according to an embodiment of the present application;
fig. 6 is a flowchart of another data transmission method according to an embodiment of the present application;
fig. 7 is an interaction diagram of a data transmission method provided in an embodiment of the application;
fig. 8 is a schematic structural diagram of a data sending device according to an embodiment of the present application;
fig. 9 is a schematic structural diagram of a data receiving device according to an embodiment of the present application;
fig. 10 is a schematic structural diagram of a data sending device according to an embodiment of the present application;
fig. 11 is a schematic structural diagram of a data receiving device according to an embodiment of the present application.
Detailed Description
For the purposes of clarity, technical solutions and advantages of the present application, the following description will be given in further detail with reference to the accompanying drawings, and it is apparent that the described embodiments are only some embodiments of the present application, but not all embodiments. All other embodiments, which can be made by one of ordinary skill in the art without undue burden from the present disclosure, are within the scope of the present disclosure.
The present application will now be described in further detail with reference to the accompanying drawings and specific examples.
Fig. 1 is an application scenario schematic diagram of a data transmission method provided in an embodiment of the present application. In the scenario shown in fig. 1, a data transmitting apparatus 100 and a data receiving apparatus 200 are included. The data transmitting apparatus 100 and the data receiving apparatus 200 are connected to the network 300, respectively. The data transmitting device 100 and the data receiving device 200 may be terminal devices with communication functions, such as a mobile phone, a palm computer, a PC, an all-in-one machine, etc., where when there are multiple terminal devices, a distributed structure is formed between each terminal device. The data transmitting apparatus 100 adds a transmission time stamp to the header of the data frame message, the data receiving apparatus 200 replies a data acknowledgement message after receiving the data frame message, and the data receiving apparatus 200 determines the average round trip time of the data frame message corresponding to the current time period at intervals of a set time, for example, 5 seconds; obtaining data confirmation time according to the average round trip time of the data frame message and the set time threshold; after each frame of data frame message is sent, if the data confirmation message corresponding to the data frame message returned by the data receiving equipment is not received within the data confirmation time length, the data frame message is retransmitted.
Fig. 1 is merely an example of an application scenario for implementing the data transmission method according to the embodiment of the present application, and the embodiment of the present application is not limited to the scenario described in fig. 1. For example, in some embodiments, there may be a plurality of data transmitting devices 100 and data receiving devices 200. In other embodiments, the data transmission device 100 is not used only to transmit data frame messages, but to transmit data frame messages at some times and to receive data frame messages at other times; the data receiving apparatus 200 may also play the role of a data transmitting end and a data receiving end at different times, respectively, as the data transmitting apparatus 100.
It should be noted that the following description is only illustrative of the embodiments of the present application and is not limiting. In specific implementation, the technical scheme provided by the embodiment of the application can be flexibly applied according to actual needs. The data transmitting device and the data receiving device are only for illustrating the technical scheme of the application, and the two opposite ends at a certain moment in the data transmission process are defined, so that the technical scheme of the application is not limited.
The data transmission method is a reliable network transmission protocol based on UDP, and can be called RTBF (real time based on flow calculate, real-time data transmission protocol based on flow measurement and calculation), and a reliable transmission mechanism of data is realized at an application layer instead of a transmission layer (kernel protocol stack) like a TCP protocol.
The data transmission method of the application comprises six data messages, and the format is as follows:
1. SYN (Synchronize Sequence Numbers, sync signal), 4 bytes, assigned 0XFF00FF00, representing a request to establish a link;
2. ACK,4 bytes, assigned 0X00FF, indicating a response to a request to establish a link;
3. FIN (Finish, end flag), 4 bytes, assigned 0xfff 0000, indicating closing the link;
4. the format of the data frame message, 28 bytes, is shown in table 1;
TABLE 1
5. The heartbeat message, 4 bytes, is assigned 0XFF00FFFF;
6. data acknowledgement ACK,20 bytes, is divided into two types, the format is shown in Table 2;
TABLE 2
The data transmission method is realized based on the six data messages.
Before the data transmission of the present application starts, the data transmitting apparatus 100 and the data receiving apparatus 200 determine the link by transmitting SYN (Synchronize Sequence Numbers, synchronization signal), ACK, and SYN data message, and the process thereof is similar to the three-way handshake of TCP, which is implemented between the data transmitting apparatus 100 and the data receiving apparatus 200.
According to the data transmission method, heartbeat keep-alive is also carried out at the application layer, the sending end and the opposite end mutually send heartbeat packets when no data is transmitted, and the dead link is automatically detected.
Fig. 2 is a schematic flow chart of a data transmission method provided in an embodiment of the present application, referring to fig. 2, where the data transmission method is applied to a data sending device, and includes:
step S201, determining the average round trip time of the data frame message corresponding to the current time period.
In the data transmission process, every interval sets time, the average round trip time of the data frame message corresponding to the current time period is determined. Optionally, the setting time of the average round trip time of the data frame message corresponding to the current time period is determined to be 5 seconds every time interval.
Illustratively, when the set time is 5s, the data transmission apparatus 100 determines the average round trip time rtt of the data frame message corresponding to the current period every 5 s.
Step S202, judging whether the average round trip time of the data frame message is larger than a set time threshold. If yes, go to step S203; if not, step S204 is performed.
Alternatively, the average round trip time rtt of the data frame packet may have a set time threshold as an upper limit value.
For example, the set time threshold of the average round trip time rtt of the data frame packet is 5ms, and it is determined whether the average round trip time of the data frame packet is greater than the set time threshold by 5ms.
In step S203, the set time threshold is used as the data confirmation duration corresponding to the current time period.
If the calculated average round trip time of the data frame message is 6ms, because 6ms is greater than the set time threshold value 5ms in value, if the judgment result is yes, the set time threshold value 5ms is taken as the data confirmation time length corresponding to the current time period.
Step S204, the average round trip time of the data frame message is used as the data confirmation duration corresponding to the current time period.
If the calculated average round-trip time of the data frame message is 3ms, the calculated average round-trip time of the data frame message is 3ms as the data confirmation time corresponding to the current time period because the 3ms is less than or equal to the set time threshold value of 5ms in value, and the judgment result is no.
Step S205, after each frame of data frame message is sent, if the data confirmation message corresponding to the data frame message returned by the data receiving device is not received within the data confirmation time, the data frame message is retransmitted.
For example, taking the data confirmation time corresponding to the current time period as an example, after each frame of data frame message is sent, if the data confirmation message corresponding to the data frame message returned by the data receiving device is not received within 3ms from the moment of sending the data frame message, the data frame message is retransmitted. The time of sending the data frame message can be obtained by the time stamp of the data frame message head.
The data transmission method determines the average round trip time of the data frame message corresponding to the current time period through each interval set time, adjusts the average round trip time of the data frame message through a preset set time threshold value to obtain data confirmation time, monitors whether the data confirmation message corresponding to the data frame message returned by the data receiving equipment is received within the data confirmation time after each frame of data frame message is sent, and retransmits the data frame message if the data confirmation message is not received, so that the real-time performance of data transmission is effectively improved, the effective utilization rate of bandwidth is improved, and the blocking phenomenon of audio and video can be remarkably improved in a weak network environment.
In some embodiments, the determining the average round trip time of the data frame packet corresponding to the current time period in step S201, as shown in fig. 5, includes:
in step S2011, the number of data acknowledgement messages received in the previous time period adjacent to the current time period is determined.
Each frame data confirmation message carries a time stamp, and the time stamp is used for indicating the sending time of the data frame message corresponding to the data confirmation message.
The head of the data frame message and the data confirmation message carries a frame number, the frame number automatically grows in the data transmission process, and the stepping value is 1.
For example, if the set time is 5s, the data transmission apparatus 100 determines the number of data confirmation messages received in the last time period of 5s adjacent to the current time period of 5s, denoted as n.
Step S2012, regarding each received frame data confirmation message, the time difference between the time when the data confirmation message is received and the time stamp in the data confirmation message is used as the round trip time of the data frame message corresponding to the data confirmation message.
For each received frame data confirmation message, the time difference between the time of receiving the data confirmation message and the time stamp in the data confirmation message is taken as the round trip time t of the data frame message corresponding to the data confirmation message i
Step S2013, the ratio of the sum of all round trip times to the number of received data confirmation messages is taken as the average round trip time of the data frame messages corresponding to the current time period.
Illustratively, when receiving the data acknowledgement messages of the n data frame messages, according to the round trip time t of the data frame messages corresponding to the respective data acknowledgement messages i The sum of all round trip times T is accumulated. The ratio of the sum T of all round trip times to the number n of received data acknowledgement messages is taken as the average round trip time rtt of the data frame messages corresponding to the current time period, and can be calculated by the following formula:
To ensure the accuracy of the rtt, the rtt value is invalidated every time 5s elapses, and the data transmission apparatus 100 recalculates the new rtt value.
In some embodiments, the above method further comprises:
and if the data confirmation message corresponding to any frame data message sent after the current data frame message is received, retransmitting the current frame message.
The smaller the upper limit value of rtt is, the better the real-time performance of transmission is, so that the effective utilization rate of bandwidth can be reduced, but the real-time performance is greatly improved, and the method is particularly suitable for transmitting data with high requirements on real-time performance, such as audio and video.
In one embodiment, when the data acknowledgement message of the nth data frame message is not received, if the data acknowledgement messages of the n+1 and n+2 data frame messages are already received, retransmitting the current frame message.
According to the method, the RTBF senses the messages which may be lost in advance, for example, the ACK of the messages with different Nth messages arrives for retransmission, so that the instantaneity is improved.
Fig. 3 is a flow chart illustrating another data transmission method provided in an embodiment of the present application, please refer to fig. 3, and in some embodiments, the method further includes:
step S301, determining the network bandwidth corresponding to the current time period according to the number of data confirmation messages received in the previous time period adjacent to the current time period, the preset upper limit value of the message length and the duration of the previous time period.
The head of the data frame message of the data transmission method carries the wave number, and the batch of data frame messages sent out each time have the same wave number.
And determining the network bandwidth Wn corresponding to the current time period according to the number sum of the data confirmation messages received in the previous time period adjacent to the current time period, a preset message length upper limit value length and the duration (t 2-t 1) of the previous time period.
Alternatively, the preset message length upper limit may be 1500 bytes.
Step S302, according to the network bandwidth corresponding to the current time period, determining the network real-time bandwidth corresponding to the current time period.
In some embodiments, according to the network bandwidth Wn corresponding to the current time period, in combination with a preset bandwidth threshold, the network real-time bandwidth Wr corresponding to the current time period is determined.
Optionally, the preset bandwidth threshold is a minimum bandwidth threshold.
Optionally, when determining the network real-time bandwidth corresponding to the current time period according to the network bandwidth corresponding to the current time period, the method may be implemented as follows: if the network bandwidth corresponding to the current time period is smaller than the preset bandwidth value, taking the preset bandwidth value as the network real-time bandwidth corresponding to the current time period; or if the network bandwidth corresponding to the current time period is greater than or equal to the preset bandwidth value, taking the network bandwidth corresponding to the current time period as the network real-time bandwidth corresponding to the current time period.
Step S303, determining the real-time maximum flow corresponding to the current time period according to the network real-time bandwidth corresponding to the current time period and the preset flow coefficient; the preset flow coefficient is greater than 1.
Optionally, the preset flow coefficient value interval may be (1, 2).
Optionally, the preset flow coefficient is 1.25.
In some embodiments, according to the network real-time bandwidth Wr and the preset flow coefficient p corresponding to the current time period, the real-time maximum flow corresponding to the current time period is determined according to the following formula:
flow=p*Wr
step S304, if the actual flow of the data frame message is monitored to reach the real-time maximum flow corresponding to the current time period, stopping sending the data frame message.
In some embodiments, the data transmission device 100 accumulates the total number of bytes count transmitted per second, and when the count value is greater than the real-time maximum flow, no data frame message is transmitted.
After the real-time maximum flow is achieved, the problem that when the upper limit value of the rtt is set to be too small, the sending frequency is possibly too high, and network storm is caused can be solved, the RTBF accumulates the total number of bytes count sent per second, and when the count value is larger than the flow, data can not be sent any more, and the network storm caused by excessive bandwidth preemption is avoided.
In some embodiments, the data frame message and the corresponding data acknowledgement message carry a wave number; step S301, determining a network bandwidth corresponding to a current time period according to the number of data acknowledgement messages received in the previous time period adjacent to the current time period, a preset message length upper limit value, and a duration of the previous time period, including:
step S3011 takes the time of receiving the first data acknowledgement message carrying the previous wave number as the starting time of the previous time period, and takes the time of receiving the last data acknowledgement message carrying the previous wave number before receiving the first data acknowledgement message carrying the next wave number as the ending time of the previous time period.
For example, the wave number of the first wave data frame message sent by the sending end is recorded as k, the number of the messages is m, the sequence number of the first wave data frame message is khead, the sequence number of the last data frame message is ktail, when the receiving end receives the data frame message and then returns a data acknowledgement message ACK acknowledgement, the sending end receives the ACK of the first k wave message (not necessarily the ACK of the khead message), the time stamp t1 is recorded, the message ACK counter sum is self-increased, then the counter is self-increased every ACK of the k wave message is received, and the time stamp t2 is recorded (t 2 is continuously refreshed, every ACK is refreshed, and t1 is unchanged). When the ACK of the first message of the k+1 wave arrives, the ACK of all messages of the k wave is considered to be returned, and the bandwidth of the network is calculated. The end time of the previous time period and the start time of the previous time period are first determined. When the starting time of the previous time period is the ACK of the message received by the first kth wave (not necessarily the ACK of the khead message), the recorded time stamp t1; the end time of the last time period is the time of the last data confirmation message carrying the wave number K received before the first data confirmation message carrying the wave number K+1 is received.
Step S3012, determining the duration of the previous time period according to the end time of the previous time period and the start time of the previous time period.
Illustratively, the last time period has a duration of (t 2-t 1).
Step S3013, determining the number of received data acknowledgement messages carrying the last wave number, as the number of data acknowledgement messages received in the last time period.
For example, the number sum of ACKs received by the transmitting end in the period t2-t1 may be determined by allowing the counter to self-increment every ACK of a k-th wave packet.
Step S3014, obtaining the network bandwidth corresponding to the current time period according to the number of the data confirmation messages received in the previous time period, the preset upper limit value of the message length and the duration of the previous time period.
For example, because the transmitting end receives sum ACKs in the time period t2-t1, that is, the bandwidth of the current link may enable the receiving end to receive sum data packets in the time period of (t 2-t 1) milliseconds, the number total of data packets that can be transmitted by the link in 1 second is:
the length upper limit of the data message is length, and the current network bandwidth Wn is calculated by the following formula:
alternatively, when the sum value is smaller than a predetermined threshold (for example, a certain wave of data has only two messages), the Wn value is considered invalid, and the RTBF continues to calculate a new reasonable Wn value.
Fig. 4 is a flow chart illustrating another data transmission method provided in the embodiment of the present application, referring to fig. 4, in some embodiments, a data frame packet and a corresponding data acknowledgement packet carry window size information, where the window size information is used to represent an empty space of a local data frame buffer queue, and the method further includes:
step S401, before each wave of data frame message is sent, the window size information carried by the data confirmation message received last time is obtained.
In the data transmission method, the data frame message and the corresponding data confirmation message carry window size information. Before transmitting each wave data frame message, the data transmitting apparatus 100 acquires window size information carried by the data acknowledgement message received last time. The window size information is a variable amount. The window size information has a preset initial value, and may be 3000 buffers, for example. The byte amount can be determined by the number of the buffer areas and the upper limit of the length of the data frame message.
Step S402, determining the total data volume of the current wave data frame message to be transmitted according to the window size information, so that the total data volume of the current wave data frame message is smaller than or equal to the window size information.
The window size information indicates the free space of the local data frame buffer queue according to the window size information, and the window size information is used for indicating the free space of the local data frame buffer queue. The data transmitting apparatus 100 determines the total data amount of the current wave data frame message to be transmitted according to the window size information, and ensures that the total data amount of the current wave data frame message is less than or equal to the window size information.
Step S403, according to the determined total data quantity of the current wave data frame message, the current wave data frame message is sent.
In some embodiments, the data packet returned by the data receiving device may further carry a receiving type identifier, where the receiving type identifier may include a first type identifier and a second type identifier, where the first type identifier is used to indicate that the data receiving device receives the data frame packet and does not store the data frame packet, and the second type identifier is used to indicate that the data receiving device receives and stores the data frame packet. If the data transmitting device receives a data confirmation message corresponding to the data frame message returned by the data receiving device within the data confirmation time length, and the receiving type identifier of the data confirmation message is a first type identifier, retransmitting the data frame message;
If the data confirmation message corresponding to the data frame message returned by the data receiving device is received within the data confirmation time length and the receiving type identifier of the data confirmation message is the second type identifier, deleting the data frame message from the sending buffer.
Fig. 6 is a schematic flow chart of another data transmission method provided in the embodiment of the present application, please refer to fig. 6, and based on the same inventive concept, another data transmission method is further provided in the embodiment of the present application, which is applied to a data receiving device, and the data transmission method includes:
step S601, in the data transmission process, a data frame packet sent by the data sending device is received.
After the data receiving apparatus 200 and the data transmitting apparatus 100 determine the link through the three-way handshake, the data receiving apparatus 200 receives a data frame message transmitted by the data transmitting apparatus 100 in the data transmission process.
Step S602, a data confirmation message corresponding to the data frame message is sent to the data sending device.
When the data receiving apparatus 200 receives the data frame message sent by the data sending apparatus 100, it sends a data acknowledgement message corresponding to the data frame message to the data sending apparatus 100. The header of the data confirmation message carries a packet type flag, which has two different assignments, as shown in table 2 above, respectively representing whether the received data frame message has been stored. A value of 0xfffffff 00 indicates that the data receiving apparatus 200 receives a data frame message, and the buffer is full and not stored; a value of 0xfffffff indicates that the data receiving apparatus 200 receives a data frame message and stores it in the buffer.
In step S603, the data transmitting device retransmits the data frame message when the data transmitting device does not receive the data confirmation message corresponding to the data frame message returned by the data receiving device within the data confirmation time.
The data confirmation time length is the average round trip time of the data frame message corresponding to the current time period or a set time threshold.
After the data transmitting device 100 transmits the data frame message, if the data confirmation message corresponding to the data frame message returned by the data receiving device 200 is not received within the data confirmation time, the data frame message is retransmitted, and the data frame message is received by the data receiving device 200.
In a possible implementation manner, the data confirmation message carries a receiving type identifier, and step S602 includes sending, to the data sending device, a data confirmation message corresponding to the data frame message, including:
step S6021, if the data frame message is not stored after the data frame message is received, the data confirmation message containing the first type identification is sent to the data sending equipment.
The first type of identifier is used for indicating that the data receiving device receives the data frame message and does not store the data frame message.
Step S6022, if the data frame message is stored after the data frame message is received, the data confirmation message containing the second type identification is sent to the data sending device.
The second type of identification is used for indicating that the data receiving device receives and stores the data frame message.
In order to better understand the technical solution of the present application, fig. 7 shows an interaction diagram of a data transmission method provided in an embodiment of the present application. As shown in fig. 7, the data transmission method includes:
step S701, a data frame message is sent.
After the data transmitting device and the data receiving device determine the link, the data transmitting device starts to transmit the data frame message to the data receiving device.
In step S702, the receiving device replies to the data acknowledgement message when receiving the data frame message.
The data receiving device replies a data confirmation message when receiving the data frame message.
In step S703, the data transmitting apparatus receives the data confirmation message.
In step S704, the data transmitting device determines the average round trip time of the data frame message corresponding to the current time period.
In step S705, the data transmission apparatus determines a data confirmation period.
If the average round trip time of the data frame message is larger than the set time threshold, the set time threshold is used as the data confirmation duration corresponding to the current time period; or if the average round-trip time of the data frame message is smaller than or equal to the set time threshold, taking the average round-trip time of the data frame message as the data confirmation time corresponding to the current time period.
Step S706, after each frame of data frame message is sent, if the data confirmation message corresponding to the data frame message returned by the data receiving device is not received within the data confirmation time, retransmitting the data frame message.
In step S707, the data transmitting apparatus determines the network bandwidth corresponding to the current time period according to the number of data acknowledgement messages received in the previous time period adjacent to the current time period, the preset upper limit value of the message length, and the duration of the previous time period.
In step S708, the data sending device determines the network real-time bandwidth corresponding to the current time period according to the network bandwidth corresponding to the current time period.
Step S709, the data sending device determines the real-time maximum flow corresponding to the current time period according to the network real-time bandwidth corresponding to the current time period and the preset flow coefficient; the preset flow coefficient is greater than 1.
In step S710, if the data transmission device monitors that the actual flow of the transmitted data frame message reaches the real-time maximum flow corresponding to the current time period, the data transmission device stops transmitting the data frame message.
The above steps are all described in the foregoing embodiments, and are not repeated here. The step numbers are merely used as labels for the corresponding steps, and do not limit the order of the steps relative to each other. In some embodiments, some steps may be split into more sub-steps; in other embodiments, some steps may be combined; in still other embodiments, the data transmission method may include further additional steps, and illustratively, in some embodiments, the data transmission method further includes: when no data is transmitted, the data transmission method further comprises the following steps: before transmitting each wave of data frame message, the data transmitting device acquires window size information carried by the data confirmation message received last time; the data transmitting device determines the total data volume of the current wave data frame message to be transmitted according to the window size information, so that the total data volume of the current wave data frame message is smaller than or equal to the window size information; and sending the current wave data frame message according to the determined total data quantity of the current wave data frame message.
Fig. 8 is a schematic structural diagram of a data transmitting apparatus according to an embodiment of the present application. As shown in fig. 8, based on the same inventive concept, an embodiment of the present application provides a data transmitting apparatus, including:
a data confirmation unit 801, configured to determine an average round trip time of a data frame packet corresponding to a current time period every interval of a set time during a data transmission process; if the average round trip time of the data frame message is larger than the set time threshold, the set time threshold is used as the data confirmation duration corresponding to the current time period; or if the average round-trip time of the data frame message is smaller than or equal to the set time threshold, taking the average round-trip time of the data frame message as the data confirmation time corresponding to the current time period;
and the data retransmission unit 802 is configured to retransmit the data frame message if the data acknowledgement message corresponding to the data frame message returned by the data receiving device is not received within the data acknowledgement time after each frame of data frame message is transmitted.
In some embodiments, the data validation unit 801 is further configured to:
determining a network bandwidth corresponding to a current time period according to the number of data confirmation messages received in the previous time period adjacent to the current time period, a preset message length upper limit value and the duration of the previous time period;
According to the network bandwidth corresponding to the current time period, determining the network real-time bandwidth corresponding to the current time period;
according to the network real-time bandwidth corresponding to the current time period and a preset flow coefficient, determining the real-time maximum flow corresponding to the current time period; the preset flow coefficient is larger than 1;
and stopping sending the data frame message if the actual flow of the data frame message is monitored to reach the real-time maximum flow corresponding to the current time period.
In some embodiments, the data confirmation message carries a receiving type identifier, and the data confirmation unit 801 is further configured to:
if a data confirmation message corresponding to the data frame message returned by the data receiving equipment is received within the data confirmation time length, and the receiving type identifier of the data confirmation message is a first type identifier, retransmitting the data frame message; the first type identifier is used for indicating that the data receiving equipment receives the data frame message and does not store the data frame message; or alternatively, the process may be performed,
if the data confirmation message corresponding to the data frame message returned by the data receiving equipment is received within the data confirmation time length and the receiving type identifier of the data confirmation message is the second type identifier, deleting the data frame message from the sending buffer; the second type of identification is used for indicating that the data receiving device receives and stores the data frame message.
Fig. 9 is a schematic structural diagram of a data receiving device according to an embodiment of the present application. As shown in fig. 9, based on the same inventive concept, an embodiment of the present application provides a data receiving apparatus, including:
a data receiving unit 901, configured to receive a data frame packet sent by a data sending device in a data transmission process;
the data feedback unit 902 is configured to send a data acknowledgement message corresponding to a data frame message to the data sending device, so that the data sending device retransmits the data frame message when the data acknowledgement message corresponding to the data frame message returned by the data receiving device is not received within the data acknowledgement time length; the data confirmation time length is the average round trip time of the data frame message corresponding to the current time period or a set time threshold.
Based on the same inventive concept, an embodiment of the present application provides a data transmission device, including a memory and a processor, where the memory stores a computer program executable on the processor, and when the computer program is executed by the processor, causes the processor to implement a method of applying any one of the above data transmission methods to the data transmission device.
Fig. 10 is a schematic structural diagram of a data sending device according to an embodiment of the present application; as shown in fig. 10, the data transmission apparatus 100 in the embodiment of the present application includes: a processor 101, a display 102, a memory 103, an input device 106, a bus 105, and a communication module 104; the processor 101, memory 103, input device 106, display 102, and communication module 104 are all coupled via a bus 105, and the bus 105 is used to transfer data between the processor 101, memory 103, display 102, communication module 104, and input device 106.
The memory 103 may be used to store software programs and modules, such as program instructions/modules corresponding to the data transmission method applied to the data transmission device in the embodiment of the present application, and the processor 101 executes the software programs and modules stored in the memory 103, thereby performing various functional applications and data processing of the data transmission device 100, such as the data transmission method applied to the data transmission device provided in the embodiment of the present application. The memory 103 may mainly include a storage program area and a storage data area, wherein the storage program area may store an operating system, an application program of at least one application, and the like; the storage data area may store data (such as a session data set) created according to the use of the data transmission apparatus 100, and the like. In addition, memory 103 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 volatile solid-state storage device.
The processor 101 is a control center of the data transmission apparatus 100, connects respective portions of the entire data transmission apparatus 100 using the bus 105 and various interfaces and lines, and performs various functions of the data transmission apparatus 100 and processes data by running or executing software programs and/or modules stored in the memory 103 and calling data stored in the memory 103. Alternatively, the processor 101 may include one or more processing units, such as a CPU, GPU, digital processing unit, or the like.
The input device 106 is mainly used to obtain input operations by the user, and the input device 106 may be different when the data transmission devices are different. For example, when the data transmission device is a computer, the input device 106 may be an input device such as a mouse, a keyboard, etc.; when the data transmitting device is a portable device such as a smart phone or a tablet computer, the input device 106 may be a touch screen.
It is to be understood that the structure shown in fig. 10 is merely illustrative, and the data transmission apparatus 100 may further include more or less components than those shown in fig. 10, or have a different configuration from that shown in fig. 10. The components shown in fig. 10 may be implemented in hardware, software, or a combination thereof.
Based on the same inventive concept, the embodiments of the present application provide a data receiving apparatus, including a memory and a processor, where the memory stores a computer program executable on the processor, and when the computer program is executed by the processor, causes the processor to implement a method of applying any one of the above data transmission methods to the data receiving apparatus.
Fig. 11 is a schematic structural diagram of a data receiving device according to an embodiment of the present application; as shown in fig. 11, the data receiving apparatus 200 in the embodiment of the present application includes: a processor 201, a display 202, a memory 203, an input device 206, a bus 205, and a communication module 204; the processor 201, memory 203, input device 206, display 202, and communication module 204 are all connected via a bus 205, the bus 205 being used to transfer data between the processor 201, memory 203, display 202, communication module 204, and input device 206.
The memory 203 may be configured to store software programs and modules, such as program instructions/modules corresponding to a method of applying any of the data transmission methods in the embodiments of the present application to a data receiving device, and the processor 201 executes various functional applications and data processing of the data receiving device 200 by executing the software programs and modules stored in the memory 203, such as a method of applying any of the data transmission methods in the embodiments of the present application to a data receiving device. The memory 203 may mainly include a storage program area and a storage data area, wherein the storage program area may store an operating system, an application program of at least one application, and the like; the storage data area may store data (such as a session data set) created according to the use of the data receiving apparatus 200, and the like. In addition, memory 203 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 volatile solid-state storage device.
The processor 201 is a control center of the data reception apparatus 200, connects respective portions of the entire data reception apparatus 200 using the bus 205 and various interfaces and lines, and performs various functions of the data reception apparatus 200 and processes data by running or executing software programs and/or modules stored in the memory 203 and calling data stored in the memory 203. Alternatively, the processor 201 may include one or more processing units, such as a CPU, GPU, digital processing unit, or the like.
The input device 206 is mainly used to obtain input operations by a user, and when the data receiving devices are different, the input device 206 may be different. For example, when the data receiving device is a computer, the input device 206 may be an input device such as a mouse, a keyboard, etc.; when the data receiving device is a portable device such as a smart phone, a tablet computer, etc., the input device 206 may be a touch screen.
It is to be understood that the structure shown in fig. 11 is merely illustrative, and the data receiving apparatus 200 may further include more or less components than those shown in fig. 11, or have a different configuration from that shown in fig. 11. The components shown in fig. 11 may be implemented in hardware, software, or a combination thereof.
The embodiment of the application also provides a computer storage medium, and the computer storage medium stores computer executable instructions for implementing the data transmission method described in any embodiment of the application.
In some possible embodiments, various aspects of the data transmission method provided herein may also be implemented in the form of a program product, which includes a program code for causing a computer device to perform the steps of the data transmission method described herein above when the program product is run on the computer device, for example, the computer device may perform the flow of the data transmission method as shown in fig. 2 from step S201 to step S203.
The program product may employ any combination of one or more readable media. The readable medium may be a readable signal medium or a readable storage medium. The readable storage medium can be, for example, but not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or a combination of any of the foregoing. More specific examples (a non-exhaustive list) of the readable storage medium would include the following: an electrical connection having one or more wires, a portable disk, a hard disk, random Access Memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM or flash memory), optical fiber, portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing.
The foregoing is merely specific embodiments of the present application, but the scope of the present application is not limited thereto, and any person skilled in the art can easily think about changes or substitutions within the technical scope of the present application, and the changes and substitutions are intended to be covered by the scope of the present application.

Claims (10)

1. A data transmission method, characterized by being applied to a data transmission apparatus, the method comprising:
In the data transmission process, setting time at each interval, and determining the average round trip time of a data frame message corresponding to the current time period;
if the average round trip time of the data frame message is larger than a set time threshold, the set time threshold is used as the data confirmation duration corresponding to the current time period; or if the average round trip time of the data frame message is smaller than or equal to a set time threshold, taking the average round trip time of the data frame message as the data confirmation time corresponding to the current time period;
after each frame of data frame message is sent, if the data confirmation message corresponding to the data frame message returned by the data receiving equipment is not received within the data confirmation time length, the data frame message is retransmitted.
2. The method of claim 1, wherein determining the average round trip time of the data frame message corresponding to the current time period comprises:
determining the number of data acknowledgement messages received in a previous time period adjacent to the current time period; each frame data confirmation message carries a time stamp, and the time stamp is used for indicating the sending time of the data frame message corresponding to the data confirmation message;
for each received frame data confirmation message, taking the time difference between the time when the data confirmation message is received and the time stamp in the data confirmation message as the round trip time of the data frame message corresponding to the data confirmation message;
And taking the ratio of the sum of all obtained round trip times to the number of received data confirmation messages as the average round trip time of the data frame messages corresponding to the current time period.
3. The method according to claim 1, wherein the method further comprises:
determining a network bandwidth corresponding to a current time period according to the number of data confirmation messages received in the previous time period adjacent to the current time period, a preset message length upper limit value and the duration of the previous time period;
according to the network bandwidth corresponding to the current time period, determining the network real-time bandwidth corresponding to the current time period;
determining a real-time maximum flow corresponding to the current time period according to the network real-time bandwidth corresponding to the current time period and a preset flow coefficient; the preset flow coefficient is greater than 1;
and stopping sending the data frame message if the actual flow of the data frame message is monitored to reach the real-time maximum flow corresponding to the current time period.
4. A method according to claim 3, wherein the data frame message and the corresponding data confirmation message carry a wave number; the determining the network bandwidth corresponding to the current time period according to the number of the data confirmation messages received in the previous time period adjacent to the current time period, the preset message length upper limit value and the duration of the previous time period comprises the following steps:
Taking the time of receiving a first data confirmation message carrying a previous wave number as the starting time of the previous time period, and taking the time of receiving a last data confirmation message carrying the previous wave number before receiving a first data confirmation message carrying a next wave number as the ending time of the previous time period;
determining the duration of the previous time period according to the ending time of the previous time period and the starting time of the previous time period;
determining the number of received data confirmation messages carrying the last wave number as the number of the received data confirmation messages in the last time period;
and obtaining the network bandwidth corresponding to the current time period according to the number of the data confirmation messages received in the previous time period, the preset upper limit value of the message length and the duration of the previous time period.
5. The method of claim 1, wherein the data confirmation message carries a receipt type identification, the method further comprising:
if a data confirmation message corresponding to the data frame message returned by the data receiving equipment is received within the data confirmation time length, and the receiving type identifier of the data confirmation message is a first type identifier, retransmitting the data frame message; the first type identifier is used for indicating that the data receiving device receives the data frame message and does not store the data frame message; or alternatively, the process may be performed,
If a data confirmation message corresponding to the data frame message returned by the data receiving equipment is received within the data confirmation time length, and the receiving type identifier of the data confirmation message is a second type identifier, deleting the data frame message from a sending cache; the second type identifier is used for indicating the data receiving device to receive and store the data frame message.
6. A data transmission method, characterized by being applied to a data receiving apparatus, the method comprising:
in the data transmission process, receiving a data frame message sent by data sending equipment;
transmitting a data confirmation message corresponding to the data frame message to the data transmitting device, so that the data transmitting device retransmits the data frame message when the data confirmation message corresponding to the data frame message returned by the data receiving device is not received within the data confirmation time; the data confirmation time length is determined by the data sending device through the following modes: in the data transmission process, setting time at each interval, and determining the average round trip time of a data frame message corresponding to the current time period; if the average round trip time of the data frame message is larger than a set time threshold, the set time threshold is used as the data confirmation duration corresponding to the current time period; or if the average round-trip time of the data frame message is smaller than or equal to the set time threshold, taking the average round-trip time of the data frame message as the data confirmation time corresponding to the current time period.
7. The method according to claim 6, wherein the data confirmation message carries a receiving type identifier, and the sending the data confirmation message corresponding to the data frame message to the data sending device includes:
if the data frame message is not stored after the data frame message is received, sending a data confirmation message containing a first type identifier to the data sending equipment; the first type identifier is used for indicating that the data receiving device receives the data frame message and does not store the data frame message; or alternatively, the process may be performed,
if the data frame message is stored after the data frame message is received, sending a data confirmation message containing a second type identifier to the data sending equipment; the second type identifier is used for indicating that the data receiving device receives and stores the data frame message.
8. A data transmission device comprising a memory and a processor, the memory having stored thereon a computer program executable on the processor, which when executed by the processor causes the processor to implement the method of any of claims 1 to 5.
9. A data receiving device comprising a memory and a processor, the memory having stored thereon a computer program executable on the processor, which when executed by the processor causes the processor to implement the method of any of claims 6 to 7.
10. A computer-readable storage medium having a computer program stored therein, characterized in that: the computer program, when executed by a processor, implements the method of any of claims 1-5 or 6-7.
CN202010685990.2A 2020-07-16 2020-07-16 Data transmission method, device, equipment and readable storage medium Active CN111917525B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202010685990.2A CN111917525B (en) 2020-07-16 2020-07-16 Data transmission method, device, equipment and readable storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202010685990.2A CN111917525B (en) 2020-07-16 2020-07-16 Data transmission method, device, equipment and readable storage medium

Publications (2)

Publication Number Publication Date
CN111917525A CN111917525A (en) 2020-11-10
CN111917525B true CN111917525B (en) 2023-07-18

Family

ID=73281021

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202010685990.2A Active CN111917525B (en) 2020-07-16 2020-07-16 Data transmission method, device, equipment and readable storage medium

Country Status (1)

Country Link
CN (1) CN111917525B (en)

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN115571072B (en) * 2022-10-24 2024-06-14 中国第一汽车股份有限公司 Head-up display mode conversion method and device, electronic equipment and storage medium

Citations (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN108880763A (en) * 2018-06-27 2018-11-23 努比亚技术有限公司 The time-optimized method of retransmission time out, equipment and computer readable storage medium

Patent Citations (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN108880763A (en) * 2018-06-27 2018-11-23 努比亚技术有限公司 The time-optimized method of retransmission time out, equipment and computer readable storage medium

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
TRANSMISSION CONTROL PROTOCOL;DARPA INTERNET PROGRAM;《IETF RFC793》;19810930;正文第40-41页 *

Also Published As

Publication number Publication date
CN111917525A (en) 2020-11-10

Similar Documents

Publication Publication Date Title
CN110995697B (en) Big data transmission method and system
US10462707B2 (en) Data transmission method and apparatus
JP6023368B1 (en) Interactive real-time media transfer protocol
US6292834B1 (en) Dynamic bandwidth selection for efficient transmission of multimedia streams in a computer network
US8553540B2 (en) Congestion control for delay sensitive applications
US8873385B2 (en) Incast congestion control in a network
US9325628B2 (en) Packet handling method, forwarding device and system
EP3780542B1 (en) Data transmission method and device
EP2661029B1 (en) Avoiding Delayed Data
CN112436924B (en) Data transmission method and electronic equipment
CN112769526B (en) Data packet retransmission method, system and storage medium
WO2015169186A1 (en) File transmission method and system
EP3742746A1 (en) Method and device for realizing video service, and communication system and computer-readable storage medium
WO2019144802A1 (en) Data transmission method and related device
CN111917525B (en) Data transmission method, device, equipment and readable storage medium
Mudambi et al. A transport protocol for dedicated end-to-end circuits
CN113726817B (en) Streaming media data transmission method, device and medium
US7561523B1 (en) Method and apparatus for flow control in a reliable multicast communication system
CN114039702B (en) Data transmission method, device, equipment and medium
CN112994848B (en) MCS (modulation and coding scheme) adjusting method and device, storage medium and wireless node
CN115001632A (en) Information transmission method and device, electronic equipment and readable storage medium
WO2017101875A1 (en) Transmission rate control method and device based on iscsi protocol
JP4627290B2 (en) Rate control method, server, and program using TCP
JP7123194B2 (en) Data transmission method, transmission device, data reception method, and reception device
US9319330B2 (en) Apparatus and method for avoiding packet losses in a network connection

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant