A data transmission method, device, apparatus, and computer-readable storage medium

CN116436570BActive Publication Date: 2026-10-13LAUNCH TECH CO LTD
View PDF 3 Cites 0 Cited by

Patent Information

Application Number
CN202310472288.1
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2023-04-23
Publication Date
2026-10-13
Estimated Expiration
2043-04-23

AI Technical Summary

Technical Problem

[0003]有鉴于此,本申请的目的在于提供一种数据传输方法、装置、设备及计算机可读存储介质,解决了现有技术中数据传输效率较低的技术问题

Benefits of technology

[0034]可见,本申请通过获取第一时间阈值;其中,第一时间阈值小于网络延时时间;获取目标数据包对应的数据发送时间,根据数据发送时间确定等待时间;当等待时间超过所述第一时间阈值时,确定进行数据重传。和当前进行数据传输时,主要依赖接收的应答字符进行数据重传,而接收应答字符时,由于存在网络延时,使得无法及时进行数据传输,本申请通过设置小于网络延时时间的第一时间阈值,从而根据第一时间阈值和发送时间确定是否进行重传,由于第一时间阈值小于该网络延时时间,故根据第一时间阈值进行重传时,可以确保及时进行数据重传,提高数据传输的效率。

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN116436570B_ABST
    Figure CN116436570B_ABST
Patent Text Reader

Abstract

The application discloses a data transmission method and device, equipment and a computer readable storage medium, applied to the technical field of communication, comprising: acquiring a first time threshold; wherein the first time threshold is less than the network delay time; acquiring the data sending time corresponding to the target data packet, determining the waiting time according to the data sending time; when the waiting time exceeds the first time threshold, it is determined to perform data retransmission. When the current data retransmission is performed, the data retransmission mainly depends on the received response character, and due to the network delay, the response character cannot be received in time for data transmission. The application sets the first time threshold less than the network delay time, so as to determine whether to retransmit according to the first time threshold and the sending time. Since the first time threshold is less than the network delay time, when the data retransmission is performed according to the first time threshold, the data retransmission can be ensured in time, and the efficiency of data transmission is improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of communication technology, and in particular to a data transmission method, apparatus, device, and computer-readable storage medium. Background Technology

[0002] User Datagram Protocol (UDP) is a connectionless and unreliable protocol. When transmitting data based on UDP, packet loss is inevitable. Currently, packet loss retransmission mainly relies on network latency, combined with the acknowledgment characters between the sender and the acknowledgment party, to determine whether to retransmit. However, since wireless communication is difficult to maintain network stability, the network latency is relatively long, resulting in the inability to receive acknowledgment characters in a timely manner, which reduces the efficiency of retransmission. Summary of the Invention

[0003] In view of this, the purpose of this application is to provide a data transmission method, apparatus, device and computer-readable storage medium, which solves the technical problem of low data transmission efficiency in the prior art.

[0004] To address the aforementioned technical problems, this application provides a data transmission method, comprising:

[0005] Obtain a first time threshold; wherein, the first time threshold is less than the network latency.

[0006] Obtain the data transmission time corresponding to the target data packet, and determine the waiting time based on the data transmission time;

[0007] When the waiting time exceeds the first time threshold, it is determined that data retransmission will be performed.

[0008] Optionally, after determining to retransmit data, the method further includes:

[0009] A second time threshold is obtained to retransmit data again based on the second time threshold; wherein the second time threshold is greater than the first time threshold and less than the network latency.

[0010] Optionally, during data retransmission, the following may be included:

[0011] Determine the size of the sliding window corresponding to the first time threshold;

[0012] Adjust the current transmission rate according to the size of the sliding window to obtain the target transmission rate;

[0013] Data retransmission is performed according to the target transmission rate.

[0014] Optionally, after determining to perform data retransmission when the waiting time exceeds the first time threshold, the method further includes:

[0015] Receive the sequence number corresponding to the last consecutive frame in the buffer corresponding to the target data packet;

[0016] Data transmission continues according to the sequence number.

[0017] Optionally, after obtaining the data transmission time corresponding to the target data packet and determining the waiting time based on the data transmission time, the method further includes:

[0018] Obtain the highest time threshold;

[0019] When the waiting time exceeds the maximum time threshold, it is determined to stop retransmission.

[0020] Optionally, after determining to stop retransmission when the waiting time exceeds the maximum time threshold, the method further includes:

[0021] Rebuild the data transmission link.

[0022] Optionally, after confirming data retransmission, the method further includes:

[0023] Determine if the system has sufficient available resources;

[0024] When system resources are sufficient, the target data will not be retransmitted in segments;

[0025] When system resources are insufficient, the target data is retransmitted in segments.

