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

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

Info

Publication number
CN116436570A
CN116436570A CN202310472288.1A CN202310472288A CN116436570A CN 116436570 A CN116436570 A CN 116436570A CN 202310472288 A CN202310472288 A CN 202310472288A CN 116436570 A CN116436570 A CN 116436570A
Authority
CN
China
Prior art keywords
time
data
data transmission
time threshold
retransmission
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.)
Pending
Application number
CN202310472288.1A
Other languages
Chinese (zh)
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.)
Shenzhen Launch Technology Co Ltd
Original Assignee
Shenzhen Launch 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 Shenzhen Launch Technology Co Ltd filed Critical Shenzhen Launch Technology Co Ltd
Priority to CN202310472288.1A priority Critical patent/CN116436570A/en
Publication of CN116436570A publication Critical patent/CN116436570A/en
Pending legal-status Critical Current

Links

Images

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
    • 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
    • YGENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
    • Y02TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
    • Y02DCLIMATE CHANGE MITIGATION TECHNOLOGIES IN INFORMATION AND COMMUNICATION TECHNOLOGIES [ICT], I.E. INFORMATION AND COMMUNICATION TECHNOLOGIES AIMING AT THE REDUCTION OF THEIR OWN ENERGY USE
    • Y02D30/00Reducing energy consumption in communication networks
    • Y02D30/70Reducing energy consumption in communication networks in wireless communication networks

Abstract

The application discloses a data transmission method, a device, equipment and a computer readable storage medium, which are applied to the technical field of communication and comprise the following steps: acquiring a first time threshold; wherein the first time threshold is less than the network delay time; acquiring data transmission time corresponding to a target data packet, and determining waiting time according to the data transmission time; when the waiting time exceeds a first time threshold, it is determined to perform data retransmission. When data retransmission is carried out currently, the received response characters are mainly relied on for data retransmission, and the response characters cannot be received in time for data transmission due to network delay. According to the method and the device, the first time threshold value smaller than the network delay time is set, so that whether retransmission is carried out or not is determined according to the first time threshold value and the sending time, and the data retransmission can be ensured to be carried out in time when the data retransmission is carried out according to the first time threshold value due to the fact that the first time threshold value is smaller than the network delay time, and the efficiency of data transmission is improved.

Description

