Data transmission method, device and equipment, medium and vehicle
By using the double cache mechanism on the sending side, the data packets and index information are cached separately, and the problem of out-of-order reordering caused by packet loss during data transmission on the receiving side is solved, and the effect of saving storage resources and improving data transmission efficiency is achieved. .
Patent Information
- Application Number
- CN202310960401.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2023-08-01
- Publication Date
- 2025-02-14
AI Technical Summary
In the prior art, packet loss caused by network fluctuations during data transmission, a retransmission mechanism is required, which leads to the receiving end to open up independent cache space for data packet re-arrangement in an out-of-order manner, resulting in wasting storage resources.
By using a double cache mechanism on the sending end, the data packets are cached separately from the index information, and the data buffer area and the information buffer area are used to determine the unreceived data packets and retransmit them to avoid unsequential reordering processing on the receiving end.
It realizes that when the receiver does not need to use cache processing, adjust the retransmission method, avoid the out-of-order re-order process, save storage resources, and improve data transmission efficiency.
Smart Images

Figure CN119449239A_ABST
Abstract
Description
Technical Field
[0001] The present application belongs to the field of data processing technology, and in particular, relates to a data transmission method, device, equipment, medium and vehicle. Background Art
[0002] When data is transmitted between the sender and the receiver, packet loss often occurs due to network fluctuations, so a retransmission mechanism needs to be set up to retransmit the lost data packets.
[0003] At present, the existing retransmission mechanisms mainly include timeout retransmission and fast retransmission. Usually, in the existing retransmission mechanism, the sender will only retransmit the lost data packets in order to save time. In order to be compatible with the above two retransmission methods, even if the receiver receives subsequent data packets, it needs to wait for the lost data packets to be received before rearranging the data packets and then transmitting them to the backend. In this way, the receiver needs to open up an independent cache space to cache the out-of-order data packets in order to rearrange the out-of-order data packets, which leads to a waste of storage resources. Summary of the invention
[0004] The purpose of the embodiments of the present application is to provide a data transmission method, device, equipment, medium and vehicle that can save storage resources.
[0005] In a first aspect, an embodiment of the present application provides a data transmission method, the method comprising:
[0006] When a first data packet to be sent is obtained, storing the first data packet in the data buffer area;
[0007] Sending the first data packet to the receiving end, and storing first index information corresponding to the first data packet in a first information buffer area, where the first information buffer area is used to store index information corresponding to the sent data packet in the data buffer area;
[0008] receiving feedback information sent by the receiving end;
[0009] When it is determined by the feedback information that the receiving end has not received the first data packet, acquiring the first index information and at least one target index information stored after the first index information from the first information buffer area;
[0010] The first data packet corresponding to the first index information and at least one target data packet corresponding to the at least one target index information are determined from the data buffer area, and the first data packet and the at least one target data packet are resent to the receiving end in sequence.
[0011] In a second aspect, an embodiment of the present application provides a data transmission method, the method comprising:
[0012] Receive data packets sent by the sender;
[0013] Determining whether the data packet is a desired first data packet;
[0014] In a case where the data packet is not the first data packet, the data packet is discarded, and feedback information including a first identifier corresponding to the first data packet is sent to the sending end.
[0015] In a third aspect, an embodiment of the present application provides a data transmission device, the device comprising:
[0016] A first storage module is used to store the first data packet to be sent in the data buffer area when the first data packet to be sent is acquired;
[0017] A data sending module, used for sending the first data packet to the receiving end, and storing the first index information corresponding to the first data packet in a first information buffer area, wherein the first information buffer area is used for storing the index information corresponding to the sent data packet in the data buffer area;
[0018] An information receiving module, used for receiving feedback information sent by the receiving end;
[0019] an information acquisition module, configured to acquire the first index information and at least one target index information stored after the first index information from the first information buffer area when it is determined by the feedback information that the receiving end has not received the first data packet;
[0020] A data retransmission module is used to determine the first data packet corresponding to the first index information and at least one target data packet corresponding to the at least one target index information from the data buffer area, and resend the first data packet and the at least one target data packet to the receiving end in sequence.
[0021] In a fourth aspect, an embodiment of the present application provides a data transmission device, the device comprising:
[0022] A data receiving module, used for receiving data packets sent by a sending end;
[0023] A data judgment module, used to determine whether the data packet is a required first data packet;
[0024] The first feedback module is used to discard the data packet if the data packet is not the first data packet, and send feedback information including a first identifier corresponding to the first data packet to the sending end.
[0025] In a fifth aspect, an embodiment of the present application provides an electronic device, the electronic device comprising: a processor and a memory storing computer program instructions;
[0026] When the processor executes the computer program instructions, the steps of the data transmission method in any one of the embodiments of the first aspect or the second aspect are implemented.
[0027] In a sixth aspect, an embodiment of the present application provides a computer-readable storage medium, on which computer program instructions are stored, and when the computer program instructions are executed by a processor, the data transmission method provided by any one of the implementations in the first aspect or the second aspect is implemented.
[0028] In a seventh aspect, an embodiment of the present application provides a vehicle, the vehicle at least comprising:
[0029] The data transmission device according to the third aspect or the fourth aspect;
[0030] The electronic device as in the fifth aspect;
[0031] As a computer-readable storage medium in the sixth aspect.
[0032] The data transmission method, device, equipment, medium and vehicle in the embodiments of the present application store the first data packet to be sent in the data buffer area, send the first data packet to the receiving end, and store the first index information corresponding to the first data packet in the first information buffer area. When the feedback information returned by the receiving end determines that the receiving end has not received the first data packet, the first index information and at least one target index information stored after the first index information are obtained from the first information buffer area, and then the first data packet and at least one target data packet are determined from the data buffer area according to the index information, and the first data packet and the subsequent at least one target data packet are sequentially resent to the receiving end. In this way, by using the dual buffering mechanism of the data buffer area and the first information buffer area at the sending end, the data packet and the index information are cached separately, so that the receiving end does not need to use buffer processing, and can avoid the process of disorderly reordering by adjusting the retransmission method, saving storage resources. BRIEF DESCRIPTION OF THE DRAWINGS
[0033] In order to more clearly illustrate the technical solution of the embodiments of the present application, the following is a brief introduction to the drawings required for use in the embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without any creative work.
[0034] Figure 1 is a schematic diagram of data transmission corresponding to a fast retransmission mechanism provided in an embodiment of the present application;
[0035] Figure 2It is a data transmission schematic diagram corresponding to the timeout retransmission mechanism provided in an embodiment of the present application;
[0036] Figure 3 It is a flowchart of a data transmission method provided by an embodiment of the present application;
[0037] Figure 4 is a schematic diagram of the structure of the first information buffer area provided in an embodiment of the present application;
[0038] Figure 5 is a schematic diagram of the structure of the second information buffer area provided in an embodiment of the present application;
[0039] Figure 6 It is a double buffer processing architecture diagram of the sending end provided in an embodiment of the present application;
[0040] Figure 7 It is a flowchart of another data transmission method provided in an embodiment of the present application;
[0041] Figure 8 It is a structural schematic diagram of a data transmission device provided in an embodiment of the present application;
[0042] Fig. 9 is a structural schematic diagram of another data transmission device provided in an embodiment of the present application;
[0043] Fig.10 It is a structural schematic diagram of an electronic device provided in an embodiment of the present application. DETAILED DESCRIPTION
[0044] In order to more clearly understand the above-mentioned objectives, features and advantages of the present disclosure, the scheme of the present disclosure will be further described below. It should be noted that the embodiments of the present disclosure and the features in the embodiments can be combined with each other without conflict.
[0045] In the following description, many specific details are set forth to facilitate a full understanding of the present disclosure, but the present disclosure may also be implemented in other ways different from those described herein; it is obvious that the embodiments in the specification are only part of the embodiments of the present disclosure, rather than all of the embodiments.
[0046] It should be noted that, in this article, relational terms such as "first" and "second" are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Moreover, the term "comprising" or any other variant thereof is intended to cover non-exclusive inclusion, so that a process, method, article or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or device. In the absence of further restrictions, the elements defined by the sentence "comprising a ..." do not exclude the existence of other identical elements in the process, method, article or device including the elements.
[0047] In order to solve the problems of the prior art, the embodiments of the present application provide a data transmission method, device, equipment, medium and vehicle.
[0048] The data transmission method provided in the embodiment of the present application is described in detail below through specific embodiments and their application scenarios in conjunction with the accompanying drawings.
[0049] Figure 1 It is a data transmission diagram corresponding to the fast retransmission mechanism provided in an embodiment of the present application.
[0050] like Figure 1 As shown, in the scenario corresponding to the fast retransmit mechanism, when the sender transmits the data packet seq to the receiver in sequence, the receiver will reply the corresponding acknowledgment packet ack to the sender after receiving the data packet. Figure 3 In the figure, seq1 and seq2 are packets transmitted normally, while seq3 is lost during transmission. When seq4 reaches the receiving end, the ack sequence number of the receiving end’s reply no longer increases, and the received seq4 and the subsequent seq5 and seq6 are discarded without caching to save storage resources and avoid reordering. When the sender receives multiple acks with the same sequence number in succession, such as receiving ack3 three times in a row, the fast retransmission mechanism can be triggered to retransmit ack3 to ack6.
[0051] Figure 2 This is a data transmission diagram corresponding to the timeout retransmission mechanism provided in an embodiment of the present application.
[0052] like Figure 2As shown in the figure, in the scenario corresponding to the timeout retransmission mechanism, if seq1 and seq2 are normally transmitted data packets, and seq3 is lost during the transmission process, when seq4 reaches the receiving end, the ack sequence number of the receiving end's reply will no longer increase, and the received seq4 and the subsequent seq5 and seq6 will be discarded without caching to save storage resources and avoid reordering. When the sender receives ack4 corresponding to seq3 for more than the RTO time, the timeout retransmission mechanism can be triggered to retransmit ack3 to ack6.
[0053] The following first introduces in detail the data transmission method performed by the sending end.
[0054] Figure 3 1 is a flow chart of a data transmission method provided in an embodiment of the present application. The data transmission method can be executed by a sending end.
[0055] like Figure 3 As shown, the data transmission method may specifically include the following steps:
[0056] S310, when a first data packet to be sent is obtained, storing the first data packet in a data buffer area;
[0057] S320, sending a first data packet to a receiving end, and storing first index information corresponding to the first data packet in a first information buffer area, where the first information buffer area is used to store index information corresponding to the sent data packet in the data buffer area;
[0058] S330, receiving feedback information sent by the receiving end;
[0059] S340: when it is determined by the feedback information that the receiving end has not received the first data packet, obtain the first index information and at least one target index information stored after the first index information from the first information buffer area;
[0060] S350, determining a first data packet corresponding to the first index information and at least one target data packet corresponding to at least one target index information from the data cache area, and resending the first data packet and the at least one target data packet to the receiving end in sequence.
[0061] Thus, by storing the first data packet to be sent in the data buffer area, and sending the first data packet to the receiving end, and storing the first index information corresponding to the first data packet in the first information buffer area, when the feedback information returned by the receiving end determines that the receiving end has not received the first data packet, the first index information and at least one target index information stored after the first index information are obtained from the first information buffer area, and then according to these index information, the first data packet and at least one target data packet are determined from the data buffer area, and the first data packet and at least one target data packet thereafter are sequentially resent to the receiving end. In this way, by using the dual buffering mechanism of the data buffer area and the first information buffer area at the sending end, the data packet and the index information are cached separately, so that the receiving end does not need to use buffer processing, and can avoid the process of disorderly reordering by adjusting the retransmission method, thereby saving storage resources.
[0062] The specific implementation methods of the above steps are introduced below.
[0063] In some embodiments, in S310, the first data packet may be any data packet that the transmitting end needs to send to the receiving end. The manner of obtaining the first data packet includes but is not limited to receiving from an upstream data source, or generating by the transmitting end itself. In addition, the data buffer may be a buffer area set in the transmitting end for caching data packets to be sent, wherein the data packets to be sent may include data packets that have been sent and data packets that have not been sent.
[0064] For example, when the upstream data source has data packets to be sent, it can first determine whether there is enough remaining space in the data buffer area according to the data packet length of the data packet. If there is not enough remaining space, the upstream data source is notified that the data to be sent can no longer be received so that the upstream data source can perform data flow control; if there is enough remaining space, the data packets sent by the upstream data source are stored in the data buffer area.
[0065] In some embodiments, in S320, the transmitting end may send the first data packet to the receiving end via the data transmission port. In addition, the transmitting end may also store the first index information corresponding to the sent first data packet in the first information buffer area. The first information buffer area may be used to store the index information corresponding to the sent data packet in the data buffer area, and the index information may specifically include the cache head address of the data packet in the data buffer area, and the data packet length corresponding to the data packet and other information.
[0066] In addition, in addition to storing the index information corresponding to the sent data packet, the first information buffer area may also store the identifier corresponding to the data packet in association, which is not limited here. The identifier corresponding to the data packet may be, for example, a seq number.
[0067] The first information buffer area can be, for example, Figure 4 The data cache vector shown in the figure may store information such as the seq number, cache head address and data packet length corresponding to each sent data packet. In addition, the management of the first information cache area may use a queue management form.
[0068] In some embodiments, in S330, after receiving the first data packet, the receiving end may return corresponding feedback information, which may be a response packet containing an identifier corresponding to the data packet required by the receiving end, such as an ack response packet having a seq sequence number corresponding to the data packet required by the receiving end.
[0069] Exemplarily, if the receiving end receives the required first data packet, it may feed back feedback information including an identifier corresponding to the next data packet after the first data packet to the sending end. For example, if the first data packet is seq3, the feedback information may be ack4. If the receiving end does not receive the required first data packet, it may discard the data packet after receiving other data packets, and feed back feedback information including a first identifier corresponding to the first data packet. For example, if the first data packet is seq3, the feedback information may be ack3.
[0070] In some implementations, in S340 and S350, the transmitting end may determine whether the receiving end has received the first data packet based on feedback information returned by the receiving end.
[0071] Exemplarily, if the feedback information includes a first identifier corresponding to the first data packet, indicating that the receiving end has not received the first data packet, but the receiving end requires the sending end to send the first data packet, the sending end can determine that the receiving end has not received the first data packet.
[0072] When the transmitting end determines that the receiving end has not received the first data packet, the transmitting end may retransmit the first data packet and all data packets sent by the transmitting end in sequence, starting from the first data packet. Specifically, the first index information corresponding to the first data packet that has not been received, and all other index information stored in the first information buffer after the first index information, that is, at least one target index information, are queried from the first information buffer area, and then the first data packet is queried from the data buffer area according to the first index information, and the target data packet is queried from the data buffer area according to the target index information, and the first data packet and the target data packet are retransmitted in sequence, starting from the first data packet.
[0073] In some specific examples, after the sending end sends data packets seq3, seq4 and seq5 to the receiving end in sequence, if it is determined based on the feedback information returned by the receiving end that the receiving end has not received data packet seq3, the cache first address, data packet length and other index information corresponding to seq3 can be queried from the first information cache area according to the seq number corresponding to seq3, as well as the cache first address, data packet length and other index information corresponding to seq4 and seq5 stored after seq3, and then the seq3, seq4 and seq5 data packets can be queried from the data cache area according to the index information corresponding to seq3, seq4 and seq5 respectively, thereby resending the seq3, seq4 and seq5 data packets to the receiving end in sequence.
[0074] In addition, in the prior art, when data is retransmitted at the sending end or other data packets are transmitted, the data sending port will be occupied, and the new data to be sent may not be sent in time, resulting in the entire upstream transmission link being subjected to back pressure.
[0075] In order to solve the above technical problems, in addition to setting up a first information cache area in the sending end, the embodiment of the present application also sets up a second information cache area to manage the index information of the data packet in detail according to whether it has been sent or not, so that while ensuring retransmission, upstream data can continue to be received to avoid back pressure.
[0076] Based on this, in some implementations, the step of sending the first data packet to the receiving end in S320 may specifically include:
[0077] Detecting whether the data transmission port is occupied and whether the second information buffer is empty, wherein the second information buffer is used to store index information corresponding to unsent data packets in the data buffer;
[0078] When the data transmission port is occupied or the second information buffer is not empty, the first index information corresponding to the first data packet is stored in the second information buffer, and when the data transmission port is not occupied, the first index information is obtained from the second information buffer;
[0079] A first data packet corresponding to the first index information is determined from the data buffer area, and the first data packet is sent to the receiving end via the data sending port.
[0080] Here, the situation where the data transmission port is occupied may include the situation where the transmitting end is in a retransmission state, and may also include the situation where other unsent data packets are being sent, which is not limited here. Among them, the situation where the transmitting end is in a retransmission state can be determined according to the state of the retransmission flag. For example, when the retransmission flag is pulled high, it can be determined that the transmitting end is in a retransmission state, and when the retransmission flag is pulled low, it can be determined that the transmitting end is not in a retransmission state. Specifically, when the transmitting end triggers the retransmission mechanism, the retransmission flag can be pulled high, and after all data that need to be retransmitted are retransmitted, the retransmission flag can be pulled low.
[0081] In addition, the second information buffer area can be, for example, Figure 5 The data cache vector shown in the figure may store index information such as the cache head address and data packet length corresponding to each unsent data packet in the data cache area. In addition, the management of the second information cache area may use a queue management form.
[0082] Exemplarily, after storing the first data packet in the data cache area, it can be detected whether the current data sending port is occupied and whether the second information cache area is empty. If the data sending port is occupied, for example, the sending end is in a retransmission state, or the second information cache area is not empty, that is, there are unsent data packets before the first data packet, then the first index information corresponding to the first data packet can be stored in the second information cache area, and when the data sending port is unoccupied, the index information corresponding to the unsent data packets can be obtained from the second information cache area in real time, and the data packets cached in the data cache area corresponding to these index information can be sent until the second information cache area is empty.
[0083] In addition, in some implementations, after the above-mentioned step of detecting whether the data transmission port is occupied and whether the second information buffer area is empty, the data transmission method provided in the embodiment of the present application may further include:
[0084] When the data transmission port is not occupied and the second information buffer is empty, the first data packet is sent to the receiving end via the data transmission port.
[0085] Exemplarily, if the data sending port is not occupied, for example, the sending end is not in a retransmission state, or the second information buffer is empty, that is, there is no unsent data packet before the first data packet, then the first data packet can be sent directly via the data sending port without caching the first index information through the second information buffer.
[0086] In some specific examples, such as Figure 6 The figure shows a double buffer processing architecture diagram of the sending end, which may include an upstream data processing unit 61 , a data buffer area 62 , a first information buffer area 63 , a second information buffer area 64 and a data sending unit 65 .
[0087] For example, when the upstream data processing unit 61 has a data packet to be sent, it queries whether there is enough remaining space in the data buffer area 62 according to the data packet length of the current data packet to be sent. When there is not enough remaining space, the upstream data processing unit 61 is notified to perform flow control on the data packet to be sent. When there is enough remaining space, the data packet to be sent is cached in the data buffer area 62. The sending end determines whether it is in the retransmission state and whether the second information buffer area 64 is empty. When it is in the retransmission state or the second information buffer area 64 is not empty, the cache first address and data packet length of the data packet are stored in the second information buffer area 64. Otherwise, the data packet is sent to the data sending unit 65 so that the data sending unit 65 sends the data packet. For the index information stored in the second information buffer area 64, as long as the second information buffer area 64 is not empty, the data packet corresponding to the index information in the second information buffer area 64 is attempted to be sent to the data sending unit 65, and when the sending end is not in the retransmission state, the data sending unit 65 sends the data packets corresponding to these index information. When the data transmission unit 65 sends a data packet, the seq number, cache first address, data packet length and other information corresponding to the data packet can be stored in the first information buffer area 63. Only when the transmitting end receives the corresponding response packet of the data packet, the information cached in the first information buffer area 63 corresponding to the data packet and the data packet cached in the data buffer area 62 will be cleared. When the data is retransmitted, only the relevant information of the cached data packet is read out and the corresponding data packet is resent, without clearing the cached information or data packet.
[0088] In this way, by using a double buffer mechanism at the sending end, data storage and data information storage are processed separately, and the index information of the data packet is managed in detail according to whether it has been sent or not. The upstream data packet can continue to be received while retransmitting, which greatly improves the data transmission efficiency, thereby improving the overall end-to-end link delay and reducing the chance of back pressure.
[0089] In addition, when determining whether the receiving end has received the first data packet, in some implementations, since the feedback information may include an identifier corresponding to the data packet required by the receiving end, the above S540 determines that the receiving end has not received the first data packet based on the feedback information, which may specifically include:
[0090] In a case where the feedback information is first feedback information including a first identifier, determining a number of times the first feedback information is received, wherein the first identifier is an identifier corresponding to the first data packet;
[0091] When the number of times is less than a preset threshold, the number of times the first feedback information is received is cumulatively increased;
[0092] When the number of times is not less than a preset threshold, it is determined that the receiving end has not received the first data packet.
[0093] Here, the preset threshold may be, for example, 3, and may be set according to actual needs.
[0094] Exemplarily, in one case, if the feedback information received by the transmitting end is the first feedback information including the first identifier corresponding to the first data packet, for example, when the first data packet is seq3, if the received feedback information is ack3, the number of times ack3 is received can be further determined, and when the number is not less than a preset threshold, it is determined that the receiving end has not received the first data packet. If the number is less than the preset threshold, the number of times ack3 is received can be accumulated by 1.
[0095] In addition, after the above S530, the data transmission method provided in the embodiment of the present application may further include:
[0096] When the feedback information is second feedback information including a second identifier, the first index information stored in the first information cache and the first data packet stored in the data cache are deleted, wherein the second identifier is an identifier corresponding to a second data packet sent after the first data packet.
[0097] Exemplarily, in another case, if the feedback information received by the sending end is second feedback information including a second identifier corresponding to a second data packet, for example, when the first data packet is seq3, if the received feedback information is ack4, it means that the receiving end has received the first data packet and needs the second data packet, that is, seq4, at this time, the sending end can delete the first index information corresponding to the first data packet stored in the first information cache area, as well as the first data packet stored in the data cache area.
[0098] In addition, when at least one third data packet is sent between the first data packet and the second data packet, the data transmission method provided in the embodiment of the present application may further include:
[0099] At least one third index information corresponding to at least one third data packet stored in the first information buffer area and at least one third data packet stored in the data buffer area are deleted.
[0100] For example, in another case, if the feedback information received by the transmitting end is the second feedback information including the second identifier corresponding to the second data packet, and at least one other data packet is sent between the first data packet and the second data packet, for example, the first data packet is seq3, and the third data packet seq4 is sent to the receiving end between seq3 and the second data packet seq5, if the received feedback information is ack5, it means that the receiving end has received the first data packet seq3 and the third data packet seq4, but may have lost the acknowledgment packet ack4 corresponding to the first data packet seq3. Therefore, it is only necessary to continue to send the second data packet seq5. At this time, in addition to deleting the first index information corresponding to the first data packet stored in the first information buffer area and the first data packet stored in the data buffer area, the transmitting end also needs to delete the third index information corresponding to the third data packet stored in the first information buffer area and the third data packet stored in the data buffer area. Of course, the number of the third data packet can be multiple, and the specific processing process is the same as the above process. For the sake of simplicity, it is not repeated here.
[0101] In summary, in some specific examples, when the sending end receives the feedback information returned by the receiving end, the feedback information can be parsed to determine whether it corresponds to the data packet identifier corresponding to the header index information in the first information buffer area, that is, ack-1==seq. If ack-1==seq, it means that the seq data packet has been successfully received by the receiving end, then the header index information is pushed out from the first information buffer area, and the cache space corresponding to the seq data packet in the data buffer area is released; if ack-1>seq, it means that an ack response packet is lost, but the receiving end has received the corresponding seq data packet, then the index information corresponding to all seq data packets in the first information buffer area that meet the seq<ack condition is continuously pushed out, and the cache space corresponding to these seq data packets in the data buffer area is continuously released during the pushing process; if ack==seq, it means that the seq data packet is lost, then the current ack information is recorded, and when the condition is matched three times, the retransmission mechanism is triggered, and the retransmission state is entered, and the data packets corresponding to the index information stored in the current first information cache space are retransmitted in sequence.
[0102] The above is an introduction to the data transmission method performed by the sending end. The following is a detailed introduction to the data transmission method performed by the receiving end.
[0103] Figure 7 FIG. 1 is a flow chart of another data transmission method provided in an embodiment of the present application. The data transmission method can be executed by a receiving end.
[0104] like Figure 7 As shown, the data transmission method may specifically include the following steps:
[0105] S710, receiving a data packet sent by a transmitting end;
[0106] S720, determining whether the data packet is the required first data packet;
[0107] S730: If the data packet is not the first data packet, discard the data packet, and send feedback information including a first identifier corresponding to the first data packet to the sending end.
[0108] Here, the receiving end may first determine the currently required data packet based on the last data packet received. For example, if the last data packet received is seq1, the currently required data packet is seq2; if the last data packet received is seq3, the currently required data packet is seq4.
[0109] Exemplarily, when the data packet currently required by the receiving end is the first data packet, if the received data packet is not the first data packet, the currently received data packet is discarded, and feedback information including the first identifier corresponding to the first data packet is sent to the sending end. The receiving end continues to receive data packets sent by the sending end. If the data packet received is not the first data packet, the received data packet is discarded, and feedback information including the first identifier corresponding to the first data packet is sent to the sending end until the first data packet is received.
[0110] In some implementations, after the above S720, the data transmission method provided in the embodiment of the present application may further include:
[0111] In the case that the data packet is the first data packet, the first data packet is saved, and feedback information including an identifier corresponding to the next required data packet is sent to the sending end.
[0112] In some specific examples, if the data packet currently required by the receiving end is seq3, that is, the last response packet fed back to the sending end is ack3, then if the currently received data packet is seq3, the data packet is saved and a response packet ack4 is sent to the sending end. If the currently received data packet is not seq3, for example, if the received data packet is seq4, the data packet is discarded and a response packet ack3 is sent to the sending end until data packet seq3 is received.
[0113] Thus, the receiving end discards the data packets that are not currently required until the first required data packet is received. In this way, the receiving end always receives the data packets in order, so that the receiving end does not need to use cache processing, and can avoid the process of reordering, saving storage resources.
[0114] It should be noted that the application scenarios described in the above-mentioned embodiments of the present application are intended to more clearly illustrate the technical solutions of the embodiments of the present application, and do not constitute a limitation on the technical solutions provided in the embodiments of the present application. Ordinary technicians in this field can know that with the emergence of new application scenarios, the technical solutions provided in the embodiments of the present application are also applicable to similar technical problems.
[0115] Based on the same inventive concept, the present application also provides a data transmission device. Figure 8 and Fig. 9 Provide detailed explanation.
[0116] Figure 8 1 is a schematic diagram of a data transmission device provided by an embodiment of the present application. The data transmission device can be configured at a transmitting end.
[0117] like Figure 8 As shown, the data transmission device 800 may include:
[0118] A first storage module 801 is used to store the first data packet to be sent in the data buffer area when the first data packet to be sent is acquired;
[0119] The data sending module 802 is used to send the first data packet to the receiving end, and store the first index information corresponding to the first data packet in the first information buffer area, where the first information buffer area is used to store the index information corresponding to the sent data packet in the data buffer area;
[0120] The information receiving module 803 is used to receive feedback information sent by the receiving end;
[0121] An information acquisition module 804 is configured to acquire the first index information and at least one target index information stored after the first index information from the first information buffer area when it is determined by the feedback information that the receiving end has not received the first data packet;
[0122] The data retransmission module 805 is used to determine the first data packet corresponding to the first index information and at least one target data packet corresponding to the at least one target index information from the data buffer area, and resend the first data packet and the at least one target data packet to the receiving end in sequence.
[0123] The data transmission device 800 is described in detail below, as follows:
[0124] In some embodiments, the data sending module 802 may specifically include:
[0125] A detection submodule, used to detect whether the data transmission port is occupied and whether the second information buffer area is empty, wherein the second information buffer area is used to store the index information corresponding to the unsent data packets in the data buffer area;
[0126] a cache submodule, configured to store the first index information corresponding to the first data packet in the second information cache area when the data transmission port is occupied or the second information cache area is not empty, and to obtain the first index information from the second information cache area when the data transmission port is not occupied;
[0127] The first sending submodule is used to determine the first data packet corresponding to the first index information from the data buffer area, and send the first data packet to the receiving end via the data sending port.
[0128] In some embodiments, the data sending module 802 may further include:
[0129] The second sending submodule is used to send the first data packet to the receiving end via the data sending port when the data sending port is not occupied and the second information buffer area is empty after detecting whether the data sending port is occupied and whether the second information buffer area is empty.
[0130] In some embodiments, the feedback information includes an identifier corresponding to the data packet required by the receiving end, and the information acquisition module 804 may specifically include:
[0131] a number determination submodule, configured to determine the number of times the first feedback information is received when the feedback information is first feedback information including a first identifier, wherein the first identifier is an identifier corresponding to the first data packet;
[0132] An accumulation submodule, configured to cumulatively increase the number of times the first feedback information is received when the number is less than a preset threshold;
[0133] The receiving determination submodule is used to determine that the receiving end has not received the first data packet when the number of times is not less than the preset threshold.
[0134] In some embodiments, the data transmission device 800 may further include:
[0135] A first deletion module is used to delete the first index information stored in the first information cache area and the first data packet stored in the data cache area after receiving the data packet confirmation information sent by the receiving end, when the feedback information is second feedback information including a second identifier, wherein the second identifier is an identifier corresponding to a second data packet sent after the first data packet.
[0136] In some embodiments, the data transmission device 800 may further include:
[0137] A second deletion module is used to delete at least one third index information corresponding to the at least one third data packet stored in the first information cache area and the at least one third data packet stored in the data cache area when at least one third data packet is sent between the first data packet and the second data packet.
[0138] Thus, by storing the first data packet to be sent in the data buffer area, and sending the first data packet to the receiving end, and storing the first index information corresponding to the first data packet in the first information buffer area, when the feedback information returned by the receiving end determines that the receiving end has not received the first data packet, the first index information and at least one target index information stored after the first index information are obtained from the first information buffer area, and then according to these index information, the first data packet and at least one target data packet are determined from the data buffer area, and the first data packet and at least one target data packet thereafter are sequentially resent to the receiving end. In this way, by using the dual buffering mechanism of the data buffer area and the first information buffer area at the sending end, the data packet and the index information are cached separately, so that the receiving end does not need to use buffer processing, and can avoid the process of disorderly reordering by adjusting the retransmission method, thereby saving storage resources.
[0139] Fig. 9 1 is a schematic diagram of a data transmission device provided by an embodiment of the present application. The data transmission device can be configured at a transmitting end.
[0140] like Fig. 9 As shown, the data transmission device 900 may include:
[0141] The data receiving module 901 is used to receive data packets sent by the sending end;
[0142] A data determination module 902 is used to determine whether the data packet is a required first data packet;
[0143] The first feedback module 903 is used to discard the data packet if the data packet is not the first data packet, and send feedback information including a first identifier corresponding to the first data packet to the sending end.
[0144] The data transmission device 900 is described in detail below, as follows:
[0145] In some embodiments, the data transmission device 900 may further include:
[0146] The data storage module is used to, after determining whether the data packet is the required first data packet, save the first data packet if the data packet is the first data packet, and send feedback information containing an identifier corresponding to the next required data packet to the sending end.
[0147] Thus, the receiving end discards the data packets that are not currently required until the first required data packet is received. In this way, the receiving end always receives the data packets in order, so that the receiving end does not need to use cache processing, and can avoid the process of reordering, saving storage resources.
[0148] Fig.10 It is a schematic diagram of the structure of an electronic device provided by an embodiment of the present application.
[0149] The electronic device 1000 may include a processor 1001 and a memory 1002 storing computer program instructions.
[0150] Specifically, the processor 1001 may include a central processing unit (CPU), or an application specific integrated circuit (ASIC), or may be configured to implement one or more integrated circuits of the embodiments of the present application.
[0151] The memory 1002 may include a large capacity memory for data or instructions. By way of example and not limitation, the memory 1002 may include a hard disk drive (HDD), a floppy disk drive, a flash memory, an optical disk, a magneto-optical disk, a magnetic tape, or a universal serial bus (USB) drive or a combination of two or more of these. In appropriate cases, the memory 1002 may include a removable or non-removable (or fixed) medium. In appropriate cases, the memory 1002 may be inside or outside the integrated gateway disaster recovery device. In a specific embodiment, the memory 1002 is a non-volatile solid-state memory.
[0152] In certain embodiments, the memory may include a read-only memory (ROM), a random access memory (RAM), a magnetic disk storage medium device, an optical storage medium device, a flash memory device, an electrical, optical or other physical / tangible memory storage device. Thus, typically, the memory includes one or more tangible (non-transitory) computer-readable storage media (e.g., a memory device) encoded with software including computer-executable instructions, and when the software is executed (e.g., by one or more processors), it is operable to perform the operations described with reference to the method according to one aspect of the present application.
[0153] The processor 1001 implements any one of the data transmission methods in the above embodiments by reading and executing computer program instructions stored in the memory 1002 .
[0154] In some examples, the electronic device 1000 may further include a communication interface 1003 and a bus 1010. Fig.10 As shown, the processor 1001, the memory 1002, and the communication interface 1003 are connected via a bus 1010 and communicate with each other.
[0155] The communication interface 1003 is mainly used to implement communication between various modules, devices, units and / or equipment in the embodiments of the present application.
[0156] Bus 1010 includes hardware, software or both, and the components of online data flow billing equipment are coupled to each other. For example, but not limitation, bus 1010 may include accelerated graphics port (AGP) or other graphics bus, enhanced industrial standard architecture (EISA) bus, front-end bus (FSB), hypertransport (HT) interconnection, industrial standard architecture (ISA) bus, infinite bandwidth interconnection, low pin count (LPC) bus, memory bus, micro channel architecture (MCA) bus, peripheral component interconnection (PCI) bus, PCI-Express (PCI-X) bus, serial advanced technology attachment (SATA) bus, video electronics standard association local (VLB) bus or other suitable bus or two or more of these combinations. In appropriate cases, bus 1010 may include one or more buses. Although the present application embodiment describes and shows a specific bus, the present application considers any suitable bus or interconnection.
[0157] Exemplarily, the electronic device 1000 may be a mobile phone, a tablet computer, a laptop computer, a PDA, an in-vehicle electronic device, an ultra-mobile personal computer (UMPC), a netbook, or a personal digital assistant (PDA).
[0158] The electronic device 1000 can execute the data transmission method in the embodiment of the present application, thereby realizing the combination Figures 3 to 9 Described data transmission method and device.
[0159] In addition, in combination with the data transmission method in the above embodiment, the embodiment of the present application may provide a computer-readable storage medium for implementation. The computer-readable storage medium stores computer program instructions; when the computer program instructions are executed by the processor, any one of the data transmission methods in the above embodiment is implemented. Examples of computer-readable storage media include non-transitory computer-readable storage media, such as portable disks, hard disks, random access memories (RAM), read-only memories (ROM), erasable programmable read-only memories (EPROM or flash memory), portable compact disk read-only memories (CD-ROM), optical storage devices, magnetic storage devices, etc.
[0160] The embodiment of the present application also provides a computer program product. When the instructions in the computer program product are executed by a processor of an electronic device, the electronic device executes the data transmission method provided in the embodiment of the present application.
[0161] A vehicle is also provided in an embodiment of the present application. The vehicle may include at least one of a charging device for a power battery, an electronic device, and a computer storage medium. The specific data transmission device, electronic device, and computer storage medium involved are consistent with the above description and will not be repeated here.
[0162] It should be clear that the present application is not limited to the specific configuration and processing described above and shown in the figures. For the sake of simplicity, a detailed description of the known method is omitted here. In the above embodiments, several specific steps are described and shown as examples. However, the method process of the present application is not limited to the specific steps described and shown, and those skilled in the art can make various changes, modifications and additions, or change the order between the steps after understanding the spirit of the present application.
[0163] The functional blocks shown in the above-described block diagram can be implemented as hardware, software, firmware or a combination thereof. When implemented in hardware, it can be, for example, an electronic circuit, an application specific integrated circuit (ASIC), appropriate firmware, a plug-in, a function card, etc. When implemented in software, the elements of the present application are programs or code segments that are used to perform the required tasks. The program or code segment can be stored in a machine-readable medium, or transmitted on a transmission medium or a communication link by a data signal carried in a carrier wave. "Machine-readable medium" can include any medium capable of storing or transmitting information. Examples of machine-readable media include electronic circuits, semiconductor memory devices, ROM, flash memory, erasable ROM (EROM), floppy disks, CD-ROMs, optical disks, hard disks, optical fiber media, radio frequency (RF) links, etc. The code segment can be downloaded via a computer network such as the Internet, an intranet, etc.
[0164] It should also be noted that the exemplary embodiments mentioned in this application describe some methods or systems based on a series of steps or devices. However, this application is not limited to the order of the above steps, that is, the steps can be performed in the order mentioned in the embodiment, or in a different order from the embodiment, or several steps can be performed simultaneously.
[0165] The above reference is according to the method of the embodiment of the present application, the flow chart of the device (system) and the computer program product and / or the block diagram described various aspects of the present application.It should be understood that each square box in the flow chart and / or the block diagram and the combination of each square box in the flow chart and / or the block diagram can be realized by computer program instructions.These computer program instructions can be provided to the processor of a general-purpose computer, a special-purpose computer or other programmable data processing device to produce a machine so that these instructions executed by the processor of the computer or other programmable data processing device enable the realization of the function / action specified in one or more square boxes of the flow chart and / or the block diagram.Such a processor can be but is not limited to a general-purpose processor, a special-purpose processor, a special application processor or a field programmable logic circuit.It can also be understood that each square box in the block diagram and / or the flow chart and the combination of the square boxes in the block diagram and / or the flow chart can also be realized by the dedicated hardware that performs the specified function or action, or can be realized by the combination of dedicated hardware and computer instructions.
[0166] The above is only a specific implementation of the present application. Those skilled in the art can clearly understand that for the convenience and simplicity of description, the specific working processes of the systems, modules and units described above can refer to the corresponding processes in the aforementioned method embodiments, and will not be repeated here. It should be understood that the protection scope of the present application is not limited to this. Any technician familiar with the technical field can easily think of various equivalent modifications or replacements within the technical scope disclosed in this application, and these modifications or replacements should be included in the protection scope of this application.
Claims
1. A data transmission method, characterized in that: include: When a first data packet to be sent is obtained, storing the first data packet in the data buffer area; Sending the first data packet to the receiving end, and storing first index information corresponding to the first data packet in a first information buffer area, where the first information buffer area is used to store index information corresponding to the sent data packet in the data buffer area; receiving feedback information sent by the receiving end; When it is determined by the feedback information that the receiving end has not received the first data packet, acquiring the first index information and at least one target index information stored after the first index information from the first information buffer area; The first data packet corresponding to the first index information and at least one target data packet corresponding to the at least one target index information are determined from the data buffer area, and the first data packet and the at least one target data packet are resent to the receiving end in sequence.
2. The method according to claim 1, characterized in that The sending the first data packet to the receiving end includes: Detecting whether the data transmission port is occupied and whether the second information buffer area is empty, wherein the second information buffer area is used to store index information corresponding to unsent data packets in the data buffer area; When the data transmission port is occupied or the second information buffer area is not empty, the first index information corresponding to the first data packet is stored in the second information buffer area, and when the data transmission port is not occupied, the first index information is obtained from the second information buffer area; The first data packet corresponding to the first index information is determined from the data buffer area, and the first data packet is sent to the receiving end via the data sending port.
3. The method according to claim 2, characterized in that After detecting whether the data transmission port is occupied and whether the second information buffer area is empty, the method further includes: When the data sending port is not occupied and the second information buffer is empty, the first data packet is sent to the receiving end via the data sending port.
4. The method according to claim 1, characterized in that The feedback information includes an identifier corresponding to the data packet required by the receiving end, and determining that the receiving end has not received the first data packet based on the feedback information includes: In a case where the feedback information is first feedback information including a first identifier, determining a number of times the first feedback information is received, wherein the first identifier is an identifier corresponding to the first data packet; When the number of times is less than a preset threshold, cumulatively increase the number of times the first feedback information is received; When the number is not less than the preset threshold, it is determined that the receiving end has not received the first data packet.
5. The method according to claim 1, characterized in that After receiving the data packet confirmation information sent by the receiving end, the method further includes: In a case where the feedback information is second feedback information including a second identifier, the first index information stored in the first information cache area and the first data packet stored in the data cache area are deleted, wherein the second identifier is an identifier corresponding to a second data packet sent after the first data packet.
6. The method according to claim 5, characterized in that In a case where at least one third data packet is sent between the first data packet and the second data packet, the method further includes: At least one third index information corresponding to the at least one third data packet stored in the first information buffer area and the at least one third data packet stored in the data buffer area are deleted.
7. A data transmission method, characterized in that: include: Receive data packets sent by the sender; Determining whether the data packet is a desired first data packet; In a case where the data packet is not the first data packet, the data packet is discarded, and feedback information including a first identifier corresponding to the first data packet is sent to the sending end.
8. The method according to claim 7, characterized in that After determining whether the data packet is the required first data packet, the method further includes: In the case that the data packet is the first data packet, the first data packet is saved, and feedback information including an identifier corresponding to the next required data packet is sent to the sending end.
9. A data transmission device, characterized in that: include: A first storage module is used to store the first data packet to be sent in the data buffer area when the first data packet to be sent is acquired; A data sending module, used for sending the first data packet to the receiving end, and storing the first index information corresponding to the first data packet in a first information buffer area, wherein the first information buffer area is used for storing the index information corresponding to the sent data packet in the data buffer area; An information receiving module, used for receiving feedback information sent by the receiving end; an information acquisition module, configured to acquire the first index information and at least one target index information stored after the first index information from the first information buffer area when it is determined by the feedback information that the receiving end has not received the first data packet; A data retransmission module is used to determine the first data packet corresponding to the first index information and at least one target data packet corresponding to the at least one target index information from the data buffer area, and resend the first data packet and the at least one target data packet to the receiving end in sequence.
10. A data transmission device, characterized in that: include: A data receiving module, used for receiving data packets sent by a sending end; A data judgment module, used to determine whether the data packet is a required first data packet; The first feedback module is used to discard the data packet if the data packet is not the first data packet, and send feedback information including a first identifier corresponding to the first data packet to the sending end.
11. An electronic device, characterized in that: The electronic device comprises: a processor and a memory storing computer program instructions; When the processor executes the computer program instructions, the steps of the data transmission method according to any one of claims 1-6 or 7-8 are implemented.
12. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores computer program instructions, and when the computer program instructions are executed by the processor, the steps of the data transmission method according to any one of claims 1-6 or 7-8 are implemented.
13. A vehicle, characterized in that: Include at least one of the following: The data transmission device according to claim 9 or 10; The electronic device as claimed in claim 11; The computer readable storage medium of claim 12.