[0026] This application also provides a data transmission device, including:

[0027] The first time threshold acquisition module is used to acquire a first time threshold; wherein, the first time threshold is less than the network latency time;

[0028] The waiting time acquisition module is used to acquire the data transmission time corresponding to the target data packet and determine the waiting time based on the data transmission time.

[0029] The data retransmission determination module is used to determine to retransmit data when the waiting time exceeds the first time threshold.

[0030] This application also provides a data transmission device, including:

[0031] Memory, used to store computer programs;

[0032] A processor is used to implement the above-described data transmission method when executing the computer program.

[0033] This application also provides a computer-readable storage medium storing computer-executable instructions, which, when loaded and executed by a processor, implement the steps of the above-described data transmission method.

[0034] As can be seen, this application obtains a first time threshold, wherein the first time threshold is less than the network latency; obtains the data transmission time corresponding to the target data packet, determines the waiting time based on the data transmission time; and determines to retransmit data when the waiting time exceeds the first time threshold. Currently, data transmission mainly relies on received acknowledgment characters for retransmission. However, due to network latency, timely data transmission is impossible when receiving acknowledgment characters. This application sets a first time threshold less than the network latency, thereby determining whether to retransmit based on the first time threshold and the transmission time. Since the first time threshold is less than the network latency, retransmission based on the first time threshold ensures timely data retransmission and improves data transmission efficiency.

[0035] In addition, this application also provides a data transmission apparatus, device, and computer-readable storage medium, which also have the above-mentioned beneficial effects. Attached Figure Description

[0036] To more clearly illustrate the technical solutions in the embodiments of this application or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are only embodiments of this application. For those skilled in the art, other drawings can be obtained based on the provided drawings without creative effort.

[0037] Figure 1 A flowchart illustrating a data transmission method provided in an embodiment of this application;

[0038] Figure 2 A flowchart illustrating another data transmission method provided in this application embodiment;

[0039] Figure 3 A flowchart of a data retransmission method provided in an embodiment of this application;

[0040] Figure 4 A flowchart illustrating a data retransmission method provided in an embodiment of this application;

[0041] Figure 5 A flowchart illustrating a data frame loss retransmission process provided in an embodiment of this application;

[0042] Figure 6 This is a schematic diagram of the structure of a data transmission device provided in an embodiment of this application;

[0043] Figure 7 This is a schematic diagram of the structure of a data transmission device provided in an embodiment of this application. Detailed Implementation

[0044] To make the objectives, technical solutions, and advantages of the embodiments of this application clearer, the technical solutions of the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of this application, and not all embodiments. Based on the embodiments of this application, all other embodiments obtained by those of ordinary skill in the art without creative effort are within the scope of protection of this application.

[0045] Please refer to Figure 1 , Figure 1 A flowchart illustrating a data transmission method provided in an embodiment of this application. The method may include:

[0046] S100, obtain the first time threshold; wherein, the first time threshold is less than the network latency time.

[0047] This embodiment does not limit the specific first time threshold, as long as the time for data retransmission using the first time threshold is lower than the network latency. For example, when the network latency is 40 milliseconds, the first time threshold can be 10 milliseconds; or when the network latency is 40 milliseconds, the first time threshold can be 12 milliseconds; or when the network latency is 100 milliseconds, the first time threshold can be 20 milliseconds; or when the network latency is 60 milliseconds, the first time threshold can be 21 milliseconds. It is understood that the network latency in this embodiment refers to the round-trip time of a data packet from the user's computer to the website server and then immediately back from the website server to the user's computer. In simpler terms, network latency refers to the time it takes for data to travel from one computer to another, equivalent to the time from the sender to the receiver. It is understood that when the network conditions are excellent, the network latency is extremely short, and there is almost no network latency, the first time threshold can be equal to the network latency to ensure efficient data retransmission. For example, when the network latency is 60 milliseconds, the first time threshold is set to 59 milliseconds, meaning that retransmission occurs at the 59th millisecond. In this case, although the retransmission is received, it has already timed out, resulting in data packet loss.

[0048] S101, obtain the data transmission time corresponding to the target data packet, and determine the waiting time based on the data transmission time.

[0049] This embodiment obtains the data transmission time corresponding to the target data packet and determines the waiting time based on the data transmission time. It can be understood that when sending the target data packet, the timestamp of the frame sequence number in the data packet can be recorded, and the waiting time can be determined based on the timestamp and the current time.

[0050] Furthermore, to improve the timeliness of retransmission, after obtaining the data transmission time corresponding to the target data packet and determining the waiting time based on the data transmission time, the process may further include:

[0051] Obtain the highest time threshold;