Data transmission method, device, equipment and computer readable storage medium
Technical Field
The present disclosure relates to the field of communications technologies, and in particular, to a data transmission method, apparatus, device, and computer readable storage medium.
Background
The user datagram protocol (UserDatagram Protocol, UDP) is a connectionless and unreliable protocol, when data transmission is performed based on UDP, a problem of packet loss is unavoidable, when packet loss retransmission is performed currently, it mainly depends on network delay, and in combination with response characters between a sender and a confirmater, whether retransmission is performed is determined, however, because wireless communication is difficult to keep stable in network, network delay is longer, thus response characters cannot be received in time, and retransmission efficiency is reduced.
Disclosure of Invention
In view of the foregoing, an object of the present application is to provide a data transmission method, apparatus, device and computer readable storage medium, which solve the technical problem of low data transmission efficiency in the prior art.
In order to solve the above technical problems, the present application provides a data transmission method, including:
acquiring a first time threshold; wherein the first time threshold is less than a network delay time;
acquiring data transmission time corresponding to a target data packet, and determining waiting time according to the data transmission time;
and when the waiting time exceeds the first time threshold, determining to retransmit the data.
Optionally, after the determining to retransmit the data, the method further includes:
acquiring a second time threshold value, and retransmitting data again according to the second time threshold value; wherein the second time threshold is greater than the first time threshold and less than the network delay time.
Optionally, when the data retransmission is performed, the method includes:
determining a sliding window size corresponding to the first time threshold;
adjusting the current transmission rate according to the size of the sliding window to obtain a target transmission rate;
and retransmitting the data according to the target transmission rate.
Optionally, after determining to retransmit the data when the waiting time exceeds the first time threshold, the method further includes:
receiving a sequence number corresponding to a last continuous frame in a buffer zone corresponding to the target data packet;
and continuing data transmission according to the sequence numbers.
Optionally, after determining the waiting time according to the data transmission time at the data transmission time corresponding to the acquisition target data packet, the method further includes:
acquiring a highest time threshold;
and determining to stop retransmission when the waiting time exceeds the highest time threshold.
Optionally, after determining to stop retransmission when the waiting time exceeds the maximum time threshold, the method further includes:
and reconstructing the data transmission link.
Optionally, after the acknowledgement performs data retransmission, the method further includes:
judging whether available resources of the system are sufficient or not;
when the system resources are sufficient, the target data is not subjected to segmented retransmission;
and when the system resources are insufficient, carrying out segmented retransmission on the target data.
The application also provides a data transmission device, comprising:
the first time threshold acquisition module is used for acquiring a first time threshold; wherein the first time threshold is less than a network delay time;
the waiting time acquisition module is used for acquiring the data transmission time corresponding to the target data packet and determining the waiting time according to the data transmission time;
and the data retransmission determining module is used for determining to retransmit the data when the waiting time exceeds the first time threshold.
The application also provides a data transmission device, comprising:
a memory for storing a computer program;
and the processor is used for realizing the steps of the data transmission method when executing the computer program.
The present application also provides a computer readable storage medium having stored therein computer executable instructions that when loaded and executed by a processor implement the steps of the data transmission method described above.
As can be seen, the present application provides for obtaining a first time threshold; wherein the first time threshold is less than the network delay time; acquiring data transmission time corresponding to a target data packet, and determining waiting time according to the data transmission time; and when the waiting time exceeds the first time threshold, determining to retransmit the data. When the data transmission is currently carried out, the received response character is mainly relied on to carry out data retransmission, and when the response character is received, the data transmission cannot be carried out timely due to network delay.
In addition, the application also provides a data transmission device, equipment and a computer readable storage medium, and the data transmission device and the equipment have the beneficial effects.
Drawings
In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the drawings that are required to be used in the embodiments or the description of the prior art will be briefly described below, and it is obvious that the drawings in the following description are only embodiments of the present application, and that other drawings may be obtained according to the provided drawings without inventive effort to a person skilled in the art.
Fig. 1 is a flowchart of a data transmission method provided in an embodiment of the present application;
fig. 2 is a flowchart of another data transmission method according to an embodiment of the present application;
fig. 3 is a flowchart of a data retransmission method provided in an embodiment of the present application;
fig. 4 is a flowchart illustrating a data retransmission method according to an embodiment of the present application;
fig. 5 is a flowchart illustrating a data frame loss retransmission process according to an embodiment of the present application;
fig. 6 is a schematic structural diagram of a data transmission device according to an embodiment of the present application;
fig. 7 is a schematic structural diagram of a data transmission device according to an embodiment of the present application.
Detailed Description
For the purposes of making the objects, technical solutions and advantages of the embodiments of the present application more clear, the technical solutions of the embodiments of the present application will be clearly and completely described below with reference to the drawings in the embodiments of the present application, 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.
Referring to fig. 1, fig. 1 is a flowchart of a data transmission method according to an embodiment of the present application. The method may include:
s100, acquiring a first time threshold; wherein the first time threshold is less than the network latency.
The embodiment is not limited to a specific first time threshold, as long as the time for data retransmission using the first time threshold is lower than the network delay time. For example, when the network delay is 40 milliseconds, the first time threshold may be 10 milliseconds; or when the network delay is 40 milliseconds, the first time threshold may be 12 milliseconds as well; or when the network delay is 100 milliseconds, the first time threshold may be 20 milliseconds; or the first time threshold may be 21 milliseconds when the network delay is 60 milliseconds. It will be appreciated that network latency in this embodiment refers to the round-trip time for a packet to be sent from the user's computer to the web server and then immediately returned from the web server to the user's computer. In colloquial terms, network latency refers to the time taken for data to pass from computer side to side, corresponding to the time from the sender to the receiver. It can be understood that, in the case that the network state is excellent, the network delay time is extremely short, and there is almost no network delay, the first time threshold can be equal to the network delay time, so as to ensure the efficiency of data retransmission. For example, when the network delay time is 60 ms, the first time threshold is set to 59 ms, that is, the 59 th ms is used for retransmission, and at this time, the retransmission is received but has timed out, so that the packet loss of the data is caused.
S101, acquiring data transmission time corresponding to a target data packet, and determining waiting time according to the data transmission time.
The embodiment obtains the data transmission time corresponding to the target data packet, and determines the waiting time according to the data transmission time. It will be appreciated that when the target data packet is transmitted, a time stamp of the transmission of the frame number in the data packet may be recorded, and the waiting time is determined according to the time stamp and the current time.
Further, in order to improve the timeliness of retransmission, after determining the waiting time according to the data transmission time, the method may further include:
acquiring a highest time threshold;
when the waiting time exceeds the highest time threshold, it is determined to stop retransmission.
This embodiment will acquire a highest time threshold, which in this embodiment can determine the opportunity to not retransmit the data. The embodiment is not limited to a specific maximum time threshold. For example, the highest time threshold may be 100 milliseconds; or the highest time threshold may be 110 milliseconds; or the highest time threshold may also be 150 milliseconds. It will be appreciated that when the first time threshold is compared to the current latency, the current latency may be compared to a maximum time threshold and when the latency is found to exceed the maximum time threshold, it is determined to cease retransmission. The highest time threshold is related to the timeout of the diagnostic software. I.e. the timeout time that can be diagnosed with the largest timeout time for most diagnostic software in the customer base.
Further, in order to send the target data packet to the receiving end as soon as possible, after determining to stop the retransmission when the waiting time exceeds the maximum time threshold, the method may further include:
and reconstructing the data transmission link.
When the embodiment determines to stop retransmitting, the embodiment indicates that the frame loss occurs in the target data packet, and the data transmission link needs to be rebuilt. It can be appreciated that when packet loss occurs, by re-establishing the link, packet loss caused by the data transmission link can be reduced, thereby improving communication quality.
S102, when the waiting time exceeds a first time threshold, determining to retransmit the data.
This embodiment determines to perform a data retransmission when the latency exceeds a first time threshold. It can be understood that in the process of waiting for retransmission, the waiting time can be determined in real time, the relation between the waiting time and the first time threshold is judged, and when the waiting time is greater than the first time threshold and no response message is received, the data retransmission is determined. The embodiment is not limited to the specific operations performed after determining to perform the data retransmission. For example, the second time threshold may be set when the data retransmission is performed, so that the data retransmission is performed according to the second time threshold, where a specific value of the second time threshold is not limited as long as the specific value is less than the network timeout time. For example, the second time threshold may be equal to the first time threshold, or the second time threshold may be greater than the first time threshold. It can be appreciated that, in general, the second time threshold should be set larger than the first time threshold, so as to prevent too dense, reduce the number of retransmissions, and improve the data retransmission efficiency.
Further, in order to improve the efficiency of data transmission, when determining to perform data retransmission, the method includes:
determining a sliding window size corresponding to the first time threshold;
the current transmission rate is adjusted according to the size of the sliding window, and the target transmission rate is obtained;
and retransmitting the data according to the target transmission rate.
It will be appreciated that the implementation determines that a protocol is invoked in the computer memory upon data retransmission to adjust the timeout period of an automatic retransmission request based on the UDP (user datagram protocol) protocol via the protocol. In actual operation, data transmission is performed based on the adjusted timeout time, then unacknowledged data packets in the UDP data packets are calculated, so that the data throughput rate at the moment is obtained, and finally the window size of the sliding window is adjusted based on the data throughput rate.
It should be noted that, based on the adjusted timeout, the window size of the sliding window is determined; and adjusting the data transmission rate according to the window size of the sliding window so as to perform data transmission according to the adjusted transmission rate. The method redetermines the window size of the sliding window by adjusting the timeout time of automatic retransmission, thereby adjusting the data transmission speed and improving the transmission speed of the existing network data.
Further, to ensure the efficiency of data retransmission, after confirming that data retransmission is performed, the method may further include:
judging whether available resources of the system are sufficient or not;
when the system resources are sufficient, the target data is not subjected to segmented retransmission;
and when the system resources are insufficient, the target data are subjected to segmented retransmission.
When the embodiment confirms that the data retransmission is carried out, judging whether the available resources of the system are sufficient or not; when the system resources are sufficient, the target data is not subjected to segmented retransmission; and when the system resources are insufficient, the target data are subjected to segmented retransmission. It can be understood that when data retransmission is needed, it indicates that there is a longer network delay, so that the data is retransmitted in segments, and the average transmission delay of the target data packet is reduced.
The data transmission method provided by the embodiment of the application comprises the following steps: acquiring a first time threshold; wherein the first time threshold is less than the network delay time; acquiring data transmission time corresponding to a target data packet, and determining waiting time according to the data transmission time; and when the waiting time exceeds the first time threshold, determining to retransmit the data. Therefore, when the data transmission is performed currently, the received response character is mainly relied on to perform data retransmission, and when the response character is received, the data transmission cannot be performed timely due to network delay. In addition, by setting the highest time threshold, data retransmission is prevented from being carried out all the time, and the energy consumption of the system is reduced; and the quality of data transmission is improved through the reconstruction of the data transmission link; and the efficiency of transmitting the target data packet is improved by adjusting the data transmission efficiency; and, can carry on the segmentation to retransmit, reduce the average transmission delay.
For easier understanding of the present application, please refer to fig. 2 specifically, fig. 2 is a flowchart of another data transmission method provided in an embodiment of the present application, which may specifically include:
s200, acquiring a first time threshold; wherein the first time threshold is less than the network latency.
The embodiment does not limit the execution body. For example, the execution subject of this embodiment may be a client; or the execution subject of this embodiment may be the server side. In this embodiment, the first time threshold is smaller than the network delay time, so that when data retransmission is performed according to the first time threshold, the first time threshold can be lower than the network delay time, and the efficiency of data retransmission is improved. It will be appreciated that the first time threshold may not be set too small, which may cause too many retransmissions, resulting in packet loss, and when the network state is excellent, there is little network delay, at which point the first time threshold may be equal to the network delay time.
S201, acquiring data transmission time corresponding to the target data packet, and determining waiting time according to the data transmission time.
The embodiment determines the data transmission time corresponding to the target data packet, i.e., the timestamp, and thus determines the waiting time according to the data transmission time.
S202, when the waiting time exceeds a first time threshold, determining to retransmit the data.
The embodiment determines to perform a data retransmission when the latency exceeds a first time threshold. It can be understood that the automobile diagnosis has high requirement on time delay, so that diagnosis failure is caused by overtime, network time delay is reduced, and communication is usually carried out in a UDP direct connection mode. The user datagram protocol (User Datagram Protocol, UDP) is a connectionless and unreliable protocol. In order to solve this problem, it is known to refer to TCP (Transmission Control Protocol ) that each frame of data has a frame number, and after receiving the data, the receiver performs comparison, if the received data is repeated, then discards the received data, and if the received data is continuous data, then acknowledges ACK (Acknowledgement character), where the ACK packet includes the continuous frame number. The retransmission mechanism of the receiver comprises fast retransmission, overtime retransmission and retransmission after receiving the packet loss message of the receiver. The re-synchronization mechanism is that after the sender loses the packet, the sender discovers that the data packet is deleted, and then sends a re-synchronization message, the receiver receives a post-response, and the sender resumes communication after receiving the synchronization response.
S203, acquiring a second time threshold value to retransmit the data again according to the second time threshold value; the second time threshold is larger than the first time threshold and smaller than the network delay time.
The first time threshold in this embodiment is the time threshold at the time of the secondary retransmission. The embodiment is not limited to the specific operation performed after the second time threshold is acquired. For example, three retransmissions may be performed followed by four more retransmissions; or may stop the retransmission after the failure of the secondary retransmission. It should be noted that, in the case where there is almost no network delay, the second time threshold may be equal to the network delay time.
To facilitate understanding, the specific disadvantage of the current retransmission mechanism, that is, the advantage of the present application compared to the prior art, this embodiment takes the network delay as 40 ms (40 ms is the time consumed for sending the response from the sending end to the receiving end), the communication takes the C-end as the sending end (client) and the B-end (server) as the receiving end as the example, and first, fast retransmission: for example, the C-terminal sends five frames of data 1, 2, 3, 4, 5 at intervals of 10 ms, wherein the five frames of data are sent at intervals of 0 ms, 10 ms, 20 ms, 30 ms, and 40 ms, respectively, but 2 is lost, 20 ms when the B-terminal receives 1, the acknowledgement ACK2,2 is lost, 40 ms when the acknowledgement ACK2 is received 3, the same processing is performed when the acknowledgement ACK2 is received 4 and 5, 60 ms when the acknowledgement ACK2 is received 5, 20 ms when the acknowledgement ACK2 is received 5 to the C-terminal, 3 times of the same ACK (ACK 2) are received by the C-terminal, 2 is retransmitted 80 ms, and then the time is 100 ms later when the B-terminal receives 2, the whole time is 100-10 ms, and the diagnostic apparatus usually times out for 55 ms and delays for 90 ms, which causes the diagnostic time-out. Second, timeout retransmission: for example, the C-terminal sends 1, frames are lost, the C-terminal times out that no ACK acknowledgement retransmission is received, and the time-out time calculated by the C-terminal is calculated based on the network delay, for example, 1.5 times of the network delay. The retransmission occurs at 60 ms timeout, i.e. at 60 ms, 80 ms arrives at the B-terminal, thus delaying 80 ms; thirdly, frame loss retransmission: for example, the C-terminal sends the five frames 1, 2, 3, 4 and 5 at intervals of 10 ms, but if the second frame data is lost, the B-terminal can only sense the frame loss (40 ms) when receiving 3 frames of data, then sets a timeout, and the timeout does not receive 2 (assuming 10 ms timeout), notifies the frame loss (50 ms), then the C-terminal receives the response (70 ms) of the frame loss, retransmits 2, and the B-terminal receives 2 (90 ms) after 20 ms, and the delay is 90-10 and 80 ms.
When the retransmission mechanism of the data transmission method provided by the application is used for data transmission, the timeout is not based on network delay, and is respectively 10, 20, 40 and 80 milliseconds (the first time threshold value) based on fixed value timeout, namely, each waiting time is doubled (an example does not represent a specific implementation). For example, the C end sends 1 frame loss, and the C end does not receive ACK response all the time, and retransmits 4 times in 10 ms, 30 ms, 70 ms and 150 ms, and the 30 th ms B end can receive retransmitted data under the condition of failure once, and even if two continuous packet losses occur, the retransmitted data can be received in 50 ms (90 ms in the prior art), and compared with the prior art, the method can rapidly retransmit when the packet is lost. Meanwhile, the data of the automobile diagnosis are small packets, and are usually tens of bytes of data, and the data of one packet is not retransmitted for 4 times under the extreme condition, so that the network load is not greatly caused, and the retransmission speed is much faster than that of the existing method, and the method has obvious advantages. In the application, the existing method is that the B end (the service end) finds out the lost frame, informs the C end (the client end), the C end detects that the lost frame is cleared and cannot be retransmitted, sends a resynchronization message to the B end, the B end responds, the C end receives the response, defines a new frame sequence number, tells the new initial packet sequence number to recover from the new frame sequence number, and resumes the sending (the existing method is used for resynchronization based on interaction according to the frame sequence number), and the existing method stops the sending of data when the existing method is resynchronized as can be seen from the above flow. The recovery can be completed by one round of interaction from the C end to the B end to the C end, the time consumption is relatively long, and if frame loss occurs again in the synchronization process, the time is longer. This results in the roughly subsequent data being discarded by the C-terminal and re-synchronized, and in extreme cases, causing a vicious circle, always being synchronized. The method does not need a separate resynchronization process, and resynchronizes by the B-side replying to the ACK. The following illustrates, for example, that the C-terminal transmits 1, 2, 3, 4, 5, 6, 7 and the b-terminal receives 1, 3, 5, 6, 7. The B end finds that 2 is lost, informs retransmission, starts synchronization after 150 ms, and still does not have 2 at the moment, finds the next continuous frame, sends 567 to MCU (micro control Unit), replies 7 ACK to the C end, the C end receives 7 ACK, and synchronization 1-7 is not retransmitted any more, and sends from 8. It can be seen from the above description that the present application has the advantage that, in the existing method, if a frame is lost in the synchronization process, the synchronization is further performed, but the method does not need to perform the synchronization if the ACK of the B end 7 is lost, because C has a retransmission mechanism and continues to transmit 8 and 9 after receiving the following data. The B end can continue to return to ACK after receiving retransmission or 8, the C end can not retransmit the data before 7 or 8 after receiving, and the two sides are in resynchronization, and the process does not influence communication. The C end does not resynchronize, so that the data of the follow-up 8 and 9 are not influenced, the follow-up data is not delayed to be sent continuously, and the follow-up continuous timeout is caused.
For easier understanding of the present application, referring specifically to fig. 3, fig. 3 is a flowchart of a data retransmission method provided in an embodiment of the present application, where the method may include:
s300, acquiring a first time threshold; wherein the first time threshold is less than the network latency.
The embodiment is not limited to a specific execution subject, and for example, the execution subject may be a client, or the execution subject may also be a server. The embodiment obtains a first time threshold; wherein the first time threshold is less than the network latency.
S301, acquiring data transmission time corresponding to the target data packet, and determining waiting time according to the data transmission time.
This embodiment calculates the total length of the waiting time from the data transmission time.
S302, when the waiting time exceeds a first time threshold, determining to retransmit the data.
The embodiment determines to perform a data retransmission when the latency exceeds a first time threshold.
S303, receiving a sequence number corresponding to the last continuous frame in the buffer area corresponding to the target data packet.
For ease of understanding, the sequence number corresponding to the last consecutive frame in the buffer of this embodiment is exemplified by the C-terminal (client) sending the target data packet including 1, 2, 3, 4, 5, 6, 7, and the B-terminal receiving 1, 3, 5, 6, 7. The B end (service end) finds that 2 is lost, informs retransmission, finds the next continuous frame, sends 567 to MCU, replies 7 ACK to C end, C end receives 7 ACK,1 to 7 are not retransmitted any more, and 8 is sent. According to the embodiment, the repeated transmission of the data is reduced and the efficiency of data transmission is improved by acquiring the sequence number corresponding to the last continuous frame.
For easier understanding of the present application, please refer to fig. 4 specifically, fig. 4 is a flowchart illustrating a data retransmission method according to an embodiment of the present application, where the method may include:
s400, bus data of the vehicle is received.
The execution subject of this embodiment is a client.
S401, determining a frame number group packet corresponding to the bus data, sending the data to the server according to the frame numbers, and recording a first timestamp of data sending corresponding to each frame number.
S402, acquiring a first timeout threshold and a first response time corresponding to the first timestamp.
S403, deleting the data frame when the data corresponding to the current frame number is received within the first timeout time threshold.
S404, when the first response time is greater than the first time threshold and the data corresponding to the current frame number is not received, acquiring a second time threshold, recording a second time stamp, and determining a second response time according to the second time stamp.
The embodiment obtains a second time threshold when no answer is received within the first time threshold, and will record a second time stamp, and determine a second answer time based on the second time stamp.
And S405, deleting the data frame when the data packet corresponding to the current frame number is received in the second time threshold.
S406, when the second response time is greater than the second time threshold and the data corresponding to the current frame number is not received, the highest time threshold is obtained, and the third response time corresponding to the highest time threshold is recorded.
S407, deleting the data frame when the data packet corresponding to the current frame number is received in the highest time threshold.
S408, when the third response time is greater than the highest time threshold and the data packet corresponding to the current frame number is not received, confirming packet loss and stopping retransmission.
For the sake of easier understanding of the present application, referring to fig. 5 specifically, fig. 5 is an exemplary diagram of a flow of retransmission of a lost frame of data provided in an embodiment of the present application, which may specifically include:
s500, when the server side finds out the frame loss, the sequence number of the last continuous frame in the search buffer area is obtained.
The execution subject of this embodiment is a server, which serves as a receiving end,
s501, the serial number is responded to the client.
S503, the client receives the sequence number and continues data transmission according to the sequence number.
In this embodiment, the lost frame is detected according to the frame sequence number, and the lost frame is not received yet beyond the highest time threshold, and the last continuous frame in the buffer area is searched for, so that the continuous frame can be sent to the diagnostic apparatus. The highest time threshold in this embodiment may be 150 milliseconds.
A data transmission device provided in the embodiments of the present application is described below, and a data transmission device described below and a data transmission method described above may be referred to correspondingly.
Referring to fig. 6 specifically, fig. 6 is a schematic structural diagram of a data transmission device according to an embodiment of the present application, which may include:
a first time threshold obtaining module 100, configured to obtain a first time threshold; wherein the first time threshold is less than a network delay time;
the waiting time obtaining module 200 is configured to obtain a data transmission time corresponding to a target data packet, and determine a waiting time according to the data transmission time;
the data retransmission determining module 300 is configured to determine to perform data retransmission when the waiting time exceeds the first time threshold.
Further, based on the above embodiment, the above data retransmission apparatus may further include:
a retransmission module is carried out according to a second time threshold, and is used for acquiring the second time threshold so as to retransmit the data again according to the second time threshold; wherein the second time threshold is greater than the first time threshold and less than the network delay time.
Further, based on any of the above embodiments, when determining to perform data retransmission, it may include:
a sliding window size determining unit, configured to determine a sliding window size corresponding to the first time threshold;
the target transmission rate determining unit is used for adjusting the current transmission rate according to the size of the sliding window to obtain a target transmission rate;
and the data retransmission unit is used for retransmitting the data according to the target transmission rate.
Further, based on any of the foregoing embodiments, the foregoing data retransmission apparatus may further include:
the sequence number determining module is used for receiving the sequence number corresponding to the last continuous frame in the buffer area corresponding to the target data packet;
and the data transmission module is used for continuing data transmission according to the sequence numbers.
Further, based on any of the foregoing embodiments, the foregoing data retransmission apparatus may further include:
the highest time threshold obtaining module is used for obtaining the highest time threshold;
and the retransmission suspension module is used for determining to stop retransmission when the waiting time exceeds the highest time threshold.
Further, based on the above embodiment, the above data retransmission apparatus may further include:
and the data transmission link impact module is used for reconstructing the data transmission link.
Further, based on the above embodiment, the above data retransmission apparatus may further include:
the available resource determining module is used for judging whether available resources of the system are sufficient or not;
the non-segmented retransmission module is used for not carrying out segmented retransmission on the target data when the system resources are sufficient;
and the segment retransmission module performs segment retransmission on the target data when the system resources are insufficient.
It should be noted that, the order of the modules and units in the data transmission device can be changed without affecting the logic.
The data transmission device provided in the embodiment of the application may include: a first time threshold obtaining module 100, configured to obtain a first time threshold; wherein the first time threshold is less than a network delay time; the waiting time obtaining module 200 is configured to obtain a data transmission time corresponding to a target data packet, and determine a waiting time according to the data transmission time; the data retransmission determining module 300 is configured to determine to perform data retransmission when the waiting time exceeds the first time threshold. Therefore, when the data transmission is performed currently, the received response character is mainly relied on to perform data retransmission, and when the response character is received, the data transmission cannot be performed timely due to network delay. In addition, by setting the highest time threshold, data retransmission is prevented from being carried out all the time, and the energy consumption of the system is reduced; and the quality of data transmission is improved through the reconstruction of the data transmission link; and the efficiency of transmitting the target data packet is improved by adjusting the data transmission efficiency; and the segmented retransmission can be performed, so that the average transmission delay is reduced; setting a second time threshold, retransmitting again according to the second time threshold, and ensuring retransmission efficiency; and the repeated transmission of the data can be reduced and the efficiency of the data transmission can be improved by acquiring the sequence number corresponding to the last continuous frame.
A data transmission device provided in the embodiments of the present application is described below, and a data transmission device described below and a data transmission method described above may be referred to correspondingly.
Referring to fig. 7, fig. 7 is a schematic structural diagram of a data transmission device according to an embodiment of the present application, which may include:
a memory 10 for storing a computer program;
a processor 20 for executing a computer program for implementing a data transmission method as described above.
The memory 10, the processor 20, and the communication interface 30 all communicate with each other via a communication bus 40.
In the embodiment of the present application, the memory 10 is used to store one or more programs, and the programs may include program codes, where the program codes include computer operation instructions, and in the embodiment of the present application, the memory 10 may store programs for implementing the following functions:
acquiring a first time threshold; wherein the first time threshold is less than the network delay time;
acquiring data transmission time corresponding to a target data packet, and determining waiting time according to the data transmission time;
when the waiting time exceeds a first time threshold, it is determined to perform data retransmission.
In one possible implementation, the memory 10 may include a storage program area and a storage data area, wherein the storage program area may store an operating system, and at least one application program required for functions, etc.; the storage data area may store data created during use.
In addition, memory 10 may include read only memory and random access memory and provide instructions and data to the processor. A portion of the memory may also include NVRAM. The memory stores an operating system and operating instructions, executable modules or data structures, or a subset thereof, or an extended set thereof, where the operating instructions may include various operating instructions for performing various operations. The operating system may include various system programs for implementing various basic tasks as well as handling hardware-based tasks.
The processor 20 may be a central processing unit (Central Processing Unit, CPU), an asic, a dsp, a fpga or other programmable logic device, and the processor 20 may be a microprocessor or any conventional processor. The processor 20 may call a program stored in the memory 10.
The communication interface 30 may be an interface of a communication module for connecting with other devices or systems.
Of course, it should be noted that the structure shown in fig. 7 is not limited to one data transmission device in the embodiment of the present application, and in practical application, one data transmission device may include more or fewer components than those shown in fig. 7, or some components may be combined.
The following describes a computer readable storage medium provided in an embodiment of the present application, where the computer readable storage medium described below and a data transmission method described above may be referred to correspondingly.
The present application also provides a computer readable storage medium having a computer program stored thereon, which when executed by a processor, implements the steps of a data transmission method as described above.
The computer readable storage medium may include: a U-disk, a removable hard disk, a Read-Only Memory (ROM), a random access Memory (RandomAccess Memory, RAM), a magnetic disk, or an optical disk, or other various media capable of storing program codes.
In this specification, each embodiment is described in a progressive manner, and each embodiment is mainly described in a different point from other embodiments, so that the same or similar parts between the embodiments are referred to each other. For the device disclosed in the embodiment, since it corresponds to the method disclosed in the embodiment, the description is relatively simple, and the relevant points refer to the description of the method section.
Those of skill would further appreciate that the various illustrative elements and algorithm steps described in connection with the embodiments disclosed herein may be implemented as electronic hardware, computer software, or combinations of both, and that the various illustrative elements and steps are described above generally in terms of functionality in order to clearly illustrate the interchangeability of hardware and software. Whether such functionality is implemented as hardware or software depends upon the particular application and design constraints imposed on the solution. Skilled artisans may implement the described functionality in varying ways for each particular application, but such implementation decisions should not be interpreted as causing a departure from the scope of the present application.
Finally, it is further noted that, in this document, relational terms such as first and second, and the like are used solely to distinguish one entity or action from another entity or action without necessarily requiring or implying any actual such relationship or order between such entities or actions. Moreover, the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or apparatus.
The foregoing has described in detail a data transmission method, apparatus, device and computer readable storage medium provided herein, and specific examples have been applied to illustrate the principles and embodiments of the present application, and the above examples are only used to help understand the method and core idea of the present application; meanwhile, as those skilled in the art will have modifications in the specific embodiments and application scope in accordance with the ideas of the present application, the present description should not be construed as limiting the present application in view of the above.

Claims (10)

1. A data transmission method, comprising:
acquiring a first time threshold; wherein the first time threshold is less than a network delay time;
acquiring data transmission time corresponding to a target data packet, and determining waiting time according to the data transmission time;
and when the waiting time exceeds the first time threshold, determining to retransmit the data.
2. The data transmission method according to claim 1, further comprising, after the determining to retransmit the data:
acquiring a second time threshold value, and retransmitting data again according to the second time threshold value; wherein the second time threshold is greater than the first time threshold and less than the network delay time.
3. The data transmission method according to claim 1, characterized in that, when data retransmission is performed, it comprises:
determining a sliding window size corresponding to the first time threshold;
adjusting the current transmission rate according to the size of the sliding window to obtain a target transmission rate;
and retransmitting the data according to the target transmission rate.
4. A data transmission method according to any one of claims 1 to 3, characterized in that after determining to perform a data retransmission when the waiting time exceeds the first time threshold, it further comprises:
receiving a sequence number corresponding to a last continuous frame in a buffer zone corresponding to the target data packet;
and continuing data transmission according to the sequence numbers.
5. The data transmission method according to claim 1, wherein after determining the waiting time according to the data transmission time corresponding to the acquisition target data packet, further comprising:
acquiring a highest time threshold;
and determining to stop retransmission when the waiting time exceeds the highest time threshold.
6. The data transmission method according to claim 5, wherein after determining to stop retransmission when the waiting time exceeds the maximum time threshold, further comprising:
and reconstructing the data transmission link.
7. The data transmission method according to claim 1, further comprising, after the acknowledgement of the retransmission of the data:
judging whether available resources of the system are sufficient or not;
when the system resources are sufficient, the target data is not subjected to segmented retransmission;
and when the system resources are insufficient, carrying out segmented retransmission on the target data.
8. A data transmission apparatus, comprising:
the first time threshold acquisition module is used for acquiring a first time threshold; wherein the first time threshold is less than a network delay time;
the waiting time acquisition module is used for acquiring the data transmission time corresponding to the target data packet and determining the waiting time according to the data transmission time;
and the data retransmission determining module is used for determining to retransmit the data when the waiting time exceeds the first time threshold.
9. A data transmission apparatus, comprising:
a memory for storing a computer program;
a processor for implementing the data transmission method according to any one of claims 1 to 7 when executing the computer program.
10. A computer readable storage medium having stored therein computer executable instructions which when loaded and executed by a processor implement a data transmission method as claimed in any one of claims 1 to 7.
CN202310472288.1A 2023-04-23 2023-04-23 Data transmission method, device, equipment and computer readable storage medium Pending CN116436570A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202310472288.1A CN116436570A (en) 2023-04-23 2023-04-23 Data transmission method, device, equipment and computer readable storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202310472288.1A CN116436570A (en) 2023-04-23 2023-04-23 Data transmission method, device, equipment and computer readable storage medium