[0052] When the waiting time exceeds the maximum time threshold, determine to stop retransmission.

[0053] This embodiment obtains a maximum time threshold, which determines when to stop data retransmission. This embodiment does not limit the specific maximum time threshold. For example, the maximum time threshold could be 100 milliseconds; or it could be 110 milliseconds; or it could be 150 milliseconds. It is understood that when comparing the first time threshold with the current waiting time, the current waiting time can be compared with the maximum time threshold. When the waiting time exceeds the maximum time threshold, it is determined to stop retransmission. It should be noted that the maximum time threshold is related to the timeout of diagnostic software. That is, it is related to the maximum timeout time of most diagnostic software in the customer group, and can diagnose the timeout time of the software.

[0054] Furthermore, in order to send the target data packet to the receiving end as quickly as possible, after determining to stop retransmission when the waiting time exceeds the maximum time threshold, the following may also be included:

[0055] Rebuild the data transmission link.

[0056] In this embodiment, determining to stop retransmission indicates that the target data packet has been lost, and the data transmission link needs to be rebuilt. It is understood that when packet loss occurs, rebuilding the link can reduce packet loss caused by data transmission link issues, thereby improving communication quality.

[0057] S102, when the waiting time exceeds the first time threshold, determine to retransmit the data.

[0058] This embodiment determines to retransmit data when the waiting time exceeds a first time threshold. It is understood that during the retransmission process, the waiting time can be determined in real time, and the relationship between the waiting time and the first time threshold can be compared. When the waiting time exceeds the first time threshold and no response message is received, data retransmission is determined. This embodiment does not limit the specific operations performed after determining to retransmit data. For example, a second time threshold can be set during data retransmission so that data retransmission is based on this second time threshold. The specific value of the second time threshold is not limited, as long as it is less than the network timeout period. For example, the second time threshold can be equal to or greater than the first time threshold. It is understood that, generally, the second time threshold should be set higher than the first time threshold to prevent excessive retransmission frequency, reduce the number of retransmissions, and improve data retransmission efficiency.

[0059] Furthermore, to improve data transmission efficiency, when data retransmission is determined, the following steps are taken:

[0060] Determine the sliding window size corresponding to the first time threshold;

[0061] Adjust the current transmission rate according to the size of the sliding window to obtain the target transmission rate;

[0062] Data retransmission is performed based on the target transmission rate.

[0063] Understandably, when this implementation determines that data retransmission is required, it invokes a protocol in computer memory to adjust the timeout for automatic retransmission requests based on the UDP (User Datagram Protocol) protocol. In actual operation, data transmission is performed based on the adjusted timeout, and then the unacknowledged data packets in the UDP packet are calculated to obtain the current data throughput. Finally, the window size of the sliding window is adjusted based on this data throughput. This application improves the smoothness of data transmission by adjusting the transmission rate.

[0064] It should be noted that the sliding window size is determined based on the adjusted timeout period; the data transmission rate is then adjusted according to this sliding window size to ensure data transmission is performed at the adjusted rate. This method adjusts the data transmission speed by redetermining the sliding window size through adjusting the automatic retransmission timeout, thereby improving the transmission speed of existing network data.

[0065] Furthermore, to ensure the efficiency of data retransmission, after confirming that data retransmission is to be performed, the following may also be included:

[0066] Determine if the system has sufficient available resources;

[0067] When system resources are sufficient, the target data is not segmented and retransmitted.

[0068] When system resources are insufficient, the target data is retransmitted in segments.

[0069] This embodiment determines whether the system has sufficient available resources when confirming data retransmission. If system resources are sufficient, the target data is not retransmitted in segments; if system resources are insufficient, the target data is retransmitted in segments. It is understood that the need for data retransmission indicates a long network latency, therefore, retransmitting the data in segments reduces the average transmission latency of the target data packet.

[0070] The data transmission method provided in this application includes: obtaining a first time threshold; wherein the first time threshold is less than the network latency; obtaining the data transmission time corresponding to the target data packet, and determining a waiting time based on the data transmission time; and determining to retransmit data when the waiting time exceeds the first time threshold. It is evident that data transmission currently relies primarily on received acknowledgment characters for retransmission. However, due to network latency, timely data transmission is impossible when receiving acknowledgment characters. This application sets a first time threshold less than the network latency, thereby determining whether to retransmit based on the first time threshold and the transmission time. Since the first time threshold is less than the network latency, timely data retransmission is ensured when retransmitting based on the first time threshold, improving data transmission efficiency. Furthermore, setting a maximum time threshold prevents continuous data retransmission, reducing system energy consumption; rebuilding the data transmission link improves data transmission quality; adjusting data transmission efficiency improves the efficiency of target data packet transmission; and segmented retransmission reduces average transmission latency.