Publications (1)

Publication Number Publication Date
CN116436570A true CN116436570A (en) 2023-07-14

Family

ID=87085408

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202310472288.1A Pending CN116436570A (en) 2023-04-23 2023-04-23 Data transmission method, device, equipment and computer readable storage medium

Country Status (1)

Country Link
CN (1) CN116436570A (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN117318898A (en) * 2023-11-24 2023-12-29 合肥奎芯集成电路设计有限公司 Method for processing repeated data packet in high-speed serial interface

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN117318898A (en) * 2023-11-24 2023-12-29 合肥奎芯集成电路设计有限公司 Method for processing repeated data packet in high-speed serial interface
CN117318898B (en) * 2023-11-24 2024-02-09 合肥奎芯集成电路设计有限公司 Method for processing repeated data packet in high-speed serial interface

Similar Documents

Publication Publication Date Title
Ratnam et al. WTCP: An efficient mechanism for improving TCP performance over wireless links
EP2068510B1 (en) Communication system, communication device, and communication method
JP6522855B2 (en) Packet transmission method and user equipment
CN102007812B (en) The method and apparatus that TCP flow controls
EP2119171B1 (en) Improved data transfer method, system and protocol
CN109639340B (en) TCP acceleration method suitable for satellite link
CN112436994B (en) Data transmission method and electronic equipment
US20040190540A1 (en) Transmission control method and system
JP2002541727A (en) Packet discard notification for retransmission protocol with semi-confirmation
CN101369877B (en) Wireless transmission control protocol processing method and equipment
EP1909468A1 (en) Method and apparatus for backing up TCP connection
JP6409558B2 (en) Communication device, relay device, and communication control method
CN106210924B (en) Video network transmission control method and system
CN109194452B (en) Data retransmission method, device, storage medium and network equipment thereof
WO1996017462A2 (en) A reliable connectionless network protocol
US20030128672A1 (en) Transmission and flow control
CN116436570A (en) Data transmission method, device, equipment and computer readable storage medium
JP2002527935A (en) Data communication methods and systems
US8943362B2 (en) Control and monitoring for fast millimeter-wave link using out-of-band wireless channel
JP2003503892A (en) Method and apparatus in a wireless communication system
CN113300817B (en) Data transmission method and device
CN108713311A (en) A kind of transmission method, equipment and the system of transmission control protocol TCP message
JP2000134279A (en) Flow control method
JP2002521960A (en) Method and apparatus for transmitting a data packet in a communication system
CN111314961A (en) TCP transmission method, device and system

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