[0071] To make this application easier to understand, please refer to the following: Figure 2 , Figure 2 A flowchart of another data transmission method provided in the embodiments of this application may specifically include:

[0072] S200, obtain the first time threshold; wherein, the first time threshold is less than the network latency time.

[0073] This embodiment does not limit the execution subject. For example, the execution subject in this embodiment can be a client; or the execution subject in this embodiment can be a server. In this embodiment, the first time threshold is less than the network latency time, which ensures that when data is retransmitted according to the first time threshold, it can be lower than the network latency time, thereby improving the efficiency of data retransmission. It is understood that the first time threshold should not be set too small, as this will result in too many retransmissions and data packet loss. When the network condition is excellent, there is almost no network latency, and in this case, the first time threshold can be equal to the network latency time.

[0074] S201, obtain the data transmission time corresponding to the target data packet, and determine the waiting time based on the data transmission time.

[0075] This embodiment determines the data transmission time corresponding to the target data packet, i.e., the timestamp, and then determines the waiting time based on the data transmission time.

[0076] S202, when the waiting time exceeds the first time threshold, determine to retransmit the data.

[0077] In this embodiment, data retransmission is initiated when the waiting time exceeds a first time threshold. It is understandable that automotive diagnostics have very high latency requirements; to address diagnostic failures caused by timeouts and reduce network latency, UDP direct connection communication is often used. User Datagram Protocol (UDP) is a connectionless and unreliable protocol. Packet loss and retransmission are inevitable during transmission. To address this, existing methods refer to TCP (Transmission Control Protocol), where each data frame has a sequence number. Upon receiving data, the receiver compares it; if it's duplicate data, it discards it; if it's consecutive data, it sends an ACK (Acknowledgement) packet, which includes consecutive sequence numbers. Retransmission mechanisms include fast retransmission, timeout retransmission, and retransmission after receiving a packet loss message from the receiver. The resynchronization mechanism involves the sender sending a resynchronization message after packet loss and detection of data deletion. The receiver acknowledges upon receipt, and the sender resumes communication after receiving the synchronization acknowledgment.

[0078] S203, obtain a second time threshold to retransmit data again based on the second time threshold; wherein the second time threshold is greater than the first time threshold and less than the network delay time.

[0079] The first time threshold in this embodiment is the time threshold for the second retransmission. This embodiment does not limit the specific operations performed after obtaining the second time threshold. For example, three retransmissions can be performed, followed by a fourth retransmission; or retransmission can be stopped after the second retransmission fails. It should be noted that, in the case of almost no network latency, the second time threshold can be equal to the network latency time.

[0080] To facilitate understanding of the specific shortcomings of current retransmission mechanisms, and the advantages of this application compared to existing technologies, this embodiment uses a network latency of 40 milliseconds as an example (40 milliseconds is the time from the sending end to receiving the acknowledgment from the receiving end). The communication is illustrated using C (client) as the sending end and B (server) as the receiving end. First, fast retransmission: For example, C sends five frames of data (frames 1, 2, 3, 4, and 5) at 10-millisecond intervals. The transmission times for these five frames are 0 milliseconds, 10 milliseconds, 20 milliseconds, 30 milliseconds, and 40 milliseconds, respectively. However, 2... When frame 1 is lost, B receives it in 20 milliseconds and responds with ACK2. When frame 2 is lost, B receives it in 40 milliseconds and still responds with ACK2. The same process applies to frames 4 and 5. When frame 5 responds with ACK2, it takes 60 milliseconds, for a total of 20 milliseconds. ACK5 is then sent to C. C receives the same ACK (ACK2) three times. At 80 milliseconds, frame 2 is retransmitted, and then it arrives at B 20 milliseconds later. This means B receives frame 2 at 100 milliseconds, with the total time taken being 100 - 10, or 90 milliseconds. Diagnostic instruments typically have a 55-millisecond timeout, resulting in a 90-millisecond delay, which causes a diagnostic timeout. Secondly, there's the issue of timeout retransmission: For example, if C sends frame 1 and it's lost, C times out without receiving an ACK and retransmits. The timeout calculated by C is based on network latency, for example, 1.5 times the network latency. The first method involves a 60-millisecond timeout, meaning a retransmission occurs at 60 milliseconds. The data arrives at end B in 80 milliseconds, resulting in a delay of 80 milliseconds. The second method involves frame loss retransmission: For example, end C sends five frames of data (frames 1, 2, 3, 4, and 5) at 10-millisecond intervals. However, if the second frame is lost, end B will only detect the frame loss when it receives frame 3 (40 milliseconds). Then, a timeout is set. If frame 2 is not received within the timeout period (assuming a 10-millisecond timeout), a frame loss notification is issued (50 milliseconds). End C then receives the frame loss acknowledgment (70 milliseconds) and retransmits frame 2. End B receives frame 20 milliseconds later (90 milliseconds), resulting in a delay of 90-10, or 80 milliseconds.

[0081] The retransmission mechanism of the data transmission method provided in this application does not use network latency as the basis for data transmission timeout, but rather a fixed timeout value (first time threshold), which is 10, 20, 40, and 80 milliseconds respectively, meaning the waiting time doubles each time (one embodiment, not representing a specific implementation). For example, in the extreme case where the C-end sends one lost frame and does not receive an ACK response, it will retransmit four times at 10 milliseconds, 30 milliseconds, 70 milliseconds, and 150 milliseconds. In the case of one failure, the B-end can receive the retransmitted data in 30 milliseconds. Even if there are two consecutive packet losses, the retransmitted data can be received in 50 milliseconds (compared to 90 milliseconds in the prior art). As can be seen, this method can quickly retransmit when packets are lost. At the same time, since the data from vehicle diagnostics are all small packets, usually only a few tens of bytes, even in the extreme case, a single packet will only be retransmitted four times, which will not cause a large network burden. The retransmission speed is much faster than existing methods, which has a significant advantage. This application addresses the resynchronization mechanism (if frames are indeed lost). Existing methods involve the server (B) detecting frame loss and notifying the client (C). The client (C) detects the lost frames have been cleared and cannot be retransmitted, sending a resynchronization message to the server (B). The server (B) responds, the client (C) receives the response, defines new frame sequence numbers, specifies where to re-initialize the sequence numbers, and resumes transmission (based on frame sequence numbers, existing methods use interactive resynchronization). As the above process shows, existing methods stop data transmission during resynchronization. A complete interaction from client (C) to server (B) and back to client (C) is required for recovery, which is time-consuming. If frame loss occurs again during synchronization, the time will be even longer. This can lead to subsequent data timeouts, being discarded by the client (C), and requiring resynchronization. In extreme cases, this can create a vicious cycle of continuous synchronization. This method eliminates the need for a separate resynchronization process, using the client (B)'s ACK response for resynchronization. For example, client (C) sends 1, 2, 3, 4, 5, 6, 7, and client (B) receives 1, 3, 5, 6, 7. B detects the loss of frame 2 and requests a retransmission. If frame 2 is still missing after 150 milliseconds, synchronization begins. The next consecutive frame is found, and frames 5, 6, and 7 are sent to the MCU (Microcontroller Unit). An ACK for frame 7 is sent back to C. Upon receiving the ACK for frame 7, C synchronizes frames 1-7 without retransmission and starts sending from frame 8. As can be seen from the above description, the advantage of this application is that existing methods require resynchronization if frames are lost during synchronization, while this method does not. If B's ​​ACK for frame 7 is lost, C has a retransmission mechanism and will continue sending frames 8 and 9 after receiving subsequent data. B receives the retransmission or ACK for frame 8 and continues to send back an ACK. C, upon receiving this, will not retransmit data before frames 7 or 8, and both parties resynchronize. This process does not affect communication. C does not resynchronize, therefore it does not affect subsequent frames 8 and 9, preventing further delays and timeouts. As can be seen from the above description, this method has significant advantages over existing methods.

[0082] To make this application easier to understand, please refer to the following: Figure 3 , Figure 3 A flowchart of a data retransmission method provided in this application embodiment, the method may include:

[0083] S300, obtain the first time threshold; wherein, the first time threshold is less than the network latency time.

[0084] This embodiment does not limit the specific execution entity; for example, the execution entity can be a client or a server. This embodiment obtains a first time threshold; wherein the first time threshold is less than the network latency time.

[0085] S301, obtain the data transmission time corresponding to the target data packet, and determine the waiting time based on the data transmission time.

[0086] This embodiment calculates the total waiting time based on the data transmission time.

[0087] S302, when the waiting time exceeds the first time threshold, determine to retransmit the data.

[0088] In this embodiment, when the waiting time exceeds a first time threshold, data retransmission is determined.

[0089] S303, Receive the sequence number of the last consecutive frame in the buffer corresponding to the target data packet.

[0090] For ease of understanding, this embodiment uses the sequence number corresponding to the last consecutive frames in the buffer. Taking a client (C) sending a target data packet containing the sequence numbers 1, 2, 3, 4, 5, 6, and 7, and server (B) receiving these, it discovers that frame 2 is missing and requests a retransmission. Upon finding the next consecutive frame, it sends frames 5, 6, and 7 to the MCU and replies with an ACK for frame 7 to client (C). Client (C) receives the ACK for frame 7, and frames 1 through 7 are no longer retransmitted; transmission begins from frame 8. This embodiment reduces redundant data transmission and improves data transmission efficiency by obtaining the sequence number corresponding to the last consecutive frame.

[0091] To make this application easier to understand, please refer to the following: Figure 4 , Figure 4 A flowchart illustrating a data retransmission method provided in this application embodiment is shown. The method may include:

[0092] S400 receives bus data from the vehicle.

[0093] The execution entity in this embodiment is the client.

[0094] S401 determines the frame sequence number packet corresponding to the bus data, sends the data to the server according to the frame sequence number, and records the first timestamp of the data transmission corresponding to each frame sequence number.

[0095] S402, obtain the first timeout threshold and the first response time corresponding to the first timestamp.

[0096] S403: When data corresponding to the current frame number is received within the first timeout threshold, delete the data frame.

[0097] S404, when the first response time is greater than the first time threshold and no data corresponding to the current frame sequence number is received, obtain the second time threshold, record the second timestamp, and determine the second response time based on the second timestamp.

[0098] In this embodiment, if no response is received within the first time threshold, a second time threshold is obtained, a second timestamp is recorded, and a second response time is determined based on the second timestamp.

[0099] S405: When a data packet corresponding to the current frame sequence number is received within the second time threshold, the data frame is deleted.

[0100] S406, when the second response time is greater than the second time threshold and no data corresponding to the current frame sequence number is received, the highest time threshold is obtained and the third response time corresponding to the highest time threshold is recorded.

[0101] S407: When a data packet corresponding to the current frame number is received within the highest time threshold, the data frame is deleted.

[0102] S408: When the third response time exceeds the maximum time threshold and no data packet corresponding to the current frame sequence number is received, packet loss is confirmed and retransmission is stopped.

[0103] To make this application easier to understand, please refer to the following: Figure 5 , Figure 5 A flowchart illustrating a data frame loss retransmission process provided in this application embodiment may specifically include:

[0104] S500: When the server detects a frame loss, it retrieves the sequence number of the last consecutive frame in the lookup buffer.

[0105] In this embodiment, the execution entity is the server, which acts as the receiving end.

[0106] S501 sends the sequence number to the client.

[0107] S503: The client receives the sequence number and continues data transmission based on that sequence number.

[0108] This embodiment detects lost frames based on frame sequence numbers. If no lost frames are received after exceeding the maximum time threshold, the last consecutive frames in the buffer are searched and sent to the diagnostic tool. In this embodiment, the maximum time threshold can be 150 milliseconds.

[0109] The following describes a data transmission device provided in an embodiment of this application. The data transmission device described below can be referred to in correspondence with the data transmission method described above.

[0110] Please refer to the details. Figure 6 , Figure 6 A schematic diagram of a data transmission device provided in this application embodiment may include:

[0111] The first time threshold acquisition module 100 is used to acquire a first time threshold; wherein, the first time threshold is less than the network latency time;

[0112] The waiting time acquisition module 200 is used to acquire the data transmission time corresponding to the target data packet and determine the waiting time based on the data transmission time.

[0113] The data retransmission determination module 300 is used to determine to retransmit data when the waiting time exceeds the first time threshold.

[0114] Furthermore, based on the above embodiments, the data retransmission apparatus may further include:

[0115] The retransmission module based on a second time threshold is used to obtain a second time threshold and retransmit data again based on the second time threshold; wherein the second time threshold is greater than the first time threshold and less than the network latency time.

[0116] Furthermore, based on any of the above embodiments, when it is determined that data retransmission is to be performed, it may include:

[0117] A sliding window size determination unit is used to determine the sliding window size corresponding to the first time threshold.

[0118] A target transmission rate determination unit is used to adjust the current transmission rate according to the size of the sliding window to obtain the target transmission rate;

[0119] The data retransmission unit is used to retransmit data according to the target transmission rate.

[0120] Furthermore, based on any of the above embodiments, the data retransmission apparatus may further include:

[0121] The sequence number determination module is used to receive the sequence number corresponding to the last consecutive frame in the buffer corresponding to the target data packet;

[0122] The data transmission module is used to continue data transmission according to the sequence number.

[0123] Furthermore, based on any of the above embodiments, the data retransmission apparatus may further include:

[0124] The highest time threshold acquisition module is used to acquire the highest time threshold.

[0125] The pause retransmission module is used to determine to stop retransmission when the waiting time exceeds the maximum time threshold.

[0126] Furthermore, based on the above embodiments, the data retransmission apparatus may further include:

[0127] The data transmission link disruption module is used to rebuild the data transmission link.

[0128] Furthermore, based on the above embodiments, the data retransmission apparatus may further include:

[0129] The available resources determination module is used to determine whether the system has sufficient available resources;

[0130] The non-segmented retransmission module is used to avoid segmenting and retransmitting the target data when system resources are sufficient.

[0131] When system resources are insufficient, the segmented retransmission module performs segmented retransmission of the target data.

[0132] It should be noted that the order of the modules and units in the aforementioned data transmission device can be changed without affecting the logic.

[0133] This application provides a data transmission device that may include: a first time threshold acquisition module 100, used to acquire a first time threshold, wherein the first time threshold is less than a network latency time; a waiting time acquisition module 200, used to acquire the data transmission time corresponding to the target data packet and determine a waiting time based on the data transmission time; and a data retransmission determination module 300, used to determine to retransmit data when the waiting time exceeds the first time threshold. It is evident that data retransmission currently relies primarily on received acknowledgment characters. However, due to network latency, timely data transmission is impossible when receiving acknowledgment characters. This application sets a first time threshold less than the network latency time, thereby determining whether to retransmit based on the first time threshold and the transmission time. Since the first time threshold is less than the network latency time, retransmission based on the first time threshold ensures timely data retransmission and improves data transmission efficiency. Furthermore, by setting a maximum time threshold, continuous data retransmission is prevented, reducing system energy consumption; by rebuilding the data transmission link, the quality of data transmission is improved; by adjusting the data transmission efficiency, the efficiency of target data packet transmission is improved; segmented retransmission can be performed to reduce average transmission latency; a second time threshold is set, and retransmission is performed again based on the second time threshold to ensure retransmission efficiency; and by obtaining the sequence number corresponding to the last consecutive frames, duplicate data transmission is reduced, improving data transmission efficiency.

[0134] The following describes a data transmission device provided in an embodiment of this application. The data transmission device described below and the data transmission method described above can be referred to and correspond to each other.

[0135] Please refer to Figure 7 , Figure 7 A schematic diagram of a data transmission device provided in this application embodiment may include:

[0136] Memory 10 is used to store computer programs;

[0137] The processor 20 is used to execute computer programs to implement the data transmission method described above.

[0138] The memory 10, processor 20, and communication interface 30 all communicate with each other through the communication bus 40.

[0139] In this embodiment, the memory 10 is used to store one or more programs. The programs may include program code, which includes computer operation instructions. In this embodiment, the memory 10 may store programs for implementing the following functions:

[0140] Obtain the first time threshold; where the first time threshold is less than the network latency.

[0141] Obtain the data transmission time corresponding to the target data packet, and determine the waiting time based on the data transmission time;

[0142] If the waiting time exceeds the first time threshold, data retransmission will be initiated.

[0143] In one possible implementation, the memory 10 may include a program storage area and a data storage area, wherein the program storage area may store the operating system and applications required for at least one function; and the data storage area may store data created during use.

[0144] Furthermore, memory 10 may include read-only memory and random access memory, providing instructions and data to the processor. A portion of the memory may also include NVRAM. The memory stores operating systems and operating instructions, executable modules, or data structures, or subsets thereof, or extended sets thereof, wherein the operating instructions may include various operating instructions for implementing various operations. The operating system may include various system programs for implementing various basic tasks and handling hardware-based tasks.

[0145] Processor 20 can be a central processing unit (CPU), an application-specific integrated circuit, a digital signal processor, a field-programmable gate array, or other programmable logic device. Processor 20 can be a microprocessor or any conventional processor. Processor 20 can call programs stored in memory 10.

[0146] The communication interface 30 can be an interface for the communication module, used to connect with other devices or systems.

[0147] Of course, it should be noted that, Figure 7 The structure shown does not constitute a limitation on a data transmission device in the embodiments of this application. In practical applications, a data transmission device may include more than Figure 7 More or fewer components as shown, or combinations of certain components.

[0148] The following describes the computer-readable storage medium provided in the embodiments of this application. The computer-readable storage medium described below can be referred to in correspondence with the data transmission method described above.

[0149] This application also provides a computer-readable storage medium storing a computer program, which, when executed by a processor, implements the steps of the data transmission method described above.

[0150] The computer-readable storage medium may include various media capable of storing program code, such as USB flash drives, portable hard drives, read-only memory (ROM), random access memory (RAM), magnetic disks, or optical disks.

[0151] The various embodiments in this specification are described in a progressive manner, with each embodiment focusing on its differences from other embodiments. Similar or identical parts between embodiments can be referred to interchangeably. For the apparatus disclosed in the embodiments, since it corresponds to the method disclosed in the embodiments, the description is relatively simple; relevant parts can be referred to in the method section.

[0152] Those skilled in the art will further recognize that the units and algorithm steps of the various examples described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, computer software, or a combination of both. To clearly illustrate the interchangeability of hardware and software, the components and steps of the various examples have been generally described in terms of functionality in the foregoing description. Whether these functions are implemented in hardware or software depends on the specific application and design constraints of the technical solution. Those skilled in the art can use different methods to implement the described functions for each specific application, but such implementations should not be considered beyond the scope of this application.

[0153] Finally, it should be noted that in this document, relationships such as "first" and "second" are used merely to distinguish one entity or operation from another, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Furthermore, the terms "comprising," "including," or any other variations are intended to cover non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such process, method, article, or apparatus.

[0154] The present application provides a detailed description of a data transmission method, apparatus, device, and computer-readable storage medium. Specific examples have been used to illustrate the principles and implementation methods of the present application. The descriptions of the above embodiments are only for the purpose of helping to understand the method and core ideas of the present application. At the same time, those skilled in the art will recognize that there will be changes in the specific implementation methods and application scope based on the ideas of the present application. Therefore, the content of this specification should not be construed as a limitation of the present application.

Claims

1. A data transmission method, characterized in that, Applications include vehicle diagnostics based on the User Datagram Protocol (UDP), including: Upon receiving bus data from the vehicle, the system determines the frame sequence number packet corresponding to the bus data and sends the data to the server according to the frame sequence number, while recording the data transmission time corresponding to each frame sequence number. Obtain a first time threshold; wherein the first time threshold is less than the network latency time, and the first time threshold is a fixed timeout time threshold not based on network latency. Obtain the data transmission time corresponding to the current frame sequence number in the target data packet, and determine the waiting time based on the data transmission time; When the waiting time exceeds the first time threshold and no data corresponding to the current frame sequence number is received, it is determined that data retransmission will be performed, a second time threshold is obtained, a second timestamp is recorded, and a second response time is determined based on the second timestamp; wherein, during retransmission, the sequence number corresponding to the last consecutive frame in the buffer corresponding to the target data packet is received; data transmission continues according to the sequence number; When a data packet corresponding to the current frame number is received within the second time threshold, the data frame is deleted; wherein the second time threshold is greater than the first time threshold and less than the network delay time; When the second response time is greater than the second time threshold and no data packet corresponding to the current frame sequence number is received, it is determined to retransmit the data again, obtain the highest time threshold, and record the third response time corresponding to the highest time threshold. When a data packet corresponding to the current frame number is received within the maximum time threshold, the data frame is deleted. When the third response time is greater than the highest time threshold and no data packet corresponding to the current frame sequence number is received, packet loss is confirmed, and the sequence number corresponding to the last consecutive frame in the buffer corresponding to the target data packet is received. Data transmission continues according to the sequence number corresponding to the last consecutive frame, and retransmission of data before the sequence number is stopped.

2. The data transmission method according to claim 1, characterized in that, When performing data retransmission, the following are included: Determine the size of the sliding window corresponding to the first time threshold; Adjust the current transmission rate according to the size of the sliding window to obtain the target transmission rate; Data retransmission is performed according to the target transmission rate.

3. The data transmission method according to claim 1, characterized in that, After determining to stop retransmission when the waiting time exceeds the maximum time threshold, the method further includes: Rebuild the data transmission link.

4. The data transmission method according to claim 1, characterized in that, After confirming data retransmission, the following is also included: Determine if the system has sufficient available resources; When system resources are sufficient, the target data will not be retransmitted in segments; When system resources are insufficient, the target data is retransmitted in segments.

5. A data transmission device, characterized in that, The data transmission method according to any one of claims 1 to 3 includes: The first time threshold acquisition module is used to acquire a first time threshold; wherein, the first time threshold is less than the network latency time; The waiting time acquisition module is used to acquire the data transmission time corresponding to the target data packet and determine the waiting time based on the data transmission time. The data retransmission determination module is used to determine to retransmit data when the waiting time exceeds the first time threshold.

6. A data transmission device, characterized in that, include: Memory, used to store computer programs; A processor for implementing the data transmission method as described in any one of claims 1 to 4 when executing the computer program.

7. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores computer-executable instructions, which, when loaded and executed by a processor, implement the data transmission method as described in any one of claims 1 to 4.

Citation Information

Patent Citations

  • Data processing method, device and equipment and storage medium

    CN112583529A

  • Retransmission control method, communication interface and electronic equipment

    CN115396067A

  • Data transmission method and computing apparatus having data transmission function

    US20170346601A1